[ES|QL] Introduces a new package for esql types (#212754)

## Summary

The esql types are around many packages and plugins creating problems
either with the bundle size or cyclic dependencies.

This PR is moving some of them on the esql-types package. I am going to
move more there in follow up PRs.

(I decided to rename it as it makes more sense to have a generic one for
esql rather one only for the variables)

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Marco Vettorello <vettorello.marco@gmail.com>
This commit is contained in:
Stratoula Kalafateli 2025-03-03 12:04:32 +01:00 committed by GitHub
parent 58e25b564e
commit dab569b70a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
69 changed files with 174 additions and 138 deletions

2
.github/CODEOWNERS vendored
View file

@ -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

View file

@ -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",

View file

@ -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';

View file

@ -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 */

View file

@ -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/**/*",

View file

@ -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 {

View file

@ -16,7 +16,7 @@
"@kbn/utility-types",
"@kbn/i18n",
"@kbn/safer-lodash-set",
"@kbn/esql-validation-autocomplete"
"@kbn/esql-types"
],
"exclude": [
"target/**/*",

View file

@ -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"],
)

View file

@ -0,0 +1,3 @@
# @kbn/esql-types
Gathers types of esql usage across kibana.

View file

@ -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';

View file

@ -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: ['<rootDir>/src/platform/packages/shared/kbn-esql-types'],
};

View file

@ -0,0 +1,9 @@
{
"type": "shared-common",
"id": "@kbn/esql-types",
"owner": [
"@elastic/kibana-esql"
],
"group": "platform",
"visibility": "shared"
}

View file

@ -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"
}

View file

@ -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<T extends unknown = unknown> = Omit<BehaviorSubject<T>, '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<ESQLControlVariable>;

View file

@ -0,0 +1,10 @@
{
"extends": "../../../../../tsconfig.base.json",
"compilerOptions": {
"outDir": "target/types"
},
"include": ["*.ts", "src/**/*", "__mocks__/**/*.ts"],
"kbn_references": [
],
"exclude": ["target/**/*"]
}

View file

@ -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,

View file

@ -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;

View file

@ -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', () => {

View file

@ -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);

View file

@ -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"
]
}

View file

@ -22,6 +22,7 @@ SRCS = glob(
SHARED_DEPS = [
"//src/platform/packages/shared/kbn-i18n",
"//src/platform/packages/shared/kbn-esql-types",
"@npm//fastest-levenshtein",
]

View file

@ -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,

View file

@ -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';

View file

@ -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';

View file

@ -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,

View file

@ -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';

View file

@ -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',

View file

@ -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);

View file

@ -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 =

View file

@ -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

View file

@ -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>;

View file

@ -14,7 +14,8 @@
"kbn_references": [
"@kbn/i18n",
"@kbn/esql-ast",
"@kbn/utility-types"
"@kbn/utility-types",
"@kbn/esql-types",
],
"exclude": [
"target/**/*",

View file

@ -1,3 +0,0 @@
# @kbn/esql-variables-types
This package contains types important for the ES|QL variables.

View file

@ -1,9 +0,0 @@
{
"type": "shared-browser",
"id": "@kbn/esql-variables-types",
"owner": [
"@elastic/kibana-esql",
],
"group": "platform",
"visibility": "shared"
}

View file

@ -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",
]
}

View file

@ -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,

View file

@ -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,

View file

@ -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) {

View file

@ -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';

View file

@ -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';

View file

@ -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/**/*"]
}

View file

@ -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,

View file

@ -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';

View file

@ -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/**/*"]
}

View file

@ -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());

View file

@ -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';

View file

@ -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 {

View file

@ -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';

View file

@ -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,

View file

@ -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';

View file

@ -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,

View file

@ -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', () => {

View file

@ -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';

View file

@ -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';

View file

@ -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',

View file

@ -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', () => {

View file

@ -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[] = [];

View file

@ -34,6 +34,7 @@
"@kbn/core-test-helpers-kbn-server",
"@kbn/i18n-react",
"@kbn/visualization-utils",
"@kbn/esql-types",
],
"exclude": [
"target/**/*",

View file

@ -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"],

View file

@ -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,

View file

@ -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';

View file

@ -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,

View file

@ -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,

View file

@ -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 {

View file

@ -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', () => {

View file

@ -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';

View file

@ -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,

View file

@ -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/**/*"]
}

View file

@ -5603,6 +5603,10 @@
version "0.0.0"
uid ""
"@kbn/esql-types@link:src/platform/packages/shared/kbn-esql-types":
version "0.0.0"
uid ""
"@kbn/esql-utils@link:src/platform/packages/shared/kbn-esql-utils":
version "0.0.0"
uid ""
@ -5615,10 +5619,6 @@
version "0.0.0"
uid ""
"@kbn/esql-variables-types@link:src/platform/packages/shared/kbn-esql-variables-types":
version "0.0.0"
uid ""
"@kbn/esql@link:src/platform/plugins/shared/esql":
version "0.0.0"
uid ""