mirror of
https://github.com/elastic/kibana.git
synced 2025-06-27 18:51:07 -04:00
[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:
parent
58e25b564e
commit
dab569b70a
69 changed files with 174 additions and 138 deletions
2
.github/CODEOWNERS
vendored
2
.github/CODEOWNERS
vendored
|
@ -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-query @elastic/kibana-data-discovery
|
||||||
src/platform/packages/shared/kbn-es-types @elastic/kibana-core @elastic/obs-knowledge-team
|
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-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-utils @elastic/kibana-esql
|
||||||
src/platform/packages/shared/kbn-esql-validation-autocomplete @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-common @elastic/kibana-visualizations
|
||||||
src/platform/packages/shared/kbn-event-annotation-components @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
|
src/platform/packages/shared/kbn-expect @elastic/kibana-operations @elastic/appex-qa
|
||||||
|
|
|
@ -498,10 +498,10 @@
|
||||||
"@kbn/esql-ast-inspector-plugin": "link:examples/esql_ast_inspector",
|
"@kbn/esql-ast-inspector-plugin": "link:examples/esql_ast_inspector",
|
||||||
"@kbn/esql-datagrid": "link:src/platform/plugins/shared/esql_datagrid",
|
"@kbn/esql-datagrid": "link:src/platform/plugins/shared/esql_datagrid",
|
||||||
"@kbn/esql-editor": "link:src/platform/packages/private/kbn-esql-editor",
|
"@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-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-autocomplete": "link:src/platform/packages/shared/kbn-esql-validation-autocomplete",
|
||||||
"@kbn/esql-validation-example-plugin": "link:examples/esql_validation_example",
|
"@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/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-common": "link:src/platform/packages/shared/kbn-event-annotation-common",
|
||||||
"@kbn/event-annotation-components": "link:src/platform/packages/shared/kbn-event-annotation-components",
|
"@kbn/event-annotation-components": "link:src/platform/packages/shared/kbn-event-annotation-components",
|
||||||
|
|
|
@ -31,11 +31,8 @@ import memoize from 'lodash/memoize';
|
||||||
import React, { memo, useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
import React, { memo, useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
||||||
import { createPortal } from 'react-dom';
|
import { createPortal } from 'react-dom';
|
||||||
import { css } from '@emotion/react';
|
import { css } from '@emotion/react';
|
||||||
import {
|
import { ESQLVariableType, type ESQLControlVariable } from '@kbn/esql-types';
|
||||||
type ESQLRealField,
|
import { type ESQLRealField } from '@kbn/esql-validation-autocomplete';
|
||||||
ESQLVariableType,
|
|
||||||
type ESQLControlVariable,
|
|
||||||
} from '@kbn/esql-validation-autocomplete';
|
|
||||||
import { FieldType } from '@kbn/esql-validation-autocomplete/src/definitions/types';
|
import { FieldType } from '@kbn/esql-validation-autocomplete/src/definitions/types';
|
||||||
import { EditorFooter } from './editor_footer';
|
import { EditorFooter } from './editor_footer';
|
||||||
import { fetchFieldsFromESQL } from './fetch_fields_from_esql';
|
import { fetchFieldsFromESQL } from './fetch_fields_from_esql';
|
||||||
|
|
|
@ -17,7 +17,7 @@ import type { UsageCollectionStart } from '@kbn/usage-collection-plugin/public';
|
||||||
import type { Storage } from '@kbn/kibana-utils-plugin/public';
|
import type { Storage } from '@kbn/kibana-utils-plugin/public';
|
||||||
import type { UiActionsStart } from '@kbn/ui-actions-plugin/public';
|
import type { UiActionsStart } from '@kbn/ui-actions-plugin/public';
|
||||||
import type { DataPublicPluginStart } from '@kbn/data-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 {
|
export interface ESQLEditorProps {
|
||||||
/** The aggregate type query */
|
/** The aggregate type query */
|
||||||
|
|
|
@ -33,7 +33,8 @@
|
||||||
"@kbn/content-management-favorites-common",
|
"@kbn/content-management-favorites-common",
|
||||||
"@kbn/kibana-utils-plugin",
|
"@kbn/kibana-utils-plugin",
|
||||||
"@kbn/ui-actions-plugin",
|
"@kbn/ui-actions-plugin",
|
||||||
"@kbn/shared-ux-table-persist"
|
"@kbn/shared-ux-table-persist",
|
||||||
|
"@kbn/esql-types"
|
||||||
],
|
],
|
||||||
"exclude": [
|
"exclude": [
|
||||||
"target/**/*",
|
"target/**/*",
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
* your election, the "Elastic License 2.0", the "GNU Affero General Public
|
* your election, the "Elastic License 2.0", the "GNU Affero General Public
|
||||||
* License v3.0 only", or the "Server Side Public License, v 1".
|
* 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';
|
import { Filter, Query, TimeRange } from '../filters';
|
||||||
|
|
||||||
export interface ExecutionContextSearch {
|
export interface ExecutionContextSearch {
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
"@kbn/utility-types",
|
"@kbn/utility-types",
|
||||||
"@kbn/i18n",
|
"@kbn/i18n",
|
||||||
"@kbn/safer-lodash-set",
|
"@kbn/safer-lodash-set",
|
||||||
"@kbn/esql-validation-autocomplete"
|
"@kbn/esql-types"
|
||||||
],
|
],
|
||||||
"exclude": [
|
"exclude": [
|
||||||
"target/**/*",
|
"target/**/*",
|
||||||
|
|
31
src/platform/packages/shared/kbn-esql-types/BUILD.bazel
Normal file
31
src/platform/packages/shared/kbn-esql-types/BUILD.bazel
Normal 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"],
|
||||||
|
)
|
3
src/platform/packages/shared/kbn-esql-types/README.md
Normal file
3
src/platform/packages/shared/kbn-esql-types/README.md
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
# @kbn/esql-types
|
||||||
|
|
||||||
|
Gathers types of esql usage across kibana.
|
17
src/platform/packages/shared/kbn-esql-types/index.ts
Normal file
17
src/platform/packages/shared/kbn-esql-types/index.ts
Normal 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';
|
14
src/platform/packages/shared/kbn-esql-types/jest.config.js
Normal file
14
src/platform/packages/shared/kbn-esql-types/jest.config.js
Normal 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'],
|
||||||
|
};
|
9
src/platform/packages/shared/kbn-esql-types/kibana.jsonc
Normal file
9
src/platform/packages/shared/kbn-esql-types/kibana.jsonc
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
{
|
||||||
|
"type": "shared-common",
|
||||||
|
"id": "@kbn/esql-types",
|
||||||
|
"owner": [
|
||||||
|
"@elastic/kibana-esql"
|
||||||
|
],
|
||||||
|
"group": "platform",
|
||||||
|
"visibility": "shared"
|
||||||
|
}
|
|
@ -1,7 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "@kbn/esql-variables-types",
|
"name": "@kbn/esql-types",
|
||||||
"private": true,
|
"private": true,
|
||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"author": "Kibana ES|QL",
|
|
||||||
"license": "Elastic License 2.0 OR AGPL-3.0-only OR SSPL-1.0"
|
"license": "Elastic License 2.0 OR AGPL-3.0-only OR SSPL-1.0"
|
||||||
}
|
}
|
|
@ -6,12 +6,23 @@
|
||||||
* your election, the "Elastic License 2.0", the "GNU Affero General Public
|
* your election, the "Elastic License 2.0", the "GNU Affero General Public
|
||||||
* License v3.0 only", or the "Server Side Public License, v 1".
|
* 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';
|
|
||||||
|
|
||||||
/**
|
import { BehaviorSubject } from 'rxjs';
|
||||||
* This should all be moved into a package and reorganized into separate files etc
|
|
||||||
*/
|
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 {
|
export interface PublishesESQLVariable {
|
||||||
esqlVariable$: PublishingSubject<ESQLControlVariable>;
|
esqlVariable$: PublishingSubject<ESQLControlVariable>;
|
10
src/platform/packages/shared/kbn-esql-types/tsconfig.json
Normal file
10
src/platform/packages/shared/kbn-esql-types/tsconfig.json
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
{
|
||||||
|
"extends": "../../../../../tsconfig.base.json",
|
||||||
|
"compilerOptions": {
|
||||||
|
"outDir": "target/types"
|
||||||
|
},
|
||||||
|
"include": ["*.ts", "src/**/*", "__mocks__/**/*.ts"],
|
||||||
|
"kbn_references": [
|
||||||
|
],
|
||||||
|
"exclude": ["target/**/*"]
|
||||||
|
}
|
|
@ -7,7 +7,7 @@
|
||||||
* License v3.0 only", or the "Server Side Public License, v 1".
|
* License v3.0 only", or the "Server Side Public License, v 1".
|
||||||
*/
|
*/
|
||||||
import type { DatatableColumn } from '@kbn/expressions-plugin/common';
|
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 {
|
import {
|
||||||
getIndexPatternFromESQLQuery,
|
getIndexPatternFromESQLQuery,
|
||||||
getLimitFromESQLQuery,
|
getLimitFromESQLQuery,
|
||||||
|
|
|
@ -15,7 +15,7 @@ import type {
|
||||||
ESQLSingleAstItem,
|
ESQLSingleAstItem,
|
||||||
ESQLCommandOption,
|
ESQLCommandOption,
|
||||||
} from '@kbn/esql-ast';
|
} 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';
|
import type { DatatableColumn } from '@kbn/expressions-plugin/common';
|
||||||
|
|
||||||
const DEFAULT_ESQL_LIMIT = 1000;
|
const DEFAULT_ESQL_LIMIT = 1000;
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
* your election, the "Elastic License 2.0", the "GNU Affero General Public
|
* your election, the "Elastic License 2.0", the "GNU Affero General Public
|
||||||
* License v3.0 only", or the "Server Side Public License, v 1".
|
* 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';
|
import { getStartEndParams, getNamedParams } from './run_query';
|
||||||
|
|
||||||
describe('run query helpers', () => {
|
describe('run query helpers', () => {
|
||||||
|
|
|
@ -15,7 +15,8 @@ import type { TimeRange } from '@kbn/es-query';
|
||||||
import { esFieldTypeToKibanaFieldType } from '@kbn/field-types';
|
import { esFieldTypeToKibanaFieldType } from '@kbn/field-types';
|
||||||
import type { ESQLColumn, ESQLSearchResponse, ESQLSearchParams } from '@kbn/es-types';
|
import type { ESQLColumn, ESQLSearchResponse, ESQLSearchParams } from '@kbn/es-types';
|
||||||
import { lastValueFrom } from 'rxjs';
|
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);
|
export const hasStartEndParams = (query: string) => /\?_tstart|\?_tend/i.test(query);
|
||||||
|
|
||||||
|
|
|
@ -20,6 +20,7 @@
|
||||||
"@kbn/crypto-browser",
|
"@kbn/crypto-browser",
|
||||||
"@kbn/data-view-utils",
|
"@kbn/data-view-utils",
|
||||||
"@kbn/esql-ast",
|
"@kbn/esql-ast",
|
||||||
|
"@kbn/esql-types",
|
||||||
"@kbn/search-types",
|
"@kbn/search-types",
|
||||||
"@kbn/expressions-plugin",
|
"@kbn/expressions-plugin",
|
||||||
"@kbn/field-types",
|
"@kbn/field-types",
|
||||||
|
@ -27,6 +28,5 @@
|
||||||
"@kbn/i18n",
|
"@kbn/i18n",
|
||||||
"@kbn/datemath",
|
"@kbn/datemath",
|
||||||
"@kbn/es-query",
|
"@kbn/es-query",
|
||||||
"@kbn/esql-validation-autocomplete"
|
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,6 +22,7 @@ SRCS = glob(
|
||||||
|
|
||||||
SHARED_DEPS = [
|
SHARED_DEPS = [
|
||||||
"//src/platform/packages/shared/kbn-i18n",
|
"//src/platform/packages/shared/kbn-i18n",
|
||||||
|
"//src/platform/packages/shared/kbn-esql-types",
|
||||||
"@npm//fastest-levenshtein",
|
"@npm//fastest-levenshtein",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
|
@ -8,7 +8,6 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
export type { SuggestionRawDefinition, ItemKind } from './src/autocomplete/types';
|
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 { CodeAction } from './src/code_actions/types';
|
||||||
export type {
|
export type {
|
||||||
FunctionDefinition,
|
FunctionDefinition,
|
||||||
|
|
|
@ -6,10 +6,9 @@
|
||||||
* your election, the "Elastic License 2.0", the "GNU Affero General Public
|
* your election, the "Elastic License 2.0", the "GNU Affero General Public
|
||||||
* License v3.0 only", or the "Server Side Public License, v 1".
|
* 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 { FieldType, FunctionReturnType } from '../../definitions/types';
|
||||||
import { ESQL_COMMON_NUMERIC_TYPES, ESQL_NUMBER_TYPES } from '../../shared/esql_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 { getDateHistogramCompletionItem } from '../commands/stats/util';
|
||||||
import { allStarConstant } from '../complete_items';
|
import { allStarConstant } from '../complete_items';
|
||||||
import { roundParameterTypes } from './constants';
|
import { roundParameterTypes } from './constants';
|
||||||
|
|
|
@ -6,9 +6,8 @@
|
||||||
* your election, the "Elastic License 2.0", the "GNU Affero General Public
|
* your election, the "Elastic License 2.0", the "GNU Affero General Public
|
||||||
* License v3.0 only", or the "Server Side Public License, v 1".
|
* 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 { ESQL_COMMON_NUMERIC_TYPES } from '../../shared/esql_types';
|
||||||
import { ESQLVariableType } from '../../shared/types';
|
|
||||||
import { pipeCompleteItem } from '../complete_items';
|
import { pipeCompleteItem } from '../complete_items';
|
||||||
import { getDateLiterals } from '../factories';
|
import { getDateLiterals } from '../factories';
|
||||||
import { log10ParameterTypes, powParameterTypes } from './constants';
|
import { log10ParameterTypes, powParameterTypes } from './constants';
|
||||||
|
|
|
@ -16,6 +16,7 @@ import {
|
||||||
type ESQLFunction,
|
type ESQLFunction,
|
||||||
type ESQLSingleAstItem,
|
type ESQLSingleAstItem,
|
||||||
} from '@kbn/esql-ast';
|
} from '@kbn/esql-ast';
|
||||||
|
import { ESQLVariableType, type ESQLControlVariable } from '@kbn/esql-types';
|
||||||
import { ESQL_NUMBER_TYPES, isNumericType } from '../shared/esql_types';
|
import { ESQL_NUMBER_TYPES, isNumericType } from '../shared/esql_types';
|
||||||
import type { EditorContext, ItemKind, SuggestionRawDefinition, GetColumnsByTypeFn } from './types';
|
import type { EditorContext, ItemKind, SuggestionRawDefinition, GetColumnsByTypeFn } from './types';
|
||||||
import {
|
import {
|
||||||
|
@ -84,12 +85,7 @@ import {
|
||||||
getPolicyHelper,
|
getPolicyHelper,
|
||||||
getSourcesHelper,
|
getSourcesHelper,
|
||||||
} from '../shared/resources_helpers';
|
} from '../shared/resources_helpers';
|
||||||
import type {
|
import type { ESQLCallbacks, ESQLSourceResult } from '../shared/types';
|
||||||
ESQLCallbacks,
|
|
||||||
ESQLSourceResult,
|
|
||||||
ESQLControlVariable,
|
|
||||||
ESQLVariableType,
|
|
||||||
} from '../shared/types';
|
|
||||||
import {
|
import {
|
||||||
getFunctionsToIgnoreForStats,
|
getFunctionsToIgnoreForStats,
|
||||||
getQueryForFields,
|
getQueryForFields,
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
* your election, the "Elastic License 2.0", the "GNU Affero General Public
|
* your election, the "Elastic License 2.0", the "GNU Affero General Public
|
||||||
* License v3.0 only", or the "Server Side Public License, v 1".
|
* License v3.0 only", or the "Server Side Public License, v 1".
|
||||||
*/
|
*/
|
||||||
|
import { ESQLVariableType } from '@kbn/esql-types';
|
||||||
import { CommandSuggestParams } from '../../../definitions/types';
|
import { CommandSuggestParams } from '../../../definitions/types';
|
||||||
import type { SuggestionRawDefinition } from '../../types';
|
import type { SuggestionRawDefinition } from '../../types';
|
||||||
import {
|
import {
|
||||||
|
@ -15,7 +15,6 @@ import {
|
||||||
getFunctionSuggestions,
|
getFunctionSuggestions,
|
||||||
getControlSuggestionIfSupported,
|
getControlSuggestionIfSupported,
|
||||||
} from '../../factories';
|
} from '../../factories';
|
||||||
import { ESQLVariableType } from '../../../shared/types';
|
|
||||||
import { commaCompleteItem, pipeCompleteItem } from '../../complete_items';
|
import { commaCompleteItem, pipeCompleteItem } from '../../complete_items';
|
||||||
import { pushItUpInTheList } from '../../helper';
|
import { pushItUpInTheList } from '../../helper';
|
||||||
import { byCompleteItem, getDateHistogramCompletionItem, getPosition } from './util';
|
import { byCompleteItem, getDateHistogramCompletionItem, getPosition } from './util';
|
||||||
|
|
|
@ -9,6 +9,7 @@
|
||||||
|
|
||||||
import { i18n } from '@kbn/i18n';
|
import { i18n } from '@kbn/i18n';
|
||||||
import { memoize } from 'lodash';
|
import { memoize } from 'lodash';
|
||||||
|
import { ESQLVariableType, type ESQLControlVariable } from '@kbn/esql-types';
|
||||||
import { SuggestionRawDefinition } from './types';
|
import { SuggestionRawDefinition } from './types';
|
||||||
import { groupingFunctionDefinitions } from '../definitions/generated/grouping_functions';
|
import { groupingFunctionDefinitions } from '../definitions/generated/grouping_functions';
|
||||||
import { aggFunctionDefinitions } from '../definitions/generated/aggregation_functions';
|
import { aggFunctionDefinitions } from '../definitions/generated/aggregation_functions';
|
||||||
|
@ -29,7 +30,6 @@ import { ESQLRealField } from '../validation/types';
|
||||||
import { isNumericType } from '../shared/esql_types';
|
import { isNumericType } from '../shared/esql_types';
|
||||||
import { getTestFunctions } from '../shared/test_functions';
|
import { getTestFunctions } from '../shared/test_functions';
|
||||||
import { operatorsDefinitions } from '../definitions/all_operators';
|
import { operatorsDefinitions } from '../definitions/all_operators';
|
||||||
import { ESQLVariableType, ESQLControlVariable } from '../shared/types';
|
|
||||||
|
|
||||||
const techPreviewLabel = i18n.translate(
|
const techPreviewLabel = i18n.translate(
|
||||||
'kbn-esql-validation-autocomplete.esql.autocomplete.techPreviewLabel',
|
'kbn-esql-validation-autocomplete.esql.autocomplete.techPreviewLabel',
|
||||||
|
|
|
@ -16,6 +16,7 @@ import {
|
||||||
type ESQLSource,
|
type ESQLSource,
|
||||||
} from '@kbn/esql-ast';
|
} from '@kbn/esql-ast';
|
||||||
import { uniqBy } from 'lodash';
|
import { uniqBy } from 'lodash';
|
||||||
|
import { ESQLVariableType } from '@kbn/esql-types';
|
||||||
import {
|
import {
|
||||||
isParameterType,
|
isParameterType,
|
||||||
type FunctionDefinition,
|
type FunctionDefinition,
|
||||||
|
@ -49,7 +50,6 @@ import { EDITOR_MARKER } from '../shared/constants';
|
||||||
import { ESQLRealField, ESQLVariable, ReferenceMaps } from '../validation/types';
|
import { ESQLRealField, ESQLVariable, ReferenceMaps } from '../validation/types';
|
||||||
import { listCompleteItem } from './complete_items';
|
import { listCompleteItem } from './complete_items';
|
||||||
import { removeMarkerArgFromArgsList } from '../shared/context';
|
import { removeMarkerArgFromArgsList } from '../shared/context';
|
||||||
import { ESQLVariableType } from '../shared/types';
|
|
||||||
|
|
||||||
function extractFunctionArgs(args: ESQLAstItem[]): ESQLFunction[] {
|
function extractFunctionArgs(args: ESQLAstItem[]): ESQLFunction[] {
|
||||||
return args.flatMap((arg) => (isAssignment(arg) ? arg.args[1] : arg)).filter(isFunctionItem);
|
return args.flatMap((arg) => (isAssignment(arg) ? arg.args[1] : arg)).filter(isFunctionItem);
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
* your election, the "Elastic License 2.0", the "GNU Affero General Public
|
* your election, the "Elastic License 2.0", the "GNU Affero General Public
|
||||||
* License v3.0 only", or the "Server Side Public License, v 1".
|
* 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
|
// This is a subset of the Monaco's editor CompletitionItemKind type
|
||||||
export type ItemKind =
|
export type ItemKind =
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
* your election, the "Elastic License 2.0", the "GNU Affero General Public
|
* your election, the "Elastic License 2.0", the "GNU Affero General Public
|
||||||
* License v3.0 only", or the "Server Side Public License, v 1".
|
* License v3.0 only", or the "Server Side Public License, v 1".
|
||||||
*/
|
*/
|
||||||
|
import type { ESQLVariableType, ESQLControlVariable } from '@kbn/esql-types';
|
||||||
import type {
|
import type {
|
||||||
ESQLAstItem,
|
ESQLAstItem,
|
||||||
ESQLCommand,
|
ESQLCommand,
|
||||||
|
@ -16,12 +16,7 @@ import type {
|
||||||
ESQLSource,
|
ESQLSource,
|
||||||
} from '@kbn/esql-ast';
|
} from '@kbn/esql-ast';
|
||||||
import { GetColumnsByTypeFn, SuggestionRawDefinition } from '../autocomplete/types';
|
import { GetColumnsByTypeFn, SuggestionRawDefinition } from '../autocomplete/types';
|
||||||
import type {
|
import type { ESQLCallbacks, ESQLSourceResult } from '../shared/types';
|
||||||
ESQLCallbacks,
|
|
||||||
ESQLControlVariable,
|
|
||||||
ESQLVariableType,
|
|
||||||
ESQLSourceResult,
|
|
||||||
} from '../shared/types';
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* All supported field types in ES|QL. This is all the types
|
* All supported field types in ES|QL. This is all the types
|
||||||
|
|
|
@ -6,6 +6,7 @@
|
||||||
* your election, the "Elastic License 2.0", the "GNU Affero General Public
|
* your election, the "Elastic License 2.0", the "GNU Affero General Public
|
||||||
* License v3.0 only", or the "Server Side Public License, v 1".
|
* 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';
|
import type { ESQLRealField, JoinIndexAutocompleteItem } from '../validation/types';
|
||||||
|
|
||||||
/** @internal **/
|
/** @internal **/
|
||||||
|
@ -36,19 +37,6 @@ export interface ESQLSourceResult {
|
||||||
type?: string;
|
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 {
|
export interface ESQLCallbacks {
|
||||||
getSources?: CallbackFn<{}, ESQLSourceResult>;
|
getSources?: CallbackFn<{}, ESQLSourceResult>;
|
||||||
getColumnsFor?: CallbackFn<{ query: string }, ESQLRealField>;
|
getColumnsFor?: CallbackFn<{ query: string }, ESQLRealField>;
|
||||||
|
|
|
@ -14,7 +14,8 @@
|
||||||
"kbn_references": [
|
"kbn_references": [
|
||||||
"@kbn/i18n",
|
"@kbn/i18n",
|
||||||
"@kbn/esql-ast",
|
"@kbn/esql-ast",
|
||||||
"@kbn/utility-types"
|
"@kbn/utility-types",
|
||||||
|
"@kbn/esql-types",
|
||||||
],
|
],
|
||||||
"exclude": [
|
"exclude": [
|
||||||
"target/**/*",
|
"target/**/*",
|
||||||
|
|
|
@ -1,3 +0,0 @@
|
||||||
# @kbn/esql-variables-types
|
|
||||||
|
|
||||||
This package contains types important for the ES|QL variables.
|
|
|
@ -1,9 +0,0 @@
|
||||||
{
|
|
||||||
"type": "shared-browser",
|
|
||||||
"id": "@kbn/esql-variables-types",
|
|
||||||
"owner": [
|
|
||||||
"@elastic/kibana-esql",
|
|
||||||
],
|
|
||||||
"group": "platform",
|
|
||||||
"visibility": "shared"
|
|
||||||
}
|
|
|
@ -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",
|
|
||||||
]
|
|
||||||
}
|
|
|
@ -9,8 +9,8 @@
|
||||||
|
|
||||||
import { DataView } from '@kbn/data-views-plugin/common';
|
import { DataView } from '@kbn/data-views-plugin/common';
|
||||||
import { ReactEmbeddableFactory } from '@kbn/embeddable-plugin/public';
|
import { ReactEmbeddableFactory } from '@kbn/embeddable-plugin/public';
|
||||||
import { ESQLControlVariable } from '@kbn/esql-validation-autocomplete';
|
import type { ESQLControlVariable } from '@kbn/esql-types';
|
||||||
import { PublishesESQLVariable, apiPublishesESQLVariable } from '@kbn/esql-variables-types';
|
import { PublishesESQLVariable, apiPublishesESQLVariable } from '@kbn/esql-types';
|
||||||
import { i18n } from '@kbn/i18n';
|
import { i18n } from '@kbn/i18n';
|
||||||
import {
|
import {
|
||||||
apiHasSaveNotification,
|
apiHasSaveNotification,
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
import type { Observable } from 'rxjs';
|
import type { Observable } from 'rxjs';
|
||||||
|
|
||||||
import { DefaultEmbeddableApi } from '@kbn/embeddable-plugin/public';
|
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 { Filter } from '@kbn/es-query';
|
||||||
import {
|
import {
|
||||||
HasSaveNotification,
|
HasSaveNotification,
|
||||||
|
|
|
@ -8,8 +8,8 @@
|
||||||
*/
|
*/
|
||||||
import deepEqual from 'react-fast-compare';
|
import deepEqual from 'react-fast-compare';
|
||||||
import { BehaviorSubject, combineLatest } from 'rxjs';
|
import { BehaviorSubject, combineLatest } from 'rxjs';
|
||||||
|
import { ESQLVariableType, type ESQLControlVariable } from '@kbn/esql-types';
|
||||||
import { PublishingSubject, StateComparators } from '@kbn/presentation-publishing';
|
import { PublishingSubject, StateComparators } from '@kbn/presentation-publishing';
|
||||||
import { ESQLControlVariable, ESQLVariableType } from '@kbn/esql-validation-autocomplete';
|
|
||||||
import type { ESQLControlState } from '@kbn/esql/public';
|
import type { ESQLControlState } from '@kbn/esql/public';
|
||||||
|
|
||||||
export function initializeESQLControlSelections(initialState: ESQLControlState) {
|
export function initializeESQLControlSelections(initialState: ESQLControlState) {
|
||||||
|
|
|
@ -12,7 +12,7 @@ import { i18n } from '@kbn/i18n';
|
||||||
import { BehaviorSubject } from 'rxjs';
|
import { BehaviorSubject } from 'rxjs';
|
||||||
import { css } from '@emotion/react';
|
import { css } from '@emotion/react';
|
||||||
import { EuiComboBox } from '@elastic/eui';
|
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 { useBatchedPublishingSubjects, apiHasParentApi } from '@kbn/presentation-publishing';
|
||||||
import { tracksOverlays } from '@kbn/presentation-containers';
|
import { tracksOverlays } from '@kbn/presentation-containers';
|
||||||
import type { ESQLControlState } from '@kbn/esql/public';
|
import type { ESQLControlState } from '@kbn/esql/public';
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
* your election, the "Elastic License 2.0", the "GNU Affero General Public
|
* your election, the "Elastic License 2.0", the "GNU Affero General Public
|
||||||
* License v3.0 only", or the "Server Side Public License, v 1".
|
* 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 { HasEditCapabilities, PublishesTitle } from '@kbn/presentation-publishing';
|
||||||
import type { DefaultControlApi } from '../types';
|
import type { DefaultControlApi } from '../types';
|
||||||
|
|
||||||
|
|
|
@ -39,9 +39,8 @@
|
||||||
"@kbn/shared-ux-utility",
|
"@kbn/shared-ux-utility",
|
||||||
"@kbn/std",
|
"@kbn/std",
|
||||||
"@kbn/react-hooks",
|
"@kbn/react-hooks",
|
||||||
"@kbn/esql-validation-autocomplete",
|
|
||||||
"@kbn/esql-variables-types",
|
|
||||||
"@kbn/esql",
|
"@kbn/esql",
|
||||||
|
"@kbn/esql-types",
|
||||||
],
|
],
|
||||||
"exclude": ["target/**/*"]
|
"exclude": ["target/**/*"]
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,7 +16,7 @@ import {
|
||||||
import { RefreshInterval, SearchSessionInfoProvider } from '@kbn/data-plugin/public';
|
import { RefreshInterval, SearchSessionInfoProvider } from '@kbn/data-plugin/public';
|
||||||
import type { DefaultEmbeddableApi, EmbeddablePackageState } from '@kbn/embeddable-plugin/public';
|
import type { DefaultEmbeddableApi, EmbeddablePackageState } from '@kbn/embeddable-plugin/public';
|
||||||
import { Filter, Query, TimeRange } from '@kbn/es-query';
|
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 { IKbnUrlStateStorage } from '@kbn/kibana-utils-plugin/public';
|
||||||
import {
|
import {
|
||||||
CanExpandPanels,
|
CanExpandPanels,
|
||||||
|
|
|
@ -24,7 +24,7 @@ import {
|
||||||
compareFilters,
|
compareFilters,
|
||||||
isFilterPinned,
|
isFilterPinned,
|
||||||
} from '@kbn/es-query';
|
} 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 { PublishingSubject, StateComparators } from '@kbn/presentation-publishing';
|
||||||
import fastIsEqual from 'fast-deep-equal';
|
import fastIsEqual from 'fast-deep-equal';
|
||||||
import { cloneDeep } from 'lodash';
|
import { cloneDeep } from 'lodash';
|
||||||
|
|
|
@ -81,10 +81,9 @@
|
||||||
"@kbn/visualization-utils",
|
"@kbn/visualization-utils",
|
||||||
"@kbn/std",
|
"@kbn/std",
|
||||||
"@kbn/core-rendering-browser",
|
"@kbn/core-rendering-browser",
|
||||||
"@kbn/esql-variables-types",
|
|
||||||
"@kbn/grid-layout",
|
"@kbn/grid-layout",
|
||||||
"@kbn/esql-validation-autocomplete",
|
"@kbn/ui-actions-browser",
|
||||||
"@kbn/ui-actions-browser"
|
"@kbn/esql-types"
|
||||||
],
|
],
|
||||||
"exclude": ["target/**/*"]
|
"exclude": ["target/**/*"]
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,7 +7,8 @@
|
||||||
* License v3.0 only", or the "Server Side Public License, v 1".
|
* License v3.0 only", or the "Server Side Public License, v 1".
|
||||||
*/
|
*/
|
||||||
import { monaco } from '@kbn/monaco';
|
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 {
|
function inKnownTimeInterval(timeIntervalUnit: string): boolean {
|
||||||
return timeUnits.some((unit) => unit === timeIntervalUnit.toLowerCase());
|
return timeUnits.some((unit) => unit === timeIntervalUnit.toLowerCase());
|
||||||
|
|
|
@ -11,7 +11,7 @@ import React from 'react';
|
||||||
import { render, within, fireEvent } from '@testing-library/react';
|
import { render, within, fireEvent } from '@testing-library/react';
|
||||||
import { monaco } from '@kbn/monaco';
|
import { monaco } from '@kbn/monaco';
|
||||||
import { dataPluginMock } from '@kbn/data-plugin/public/mocks';
|
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 { IdentifierControlForm } from './identifier_control_form';
|
||||||
import { ESQLControlState, EsqlControlType } from '../types';
|
import { ESQLControlState, EsqlControlType } from '../types';
|
||||||
|
|
||||||
|
|
|
@ -20,11 +20,8 @@ import {
|
||||||
import { css } from '@emotion/react';
|
import { css } from '@emotion/react';
|
||||||
import { monaco } from '@kbn/monaco';
|
import { monaco } from '@kbn/monaco';
|
||||||
import type { ISearchGeneric } from '@kbn/search-types';
|
import type { ISearchGeneric } from '@kbn/search-types';
|
||||||
import {
|
import { ESQLVariableType, type ESQLControlVariable } from '@kbn/esql-types';
|
||||||
ESQLVariableType,
|
import { aggFunctionDefinitions } from '@kbn/esql-validation-autocomplete';
|
||||||
ESQLControlVariable,
|
|
||||||
aggFunctionDefinitions,
|
|
||||||
} from '@kbn/esql-validation-autocomplete';
|
|
||||||
import { getESQLQueryColumnsRaw } from '@kbn/esql-utils';
|
import { getESQLQueryColumnsRaw } from '@kbn/esql-utils';
|
||||||
import type { ESQLControlState, ControlWidthOptions } from '../types';
|
import type { ESQLControlState, ControlWidthOptions } from '../types';
|
||||||
import {
|
import {
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import React, { useCallback } from 'react';
|
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 type { ISearchGeneric } from '@kbn/search-types';
|
||||||
import { monaco } from '@kbn/monaco';
|
import { monaco } from '@kbn/monaco';
|
||||||
import type { ESQLControlState } from '../types';
|
import type { ESQLControlState } from '../types';
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
import React, { useCallback } from 'react';
|
import React, { useCallback } from 'react';
|
||||||
import { i18n } from '@kbn/i18n';
|
import { i18n } from '@kbn/i18n';
|
||||||
import { css } from '@emotion/react';
|
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 { TooltipWrapper } from '@kbn/visualization-utils';
|
||||||
import {
|
import {
|
||||||
EuiFieldText,
|
EuiFieldText,
|
||||||
|
|
|
@ -12,7 +12,7 @@ import { render, within, fireEvent } from '@testing-library/react';
|
||||||
import { dataPluginMock } from '@kbn/data-plugin/public/mocks';
|
import { dataPluginMock } from '@kbn/data-plugin/public/mocks';
|
||||||
import { IUiSettingsClient } from '@kbn/core/public';
|
import { IUiSettingsClient } from '@kbn/core/public';
|
||||||
import { coreMock } from '@kbn/core/server/mocks';
|
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 { KibanaContextProvider } from '@kbn/kibana-react-plugin/public';
|
||||||
import { __IntlProvider as IntlProvider } from '@kbn/i18n-react';
|
import { __IntlProvider as IntlProvider } from '@kbn/i18n-react';
|
||||||
import { ValueControlForm } from './value_control_form';
|
import { ValueControlForm } from './value_control_form';
|
||||||
|
|
|
@ -22,7 +22,8 @@ import {
|
||||||
import { css } from '@emotion/react';
|
import { css } from '@emotion/react';
|
||||||
import { FormattedMessage } from '@kbn/i18n-react';
|
import { FormattedMessage } from '@kbn/i18n-react';
|
||||||
import type { ISearchGeneric } from '@kbn/search-types';
|
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 {
|
import {
|
||||||
getIndexPatternFromESQLQuery,
|
getIndexPatternFromESQLQuery,
|
||||||
getESQLResults,
|
getESQLResults,
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
|
|
||||||
import { dataPluginMock } from '@kbn/data-plugin/public/mocks';
|
import { dataPluginMock } from '@kbn/data-plugin/public/mocks';
|
||||||
import { coreMock } from '@kbn/core/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';
|
import { CreateESQLControlAction } from './esql_control_action';
|
||||||
|
|
||||||
describe('update ES|QL query action', () => {
|
describe('update ES|QL query action', () => {
|
||||||
|
|
|
@ -11,7 +11,8 @@ import { i18n } from '@kbn/i18n';
|
||||||
import type { Action } from '@kbn/ui-actions-plugin/public';
|
import type { Action } from '@kbn/ui-actions-plugin/public';
|
||||||
import type { CoreStart } from '@kbn/core/public';
|
import type { CoreStart } from '@kbn/core/public';
|
||||||
import type { ISearchGeneric } from '@kbn/search-types';
|
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 { monaco } from '@kbn/monaco';
|
||||||
import type { ESQLControlState } from './types';
|
import type { ESQLControlState } from './types';
|
||||||
import { isActionCompatible, executeAction } from './esql_control_helpers';
|
import { isActionCompatible, executeAction } from './esql_control_helpers';
|
||||||
|
|
|
@ -12,7 +12,7 @@ import { KibanaContextProvider } from '@kbn/kibana-react-plugin/public';
|
||||||
import { KibanaRenderContextProvider } from '@kbn/react-kibana-context-render';
|
import { KibanaRenderContextProvider } from '@kbn/react-kibana-context-render';
|
||||||
import type { CoreStart } from '@kbn/core/public';
|
import type { CoreStart } from '@kbn/core/public';
|
||||||
import type { ISearchGeneric } from '@kbn/search-types';
|
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 { toMountPoint } from '@kbn/react-kibana-mount';
|
||||||
import { monaco } from '@kbn/monaco';
|
import { monaco } from '@kbn/monaco';
|
||||||
import { untilPluginStartServicesReady } from '../../kibana_services';
|
import { untilPluginStartServicesReady } from '../../kibana_services';
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
* your election, the "Elastic License 2.0", the "GNU Affero General Public
|
* your election, the "Elastic License 2.0", the "GNU Affero General Public
|
||||||
* License v3.0 only", or the "Server Side Public License, v 1".
|
* 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 {
|
export enum EsqlControlType {
|
||||||
STATIC_VALUES = 'STATIC_VALUES',
|
STATIC_VALUES = 'STATIC_VALUES',
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
* your election, the "Elastic License 2.0", the "GNU Affero General Public
|
* your election, the "Elastic License 2.0", the "GNU Affero General Public
|
||||||
* License v3.0 only", or the "Server Side Public License, v 1".
|
* 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';
|
import { EsqlVariablesService } from './variables_service';
|
||||||
|
|
||||||
describe('EsqlVariablesService', () => {
|
describe('EsqlVariablesService', () => {
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
* License v3.0 only", or the "Server Side Public License, v 1".
|
* 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 {
|
export class EsqlVariablesService {
|
||||||
esqlVariables: ESQLControlVariable[] = [];
|
esqlVariables: ESQLControlVariable[] = [];
|
||||||
|
|
|
@ -34,6 +34,7 @@
|
||||||
"@kbn/core-test-helpers-kbn-server",
|
"@kbn/core-test-helpers-kbn-server",
|
||||||
"@kbn/i18n-react",
|
"@kbn/i18n-react",
|
||||||
"@kbn/visualization-utils",
|
"@kbn/visualization-utils",
|
||||||
|
"@kbn/esql-types",
|
||||||
],
|
],
|
||||||
"exclude": [
|
"exclude": [
|
||||||
"target/**/*",
|
"target/**/*",
|
||||||
|
|
|
@ -880,14 +880,14 @@
|
||||||
"@kbn/esql-datagrid/*": ["src/platform/plugins/shared/esql_datagrid/*"],
|
"@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-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-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-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-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/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"],
|
"@kbn/event-annotation-common": ["src/platform/packages/shared/kbn-event-annotation-common"],
|
||||||
|
|
|
@ -13,7 +13,7 @@ import {
|
||||||
} from '@kbn/esql-utils';
|
} from '@kbn/esql-utils';
|
||||||
import { isEqual, cloneDeep } from 'lodash';
|
import { isEqual, cloneDeep } from 'lodash';
|
||||||
import { type AggregateQuery, buildEsQuery } from '@kbn/es-query';
|
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 type { ESQLRow } from '@kbn/es-types';
|
||||||
import {
|
import {
|
||||||
getLensAttributesFromSuggestion,
|
getLensAttributesFromSuggestion,
|
||||||
|
|
|
@ -35,7 +35,7 @@ import {
|
||||||
import { PublishesSearchSession } from '@kbn/presentation-publishing/interfaces/fetch/publishes_search_session';
|
import { PublishesSearchSession } from '@kbn/presentation-publishing/interfaces/fetch/publishes_search_session';
|
||||||
import { isObject } from 'lodash';
|
import { isObject } from 'lodash';
|
||||||
import { createMockDatasource, defaultDoc } from '../mocks';
|
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 * as Logger from './logger';
|
||||||
import { buildObservableVariable } from './helper';
|
import { buildObservableVariable } from './helper';
|
||||||
|
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
|
|
||||||
import type { DefaultInspectorAdapters } from '@kbn/expressions-plugin/common';
|
import type { DefaultInspectorAdapters } from '@kbn/expressions-plugin/common';
|
||||||
import { apiPublishesUnifiedSearch, fetch$ } from '@kbn/presentation-publishing';
|
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 { type KibanaExecutionContext } from '@kbn/core/public';
|
||||||
import {
|
import {
|
||||||
BehaviorSubject,
|
BehaviorSubject,
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
* 2.0; you may not use this file except in compliance with the Elastic License
|
* 2.0; you may not use this file except in compliance with the Elastic License
|
||||||
* 2.0.
|
* 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 { DataPublicPluginStart, FilterManager } from '@kbn/data-plugin/public';
|
||||||
import {
|
import {
|
||||||
type AggregateQuery,
|
type AggregateQuery,
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
|
|
||||||
import { BehaviorSubject } from 'rxjs';
|
import { BehaviorSubject } from 'rxjs';
|
||||||
import { initializeTitleManager } from '@kbn/presentation-publishing';
|
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 type { DataView } from '@kbn/data-views-plugin/common';
|
||||||
import { buildObservableVariable, createEmptyLensState } from '../helper';
|
import { buildObservableVariable, createEmptyLensState } from '../helper';
|
||||||
import type {
|
import type {
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
* 2.0; you may not use this file except in compliance with the Elastic License
|
* 2.0; you may not use this file except in compliance with the Elastic License
|
||||||
* 2.0.
|
* 2.0.
|
||||||
*/
|
*/
|
||||||
import { ESQLVariableType } from '@kbn/esql-validation-autocomplete';
|
import { ESQLVariableType } from '@kbn/esql-types';
|
||||||
import { getEmbeddableVariables } from './utils';
|
import { getEmbeddableVariables } from './utils';
|
||||||
|
|
||||||
describe('getEmbeddableVariables', () => {
|
describe('getEmbeddableVariables', () => {
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
* 2.0.
|
* 2.0.
|
||||||
*/
|
*/
|
||||||
import { type AggregateQuery, type Query, isOfAggregateQueryType } from '@kbn/es-query';
|
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 { ENABLE_ESQL, getESQLQueryVariables } from '@kbn/esql-utils';
|
||||||
import type { LensEmbeddableStartServices } from '../types';
|
import type { LensEmbeddableStartServices } from '../types';
|
||||||
|
|
||||||
|
|
|
@ -13,7 +13,7 @@ import type {
|
||||||
TimeRange,
|
TimeRange,
|
||||||
} from '@kbn/es-query';
|
} from '@kbn/es-query';
|
||||||
import type { Adapters, InspectorOptions } from '@kbn/inspector-plugin/public';
|
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 {
|
import type {
|
||||||
HasEditCapabilities,
|
HasEditCapabilities,
|
||||||
HasLibraryTransforms,
|
HasLibraryTransforms,
|
||||||
|
|
|
@ -119,8 +119,7 @@
|
||||||
"@kbn/core-chrome-browser",
|
"@kbn/core-chrome-browser",
|
||||||
"@kbn/core-capabilities-common",
|
"@kbn/core-capabilities-common",
|
||||||
"@kbn/presentation-panel-plugin",
|
"@kbn/presentation-panel-plugin",
|
||||||
"@kbn/esql-validation-autocomplete",
|
"@kbn/esql-types",
|
||||||
"@kbn/esql-variables-types",
|
|
||||||
],
|
],
|
||||||
"exclude": ["target/**/*"]
|
"exclude": ["target/**/*"]
|
||||||
}
|
}
|
||||||
|
|
|
@ -5603,6 +5603,10 @@
|
||||||
version "0.0.0"
|
version "0.0.0"
|
||||||
uid ""
|
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":
|
"@kbn/esql-utils@link:src/platform/packages/shared/kbn-esql-utils":
|
||||||
version "0.0.0"
|
version "0.0.0"
|
||||||
uid ""
|
uid ""
|
||||||
|
@ -5615,10 +5619,6 @@
|
||||||
version "0.0.0"
|
version "0.0.0"
|
||||||
uid ""
|
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":
|
"@kbn/esql@link:src/platform/plugins/shared/esql":
|
||||||
version "0.0.0"
|
version "0.0.0"
|
||||||
uid ""
|
uid ""
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue