Skip to content

Commit

Permalink
Merge branch 'main' into rules-management-client-refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
jpdjere authored May 24, 2024
2 parents 366bc6d + 0cce8a8 commit 89d24ff
Show file tree
Hide file tree
Showing 108 changed files with 19,702 additions and 5,194 deletions.
1 change: 0 additions & 1 deletion packages/kbn-es-types/src/search.ts
Original file line number Diff line number Diff line change
Expand Up @@ -688,7 +688,6 @@ export interface ESQLSearchParams {
// https://github.com/elastic/elasticsearch/pull/102767
// time_zone?: string;
query: string;
version: string;
filter?: unknown;
locale?: string;
dropNullColumns?: boolean;
Expand Down
4 changes: 1 addition & 3 deletions packages/kbn-esql-utils/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
* in compliance with, at your election, the Elastic License 2.0 or the Server
* Side Public License, v 1.
*/

// we are expecting to retrieve this from an API instead
// https://github.com/elastic/elasticsearch/issues/107069
// only used for security solution
export const ESQL_LATEST_VERSION = '2024.04.01';
export const ENABLE_ESQL = 'enableESQL';
2 changes: 1 addition & 1 deletion packages/kbn-esql-utils/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ export {
TextBasedLanguages,
} from './src';

export { ESQL_LATEST_VERSION, ENABLE_ESQL } from './constants';
export { ENABLE_ESQL, ESQL_LATEST_VERSION } from './constants';
4 changes: 0 additions & 4 deletions packages/kbn-esql-utils/src/utils/run_query.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import type { ISearchGeneric } from '@kbn/search-types';
import { esFieldTypeToKibanaFieldType } from '@kbn/field-types';
import type { ESQLColumn, ESQLSearchReponse, ESQLSearchParams } from '@kbn/es-types';
import { lastValueFrom } from 'rxjs';
import { ESQL_LATEST_VERSION } from '../../constants';

export function formatESQLColumns(columns: ESQLColumn[]): DatatableColumn[] {
return columns.map(({ name, type }) => {
Expand Down Expand Up @@ -41,7 +40,6 @@ export async function getESQLQueryColumnsRaw({
{
params: {
query: `${esqlQuery} | limit 0`,
version: ESQL_LATEST_VERSION,
},
},
{
Expand Down Expand Up @@ -76,7 +74,6 @@ export async function getESQLQueryColumns({
try {
const rawColumns = await getESQLQueryColumnsRaw({ esqlQuery, search, signal });
const columns = formatESQLColumns(rawColumns) ?? [];

return columns;
} catch (error) {
throw new Error(
Expand Down Expand Up @@ -112,7 +109,6 @@ export async function getESQLResults({
params: {
...(filter ? { filter } : {}),
query: esqlQuery,
version: ESQL_LATEST_VERSION,
...(dropNullColumns ? { dropNullColumns: true } : {}),
},
},
Expand Down
1 change: 1 addition & 0 deletions packages/kbn-esql-validation-autocomplete/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ load("@build_bazel_rules_nodejs//:index.bzl", "js_library")
SRCS = glob(
[
"**/*.ts",
"**/*functions.json",
],
exclude = [
"**/*.config.js",
Expand Down
7 changes: 6 additions & 1 deletion packages/kbn-esql-validation-autocomplete/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@
"license": "SSPL-1.0 OR Elastic License 2.0",
"sideEffects": false,
"scripts": {
"maketests": "ts-node --transpileOnly ./scripts/generate_function_validation_tests.ts"
"make:tests": "ts-node --transpileOnly ./scripts/generate_function_validation_tests.ts",
"postmake:tests": "yarn run lint:fix",
"make:defs": "ts-node --transpileOnly ./scripts/generate_function_definitions.ts",
"postmake:defs": "yarn run lint:fix && yarn run i18n:fix",
"lint:fix": "cd ../.. && node ./scripts/eslint --fix ./packages/kbn-esql-validation-autocomplete/src/**/*.ts",
"i18n:fix": "cd ../.. && node ./scripts/i18n_check.js --fix"
}
}
Loading

0 comments on commit 89d24ff

Please sign in to comment.