diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index b2c26aae1602c..20485606602dd 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -446,9 +446,9 @@ src/platform/packages/shared/kbn-es-errors @elastic/kibana-core src/platform/packages/shared/kbn-es-query @elastic/kibana-data-discovery src/platform/packages/shared/kbn-es-types @elastic/kibana-core @elastic/obs-knowledge-team src/platform/packages/shared/kbn-esql-ast @elastic/kibana-esql +src/platform/packages/shared/kbn-esql-types @elastic/kibana-esql src/platform/packages/shared/kbn-esql-utils @elastic/kibana-esql src/platform/packages/shared/kbn-esql-validation-autocomplete @elastic/kibana-esql -src/platform/packages/shared/kbn-esql-variables-types @elastic/kibana-esql src/platform/packages/shared/kbn-event-annotation-common @elastic/kibana-visualizations src/platform/packages/shared/kbn-event-annotation-components @elastic/kibana-visualizations src/platform/packages/shared/kbn-expect @elastic/kibana-operations @elastic/appex-qa diff --git a/package.json b/package.json index 793a76488191d..1a7260c98c13d 100644 --- a/package.json +++ b/package.json @@ -498,10 +498,10 @@ "@kbn/esql-ast-inspector-plugin": "link:examples/esql_ast_inspector", "@kbn/esql-datagrid": "link:src/platform/plugins/shared/esql_datagrid", "@kbn/esql-editor": "link:src/platform/packages/private/kbn-esql-editor", + "@kbn/esql-types": "link:src/platform/packages/shared/kbn-esql-types", "@kbn/esql-utils": "link:src/platform/packages/shared/kbn-esql-utils", "@kbn/esql-validation-autocomplete": "link:src/platform/packages/shared/kbn-esql-validation-autocomplete", "@kbn/esql-validation-example-plugin": "link:examples/esql_validation_example", - "@kbn/esql-variables-types": "link:src/platform/packages/shared/kbn-esql-variables-types", "@kbn/eui-provider-dev-warning": "link:test/plugin_functional/plugins/eui_provider_dev_warning", "@kbn/event-annotation-common": "link:src/platform/packages/shared/kbn-event-annotation-common", "@kbn/event-annotation-components": "link:src/platform/packages/shared/kbn-event-annotation-components", diff --git a/src/platform/packages/private/kbn-esql-editor/src/esql_editor.tsx b/src/platform/packages/private/kbn-esql-editor/src/esql_editor.tsx index b2e8f29ca428f..b5f075fb2f095 100644 --- a/src/platform/packages/private/kbn-esql-editor/src/esql_editor.tsx +++ b/src/platform/packages/private/kbn-esql-editor/src/esql_editor.tsx @@ -31,11 +31,8 @@ import memoize from 'lodash/memoize'; import React, { memo, useCallback, useEffect, useMemo, useRef, useState } from 'react'; import { createPortal } from 'react-dom'; import { css } from '@emotion/react'; -import { - type ESQLRealField, - ESQLVariableType, - type ESQLControlVariable, -} from '@kbn/esql-validation-autocomplete'; +import { ESQLVariableType, type ESQLControlVariable } from '@kbn/esql-types'; +import { type ESQLRealField } from '@kbn/esql-validation-autocomplete'; import { FieldType } from '@kbn/esql-validation-autocomplete/src/definitions/types'; import { EditorFooter } from './editor_footer'; import { fetchFieldsFromESQL } from './fetch_fields_from_esql'; diff --git a/src/platform/packages/private/kbn-esql-editor/src/types.ts b/src/platform/packages/private/kbn-esql-editor/src/types.ts index 41171606dd7dc..d7974a1d9f0e8 100644 --- a/src/platform/packages/private/kbn-esql-editor/src/types.ts +++ b/src/platform/packages/private/kbn-esql-editor/src/types.ts @@ -17,7 +17,7 @@ import type { UsageCollectionStart } from '@kbn/usage-collection-plugin/public'; import type { Storage } from '@kbn/kibana-utils-plugin/public'; import type { UiActionsStart } from '@kbn/ui-actions-plugin/public'; import type { DataPublicPluginStart } from '@kbn/data-plugin/public'; -import type { ESQLControlVariable } from '@kbn/esql-validation-autocomplete'; +import type { ESQLControlVariable } from '@kbn/esql-types'; export interface ESQLEditorProps { /** The aggregate type query */ diff --git a/src/platform/packages/private/kbn-esql-editor/tsconfig.json b/src/platform/packages/private/kbn-esql-editor/tsconfig.json index 85dda7f030af0..56e1d3fbbcf7b 100644 --- a/src/platform/packages/private/kbn-esql-editor/tsconfig.json +++ b/src/platform/packages/private/kbn-esql-editor/tsconfig.json @@ -33,7 +33,8 @@ "@kbn/content-management-favorites-common", "@kbn/kibana-utils-plugin", "@kbn/ui-actions-plugin", - "@kbn/shared-ux-table-persist" + "@kbn/shared-ux-table-persist", + "@kbn/esql-types" ], "exclude": [ "target/**/*", diff --git a/src/platform/packages/shared/kbn-es-query/src/expressions/types.ts b/src/platform/packages/shared/kbn-es-query/src/expressions/types.ts index 1cb794e8e2c50..8a62bcf54a55e 100644 --- a/src/platform/packages/shared/kbn-es-query/src/expressions/types.ts +++ b/src/platform/packages/shared/kbn-es-query/src/expressions/types.ts @@ -6,7 +6,7 @@ * 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 type { ESQLControlVariable } from '@kbn/esql-validation-autocomplete'; +import type { ESQLControlVariable } from '@kbn/esql-types'; import { Filter, Query, TimeRange } from '../filters'; export interface ExecutionContextSearch { diff --git a/src/platform/packages/shared/kbn-es-query/tsconfig.json b/src/platform/packages/shared/kbn-es-query/tsconfig.json index 6ad761f90dc1f..e032b9531c04f 100644 --- a/src/platform/packages/shared/kbn-es-query/tsconfig.json +++ b/src/platform/packages/shared/kbn-es-query/tsconfig.json @@ -16,7 +16,7 @@ "@kbn/utility-types", "@kbn/i18n", "@kbn/safer-lodash-set", - "@kbn/esql-validation-autocomplete" + "@kbn/esql-types" ], "exclude": [ "target/**/*", diff --git a/src/platform/packages/shared/kbn-esql-types/BUILD.bazel b/src/platform/packages/shared/kbn-esql-types/BUILD.bazel new file mode 100644 index 0000000000000..46c3267d8f0e7 --- /dev/null +++ b/src/platform/packages/shared/kbn-esql-types/BUILD.bazel @@ -0,0 +1,31 @@ +load("@build_bazel_rules_nodejs//:index.bzl", "js_library") + +SRCS = glob( + [ + "**/*.ts", + "**/*functions.json", + ], + exclude = [ + "**/*.config.js", + "**/*.mock.*", + "**/*.test.*", + "**/*.stories.*", + "**/__snapshots__/**", + "**/integration_tests/**", + "**/mocks/**", + "**/scripts/**", + "**/storybook/**", + "**/test_fixtures/**", + "**/test_helpers/**", + ], +) + +SHARED_DEPS = [] + +js_library( + name = "kbn-esql-types", + package_name = "@kbn/esql-types", + srcs = ["package.json"] + SRCS, + deps = SHARED_DEPS, + visibility = ["//visibility:public"], +) diff --git a/src/platform/packages/shared/kbn-esql-types/README.md b/src/platform/packages/shared/kbn-esql-types/README.md new file mode 100644 index 0000000000000..6c4c2d9f76a54 --- /dev/null +++ b/src/platform/packages/shared/kbn-esql-types/README.md @@ -0,0 +1,3 @@ +# @kbn/esql-types + +Gathers types of esql usage across kibana. \ No newline at end of file diff --git a/src/platform/packages/shared/kbn-esql-types/index.ts b/src/platform/packages/shared/kbn-esql-types/index.ts new file mode 100644 index 0000000000000..b236edcaf96f9 --- /dev/null +++ b/src/platform/packages/shared/kbn-esql-types/index.ts @@ -0,0 +1,17 @@ +/* + * 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 { + ESQLVariableType, + type ESQLControlVariable, + type PublishesESQLVariable, + type PublishesESQLVariables, + apiPublishesESQLVariable, + apiPublishesESQLVariables, +} from './src/variables_types'; diff --git a/src/platform/packages/shared/kbn-esql-types/jest.config.js b/src/platform/packages/shared/kbn-esql-types/jest.config.js new file mode 100644 index 0000000000000..303bd483126a9 --- /dev/null +++ b/src/platform/packages/shared/kbn-esql-types/jest.config.js @@ -0,0 +1,14 @@ +/* + * 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". + */ + +module.exports = { + preset: '@kbn/test', + rootDir: '../../../../..', + roots: ['/src/platform/packages/shared/kbn-esql-types'], +}; diff --git a/src/platform/packages/shared/kbn-esql-types/kibana.jsonc b/src/platform/packages/shared/kbn-esql-types/kibana.jsonc new file mode 100644 index 0000000000000..cdf7bfdd871fb --- /dev/null +++ b/src/platform/packages/shared/kbn-esql-types/kibana.jsonc @@ -0,0 +1,9 @@ +{ + "type": "shared-common", + "id": "@kbn/esql-types", + "owner": [ + "@elastic/kibana-esql" + ], + "group": "platform", + "visibility": "shared" +} \ No newline at end of file diff --git a/src/platform/packages/shared/kbn-esql-variables-types/package.json b/src/platform/packages/shared/kbn-esql-types/package.json similarity index 61% rename from src/platform/packages/shared/kbn-esql-variables-types/package.json rename to src/platform/packages/shared/kbn-esql-types/package.json index 743099b750ff3..4b69fd8961876 100644 --- a/src/platform/packages/shared/kbn-esql-variables-types/package.json +++ b/src/platform/packages/shared/kbn-esql-types/package.json @@ -1,7 +1,6 @@ { - "name": "@kbn/esql-variables-types", + "name": "@kbn/esql-types", "private": true, "version": "1.0.0", - "author": "Kibana ES|QL", "license": "Elastic License 2.0 OR AGPL-3.0-only OR SSPL-1.0" } \ No newline at end of file diff --git a/src/platform/packages/shared/kbn-esql-variables-types/index.ts b/src/platform/packages/shared/kbn-esql-types/src/variables_types.ts similarity index 74% rename from src/platform/packages/shared/kbn-esql-variables-types/index.ts rename to src/platform/packages/shared/kbn-esql-types/src/variables_types.ts index 0e2bf9bb12fb3..0395d3dfab453 100644 --- a/src/platform/packages/shared/kbn-esql-variables-types/index.ts +++ b/src/platform/packages/shared/kbn-esql-types/src/variables_types.ts @@ -6,12 +6,23 @@ * 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 type { ESQLControlVariable } from '@kbn/esql-validation-autocomplete'; -import { PublishingSubject } from '@kbn/presentation-publishing'; -/** - * This should all be moved into a package and reorganized into separate files etc - */ +import { BehaviorSubject } from 'rxjs'; + +type PublishingSubject = Omit, 'next'>; + +export enum ESQLVariableType { + TIME_LITERAL = 'time_literal', + FIELDS = 'fields', + VALUES = 'values', + FUNCTIONS = 'functions', +} + +export interface ESQLControlVariable { + key: string; + value: string | number; + type: ESQLVariableType; +} export interface PublishesESQLVariable { esqlVariable$: PublishingSubject; diff --git a/src/platform/packages/shared/kbn-esql-types/tsconfig.json b/src/platform/packages/shared/kbn-esql-types/tsconfig.json new file mode 100644 index 0000000000000..0171c64efb992 --- /dev/null +++ b/src/platform/packages/shared/kbn-esql-types/tsconfig.json @@ -0,0 +1,10 @@ +{ + "extends": "../../../../../tsconfig.base.json", + "compilerOptions": { + "outDir": "target/types" + }, + "include": ["*.ts", "src/**/*", "__mocks__/**/*.ts"], + "kbn_references": [ + ], + "exclude": ["target/**/*"] +} 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 fc7c7fc7d44a4..86d79f1d8a4bc 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 { ESQLVariableType, type ESQLControlVariable } from '@kbn/esql-validation-autocomplete'; +import { ESQLVariableType, type ESQLControlVariable } from '@kbn/esql-types'; import { getIndexPatternFromESQLQuery, getLimitFromESQLQuery, 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 7d9f08b26dce5..ad1b78d7a4b82 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 @@ -15,7 +15,7 @@ import type { ESQLSingleAstItem, ESQLCommandOption, } from '@kbn/esql-ast'; -import type { ESQLControlVariable } from '@kbn/esql-validation-autocomplete'; +import type { ESQLControlVariable } from '@kbn/esql-types'; import type { DatatableColumn } from '@kbn/expressions-plugin/common'; const DEFAULT_ESQL_LIMIT = 1000; diff --git a/src/platform/packages/shared/kbn-esql-utils/src/utils/run_query.test.ts b/src/platform/packages/shared/kbn-esql-utils/src/utils/run_query.test.ts index 9a77606ccdac0..52893fbf56efe 100644 --- a/src/platform/packages/shared/kbn-esql-utils/src/utils/run_query.test.ts +++ b/src/platform/packages/shared/kbn-esql-utils/src/utils/run_query.test.ts @@ -6,7 +6,7 @@ * 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 { ESQLVariableType, type ESQLControlVariable } from '@kbn/esql-validation-autocomplete'; +import { ESQLVariableType, type ESQLControlVariable } from '@kbn/esql-types'; import { getStartEndParams, getNamedParams } from './run_query'; describe('run query helpers', () => { diff --git a/src/platform/packages/shared/kbn-esql-utils/src/utils/run_query.ts b/src/platform/packages/shared/kbn-esql-utils/src/utils/run_query.ts index e9acfc54b4a33..1107d8086167c 100644 --- a/src/platform/packages/shared/kbn-esql-utils/src/utils/run_query.ts +++ b/src/platform/packages/shared/kbn-esql-utils/src/utils/run_query.ts @@ -15,7 +15,8 @@ import type { TimeRange } from '@kbn/es-query'; import { esFieldTypeToKibanaFieldType } from '@kbn/field-types'; import type { ESQLColumn, ESQLSearchResponse, ESQLSearchParams } from '@kbn/es-types'; import { lastValueFrom } from 'rxjs'; -import { type ESQLControlVariable, ESQLVariableType } from '@kbn/esql-validation-autocomplete'; +import { type ESQLControlVariable } from '@kbn/esql-types'; +import { ESQLVariableType } from '@kbn/esql-types'; export const hasStartEndParams = (query: string) => /\?_tstart|\?_tend/i.test(query); diff --git a/src/platform/packages/shared/kbn-esql-utils/tsconfig.json b/src/platform/packages/shared/kbn-esql-utils/tsconfig.json index 3c45073c44be8..0ab50bd5722a5 100644 --- a/src/platform/packages/shared/kbn-esql-utils/tsconfig.json +++ b/src/platform/packages/shared/kbn-esql-utils/tsconfig.json @@ -20,6 +20,7 @@ "@kbn/crypto-browser", "@kbn/data-view-utils", "@kbn/esql-ast", + "@kbn/esql-types", "@kbn/search-types", "@kbn/expressions-plugin", "@kbn/field-types", @@ -27,6 +28,5 @@ "@kbn/i18n", "@kbn/datemath", "@kbn/es-query", - "@kbn/esql-validation-autocomplete" ] } diff --git a/src/platform/packages/shared/kbn-esql-validation-autocomplete/BUILD.bazel b/src/platform/packages/shared/kbn-esql-validation-autocomplete/BUILD.bazel index 429bc5b8aaddd..8bc7a11d15c8d 100644 --- a/src/platform/packages/shared/kbn-esql-validation-autocomplete/BUILD.bazel +++ b/src/platform/packages/shared/kbn-esql-validation-autocomplete/BUILD.bazel @@ -22,6 +22,7 @@ SRCS = glob( SHARED_DEPS = [ "//src/platform/packages/shared/kbn-i18n", + "//src/platform/packages/shared/kbn-esql-types", "@npm//fastest-levenshtein", ] diff --git a/src/platform/packages/shared/kbn-esql-validation-autocomplete/index.ts b/src/platform/packages/shared/kbn-esql-validation-autocomplete/index.ts index 4e0f6b3962ae3..181195b3978cd 100644 --- a/src/platform/packages/shared/kbn-esql-validation-autocomplete/index.ts +++ b/src/platform/packages/shared/kbn-esql-validation-autocomplete/index.ts @@ -8,7 +8,6 @@ */ export type { SuggestionRawDefinition, ItemKind } from './src/autocomplete/types'; -export { ESQLVariableType, type ESQLControlVariable } from './src/shared/types'; export type { CodeAction } from './src/code_actions/types'; export type { FunctionDefinition, diff --git a/src/platform/packages/shared/kbn-esql-validation-autocomplete/src/autocomplete/__tests__/autocomplete.command.stats.test.ts b/src/platform/packages/shared/kbn-esql-validation-autocomplete/src/autocomplete/__tests__/autocomplete.command.stats.test.ts index 64efda15d13e9..5d158eda45e01 100644 --- a/src/platform/packages/shared/kbn-esql-validation-autocomplete/src/autocomplete/__tests__/autocomplete.command.stats.test.ts +++ b/src/platform/packages/shared/kbn-esql-validation-autocomplete/src/autocomplete/__tests__/autocomplete.command.stats.test.ts @@ -6,10 +6,9 @@ * 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 { ESQLVariableType } from '@kbn/esql-types'; import { FieldType, FunctionReturnType } from '../../definitions/types'; import { ESQL_COMMON_NUMERIC_TYPES, ESQL_NUMBER_TYPES } from '../../shared/esql_types'; -import { ESQLVariableType } from '../../shared/types'; import { getDateHistogramCompletionItem } from '../commands/stats/util'; import { allStarConstant } from '../complete_items'; import { roundParameterTypes } from './constants'; diff --git a/src/platform/packages/shared/kbn-esql-validation-autocomplete/src/autocomplete/__tests__/autocomplete.command.where.test.ts b/src/platform/packages/shared/kbn-esql-validation-autocomplete/src/autocomplete/__tests__/autocomplete.command.where.test.ts index da071122d08f6..1fdc6fa2ae769 100644 --- a/src/platform/packages/shared/kbn-esql-validation-autocomplete/src/autocomplete/__tests__/autocomplete.command.where.test.ts +++ b/src/platform/packages/shared/kbn-esql-validation-autocomplete/src/autocomplete/__tests__/autocomplete.command.where.test.ts @@ -6,9 +6,8 @@ * 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 { ESQLVariableType } from '@kbn/esql-types'; import { ESQL_COMMON_NUMERIC_TYPES } from '../../shared/esql_types'; -import { ESQLVariableType } from '../../shared/types'; import { pipeCompleteItem } from '../complete_items'; import { getDateLiterals } from '../factories'; import { log10ParameterTypes, powParameterTypes } from './constants'; diff --git a/src/platform/packages/shared/kbn-esql-validation-autocomplete/src/autocomplete/autocomplete.ts b/src/platform/packages/shared/kbn-esql-validation-autocomplete/src/autocomplete/autocomplete.ts index 68c835d74de5a..f628458f25e47 100644 --- a/src/platform/packages/shared/kbn-esql-validation-autocomplete/src/autocomplete/autocomplete.ts +++ b/src/platform/packages/shared/kbn-esql-validation-autocomplete/src/autocomplete/autocomplete.ts @@ -16,6 +16,7 @@ import { type ESQLFunction, type ESQLSingleAstItem, } from '@kbn/esql-ast'; +import { ESQLVariableType, type ESQLControlVariable } from '@kbn/esql-types'; import { ESQL_NUMBER_TYPES, isNumericType } from '../shared/esql_types'; import type { EditorContext, ItemKind, SuggestionRawDefinition, GetColumnsByTypeFn } from './types'; import { @@ -84,12 +85,7 @@ import { getPolicyHelper, getSourcesHelper, } from '../shared/resources_helpers'; -import type { - ESQLCallbacks, - ESQLSourceResult, - ESQLControlVariable, - ESQLVariableType, -} from '../shared/types'; +import type { ESQLCallbacks, ESQLSourceResult } from '../shared/types'; import { getFunctionsToIgnoreForStats, getQueryForFields, diff --git a/src/platform/packages/shared/kbn-esql-validation-autocomplete/src/autocomplete/commands/stats/index.ts b/src/platform/packages/shared/kbn-esql-validation-autocomplete/src/autocomplete/commands/stats/index.ts index cf9a1888b9461..5fb905629d55b 100644 --- a/src/platform/packages/shared/kbn-esql-validation-autocomplete/src/autocomplete/commands/stats/index.ts +++ b/src/platform/packages/shared/kbn-esql-validation-autocomplete/src/autocomplete/commands/stats/index.ts @@ -6,7 +6,7 @@ * 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 { ESQLVariableType } from '@kbn/esql-types'; import { CommandSuggestParams } from '../../../definitions/types'; import type { SuggestionRawDefinition } from '../../types'; import { @@ -15,7 +15,6 @@ import { getFunctionSuggestions, getControlSuggestionIfSupported, } from '../../factories'; -import { ESQLVariableType } from '../../../shared/types'; import { commaCompleteItem, pipeCompleteItem } from '../../complete_items'; import { pushItUpInTheList } from '../../helper'; import { byCompleteItem, getDateHistogramCompletionItem, getPosition } from './util'; diff --git a/src/platform/packages/shared/kbn-esql-validation-autocomplete/src/autocomplete/factories.ts b/src/platform/packages/shared/kbn-esql-validation-autocomplete/src/autocomplete/factories.ts index 2938757064655..a73d9d646a9bd 100644 --- a/src/platform/packages/shared/kbn-esql-validation-autocomplete/src/autocomplete/factories.ts +++ b/src/platform/packages/shared/kbn-esql-validation-autocomplete/src/autocomplete/factories.ts @@ -9,6 +9,7 @@ import { i18n } from '@kbn/i18n'; import { memoize } from 'lodash'; +import { ESQLVariableType, type ESQLControlVariable } from '@kbn/esql-types'; import { SuggestionRawDefinition } from './types'; import { groupingFunctionDefinitions } from '../definitions/generated/grouping_functions'; import { aggFunctionDefinitions } from '../definitions/generated/aggregation_functions'; @@ -29,7 +30,6 @@ import { ESQLRealField } from '../validation/types'; import { isNumericType } from '../shared/esql_types'; import { getTestFunctions } from '../shared/test_functions'; import { operatorsDefinitions } from '../definitions/all_operators'; -import { ESQLVariableType, ESQLControlVariable } from '../shared/types'; const techPreviewLabel = i18n.translate( 'kbn-esql-validation-autocomplete.esql.autocomplete.techPreviewLabel', diff --git a/src/platform/packages/shared/kbn-esql-validation-autocomplete/src/autocomplete/helper.ts b/src/platform/packages/shared/kbn-esql-validation-autocomplete/src/autocomplete/helper.ts index e635aaa92dc01..8fc421bda3751 100644 --- a/src/platform/packages/shared/kbn-esql-validation-autocomplete/src/autocomplete/helper.ts +++ b/src/platform/packages/shared/kbn-esql-validation-autocomplete/src/autocomplete/helper.ts @@ -16,6 +16,7 @@ import { type ESQLSource, } from '@kbn/esql-ast'; import { uniqBy } from 'lodash'; +import { ESQLVariableType } from '@kbn/esql-types'; import { isParameterType, type FunctionDefinition, @@ -49,7 +50,6 @@ import { EDITOR_MARKER } from '../shared/constants'; import { ESQLRealField, ESQLVariable, ReferenceMaps } from '../validation/types'; import { listCompleteItem } from './complete_items'; import { removeMarkerArgFromArgsList } from '../shared/context'; -import { ESQLVariableType } from '../shared/types'; function extractFunctionArgs(args: ESQLAstItem[]): ESQLFunction[] { return args.flatMap((arg) => (isAssignment(arg) ? arg.args[1] : arg)).filter(isFunctionItem); diff --git a/src/platform/packages/shared/kbn-esql-validation-autocomplete/src/autocomplete/types.ts b/src/platform/packages/shared/kbn-esql-validation-autocomplete/src/autocomplete/types.ts index 7b686cbb56134..cad0ddba0db54 100644 --- a/src/platform/packages/shared/kbn-esql-validation-autocomplete/src/autocomplete/types.ts +++ b/src/platform/packages/shared/kbn-esql-validation-autocomplete/src/autocomplete/types.ts @@ -6,7 +6,7 @@ * 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 type { ESQLVariableType } from '../shared/types'; +import type { ESQLVariableType } from '@kbn/esql-types'; // This is a subset of the Monaco's editor CompletitionItemKind type export type ItemKind = diff --git a/src/platform/packages/shared/kbn-esql-validation-autocomplete/src/definitions/types.ts b/src/platform/packages/shared/kbn-esql-validation-autocomplete/src/definitions/types.ts index a3aa51c696d61..02e9aaf00a81a 100644 --- a/src/platform/packages/shared/kbn-esql-validation-autocomplete/src/definitions/types.ts +++ b/src/platform/packages/shared/kbn-esql-validation-autocomplete/src/definitions/types.ts @@ -6,7 +6,7 @@ * 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 type { ESQLVariableType, ESQLControlVariable } from '@kbn/esql-types'; import type { ESQLAstItem, ESQLCommand, @@ -16,12 +16,7 @@ import type { ESQLSource, } from '@kbn/esql-ast'; import { GetColumnsByTypeFn, SuggestionRawDefinition } from '../autocomplete/types'; -import type { - ESQLCallbacks, - ESQLControlVariable, - ESQLVariableType, - ESQLSourceResult, -} from '../shared/types'; +import type { ESQLCallbacks, ESQLSourceResult } from '../shared/types'; /** * All supported field types in ES|QL. This is all the types diff --git a/src/platform/packages/shared/kbn-esql-validation-autocomplete/src/shared/types.ts b/src/platform/packages/shared/kbn-esql-validation-autocomplete/src/shared/types.ts index d5c1b8ded942e..aafd56ff9c579 100644 --- a/src/platform/packages/shared/kbn-esql-validation-autocomplete/src/shared/types.ts +++ b/src/platform/packages/shared/kbn-esql-validation-autocomplete/src/shared/types.ts @@ -6,6 +6,7 @@ * 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 { ESQLVariableType, type ESQLControlVariable } from '@kbn/esql-types'; import type { ESQLRealField, JoinIndexAutocompleteItem } from '../validation/types'; /** @internal **/ @@ -36,19 +37,6 @@ export interface ESQLSourceResult { type?: string; } -export interface ESQLControlVariable { - key: string; - value: string | number; - type: ESQLVariableType; -} - -export enum ESQLVariableType { - TIME_LITERAL = 'time_literal', - FIELDS = 'fields', - VALUES = 'values', - FUNCTIONS = 'functions', -} - export interface ESQLCallbacks { getSources?: CallbackFn<{}, ESQLSourceResult>; getColumnsFor?: CallbackFn<{ query: string }, ESQLRealField>; diff --git a/src/platform/packages/shared/kbn-esql-validation-autocomplete/tsconfig.json b/src/platform/packages/shared/kbn-esql-validation-autocomplete/tsconfig.json index d262131493eaf..ad51b743a3689 100644 --- a/src/platform/packages/shared/kbn-esql-validation-autocomplete/tsconfig.json +++ b/src/platform/packages/shared/kbn-esql-validation-autocomplete/tsconfig.json @@ -14,7 +14,8 @@ "kbn_references": [ "@kbn/i18n", "@kbn/esql-ast", - "@kbn/utility-types" + "@kbn/utility-types", + "@kbn/esql-types", ], "exclude": [ "target/**/*", diff --git a/src/platform/packages/shared/kbn-esql-variables-types/README.md b/src/platform/packages/shared/kbn-esql-variables-types/README.md deleted file mode 100644 index 681bab7815a07..0000000000000 --- a/src/platform/packages/shared/kbn-esql-variables-types/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# @kbn/esql-variables-types - -This package contains types important for the ES|QL variables. diff --git a/src/platform/packages/shared/kbn-esql-variables-types/kibana.jsonc b/src/platform/packages/shared/kbn-esql-variables-types/kibana.jsonc deleted file mode 100644 index 7bbcf074645c1..0000000000000 --- a/src/platform/packages/shared/kbn-esql-variables-types/kibana.jsonc +++ /dev/null @@ -1,9 +0,0 @@ -{ - "type": "shared-browser", - "id": "@kbn/esql-variables-types", - "owner": [ - "@elastic/kibana-esql", - ], - "group": "platform", - "visibility": "shared" -} \ No newline at end of file diff --git a/src/platform/packages/shared/kbn-esql-variables-types/tsconfig.json b/src/platform/packages/shared/kbn-esql-variables-types/tsconfig.json deleted file mode 100644 index 871403f5170cf..0000000000000 --- a/src/platform/packages/shared/kbn-esql-variables-types/tsconfig.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "extends": "../../../../../tsconfig.base.json", - "compilerOptions": { - "outDir": "target/types", - "types": [ - "jest", - "node" - ] - }, - "include": [ - "**/*.ts", - ], - "exclude": [ - "target/**/*", - ], - "kbn_references": [ - "@kbn/presentation-publishing", - "@kbn/esql-validation-autocomplete", - ] -} diff --git a/src/platform/plugins/shared/controls/public/control_group/get_control_group_factory.tsx b/src/platform/plugins/shared/controls/public/control_group/get_control_group_factory.tsx index fa943d2504c44..ef2c83d39a3e1 100644 --- a/src/platform/plugins/shared/controls/public/control_group/get_control_group_factory.tsx +++ b/src/platform/plugins/shared/controls/public/control_group/get_control_group_factory.tsx @@ -9,8 +9,8 @@ import { DataView } from '@kbn/data-views-plugin/common'; import { ReactEmbeddableFactory } from '@kbn/embeddable-plugin/public'; -import { ESQLControlVariable } from '@kbn/esql-validation-autocomplete'; -import { PublishesESQLVariable, apiPublishesESQLVariable } from '@kbn/esql-variables-types'; +import type { ESQLControlVariable } from '@kbn/esql-types'; +import { PublishesESQLVariable, apiPublishesESQLVariable } from '@kbn/esql-types'; import { i18n } from '@kbn/i18n'; import { apiHasSaveNotification, diff --git a/src/platform/plugins/shared/controls/public/control_group/types.ts b/src/platform/plugins/shared/controls/public/control_group/types.ts index d2c7dafc971d7..477b1fddaa878 100644 --- a/src/platform/plugins/shared/controls/public/control_group/types.ts +++ b/src/platform/plugins/shared/controls/public/control_group/types.ts @@ -10,7 +10,7 @@ import type { Observable } from 'rxjs'; import { DefaultEmbeddableApi } from '@kbn/embeddable-plugin/public'; -import { PublishesESQLVariables } from '@kbn/esql-variables-types'; +import { PublishesESQLVariables } from '@kbn/esql-types'; import { Filter } from '@kbn/es-query'; import { HasSaveNotification, diff --git a/src/platform/plugins/shared/controls/public/controls/esql_control/esql_control_selections.ts b/src/platform/plugins/shared/controls/public/controls/esql_control/esql_control_selections.ts index f30ed60492318..c56857e2f3915 100644 --- a/src/platform/plugins/shared/controls/public/controls/esql_control/esql_control_selections.ts +++ b/src/platform/plugins/shared/controls/public/controls/esql_control/esql_control_selections.ts @@ -8,8 +8,8 @@ */ import deepEqual from 'react-fast-compare'; import { BehaviorSubject, combineLatest } from 'rxjs'; +import { ESQLVariableType, type ESQLControlVariable } from '@kbn/esql-types'; import { PublishingSubject, StateComparators } from '@kbn/presentation-publishing'; -import { ESQLControlVariable, ESQLVariableType } from '@kbn/esql-validation-autocomplete'; import type { ESQLControlState } from '@kbn/esql/public'; export function initializeESQLControlSelections(initialState: ESQLControlState) { diff --git a/src/platform/plugins/shared/controls/public/controls/esql_control/get_esql_control_factory.tsx b/src/platform/plugins/shared/controls/public/controls/esql_control/get_esql_control_factory.tsx index 982b34fc5dd75..f7a599e22cca0 100644 --- a/src/platform/plugins/shared/controls/public/controls/esql_control/get_esql_control_factory.tsx +++ b/src/platform/plugins/shared/controls/public/controls/esql_control/get_esql_control_factory.tsx @@ -12,7 +12,7 @@ import { i18n } from '@kbn/i18n'; import { BehaviorSubject } from 'rxjs'; import { css } from '@emotion/react'; import { EuiComboBox } from '@elastic/eui'; -import { apiPublishesESQLVariables } from '@kbn/esql-variables-types'; +import { apiPublishesESQLVariables } from '@kbn/esql-types'; import { useBatchedPublishingSubjects, apiHasParentApi } from '@kbn/presentation-publishing'; import { tracksOverlays } from '@kbn/presentation-containers'; import type { ESQLControlState } from '@kbn/esql/public'; diff --git a/src/platform/plugins/shared/controls/public/controls/esql_control/types.ts b/src/platform/plugins/shared/controls/public/controls/esql_control/types.ts index fe79a25f6b81e..f2aeeef62fcb9 100644 --- a/src/platform/plugins/shared/controls/public/controls/esql_control/types.ts +++ b/src/platform/plugins/shared/controls/public/controls/esql_control/types.ts @@ -6,7 +6,7 @@ * 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 { PublishesESQLVariable } from '@kbn/esql-variables-types'; +import { PublishesESQLVariable } from '@kbn/esql-types'; import type { HasEditCapabilities, PublishesTitle } from '@kbn/presentation-publishing'; import type { DefaultControlApi } from '../types'; diff --git a/src/platform/plugins/shared/controls/tsconfig.json b/src/platform/plugins/shared/controls/tsconfig.json index 4a3cef45061f8..a6733169ba549 100644 --- a/src/platform/plugins/shared/controls/tsconfig.json +++ b/src/platform/plugins/shared/controls/tsconfig.json @@ -39,9 +39,8 @@ "@kbn/shared-ux-utility", "@kbn/std", "@kbn/react-hooks", - "@kbn/esql-validation-autocomplete", - "@kbn/esql-variables-types", "@kbn/esql", + "@kbn/esql-types", ], "exclude": ["target/**/*"] } diff --git a/src/platform/plugins/shared/dashboard/public/dashboard_api/types.ts b/src/platform/plugins/shared/dashboard/public/dashboard_api/types.ts index 094ebbe62c73b..2e6edcf137ec3 100644 --- a/src/platform/plugins/shared/dashboard/public/dashboard_api/types.ts +++ b/src/platform/plugins/shared/dashboard/public/dashboard_api/types.ts @@ -16,7 +16,7 @@ import { import { RefreshInterval, SearchSessionInfoProvider } from '@kbn/data-plugin/public'; import type { DefaultEmbeddableApi, EmbeddablePackageState } from '@kbn/embeddable-plugin/public'; import { Filter, Query, TimeRange } from '@kbn/es-query'; -import { PublishesESQLVariables } from '@kbn/esql-variables-types'; +import { PublishesESQLVariables } from '@kbn/esql-types'; import { IKbnUrlStateStorage } from '@kbn/kibana-utils-plugin/public'; import { CanExpandPanels, diff --git a/src/platform/plugins/shared/dashboard/public/dashboard_api/unified_search_manager.ts b/src/platform/plugins/shared/dashboard/public/dashboard_api/unified_search_manager.ts index b38ca7b2b175e..92ad14f34b805 100644 --- a/src/platform/plugins/shared/dashboard/public/dashboard_api/unified_search_manager.ts +++ b/src/platform/plugins/shared/dashboard/public/dashboard_api/unified_search_manager.ts @@ -24,7 +24,7 @@ import { compareFilters, isFilterPinned, } from '@kbn/es-query'; -import { ESQLControlVariable } from '@kbn/esql-validation-autocomplete'; +import { ESQLControlVariable } from '@kbn/esql-types'; import { PublishingSubject, StateComparators } from '@kbn/presentation-publishing'; import fastIsEqual from 'fast-deep-equal'; import { cloneDeep } from 'lodash'; diff --git a/src/platform/plugins/shared/dashboard/tsconfig.json b/src/platform/plugins/shared/dashboard/tsconfig.json index 42d640a2c4d40..7f2c5c3a85b61 100644 --- a/src/platform/plugins/shared/dashboard/tsconfig.json +++ b/src/platform/plugins/shared/dashboard/tsconfig.json @@ -81,10 +81,9 @@ "@kbn/visualization-utils", "@kbn/std", "@kbn/core-rendering-browser", - "@kbn/esql-variables-types", "@kbn/grid-layout", - "@kbn/esql-validation-autocomplete", - "@kbn/ui-actions-browser" + "@kbn/ui-actions-browser", + "@kbn/esql-types" ], "exclude": ["target/**/*"] } diff --git a/src/platform/plugins/shared/esql/public/triggers/esql_controls/control_flyout/helpers.ts b/src/platform/plugins/shared/esql/public/triggers/esql_controls/control_flyout/helpers.ts index 3de541435cd34..72f3e7919cad0 100644 --- a/src/platform/plugins/shared/esql/public/triggers/esql_controls/control_flyout/helpers.ts +++ b/src/platform/plugins/shared/esql/public/triggers/esql_controls/control_flyout/helpers.ts @@ -7,7 +7,8 @@ * License v3.0 only", or the "Server Side Public License, v 1". */ import { monaco } from '@kbn/monaco'; -import { timeUnits, ESQLVariableType } from '@kbn/esql-validation-autocomplete'; +import { ESQLVariableType } from '@kbn/esql-types'; +import { timeUnits } from '@kbn/esql-validation-autocomplete'; function inKnownTimeInterval(timeIntervalUnit: string): boolean { return timeUnits.some((unit) => unit === timeIntervalUnit.toLowerCase()); diff --git a/src/platform/plugins/shared/esql/public/triggers/esql_controls/control_flyout/identifier_control_form.test.tsx b/src/platform/plugins/shared/esql/public/triggers/esql_controls/control_flyout/identifier_control_form.test.tsx index ed6d57fb31f14..bf33ec7cd635f 100644 --- a/src/platform/plugins/shared/esql/public/triggers/esql_controls/control_flyout/identifier_control_form.test.tsx +++ b/src/platform/plugins/shared/esql/public/triggers/esql_controls/control_flyout/identifier_control_form.test.tsx @@ -11,7 +11,7 @@ import React from 'react'; import { render, within, fireEvent } from '@testing-library/react'; import { monaco } from '@kbn/monaco'; import { dataPluginMock } from '@kbn/data-plugin/public/mocks'; -import { ESQLVariableType } from '@kbn/esql-validation-autocomplete'; +import { ESQLVariableType } from '@kbn/esql-types'; import { IdentifierControlForm } from './identifier_control_form'; import { ESQLControlState, EsqlControlType } from '../types'; diff --git a/src/platform/plugins/shared/esql/public/triggers/esql_controls/control_flyout/identifier_control_form.tsx b/src/platform/plugins/shared/esql/public/triggers/esql_controls/control_flyout/identifier_control_form.tsx index d16572e5a6f61..40306c6a5734c 100644 --- a/src/platform/plugins/shared/esql/public/triggers/esql_controls/control_flyout/identifier_control_form.tsx +++ b/src/platform/plugins/shared/esql/public/triggers/esql_controls/control_flyout/identifier_control_form.tsx @@ -20,11 +20,8 @@ import { import { css } from '@emotion/react'; import { monaco } from '@kbn/monaco'; import type { ISearchGeneric } from '@kbn/search-types'; -import { - ESQLVariableType, - ESQLControlVariable, - aggFunctionDefinitions, -} from '@kbn/esql-validation-autocomplete'; +import { ESQLVariableType, type ESQLControlVariable } from '@kbn/esql-types'; +import { aggFunctionDefinitions } from '@kbn/esql-validation-autocomplete'; import { getESQLQueryColumnsRaw } from '@kbn/esql-utils'; import type { ESQLControlState, ControlWidthOptions } from '../types'; import { diff --git a/src/platform/plugins/shared/esql/public/triggers/esql_controls/control_flyout/index.tsx b/src/platform/plugins/shared/esql/public/triggers/esql_controls/control_flyout/index.tsx index 07f0c86d855a7..6681843a6f8f5 100644 --- a/src/platform/plugins/shared/esql/public/triggers/esql_controls/control_flyout/index.tsx +++ b/src/platform/plugins/shared/esql/public/triggers/esql_controls/control_flyout/index.tsx @@ -8,7 +8,7 @@ */ import React, { useCallback } from 'react'; -import { ESQLVariableType, ESQLControlVariable } from '@kbn/esql-validation-autocomplete'; +import { ESQLVariableType, type ESQLControlVariable } from '@kbn/esql-types'; import type { ISearchGeneric } from '@kbn/search-types'; import { monaco } from '@kbn/monaco'; import type { ESQLControlState } from '../types'; diff --git a/src/platform/plugins/shared/esql/public/triggers/esql_controls/control_flyout/shared_form_components.tsx b/src/platform/plugins/shared/esql/public/triggers/esql_controls/control_flyout/shared_form_components.tsx index a654cd0e880c1..bc6763fa3032d 100644 --- a/src/platform/plugins/shared/esql/public/triggers/esql_controls/control_flyout/shared_form_components.tsx +++ b/src/platform/plugins/shared/esql/public/triggers/esql_controls/control_flyout/shared_form_components.tsx @@ -10,7 +10,7 @@ import React, { useCallback } from 'react'; import { i18n } from '@kbn/i18n'; import { css } from '@emotion/react'; -import { ESQLControlVariable } from '@kbn/esql-validation-autocomplete'; +import { ESQLControlVariable } from '@kbn/esql-types'; import { TooltipWrapper } from '@kbn/visualization-utils'; import { EuiFieldText, diff --git a/src/platform/plugins/shared/esql/public/triggers/esql_controls/control_flyout/value_control_form.test.tsx b/src/platform/plugins/shared/esql/public/triggers/esql_controls/control_flyout/value_control_form.test.tsx index 6a0c3e9e78609..ecafe01f08f27 100644 --- a/src/platform/plugins/shared/esql/public/triggers/esql_controls/control_flyout/value_control_form.test.tsx +++ b/src/platform/plugins/shared/esql/public/triggers/esql_controls/control_flyout/value_control_form.test.tsx @@ -12,7 +12,7 @@ import { render, within, fireEvent } from '@testing-library/react'; import { dataPluginMock } from '@kbn/data-plugin/public/mocks'; import { IUiSettingsClient } from '@kbn/core/public'; import { coreMock } from '@kbn/core/server/mocks'; -import { ESQLVariableType } from '@kbn/esql-validation-autocomplete'; +import { ESQLVariableType } from '@kbn/esql-types'; import { KibanaContextProvider } from '@kbn/kibana-react-plugin/public'; import { __IntlProvider as IntlProvider } from '@kbn/i18n-react'; import { ValueControlForm } from './value_control_form'; diff --git a/src/platform/plugins/shared/esql/public/triggers/esql_controls/control_flyout/value_control_form.tsx b/src/platform/plugins/shared/esql/public/triggers/esql_controls/control_flyout/value_control_form.tsx index e881d642e688f..e88b0fda63e01 100644 --- a/src/platform/plugins/shared/esql/public/triggers/esql_controls/control_flyout/value_control_form.tsx +++ b/src/platform/plugins/shared/esql/public/triggers/esql_controls/control_flyout/value_control_form.tsx @@ -22,7 +22,8 @@ import { import { css } from '@emotion/react'; import { FormattedMessage } from '@kbn/i18n-react'; import type { ISearchGeneric } from '@kbn/search-types'; -import { ESQLVariableType, ESQLControlVariable } from '@kbn/esql-validation-autocomplete'; +import { ESQLVariableType } from '@kbn/esql-types'; +import { ESQLControlVariable } from '@kbn/esql-types'; import { getIndexPatternFromESQLQuery, getESQLResults, diff --git a/src/platform/plugins/shared/esql/public/triggers/esql_controls/esql_control_action.test.ts b/src/platform/plugins/shared/esql/public/triggers/esql_controls/esql_control_action.test.ts index 07f9b50e43d75..8c027c605fba4 100644 --- a/src/platform/plugins/shared/esql/public/triggers/esql_controls/esql_control_action.test.ts +++ b/src/platform/plugins/shared/esql/public/triggers/esql_controls/esql_control_action.test.ts @@ -9,7 +9,7 @@ import { dataPluginMock } from '@kbn/data-plugin/public/mocks'; import { coreMock } from '@kbn/core/public/mocks'; -import { ESQLVariableType } from '@kbn/esql-validation-autocomplete'; +import { ESQLVariableType } from '@kbn/esql-types'; import { CreateESQLControlAction } from './esql_control_action'; describe('update ES|QL query action', () => { diff --git a/src/platform/plugins/shared/esql/public/triggers/esql_controls/esql_control_action.ts b/src/platform/plugins/shared/esql/public/triggers/esql_controls/esql_control_action.ts index 32a4a3a1fd97b..bbda601a78e90 100644 --- a/src/platform/plugins/shared/esql/public/triggers/esql_controls/esql_control_action.ts +++ b/src/platform/plugins/shared/esql/public/triggers/esql_controls/esql_control_action.ts @@ -11,7 +11,8 @@ import { i18n } from '@kbn/i18n'; import type { Action } from '@kbn/ui-actions-plugin/public'; import type { CoreStart } from '@kbn/core/public'; import type { ISearchGeneric } from '@kbn/search-types'; -import type { ESQLVariableType, ESQLControlVariable } from '@kbn/esql-validation-autocomplete'; +import type { ESQLVariableType } from '@kbn/esql-types'; +import type { ESQLControlVariable } from '@kbn/esql-types'; import { monaco } from '@kbn/monaco'; import type { ESQLControlState } from './types'; import { isActionCompatible, executeAction } from './esql_control_helpers'; diff --git a/src/platform/plugins/shared/esql/public/triggers/esql_controls/esql_control_helpers.tsx b/src/platform/plugins/shared/esql/public/triggers/esql_controls/esql_control_helpers.tsx index 1313d6c690a14..afd9b89e98738 100644 --- a/src/platform/plugins/shared/esql/public/triggers/esql_controls/esql_control_helpers.tsx +++ b/src/platform/plugins/shared/esql/public/triggers/esql_controls/esql_control_helpers.tsx @@ -12,7 +12,7 @@ import { KibanaContextProvider } from '@kbn/kibana-react-plugin/public'; import { KibanaRenderContextProvider } from '@kbn/react-kibana-context-render'; import type { CoreStart } from '@kbn/core/public'; import type { ISearchGeneric } from '@kbn/search-types'; -import type { ESQLVariableType, ESQLControlVariable } from '@kbn/esql-validation-autocomplete'; +import type { ESQLVariableType, ESQLControlVariable } from '@kbn/esql-types'; import { toMountPoint } from '@kbn/react-kibana-mount'; import { monaco } from '@kbn/monaco'; import { untilPluginStartServicesReady } from '../../kibana_services'; diff --git a/src/platform/plugins/shared/esql/public/triggers/esql_controls/types.ts b/src/platform/plugins/shared/esql/public/triggers/esql_controls/types.ts index 5787d8e485724..87301feab97e0 100644 --- a/src/platform/plugins/shared/esql/public/triggers/esql_controls/types.ts +++ b/src/platform/plugins/shared/esql/public/triggers/esql_controls/types.ts @@ -6,7 +6,7 @@ * 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 type { ESQLVariableType } from '@kbn/esql-validation-autocomplete'; +import type { ESQLVariableType } from '@kbn/esql-types'; export enum EsqlControlType { STATIC_VALUES = 'STATIC_VALUES', diff --git a/src/platform/plugins/shared/esql/public/variables_service.test.ts b/src/platform/plugins/shared/esql/public/variables_service.test.ts index 5ef6cf8a3d759..15331fc515b14 100644 --- a/src/platform/plugins/shared/esql/public/variables_service.test.ts +++ b/src/platform/plugins/shared/esql/public/variables_service.test.ts @@ -6,7 +6,7 @@ * 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 { ESQLVariableType } from '@kbn/esql-validation-autocomplete'; +import { ESQLVariableType } from '@kbn/esql-types'; import { EsqlVariablesService } from './variables_service'; describe('EsqlVariablesService', () => { diff --git a/src/platform/plugins/shared/esql/public/variables_service.ts b/src/platform/plugins/shared/esql/public/variables_service.ts index a748e81f3bb19..ce63c733847d9 100644 --- a/src/platform/plugins/shared/esql/public/variables_service.ts +++ b/src/platform/plugins/shared/esql/public/variables_service.ts @@ -7,7 +7,7 @@ * License v3.0 only", or the "Server Side Public License, v 1". */ -import type { ESQLControlVariable } from '@kbn/esql-validation-autocomplete'; +import type { ESQLControlVariable } from '@kbn/esql-types'; export class EsqlVariablesService { esqlVariables: ESQLControlVariable[] = []; diff --git a/src/platform/plugins/shared/esql/tsconfig.json b/src/platform/plugins/shared/esql/tsconfig.json index 7c36e9f7d74af..1d32d6dcde8f5 100644 --- a/src/platform/plugins/shared/esql/tsconfig.json +++ b/src/platform/plugins/shared/esql/tsconfig.json @@ -34,6 +34,7 @@ "@kbn/core-test-helpers-kbn-server", "@kbn/i18n-react", "@kbn/visualization-utils", + "@kbn/esql-types", ], "exclude": [ "target/**/*", diff --git a/tsconfig.base.json b/tsconfig.base.json index e305fba217e23..f5580bf413c2a 100644 --- a/tsconfig.base.json +++ b/tsconfig.base.json @@ -880,14 +880,14 @@ "@kbn/esql-datagrid/*": ["src/platform/plugins/shared/esql_datagrid/*"], "@kbn/esql-editor": ["src/platform/packages/private/kbn-esql-editor"], "@kbn/esql-editor/*": ["src/platform/packages/private/kbn-esql-editor/*"], + "@kbn/esql-types": ["src/platform/packages/shared/kbn-esql-types"], + "@kbn/esql-types/*": ["src/platform/packages/shared/kbn-esql-types/*"], "@kbn/esql-utils": ["src/platform/packages/shared/kbn-esql-utils"], "@kbn/esql-utils/*": ["src/platform/packages/shared/kbn-esql-utils/*"], "@kbn/esql-validation-autocomplete": ["src/platform/packages/shared/kbn-esql-validation-autocomplete"], "@kbn/esql-validation-autocomplete/*": ["src/platform/packages/shared/kbn-esql-validation-autocomplete/*"], "@kbn/esql-validation-example-plugin": ["examples/esql_validation_example"], "@kbn/esql-validation-example-plugin/*": ["examples/esql_validation_example/*"], - "@kbn/esql-variables-types": ["src/platform/packages/shared/kbn-esql-variables-types"], - "@kbn/esql-variables-types/*": ["src/platform/packages/shared/kbn-esql-variables-types/*"], "@kbn/eui-provider-dev-warning": ["test/plugin_functional/plugins/eui_provider_dev_warning"], "@kbn/eui-provider-dev-warning/*": ["test/plugin_functional/plugins/eui_provider_dev_warning/*"], "@kbn/event-annotation-common": ["src/platform/packages/shared/kbn-event-annotation-common"], diff --git a/x-pack/platform/plugins/shared/lens/public/app_plugin/shared/edit_on_the_fly/helpers.ts b/x-pack/platform/plugins/shared/lens/public/app_plugin/shared/edit_on_the_fly/helpers.ts index 4cdea9dc52742..08344d8f4aaed 100644 --- a/x-pack/platform/plugins/shared/lens/public/app_plugin/shared/edit_on_the_fly/helpers.ts +++ b/x-pack/platform/plugins/shared/lens/public/app_plugin/shared/edit_on_the_fly/helpers.ts @@ -13,7 +13,7 @@ import { } from '@kbn/esql-utils'; import { isEqual, cloneDeep } from 'lodash'; import { type AggregateQuery, buildEsQuery } from '@kbn/es-query'; -import type { ESQLControlVariable } from '@kbn/esql-validation-autocomplete'; +import type { ESQLControlVariable } from '@kbn/esql-types'; import type { ESQLRow } from '@kbn/es-types'; import { getLensAttributesFromSuggestion, diff --git a/x-pack/platform/plugins/shared/lens/public/react_embeddable/data_loader.test.ts b/x-pack/platform/plugins/shared/lens/public/react_embeddable/data_loader.test.ts index 94d6b5e6aed10..8a43783e58dc0 100644 --- a/x-pack/platform/plugins/shared/lens/public/react_embeddable/data_loader.test.ts +++ b/x-pack/platform/plugins/shared/lens/public/react_embeddable/data_loader.test.ts @@ -35,7 +35,7 @@ import { import { PublishesSearchSession } from '@kbn/presentation-publishing/interfaces/fetch/publishes_search_session'; import { isObject } from 'lodash'; import { createMockDatasource, defaultDoc } from '../mocks'; -import { ESQLControlVariable, ESQLVariableType } from '@kbn/esql-validation-autocomplete'; +import { ESQLVariableType, type ESQLControlVariable } from '@kbn/esql-types'; import * as Logger from './logger'; import { buildObservableVariable } from './helper'; diff --git a/x-pack/platform/plugins/shared/lens/public/react_embeddable/data_loader.ts b/x-pack/platform/plugins/shared/lens/public/react_embeddable/data_loader.ts index ce14bfc76cc85..da9c9ae071f3c 100644 --- a/x-pack/platform/plugins/shared/lens/public/react_embeddable/data_loader.ts +++ b/x-pack/platform/plugins/shared/lens/public/react_embeddable/data_loader.ts @@ -7,7 +7,7 @@ import type { DefaultInspectorAdapters } from '@kbn/expressions-plugin/common'; import { apiPublishesUnifiedSearch, fetch$ } from '@kbn/presentation-publishing'; -import type { ESQLControlVariable } from '@kbn/esql-validation-autocomplete'; +import type { ESQLControlVariable } from '@kbn/esql-types'; import { type KibanaExecutionContext } from '@kbn/core/public'; import { BehaviorSubject, diff --git a/x-pack/platform/plugins/shared/lens/public/react_embeddable/expressions/merged_search_context.ts b/x-pack/platform/plugins/shared/lens/public/react_embeddable/expressions/merged_search_context.ts index 5dc59a28eec97..bd2575baf7249 100644 --- a/x-pack/platform/plugins/shared/lens/public/react_embeddable/expressions/merged_search_context.ts +++ b/x-pack/platform/plugins/shared/lens/public/react_embeddable/expressions/merged_search_context.ts @@ -4,7 +4,7 @@ * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ -import type { ESQLControlVariable } from '@kbn/esql-validation-autocomplete'; +import type { ESQLControlVariable } from '@kbn/esql-types'; import type { DataPublicPluginStart, FilterManager } from '@kbn/data-plugin/public'; import { type AggregateQuery, diff --git a/x-pack/platform/plugins/shared/lens/public/react_embeddable/initializers/initialize_internal_api.ts b/x-pack/platform/plugins/shared/lens/public/react_embeddable/initializers/initialize_internal_api.ts index 7b2cb38b36e87..e34ea644c02d4 100644 --- a/x-pack/platform/plugins/shared/lens/public/react_embeddable/initializers/initialize_internal_api.ts +++ b/x-pack/platform/plugins/shared/lens/public/react_embeddable/initializers/initialize_internal_api.ts @@ -7,7 +7,7 @@ import { BehaviorSubject } from 'rxjs'; import { initializeTitleManager } from '@kbn/presentation-publishing'; -import { apiPublishesESQLVariables } from '@kbn/esql-variables-types'; +import { apiPublishesESQLVariables } from '@kbn/esql-types'; import type { DataView } from '@kbn/data-views-plugin/common'; import { buildObservableVariable, createEmptyLensState } from '../helper'; import type { diff --git a/x-pack/platform/plugins/shared/lens/public/react_embeddable/initializers/utils.test.ts b/x-pack/platform/plugins/shared/lens/public/react_embeddable/initializers/utils.test.ts index a058e16b49873..8e3d014166806 100644 --- a/x-pack/platform/plugins/shared/lens/public/react_embeddable/initializers/utils.test.ts +++ b/x-pack/platform/plugins/shared/lens/public/react_embeddable/initializers/utils.test.ts @@ -4,7 +4,7 @@ * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ -import { ESQLVariableType } from '@kbn/esql-validation-autocomplete'; +import { ESQLVariableType } from '@kbn/esql-types'; import { getEmbeddableVariables } from './utils'; describe('getEmbeddableVariables', () => { diff --git a/x-pack/platform/plugins/shared/lens/public/react_embeddable/initializers/utils.ts b/x-pack/platform/plugins/shared/lens/public/react_embeddable/initializers/utils.ts index e457fb206e620..74a9a6f5a0d38 100644 --- a/x-pack/platform/plugins/shared/lens/public/react_embeddable/initializers/utils.ts +++ b/x-pack/platform/plugins/shared/lens/public/react_embeddable/initializers/utils.ts @@ -5,7 +5,7 @@ * 2.0. */ import { type AggregateQuery, type Query, isOfAggregateQueryType } from '@kbn/es-query'; -import type { ESQLControlVariable } from '@kbn/esql-validation-autocomplete'; +import type { ESQLControlVariable } from '@kbn/esql-types'; import { ENABLE_ESQL, getESQLQueryVariables } from '@kbn/esql-utils'; import type { LensEmbeddableStartServices } from '../types'; diff --git a/x-pack/platform/plugins/shared/lens/public/react_embeddable/types.ts b/x-pack/platform/plugins/shared/lens/public/react_embeddable/types.ts index 8758152a54f0d..b068e5e2944b8 100644 --- a/x-pack/platform/plugins/shared/lens/public/react_embeddable/types.ts +++ b/x-pack/platform/plugins/shared/lens/public/react_embeddable/types.ts @@ -13,7 +13,7 @@ import type { TimeRange, } from '@kbn/es-query'; import type { Adapters, InspectorOptions } from '@kbn/inspector-plugin/public'; -import type { ESQLControlVariable } from '@kbn/esql-validation-autocomplete'; +import type { ESQLControlVariable } from '@kbn/esql-types'; import type { HasEditCapabilities, HasLibraryTransforms, diff --git a/x-pack/platform/plugins/shared/lens/tsconfig.json b/x-pack/platform/plugins/shared/lens/tsconfig.json index c856a3dff581d..c3bf41d4efdb7 100644 --- a/x-pack/platform/plugins/shared/lens/tsconfig.json +++ b/x-pack/platform/plugins/shared/lens/tsconfig.json @@ -119,8 +119,7 @@ "@kbn/core-chrome-browser", "@kbn/core-capabilities-common", "@kbn/presentation-panel-plugin", - "@kbn/esql-validation-autocomplete", - "@kbn/esql-variables-types", + "@kbn/esql-types", ], "exclude": ["target/**/*"] } diff --git a/yarn.lock b/yarn.lock index 61ac573bf1e21..51840eefa547a 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5603,19 +5603,19 @@ version "0.0.0" uid "" -"@kbn/esql-utils@link:src/platform/packages/shared/kbn-esql-utils": +"@kbn/esql-types@link:src/platform/packages/shared/kbn-esql-types": version "0.0.0" uid "" -"@kbn/esql-validation-autocomplete@link:src/platform/packages/shared/kbn-esql-validation-autocomplete": +"@kbn/esql-utils@link:src/platform/packages/shared/kbn-esql-utils": version "0.0.0" uid "" -"@kbn/esql-validation-example-plugin@link:examples/esql_validation_example": +"@kbn/esql-validation-autocomplete@link:src/platform/packages/shared/kbn-esql-validation-autocomplete": version "0.0.0" uid "" -"@kbn/esql-variables-types@link:src/platform/packages/shared/kbn-esql-variables-types": +"@kbn/esql-validation-example-plugin@link:examples/esql_validation_example": version "0.0.0" uid ""