From 807da63c617a8a9ad0b0d90e20a065fd499940fa Mon Sep 17 00:00:00 2001 From: Stratoula Kalafateli Date: Mon, 6 May 2024 10:51:40 +0200 Subject: [PATCH 1/6] [ES|QL] Fetch the query columns utils (#182338) ## Summary Revives this https://github.com/elastic/kibana/pull/181969 To do so, I had to create a new package `search-types` and move the types I need there. The Discovery team can take it from here. Note: It also does a cleanup on the types I move, some of them were declared twice. --------- Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com> --- .github/CODEOWNERS | 1 + .i18nrc.json | 1 + examples/search_examples/common/types.ts | 6 +- .../search_examples/public/search/app.tsx | 7 +- .../public/search_sessions/app.tsx | 4 +- .../search_examples/public/sql_search/app.tsx | 8 +-- .../server/routes/server_search_route.ts | 3 +- examples/search_examples/tsconfig.json | 3 +- package.json | 1 + packages/kbn-esql-utils/index.ts | 1 + packages/kbn-esql-utils/src/index.ts | 1 + .../kbn-esql-utils/src/utils/run_query.ts | 52 ++++++++++++++ packages/kbn-esql-utils/tsconfig.json | 4 ++ .../kbn-generate-csv/src/generate_csv.test.ts | 4 +- packages/kbn-generate-csv/src/generate_csv.ts | 3 +- .../src/generate_csv_esql.test.ts | 2 +- .../kbn-generate-csv/src/generate_csv_esql.ts | 9 +-- .../kbn-generate-csv/src/lib/search_cursor.ts | 8 +-- .../src/lib/search_cursor_pit.test.ts | 2 +- .../src/lib/search_cursor_scroll.test.ts | 2 +- .../src/lib/search_cursor_scroll.ts | 2 +- packages/kbn-generate-csv/tsconfig.json | 1 + packages/kbn-search-errors/src/types.ts | 14 +--- packages/kbn-search-errors/tsconfig.json | 1 + packages/kbn-search-types/README.md | 3 + packages/kbn-search-types/index.ts | 24 +++++++ packages/kbn-search-types/jest.config.js | 13 ++++ packages/kbn-search-types/kibana.jsonc | 5 ++ packages/kbn-search-types/package.json | 9 +++ .../kbn-search-types/src/es_search_types.ts | 21 ++++++ .../src/kibana_search_types.ts | 71 +++++++++++++++++++ .../kbn-search-types/src}/types.ts | 66 +---------------- packages/kbn-search-types/tsconfig.json | 12 ++++ .../field_existing/field_existing_utils.ts | 2 +- .../load_field_stats_text_based.ts | 7 +- packages/kbn-unified-field-list/tsconfig.json | 3 +- .../data/common/search/aggs/agg_config.ts | 3 +- .../common/search/aggs/agg_configs.test.ts | 2 +- .../data/common/search/aggs/agg_configs.ts | 4 +- .../common/search/aggs/param_types/base.ts | 3 +- .../data/common/search/expressions/eql.ts | 2 +- .../data/common/search/expressions/esdsl.ts | 4 +- .../data/common/search/expressions/esql.ts | 10 +-- .../data/common/search/expressions/essql.ts | 2 +- src/plugins/data/common/search/index.ts | 1 - src/plugins/data/common/search/poll_search.ts | 3 +- .../search_source/fetch/get_search_params.ts | 3 +- .../search_source/fetch/request_error.ts | 2 +- .../search/search_source/fetch/types.ts | 3 +- .../search_source/search_source.test.ts | 2 +- .../search/search_source/search_source.ts | 5 +- .../data/common/search/search_source/types.ts | 3 +- .../search/strategies/eql_search/types.ts | 4 +- .../search/strategies/es_search/types.ts | 15 ---- .../search/strategies/sql_search/types.ts | 2 +- src/plugins/data/common/search/utils.test.ts | 2 +- src/plugins/data/common/search/utils.ts | 2 +- src/plugins/data/public/index.ts | 6 -- src/plugins/data/public/search/index.ts | 5 -- .../search_interceptor.test.ts | 2 +- .../search_interceptor/search_interceptor.ts | 11 +-- .../search_response_cache.test.ts | 2 +- .../search_response_cache.ts | 2 +- .../to_partial_response.test.ts | 2 +- .../search_interceptor/to_partial_response.ts | 2 +- .../data/public/search/search_service.ts | 2 +- .../public/search/session/session_service.ts | 2 +- src/plugins/data/public/search/types.ts | 3 +- src/plugins/data/server/index.ts | 8 +-- .../server/search/collectors/search/usage.ts | 2 +- .../data/server/search/report_search_error.ts | 2 +- .../data/server/search/routes/bsearch.ts | 8 +-- .../server/search/sanitize_request_params.ts | 2 +- .../data/server/search/search_service.test.ts | 5 +- .../data/server/search/search_service.ts | 12 ++-- .../server/search/session/session_service.ts | 3 +- .../data/server/search/session/types.ts | 3 +- .../search/strategies/common/async_utils.ts | 2 +- .../search/strategies/es_search/index.ts | 1 - .../strategies/es_search/response_utils.ts | 2 +- .../ese_search/ese_search_strategy.ts | 8 +-- .../strategies/ese_search/request_utils.ts | 3 +- .../strategies/ese_search/response_utils.ts | 2 +- .../search/strategies/ese_search/types.ts | 2 +- .../esql_async_search_strategy.ts | 3 +- .../esql_async_search/response_utils.ts | 2 +- .../strategies/sql_search/request_utils.ts | 2 +- src/plugins/data/server/search/types.ts | 14 ++-- src/plugins/data/tsconfig.json | 3 +- .../discover/public/__mocks__/services.ts | 8 +-- .../application/context/services/_stubs.ts | 2 +- .../data_fetching/fetch_documents.test.ts | 2 +- src/plugins/discover/tsconfig.json | 3 +- src/plugins/saved_search/public/mocks.ts | 3 +- src/plugins/saved_search/tsconfig.json | 1 + .../public/chart/histogram.tsx | 2 +- src/plugins/unified_histogram/tsconfig.json | 1 + .../vega/public/data_model/search_api.ts | 2 +- src/plugins/vis_types/vega/tsconfig.json | 1 + test/common/services/bsearch.ts | 2 +- test/tsconfig.json | 1 + tsconfig.base.json | 2 + .../src/use_cancellable_search.ts | 3 +- .../ml/cancellable_search/tsconfig.json | 3 +- .../public/hooks/use_cancellable_search.ts | 3 +- x-pack/plugins/aiops/tsconfig.json | 1 + .../server/lib/wrap_search_source_client.ts | 2 +- x-pack/plugins/alerting/tsconfig.json | 1 + x-pack/plugins/canvas/tsconfig.json | 1 + x-pack/plugins/canvas/types/strategy.ts | 2 +- .../latest_findings/use_grouped_findings.tsx | 2 +- .../latest_findings/use_latest_findings.ts | 2 +- .../hooks/use_grouped_vulnerabilities.tsx | 2 +- .../hooks/use_latest_vulnerabilities.tsx | 2 +- .../cloud_security_posture/tsconfig.json | 3 +- .../common/types/field_stats.ts | 2 +- .../data_drift/use_data_drift_result.ts | 2 +- .../doc_count_chart/doc_count_search.ts | 4 +- .../hooks/esql/use_esql_overall_stats_data.ts | 2 +- .../hooks/use_field_stats.ts | 2 +- .../hooks/use_overall_stats.ts | 4 +- .../requests/get_boolean_field_stats.ts | 6 +- .../requests/get_date_field_stats.ts | 6 +- .../requests/get_document_stats.ts | 3 +- .../requests/get_field_examples.ts | 6 +- .../requests/get_fields_stats.ts | 2 +- .../requests/get_numeric_field_stats.ts | 4 +- .../requests/get_string_field_stats.ts | 6 +- .../search_strategy/requests/overall_stats.ts | 2 +- x-pack/plugins/data_visualizer/tsconfig.json | 3 +- ...ytics_collection_explore_table_formulas.ts | 4 +- ...nalytics_collection_explore_table_logic.ts | 9 +-- .../plugins/enterprise_search/tsconfig.json | 3 +- .../shared/edit_on_the_fly/helpers.test.ts | 57 ++++++++------- .../shared/edit_on_the_fly/helpers.ts | 36 +++------- .../open_lens_config/create_action_helpers.ts | 26 +++---- .../latency_correlations.test.tsx | 2 +- .../observability_solution/apm/tsconfig.json | 1 + .../context/fixtures/log_entries.ts | 4 +- .../asset_details/__stories__/decorator.tsx | 7 +- .../metrics/hosts/hooks/use_host_count.ts | 3 +- .../flatten_data_search_response.ts | 2 +- .../normalize_data_search_responses.ts | 2 +- .../infra/public/utils/data_search/types.ts | 6 +- .../use_data_search_request.test.tsx | 8 +-- .../data_search/use_data_search_request.ts | 6 +- .../use_data_search_response_state.ts | 2 +- ...test_partial_data_search_response.test.tsx | 2 +- ...use_latest_partial_data_search_response.ts | 2 +- .../infra/tsconfig.json | 3 +- .../log_stream.story_decorators.tsx | 8 +-- .../log_stream/use_fetch_log_entries_after.ts | 2 +- .../use_fetch_log_entries_before.ts | 2 +- .../services/log_views/log_views_client.ts | 2 +- .../flatten_data_search_response.ts | 2 +- .../normalize_data_search_responses.ts | 2 +- .../public/utils/data_search/types.ts | 7 +- .../use_data_search_request.test.tsx | 8 +-- .../data_search/use_data_search_request.ts | 6 +- .../use_data_search_response_state.ts | 2 +- ...test_partial_data_search_response.test.tsx | 2 +- ...use_latest_partial_data_search_response.ts | 2 +- .../log_entries_search_strategy.test.ts | 8 +-- .../log_entries_search_strategy.ts | 6 +- .../log_entry_search_strategy.test.ts | 8 +-- .../log_entries/log_entry_search_strategy.ts | 6 +- .../logs_shared/tsconfig.json | 1 + .../synthetics/state/elasticsearch/api.ts | 4 +- .../synthetics/tsconfig.json | 3 +- .../app/rum_dashboard/ux_overview_fetchers.ts | 2 +- .../observability_solution/ux/tsconfig.json | 3 +- .../common/search_strategy/common/index.ts | 2 +- .../search_strategy/osquery/actions/index.ts | 4 +- .../search_strategy/osquery/agents/index.ts | 2 +- .../common/search_strategy/osquery/index.ts | 2 +- .../search_strategy/osquery/results/index.ts | 2 +- .../osquery/factory/actions/all/index.ts | 2 +- .../actions/all/query.all_actions.dsl.ts | 2 +- .../osquery/factory/actions/details/index.ts | 2 +- .../details/query.action_details.dsl.ts | 2 +- .../results/query.action_results.dsl.ts | 2 +- .../osquery/factory/results/index.ts | 2 +- .../factory/results/query.all_results.dsl.ts | 2 +- .../search_strategy/osquery/factory/types.ts | 2 +- x-pack/plugins/osquery/tsconfig.json | 3 +- .../common/search_strategy/index.ts | 2 +- x-pack/plugins/rule_registry/tsconfig.json | 1 + .../first_seen_last_seen.ts | 2 +- .../common/search_strategy/common/index.ts | 2 +- .../common/search_strategy/endpoint/index.ts | 2 +- .../endpoint/response_actions/action.ts | 2 +- .../endpoint/response_actions/response.ts | 2 +- .../endpoint/response_actions/types.ts | 2 +- .../security_solution/cti/index.mock.ts | 2 +- .../security_solution/cti/index.ts | 2 +- .../security_solution/hosts/all/index.ts | 2 +- .../security_solution/hosts/details/index.ts | 2 +- .../security_solution/hosts/overview/index.ts | 2 +- .../hosts/uncommon_processes/index.ts | 2 +- .../network/details/index.ts | 2 +- .../security_solution/network/dns/index.ts | 2 +- .../security_solution/network/http/index.ts | 2 +- .../network/overview/index.ts | 2 +- .../security_solution/network/tls/index.ts | 2 +- .../network/top_countries/index.ts | 2 +- .../network/top_n_flow/index.ts | 2 +- .../security_solution/network/users/index.ts | 2 +- .../related_entities/related_hosts/index.tsx | 2 +- .../related_entities/related_users/index.tsx | 2 +- .../security_solution/risk_score/all/index.ts | 2 +- .../security_solution/risk_score/kpi/index.ts | 2 +- .../security_solution/users/all/index.ts | 2 +- .../users/authentications/index.ts | 2 +- .../users/managed_details/index.ts | 2 +- .../users/observed_details/index.ts | 2 +- .../shared/hooks/use_fetch_prevalence.ts | 2 +- .../shared/utils/build_requests.ts | 2 +- .../shared/utils/fetch_data.ts | 3 +- .../management/services/policies/hooks.ts | 2 +- .../server/endpoint/routes/policy/service.ts | 2 +- .../wrap_search_source_client.ts | 2 +- .../factory/response_actions/actions/index.ts | 2 +- .../actions/query.all_actions.dsl.ts | 2 +- .../results/query.action_results.dsl.ts | 2 +- .../search_strategy/endpoint/factory/types.ts | 2 +- .../endpoint_package_policies_stats/index.ts | 2 +- .../factory/cti/event_enrichment/response.ts | 2 +- .../factory/cti/threat_intel_source/index.ts | 2 +- .../factory/hosts/all/__mocks__/index.ts | 2 +- .../factory/hosts/all/index.ts | 2 +- .../factory/hosts/all/query.all_hosts.dsl.ts | 2 +- .../factory/hosts/details/__mocks__/index.ts | 2 +- .../factory/hosts/details/index.ts | 2 +- .../hosts/details/query.host_details.dsl.ts | 2 +- .../factory/hosts/overview/__mocks__/index.ts | 2 +- .../factory/hosts/overview/index.ts | 2 +- .../hosts/overview/query.overview_host.dsl.ts | 2 +- .../factory/hosts/uncommon_processes/index.ts | 2 +- .../factory/last_first_seen/index.ts | 2 +- .../network/details/__mocks__/index.ts | 2 +- .../factory/network/details/index.ts | 2 +- .../factory/network/dns/__mocks__/index.ts | 2 +- .../factory/network/dns/helpers.ts | 2 +- .../factory/network/dns/index.ts | 2 +- .../factory/network/http/__mocks__/index.ts | 2 +- .../factory/network/http/helpers.ts | 2 +- .../factory/network/http/index.ts | 2 +- .../network/overview/__mocks__/index.ts | 2 +- .../factory/network/overview/index.ts | 2 +- .../overview/query.overview_network.dsl.ts | 2 +- .../factory/network/tls/__mocks__/index.ts | 2 +- .../factory/network/tls/helpers.ts | 2 +- .../factory/network/tls/index.ts | 2 +- .../network/top_countries/__mocks__/index.ts | 2 +- .../factory/network/top_countries/helpers.ts | 2 +- .../factory/network/top_countries/index.ts | 2 +- .../network/top_n_flow/__mocks__/index.ts | 2 +- .../factory/network/top_n_flow/helpers.ts | 2 +- .../factory/network/top_n_flow/index.ts | 2 +- .../query.top_n_flow_network.dsl.ts | 2 +- .../factory/network/users/__mocks__/index.ts | 2 +- .../factory/network/users/helpers.ts | 2 +- .../factory/network/users/index.ts | 2 +- .../related_hosts/__mocks__/index.ts | 2 +- .../related_entities/related_hosts/index.ts | 2 +- .../related_hosts/query.related_hosts.dsl.ts | 2 +- .../related_users/__mocks__/index.ts | 2 +- .../related_entities/related_users/index.ts | 2 +- .../related_users/query.related_users.dsl.ts | 2 +- .../factory/risk_score/all/index.test.ts | 2 +- .../factory/risk_score/all/index.ts | 4 +- .../factory/risk_score/kpi/index.ts | 2 +- .../security_solution/factory/types.ts | 2 +- .../factory/users/all/__mocks__/index.ts | 2 +- .../factory/users/all/index.ts | 2 +- .../factory/users/all/query.all_users.dsl.ts | 2 +- .../users/authentications/__mocks__/index.ts | 2 +- .../factory/users/authentications/index.tsx | 2 +- .../users/managed_details/index.test.ts | 3 +- .../factory/users/managed_details/index.ts | 2 +- .../query.managed_user_details.dsl.ts | 2 +- .../users/observed_details/__mocks__/index.ts | 2 +- .../factory/users/observed_details/index.ts | 2 +- .../query.observed_user_details.dsl.ts | 2 +- .../plugins/security_solution/tsconfig.json | 3 +- .../logs_signal/overview_registration.ts | 2 +- .../serverless_observability/tsconfig.json | 1 + .../expression/es_query_expression.test.tsx | 7 +- x-pack/plugins/stack_alerts/tsconfig.json | 1 + .../components/comment_children.stories.tsx | 2 +- .../indicators/hooks/use_total_count.tsx | 7 +- .../public/utils/search.ts | 8 +-- .../server/search_strategy.ts | 7 +- .../plugins/threat_intelligence/tsconfig.json | 3 +- .../search_strategy/index_fields/index.ts | 3 +- .../timeline/events/all/index.ts | 2 +- .../timeline/events/details/index.ts | 2 +- .../timeline/events/last_event_time/index.ts | 2 +- .../timeline/factory/events/all/index.ts | 2 +- .../timeline/factory/events/details/index.ts | 2 +- .../timeline/factory/events/kpi/index.ts | 2 +- .../factory/events/last_event_time/index.ts | 2 +- .../query.events_last_event_time.dsl.ts | 2 +- .../search_strategy/timeline/factory/types.ts | 3 +- .../server/search_strategy/timeline/index.ts | 3 +- x-pack/plugins/timelines/tsconfig.json | 1 + .../public/app/__mocks__/app_dependencies.tsx | 3 +- .../public/app/hooks/use_data_search.ts | 2 +- x-pack/plugins/transform/tsconfig.json | 3 +- .../hooks/use_fetch_alerts.test.tsx | 2 +- .../plugins/triggers_actions_ui/tsconfig.json | 3 +- x-pack/test/common/services/bsearch_secure.ts | 2 +- x-pack/test/tsconfig.json | 1 + yarn.lock | 4 ++ 314 files changed, 679 insertions(+), 603 deletions(-) create mode 100644 packages/kbn-esql-utils/src/utils/run_query.ts create mode 100644 packages/kbn-search-types/README.md create mode 100644 packages/kbn-search-types/index.ts create mode 100644 packages/kbn-search-types/jest.config.js create mode 100644 packages/kbn-search-types/kibana.jsonc create mode 100644 packages/kbn-search-types/package.json create mode 100644 packages/kbn-search-types/src/es_search_types.ts create mode 100644 packages/kbn-search-types/src/kibana_search_types.ts rename {src/plugins/data/common/search => packages/kbn-search-types/src}/types.ts (72%) create mode 100644 packages/kbn-search-types/tsconfig.json diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index ff98ba54635bd..ed7c3a75a24e7 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -707,6 +707,7 @@ packages/kbn-search-index-documents @elastic/enterprise-search-frontend x-pack/plugins/search_notebooks @elastic/enterprise-search-frontend x-pack/plugins/search_playground @elastic/enterprise-search-frontend packages/kbn-search-response-warnings @elastic/kibana-data-discovery +packages/kbn-search-types @elastic/kibana-data-discovery x-pack/plugins/searchprofiler @elastic/kibana-management x-pack/test/security_api_integration/packages/helpers @elastic/kibana-security packages/kbn-security-hardening @elastic/kibana-security diff --git a/.i18nrc.json b/.i18nrc.json index f853d3e1d8796..1a29b7b9ed68d 100644 --- a/.i18nrc.json +++ b/.i18nrc.json @@ -109,6 +109,7 @@ "searchErrors": "packages/kbn-search-errors", "searchIndexDocuments": "packages/kbn-search-index-documents", "searchResponseWarnings": "packages/kbn-search-response-warnings", + "searchTypes": "packages/kbn-search-types", "securitySolutionPackages": "x-pack/packages/security-solution", "serverlessPackages": "packages/serverless", "coloring": "packages/kbn-coloring/src", diff --git a/examples/search_examples/common/types.ts b/examples/search_examples/common/types.ts index c2e174ca4731e..0f9efcca759f3 100644 --- a/examples/search_examples/common/types.ts +++ b/examples/search_examples/common/types.ts @@ -7,11 +7,11 @@ */ import { - IEsSearchRequest, - IEsSearchResponse, IKibanaSearchRequest, IKibanaSearchResponse, -} from '@kbn/data-plugin/common'; + IEsSearchRequest, + IEsSearchResponse, +} from '@kbn/search-types'; export interface IMyStrategyRequest extends IEsSearchRequest { get_cool: boolean; diff --git a/examples/search_examples/public/search/app.tsx b/examples/search_examples/public/search/app.tsx index 014ef1d8f3080..91489d0e55ef1 100644 --- a/examples/search_examples/public/search/app.tsx +++ b/examples/search_examples/public/search/app.tsx @@ -26,11 +26,8 @@ import { } from '@elastic/eui'; import { CoreStart } from '@kbn/core/public'; import { IInspectorInfo } from '@kbn/data-plugin/common'; -import { - DataPublicPluginStart, - IKibanaSearchResponse, - isRunningResponse, -} from '@kbn/data-plugin/public'; +import { DataPublicPluginStart, isRunningResponse } from '@kbn/data-plugin/public'; +import type { IKibanaSearchResponse } from '@kbn/search-types'; import type { SearchResponseWarning } from '@kbn/search-response-warnings'; import type { DataView, DataViewField } from '@kbn/data-views-plugin/public'; import { i18n } from '@kbn/i18n'; diff --git a/examples/search_examples/public/search_sessions/app.tsx b/examples/search_examples/public/search_sessions/app.tsx index d6adcd2c26f3e..7c9f28cee1026 100644 --- a/examples/search_examples/public/search_sessions/app.tsx +++ b/examples/search_examples/public/search_sessions/app.tsx @@ -34,11 +34,11 @@ import { mountReactNode } from '@kbn/core-mount-utils-browser-internal'; import type { TimeRange } from '@kbn/es-query'; import { NavigationPublicPluginStart } from '@kbn/navigation-plugin/public'; +import type { IEsSearchRequest, IEsSearchResponse } from '@kbn/search-types'; + import { connectToQueryState, DataPublicPluginStart, - IEsSearchRequest, - IEsSearchResponse, isRunningResponse, QueryState, SearchSessionState, diff --git a/examples/search_examples/public/sql_search/app.tsx b/examples/search_examples/public/sql_search/app.tsx index 86580a55e714f..4715ac257cde4 100644 --- a/examples/search_examples/public/sql_search/app.tsx +++ b/examples/search_examples/public/sql_search/app.tsx @@ -22,12 +22,8 @@ import { } from '@elastic/eui'; import { CoreStart } from '@kbn/core/public'; - -import { - DataPublicPluginStart, - IKibanaSearchResponse, - isRunningResponse, -} from '@kbn/data-plugin/public'; +import type { IKibanaSearchResponse } from '@kbn/search-types'; +import { DataPublicPluginStart, isRunningResponse } from '@kbn/data-plugin/public'; import { SQL_SEARCH_STRATEGY, SqlSearchStrategyRequest, diff --git a/examples/search_examples/server/routes/server_search_route.ts b/examples/search_examples/server/routes/server_search_route.ts index 632952b6c4617..dfd859f6c4cfd 100644 --- a/examples/search_examples/server/routes/server_search_route.ts +++ b/examples/search_examples/server/routes/server_search_route.ts @@ -7,9 +7,8 @@ */ import { Observable } from 'rxjs'; -import { IEsSearchRequest } from '@kbn/data-plugin/server'; +import type { IEsSearchRequest, IEsSearchResponse } from '@kbn/search-types'; import { schema } from '@kbn/config-schema'; -import { IEsSearchResponse } from '@kbn/data-plugin/common'; import type { DataRequestHandlerContext } from '@kbn/data-plugin/server'; import type { IRouter } from '@kbn/core/server'; import { SERVER_SEARCH_ROUTE_PATH } from '../../common'; diff --git a/examples/search_examples/tsconfig.json b/examples/search_examples/tsconfig.json index fb5136311fe1c..18156d4bfa198 100644 --- a/examples/search_examples/tsconfig.json +++ b/examples/search_examples/tsconfig.json @@ -31,8 +31,9 @@ "@kbn/core-mount-utils-browser-internal", "@kbn/config-schema", "@kbn/shared-ux-router", - "@kbn/search-response-warnings", + "@kbn/search-types", "@kbn/shared-ux-link-redirect-app", "@kbn/react-kibana-mount", + "@kbn/search-response-warnings", ] } diff --git a/package.json b/package.json index c37bcbb0001d5..4e13037e285d3 100644 --- a/package.json +++ b/package.json @@ -713,6 +713,7 @@ "@kbn/search-notebooks": "link:x-pack/plugins/search_notebooks", "@kbn/search-playground": "link:x-pack/plugins/search_playground", "@kbn/search-response-warnings": "link:packages/kbn-search-response-warnings", + "@kbn/search-types": "link:packages/kbn-search-types", "@kbn/searchprofiler-plugin": "link:x-pack/plugins/searchprofiler", "@kbn/security-hardening": "link:packages/kbn-security-hardening", "@kbn/security-plugin": "link:x-pack/plugins/security", diff --git a/packages/kbn-esql-utils/index.ts b/packages/kbn-esql-utils/index.ts index 4cda488ecfad1..3b1ad4fb337db 100644 --- a/packages/kbn-esql-utils/index.ts +++ b/packages/kbn-esql-utils/index.ts @@ -15,6 +15,7 @@ export { getInitialESQLQuery, getESQLWithSafeLimit, appendToESQLQuery, + getESQLQueryColumns, TextBasedLanguages, } from './src'; diff --git a/packages/kbn-esql-utils/src/index.ts b/packages/kbn-esql-utils/src/index.ts index 8bafe9d2737ff..9f39521634c05 100644 --- a/packages/kbn-esql-utils/src/index.ts +++ b/packages/kbn-esql-utils/src/index.ts @@ -16,3 +16,4 @@ export { removeDropCommandsFromESQLQuery, } from './utils/query_parsing_helpers'; export { appendToESQLQuery } from './utils/append_to_query'; +export { getESQLQueryColumns } from './utils/run_query'; diff --git a/packages/kbn-esql-utils/src/utils/run_query.ts b/packages/kbn-esql-utils/src/utils/run_query.ts new file mode 100644 index 0000000000000..d94d2e07e5a53 --- /dev/null +++ b/packages/kbn-esql-utils/src/utils/run_query.ts @@ -0,0 +1,52 @@ +/* + * 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 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 or the Server + * Side Public License, v 1. + */ +import type { DatatableColumn } from '@kbn/expressions-plugin/common'; +import type { ISearchGeneric } from '@kbn/search-types'; +import { esFieldTypeToKibanaFieldType } from '@kbn/field-types'; +import type { ESQLSearchReponse } from '@kbn/es-types'; +import { lastValueFrom } from 'rxjs'; +import { ESQL_LATEST_VERSION } from '../../constants'; + +export async function getESQLQueryColumns({ + esqlQuery, + search, + signal, +}: { + esqlQuery: string; + search: ISearchGeneric; + signal?: AbortSignal; +}): Promise { + const response = await lastValueFrom( + search( + { + params: { + query: `${esqlQuery} | limit 0`, + version: ESQL_LATEST_VERSION, + }, + }, + { + abortSignal: signal, + strategy: 'esql_async', + } + ) + ); + + const columns = + (response.rawResponse as unknown as ESQLSearchReponse).columns?.map(({ name, type }) => { + const kibanaType = esFieldTypeToKibanaFieldType(type); + const column = { + id: name, + name, + meta: { type: kibanaType, esType: type }, + } as DatatableColumn; + + return column; + }) ?? []; + + return columns; +} diff --git a/packages/kbn-esql-utils/tsconfig.json b/packages/kbn-esql-utils/tsconfig.json index 5a494e9929d7b..dcd3a6da1795b 100644 --- a/packages/kbn-esql-utils/tsconfig.json +++ b/packages/kbn-esql-utils/tsconfig.json @@ -20,5 +20,9 @@ "@kbn/crypto-browser", "@kbn/data-view-utils", "@kbn/esql-ast", + "@kbn/search-types", + "@kbn/expressions-plugin", + "@kbn/field-types", + "@kbn/es-types" ] } diff --git a/packages/kbn-generate-csv/src/generate_csv.test.ts b/packages/kbn-generate-csv/src/generate_csv.test.ts index 2a080e3652288..5123e75d8bf68 100644 --- a/packages/kbn-generate-csv/src/generate_csv.test.ts +++ b/packages/kbn-generate-csv/src/generate_csv.test.ts @@ -22,10 +22,10 @@ import { } from '@kbn/core/server/mocks'; import { createStubDataView } from '@kbn/data-views-plugin/common/data_views/data_view.stub'; import { stubLogstashFieldSpecMap } from '@kbn/data-views-plugin/common/field.stub'; -import { ISearchClient, ISearchStartSearchSource } from '@kbn/data-plugin/common'; +import type { ISearchClient, IKibanaSearchResponse } from '@kbn/search-types'; +import { ISearchStartSearchSource } from '@kbn/data-plugin/common'; import { searchSourceInstanceMock } from '@kbn/data-plugin/common/search/search_source/mocks'; import type { IScopedSearchClient } from '@kbn/data-plugin/server'; -import type { IKibanaSearchResponse } from '@kbn/data-plugin/common'; import { dataPluginMock } from '@kbn/data-plugin/server/mocks'; import { FieldFormatsRegistry } from '@kbn/field-formats-plugin/common'; import { CancellationToken } from '@kbn/reporting-common'; diff --git a/packages/kbn-generate-csv/src/generate_csv.ts b/packages/kbn-generate-csv/src/generate_csv.ts index 25ed0da6226ec..c021aa6146b28 100644 --- a/packages/kbn-generate-csv/src/generate_csv.ts +++ b/packages/kbn-generate-csv/src/generate_csv.ts @@ -11,7 +11,8 @@ import type { Writable } from 'stream'; import { errors as esErrors, estypes } from '@elastic/elasticsearch'; import type { IScopedClusterClient, IUiSettingsClient, Logger } from '@kbn/core/server'; -import type { DataView, ISearchClient, ISearchStartSearchSource } from '@kbn/data-plugin/common'; +import type { ISearchClient } from '@kbn/search-types'; +import type { DataView, ISearchStartSearchSource } from '@kbn/data-plugin/common'; import { cellHasFormulas, tabifyDocs } from '@kbn/data-plugin/common'; import type { Datatable } from '@kbn/expressions-plugin/server'; import type { diff --git a/packages/kbn-generate-csv/src/generate_csv_esql.test.ts b/packages/kbn-generate-csv/src/generate_csv_esql.test.ts index ee514788c72cf..4035dce01ce82 100644 --- a/packages/kbn-generate-csv/src/generate_csv_esql.test.ts +++ b/packages/kbn-generate-csv/src/generate_csv_esql.test.ts @@ -18,7 +18,7 @@ import { savedObjectsClientMock, uiSettingsServiceMock, } from '@kbn/core/server/mocks'; -import { IKibanaSearchResponse } from '@kbn/data-plugin/common'; +import type { IKibanaSearchResponse } from '@kbn/search-types'; import { IScopedSearchClient } from '@kbn/data-plugin/server'; import { dataPluginMock } from '@kbn/data-plugin/server/mocks'; import { CancellationToken } from '@kbn/reporting-common'; diff --git a/packages/kbn-generate-csv/src/generate_csv_esql.ts b/packages/kbn-generate-csv/src/generate_csv_esql.ts index dbfe073ff62f3..91b63f88046af 100644 --- a/packages/kbn-generate-csv/src/generate_csv_esql.ts +++ b/packages/kbn-generate-csv/src/generate_csv_esql.ts @@ -11,13 +11,8 @@ import type { Writable } from 'stream'; import { ESQL_LATEST_VERSION } from '@kbn/esql-utils'; import { errors as esErrors } from '@elastic/elasticsearch'; import type { IScopedClusterClient, IUiSettingsClient, Logger } from '@kbn/core/server'; -import { - ESQL_SEARCH_STRATEGY, - type IKibanaSearchRequest, - type IKibanaSearchResponse, - cellHasFormulas, - getEsQueryConfig, -} from '@kbn/data-plugin/common'; +import type { IKibanaSearchResponse, IKibanaSearchRequest } from '@kbn/search-types'; +import { ESQL_SEARCH_STRATEGY, cellHasFormulas, getEsQueryConfig } from '@kbn/data-plugin/common'; import type { IScopedSearchClient } from '@kbn/data-plugin/server'; import { type Filter, buildEsQuery } from '@kbn/es-query'; import type { ESQLSearchParams, ESQLSearchReponse } from '@kbn/es-types'; diff --git a/packages/kbn-generate-csv/src/lib/search_cursor.ts b/packages/kbn-generate-csv/src/lib/search_cursor.ts index 834f5d6fb2fbc..5ac80e69500b0 100644 --- a/packages/kbn-generate-csv/src/lib/search_cursor.ts +++ b/packages/kbn-generate-csv/src/lib/search_cursor.ts @@ -8,12 +8,8 @@ import type { estypes } from '@elastic/elasticsearch'; import type { IScopedClusterClient, Logger } from '@kbn/core/server'; -import type { - IEsSearchResponse, - IKibanaSearchResponse, - ISearchClient, - ISearchSource, -} from '@kbn/data-plugin/common'; +import type { ISearchClient, IKibanaSearchResponse, IEsSearchResponse } from '@kbn/search-types'; +import type { ISearchSource } from '@kbn/data-plugin/common'; import type { CsvExportSettings } from './get_export_settings'; export interface SearchCursorClients { diff --git a/packages/kbn-generate-csv/src/lib/search_cursor_pit.test.ts b/packages/kbn-generate-csv/src/lib/search_cursor_pit.test.ts index a61f8f382c681..f21485ffae922 100644 --- a/packages/kbn-generate-csv/src/lib/search_cursor_pit.test.ts +++ b/packages/kbn-generate-csv/src/lib/search_cursor_pit.test.ts @@ -11,7 +11,7 @@ import * as Rx from 'rxjs'; import type { estypes } from '@elastic/elasticsearch'; import type { IScopedClusterClient, Logger } from '@kbn/core/server'; import { elasticsearchServiceMock, loggingSystemMock } from '@kbn/core/server/mocks'; -import type { ISearchClient } from '@kbn/data-plugin/common'; +import type { ISearchClient } from '@kbn/search-types'; import { createSearchSourceMock } from '@kbn/data-plugin/common/search/search_source/mocks'; import { createSearchRequestHandlerContext } from '@kbn/data-plugin/server/search/mocks'; import type { SearchCursorSettings } from './search_cursor'; diff --git a/packages/kbn-generate-csv/src/lib/search_cursor_scroll.test.ts b/packages/kbn-generate-csv/src/lib/search_cursor_scroll.test.ts index c72e1e24946f5..3d09985fd00b8 100644 --- a/packages/kbn-generate-csv/src/lib/search_cursor_scroll.test.ts +++ b/packages/kbn-generate-csv/src/lib/search_cursor_scroll.test.ts @@ -10,7 +10,7 @@ import * as Rx from 'rxjs'; import type { IScopedClusterClient, Logger } from '@kbn/core/server'; import { elasticsearchServiceMock, loggingSystemMock } from '@kbn/core/server/mocks'; -import type { ISearchClient } from '@kbn/data-plugin/common'; +import type { ISearchClient } from '@kbn/search-types'; import { createSearchSourceMock } from '@kbn/data-plugin/common/search/search_source/mocks'; import { createSearchRequestHandlerContext } from '@kbn/data-plugin/server/search/mocks'; import type { SearchCursorSettings } from './search_cursor'; diff --git a/packages/kbn-generate-csv/src/lib/search_cursor_scroll.ts b/packages/kbn-generate-csv/src/lib/search_cursor_scroll.ts index 64d94c05a834d..24fdd10d59d2a 100644 --- a/packages/kbn-generate-csv/src/lib/search_cursor_scroll.ts +++ b/packages/kbn-generate-csv/src/lib/search_cursor_scroll.ts @@ -9,9 +9,9 @@ import type { estypes } from '@elastic/elasticsearch'; import { lastValueFrom } from 'rxjs'; import type { Logger } from '@kbn/core/server'; +import type { IEsSearchResponse } from '@kbn/search-types'; import { ES_SEARCH_STRATEGY, - type IEsSearchResponse, type ISearchSource, type SearchRequest, } from '@kbn/data-plugin/common'; diff --git a/packages/kbn-generate-csv/tsconfig.json b/packages/kbn-generate-csv/tsconfig.json index 30b1ac0a49f8b..b3b8e89f077d1 100644 --- a/packages/kbn-generate-csv/tsconfig.json +++ b/packages/kbn-generate-csv/tsconfig.json @@ -30,5 +30,6 @@ "@kbn/es-types", "@kbn/esql-utils", "@kbn/data-views-plugin", + "@kbn/search-types", ] } diff --git a/packages/kbn-search-errors/src/types.ts b/packages/kbn-search-errors/src/types.ts index 085d5961a2984..bd078933714a0 100644 --- a/packages/kbn-search-errors/src/types.ts +++ b/packages/kbn-search-errors/src/types.ts @@ -6,19 +6,7 @@ * Side Public License, v 1. */ -import { estypes } from '@elastic/elasticsearch'; -import type { ConnectionRequestParams } from '@elastic/transport'; +import type { IEsErrorAttributes } from '@kbn/search-types'; import type { KibanaServerError } from '@kbn/kibana-utils-plugin/common'; -type SanitizedConnectionRequestParams = Pick< - ConnectionRequestParams, - 'method' | 'path' | 'querystring' ->; - -interface IEsErrorAttributes { - error?: estypes.ErrorCause; - rawResponse?: estypes.SearchResponseBody; - requestParams?: SanitizedConnectionRequestParams; -} - export type IEsError = KibanaServerError; diff --git a/packages/kbn-search-errors/tsconfig.json b/packages/kbn-search-errors/tsconfig.json index d7cb9d82c63a5..d420899bfae32 100644 --- a/packages/kbn-search-errors/tsconfig.json +++ b/packages/kbn-search-errors/tsconfig.json @@ -21,5 +21,6 @@ "@kbn/kibana-utils-plugin", "@kbn/data-views-plugin", "@kbn/bfetch-error", + "@kbn/search-types", ] } diff --git a/packages/kbn-search-types/README.md b/packages/kbn-search-types/README.md new file mode 100644 index 0000000000000..0f3f3939fbcbc --- /dev/null +++ b/packages/kbn-search-types/README.md @@ -0,0 +1,3 @@ +# @kbn/search-types + +Gathers types of search strategies exported by the data plugin. \ No newline at end of file diff --git a/packages/kbn-search-types/index.ts b/packages/kbn-search-types/index.ts new file mode 100644 index 0000000000000..e1db319f2b601 --- /dev/null +++ b/packages/kbn-search-types/index.ts @@ -0,0 +1,24 @@ +/* + * 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 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 or the Server + * Side Public License, v 1. + */ + +export type { + ISearchGeneric, + ISearchClient, + SanitizedConnectionRequestParams, + IEsErrorAttributes, + ISearchOptions, + ISearchOptionsSerializable, +} from './src/types'; + +export type { IKibanaSearchRequest, IKibanaSearchResponse } from './src/kibana_search_types'; + +export type { + ISearchRequestParams, + IEsSearchResponse, + IEsSearchRequest, +} from './src/es_search_types'; diff --git a/packages/kbn-search-types/jest.config.js b/packages/kbn-search-types/jest.config.js new file mode 100644 index 0000000000000..6ab90dd13bb44 --- /dev/null +++ b/packages/kbn-search-types/jest.config.js @@ -0,0 +1,13 @@ +/* + * 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 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 or the Server + * Side Public License, v 1. + */ + +module.exports = { + preset: '@kbn/test', + rootDir: '../..', + roots: ['/packages/kbn-search-types'], +}; diff --git a/packages/kbn-search-types/kibana.jsonc b/packages/kbn-search-types/kibana.jsonc new file mode 100644 index 0000000000000..2f61b7444a0d8 --- /dev/null +++ b/packages/kbn-search-types/kibana.jsonc @@ -0,0 +1,5 @@ +{ + "type": "shared-common", + "id": "@kbn/search-types", + "owner": "@elastic/kibana-data-discovery" +} diff --git a/packages/kbn-search-types/package.json b/packages/kbn-search-types/package.json new file mode 100644 index 0000000000000..437208d6995e5 --- /dev/null +++ b/packages/kbn-search-types/package.json @@ -0,0 +1,9 @@ +{ + "name": "@kbn/search-types", + "private": true, + "version": "1.0.0", + "license": "SSPL-1.0 OR Elastic License 2.0", + "sideEffects": [ + "*.scss" + ] +} \ No newline at end of file diff --git a/packages/kbn-search-types/src/es_search_types.ts b/packages/kbn-search-types/src/es_search_types.ts new file mode 100644 index 0000000000000..1516ec1136aba --- /dev/null +++ b/packages/kbn-search-types/src/es_search_types.ts @@ -0,0 +1,21 @@ +/* + * 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 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 or the Server + * Side Public License, v 1. + */ +import type * as estypes from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; + +import { IKibanaSearchRequest, IKibanaSearchResponse } from './kibana_search_types'; + +export type ISearchRequestParams = { + trackTotalHits?: boolean; +} & estypes.SearchRequest; + +export interface IEsSearchRequest + extends IKibanaSearchRequest { + indexType?: string; +} + +export type IEsSearchResponse = IKibanaSearchResponse>; diff --git a/packages/kbn-search-types/src/kibana_search_types.ts b/packages/kbn-search-types/src/kibana_search_types.ts new file mode 100644 index 0000000000000..d323a0d1c3c88 --- /dev/null +++ b/packages/kbn-search-types/src/kibana_search_types.ts @@ -0,0 +1,71 @@ +/* + * 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 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 or the Server + * Side Public License, v 1. + */ +import type { SanitizedConnectionRequestParams } from './types'; + +export interface IKibanaSearchRequest { + /** + * An id can be used to uniquely identify this request. + */ + id?: string; + + params?: Params; +} + +export interface IKibanaSearchResponse { + /** + * Some responses may contain a unique id to identify the request this response came from. + */ + id?: string; + + /** + * If relevant to the search strategy, return a total number + * that represents how progress is indicated. + */ + total?: number; + + /** + * If relevant to the search strategy, return a loaded number + * that represents how progress is indicated. + */ + loaded?: number; + + /** + * Indicates whether search is still in flight + */ + isRunning?: boolean; + + /** + * Indicates whether the results returned are complete or partial + */ + isPartial?: boolean; + + /** + * Indicates whether the results returned are from the async-search index + */ + isRestored?: boolean; + + /** + * Indicates whether the search has been saved to a search-session object and long keepAlive was set + */ + isStored?: boolean; + + /** + * Optional warnings returned from Elasticsearch (for example, deprecation warnings) + */ + warning?: string; + + /** + * The raw response returned by the internal search method (usually the raw ES response) + */ + rawResponse: RawResponse; + + /** + * HTTP request parameters from elasticsearch transport client t + */ + requestParams?: SanitizedConnectionRequestParams; +} diff --git a/src/plugins/data/common/search/types.ts b/packages/kbn-search-types/src/types.ts similarity index 72% rename from src/plugins/data/common/search/types.ts rename to packages/kbn-search-types/src/types.ts index 51c56541366f0..05afdc6a06d4c 100644 --- a/src/plugins/data/common/search/types.ts +++ b/packages/kbn-search-types/src/types.ts @@ -12,7 +12,8 @@ import type { TransportRequestOptions } from '@elastic/elasticsearch'; import type { KibanaExecutionContext } from '@kbn/core/public'; import type { DataView } from '@kbn/data-views-plugin/common'; import { Observable } from 'rxjs'; -import { IEsSearchRequest, IEsSearchResponse } from '..'; +import { IEsSearchRequest, IEsSearchResponse } from './es_search_types'; +import { IKibanaSearchRequest, IKibanaSearchResponse } from './kibana_search_types'; export type ISearchGeneric = < SearchStrategyRequest extends IKibanaSearchRequest = IEsSearchRequest, @@ -46,75 +47,12 @@ export type SanitizedConnectionRequestParams = Pick< 'method' | 'path' | 'querystring' >; -export interface IKibanaSearchResponse { - /** - * Some responses may contain a unique id to identify the request this response came from. - */ - id?: string; - - /** - * If relevant to the search strategy, return a total number - * that represents how progress is indicated. - */ - total?: number; - - /** - * If relevant to the search strategy, return a loaded number - * that represents how progress is indicated. - */ - loaded?: number; - - /** - * Indicates whether search is still in flight - */ - isRunning?: boolean; - - /** - * Indicates whether the results returned are complete or partial - */ - isPartial?: boolean; - - /** - * Indicates whether the results returned are from the async-search index - */ - isRestored?: boolean; - - /** - * Indicates whether the search has been saved to a search-session object and long keepAlive was set - */ - isStored?: boolean; - - /** - * Optional warnings returned from Elasticsearch (for example, deprecation warnings) - */ - warning?: string; - - /** - * The raw response returned by the internal search method (usually the raw ES response) - */ - rawResponse: RawResponse; - - /** - * HTTP request parameters from elasticsearch transport client t - */ - requestParams?: SanitizedConnectionRequestParams; -} - export interface IEsErrorAttributes { error?: estypes.ErrorCause; rawResponse?: estypes.SearchResponseBody; requestParams?: SanitizedConnectionRequestParams; } -export interface IKibanaSearchRequest { - /** - * An id can be used to uniquely identify this request. - */ - id?: string; - - params?: Params; -} - export interface ISearchOptions { /** * An `AbortSignal` that allows the caller of `search` to abort a search request. diff --git a/packages/kbn-search-types/tsconfig.json b/packages/kbn-search-types/tsconfig.json new file mode 100644 index 0000000000000..07d9ec0e2e652 --- /dev/null +++ b/packages/kbn-search-types/tsconfig.json @@ -0,0 +1,12 @@ +{ + "extends": "../../tsconfig.base.json", + "compilerOptions": { + "outDir": "target/types" + }, + "include": ["*.ts", "src/**/*", "__mocks__/**/*.ts"], + "kbn_references": [ + "@kbn/core", + "@kbn/data-views-plugin", + ], + "exclude": ["target/**/*"] +} diff --git a/packages/kbn-unified-field-list/src/services/field_existing/field_existing_utils.ts b/packages/kbn-unified-field-list/src/services/field_existing/field_existing_utils.ts index 3105d94402086..e69944c6ea231 100644 --- a/packages/kbn-unified-field-list/src/services/field_existing/field_existing_utils.ts +++ b/packages/kbn-unified-field-list/src/services/field_existing/field_existing_utils.ts @@ -9,7 +9,7 @@ import type * as estypes from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; import type { DataViewField, RuntimeField } from '@kbn/data-views-plugin/common'; import type { DataViewsContract, DataView, FieldSpec } from '@kbn/data-views-plugin/common'; -import type { IKibanaSearchRequest } from '@kbn/data-plugin/common'; +import type { IKibanaSearchRequest } from '@kbn/search-types'; export type SearchHandler = ( params: IKibanaSearchRequest['params'] diff --git a/packages/kbn-unified-field-list/src/services/field_stats_text_based/load_field_stats_text_based.ts b/packages/kbn-unified-field-list/src/services/field_stats_text_based/load_field_stats_text_based.ts index 7d63c02633e77..482bf9484b67b 100644 --- a/packages/kbn-unified-field-list/src/services/field_stats_text_based/load_field_stats_text_based.ts +++ b/packages/kbn-unified-field-list/src/services/field_stats_text_based/load_field_stats_text_based.ts @@ -8,11 +8,8 @@ import { lastValueFrom } from 'rxjs'; import type { DataView, DataViewField } from '@kbn/data-views-plugin/common'; -import type { - DataPublicPluginStart, - IKibanaSearchRequest, - IKibanaSearchResponse, -} from '@kbn/data-plugin/public'; +import type { IKibanaSearchResponse, IKibanaSearchRequest } from '@kbn/search-types'; +import type { DataPublicPluginStart } from '@kbn/data-plugin/public'; import type { ESQLSearchParams, ESQLSearchReponse } from '@kbn/es-types'; import type { AggregateQuery } from '@kbn/es-query'; import { ESQL_LATEST_VERSION, getESQLWithSafeLimit } from '@kbn/esql-utils'; diff --git a/packages/kbn-unified-field-list/tsconfig.json b/packages/kbn-unified-field-list/tsconfig.json index 657498734e3d8..6dc268783d89a 100644 --- a/packages/kbn-unified-field-list/tsconfig.json +++ b/packages/kbn-unified-field-list/tsconfig.json @@ -33,7 +33,8 @@ "@kbn/field-utils", "@kbn/ml-ui-actions", "@kbn/visualization-utils", - "@kbn/esql-utils" + "@kbn/esql-utils", + "@kbn/search-types" ], "exclude": ["target/**/*"] } diff --git a/src/plugins/data/common/search/aggs/agg_config.ts b/src/plugins/data/common/search/aggs/agg_config.ts index f539826f4b2d9..8fa5ff5477058 100644 --- a/src/plugins/data/common/search/aggs/agg_config.ts +++ b/src/plugins/data/common/search/aggs/agg_config.ts @@ -15,7 +15,8 @@ import { Assign, Ensure } from '@kbn/utility-types'; import { ExpressionAstExpression, ExpressionAstArgument } from '@kbn/expressions-plugin/common'; import type { SerializedFieldFormat } from '@kbn/field-formats-plugin/common'; import { FieldFormatParams } from '@kbn/field-formats-plugin/common'; -import type { ISearchOptions, ISearchSource } from '../../../public'; +import { ISearchOptions } from '@kbn/search-types'; +import type { ISearchSource } from '../../../public'; import { IAggType } from './agg_type'; import { writeParams } from './agg_params'; diff --git a/src/plugins/data/common/search/aggs/agg_configs.test.ts b/src/plugins/data/common/search/aggs/agg_configs.test.ts index 441893affa2c3..28916bf33dec8 100644 --- a/src/plugins/data/common/search/aggs/agg_configs.test.ts +++ b/src/plugins/data/common/search/aggs/agg_configs.test.ts @@ -7,6 +7,7 @@ */ import { keyBy } from 'lodash'; +import type { IEsSearchResponse } from '@kbn/search-types'; import { ExpressionAstExpression, buildExpression } from '@kbn/expressions-plugin/common'; import { AggConfig } from './agg_config'; import { AggConfigs } from './agg_configs'; @@ -14,7 +15,6 @@ import { AggTypesRegistryStart } from './agg_types_registry'; import { mockAggTypesRegistry } from './test_helpers'; import type { DataView } from '@kbn/data-views-plugin/common'; import { stubIndexPattern } from '../../stubs'; -import { IEsSearchResponse } from '..'; // Mute moment.tz warnings about not finding a mock timezone jest.mock('../utils', () => { diff --git a/src/plugins/data/common/search/aggs/agg_configs.ts b/src/plugins/data/common/search/aggs/agg_configs.ts index 4a95724b6ccf3..f3548b7773566 100644 --- a/src/plugins/data/common/search/aggs/agg_configs.ts +++ b/src/plugins/data/common/search/aggs/agg_configs.ts @@ -15,8 +15,8 @@ import type { DataView } from '@kbn/data-views-plugin/common'; import type * as estypes from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; import type { IndexPatternLoadExpressionFunctionDefinition } from '@kbn/data-views-plugin/common'; import { buildExpression, buildExpressionFunction } from '@kbn/expressions-plugin/common'; - -import type { IEsSearchResponse, ISearchOptions, ISearchSource } from '../../../public'; +import { ISearchOptions, IEsSearchResponse } from '@kbn/search-types'; +import type { ISearchSource } from '../../../public'; import type { EsaggsExpressionFunctionDefinition } from '../expressions'; import { AggConfig, AggConfigSerialized, IAggConfig } from './agg_config'; import type { IAggType } from './agg_type'; diff --git a/src/plugins/data/common/search/aggs/param_types/base.ts b/src/plugins/data/common/search/aggs/param_types/base.ts index bd392e46dba84..3bcd3462fae51 100644 --- a/src/plugins/data/common/search/aggs/param_types/base.ts +++ b/src/plugins/data/common/search/aggs/param_types/base.ts @@ -7,7 +7,8 @@ */ import { ExpressionAstExpression } from '@kbn/expressions-plugin/common'; -import type { ISearchOptions, ISearchSource } from '../../../../public'; +import { ISearchOptions } from '@kbn/search-types'; +import type { ISearchSource } from '../../../../public'; import { IAggConfigs } from '../agg_configs'; import { IAggConfig } from '../agg_config'; diff --git a/src/plugins/data/common/search/expressions/eql.ts b/src/plugins/data/common/search/expressions/eql.ts index 7caaa0c090466..d60bb6f72480a 100644 --- a/src/plugins/data/common/search/expressions/eql.ts +++ b/src/plugins/data/common/search/expressions/eql.ts @@ -13,8 +13,8 @@ import { ExpressionFunctionDefinition } from '@kbn/expressions-plugin/common'; import { EqlSearchRequest } from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; import { lastValueFrom } from 'rxjs'; import { RequestStatistics, RequestAdapter } from '@kbn/inspector-plugin/common'; +import type { ISearchGeneric } from '@kbn/search-types'; import { - ISearchGeneric, KibanaContext, EqlSearchStrategyResponse, EQL_SEARCH_STRATEGY, diff --git a/src/plugins/data/common/search/expressions/esdsl.ts b/src/plugins/data/common/search/expressions/esdsl.ts index bf5aacef2113d..84d301498f2f9 100644 --- a/src/plugins/data/common/search/expressions/esdsl.ts +++ b/src/plugins/data/common/search/expressions/esdsl.ts @@ -11,9 +11,11 @@ import { buildEsQuery } from '@kbn/es-query'; import { ExpressionFunctionDefinition } from '@kbn/expressions-plugin/common'; import { lastValueFrom } from 'rxjs'; +import type { ISearchGeneric } from '@kbn/search-types'; import { RequestStatistics, RequestAdapter } from '@kbn/inspector-plugin/common'; import { EsRawResponse } from './es_raw_response'; -import { ISearchGeneric, KibanaContext } from '..'; + +import { KibanaContext } from '..'; import { getEsQueryConfig } from '../../es_query'; import { UiSettingsCommon } from '../..'; diff --git a/src/plugins/data/common/search/expressions/esql.ts b/src/plugins/data/common/search/expressions/esql.ts index a40902b6658ce..2303dabb7e59c 100644 --- a/src/plugins/data/common/search/expressions/esql.ts +++ b/src/plugins/data/common/search/expressions/esql.ts @@ -9,6 +9,7 @@ import type { KibanaRequest } from '@kbn/core/server'; import { esFieldTypeToKibanaFieldType } from '@kbn/field-types'; import { i18n } from '@kbn/i18n'; +import type { IKibanaSearchResponse, IKibanaSearchRequest } from '@kbn/search-types'; import type { Datatable, ExpressionFunctionDefinition } from '@kbn/expressions-plugin/common'; import { RequestAdapter } from '@kbn/inspector-plugin/common'; @@ -16,17 +17,12 @@ import { zipObject } from 'lodash'; import { Observable, defer, throwError } from 'rxjs'; import { catchError, map, switchMap, tap } from 'rxjs'; import { buildEsQuery } from '@kbn/es-query'; +import type { ISearchGeneric } from '@kbn/search-types'; import type { ESQLSearchReponse, ESQLSearchParams } from '@kbn/es-types'; import { ESQL_LATEST_VERSION } from '@kbn/esql-utils'; import { getEsQueryConfig } from '../../es_query'; import { getTime } from '../../query'; -import { - ESQL_ASYNC_SEARCH_STRATEGY, - IKibanaSearchRequest, - ISearchGeneric, - KibanaContext, -} from '..'; -import { IKibanaSearchResponse } from '../types'; +import { ESQL_ASYNC_SEARCH_STRATEGY, KibanaContext } from '..'; import { UiSettingsCommon } from '../..'; type Input = KibanaContext | null; diff --git a/src/plugins/data/common/search/expressions/essql.ts b/src/plugins/data/common/search/expressions/essql.ts index b65e8a06d414e..69d0e7ed9f727 100644 --- a/src/plugins/data/common/search/expressions/essql.ts +++ b/src/plugins/data/common/search/expressions/essql.ts @@ -16,12 +16,12 @@ import { RequestAdapter } from '@kbn/inspector-plugin/common'; import { zipObject } from 'lodash'; import { Observable, defer, throwError } from 'rxjs'; import { catchError, map, switchMap, tap } from 'rxjs'; +import type { ISearchGeneric } from '@kbn/search-types'; import type { NowProviderPublicContract } from '../../../public'; import { getEsQueryConfig } from '../../es_query'; import { getTime } from '../../query'; import { UiSettingsCommon } from '../..'; import { - ISearchGeneric, KibanaContext, SqlRequestParams, SqlSearchStrategyRequest, diff --git a/src/plugins/data/common/search/index.ts b/src/plugins/data/common/search/index.ts index 50356da1a4655..31b62912ed1fe 100644 --- a/src/plugins/data/common/search/index.ts +++ b/src/plugins/data/common/search/index.ts @@ -10,7 +10,6 @@ export * from './aggs'; export * from './expressions'; export * from './search_source'; export * from './tabify'; -export * from './types'; export * from './utils'; export * from './session'; export * from './poll_search'; diff --git a/src/plugins/data/common/search/poll_search.ts b/src/plugins/data/common/search/poll_search.ts index 3965ee96bf417..9a39a6589eb7e 100644 --- a/src/plugins/data/common/search/poll_search.ts +++ b/src/plugins/data/common/search/poll_search.ts @@ -9,7 +9,8 @@ import { from, Observable, timer, defer, fromEvent, EMPTY } from 'rxjs'; import { expand, map, switchMap, takeUntil, takeWhile, tap } from 'rxjs'; import { AbortError } from '@kbn/kibana-utils-plugin/common'; -import type { IAsyncSearchOptions, IKibanaSearchResponse } from '..'; +import type { IKibanaSearchResponse } from '@kbn/search-types'; +import type { IAsyncSearchOptions } from '..'; import { isAbortResponse, isRunningResponse } from '..'; export const pollSearch = ( diff --git a/src/plugins/data/common/search/search_source/fetch/get_search_params.ts b/src/plugins/data/common/search/search_source/fetch/get_search_params.ts index db630c85177e3..712f0d4192edc 100644 --- a/src/plugins/data/common/search/search_source/fetch/get_search_params.ts +++ b/src/plugins/data/common/search/search_source/fetch/get_search_params.ts @@ -5,10 +5,9 @@ * in compliance with, at your election, the Elastic License 2.0 or the Server * Side Public License, v 1. */ - +import type { ISearchRequestParams } from '@kbn/search-types'; import { UI_SETTINGS } from '../../../constants'; import { GetConfigFn } from '../../../types'; -import { ISearchRequestParams } from '../..'; import type { SearchRequest } from './types'; const sessionId = Date.now(); diff --git a/src/plugins/data/common/search/search_source/fetch/request_error.ts b/src/plugins/data/common/search/search_source/fetch/request_error.ts index 26bbc90e3ba07..a444a8501bb3e 100644 --- a/src/plugins/data/common/search/search_source/fetch/request_error.ts +++ b/src/plugins/data/common/search/search_source/fetch/request_error.ts @@ -7,7 +7,7 @@ */ import { KbnError } from '@kbn/kibana-utils-plugin/common'; -import { IKibanaSearchResponse } from '../../types'; +import type { IKibanaSearchResponse } from '@kbn/search-types'; import { SearchError } from './types'; /** diff --git a/src/plugins/data/common/search/search_source/fetch/types.ts b/src/plugins/data/common/search/search_source/fetch/types.ts index 612f659a07c8e..b798bef9b859c 100644 --- a/src/plugins/data/common/search/search_source/fetch/types.ts +++ b/src/plugins/data/common/search/search_source/fetch/types.ts @@ -5,10 +5,9 @@ * in compliance with, at your election, the Elastic License 2.0 or the Server * Side Public License, v 1. */ - +import type { IKibanaSearchResponse } from '@kbn/search-types'; import { SearchSourceSearchOptions } from '../../..'; import { GetConfigFn } from '../../../types'; -import { IKibanaSearchResponse } from '../../types'; /** * @internal diff --git a/src/plugins/data/common/search/search_source/search_source.test.ts b/src/plugins/data/common/search/search_source/search_source.test.ts index 6fd4355fbb6fb..e4c9ffcccd003 100644 --- a/src/plugins/data/common/search/search_source/search_source.test.ts +++ b/src/plugins/data/common/search/search_source/search_source.test.ts @@ -10,6 +10,7 @@ import Rx, { firstValueFrom, lastValueFrom, of, throwError } from 'rxjs'; import type { DataView } from '@kbn/data-views-plugin/common'; import { buildExpression, ExpressionAstExpression } from '@kbn/expressions-plugin/common'; import type { MockedKeys } from '@kbn/utility-types-jest'; +import type { ISearchGeneric } from '@kbn/search-types'; import { SearchSource, SearchSourceDependencies, SortDirection } from '.'; import { AggConfigs, AggTypesRegistryStart } from '../..'; import { mockAggTypesRegistry } from '../aggs/test_helpers'; @@ -18,7 +19,6 @@ import { switchMap } from 'rxjs'; import { Filter } from '@kbn/es-query'; import { stubIndexPattern } from '../../stubs'; import { SearchSourceSearchOptions } from './types'; -import { ISearchGeneric } from '../types'; const getComputedFields = () => ({ storedFields: [], diff --git a/src/plugins/data/common/search/search_source/search_source.ts b/src/plugins/data/common/search/search_source/search_source.ts index c91310fc0a7e1..3f2e7da84cd02 100644 --- a/src/plugins/data/common/search/search_source/search_source.ts +++ b/src/plugins/data/common/search/search_source/search_source.ts @@ -78,11 +78,12 @@ import { buildExpression, buildExpressionFunction, } from '@kbn/expressions-plugin/common'; +import type { ISearchGeneric, IKibanaSearchResponse, IEsSearchResponse } from '@kbn/search-types'; import { normalizeSortRequest } from './normalize_sort_request'; import { AggConfigSerialized, DataViewField, SerializedSearchSourceFields } from '../..'; -import { AggConfigs, EsQuerySortValue, IEsSearchResponse, ISearchGeneric } from '../..'; +import { AggConfigs, EsQuerySortValue } from '../..'; import type { ISearchSource, SearchFieldValue, @@ -94,7 +95,7 @@ import { getSearchParamsFromRequest, RequestFailure } from './fetch'; import type { FetchHandlers, SearchRequest } from './fetch'; import { getRequestInspectorStats, getResponseInspectorStats } from './inspect'; -import { getEsQueryConfig, IKibanaSearchResponse, isRunningResponse, UI_SETTINGS } from '../..'; +import { getEsQueryConfig, isRunningResponse, UI_SETTINGS } from '../..'; import { AggsStart } from '../aggs'; import { extractReferences } from './extract_references'; import { diff --git a/src/plugins/data/common/search/search_source/types.ts b/src/plugins/data/common/search/search_source/types.ts index 98cf431658e4c..2bd38cb8c00f6 100644 --- a/src/plugins/data/common/search/search_source/types.ts +++ b/src/plugins/data/common/search/search_source/types.ts @@ -12,8 +12,9 @@ import { Query, AggregateQuery } from '@kbn/es-query'; import { SerializableRecord } from '@kbn/utility-types'; import { PersistableStateService } from '@kbn/kibana-utils-plugin/common'; import type { Filter } from '@kbn/es-query'; +import { ISearchOptions } from '@kbn/search-types'; import type { DataView, DataViewSpec } from '@kbn/data-views-plugin/common'; -import type { AggConfigSerialized, IAggConfigs, ISearchOptions } from '../../../public'; +import type { AggConfigSerialized, IAggConfigs } from '../../../public'; import type { SearchSource } from './search_source'; /** diff --git a/src/plugins/data/common/search/strategies/eql_search/types.ts b/src/plugins/data/common/search/strategies/eql_search/types.ts index 732eb77a01927..88d36d58b7cd9 100644 --- a/src/plugins/data/common/search/strategies/eql_search/types.ts +++ b/src/plugins/data/common/search/strategies/eql_search/types.ts @@ -5,13 +5,11 @@ * in compliance with, at your election, the Elastic License 2.0 or the Server * Side Public License, v 1. */ - +import type { IKibanaSearchResponse, IKibanaSearchRequest } from '@kbn/search-types'; import type { EqlSearchRequest } from '@elastic/elasticsearch/lib/api/types'; import type { EqlSearchRequest as EqlSearchRequestWithBody } from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; import type { TransportRequestOptions } from '@elastic/elasticsearch'; -import { IKibanaSearchRequest, IKibanaSearchResponse } from '../../types'; - export const EQL_SEARCH_STRATEGY = 'eql'; export type EqlRequestParams = EqlSearchRequest | EqlSearchRequestWithBody; diff --git a/src/plugins/data/common/search/strategies/es_search/types.ts b/src/plugins/data/common/search/strategies/es_search/types.ts index f8c3b73d995a9..73bba6831206f 100644 --- a/src/plugins/data/common/search/strategies/es_search/types.ts +++ b/src/plugins/data/common/search/strategies/es_search/types.ts @@ -5,19 +5,4 @@ * in compliance with, at your election, the Elastic License 2.0 or the Server * Side Public License, v 1. */ -import type * as estypes from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; - -import { IKibanaSearchRequest, IKibanaSearchResponse } from '../../types'; - export const ES_SEARCH_STRATEGY = 'es'; - -export type ISearchRequestParams = { - trackTotalHits?: boolean; -} & estypes.SearchRequest; - -export interface IEsSearchRequest - extends IKibanaSearchRequest { - indexType?: string; -} - -export type IEsSearchResponse = IKibanaSearchResponse>; diff --git a/src/plugins/data/common/search/strategies/sql_search/types.ts b/src/plugins/data/common/search/strategies/sql_search/types.ts index 8c73e4a432ea6..715d80742bd39 100644 --- a/src/plugins/data/common/search/strategies/sql_search/types.ts +++ b/src/plugins/data/common/search/strategies/sql_search/types.ts @@ -11,7 +11,7 @@ import type { SqlQueryRequest, SqlQueryResponse, } from '@elastic/elasticsearch/lib/api/types'; -import { IKibanaSearchRequest, IKibanaSearchResponse } from '../../types'; +import type { IKibanaSearchResponse, IKibanaSearchRequest } from '@kbn/search-types'; export const SQL_SEARCH_STRATEGY = 'sql'; diff --git a/src/plugins/data/common/search/utils.test.ts b/src/plugins/data/common/search/utils.test.ts index e81a35fb6caeb..f708460cb7e42 100644 --- a/src/plugins/data/common/search/utils.test.ts +++ b/src/plugins/data/common/search/utils.test.ts @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -import type { IKibanaSearchResponse } from './types'; +import type { IKibanaSearchResponse } from '@kbn/search-types'; import { isAbortResponse, isRunningResponse } from './utils'; describe('utils', () => { diff --git a/src/plugins/data/common/search/utils.ts b/src/plugins/data/common/search/utils.ts index a369501981328..57e76d459d8d5 100644 --- a/src/plugins/data/common/search/utils.ts +++ b/src/plugins/data/common/search/utils.ts @@ -7,8 +7,8 @@ */ import moment from 'moment-timezone'; +import type { IKibanaSearchResponse } from '@kbn/search-types'; import { AggTypesDependencies } from '..'; -import type { IKibanaSearchResponse } from './types'; // TODO - investigate if this check is still needed // There are no documented work flows where response or rawResponse is not returned diff --git a/src/plugins/data/public/index.ts b/src/plugins/data/public/index.ts index de2504dec2d99..fa03dc95f564f 100644 --- a/src/plugins/data/public/index.ts +++ b/src/plugins/data/public/index.ts @@ -152,14 +152,9 @@ export type { // search ES_SEARCH_STRATEGY, EsQuerySortValue, - IEsSearchRequest, - IEsSearchResponse, - IKibanaSearchRequest, - IKibanaSearchResponse, ISearchSetup, ISearchStart, ISearchStartSearchSource, - ISearchGeneric, ISearchSource, SearchRequest, SearchSourceFields, @@ -188,7 +183,6 @@ export type { SearchUsageCollector, } from './search'; -export type { ISearchOptions } from '../common'; export { isRunningResponse } from '../common'; // Search namespace diff --git a/src/plugins/data/public/search/index.ts b/src/plugins/data/public/search/index.ts index 54ac47680a2b6..3a63e913149b7 100644 --- a/src/plugins/data/public/search/index.ts +++ b/src/plugins/data/public/search/index.ts @@ -17,11 +17,6 @@ export type { export type { EsQuerySortValue, - IEsSearchRequest, - IEsSearchResponse, - IKibanaSearchRequest, - IKibanaSearchResponse, - ISearchGeneric, ISearchSource, SearchError, SearchRequest, diff --git a/src/plugins/data/public/search/search_interceptor/search_interceptor.test.ts b/src/plugins/data/public/search/search_interceptor/search_interceptor.test.ts index c6d07bc9e98c2..5ee9d5be50f75 100644 --- a/src/plugins/data/public/search/search_interceptor/search_interceptor.test.ts +++ b/src/plugins/data/public/search/search_interceptor/search_interceptor.test.ts @@ -9,7 +9,7 @@ import type { MockedKeys } from '@kbn/utility-types-jest'; import { CoreSetup, CoreStart } from '@kbn/core/public'; import { coreMock, themeServiceMock } from '@kbn/core/public/mocks'; -import { IEsSearchRequest } from '../../../common/search'; +import { IEsSearchRequest } from '@kbn/search-types'; import { SearchInterceptor } from './search_interceptor'; import { AbortError } from '@kbn/kibana-utils-plugin/public'; import { EsError, type IEsError } from '@kbn/search-errors'; diff --git a/src/plugins/data/public/search/search_interceptor/search_interceptor.ts b/src/plugins/data/public/search/search_interceptor/search_interceptor.ts index 4b73f2ac9336b..2474158c10833 100644 --- a/src/plugins/data/public/search/search_interceptor/search_interceptor.ts +++ b/src/plugins/data/public/search/search_interceptor/search_interceptor.ts @@ -50,18 +50,19 @@ import { BatchedFunc, BfetchPublicSetup, DISABLE_BFETCH } from '@kbn/bfetch-plug import { toMountPoint } from '@kbn/kibana-react-plugin/public'; import { AbortError, KibanaServerError } from '@kbn/kibana-utils-plugin/public'; import { BfetchRequestError } from '@kbn/bfetch-error'; +import type { + SanitizedConnectionRequestParams, + IKibanaSearchRequest, + ISearchOptionsSerializable, +} from '@kbn/search-types'; import { createEsError, isEsError, renderSearchError } from '@kbn/search-errors'; +import type { IKibanaSearchResponse, ISearchOptions } from '@kbn/search-types'; import { ENHANCED_ES_SEARCH_STRATEGY, IAsyncSearchOptions, - IKibanaSearchRequest, - IKibanaSearchResponse, isRunningResponse, - ISearchOptions, - ISearchOptionsSerializable, pollSearch, UI_SETTINGS, - type SanitizedConnectionRequestParams, } from '../../../common'; import { SearchUsageCollector } from '../collectors'; import { SearchTimeoutError, TimeoutErrorMode } from './timeout_error'; diff --git a/src/plugins/data/public/search/search_interceptor/search_response_cache.test.ts b/src/plugins/data/public/search/search_interceptor/search_response_cache.test.ts index 25e2d9aefe088..98574c264771d 100644 --- a/src/plugins/data/public/search/search_interceptor/search_response_cache.test.ts +++ b/src/plugins/data/public/search/search_interceptor/search_response_cache.test.ts @@ -8,7 +8,7 @@ import { interval, Observable, of, throwError } from 'rxjs'; import { shareReplay, switchMap, take } from 'rxjs'; -import { IKibanaSearchResponse } from '../..'; +import type { IKibanaSearchResponse } from '@kbn/search-types'; import { SearchAbortController } from './search_abort_controller'; import { SearchResponseCache } from './search_response_cache'; diff --git a/src/plugins/data/public/search/search_interceptor/search_response_cache.ts b/src/plugins/data/public/search/search_interceptor/search_response_cache.ts index a9bf468f54f48..62b70183be0ec 100644 --- a/src/plugins/data/public/search/search_interceptor/search_response_cache.ts +++ b/src/plugins/data/public/search/search_interceptor/search_response_cache.ts @@ -7,8 +7,8 @@ */ import { Observable, Subscription } from 'rxjs'; +import type { IKibanaSearchResponse } from '@kbn/search-types'; import { SearchAbortController } from './search_abort_controller'; -import { IKibanaSearchResponse } from '../../../common'; interface ResponseCacheItem { response$: Observable; diff --git a/src/plugins/data/public/search/search_interceptor/to_partial_response.test.ts b/src/plugins/data/public/search/search_interceptor/to_partial_response.test.ts index a47e574d738e1..dee112783042e 100644 --- a/src/plugins/data/public/search/search_interceptor/to_partial_response.test.ts +++ b/src/plugins/data/public/search/search_interceptor/to_partial_response.test.ts @@ -5,9 +5,9 @@ * in compliance with, at your election, the Elastic License 2.0 or the Server * Side Public License, v 1. */ +import { IEsSearchResponse } from '@kbn/search-types'; import { toPartialResponseAfterTimeout } from './to_partial_response'; -import { IEsSearchResponse } from '../../../common'; describe('toPartialResponseAfterTimeout', () => { it('should transform a non-CCS response', () => { diff --git a/src/plugins/data/public/search/search_interceptor/to_partial_response.ts b/src/plugins/data/public/search/search_interceptor/to_partial_response.ts index edba343c7ae4c..db27af1bb690c 100644 --- a/src/plugins/data/public/search/search_interceptor/to_partial_response.ts +++ b/src/plugins/data/public/search/search_interceptor/to_partial_response.ts @@ -11,7 +11,7 @@ import { ClusterStatistics, SearchResponse, } from '@elastic/elasticsearch/lib/api/types'; -import { IEsSearchResponse } from '../../../common'; +import { IEsSearchResponse } from '@kbn/search-types'; /** * When we hit the advanced setting `search:timeout`, we cancel in-progress search requests. This method takes the diff --git a/src/plugins/data/public/search/search_service.ts b/src/plugins/data/public/search/search_service.ts index b0bbe073c53b6..325850fa409e1 100644 --- a/src/plugins/data/public/search/search_service.ts +++ b/src/plugins/data/public/search/search_service.ts @@ -17,6 +17,7 @@ import { PluginInitializerContext, StartServicesAccessor, } from '@kbn/core/public'; +import type { ISearchGeneric } from '@kbn/search-types'; import { RequestAdapter } from '@kbn/inspector-plugin/common/adapters/request'; import { DataViewsContract } from '@kbn/data-views-plugin/common'; import { ExpressionsSetup } from '@kbn/expressions-plugin/public'; @@ -41,7 +42,6 @@ import { geoPointFunction, ipPrefixFunction, ipRangeFunction, - ISearchGeneric, kibana, kibanaFilterFunction, kibanaTimerangeFunction, diff --git a/src/plugins/data/public/search/session/session_service.ts b/src/plugins/data/public/search/session/session_service.ts index b6cc43313dc1d..5b936fb72a88d 100644 --- a/src/plugins/data/public/search/session/session_service.ts +++ b/src/plugins/data/public/search/session/session_service.ts @@ -37,6 +37,7 @@ import { } from '@kbn/core/public'; import { i18n } from '@kbn/i18n'; import moment from 'moment'; +import { ISearchOptions } from '@kbn/search-types'; import { SearchUsageCollector } from '../..'; import { ConfigSchema } from '../../../config'; import type { @@ -50,7 +51,6 @@ import { TrackedSearchState, } from './search_session_state'; import { ISessionsClient } from './sessions_client'; -import { ISearchOptions } from '../../../common'; import { NowProviderInternalContract } from '../../now_provider'; import { SEARCH_SESSIONS_MANAGEMENT_ID } from './constants'; import { formatSessionName } from './lib/session_name_formatter'; diff --git a/src/plugins/data/public/search/types.ts b/src/plugins/data/public/search/types.ts index 846f929f98f70..dc2cc86b29aff 100644 --- a/src/plugins/data/public/search/types.ts +++ b/src/plugins/data/public/search/types.ts @@ -11,7 +11,8 @@ import { DataViewsContract } from '@kbn/data-views-plugin/common'; import { RequestAdapter } from '@kbn/inspector-plugin/public'; import { UsageCollectionSetup } from '@kbn/usage-collection-plugin/public'; import type { WarningHandlerCallback } from '@kbn/search-response-warnings'; -import { ISearchGeneric, ISearchStartSearchSource } from '../../common/search'; +import type { ISearchGeneric } from '@kbn/search-types'; +import { ISearchStartSearchSource } from '../../common/search'; import { AggsSetup, AggsSetupDependencies, AggsStart, AggsStartDependencies } from './aggs'; import { SearchUsageCollector } from './collectors'; import { ISessionsClient, ISessionService } from './session'; diff --git a/src/plugins/data/server/index.ts b/src/plugins/data/server/index.ts index 2f077e907dfca..e1d2080b6c59f 100644 --- a/src/plugins/data/server/index.ts +++ b/src/plugins/data/server/index.ts @@ -5,7 +5,6 @@ * in compliance with, at your election, the Elastic License 2.0 or the Server * Side Public License, v 1. */ - import { PluginConfigDescriptor, PluginInitializerContext } from '@kbn/core/server'; import { ConfigSchema, configSchema } from '../config'; import type { DataServerPlugin, DataPluginSetup, DataPluginStart } from './plugin'; @@ -54,12 +53,7 @@ import { } from '../common'; import { configDeprecationProvider } from './config_deprecations'; -export type { - ParsedInterval, - ISearchOptions, - IEsSearchRequest, - IEsSearchResponse, -} from '../common'; +export type { ParsedInterval } from '../common'; export { METRIC_TYPES, ES_SEARCH_STRATEGY } from '../common'; export type { diff --git a/src/plugins/data/server/search/collectors/search/usage.ts b/src/plugins/data/server/search/collectors/search/usage.ts index 50d71fbc8ddff..c3f1e729af847 100644 --- a/src/plugins/data/server/search/collectors/search/usage.ts +++ b/src/plugins/data/server/search/collectors/search/usage.ts @@ -8,7 +8,7 @@ import { once, debounce } from 'lodash'; import type { CoreSetup, Logger } from '@kbn/core/server'; -import type { IEsSearchResponse, ISearchOptions } from '../../../../common'; +import { ISearchOptions, IEsSearchResponse } from '@kbn/search-types'; import { isRunningResponse } from '../../../../common'; import { CollectedUsage } from './register'; diff --git a/src/plugins/data/server/search/report_search_error.ts b/src/plugins/data/server/search/report_search_error.ts index 4f95ce8fd1ec2..d9bfc796d3606 100644 --- a/src/plugins/data/server/search/report_search_error.ts +++ b/src/plugins/data/server/search/report_search_error.ts @@ -10,7 +10,7 @@ import type { ConnectionRequestParams } from '@elastic/transport'; import { errors } from '@elastic/elasticsearch'; import { KibanaResponseFactory } from '@kbn/core/server'; import { KbnError } from '@kbn/kibana-utils-plugin/common'; -import type { SanitizedConnectionRequestParams } from '../../common'; +import type { SanitizedConnectionRequestParams } from '@kbn/search-types'; import { sanitizeRequestParams } from './sanitize_request_params'; // Why not use just use kibana-utils-plugin KbnServerError and reportServerError? diff --git a/src/plugins/data/server/search/routes/bsearch.ts b/src/plugins/data/server/search/routes/bsearch.ts index 62753c0d50375..fa6796b51ab50 100644 --- a/src/plugins/data/server/search/routes/bsearch.ts +++ b/src/plugins/data/server/search/routes/bsearch.ts @@ -11,12 +11,12 @@ import { catchError } from 'rxjs'; import { BfetchServerSetup } from '@kbn/bfetch-plugin/server'; import type { ExecutionContextSetup } from '@kbn/core/server'; import apm from 'elastic-apm-node'; -import { getRequestAbortedSignal } from '../..'; -import { - IKibanaSearchRequest, +import type { IKibanaSearchResponse, + IKibanaSearchRequest, ISearchOptionsSerializable, -} from '../../../common/search'; +} from '@kbn/search-types'; +import { getRequestAbortedSignal } from '../..'; import type { ISearchStart } from '../types'; export function registerBsearchRoute( diff --git a/src/plugins/data/server/search/sanitize_request_params.ts b/src/plugins/data/server/search/sanitize_request_params.ts index 34e4e721cc872..7ec06fc21edbd 100644 --- a/src/plugins/data/server/search/sanitize_request_params.ts +++ b/src/plugins/data/server/search/sanitize_request_params.ts @@ -7,7 +7,7 @@ */ import type { ConnectionRequestParams } from '@elastic/transport'; -import type { SanitizedConnectionRequestParams } from '../../common'; +import type { SanitizedConnectionRequestParams } from '@kbn/search-types'; export function sanitizeRequestParams( requestParams: ConnectionRequestParams diff --git a/src/plugins/data/server/search/search_service.test.ts b/src/plugins/data/server/search/search_service.test.ts index cb3575caec510..4cdac1d3ebd58 100644 --- a/src/plugins/data/server/search/search_service.test.ts +++ b/src/plugins/data/server/search/search_service.test.ts @@ -9,7 +9,7 @@ import type { MockedKeys } from '@kbn/utility-types-jest'; import { CoreSetup, CoreStart, SavedObject } from '@kbn/core/server'; import { coreMock } from '@kbn/core/server/mocks'; - +import { IEsSearchRequest, IEsSearchResponse } from '@kbn/search-types'; import { DataPluginStart, DataPluginStartDependencies } from '../plugin'; import { createFieldFormatsStartMock } from '@kbn/field-formats-plugin/server/mocks'; import { createIndexPatternsStartMock } from '../data_views/mocks'; @@ -17,9 +17,8 @@ import { createIndexPatternsStartMock } from '../data_views/mocks'; import { SearchService, SearchServiceSetupDependencies } from './search_service'; import { bfetchPluginMock } from '@kbn/bfetch-plugin/server/mocks'; import { lastValueFrom, of } from 'rxjs'; + import type { - IEsSearchRequest, - IEsSearchResponse, IScopedSearchClient, IScopedSearchSessionsClient, ISearchStart, diff --git a/src/plugins/data/server/search/search_service.ts b/src/plugins/data/server/search/search_service.ts index 12b84ca0c5694..8d43e28b108e7 100644 --- a/src/plugins/data/server/search/search_service.ts +++ b/src/plugins/data/server/search/search_service.ts @@ -20,6 +20,13 @@ import { StartServicesAccessor, } from '@kbn/core/server'; import { catchError, map, switchMap, tap } from 'rxjs'; +import type { + IKibanaSearchResponse, + IKibanaSearchRequest, + ISearchOptions, + IEsSearchRequest, + IEsSearchResponse, +} from '@kbn/search-types'; import { BfetchServerSetup } from '@kbn/bfetch-plugin/server'; import { ExpressionsServerSetup } from '@kbn/expressions-plugin/server'; import { FieldFormatsStart } from '@kbn/field-formats-plugin/server'; @@ -56,13 +63,8 @@ import { fieldFunction, geoBoundingBoxFunction, geoPointFunction, - IEsSearchRequest, - IEsSearchResponse, - IKibanaSearchRequest, - IKibanaSearchResponse, ipPrefixFunction, ipRangeFunction, - ISearchOptions, kibana, kibanaFilterFunction, kibanaTimerangeFunction, diff --git a/src/plugins/data/server/search/session/session_service.ts b/src/plugins/data/server/search/session/session_service.ts index 45b0a31678402..8eeff580ca450 100644 --- a/src/plugins/data/server/search/session/session_service.ts +++ b/src/plugins/data/server/search/session/session_service.ts @@ -20,11 +20,10 @@ import { } from '@kbn/core/server'; import type { AuthenticatedUser, SecurityPluginSetup } from '@kbn/security-plugin/server'; import { defer } from '@kbn/kibana-utils-plugin/common'; +import type { IKibanaSearchRequest, ISearchOptions } from '@kbn/search-types'; import { debounce } from 'lodash'; import { ENHANCED_ES_SEARCH_STRATEGY, - IKibanaSearchRequest, - ISearchOptions, SEARCH_SESSION_TYPE, SearchSessionRequestInfo, SearchSessionSavedObjectAttributes, diff --git a/src/plugins/data/server/search/session/types.ts b/src/plugins/data/server/search/session/types.ts index 88ad5f21e2755..cc3d604f50efc 100644 --- a/src/plugins/data/server/search/session/types.ts +++ b/src/plugins/data/server/search/session/types.ts @@ -13,9 +13,8 @@ import { SavedObjectsFindOptions, SavedObjectsUpdateResponse, } from '@kbn/core/server'; +import type { IKibanaSearchRequest, ISearchOptions } from '@kbn/search-types'; import { - IKibanaSearchRequest, - ISearchOptions, SearchSessionsFindResponse, SearchSessionSavedObjectAttributes, SearchSessionStatusResponse, diff --git a/src/plugins/data/server/search/strategies/common/async_utils.ts b/src/plugins/data/server/search/strategies/common/async_utils.ts index cbc1e1acd3cd0..ca33a01ac8064 100644 --- a/src/plugins/data/server/search/strategies/common/async_utils.ts +++ b/src/plugins/data/server/search/strategies/common/async_utils.ts @@ -10,7 +10,7 @@ import { AsyncSearchSubmitRequest, AsyncSearchGetRequest, } from '@elastic/elasticsearch/lib/api/types'; -import { ISearchOptions } from '../../../../common'; +import { ISearchOptions } from '@kbn/search-types'; import { SearchConfigSchema } from '../../../../config'; /** diff --git a/src/plugins/data/server/search/strategies/es_search/index.ts b/src/plugins/data/server/search/strategies/es_search/index.ts index 53a791455e64e..8f359b4789686 100644 --- a/src/plugins/data/server/search/strategies/es_search/index.ts +++ b/src/plugins/data/server/search/strategies/es_search/index.ts @@ -9,5 +9,4 @@ export { esSearchStrategyProvider } from './es_search_strategy'; export * from './request_utils'; export * from './response_utils'; -export type { IEsSearchRequest, IEsSearchResponse } from '../../../../common'; export { ES_SEARCH_STRATEGY } from '../../../../common'; diff --git a/src/plugins/data/server/search/strategies/es_search/response_utils.ts b/src/plugins/data/server/search/strategies/es_search/response_utils.ts index 9bbf9544791cf..a471d29556e49 100644 --- a/src/plugins/data/server/search/strategies/es_search/response_utils.ts +++ b/src/plugins/data/server/search/strategies/es_search/response_utils.ts @@ -8,7 +8,7 @@ import type { ConnectionRequestParams } from '@elastic/transport'; import type * as estypes from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; -import { ISearchOptions } from '../../../../common'; +import { ISearchOptions } from '@kbn/search-types'; import { sanitizeRequestParams } from '../../sanitize_request_params'; /** diff --git a/src/plugins/data/server/search/strategies/ese_search/ese_search_strategy.ts b/src/plugins/data/server/search/strategies/ese_search/ese_search_strategy.ts index 2bf9775cd5288..bd7aaa4656737 100644 --- a/src/plugins/data/server/search/strategies/ese_search/ese_search_strategy.ts +++ b/src/plugins/data/server/search/strategies/ese_search/ese_search_strategy.ts @@ -11,16 +11,12 @@ import type { Logger, SharedGlobalConfig } from '@kbn/core/server'; import { catchError, tap } from 'rxjs'; import type * as estypes from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; import { firstValueFrom, from } from 'rxjs'; +import type { ISearchOptions, IEsSearchRequest, IEsSearchResponse } from '@kbn/search-types'; import { getKbnServerError } from '@kbn/kibana-utils-plugin/server'; import { IAsyncSearchRequestParams } from '../..'; import { getKbnSearchError } from '../../report_search_error'; import type { ISearchStrategy, SearchStrategyDependencies } from '../../types'; -import type { - IAsyncSearchOptions, - IEsSearchRequest, - IEsSearchResponse, - ISearchOptions, -} from '../../../../common'; +import type { IAsyncSearchOptions } from '../../../../common'; import { DataViewType, isRunningResponse, pollSearch } from '../../../../common'; import { getDefaultAsyncGetParams, diff --git a/src/plugins/data/server/search/strategies/ese_search/request_utils.ts b/src/plugins/data/server/search/strategies/ese_search/request_utils.ts index 83e334aea3c34..ec182534e089f 100644 --- a/src/plugins/data/server/search/strategies/ese_search/request_utils.ts +++ b/src/plugins/data/server/search/strategies/ese_search/request_utils.ts @@ -9,7 +9,8 @@ import { IUiSettingsClient } from '@kbn/core/server'; import { AsyncSearchGetRequest } from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; import { AsyncSearchSubmitRequest } from '@elastic/elasticsearch/lib/api/types'; -import { ISearchOptions, UI_SETTINGS } from '../../../../common'; +import { ISearchOptions } from '@kbn/search-types'; +import { UI_SETTINGS } from '../../../../common'; import { getDefaultSearchParams } from '../es_search'; import { SearchConfigSchema } from '../../../../config'; import { diff --git a/src/plugins/data/server/search/strategies/ese_search/response_utils.ts b/src/plugins/data/server/search/strategies/ese_search/response_utils.ts index 290f44b1b4f9b..560fd367c6eb1 100644 --- a/src/plugins/data/server/search/strategies/ese_search/response_utils.ts +++ b/src/plugins/data/server/search/strategies/ese_search/response_utils.ts @@ -7,7 +7,7 @@ */ import type { ConnectionRequestParams } from '@elastic/transport'; -import { IKibanaSearchResponse } from '../../../../common'; +import type { IKibanaSearchResponse } from '@kbn/search-types'; import type { AsyncSearchResponse } from './types'; import { getTotalLoaded } from '../es_search'; import { sanitizeRequestParams } from '../../sanitize_request_params'; diff --git a/src/plugins/data/server/search/strategies/ese_search/types.ts b/src/plugins/data/server/search/strategies/ese_search/types.ts index 443ec6039a628..8ab9ff901f2c3 100644 --- a/src/plugins/data/server/search/strategies/ese_search/types.ts +++ b/src/plugins/data/server/search/strategies/ese_search/types.ts @@ -11,7 +11,7 @@ import type { SearchResponse, ShardStatistics, } from '@elastic/elasticsearch/lib/api/types'; -import { ISearchRequestParams } from '../../../../common'; +import type { ISearchRequestParams } from '@kbn/search-types'; export interface IAsyncSearchRequestParams extends ISearchRequestParams { keep_alive?: AsyncSearchGetRequest['keep_alive']; diff --git a/src/plugins/data/server/search/strategies/esql_async_search/esql_async_search_strategy.ts b/src/plugins/data/server/search/strategies/esql_async_search/esql_async_search_strategy.ts index e779f110e594a..a58572f078bfc 100644 --- a/src/plugins/data/server/search/strategies/esql_async_search/esql_async_search_strategy.ts +++ b/src/plugins/data/server/search/strategies/esql_async_search/esql_async_search_strategy.ts @@ -9,6 +9,7 @@ import type { IScopedClusterClient, Logger } from '@kbn/core/server'; import { catchError, tap } from 'rxjs'; import { getKbnServerError } from '@kbn/kibana-utils-plugin/server'; +import type { IKibanaSearchResponse, IKibanaSearchRequest } from '@kbn/search-types'; import { SqlQueryRequest } from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; import { SqlGetAsyncResponse } from '@elastic/elasticsearch/lib/api/types'; import type { ESQLSearchParams } from '@kbn/es-types'; @@ -16,10 +17,10 @@ import { getCommonDefaultAsyncSubmitParams, getCommonDefaultAsyncGetParams, } from '../common/async_utils'; +import { pollSearch } from '../../../../common'; import { getKbnSearchError } from '../../report_search_error'; import type { ISearchStrategy, SearchStrategyDependencies } from '../../types'; import type { IAsyncSearchOptions } from '../../../../common'; -import { IKibanaSearchRequest, IKibanaSearchResponse, pollSearch } from '../../../../common'; import { toAsyncKibanaSearchResponse } from './response_utils'; import { SearchConfigSchema } from '../../../../config'; diff --git a/src/plugins/data/server/search/strategies/esql_async_search/response_utils.ts b/src/plugins/data/server/search/strategies/esql_async_search/response_utils.ts index be28e4f3827a4..c67862e12eb1d 100644 --- a/src/plugins/data/server/search/strategies/esql_async_search/response_utils.ts +++ b/src/plugins/data/server/search/strategies/esql_async_search/response_utils.ts @@ -8,7 +8,7 @@ import type { ConnectionRequestParams } from '@elastic/transport'; import { SqlGetAsyncResponse } from '@elastic/elasticsearch/lib/api/types'; -import { IKibanaSearchResponse } from '../../../../common'; +import type { IKibanaSearchResponse } from '@kbn/search-types'; import { sanitizeRequestParams } from '../../sanitize_request_params'; /** diff --git a/src/plugins/data/server/search/strategies/sql_search/request_utils.ts b/src/plugins/data/server/search/strategies/sql_search/request_utils.ts index e170b506b537d..1a2540796d690 100644 --- a/src/plugins/data/server/search/strategies/sql_search/request_utils.ts +++ b/src/plugins/data/server/search/strategies/sql_search/request_utils.ts @@ -7,7 +7,7 @@ */ import { SqlGetAsyncRequest, SqlQueryRequest } from '@elastic/elasticsearch/lib/api/types'; -import { ISearchOptions } from '../../../../common'; +import { ISearchOptions } from '@kbn/search-types'; import { SearchConfigSchema } from '../../../../config'; import { getCommonDefaultAsyncGetParams, diff --git a/src/plugins/data/server/search/types.ts b/src/plugins/data/server/search/types.ts index 8b94085c3f80a..fe6b531ff5146 100644 --- a/src/plugins/data/server/search/types.ts +++ b/src/plugins/data/server/search/types.ts @@ -15,16 +15,16 @@ import type { KibanaRequest, CustomRequestHandlerContext, } from '@kbn/core/server'; -import { - ISearchOptions, - ISearchStartSearchSource, - IKibanaSearchRequest, - IKibanaSearchResponse, +import type { ISearchClient, + IKibanaSearchResponse, + IKibanaSearchRequest, + ISearchOptions, IEsSearchResponse, IEsSearchRequest, - SearchSourceService, -} from '../../common/search'; +} from '@kbn/search-types'; + +import { ISearchStartSearchSource, SearchSourceService } from '../../common/search'; import { AggsSetup, AggsStart } from './aggs'; import { SearchUsage } from './collectors/search'; import type { IScopedSearchSessionsClient } from './session'; diff --git a/src/plugins/data/tsconfig.json b/src/plugins/data/tsconfig.json index 6b78289c5988a..5a1b06d831486 100644 --- a/src/plugins/data/tsconfig.json +++ b/src/plugins/data/tsconfig.json @@ -55,7 +55,8 @@ "@kbn/code-editor", "@kbn/core-test-helpers-model-versions", "@kbn/esql-utils", - "@kbn/react-kibana-mount" + "@kbn/react-kibana-mount", + "@kbn/search-types" ], "exclude": [ "target/**/*", diff --git a/src/plugins/discover/public/__mocks__/services.ts b/src/plugins/discover/public/__mocks__/services.ts index fff99c9223756..5ba0d3730d343 100644 --- a/src/plugins/discover/public/__mocks__/services.ts +++ b/src/plugins/discover/public/__mocks__/services.ts @@ -29,12 +29,8 @@ import { HIDE_ANNOUNCEMENTS, SEARCH_ON_PAGE_LOAD_SETTING, } from '@kbn/discover-utils'; -import { - UI_SETTINGS, - calculateBounds, - SearchSource, - IKibanaSearchResponse, -} from '@kbn/data-plugin/public'; +import type { IKibanaSearchResponse } from '@kbn/search-types'; +import { UI_SETTINGS, calculateBounds, SearchSource } from '@kbn/data-plugin/public'; import { TopNavMenu } from '@kbn/navigation-plugin/public'; import { FORMATS_UI_SETTINGS } from '@kbn/field-formats-plugin/common'; import { chartPluginMock } from '@kbn/charts-plugin/public/mocks'; diff --git a/src/plugins/discover/public/application/context/services/_stubs.ts b/src/plugins/discover/public/application/context/services/_stubs.ts index acdd07c779d5f..0122d325fd98d 100644 --- a/src/plugins/discover/public/application/context/services/_stubs.ts +++ b/src/plugins/discover/public/application/context/services/_stubs.ts @@ -10,7 +10,7 @@ import sinon from 'sinon'; import moment from 'moment'; import { of } from 'rxjs'; import * as estypes from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; -import { IKibanaSearchResponse } from '@kbn/data-plugin/common'; +import type { IKibanaSearchResponse } from '@kbn/search-types'; import type { EsHitRecord } from '@kbn/discover-utils/types'; type SortHit = { diff --git a/src/plugins/discover/public/application/main/data_fetching/fetch_documents.test.ts b/src/plugins/discover/public/application/main/data_fetching/fetch_documents.test.ts index 36847a0a08929..7abc2d2744a60 100644 --- a/src/plugins/discover/public/application/main/data_fetching/fetch_documents.test.ts +++ b/src/plugins/discover/public/application/main/data_fetching/fetch_documents.test.ts @@ -10,7 +10,7 @@ import { throwError as throwErrorRx, of } from 'rxjs'; import { RequestAdapter } from '@kbn/inspector-plugin/common'; import { savedSearchMock } from '../../../__mocks__/saved_search'; import { discoverServiceMock } from '../../../__mocks__/services'; -import { IKibanaSearchResponse } from '@kbn/data-plugin/public'; +import type { IKibanaSearchResponse } from '@kbn/search-types'; import { SearchResponse } from '@elastic/elasticsearch/lib/api/types'; import { FetchDeps } from './fetch_all'; import type { EsHitRecord } from '@kbn/discover-utils/types'; diff --git a/src/plugins/discover/tsconfig.json b/src/plugins/discover/tsconfig.json index 6b576f3a08c1a..4a34f7fb34d42 100644 --- a/src/plugins/discover/tsconfig.json +++ b/src/plugins/discover/tsconfig.json @@ -84,7 +84,8 @@ "@kbn/shared-ux-markdown", "@kbn/data-view-utils", "@kbn/presentation-publishing", - "@kbn/observability-ai-assistant-plugin" + "@kbn/observability-ai-assistant-plugin", + "@kbn/search-types" ], "exclude": ["target/**/*"] } diff --git a/src/plugins/saved_search/public/mocks.ts b/src/plugins/saved_search/public/mocks.ts index 15c4bdd556f38..970ed9692aed0 100644 --- a/src/plugins/saved_search/public/mocks.ts +++ b/src/plugins/saved_search/public/mocks.ts @@ -7,7 +7,8 @@ */ import { of } from 'rxjs'; -import { SearchSource, IKibanaSearchResponse } from '@kbn/data-plugin/public'; +import type { IKibanaSearchResponse } from '@kbn/search-types'; +import { SearchSource } from '@kbn/data-plugin/public'; import { SearchSourceDependencies } from '@kbn/data-plugin/common/search'; import type { SearchResponse } from '@elastic/elasticsearch/lib/api/types'; import type { SavedSearchPublicPluginStart } from './plugin'; diff --git a/src/plugins/saved_search/tsconfig.json b/src/plugins/saved_search/tsconfig.json index c4ea0eaf4d5bc..0da728fdc6581 100644 --- a/src/plugins/saved_search/tsconfig.json +++ b/src/plugins/saved_search/tsconfig.json @@ -33,6 +33,7 @@ "@kbn/core-plugins-server", "@kbn/utility-types", "@kbn/saved-objects-finder-plugin", + "@kbn/search-types", ], "exclude": [ "target/**/*", diff --git a/src/plugins/unified_histogram/public/chart/histogram.tsx b/src/plugins/unified_histogram/public/chart/histogram.tsx index 281b532dff029..50c8f7242c589 100644 --- a/src/plugins/unified_histogram/public/chart/histogram.tsx +++ b/src/plugins/unified_histogram/public/chart/histogram.tsx @@ -11,7 +11,7 @@ import { css } from '@emotion/react'; import React, { useState, useRef, useEffect } from 'react'; import type { DataView } from '@kbn/data-views-plugin/public'; import type { DefaultInspectorAdapters, Datatable } from '@kbn/expressions-plugin/common'; -import type { IKibanaSearchResponse } from '@kbn/data-plugin/public'; +import type { IKibanaSearchResponse } from '@kbn/search-types'; import type { estypes } from '@elastic/elasticsearch'; import type { TimeRange } from '@kbn/es-query'; import type { diff --git a/src/plugins/unified_histogram/tsconfig.json b/src/plugins/unified_histogram/tsconfig.json index a1c15026479cc..2f54a5d33797a 100644 --- a/src/plugins/unified_histogram/tsconfig.json +++ b/src/plugins/unified_histogram/tsconfig.json @@ -32,6 +32,7 @@ "@kbn/esql-utils", "@kbn/discover-utils", "@kbn/visualization-utils", + "@kbn/search-types", ], "exclude": [ "target/**/*", diff --git a/src/plugins/vis_types/vega/public/data_model/search_api.ts b/src/plugins/vis_types/vega/public/data_model/search_api.ts index eebfc6c3b9b15..b15e5a9bda5ca 100644 --- a/src/plugins/vis_types/vega/public/data_model/search_api.ts +++ b/src/plugins/vis_types/vega/public/data_model/search_api.ts @@ -9,11 +9,11 @@ import { combineLatest, from } from 'rxjs'; import { map, tap, switchMap } from 'rxjs'; import type { IUiSettingsClient, KibanaExecutionContext } from '@kbn/core/public'; +import type { IEsSearchResponse } from '@kbn/search-types'; import { getSearchParamsFromRequest, SearchRequest, DataPublicPluginStart, - IEsSearchResponse, } from '@kbn/data-plugin/public'; import type { DataViewsPublicPluginStart } from '@kbn/data-views-plugin/public'; import { search as dataPluginSearch } from '@kbn/data-plugin/public'; diff --git a/src/plugins/vis_types/vega/tsconfig.json b/src/plugins/vis_types/vega/tsconfig.json index 19caa63329abe..172dd4c60fea7 100644 --- a/src/plugins/vis_types/vega/tsconfig.json +++ b/src/plugins/vis_types/vega/tsconfig.json @@ -40,6 +40,7 @@ "@kbn/config-schema", "@kbn/code-editor", "@kbn/react-kibana-context-render", + "@kbn/search-types", ], "exclude": [ "target/**/*", diff --git a/test/common/services/bsearch.ts b/test/common/services/bsearch.ts index 7f522ca270043..fd79a9b9a75e8 100644 --- a/test/common/services/bsearch.ts +++ b/test/common/services/bsearch.ts @@ -9,7 +9,7 @@ import expect from '@kbn/expect'; import request from 'superagent'; import type SuperTest from 'supertest'; -import { IEsSearchResponse } from '@kbn/data-plugin/common'; +import type { IEsSearchResponse } from '@kbn/search-types'; import { ELASTIC_HTTP_VERSION_HEADER } from '@kbn/core-http-common'; import { BFETCH_ROUTE_VERSION_LATEST } from '@kbn/bfetch-plugin/common'; import { FtrService } from '../ftr_provider_context'; diff --git a/test/tsconfig.json b/test/tsconfig.json index ebf1a1e71c01b..fdc7557a1b990 100644 --- a/test/tsconfig.json +++ b/test/tsconfig.json @@ -74,5 +74,6 @@ "@kbn/ftr-common-functional-ui-services", "@kbn/monaco", "@kbn/esql-utils", + "@kbn/search-types", ] } diff --git a/tsconfig.base.json b/tsconfig.base.json index b8a55883d5fae..670f3839f9695 100644 --- a/tsconfig.base.json +++ b/tsconfig.base.json @@ -1408,6 +1408,8 @@ "@kbn/search-playground/*": ["x-pack/plugins/search_playground/*"], "@kbn/search-response-warnings": ["packages/kbn-search-response-warnings"], "@kbn/search-response-warnings/*": ["packages/kbn-search-response-warnings/*"], + "@kbn/search-types": ["packages/kbn-search-types"], + "@kbn/search-types/*": ["packages/kbn-search-types/*"], "@kbn/searchprofiler-plugin": ["x-pack/plugins/searchprofiler"], "@kbn/searchprofiler-plugin/*": ["x-pack/plugins/searchprofiler/*"], "@kbn/security-api-integration-helpers": ["x-pack/test/security_api_integration/packages/helpers"], diff --git a/x-pack/packages/ml/cancellable_search/src/use_cancellable_search.ts b/x-pack/packages/ml/cancellable_search/src/use_cancellable_search.ts index 28cf5677df2d3..375fd6e44b435 100644 --- a/x-pack/packages/ml/cancellable_search/src/use_cancellable_search.ts +++ b/x-pack/packages/ml/cancellable_search/src/use_cancellable_search.ts @@ -6,7 +6,8 @@ */ import { useCallback, useRef, useState } from 'react'; -import { type IKibanaSearchResponse, isRunningResponse } from '@kbn/data-plugin/common'; +import type { IKibanaSearchResponse } from '@kbn/search-types'; +import { isRunningResponse } from '@kbn/data-plugin/common'; import { tap } from 'rxjs'; import type { DataPublicPluginStart } from '@kbn/data-plugin/public'; diff --git a/x-pack/packages/ml/cancellable_search/tsconfig.json b/x-pack/packages/ml/cancellable_search/tsconfig.json index 733865038a43f..096fcd47fd25b 100644 --- a/x-pack/packages/ml/cancellable_search/tsconfig.json +++ b/x-pack/packages/ml/cancellable_search/tsconfig.json @@ -16,6 +16,7 @@ "target/**/*", ], "kbn_references": [ - "@kbn/data-plugin" + "@kbn/data-plugin", + "@kbn/search-types" ] } diff --git a/x-pack/plugins/aiops/public/hooks/use_cancellable_search.ts b/x-pack/plugins/aiops/public/hooks/use_cancellable_search.ts index af6dec9d07734..4d721d64c987f 100644 --- a/x-pack/plugins/aiops/public/hooks/use_cancellable_search.ts +++ b/x-pack/plugins/aiops/public/hooks/use_cancellable_search.ts @@ -6,7 +6,8 @@ */ import { useCallback, useRef, useState } from 'react'; -import { type IKibanaSearchResponse, isRunningResponse } from '@kbn/data-plugin/common'; +import type { IKibanaSearchResponse } from '@kbn/search-types'; +import { isRunningResponse } from '@kbn/data-plugin/common'; import { tap } from 'rxjs'; import { useAiopsAppContext } from './use_aiops_app_context'; diff --git a/x-pack/plugins/aiops/tsconfig.json b/x-pack/plugins/aiops/tsconfig.json index 6b11a3c6b91f4..87278bba2ad44 100644 --- a/x-pack/plugins/aiops/tsconfig.json +++ b/x-pack/plugins/aiops/tsconfig.json @@ -70,6 +70,7 @@ "@kbn/aiops-change-point-detection", "@kbn/react-kibana-context-theme", "@kbn/react-kibana-context-render", + "@kbn/search-types", ], "exclude": [ "target/**/*", diff --git a/x-pack/plugins/alerting/server/lib/wrap_search_source_client.ts b/x-pack/plugins/alerting/server/lib/wrap_search_source_client.ts index 17e5d05f61fae..77d08a969fae0 100644 --- a/x-pack/plugins/alerting/server/lib/wrap_search_source_client.ts +++ b/x-pack/plugins/alerting/server/lib/wrap_search_source_client.ts @@ -6,8 +6,8 @@ */ import { Logger } from '@kbn/core/server'; +import { ISearchOptions } from '@kbn/search-types'; import { - ISearchOptions, ISearchSource, ISearchStartSearchSource, SearchSource, diff --git a/x-pack/plugins/alerting/tsconfig.json b/x-pack/plugins/alerting/tsconfig.json index ded359714bd56..f76c6d781ad83 100644 --- a/x-pack/plugins/alerting/tsconfig.json +++ b/x-pack/plugins/alerting/tsconfig.json @@ -69,6 +69,7 @@ "@kbn/core-http-router-server-internal", "@kbn/core-execution-context-server-mocks", "@kbn/react-kibana-context-render", + "@kbn/search-types", ], "exclude": [ "target/**/*" diff --git a/x-pack/plugins/canvas/tsconfig.json b/x-pack/plugins/canvas/tsconfig.json index 4a0169f9ac65e..124d2c660e9fe 100644 --- a/x-pack/plugins/canvas/tsconfig.json +++ b/x-pack/plugins/canvas/tsconfig.json @@ -89,6 +89,7 @@ "@kbn/presentation-containers", "@kbn/presentation-publishing", "@kbn/react-kibana-context-render", + "@kbn/search-types", ], "exclude": [ "target/**/*", diff --git a/x-pack/plugins/canvas/types/strategy.ts b/x-pack/plugins/canvas/types/strategy.ts index a3675466cf278..1248c157075f9 100644 --- a/x-pack/plugins/canvas/types/strategy.ts +++ b/x-pack/plugins/canvas/types/strategy.ts @@ -7,7 +7,7 @@ import { TransportResult } from '@elastic/elasticsearch'; import type * as estypes from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; -import { IKibanaSearchRequest } from '@kbn/data-plugin/common'; +import type { IKibanaSearchRequest } from '@kbn/search-types'; import { ExpressionValueFilter } from '.'; export interface EssqlSearchStrategyRequest extends IKibanaSearchRequest { count: number; diff --git a/x-pack/plugins/cloud_security_posture/public/pages/configurations/latest_findings/use_grouped_findings.tsx b/x-pack/plugins/cloud_security_posture/public/pages/configurations/latest_findings/use_grouped_findings.tsx index c67c1250d1be7..a4dcfe5a442c2 100644 --- a/x-pack/plugins/cloud_security_posture/public/pages/configurations/latest_findings/use_grouped_findings.tsx +++ b/x-pack/plugins/cloud_security_posture/public/pages/configurations/latest_findings/use_grouped_findings.tsx @@ -6,7 +6,7 @@ */ import { SearchResponse } from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; -import { IKibanaSearchResponse } from '@kbn/data-plugin/public'; +import type { IKibanaSearchResponse } from '@kbn/search-types'; import { GenericBuckets, GroupingQuery, RootAggregation } from '@kbn/securitysolution-grouping/src'; import { useQuery } from '@tanstack/react-query'; import { lastValueFrom } from 'rxjs'; diff --git a/x-pack/plugins/cloud_security_posture/public/pages/configurations/latest_findings/use_latest_findings.ts b/x-pack/plugins/cloud_security_posture/public/pages/configurations/latest_findings/use_latest_findings.ts index 69638f92e5b64..a9bb7540ab12e 100644 --- a/x-pack/plugins/cloud_security_posture/public/pages/configurations/latest_findings/use_latest_findings.ts +++ b/x-pack/plugins/cloud_security_posture/public/pages/configurations/latest_findings/use_latest_findings.ts @@ -7,7 +7,7 @@ import { useInfiniteQuery } from '@tanstack/react-query'; import { number } from 'io-ts'; import { lastValueFrom } from 'rxjs'; -import type { IKibanaSearchRequest, IKibanaSearchResponse } from '@kbn/data-plugin/common'; +import type { IKibanaSearchResponse, IKibanaSearchRequest } from '@kbn/search-types'; import type { Pagination } from '@elastic/eui'; import type * as estypes from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; import { buildDataTableRecord } from '@kbn/discover-utils'; diff --git a/x-pack/plugins/cloud_security_posture/public/pages/vulnerabilities/hooks/use_grouped_vulnerabilities.tsx b/x-pack/plugins/cloud_security_posture/public/pages/vulnerabilities/hooks/use_grouped_vulnerabilities.tsx index 371ab2fa038c0..a39933da49695 100644 --- a/x-pack/plugins/cloud_security_posture/public/pages/vulnerabilities/hooks/use_grouped_vulnerabilities.tsx +++ b/x-pack/plugins/cloud_security_posture/public/pages/vulnerabilities/hooks/use_grouped_vulnerabilities.tsx @@ -6,7 +6,7 @@ */ import { SearchResponse } from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; -import { IKibanaSearchResponse } from '@kbn/data-plugin/public'; +import type { IKibanaSearchResponse } from '@kbn/search-types'; import { GenericBuckets, GroupingQuery, RootAggregation } from '@kbn/securitysolution-grouping/src'; import { useQuery } from '@tanstack/react-query'; import { lastValueFrom } from 'rxjs'; diff --git a/x-pack/plugins/cloud_security_posture/public/pages/vulnerabilities/hooks/use_latest_vulnerabilities.tsx b/x-pack/plugins/cloud_security_posture/public/pages/vulnerabilities/hooks/use_latest_vulnerabilities.tsx index df9d5446ea926..082f6a0bbdfcb 100644 --- a/x-pack/plugins/cloud_security_posture/public/pages/vulnerabilities/hooks/use_latest_vulnerabilities.tsx +++ b/x-pack/plugins/cloud_security_posture/public/pages/vulnerabilities/hooks/use_latest_vulnerabilities.tsx @@ -6,7 +6,7 @@ */ import { useInfiniteQuery } from '@tanstack/react-query'; import { lastValueFrom } from 'rxjs'; -import type { IKibanaSearchRequest, IKibanaSearchResponse } from '@kbn/data-plugin/common'; +import type { IKibanaSearchResponse, IKibanaSearchRequest } from '@kbn/search-types'; import { number } from 'io-ts'; import { SearchRequest, diff --git a/x-pack/plugins/cloud_security_posture/tsconfig.json b/x-pack/plugins/cloud_security_posture/tsconfig.json index c6e5ec061b57e..91d6b3711a245 100755 --- a/x-pack/plugins/cloud_security_posture/tsconfig.json +++ b/x-pack/plugins/cloud_security_posture/tsconfig.json @@ -62,7 +62,8 @@ "@kbn/securitysolution-grouping", "@kbn/alerting-plugin", "@kbn/code-editor", - "@kbn/code-editor-mock" + "@kbn/code-editor-mock", + "@kbn/search-types" ], "exclude": ["target/**/*"] } diff --git a/x-pack/plugins/data_visualizer/common/types/field_stats.ts b/x-pack/plugins/data_visualizer/common/types/field_stats.ts index 61babb72dae70..2aeea5c4cf033 100644 --- a/x-pack/plugins/data_visualizer/common/types/field_stats.ts +++ b/x-pack/plugins/data_visualizer/common/types/field_stats.ts @@ -7,7 +7,7 @@ import type * as estypes from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; import type { Query } from '@kbn/es-query'; -import type { IKibanaSearchResponse } from '@kbn/data-plugin/common'; +import type { IKibanaSearchResponse } from '@kbn/search-types'; import { isPopulatedObject } from '@kbn/ml-is-populated-object'; import type { KibanaExecutionContext } from '@kbn/core-execution-context-common'; import type { TimeBucketsInterval } from '@kbn/ml-time-buckets'; diff --git a/x-pack/plugins/data_visualizer/public/application/data_drift/use_data_drift_result.ts b/x-pack/plugins/data_visualizer/public/application/data_drift/use_data_drift_result.ts index 10af36198a77d..83648b77d7dac 100644 --- a/x-pack/plugins/data_visualizer/public/application/data_drift/use_data_drift_result.ts +++ b/x-pack/plugins/data_visualizer/public/application/data_drift/use_data_drift_result.ts @@ -17,7 +17,7 @@ import type { } from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; import type { AggregationsAggregate } from '@elastic/elasticsearch/lib/api/types'; -import type { IKibanaSearchRequest } from '@kbn/data-plugin/common'; +import type { IKibanaSearchRequest } from '@kbn/search-types'; import type { DataView } from '@kbn/data-views-plugin/public'; import { isPopulatedObject } from '@kbn/ml-is-populated-object'; import type { Query } from '@kbn/data-plugin/common'; diff --git a/x-pack/plugins/data_visualizer/public/application/file_data_visualizer/components/doc_count_chart/doc_count_search.ts b/x-pack/plugins/data_visualizer/public/application/file_data_visualizer/components/doc_count_chart/doc_count_search.ts index b5d9c23e15c9c..c48b5f3d23077 100644 --- a/x-pack/plugins/data_visualizer/public/application/file_data_visualizer/components/doc_count_chart/doc_count_search.ts +++ b/x-pack/plugins/data_visualizer/public/application/file_data_visualizer/components/doc_count_chart/doc_count_search.ts @@ -8,8 +8,8 @@ import { lastValueFrom } from 'rxjs'; import type estypes from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; - -import type { DataPublicPluginStart, IKibanaSearchResponse } from '@kbn/data-plugin/public'; +import type { IKibanaSearchResponse } from '@kbn/search-types'; +import type { DataPublicPluginStart } from '@kbn/data-plugin/public'; import type { TimeBuckets } from '@kbn/ml-time-buckets'; import type { LineChartPoint } from './event_rate_chart'; diff --git a/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/hooks/esql/use_esql_overall_stats_data.ts b/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/hooks/esql/use_esql_overall_stats_data.ts index 0ab96e4450424..18002dab13cd8 100644 --- a/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/hooks/esql/use_esql_overall_stats_data.ts +++ b/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/hooks/esql/use_esql_overall_stats_data.ts @@ -12,7 +12,7 @@ import { i18n } from '@kbn/i18n'; import { useCallback, useEffect, useMemo, useReducer, useRef, useState } from 'react'; import { type UseCancellableSearch, useCancellableSearch } from '@kbn/ml-cancellable-search'; import type { estypes } from '@elastic/elasticsearch'; -import type { ISearchOptions } from '@kbn/data-plugin/common'; +import type { ISearchOptions } from '@kbn/search-types'; import type { TimeBucketsInterval } from '@kbn/ml-time-buckets'; import { getESQLWithSafeLimit, ESQL_LATEST_VERSION, appendToESQLQuery } from '@kbn/esql-utils'; import { isDefined } from '@kbn/ml-is-defined'; diff --git a/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/hooks/use_field_stats.ts b/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/hooks/use_field_stats.ts index f2c4bd62cad1f..c237647970443 100644 --- a/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/hooks/use_field_stats.ts +++ b/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/hooks/use_field_stats.ts @@ -12,7 +12,7 @@ import { i18n } from '@kbn/i18n'; import { last, cloneDeep } from 'lodash'; import { mergeMap, switchMap } from 'rxjs'; import { Comparators } from '@elastic/eui'; -import type { ISearchOptions } from '@kbn/data-plugin/common'; +import type { ISearchOptions } from '@kbn/search-types'; import { buildBaseFilterCriteria, getSafeAggregationName } from '@kbn/ml-query-utils'; import type { DataStatsFetchProgress, diff --git a/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/hooks/use_overall_stats.ts b/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/hooks/use_overall_stats.ts index cb72592742d44..56ba706c3b3b9 100644 --- a/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/hooks/use_overall_stats.ts +++ b/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/hooks/use_overall_stats.ts @@ -10,10 +10,10 @@ import type { Subscription } from 'rxjs'; import { map } from 'rxjs'; import { chunk } from 'lodash'; import type { - IKibanaSearchRequest, IKibanaSearchResponse, + IKibanaSearchRequest, ISearchOptions, -} from '@kbn/data-plugin/common'; +} from '@kbn/search-types'; import { extractErrorProperties } from '@kbn/ml-error-utils'; import { getProcessedFields } from '@kbn/ml-data-grid'; import { buildBaseFilterCriteria } from '@kbn/ml-query-utils'; diff --git a/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/search_strategy/requests/get_boolean_field_stats.ts b/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/search_strategy/requests/get_boolean_field_stats.ts index 0688b53e88776..a283b8ff47bb7 100644 --- a/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/search_strategy/requests/get_boolean_field_stats.ts +++ b/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/search_strategy/requests/get_boolean_field_stats.ts @@ -10,11 +10,11 @@ import type { Observable } from 'rxjs'; import { of } from 'rxjs'; import { catchError, map } from 'rxjs'; import type { - IKibanaSearchRequest, IKibanaSearchResponse, + IKibanaSearchRequest, ISearchOptions, - ISearchStart, -} from '@kbn/data-plugin/public'; +} from '@kbn/search-types'; +import type { ISearchStart } from '@kbn/data-plugin/public'; import { isPopulatedObject } from '@kbn/ml-is-populated-object'; import { extractErrorProperties } from '@kbn/ml-error-utils'; diff --git a/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/search_strategy/requests/get_date_field_stats.ts b/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/search_strategy/requests/get_date_field_stats.ts index fc6af3bf157c8..93431c0334101 100644 --- a/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/search_strategy/requests/get_date_field_stats.ts +++ b/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/search_strategy/requests/get_date_field_stats.ts @@ -11,11 +11,11 @@ import type { Observable } from 'rxjs'; import { of } from 'rxjs'; import { catchError, map } from 'rxjs'; import type { - IKibanaSearchRequest, IKibanaSearchResponse, + IKibanaSearchRequest, ISearchOptions, - ISearchStart, -} from '@kbn/data-plugin/public'; +} from '@kbn/search-types'; +import type { ISearchStart } from '@kbn/data-plugin/public'; import { isPopulatedObject } from '@kbn/ml-is-populated-object'; import { extractErrorProperties } from '@kbn/ml-error-utils'; import { buildAggregationWithSamplingOption } from './build_random_sampler_agg'; diff --git a/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/search_strategy/requests/get_document_stats.ts b/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/search_strategy/requests/get_document_stats.ts index 70931200dbd86..12bf409065e72 100644 --- a/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/search_strategy/requests/get_document_stats.ts +++ b/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/search_strategy/requests/get_document_stats.ts @@ -8,7 +8,8 @@ import { each, get, sortedIndex } from 'lodash'; import type * as estypes from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; import { isPopulatedObject } from '@kbn/ml-is-populated-object'; -import type { DataPublicPluginStart, ISearchOptions } from '@kbn/data-plugin/public'; +import type { ISearchOptions } from '@kbn/search-types'; +import type { DataPublicPluginStart } from '@kbn/data-plugin/public'; import seedrandom from 'seedrandom'; import { isDefined } from '@kbn/ml-is-defined'; import { buildBaseFilterCriteria } from '@kbn/ml-query-utils'; diff --git a/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/search_strategy/requests/get_field_examples.ts b/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/search_strategy/requests/get_field_examples.ts index 80f4a7d83ab8c..9e14bd472c84a 100644 --- a/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/search_strategy/requests/get_field_examples.ts +++ b/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/search_strategy/requests/get_field_examples.ts @@ -9,11 +9,11 @@ import { get } from 'lodash'; import { combineLatest, of } from 'rxjs'; import { catchError, map } from 'rxjs'; import type { - IKibanaSearchRequest, IKibanaSearchResponse, + IKibanaSearchRequest, ISearchOptions, - ISearchStart, -} from '@kbn/data-plugin/public'; +} from '@kbn/search-types'; +import type { ISearchStart } from '@kbn/data-plugin/public'; import { isPopulatedObject } from '@kbn/ml-is-populated-object'; import type { SearchHit } from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; import { buildBaseFilterCriteria } from '@kbn/ml-query-utils'; diff --git a/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/search_strategy/requests/get_fields_stats.ts b/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/search_strategy/requests/get_fields_stats.ts index 80d5b8e338b97..b35ede24302f5 100644 --- a/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/search_strategy/requests/get_fields_stats.ts +++ b/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/search_strategy/requests/get_fields_stats.ts @@ -6,7 +6,7 @@ */ import type { Observable } from 'rxjs'; -import type { ISearchOptions } from '@kbn/data-plugin/common'; +import type { ISearchOptions } from '@kbn/search-types'; import type { ISearchStart } from '@kbn/data-plugin/public'; import type { FieldStatsCommonRequestParams, diff --git a/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/search_strategy/requests/get_numeric_field_stats.ts b/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/search_strategy/requests/get_numeric_field_stats.ts index aaa770b78150e..41569286d47b5 100644 --- a/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/search_strategy/requests/get_numeric_field_stats.ts +++ b/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/search_strategy/requests/get_numeric_field_stats.ts @@ -12,10 +12,10 @@ import type { Observable } from 'rxjs'; import { of } from 'rxjs'; import type { AggregationsTermsAggregation } from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; import type { - IKibanaSearchRequest, IKibanaSearchResponse, + IKibanaSearchRequest, ISearchOptions, -} from '@kbn/data-plugin/common'; +} from '@kbn/search-types'; import type { ISearchStart } from '@kbn/data-plugin/public'; import { isPopulatedObject } from '@kbn/ml-is-populated-object'; import { isDefined } from '@kbn/ml-is-defined'; diff --git a/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/search_strategy/requests/get_string_field_stats.ts b/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/search_strategy/requests/get_string_field_stats.ts index 4555b4c6cc860..6e323f63a37a3 100644 --- a/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/search_strategy/requests/get_string_field_stats.ts +++ b/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/search_strategy/requests/get_string_field_stats.ts @@ -11,11 +11,11 @@ import { of } from 'rxjs'; import { catchError, map } from 'rxjs'; import type { AggregationsTermsAggregation } from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; import type { - IKibanaSearchRequest, IKibanaSearchResponse, + IKibanaSearchRequest, ISearchOptions, - ISearchStart, -} from '@kbn/data-plugin/public'; +} from '@kbn/search-types'; +import type { ISearchStart } from '@kbn/data-plugin/public'; import { isPopulatedObject } from '@kbn/ml-is-populated-object'; import { extractErrorProperties } from '@kbn/ml-error-utils'; import { processTopValues } from './utils'; diff --git a/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/search_strategy/requests/overall_stats.ts b/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/search_strategy/requests/overall_stats.ts index 1a6a68a0c58c2..46894014f3556 100644 --- a/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/search_strategy/requests/overall_stats.ts +++ b/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/search_strategy/requests/overall_stats.ts @@ -8,7 +8,7 @@ import type * as estypes from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; import { get } from 'lodash'; import type { Query } from '@kbn/es-query'; -import type { IKibanaSearchResponse } from '@kbn/data-plugin/common'; +import type { IKibanaSearchResponse } from '@kbn/search-types'; import type { AggCardinality } from '@kbn/ml-agg-utils'; import { isPopulatedObject } from '@kbn/ml-is-populated-object'; import { buildBaseFilterCriteria, getSafeAggregationName } from '@kbn/ml-query-utils'; diff --git a/x-pack/plugins/data_visualizer/tsconfig.json b/x-pack/plugins/data_visualizer/tsconfig.json index 61a7a80484eb9..957c1b8eccb6f 100644 --- a/x-pack/plugins/data_visualizer/tsconfig.json +++ b/x-pack/plugins/data_visualizer/tsconfig.json @@ -79,7 +79,8 @@ "@kbn/ml-time-buckets", "@kbn/aiops-log-rate-analysis", "@kbn/react-kibana-context-render", - "@kbn/react-kibana-context-theme" + "@kbn/react-kibana-context-theme", + "@kbn/search-types" ], "exclude": [ "target/**/*", diff --git a/x-pack/plugins/enterprise_search/public/applications/analytics/components/analytics_collection_view/analytics_collection_explore_table_formulas.ts b/x-pack/plugins/enterprise_search/public/applications/analytics/components/analytics_collection_view/analytics_collection_explore_table_formulas.ts index b809f23b53d02..193b917a45106 100644 --- a/x-pack/plugins/enterprise_search/public/applications/analytics/components/analytics_collection_view/analytics_collection_explore_table_formulas.ts +++ b/x-pack/plugins/enterprise_search/public/applications/analytics/components/analytics_collection_view/analytics_collection_explore_table_formulas.ts @@ -4,8 +4,8 @@ * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ - -import { DataView, IKibanaSearchRequest, TimeRange } from '@kbn/data-plugin/common'; +import { DataView, TimeRange } from '@kbn/data-plugin/common'; +import type { IKibanaSearchRequest } from '@kbn/search-types'; const getSearchQueryRequestParams = (field: string, search: string): { regexp: {} } => { const createRegexQuery = (queryString: string) => { diff --git a/x-pack/plugins/enterprise_search/public/applications/analytics/components/analytics_collection_view/analytics_collection_explore_table_logic.ts b/x-pack/plugins/enterprise_search/public/applications/analytics/components/analytics_collection_view/analytics_collection_explore_table_logic.ts index d691a37f41827..04ab8ba35bc94 100644 --- a/x-pack/plugins/enterprise_search/public/applications/analytics/components/analytics_collection_view/analytics_collection_explore_table_logic.ts +++ b/x-pack/plugins/enterprise_search/public/applications/analytics/components/analytics_collection_view/analytics_collection_explore_table_logic.ts @@ -7,13 +7,8 @@ import { kea, MakeLogicType } from 'kea'; -import { - DataView, - IKibanaSearchRequest, - IKibanaSearchResponse, - isRunningResponse, - TimeRange, -} from '@kbn/data-plugin/common'; +import { DataView, isRunningResponse, TimeRange } from '@kbn/data-plugin/common'; +import type { IKibanaSearchResponse, IKibanaSearchRequest } from '@kbn/search-types'; import { KibanaLogic } from '../../../shared/kibana/kibana_logic'; diff --git a/x-pack/plugins/enterprise_search/tsconfig.json b/x-pack/plugins/enterprise_search/tsconfig.json index 4aba94dff1bbc..4bd4ee55807a5 100644 --- a/x-pack/plugins/enterprise_search/tsconfig.json +++ b/x-pack/plugins/enterprise_search/tsconfig.json @@ -73,6 +73,7 @@ "@kbn/utility-types", "@kbn/index-management", "@kbn/deeplinks-search", - "@kbn/react-kibana-context-theme" + "@kbn/react-kibana-context-theme", + "@kbn/search-types" ] } diff --git a/x-pack/plugins/lens/public/app_plugin/shared/edit_on_the_fly/helpers.test.ts b/x-pack/plugins/lens/public/app_plugin/shared/edit_on_the_fly/helpers.test.ts index 57638b61db1a9..fcdb83a978f6a 100644 --- a/x-pack/plugins/lens/public/app_plugin/shared/edit_on_the_fly/helpers.test.ts +++ b/x-pack/plugins/lens/public/app_plugin/shared/edit_on_the_fly/helpers.test.ts @@ -5,7 +5,7 @@ * 2.0. */ import { dataViewPluginMocks } from '@kbn/data-views-plugin/public/mocks'; -import { fetchFieldsFromESQL } from '@kbn/text-based-editor'; +import { getESQLQueryColumns } from '@kbn/esql-utils'; import type { LensPluginStartDependencies } from '../../../plugin'; import { createMockStartDependencies } from '../../../editor_frame_service/mocks'; import { @@ -18,45 +18,44 @@ import { suggestionsApi } from '../../../lens_suggestions_api'; import { getSuggestions } from './helpers'; const mockSuggestionApi = suggestionsApi as jest.Mock; -const mockFetchData = fetchFieldsFromESQL as jest.Mock; +const mockFetchData = getESQLQueryColumns as jest.Mock; jest.mock('../../../lens_suggestions_api', () => ({ suggestionsApi: jest.fn(() => mockAllSuggestions), })); -jest.mock('@kbn/text-based-editor', () => ({ - fetchFieldsFromESQL: jest.fn(() => { - return { - columns: [ - { - name: '@timestamp', - id: '@timestamp', - meta: { - type: 'date', - }, +jest.mock('@kbn/esql-utils', () => { + return { + getESQLQueryColumns: jest.fn().mockResolvedValue(() => [ + { + name: '@timestamp', + id: '@timestamp', + meta: { + type: 'date', }, - { - name: 'bytes', - id: 'bytes', - meta: { - type: 'number', - }, + }, + { + name: 'bytes', + id: 'bytes', + meta: { + type: 'number', }, - { - name: 'memory', - id: 'memory', - meta: { - type: 'number', - }, + }, + { + name: 'memory', + id: 'memory', + meta: { + type: 'number', }, - ], - }; - }), -})); + }, + ]), + getIndexPatternFromESQLQuery: jest.fn().mockReturnValue('index1'), + }; +}); describe('getSuggestions', () => { const query = { - esql: 'from index1 | limit 10 | stats average = avg(bytes', + esql: 'from index1 | limit 10 | stats average = avg(bytes)', }; const mockStartDependencies = createMockStartDependencies() as unknown as LensPluginStartDependencies; diff --git a/x-pack/plugins/lens/public/app_plugin/shared/edit_on_the_fly/helpers.ts b/x-pack/plugins/lens/public/app_plugin/shared/edit_on_the_fly/helpers.ts index a0339d65fc09f..d1dd5febca59e 100644 --- a/x-pack/plugins/lens/public/app_plugin/shared/edit_on_the_fly/helpers.ts +++ b/x-pack/plugins/lens/public/app_plugin/shared/edit_on_the_fly/helpers.ts @@ -4,38 +4,19 @@ * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ -import { getIndexPatternFromESQLQuery, getESQLAdHocDataview } from '@kbn/esql-utils'; +import { + getIndexPatternFromESQLQuery, + getESQLAdHocDataview, + getESQLQueryColumns, +} from '@kbn/esql-utils'; import type { AggregateQuery } from '@kbn/es-query'; import { getLensAttributesFromSuggestion } from '@kbn/visualization-utils'; -import { fetchFieldsFromESQL } from '@kbn/text-based-editor'; import type { DataViewSpec } from '@kbn/data-views-plugin/public'; import type { TypedLensByValueInput } from '../../../embeddable/embeddable_component'; import type { LensPluginStartDependencies } from '../../../plugin'; import type { DatasourceMap, VisualizationMap } from '../../../types'; import { suggestionsApi } from '../../../lens_suggestions_api'; -export const getQueryColumns = async ( - query: AggregateQuery, - deps: LensPluginStartDependencies, - abortController?: AbortController -) => { - // Fetching only columns for ES|QL for performance reasons with limit 0 - // Important note: ES doesnt return the warnings for 0 limit, - // I am skipping them in favor of performance now - // but we should think another way to get them (from Lens embeddable or store) - const performantQuery = { ...query }; - if ('esql' in performantQuery && performantQuery.esql) { - performantQuery.esql = `${performantQuery.esql} | limit 0`; - } - const table = await fetchFieldsFromESQL( - performantQuery, - deps.expressions, - undefined, - abortController - ); - return table?.columns; -}; - export const getSuggestions = async ( query: AggregateQuery, deps: LensPluginStartDependencies, @@ -58,7 +39,12 @@ export const getSuggestions = async ( if (dataView.fields.getByName('@timestamp')?.type === 'date' && !dataViewSpec) { dataView.timeFieldName = '@timestamp'; } - const columns = await getQueryColumns(query, deps, abortController); + + const columns = await getESQLQueryColumns({ + esqlQuery: 'esql' in query ? query.esql : '', + search: deps.data.search.search, + signal: abortController?.signal, + }); const context = { dataViewSpec: dataView?.toSpec(), fieldName: '', diff --git a/x-pack/plugins/lens/public/trigger_actions/open_lens_config/create_action_helpers.ts b/x-pack/plugins/lens/public/trigger_actions/open_lens_config/create_action_helpers.ts index b99583ddf3103..3a7f35a254b26 100644 --- a/x-pack/plugins/lens/public/trigger_actions/open_lens_config/create_action_helpers.ts +++ b/x-pack/plugins/lens/public/trigger_actions/open_lens_config/create_action_helpers.ts @@ -9,10 +9,14 @@ import type { CoreStart } from '@kbn/core/public'; import { getLensAttributesFromSuggestion } from '@kbn/visualization-utils'; import { IncompatibleActionError } from '@kbn/ui-actions-plugin/public'; import { PresentationContainer } from '@kbn/presentation-containers'; -import { getESQLAdHocDataview, getIndexForESQLQuery, ENABLE_ESQL } from '@kbn/esql-utils'; +import { + getESQLAdHocDataview, + getIndexForESQLQuery, + ENABLE_ESQL, + getESQLQueryColumns, +} from '@kbn/esql-utils'; import type { Datasource, Visualization } from '../../types'; import type { LensPluginStartDependencies } from '../../plugin'; -import { fetchDataFromAggregateQuery } from '../../datasources/text_based/fetch_data_from_aggregate_query'; import { suggestionsApi } from '../../lens_suggestions_api'; import { generateId } from '../../id_generator'; import { executeEditAction } from './edit_action_helpers'; @@ -66,21 +70,17 @@ export async function executeCreateAction({ // so we are requesting them with limit 0 // this is much more performant than requesting // all the table - const performantQuery = { - esql: `from ${defaultIndex} | limit 0`, - }; - - const table = await fetchDataFromAggregateQuery( - performantQuery, - dataView, - deps.data, - deps.expressions - ); + const abortController = new AbortController(); + const columns = await getESQLQueryColumns({ + esqlQuery: `from ${defaultIndex}`, + search: deps.data.search.search, + signal: abortController.signal, + }); const context = { dataViewSpec: dataView.toSpec(), fieldName: '', - textBasedColumns: table?.columns, + textBasedColumns: columns, query: defaultEsqlQuery, }; diff --git a/x-pack/plugins/observability_solution/apm/public/components/app/correlations/latency_correlations.test.tsx b/x-pack/plugins/observability_solution/apm/public/components/app/correlations/latency_correlations.test.tsx index 8f6d964a6af7e..483befd6e3d86 100644 --- a/x-pack/plugins/observability_solution/apm/public/components/app/correlations/latency_correlations.test.tsx +++ b/x-pack/plugins/observability_solution/apm/public/components/app/correlations/latency_correlations.test.tsx @@ -15,7 +15,7 @@ import { __IntlProvider as IntlProvider } from '@kbn/i18n-react'; import { CoreStart } from '@kbn/core/public'; import { merge } from 'lodash'; import { dataPluginMock } from '@kbn/data-plugin/public/mocks'; -import type { IKibanaSearchResponse } from '@kbn/data-plugin/public'; +import type { IKibanaSearchResponse } from '@kbn/search-types'; import { EuiThemeProvider } from '@kbn/kibana-react-plugin/common'; import { createKibanaReactContext } from '@kbn/kibana-react-plugin/public'; import type { LatencyCorrelationsResponse } from '../../../../common/correlations/latency_correlations/types'; diff --git a/x-pack/plugins/observability_solution/apm/tsconfig.json b/x-pack/plugins/observability_solution/apm/tsconfig.json index 1f1fd6c1c954a..e7cd47d0c81f5 100644 --- a/x-pack/plugins/observability_solution/apm/tsconfig.json +++ b/x-pack/plugins/observability_solution/apm/tsconfig.json @@ -114,6 +114,7 @@ "@kbn/management-settings-components-field-row", "@kbn/shared-ux-markdown", "@kbn/core-http-request-handler-context-server", + "@kbn/search-types", ], "exclude": ["target/**/*"] } diff --git a/x-pack/plugins/observability_solution/infra/public/components/asset_details/__stories__/context/fixtures/log_entries.ts b/x-pack/plugins/observability_solution/infra/public/components/asset_details/__stories__/context/fixtures/log_entries.ts index 35549673701fc..f4b8f6ab4d8eb 100644 --- a/x-pack/plugins/observability_solution/infra/public/components/asset_details/__stories__/context/fixtures/log_entries.ts +++ b/x-pack/plugins/observability_solution/infra/public/components/asset_details/__stories__/context/fixtures/log_entries.ts @@ -7,10 +7,10 @@ import { of } from 'rxjs'; import type { - IKibanaSearchRequest, IKibanaSearchResponse, + IKibanaSearchRequest, ISearchOptions, -} from '@kbn/data-plugin/public'; +} from '@kbn/search-types'; import { defaultLogViewAttributes } from '@kbn/logs-shared-plugin/common'; import { type LogEntriesSearchResponsePayload, diff --git a/x-pack/plugins/observability_solution/infra/public/components/asset_details/__stories__/decorator.tsx b/x-pack/plugins/observability_solution/infra/public/components/asset_details/__stories__/decorator.tsx index 59e67d3f669b1..5d75389d8d8c8 100644 --- a/x-pack/plugins/observability_solution/infra/public/components/asset_details/__stories__/decorator.tsx +++ b/x-pack/plugins/observability_solution/infra/public/components/asset_details/__stories__/decorator.tsx @@ -17,11 +17,8 @@ import type { DecoratorFn } from '@storybook/react'; import { useParameter } from '@storybook/addons'; import type { DeepPartial } from 'utility-types'; import type { LocatorPublic } from '@kbn/share-plugin/public'; -import type { - IKibanaSearchRequest, - ISearchOptions, - SearchSessionState, -} from '@kbn/data-plugin/public'; +import type { IKibanaSearchRequest, ISearchOptions } from '@kbn/search-types'; +import type { SearchSessionState } from '@kbn/data-plugin/public'; import { AlertSummaryWidget } from '@kbn/triggers-actions-ui-plugin/public/application/sections/alert_summary_widget/alert_summary_widget'; import type { Theme } from '@elastic/charts/dist/utils/themes/theme'; import type { AlertSummaryWidgetProps } from '@kbn/triggers-actions-ui-plugin/public/application/sections/alert_summary_widget'; diff --git a/x-pack/plugins/observability_solution/infra/public/pages/metrics/hosts/hooks/use_host_count.ts b/x-pack/plugins/observability_solution/infra/public/pages/metrics/hosts/hooks/use_host_count.ts index 1058ca994c430..c68ec312abab1 100644 --- a/x-pack/plugins/observability_solution/infra/public/pages/metrics/hosts/hooks/use_host_count.ts +++ b/x-pack/plugins/observability_solution/infra/public/pages/metrics/hosts/hooks/use_host_count.ts @@ -6,7 +6,8 @@ */ import * as rt from 'io-ts'; -import { ES_SEARCH_STRATEGY, IKibanaSearchResponse } from '@kbn/data-plugin/common'; +import type { IKibanaSearchResponse } from '@kbn/search-types'; +import { ES_SEARCH_STRATEGY } from '@kbn/data-plugin/common'; import { useCallback, useEffect, useMemo } from 'react'; import { catchError, map, Observable, of, startWith, tap } from 'rxjs'; import createContainer from 'constate'; diff --git a/x-pack/plugins/observability_solution/infra/public/utils/data_search/flatten_data_search_response.ts b/x-pack/plugins/observability_solution/infra/public/utils/data_search/flatten_data_search_response.ts index 9a0ee481814d0..5d59183b8634e 100644 --- a/x-pack/plugins/observability_solution/infra/public/utils/data_search/flatten_data_search_response.ts +++ b/x-pack/plugins/observability_solution/infra/public/utils/data_search/flatten_data_search_response.ts @@ -6,7 +6,7 @@ */ import { map } from 'rxjs'; -import { IKibanaSearchRequest } from '@kbn/data-plugin/public'; +import type { IKibanaSearchRequest } from '@kbn/search-types'; import { ParsedDataSearchRequestDescriptor } from './types'; export const flattenDataSearchResponseDescriptor = < diff --git a/x-pack/plugins/observability_solution/infra/public/utils/data_search/normalize_data_search_responses.ts b/x-pack/plugins/observability_solution/infra/public/utils/data_search/normalize_data_search_responses.ts index 20f19656059f8..c7c894f211e06 100644 --- a/x-pack/plugins/observability_solution/infra/public/utils/data_search/normalize_data_search_responses.ts +++ b/x-pack/plugins/observability_solution/infra/public/utils/data_search/normalize_data_search_responses.ts @@ -7,7 +7,7 @@ import { Observable, of } from 'rxjs'; import { catchError, map, startWith } from 'rxjs'; -import { IKibanaSearchResponse } from '@kbn/data-plugin/public'; +import type { IKibanaSearchResponse } from '@kbn/search-types'; import { AbortError } from '@kbn/kibana-utils-plugin/public'; import { SearchStrategyError } from '../../../common/search_strategies/common/errors'; import { ParsedKibanaSearchResponse } from './types'; diff --git a/x-pack/plugins/observability_solution/infra/public/utils/data_search/types.ts b/x-pack/plugins/observability_solution/infra/public/utils/data_search/types.ts index 3e2c6a15487b8..e2cfa8cca94f3 100644 --- a/x-pack/plugins/observability_solution/infra/public/utils/data_search/types.ts +++ b/x-pack/plugins/observability_solution/infra/public/utils/data_search/types.ts @@ -6,11 +6,11 @@ */ import { Observable } from 'rxjs'; -import { - IKibanaSearchRequest, +import type { IKibanaSearchResponse, + IKibanaSearchRequest, ISearchOptions, -} from '@kbn/data-plugin/public'; +} from '@kbn/search-types'; import { SearchStrategyError } from '../../../common/search_strategies/common/errors'; export interface DataSearchRequestDescriptor { diff --git a/x-pack/plugins/observability_solution/infra/public/utils/data_search/use_data_search_request.test.tsx b/x-pack/plugins/observability_solution/infra/public/utils/data_search/use_data_search_request.test.tsx index 06f8ca1b82eb7..acc7ce55358ea 100644 --- a/x-pack/plugins/observability_solution/infra/public/utils/data_search/use_data_search_request.test.tsx +++ b/x-pack/plugins/observability_solution/infra/public/utils/data_search/use_data_search_request.test.tsx @@ -8,12 +8,8 @@ import { act, renderHook } from '@testing-library/react-hooks'; import React from 'react'; import { firstValueFrom, Observable, of, Subject } from 'rxjs'; -import { - DataPublicPluginStart, - IKibanaSearchResponse, - ISearchGeneric, - ISearchStart, -} from '@kbn/data-plugin/public'; +import type { ISearchGeneric, IKibanaSearchResponse } from '@kbn/search-types'; +import { DataPublicPluginStart, ISearchStart } from '@kbn/data-plugin/public'; import { dataPluginMock } from '@kbn/data-plugin/public/mocks'; import { createKibanaReactContext } from '@kbn/kibana-react-plugin/public'; import { PluginKibanaContextValue } from '../../hooks/use_kibana'; diff --git a/x-pack/plugins/observability_solution/infra/public/utils/data_search/use_data_search_request.ts b/x-pack/plugins/observability_solution/infra/public/utils/data_search/use_data_search_request.ts index 6d0e03d48ff8b..4ec52b2b18b2b 100644 --- a/x-pack/plugins/observability_solution/infra/public/utils/data_search/use_data_search_request.ts +++ b/x-pack/plugins/observability_solution/infra/public/utils/data_search/use_data_search_request.ts @@ -8,11 +8,11 @@ import { useCallback } from 'react'; import { OperatorFunction, ReplaySubject } from 'rxjs'; import { share, tap } from 'rxjs'; -import { - IKibanaSearchRequest, +import type { IKibanaSearchResponse, + IKibanaSearchRequest, ISearchOptions, -} from '@kbn/data-plugin/public'; +} from '@kbn/search-types'; import { useKibanaContextForPlugin } from '../../hooks/use_kibana'; import { tapUnsubscribe, useObservable } from '../use_observable'; import { ParsedDataSearchRequestDescriptor, ParsedKibanaSearchResponse } from './types'; diff --git a/x-pack/plugins/observability_solution/infra/public/utils/data_search/use_data_search_response_state.ts b/x-pack/plugins/observability_solution/infra/public/utils/data_search/use_data_search_response_state.ts index c8ec672beb842..0abf571bedcc6 100644 --- a/x-pack/plugins/observability_solution/infra/public/utils/data_search/use_data_search_response_state.ts +++ b/x-pack/plugins/observability_solution/infra/public/utils/data_search/use_data_search_response_state.ts @@ -7,7 +7,7 @@ import { useCallback } from 'react'; import { Observable } from 'rxjs'; -import { IKibanaSearchRequest } from '@kbn/data-plugin/public'; +import type { IKibanaSearchRequest } from '@kbn/search-types'; import { useObservableState } from '../use_observable'; import { ParsedDataSearchResponseDescriptor } from './types'; diff --git a/x-pack/plugins/observability_solution/infra/public/utils/data_search/use_latest_partial_data_search_response.test.tsx b/x-pack/plugins/observability_solution/infra/public/utils/data_search/use_latest_partial_data_search_response.test.tsx index a48cf2c7ccdc4..a4b01be03d80b 100644 --- a/x-pack/plugins/observability_solution/infra/public/utils/data_search/use_latest_partial_data_search_response.test.tsx +++ b/x-pack/plugins/observability_solution/infra/public/utils/data_search/use_latest_partial_data_search_response.test.tsx @@ -7,7 +7,7 @@ import { act, renderHook } from '@testing-library/react-hooks'; import { BehaviorSubject, Observable, of, Subject } from 'rxjs'; -import { IKibanaSearchRequest } from '@kbn/data-plugin/public'; +import { IKibanaSearchRequest } from '@kbn/search-types'; import { ParsedDataSearchRequestDescriptor, ParsedKibanaSearchResponse } from './types'; import { useLatestPartialDataSearchResponse } from './use_latest_partial_data_search_response'; diff --git a/x-pack/plugins/observability_solution/infra/public/utils/data_search/use_latest_partial_data_search_response.ts b/x-pack/plugins/observability_solution/infra/public/utils/data_search/use_latest_partial_data_search_response.ts index 12a169a3a82aa..f9799bb196173 100644 --- a/x-pack/plugins/observability_solution/infra/public/utils/data_search/use_latest_partial_data_search_response.ts +++ b/x-pack/plugins/observability_solution/infra/public/utils/data_search/use_latest_partial_data_search_response.ts @@ -7,7 +7,7 @@ import { Observable } from 'rxjs'; import { switchMap } from 'rxjs'; -import { IKibanaSearchRequest } from '@kbn/data-plugin/public'; +import { IKibanaSearchRequest } from '@kbn/search-types'; import { useOperator } from '../use_observable'; import { flattenDataSearchResponseDescriptor } from './flatten_data_search_response'; import { ParsedDataSearchRequestDescriptor, ParsedDataSearchResponseDescriptor } from './types'; diff --git a/x-pack/plugins/observability_solution/infra/tsconfig.json b/x-pack/plugins/observability_solution/infra/tsconfig.json index bf079001de494..df1cb97bb90bf 100644 --- a/x-pack/plugins/observability_solution/infra/tsconfig.json +++ b/x-pack/plugins/observability_solution/infra/tsconfig.json @@ -96,7 +96,8 @@ "@kbn/elastic-agent-utils", "@kbn/dashboard-plugin", "@kbn/shared-svg", - "@kbn/aiops-log-rate-analysis" + "@kbn/aiops-log-rate-analysis", + "@kbn/search-types" ], "exclude": [ "target/**/*" diff --git a/x-pack/plugins/observability_solution/logs_shared/public/components/log_stream/log_stream.story_decorators.tsx b/x-pack/plugins/observability_solution/logs_shared/public/components/log_stream/log_stream.story_decorators.tsx index 3023400226690..c168feccce62a 100644 --- a/x-pack/plugins/observability_solution/logs_shared/public/components/log_stream/log_stream.story_decorators.tsx +++ b/x-pack/plugins/observability_solution/logs_shared/public/components/log_stream/log_stream.story_decorators.tsx @@ -14,12 +14,12 @@ import { ES_SEARCH_STRATEGY, FieldSpec, } from '@kbn/data-plugin/common'; -import { - IEsSearchResponse, - IKibanaSearchRequest, +import type { IKibanaSearchResponse, + IKibanaSearchRequest, ISearchOptions, -} from '@kbn/data-plugin/public'; + IEsSearchResponse, +} from '@kbn/search-types'; import { KibanaContextProvider } from '@kbn/kibana-react-plugin/public'; import { getLogViewResponsePayloadRT } from '../../../common/http_api'; import { defaultLogViewAttributes } from '../../../common/log_views'; diff --git a/x-pack/plugins/observability_solution/logs_shared/public/containers/logs/log_stream/use_fetch_log_entries_after.ts b/x-pack/plugins/observability_solution/logs_shared/public/containers/logs/log_stream/use_fetch_log_entries_after.ts index bfa7019ae3113..849bc110b5a8c 100644 --- a/x-pack/plugins/observability_solution/logs_shared/public/containers/logs/log_stream/use_fetch_log_entries_after.ts +++ b/x-pack/plugins/observability_solution/logs_shared/public/containers/logs/log_stream/use_fetch_log_entries_after.ts @@ -9,7 +9,7 @@ import { JsonObject } from '@kbn/utility-types'; import { useCallback } from 'react'; import { Observable } from 'rxjs'; import { exhaustMap } from 'rxjs'; -import { IKibanaSearchRequest } from '@kbn/data-plugin/public'; +import type { IKibanaSearchRequest } from '@kbn/search-types'; import { LogEntryAfterCursor } from '../../../../common/log_entry'; import { LogViewColumnConfiguration, LogViewReference } from '../../../../common/log_views'; import { decodeOrThrow } from '../../../../common/runtime_types'; diff --git a/x-pack/plugins/observability_solution/logs_shared/public/containers/logs/log_stream/use_fetch_log_entries_before.ts b/x-pack/plugins/observability_solution/logs_shared/public/containers/logs/log_stream/use_fetch_log_entries_before.ts index 1763ce576ecab..3bacc3f7eb4f1 100644 --- a/x-pack/plugins/observability_solution/logs_shared/public/containers/logs/log_stream/use_fetch_log_entries_before.ts +++ b/x-pack/plugins/observability_solution/logs_shared/public/containers/logs/log_stream/use_fetch_log_entries_before.ts @@ -9,7 +9,7 @@ import { JsonObject } from '@kbn/utility-types'; import { useCallback } from 'react'; import { Observable } from 'rxjs'; import { exhaustMap } from 'rxjs'; -import { IKibanaSearchRequest } from '@kbn/data-plugin/public'; +import type { IKibanaSearchRequest } from '@kbn/search-types'; import { LogEntryBeforeCursor } from '../../../../common/log_entry'; import { LogViewColumnConfiguration, LogViewReference } from '../../../../common/log_views'; import { decodeOrThrow } from '../../../../common/runtime_types'; diff --git a/x-pack/plugins/observability_solution/logs_shared/public/services/log_views/log_views_client.ts b/x-pack/plugins/observability_solution/logs_shared/public/services/log_views/log_views_client.ts index 7b669e47949be..a53ac542c5f03 100644 --- a/x-pack/plugins/observability_solution/logs_shared/public/services/log_views/log_views_client.ts +++ b/x-pack/plugins/observability_solution/logs_shared/public/services/log_views/log_views_client.ts @@ -7,7 +7,7 @@ import * as rt from 'io-ts'; import { HttpStart } from '@kbn/core/public'; -import { ISearchGeneric } from '@kbn/data-plugin/public'; +import type { ISearchGeneric } from '@kbn/search-types'; import { DataViewsContract } from '@kbn/data-views-plugin/public'; import { lastValueFrom } from 'rxjs'; import { getLogViewResponsePayloadRT, putLogViewRequestPayloadRT } from '../../../common/http_api'; diff --git a/x-pack/plugins/observability_solution/logs_shared/public/utils/data_search/flatten_data_search_response.ts b/x-pack/plugins/observability_solution/logs_shared/public/utils/data_search/flatten_data_search_response.ts index 9a0ee481814d0..255463a6ba870 100644 --- a/x-pack/plugins/observability_solution/logs_shared/public/utils/data_search/flatten_data_search_response.ts +++ b/x-pack/plugins/observability_solution/logs_shared/public/utils/data_search/flatten_data_search_response.ts @@ -6,7 +6,7 @@ */ import { map } from 'rxjs'; -import { IKibanaSearchRequest } from '@kbn/data-plugin/public'; +import { IKibanaSearchRequest } from '@kbn/search-types'; import { ParsedDataSearchRequestDescriptor } from './types'; export const flattenDataSearchResponseDescriptor = < diff --git a/x-pack/plugins/observability_solution/logs_shared/public/utils/data_search/normalize_data_search_responses.ts b/x-pack/plugins/observability_solution/logs_shared/public/utils/data_search/normalize_data_search_responses.ts index 20f19656059f8..c7c894f211e06 100644 --- a/x-pack/plugins/observability_solution/logs_shared/public/utils/data_search/normalize_data_search_responses.ts +++ b/x-pack/plugins/observability_solution/logs_shared/public/utils/data_search/normalize_data_search_responses.ts @@ -7,7 +7,7 @@ import { Observable, of } from 'rxjs'; import { catchError, map, startWith } from 'rxjs'; -import { IKibanaSearchResponse } from '@kbn/data-plugin/public'; +import type { IKibanaSearchResponse } from '@kbn/search-types'; import { AbortError } from '@kbn/kibana-utils-plugin/public'; import { SearchStrategyError } from '../../../common/search_strategies/common/errors'; import { ParsedKibanaSearchResponse } from './types'; diff --git a/x-pack/plugins/observability_solution/logs_shared/public/utils/data_search/types.ts b/x-pack/plugins/observability_solution/logs_shared/public/utils/data_search/types.ts index 3e2c6a15487b8..cf20b73bab48c 100644 --- a/x-pack/plugins/observability_solution/logs_shared/public/utils/data_search/types.ts +++ b/x-pack/plugins/observability_solution/logs_shared/public/utils/data_search/types.ts @@ -6,11 +6,12 @@ */ import { Observable } from 'rxjs'; -import { - IKibanaSearchRequest, + +import type { IKibanaSearchResponse, + IKibanaSearchRequest, ISearchOptions, -} from '@kbn/data-plugin/public'; +} from '@kbn/search-types'; import { SearchStrategyError } from '../../../common/search_strategies/common/errors'; export interface DataSearchRequestDescriptor { diff --git a/x-pack/plugins/observability_solution/logs_shared/public/utils/data_search/use_data_search_request.test.tsx b/x-pack/plugins/observability_solution/logs_shared/public/utils/data_search/use_data_search_request.test.tsx index 06f8ca1b82eb7..acc7ce55358ea 100644 --- a/x-pack/plugins/observability_solution/logs_shared/public/utils/data_search/use_data_search_request.test.tsx +++ b/x-pack/plugins/observability_solution/logs_shared/public/utils/data_search/use_data_search_request.test.tsx @@ -8,12 +8,8 @@ import { act, renderHook } from '@testing-library/react-hooks'; import React from 'react'; import { firstValueFrom, Observable, of, Subject } from 'rxjs'; -import { - DataPublicPluginStart, - IKibanaSearchResponse, - ISearchGeneric, - ISearchStart, -} from '@kbn/data-plugin/public'; +import type { ISearchGeneric, IKibanaSearchResponse } from '@kbn/search-types'; +import { DataPublicPluginStart, ISearchStart } from '@kbn/data-plugin/public'; import { dataPluginMock } from '@kbn/data-plugin/public/mocks'; import { createKibanaReactContext } from '@kbn/kibana-react-plugin/public'; import { PluginKibanaContextValue } from '../../hooks/use_kibana'; diff --git a/x-pack/plugins/observability_solution/logs_shared/public/utils/data_search/use_data_search_request.ts b/x-pack/plugins/observability_solution/logs_shared/public/utils/data_search/use_data_search_request.ts index 6d0e03d48ff8b..4ec52b2b18b2b 100644 --- a/x-pack/plugins/observability_solution/logs_shared/public/utils/data_search/use_data_search_request.ts +++ b/x-pack/plugins/observability_solution/logs_shared/public/utils/data_search/use_data_search_request.ts @@ -8,11 +8,11 @@ import { useCallback } from 'react'; import { OperatorFunction, ReplaySubject } from 'rxjs'; import { share, tap } from 'rxjs'; -import { - IKibanaSearchRequest, +import type { IKibanaSearchResponse, + IKibanaSearchRequest, ISearchOptions, -} from '@kbn/data-plugin/public'; +} from '@kbn/search-types'; import { useKibanaContextForPlugin } from '../../hooks/use_kibana'; import { tapUnsubscribe, useObservable } from '../use_observable'; import { ParsedDataSearchRequestDescriptor, ParsedKibanaSearchResponse } from './types'; diff --git a/x-pack/plugins/observability_solution/logs_shared/public/utils/data_search/use_data_search_response_state.ts b/x-pack/plugins/observability_solution/logs_shared/public/utils/data_search/use_data_search_response_state.ts index c8ec672beb842..467cb95927555 100644 --- a/x-pack/plugins/observability_solution/logs_shared/public/utils/data_search/use_data_search_response_state.ts +++ b/x-pack/plugins/observability_solution/logs_shared/public/utils/data_search/use_data_search_response_state.ts @@ -7,7 +7,7 @@ import { useCallback } from 'react'; import { Observable } from 'rxjs'; -import { IKibanaSearchRequest } from '@kbn/data-plugin/public'; +import { IKibanaSearchRequest } from '@kbn/search-types'; import { useObservableState } from '../use_observable'; import { ParsedDataSearchResponseDescriptor } from './types'; diff --git a/x-pack/plugins/observability_solution/logs_shared/public/utils/data_search/use_latest_partial_data_search_response.test.tsx b/x-pack/plugins/observability_solution/logs_shared/public/utils/data_search/use_latest_partial_data_search_response.test.tsx index a48cf2c7ccdc4..a4b01be03d80b 100644 --- a/x-pack/plugins/observability_solution/logs_shared/public/utils/data_search/use_latest_partial_data_search_response.test.tsx +++ b/x-pack/plugins/observability_solution/logs_shared/public/utils/data_search/use_latest_partial_data_search_response.test.tsx @@ -7,7 +7,7 @@ import { act, renderHook } from '@testing-library/react-hooks'; import { BehaviorSubject, Observable, of, Subject } from 'rxjs'; -import { IKibanaSearchRequest } from '@kbn/data-plugin/public'; +import { IKibanaSearchRequest } from '@kbn/search-types'; import { ParsedDataSearchRequestDescriptor, ParsedKibanaSearchResponse } from './types'; import { useLatestPartialDataSearchResponse } from './use_latest_partial_data_search_response'; diff --git a/x-pack/plugins/observability_solution/logs_shared/public/utils/data_search/use_latest_partial_data_search_response.ts b/x-pack/plugins/observability_solution/logs_shared/public/utils/data_search/use_latest_partial_data_search_response.ts index 12a169a3a82aa..f9799bb196173 100644 --- a/x-pack/plugins/observability_solution/logs_shared/public/utils/data_search/use_latest_partial_data_search_response.ts +++ b/x-pack/plugins/observability_solution/logs_shared/public/utils/data_search/use_latest_partial_data_search_response.ts @@ -7,7 +7,7 @@ import { Observable } from 'rxjs'; import { switchMap } from 'rxjs'; -import { IKibanaSearchRequest } from '@kbn/data-plugin/public'; +import { IKibanaSearchRequest } from '@kbn/search-types'; import { useOperator } from '../use_observable'; import { flattenDataSearchResponseDescriptor } from './flatten_data_search_response'; import { ParsedDataSearchRequestDescriptor, ParsedDataSearchResponseDescriptor } from './types'; diff --git a/x-pack/plugins/observability_solution/logs_shared/server/services/log_entries/log_entries_search_strategy.test.ts b/x-pack/plugins/observability_solution/logs_shared/server/services/log_entries/log_entries_search_strategy.test.ts index 177e6091dc06b..0cb65a7f4d83b 100644 --- a/x-pack/plugins/observability_solution/logs_shared/server/services/log_entries/log_entries_search_strategy.test.ts +++ b/x-pack/plugins/observability_solution/logs_shared/server/services/log_entries/log_entries_search_strategy.test.ts @@ -13,12 +13,8 @@ import { savedObjectsClientMock, uiSettingsServiceMock, } from '@kbn/core/server/mocks'; -import { - IEsSearchRequest, - IEsSearchResponse, - ISearchStrategy, - SearchStrategyDependencies, -} from '@kbn/data-plugin/server'; +import type { IEsSearchRequest, IEsSearchResponse } from '@kbn/search-types'; +import { ISearchStrategy, SearchStrategyDependencies } from '@kbn/data-plugin/server'; import { createSearchSessionsClientMock } from '@kbn/data-plugin/server/search/mocks'; import { createResolvedLogViewMock } from '../../../common/log_views/resolved_log_view.mock'; import { createLogViewsClientMock } from '../log_views/log_views_client.mock'; diff --git a/x-pack/plugins/observability_solution/logs_shared/server/services/log_entries/log_entries_search_strategy.ts b/x-pack/plugins/observability_solution/logs_shared/server/services/log_entries/log_entries_search_strategy.ts index 392b3de9bde81..587e0cd753f6a 100644 --- a/x-pack/plugins/observability_solution/logs_shared/server/services/log_entries/log_entries_search_strategy.ts +++ b/x-pack/plugins/observability_solution/logs_shared/server/services/log_entries/log_entries_search_strategy.ts @@ -10,10 +10,10 @@ import * as rt from 'io-ts'; import { combineLatest, concat, defer, forkJoin, of } from 'rxjs'; import { concatMap, filter, map, shareReplay, take } from 'rxjs'; import type { - IEsSearchRequest, - IKibanaSearchRequest, IKibanaSearchResponse, -} from '@kbn/data-plugin/common'; + IKibanaSearchRequest, + IEsSearchRequest, +} from '@kbn/search-types'; import type { ISearchStrategy, PluginStart as DataPluginStart } from '@kbn/data-plugin/server'; import { getLogEntryCursorFromHit, diff --git a/x-pack/plugins/observability_solution/logs_shared/server/services/log_entries/log_entry_search_strategy.test.ts b/x-pack/plugins/observability_solution/logs_shared/server/services/log_entries/log_entry_search_strategy.test.ts index a123536d5bb27..9a82a743e8e53 100644 --- a/x-pack/plugins/observability_solution/logs_shared/server/services/log_entries/log_entry_search_strategy.test.ts +++ b/x-pack/plugins/observability_solution/logs_shared/server/services/log_entries/log_entry_search_strategy.test.ts @@ -13,12 +13,8 @@ import { savedObjectsClientMock, uiSettingsServiceMock, } from '@kbn/core/server/mocks'; -import { - IEsSearchRequest, - IEsSearchResponse, - ISearchStrategy, - SearchStrategyDependencies, -} from '@kbn/data-plugin/server'; +import { IEsSearchRequest, IEsSearchResponse } from '@kbn/search-types'; +import { ISearchStrategy, SearchStrategyDependencies } from '@kbn/data-plugin/server'; import { createSearchSessionsClientMock } from '@kbn/data-plugin/server/search/mocks'; import { createResolvedLogViewMock } from '../../../common/log_views/resolved_log_view.mock'; import { createLogViewsClientMock } from '../log_views/log_views_client.mock'; diff --git a/x-pack/plugins/observability_solution/logs_shared/server/services/log_entries/log_entry_search_strategy.ts b/x-pack/plugins/observability_solution/logs_shared/server/services/log_entries/log_entry_search_strategy.ts index 756bb4aa76c53..ee0a112fc3a63 100644 --- a/x-pack/plugins/observability_solution/logs_shared/server/services/log_entries/log_entry_search_strategy.ts +++ b/x-pack/plugins/observability_solution/logs_shared/server/services/log_entries/log_entry_search_strategy.ts @@ -9,10 +9,10 @@ import * as rt from 'io-ts'; import { concat, defer, of } from 'rxjs'; import { concatMap, filter, map, shareReplay, take } from 'rxjs'; import type { - IEsSearchRequest, - IKibanaSearchRequest, IKibanaSearchResponse, -} from '@kbn/data-plugin/common'; + IKibanaSearchRequest, + IEsSearchRequest, +} from '@kbn/search-types'; import type { ISearchStrategy, PluginStart as DataPluginStart } from '@kbn/data-plugin/server'; import { getLogEntryCursorFromHit } from '../../../common/log_entry'; import { decodeOrThrow } from '../../../common/runtime_types'; diff --git a/x-pack/plugins/observability_solution/logs_shared/tsconfig.json b/x-pack/plugins/observability_solution/logs_shared/tsconfig.json index 803a28aba48ac..cfe5687f0404f 100644 --- a/x-pack/plugins/observability_solution/logs_shared/tsconfig.json +++ b/x-pack/plugins/observability_solution/logs_shared/tsconfig.json @@ -36,6 +36,7 @@ "@kbn/deeplinks-observability", "@kbn/share-plugin", "@kbn/shared-ux-utility", + "@kbn/search-types", "@kbn/discover-shared-plugin" ] } diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/state/elasticsearch/api.ts b/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/state/elasticsearch/api.ts index 010dd3f0fdfa5..8a8bbd0b138bf 100644 --- a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/state/elasticsearch/api.ts +++ b/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/state/elasticsearch/api.ts @@ -4,8 +4,8 @@ * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ - -import { IKibanaSearchResponse, isRunningResponse } from '@kbn/data-plugin/common'; +import type { IKibanaSearchResponse } from '@kbn/search-types'; +import { isRunningResponse } from '@kbn/data-plugin/common'; import * as estypes from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; import { ESSearchResponse } from '@kbn/es-types'; import { FETCH_STATUS } from '@kbn/observability-shared-plugin/public'; diff --git a/x-pack/plugins/observability_solution/synthetics/tsconfig.json b/x-pack/plugins/observability_solution/synthetics/tsconfig.json index 71b989fe671a6..95ed03ba36a11 100644 --- a/x-pack/plugins/observability_solution/synthetics/tsconfig.json +++ b/x-pack/plugins/observability_solution/synthetics/tsconfig.json @@ -89,7 +89,8 @@ "@kbn/license-management-plugin", "@kbn/react-kibana-mount", "@kbn/react-kibana-context-render", - "@kbn/react-kibana-context-theme" + "@kbn/react-kibana-context-theme", + "@kbn/search-types" ], "exclude": ["target/**/*"] } diff --git a/x-pack/plugins/observability_solution/ux/public/components/app/rum_dashboard/ux_overview_fetchers.ts b/x-pack/plugins/observability_solution/ux/public/components/app/rum_dashboard/ux_overview_fetchers.ts index cef7d3af3f0a9..0e69d2480e3c5 100644 --- a/x-pack/plugins/observability_solution/ux/public/components/app/rum_dashboard/ux_overview_fetchers.ts +++ b/x-pack/plugins/observability_solution/ux/public/components/app/rum_dashboard/ux_overview_fetchers.ts @@ -7,7 +7,7 @@ import type { ESSearchResponse } from '@kbn/es-types'; import { DataPublicPluginStart, isRunningResponse } from '@kbn/data-plugin/public'; -import { IKibanaSearchRequest } from '@kbn/data-plugin/common'; +import { IKibanaSearchRequest } from '@kbn/search-types'; import { FetchDataParams, HasDataParams, diff --git a/x-pack/plugins/observability_solution/ux/tsconfig.json b/x-pack/plugins/observability_solution/ux/tsconfig.json index d90159e8d30d6..e4fb69ed200c7 100644 --- a/x-pack/plugins/observability_solution/ux/tsconfig.json +++ b/x-pack/plugins/observability_solution/ux/tsconfig.json @@ -47,7 +47,8 @@ "@kbn/spaces-plugin", "@kbn/deeplinks-observability", "@kbn/react-kibana-context-render", - "@kbn/react-kibana-context-theme" + "@kbn/react-kibana-context-theme", + "@kbn/search-types" ], "exclude": ["target/**/*"] } diff --git a/x-pack/plugins/osquery/common/search_strategy/common/index.ts b/x-pack/plugins/osquery/common/search_strategy/common/index.ts index 6139682935b66..ad19425f7924b 100644 --- a/x-pack/plugins/osquery/common/search_strategy/common/index.ts +++ b/x-pack/plugins/osquery/common/search_strategy/common/index.ts @@ -5,7 +5,7 @@ * 2.0. */ -import type { IEsSearchResponse } from '@kbn/data-plugin/common'; +import type { IEsSearchResponse } from '@kbn/search-types'; export type Maybe = T | null; diff --git a/x-pack/plugins/osquery/common/search_strategy/osquery/actions/index.ts b/x-pack/plugins/osquery/common/search_strategy/osquery/actions/index.ts index 7fd4ea5d31b2c..74ed26732ae90 100644 --- a/x-pack/plugins/osquery/common/search_strategy/osquery/actions/index.ts +++ b/x-pack/plugins/osquery/common/search_strategy/osquery/actions/index.ts @@ -6,8 +6,8 @@ */ import type * as estypes from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; -import type { IEsSearchResponse, IKibanaSearchResponse } from '@kbn/data-plugin/common'; - +import type { IEsSearchResponse } from '@kbn/search-types'; +import type { IKibanaSearchResponse } from '@kbn/search-types'; import type { Inspect, Maybe } from '../../common'; import type { RequestOptions, RequestOptionsPaginated } from '../..'; diff --git a/x-pack/plugins/osquery/common/search_strategy/osquery/agents/index.ts b/x-pack/plugins/osquery/common/search_strategy/osquery/agents/index.ts index 06447beb18eac..8f10f7c844aac 100644 --- a/x-pack/plugins/osquery/common/search_strategy/osquery/agents/index.ts +++ b/x-pack/plugins/osquery/common/search_strategy/osquery/agents/index.ts @@ -5,7 +5,7 @@ * 2.0. */ -import type { IEsSearchResponse } from '@kbn/data-plugin/common'; +import type { IEsSearchResponse } from '@kbn/search-types'; import type { Inspect, Maybe } from '../../common'; import type { RequestOptionsPaginated } from '../..'; diff --git a/x-pack/plugins/osquery/common/search_strategy/osquery/index.ts b/x-pack/plugins/osquery/common/search_strategy/osquery/index.ts index 4ce3e0463696c..48ec1f2bb1900 100644 --- a/x-pack/plugins/osquery/common/search_strategy/osquery/index.ts +++ b/x-pack/plugins/osquery/common/search_strategy/osquery/index.ts @@ -5,7 +5,7 @@ * 2.0. */ -import type { IEsSearchRequest } from '@kbn/data-plugin/common'; +import type { IEsSearchRequest } from '@kbn/search-types'; import type { ActionsStrategyResponse, ActionsRequestOptions, diff --git a/x-pack/plugins/osquery/common/search_strategy/osquery/results/index.ts b/x-pack/plugins/osquery/common/search_strategy/osquery/results/index.ts index c55577fb27354..a40ac4b961640 100644 --- a/x-pack/plugins/osquery/common/search_strategy/osquery/results/index.ts +++ b/x-pack/plugins/osquery/common/search_strategy/osquery/results/index.ts @@ -6,7 +6,7 @@ */ import type * as estypes from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; -import type { IEsSearchResponse } from '@kbn/data-plugin/common'; +import type { IEsSearchResponse } from '@kbn/search-types'; import type { Inspect, Maybe, SortField } from '../../common'; import type { RequestOptionsPaginated } from '../..'; diff --git a/x-pack/plugins/osquery/server/search_strategy/osquery/factory/actions/all/index.ts b/x-pack/plugins/osquery/server/search_strategy/osquery/factory/actions/all/index.ts index 41ed60a416225..99e8d3e3f3e9d 100644 --- a/x-pack/plugins/osquery/server/search_strategy/osquery/factory/actions/all/index.ts +++ b/x-pack/plugins/osquery/server/search_strategy/osquery/factory/actions/all/index.ts @@ -5,7 +5,7 @@ * 2.0. */ -import type { IEsSearchResponse } from '@kbn/data-plugin/common'; +import type { IEsSearchResponse } from '@kbn/search-types'; import { DEFAULT_MAX_TABLE_QUERY_SIZE } from '../../../../../../common/constants'; import type { ActionsStrategyResponse, diff --git a/x-pack/plugins/osquery/server/search_strategy/osquery/factory/actions/all/query.all_actions.dsl.ts b/x-pack/plugins/osquery/server/search_strategy/osquery/factory/actions/all/query.all_actions.dsl.ts index fc1884a83fda7..7138c93f06830 100644 --- a/x-pack/plugins/osquery/server/search_strategy/osquery/factory/actions/all/query.all_actions.dsl.ts +++ b/x-pack/plugins/osquery/server/search_strategy/osquery/factory/actions/all/query.all_actions.dsl.ts @@ -7,7 +7,7 @@ import type * as estypes from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; -import type { ISearchRequestParams } from '@kbn/data-plugin/common'; +import type { ISearchRequestParams } from '@kbn/search-types'; import { AGENT_ACTIONS_INDEX } from '@kbn/fleet-plugin/common'; import type { AgentsRequestOptions } from '../../../../../../common/search_strategy/osquery/agents'; import { getQueryFilter } from '../../../../../utils/build_query'; diff --git a/x-pack/plugins/osquery/server/search_strategy/osquery/factory/actions/details/index.ts b/x-pack/plugins/osquery/server/search_strategy/osquery/factory/actions/details/index.ts index a05aec4c6fdf1..42c36a23aeddd 100644 --- a/x-pack/plugins/osquery/server/search_strategy/osquery/factory/actions/details/index.ts +++ b/x-pack/plugins/osquery/server/search_strategy/osquery/factory/actions/details/index.ts @@ -5,7 +5,7 @@ * 2.0. */ -import type { IEsSearchResponse } from '@kbn/data-plugin/server'; +import type { IEsSearchResponse } from '@kbn/search-types'; import type { ActionDetails, ActionDetailsStrategyResponse, diff --git a/x-pack/plugins/osquery/server/search_strategy/osquery/factory/actions/details/query.action_details.dsl.ts b/x-pack/plugins/osquery/server/search_strategy/osquery/factory/actions/details/query.action_details.dsl.ts index 3a5fe3db37b7b..6b3c6564c994e 100644 --- a/x-pack/plugins/osquery/server/search_strategy/osquery/factory/actions/details/query.action_details.dsl.ts +++ b/x-pack/plugins/osquery/server/search_strategy/osquery/factory/actions/details/query.action_details.dsl.ts @@ -5,7 +5,7 @@ * 2.0. */ -import type { ISearchRequestParams } from '@kbn/data-plugin/common'; +import type { ISearchRequestParams } from '@kbn/search-types'; import { AGENT_ACTIONS_INDEX } from '@kbn/fleet-plugin/common'; import { isEmpty } from 'lodash'; import { getQueryFilter } from '../../../../../utils/build_query'; diff --git a/x-pack/plugins/osquery/server/search_strategy/osquery/factory/actions/results/query.action_results.dsl.ts b/x-pack/plugins/osquery/server/search_strategy/osquery/factory/actions/results/query.action_results.dsl.ts index 830447e65be5f..41b07311cbe60 100644 --- a/x-pack/plugins/osquery/server/search_strategy/osquery/factory/actions/results/query.action_results.dsl.ts +++ b/x-pack/plugins/osquery/server/search_strategy/osquery/factory/actions/results/query.action_results.dsl.ts @@ -5,7 +5,7 @@ * 2.0. */ -import type { ISearchRequestParams } from '@kbn/data-plugin/common'; +import type { ISearchRequestParams } from '@kbn/search-types'; import { AGENT_ACTIONS_RESULTS_INDEX } from '@kbn/fleet-plugin/common'; import { isEmpty } from 'lodash'; import moment from 'moment'; diff --git a/x-pack/plugins/osquery/server/search_strategy/osquery/factory/results/index.ts b/x-pack/plugins/osquery/server/search_strategy/osquery/factory/results/index.ts index 23ea0a0211d84..f52d4065c751f 100644 --- a/x-pack/plugins/osquery/server/search_strategy/osquery/factory/results/index.ts +++ b/x-pack/plugins/osquery/server/search_strategy/osquery/factory/results/index.ts @@ -5,7 +5,7 @@ * 2.0. */ -import type { IEsSearchResponse } from '@kbn/data-plugin/common'; +import type { IEsSearchResponse } from '@kbn/search-types'; import { DEFAULT_MAX_TABLE_QUERY_SIZE } from '../../../../../common/constants'; import type { ResultsStrategyResponse, diff --git a/x-pack/plugins/osquery/server/search_strategy/osquery/factory/results/query.all_results.dsl.ts b/x-pack/plugins/osquery/server/search_strategy/osquery/factory/results/query.all_results.dsl.ts index 8a4bc5d110d14..6a8e85f657218 100644 --- a/x-pack/plugins/osquery/server/search_strategy/osquery/factory/results/query.all_results.dsl.ts +++ b/x-pack/plugins/osquery/server/search_strategy/osquery/factory/results/query.all_results.dsl.ts @@ -5,7 +5,7 @@ * 2.0. */ -import type { ISearchRequestParams } from '@kbn/data-plugin/common'; +import type { ISearchRequestParams } from '@kbn/search-types'; import { isEmpty } from 'lodash'; import moment from 'moment/moment'; import { getQueryFilter } from '../../../../utils/build_query'; diff --git a/x-pack/plugins/osquery/server/search_strategy/osquery/factory/types.ts b/x-pack/plugins/osquery/server/search_strategy/osquery/factory/types.ts index be5aeefa1c48c..276741fee6d72 100644 --- a/x-pack/plugins/osquery/server/search_strategy/osquery/factory/types.ts +++ b/x-pack/plugins/osquery/server/search_strategy/osquery/factory/types.ts @@ -5,7 +5,7 @@ * 2.0. */ -import type { IEsSearchResponse, ISearchRequestParams } from '@kbn/data-plugin/common'; +import type { IEsSearchResponse, ISearchRequestParams } from '@kbn/search-types'; import type { FactoryQueryTypes, StrategyRequestType, diff --git a/x-pack/plugins/osquery/tsconfig.json b/x-pack/plugins/osquery/tsconfig.json index 601f6ec7c74ae..d520d59c515f8 100644 --- a/x-pack/plugins/osquery/tsconfig.json +++ b/x-pack/plugins/osquery/tsconfig.json @@ -75,6 +75,7 @@ "@kbn/io-ts-utils", "@kbn/shared-ux-page-kibana-template", "@kbn/openapi-generator", - "@kbn/code-editor" + "@kbn/code-editor", + "@kbn/search-types" ] } diff --git a/x-pack/plugins/rule_registry/common/search_strategy/index.ts b/x-pack/plugins/rule_registry/common/search_strategy/index.ts index c38e5edc6d808..4070b00014e7a 100644 --- a/x-pack/plugins/rule_registry/common/search_strategy/index.ts +++ b/x-pack/plugins/rule_registry/common/search_strategy/index.ts @@ -5,7 +5,7 @@ * 2.0. */ import { TechnicalRuleDataFieldName, ValidFeatureId } from '@kbn/rule-data-utils'; -import { IEsSearchRequest, IEsSearchResponse } from '@kbn/data-plugin/common'; +import { IEsSearchRequest, IEsSearchResponse } from '@kbn/search-types'; import type { MappingRuntimeFields, QueryDslFieldAndFormat, diff --git a/x-pack/plugins/rule_registry/tsconfig.json b/x-pack/plugins/rule_registry/tsconfig.json index 3731d2029af58..385c3fe82e0f8 100644 --- a/x-pack/plugins/rule_registry/tsconfig.json +++ b/x-pack/plugins/rule_registry/tsconfig.json @@ -35,6 +35,7 @@ "@kbn/alerts-as-data-utils", "@kbn/core-http-router-server-mocks", "@kbn/core-http-server", + "@kbn/search-types", ], "exclude": [ "target/**/*", diff --git a/x-pack/plugins/security_solution/common/api/search_strategy/first_seen_last_seen/first_seen_last_seen.ts b/x-pack/plugins/security_solution/common/api/search_strategy/first_seen_last_seen/first_seen_last_seen.ts index 52a6afe56a604..cdbdaf583049e 100644 --- a/x-pack/plugins/security_solution/common/api/search_strategy/first_seen_last_seen/first_seen_last_seen.ts +++ b/x-pack/plugins/security_solution/common/api/search_strategy/first_seen_last_seen/first_seen_last_seen.ts @@ -7,7 +7,7 @@ import { z } from 'zod'; -import type { IKibanaSearchResponse } from '@kbn/data-plugin/common'; +import type { IKibanaSearchResponse } from '@kbn/search-types'; import { order } from '../model/order'; import { requestBasicOptionsSchema } from '../model/request_basic_options'; diff --git a/x-pack/plugins/security_solution/common/search_strategy/common/index.ts b/x-pack/plugins/security_solution/common/search_strategy/common/index.ts index f50cdc82f5857..ba855be105d96 100644 --- a/x-pack/plugins/security_solution/common/search_strategy/common/index.ts +++ b/x-pack/plugins/security_solution/common/search_strategy/common/index.ts @@ -4,7 +4,7 @@ * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ -import type { IEsSearchResponse } from '@kbn/data-plugin/common'; +import type { IEsSearchResponse } from '@kbn/search-types'; export type { Inspect, SortField, diff --git a/x-pack/plugins/security_solution/common/search_strategy/endpoint/index.ts b/x-pack/plugins/security_solution/common/search_strategy/endpoint/index.ts index 24ac653780a74..cdcf087140d40 100644 --- a/x-pack/plugins/security_solution/common/search_strategy/endpoint/index.ts +++ b/x-pack/plugins/security_solution/common/search_strategy/endpoint/index.ts @@ -5,7 +5,7 @@ * 2.0. */ -import type { IEsSearchResponse } from '@kbn/data-plugin/common'; +import type { IEsSearchResponse } from '@kbn/search-types'; import type { ActionResponsesRequestStrategyParseResponse } from './response_actions/response'; import type { ResponseActionsQueries, diff --git a/x-pack/plugins/security_solution/common/search_strategy/endpoint/response_actions/action.ts b/x-pack/plugins/security_solution/common/search_strategy/endpoint/response_actions/action.ts index 79a7cfb9a57c2..2f677039a1f30 100644 --- a/x-pack/plugins/security_solution/common/search_strategy/endpoint/response_actions/action.ts +++ b/x-pack/plugins/security_solution/common/search_strategy/endpoint/response_actions/action.ts @@ -5,7 +5,7 @@ * 2.0. */ -import type { IEsSearchResponse } from '@kbn/data-plugin/common'; +import type { IEsSearchResponse } from '@kbn/search-types'; import type { SortOrder, Inspect, diff --git a/x-pack/plugins/security_solution/common/search_strategy/endpoint/response_actions/response.ts b/x-pack/plugins/security_solution/common/search_strategy/endpoint/response_actions/response.ts index e2e562e2fede9..2ce5d3ff86fcd 100644 --- a/x-pack/plugins/security_solution/common/search_strategy/endpoint/response_actions/response.ts +++ b/x-pack/plugins/security_solution/common/search_strategy/endpoint/response_actions/response.ts @@ -5,7 +5,7 @@ * 2.0. */ -import type { IKibanaSearchResponse } from '@kbn/data-plugin/common'; +import type { IKibanaSearchResponse } from '@kbn/search-types'; import type * as estypes from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; import type { LogsEndpointActionResponse } from '../../../endpoint/types'; import type { SortOrder, Inspect, Maybe, RequestBasicOptions } from './types'; diff --git a/x-pack/plugins/security_solution/common/search_strategy/endpoint/response_actions/types.ts b/x-pack/plugins/security_solution/common/search_strategy/endpoint/response_actions/types.ts index ae9de843f4dac..8508011bd7a7b 100644 --- a/x-pack/plugins/security_solution/common/search_strategy/endpoint/response_actions/types.ts +++ b/x-pack/plugins/security_solution/common/search_strategy/endpoint/response_actions/types.ts @@ -5,7 +5,7 @@ * 2.0. */ -import type { IEsSearchRequest } from '@kbn/data-plugin/common'; +import type { IEsSearchRequest } from '@kbn/search-types'; import type * as estypes from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; import type { LogsOsqueryAction } from '@kbn/osquery-plugin/common/types/osquery_action'; import type { LogsEndpointActionWithHosts } from '../../../endpoint/types'; diff --git a/x-pack/plugins/security_solution/common/search_strategy/security_solution/cti/index.mock.ts b/x-pack/plugins/security_solution/common/search_strategy/security_solution/cti/index.mock.ts index 4f6b8c78f86a0..0a40c9aedee94 100644 --- a/x-pack/plugins/security_solution/common/search_strategy/security_solution/cti/index.mock.ts +++ b/x-pack/plugins/security_solution/common/search_strategy/security_solution/cti/index.mock.ts @@ -5,7 +5,7 @@ * 2.0. */ -import type { IEsSearchResponse } from '@kbn/data-plugin/public'; +import type { IEsSearchResponse } from '@kbn/search-types'; import type { EventEnrichmentRequestOptions } from '../../../api/search_strategy'; import type { CtiEnrichment } from '.'; diff --git a/x-pack/plugins/security_solution/common/search_strategy/security_solution/cti/index.ts b/x-pack/plugins/security_solution/common/search_strategy/security_solution/cti/index.ts index fce4e7bdd661d..9efb295c13496 100644 --- a/x-pack/plugins/security_solution/common/search_strategy/security_solution/cti/index.ts +++ b/x-pack/plugins/security_solution/common/search_strategy/security_solution/cti/index.ts @@ -6,7 +6,7 @@ */ import type * as estypes from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; -import type { IEsSearchResponse } from '@kbn/data-plugin/public'; +import type { IEsSearchResponse } from '@kbn/search-types'; import { EVENT_ENRICHMENT_INDICATOR_FIELD_MAP } from '../../../cti/constants'; import type { Inspect, Maybe } from '../../common'; diff --git a/x-pack/plugins/security_solution/common/search_strategy/security_solution/hosts/all/index.ts b/x-pack/plugins/security_solution/common/search_strategy/security_solution/hosts/all/index.ts index 888aa7a11c7ee..bd5bbc3752ff7 100644 --- a/x-pack/plugins/security_solution/common/search_strategy/security_solution/hosts/all/index.ts +++ b/x-pack/plugins/security_solution/common/search_strategy/security_solution/hosts/all/index.ts @@ -5,7 +5,7 @@ * 2.0. */ -import type { IEsSearchResponse } from '@kbn/data-plugin/common'; +import type { IEsSearchResponse } from '@kbn/search-types'; import type { HostsFields } from '../../../../api/search_strategy/hosts/model/sort'; import type { HostItem } from '../common'; diff --git a/x-pack/plugins/security_solution/common/search_strategy/security_solution/hosts/details/index.ts b/x-pack/plugins/security_solution/common/search_strategy/security_solution/hosts/details/index.ts index 52a4b2b531717..4a03292eff47d 100644 --- a/x-pack/plugins/security_solution/common/search_strategy/security_solution/hosts/details/index.ts +++ b/x-pack/plugins/security_solution/common/search_strategy/security_solution/hosts/details/index.ts @@ -6,7 +6,7 @@ */ import type * as estypes from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; -import type { IEsSearchResponse } from '@kbn/data-plugin/common'; +import type { IEsSearchResponse } from '@kbn/search-types'; import type { Inspect, Maybe } from '../../../common'; import type { HostItem } from '../common'; diff --git a/x-pack/plugins/security_solution/common/search_strategy/security_solution/hosts/overview/index.ts b/x-pack/plugins/security_solution/common/search_strategy/security_solution/hosts/overview/index.ts index 9bd64e6ec1dda..286c56144d7d6 100644 --- a/x-pack/plugins/security_solution/common/search_strategy/security_solution/hosts/overview/index.ts +++ b/x-pack/plugins/security_solution/common/search_strategy/security_solution/hosts/overview/index.ts @@ -5,7 +5,7 @@ * 2.0. */ -import type { IEsSearchResponse } from '@kbn/data-plugin/common'; +import type { IEsSearchResponse } from '@kbn/search-types'; import type { Inspect, Maybe, SearchHit } from '../../../common'; export interface HostsOverviewStrategyResponse extends IEsSearchResponse { diff --git a/x-pack/plugins/security_solution/common/search_strategy/security_solution/hosts/uncommon_processes/index.ts b/x-pack/plugins/security_solution/common/search_strategy/security_solution/hosts/uncommon_processes/index.ts index 568de6cd75bf4..b331a277ed240 100644 --- a/x-pack/plugins/security_solution/common/search_strategy/security_solution/hosts/uncommon_processes/index.ts +++ b/x-pack/plugins/security_solution/common/search_strategy/security_solution/hosts/uncommon_processes/index.ts @@ -5,7 +5,7 @@ * 2.0. */ -import type { IEsSearchResponse } from '@kbn/data-plugin/common'; +import type { IEsSearchResponse } from '@kbn/search-types'; import type { HostEcs, ProcessEcs, UserEcs } from '@kbn/securitysolution-ecs'; import type { diff --git a/x-pack/plugins/security_solution/common/search_strategy/security_solution/network/details/index.ts b/x-pack/plugins/security_solution/common/search_strategy/security_solution/network/details/index.ts index e6f6b8fc12acd..2ecdb459a3ef4 100644 --- a/x-pack/plugins/security_solution/common/search_strategy/security_solution/network/details/index.ts +++ b/x-pack/plugins/security_solution/common/search_strategy/security_solution/network/details/index.ts @@ -5,7 +5,7 @@ * 2.0. */ -import type { IEsSearchResponse } from '@kbn/data-plugin/common'; +import type { IEsSearchResponse } from '@kbn/search-types'; import type { HostEcs, GeoEcs } from '@kbn/securitysolution-ecs'; import type { Inspect, Maybe, TotalValue, Hit, ShardsResponse } from '../../../common'; diff --git a/x-pack/plugins/security_solution/common/search_strategy/security_solution/network/dns/index.ts b/x-pack/plugins/security_solution/common/search_strategy/security_solution/network/dns/index.ts index e36dca6658772..0251fe86af456 100644 --- a/x-pack/plugins/security_solution/common/search_strategy/security_solution/network/dns/index.ts +++ b/x-pack/plugins/security_solution/common/search_strategy/security_solution/network/dns/index.ts @@ -5,7 +5,7 @@ * 2.0. */ -import type { IEsSearchResponse } from '@kbn/data-plugin/common'; +import type { IEsSearchResponse } from '@kbn/search-types'; import type { CursorType, Inspect, Maybe, PageInfoPaginated } from '../../../common'; export enum NetworkDnsFields { diff --git a/x-pack/plugins/security_solution/common/search_strategy/security_solution/network/http/index.ts b/x-pack/plugins/security_solution/common/search_strategy/security_solution/network/http/index.ts index a2a62ec7bee49..5e543fd61146a 100644 --- a/x-pack/plugins/security_solution/common/search_strategy/security_solution/network/http/index.ts +++ b/x-pack/plugins/security_solution/common/search_strategy/security_solution/network/http/index.ts @@ -5,7 +5,7 @@ * 2.0. */ -import type { IEsSearchResponse } from '@kbn/data-plugin/common'; +import type { IEsSearchResponse } from '@kbn/search-types'; import type { Maybe, CursorType, diff --git a/x-pack/plugins/security_solution/common/search_strategy/security_solution/network/overview/index.ts b/x-pack/plugins/security_solution/common/search_strategy/security_solution/network/overview/index.ts index 871bf38be855b..d3edb04439023 100644 --- a/x-pack/plugins/security_solution/common/search_strategy/security_solution/network/overview/index.ts +++ b/x-pack/plugins/security_solution/common/search_strategy/security_solution/network/overview/index.ts @@ -5,7 +5,7 @@ * 2.0. */ -import type { IEsSearchResponse } from '@kbn/data-plugin/common'; +import type { IEsSearchResponse } from '@kbn/search-types'; import type { Inspect, Maybe, SearchHit } from '../../../common'; export interface NetworkOverviewStrategyResponse extends IEsSearchResponse { diff --git a/x-pack/plugins/security_solution/common/search_strategy/security_solution/network/tls/index.ts b/x-pack/plugins/security_solution/common/search_strategy/security_solution/network/tls/index.ts index 48ca7a133af1d..18865a76e1788 100644 --- a/x-pack/plugins/security_solution/common/search_strategy/security_solution/network/tls/index.ts +++ b/x-pack/plugins/security_solution/common/search_strategy/security_solution/network/tls/index.ts @@ -5,7 +5,7 @@ * 2.0. */ -import type { IEsSearchResponse } from '@kbn/data-plugin/common'; +import type { IEsSearchResponse } from '@kbn/search-types'; import type { CursorType, Inspect, Maybe, PageInfoPaginated } from '../../../common'; export interface NetworkTlsBuckets { diff --git a/x-pack/plugins/security_solution/common/search_strategy/security_solution/network/top_countries/index.ts b/x-pack/plugins/security_solution/common/search_strategy/security_solution/network/top_countries/index.ts index 31aed363f3275..f51766652a8fc 100644 --- a/x-pack/plugins/security_solution/common/search_strategy/security_solution/network/top_countries/index.ts +++ b/x-pack/plugins/security_solution/common/search_strategy/security_solution/network/top_countries/index.ts @@ -5,7 +5,7 @@ * 2.0. */ -import type { IEsSearchResponse } from '@kbn/data-plugin/common'; +import type { IEsSearchResponse } from '@kbn/search-types'; import type { CursorType, Inspect, Maybe, PageInfoPaginated } from '../../../common'; import type { GeoItem, TopNetworkTablesEcsField } from '../common'; diff --git a/x-pack/plugins/security_solution/common/search_strategy/security_solution/network/top_n_flow/index.ts b/x-pack/plugins/security_solution/common/search_strategy/security_solution/network/top_n_flow/index.ts index 4d4b11788c729..5e7884da92730 100644 --- a/x-pack/plugins/security_solution/common/search_strategy/security_solution/network/top_n_flow/index.ts +++ b/x-pack/plugins/security_solution/common/search_strategy/security_solution/network/top_n_flow/index.ts @@ -5,7 +5,7 @@ * 2.0. */ -import type { IEsSearchResponse } from '@kbn/data-plugin/common'; +import type { IEsSearchResponse } from '@kbn/search-types'; import type { GeoItem, TopNetworkTablesEcsField } from '../common'; import type { CursorType, Inspect, Maybe, TotalValue, GenericBuckets } from '../../../common'; diff --git a/x-pack/plugins/security_solution/common/search_strategy/security_solution/network/users/index.ts b/x-pack/plugins/security_solution/common/search_strategy/security_solution/network/users/index.ts index 2ee9fd244e4bf..b2b48b7985adb 100644 --- a/x-pack/plugins/security_solution/common/search_strategy/security_solution/network/users/index.ts +++ b/x-pack/plugins/security_solution/common/search_strategy/security_solution/network/users/index.ts @@ -5,7 +5,7 @@ * 2.0. */ -import type { IEsSearchResponse } from '@kbn/data-plugin/common'; +import type { IEsSearchResponse } from '@kbn/search-types'; import type { CursorType, Inspect, Maybe, PageInfoPaginated } from '../../../common'; export enum NetworkUsersFields { diff --git a/x-pack/plugins/security_solution/common/search_strategy/security_solution/related_entities/related_hosts/index.tsx b/x-pack/plugins/security_solution/common/search_strategy/security_solution/related_entities/related_hosts/index.tsx index 0ed809655e6d1..cabd3ee7b9db3 100644 --- a/x-pack/plugins/security_solution/common/search_strategy/security_solution/related_entities/related_hosts/index.tsx +++ b/x-pack/plugins/security_solution/common/search_strategy/security_solution/related_entities/related_hosts/index.tsx @@ -5,7 +5,7 @@ * 2.0. */ -import type { IEsSearchResponse } from '@kbn/data-plugin/common'; +import type { IEsSearchResponse } from '@kbn/search-types'; import type { RiskSeverity, Inspect, Maybe } from '../../..'; import type { BucketItem } from '../../cti'; diff --git a/x-pack/plugins/security_solution/common/search_strategy/security_solution/related_entities/related_users/index.tsx b/x-pack/plugins/security_solution/common/search_strategy/security_solution/related_entities/related_users/index.tsx index c5508dad58c4a..082694e7302ad 100644 --- a/x-pack/plugins/security_solution/common/search_strategy/security_solution/related_entities/related_users/index.tsx +++ b/x-pack/plugins/security_solution/common/search_strategy/security_solution/related_entities/related_users/index.tsx @@ -5,7 +5,7 @@ * 2.0. */ -import type { IEsSearchResponse } from '@kbn/data-plugin/common'; +import type { IEsSearchResponse } from '@kbn/search-types'; import type { RiskSeverity, Inspect, Maybe } from '../../..'; import type { BucketItem } from '../../cti'; diff --git a/x-pack/plugins/security_solution/common/search_strategy/security_solution/risk_score/all/index.ts b/x-pack/plugins/security_solution/common/search_strategy/security_solution/risk_score/all/index.ts index 19bfdf2ae4082..b2322ad64c575 100644 --- a/x-pack/plugins/security_solution/common/search_strategy/security_solution/risk_score/all/index.ts +++ b/x-pack/plugins/security_solution/common/search_strategy/security_solution/risk_score/all/index.ts @@ -5,7 +5,7 @@ * 2.0. */ -import type { IEsSearchResponse } from '@kbn/data-plugin/common'; +import type { IEsSearchResponse } from '@kbn/search-types'; import type { Inspect, Maybe, SortField } from '../../../common'; import type { RiskScore } from '../../../../entity_analytics/risk_engine'; diff --git a/x-pack/plugins/security_solution/common/search_strategy/security_solution/risk_score/kpi/index.ts b/x-pack/plugins/security_solution/common/search_strategy/security_solution/risk_score/kpi/index.ts index 25b5068700a41..d4ce5ba86c9f5 100644 --- a/x-pack/plugins/security_solution/common/search_strategy/security_solution/risk_score/kpi/index.ts +++ b/x-pack/plugins/security_solution/common/search_strategy/security_solution/risk_score/kpi/index.ts @@ -5,7 +5,7 @@ * 2.0. */ -import type { IEsSearchResponse } from '@kbn/data-plugin/common'; +import type { IEsSearchResponse } from '@kbn/search-types'; import type { RiskSeverity } from '../..'; import type { Inspect, Maybe } from '../../../common'; diff --git a/x-pack/plugins/security_solution/common/search_strategy/security_solution/users/all/index.ts b/x-pack/plugins/security_solution/common/search_strategy/security_solution/users/all/index.ts index 264244962f46c..19406bbca35d9 100644 --- a/x-pack/plugins/security_solution/common/search_strategy/security_solution/users/all/index.ts +++ b/x-pack/plugins/security_solution/common/search_strategy/security_solution/users/all/index.ts @@ -5,7 +5,7 @@ * 2.0. */ -import type { IEsSearchResponse } from '@kbn/data-plugin/common'; +import type { IEsSearchResponse } from '@kbn/search-types'; import type { Inspect, Maybe, PageInfoPaginated } from '../../../common'; import type { RiskSeverity } from '../../risk_score'; diff --git a/x-pack/plugins/security_solution/common/search_strategy/security_solution/users/authentications/index.ts b/x-pack/plugins/security_solution/common/search_strategy/security_solution/users/authentications/index.ts index 96d804d8e440a..001bdeca85d3d 100644 --- a/x-pack/plugins/security_solution/common/search_strategy/security_solution/users/authentications/index.ts +++ b/x-pack/plugins/security_solution/common/search_strategy/security_solution/users/authentications/index.ts @@ -5,7 +5,7 @@ * 2.0. */ -import type { IEsSearchResponse } from '@kbn/data-plugin/common'; +import type { IEsSearchResponse } from '@kbn/search-types'; import type { UserEcs, SourceEcs, HostEcs } from '@kbn/securitysolution-ecs'; import type { diff --git a/x-pack/plugins/security_solution/common/search_strategy/security_solution/users/managed_details/index.ts b/x-pack/plugins/security_solution/common/search_strategy/security_solution/users/managed_details/index.ts index 49fd729c3a0d5..f62315e9f717b 100644 --- a/x-pack/plugins/security_solution/common/search_strategy/security_solution/users/managed_details/index.ts +++ b/x-pack/plugins/security_solution/common/search_strategy/security_solution/users/managed_details/index.ts @@ -5,7 +5,7 @@ * 2.0. */ -import type { IEsSearchResponse } from '@kbn/data-plugin/common'; +import type { IEsSearchResponse } from '@kbn/search-types'; import type { SearchTypes } from '../../../../detection_engine/types'; import type { Inspect, Maybe } from '../../../common'; diff --git a/x-pack/plugins/security_solution/common/search_strategy/security_solution/users/observed_details/index.ts b/x-pack/plugins/security_solution/common/search_strategy/security_solution/users/observed_details/index.ts index 47aff3b0091fd..95228eab61643 100644 --- a/x-pack/plugins/security_solution/common/search_strategy/security_solution/users/observed_details/index.ts +++ b/x-pack/plugins/security_solution/common/search_strategy/security_solution/users/observed_details/index.ts @@ -5,7 +5,7 @@ * 2.0. */ -import type { IEsSearchResponse } from '@kbn/data-plugin/common'; +import type { IEsSearchResponse } from '@kbn/search-types'; import type { Inspect, Maybe } from '../../../common'; import type { UserItem } from '../common'; diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/shared/hooks/use_fetch_prevalence.ts b/x-pack/plugins/security_solution/public/flyout/document_details/shared/hooks/use_fetch_prevalence.ts index 206defb990233..9f3f1995d936e 100644 --- a/x-pack/plugins/security_solution/public/flyout/document_details/shared/hooks/use_fetch_prevalence.ts +++ b/x-pack/plugins/security_solution/public/flyout/document_details/shared/hooks/use_fetch_prevalence.ts @@ -6,7 +6,7 @@ */ import { buildEsQuery } from '@kbn/es-query'; -import type { IEsSearchRequest } from '@kbn/data-plugin/public'; +import type { IEsSearchRequest } from '@kbn/search-types'; import { useQuery } from '@tanstack/react-query'; import type { QueryDslQueryContainer } from '@elastic/elasticsearch/lib/api/types'; import { createFetchData } from '../utils/fetch_data'; diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/shared/utils/build_requests.ts b/x-pack/plugins/security_solution/public/flyout/document_details/shared/utils/build_requests.ts index 0720d26dd0bcb..3d36c5a061b65 100644 --- a/x-pack/plugins/security_solution/public/flyout/document_details/shared/utils/build_requests.ts +++ b/x-pack/plugins/security_solution/public/flyout/document_details/shared/utils/build_requests.ts @@ -5,7 +5,7 @@ * 2.0. */ -import type { IEsSearchRequest } from '@kbn/data-plugin/common'; +import type { IEsSearchRequest } from '@kbn/search-types'; import type { QueryDslQueryContainer } from '@elastic/elasticsearch/lib/api/types'; /** diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/shared/utils/fetch_data.ts b/x-pack/plugins/security_solution/public/flyout/document_details/shared/utils/fetch_data.ts index 65f92bc2ec1f7..3b545ef2dd287 100644 --- a/x-pack/plugins/security_solution/public/flyout/document_details/shared/utils/fetch_data.ts +++ b/x-pack/plugins/security_solution/public/flyout/document_details/shared/utils/fetch_data.ts @@ -4,8 +4,7 @@ * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ - -import type { IEsSearchRequest, IKibanaSearchResponse } from '@kbn/data-plugin/common'; +import type { IKibanaSearchResponse, IEsSearchRequest } from '@kbn/search-types'; import type { ISearchStart } from '@kbn/data-plugin/public'; /** diff --git a/x-pack/plugins/security_solution/public/management/services/policies/hooks.ts b/x-pack/plugins/security_solution/public/management/services/policies/hooks.ts index 0e20ce9dcbb1a..34ccf5677d144 100644 --- a/x-pack/plugins/security_solution/public/management/services/policies/hooks.ts +++ b/x-pack/plugins/security_solution/public/management/services/policies/hooks.ts @@ -9,7 +9,7 @@ import { useQuery } from '@tanstack/react-query'; import type { IHttpFetchError } from '@kbn/core-http-browser'; import type { GetInfoResponse } from '@kbn/fleet-plugin/common'; import { firstValueFrom } from 'rxjs'; -import type { IKibanaSearchResponse } from '@kbn/data-plugin/common'; +import type { IKibanaSearchResponse } from '@kbn/search-types'; import { ENDPOINT_PACKAGE_POLICIES_STATS_STRATEGY } from '../../../../common/endpoint/constants'; import { useHttp, useKibana } from '../../../common/lib/kibana'; import { MANAGEMENT_DEFAULT_PAGE_SIZE } from '../../common/constants'; diff --git a/x-pack/plugins/security_solution/server/endpoint/routes/policy/service.ts b/x-pack/plugins/security_solution/server/endpoint/routes/policy/service.ts index 8ec7664ba2c0d..fda09585e35d9 100644 --- a/x-pack/plugins/security_solution/server/endpoint/routes/policy/service.ts +++ b/x-pack/plugins/security_solution/server/endpoint/routes/policy/service.ts @@ -7,7 +7,7 @@ import type { IScopedClusterClient, KibanaRequest } from '@kbn/core/server'; import type { Agent } from '@kbn/fleet-plugin/common/types/models'; -import type { ISearchRequestParams } from '@kbn/data-plugin/common'; +import type { ISearchRequestParams } from '@kbn/search-types'; import type { GetHostPolicyResponse, HostPolicyResponse } from '../../../../common/endpoint/types'; import { INITIAL_POLICY_ID } from '.'; import type { EndpointAppContext } from '../../types'; diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_preview/api/preview_rules/wrap_search_source_client.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/rule_preview/api/preview_rules/wrap_search_source_client.ts index 7c85e2fcf28ae..e4fbdd21c07e6 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_preview/api/preview_rules/wrap_search_source_client.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/rule_preview/api/preview_rules/wrap_search_source_client.ts @@ -4,9 +4,9 @@ * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ +import type { ISearchOptions } from '@kbn/search-types'; import type { - ISearchOptions, ISearchSource, ISearchStartSearchSource, SearchSource, diff --git a/x-pack/plugins/security_solution/server/search_strategy/endpoint/factory/response_actions/actions/index.ts b/x-pack/plugins/security_solution/server/search_strategy/endpoint/factory/response_actions/actions/index.ts index 3c24d29ee7b50..2edbba20cf450 100644 --- a/x-pack/plugins/security_solution/server/search_strategy/endpoint/factory/response_actions/actions/index.ts +++ b/x-pack/plugins/security_solution/server/search_strategy/endpoint/factory/response_actions/actions/index.ts @@ -5,7 +5,7 @@ * 2.0. */ -import type { IEsSearchResponse } from '@kbn/data-plugin/common'; +import type { IEsSearchResponse } from '@kbn/search-types'; import { inspectStringifyObject } from '@kbn/osquery-plugin/common/utils/build_query'; import { buildResponseActionsQuery } from './query.all_actions.dsl'; diff --git a/x-pack/plugins/security_solution/server/search_strategy/endpoint/factory/response_actions/actions/query.all_actions.dsl.ts b/x-pack/plugins/security_solution/server/search_strategy/endpoint/factory/response_actions/actions/query.all_actions.dsl.ts index 7e17dec9f2782..422d6ebc43792 100644 --- a/x-pack/plugins/security_solution/server/search_strategy/endpoint/factory/response_actions/actions/query.all_actions.dsl.ts +++ b/x-pack/plugins/security_solution/server/search_strategy/endpoint/factory/response_actions/actions/query.all_actions.dsl.ts @@ -7,7 +7,7 @@ import type * as estypes from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; -import type { ISearchRequestParams } from '@kbn/data-plugin/common'; +import type { ISearchRequestParams } from '@kbn/search-types'; import { OSQUERY_ACTIONS_INDEX } from '@kbn/osquery-plugin/common/constants'; import type { EndpointAuthz } from '../../../../../../common/endpoint/types/authz'; import type { ActionRequestOptions } from '../../../../../../common/search_strategy/endpoint/response_actions'; diff --git a/x-pack/plugins/security_solution/server/search_strategy/endpoint/factory/response_actions/results/query.action_results.dsl.ts b/x-pack/plugins/security_solution/server/search_strategy/endpoint/factory/response_actions/results/query.action_results.dsl.ts index a2a6f2533ffb2..3db193815fcff 100644 --- a/x-pack/plugins/security_solution/server/search_strategy/endpoint/factory/response_actions/results/query.action_results.dsl.ts +++ b/x-pack/plugins/security_solution/server/search_strategy/endpoint/factory/response_actions/results/query.action_results.dsl.ts @@ -5,7 +5,7 @@ * 2.0. */ -import type { ISearchRequestParams } from '@kbn/data-plugin/common'; +import type { ISearchRequestParams } from '@kbn/search-types'; import type { ActionResponsesRequestOptions } from '../../../../../../common/search_strategy/endpoint/response_actions'; import { ENDPOINT_ACTION_RESPONSES_INDEX } from '../../../../../../common/endpoint/constants'; diff --git a/x-pack/plugins/security_solution/server/search_strategy/endpoint/factory/types.ts b/x-pack/plugins/security_solution/server/search_strategy/endpoint/factory/types.ts index 481be3fb32dbb..1fffff240d496 100644 --- a/x-pack/plugins/security_solution/server/search_strategy/endpoint/factory/types.ts +++ b/x-pack/plugins/security_solution/server/search_strategy/endpoint/factory/types.ts @@ -5,7 +5,7 @@ * 2.0. */ -import type { ISearchRequestParams } from '@kbn/data-plugin/common'; +import type { ISearchRequestParams } from '@kbn/search-types'; import type { EndpointFactoryQueryTypes, EndpointStrategyParseResponseType, diff --git a/x-pack/plugins/security_solution/server/search_strategy/endpoint_package_policies_stats/index.ts b/x-pack/plugins/security_solution/server/search_strategy/endpoint_package_policies_stats/index.ts index 99b64cf1ed193..ca12c0faf77ce 100644 --- a/x-pack/plugins/security_solution/server/search_strategy/endpoint_package_policies_stats/index.ts +++ b/x-pack/plugins/security_solution/server/search_strategy/endpoint_package_policies_stats/index.ts @@ -9,7 +9,7 @@ import type { ISearchStrategy, SearchStrategyDependencies } from '@kbn/data-plug import { from } from 'rxjs'; import moment from 'moment'; -import type { IKibanaSearchResponse } from '@kbn/data-plugin/common'; +import type { IKibanaSearchResponse } from '@kbn/search-types'; import type { EndpointAppContextService } from '../../endpoint/endpoint_app_context_services'; import { EndpointAuthorizationError } from '../../endpoint/errors'; diff --git a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/cti/event_enrichment/response.ts b/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/cti/event_enrichment/response.ts index f305eb3254b5a..ebbff68d18cab 100644 --- a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/cti/event_enrichment/response.ts +++ b/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/cti/event_enrichment/response.ts @@ -5,7 +5,7 @@ * 2.0. */ -import type { IEsSearchResponse } from '@kbn/data-plugin/common'; +import type { IEsSearchResponse } from '@kbn/search-types'; import type { EventEnrichmentRequestOptions } from '../../../../../../common/api/search_strategy'; import { inspectStringifyObject } from '../../../../../utils/build_query'; import { buildIndicatorEnrichments, getTotalCount } from './helpers'; diff --git a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/cti/threat_intel_source/index.ts b/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/cti/threat_intel_source/index.ts index 5052c4cc73fa7..a63a2cf146299 100644 --- a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/cti/threat_intel_source/index.ts +++ b/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/cti/threat_intel_source/index.ts @@ -5,7 +5,7 @@ * 2.0. */ -import type { IEsSearchResponse } from '@kbn/data-plugin/common'; +import type { IEsSearchResponse } from '@kbn/search-types'; import type { SecuritySolutionFactory } from '../../types'; import type { CtiDataSourceStrategyResponse, diff --git a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/hosts/all/__mocks__/index.ts b/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/hosts/all/__mocks__/index.ts index 11868b86f2530..e6069d12886fe 100644 --- a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/hosts/all/__mocks__/index.ts +++ b/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/hosts/all/__mocks__/index.ts @@ -7,7 +7,7 @@ import type { KibanaRequest, SavedObjectsClientContract } from '@kbn/core/server'; import { elasticsearchServiceMock } from '@kbn/core/server/mocks'; -import type { IEsSearchResponse } from '@kbn/data-plugin/common'; +import type { IEsSearchResponse } from '@kbn/search-types'; import type { HostsRequestOptions } from '../../../../../../../common/api/search_strategy'; import { HostsFields } from '../../../../../../../common/api/search_strategy/hosts/model/sort'; diff --git a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/hosts/all/index.ts b/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/hosts/all/index.ts index f3cd1eb0cf100..1e04b6910601c 100644 --- a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/hosts/all/index.ts +++ b/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/hosts/all/index.ts @@ -7,7 +7,7 @@ import { getOr } from 'lodash/fp'; -import type { IEsSearchResponse } from '@kbn/data-plugin/common'; +import type { IEsSearchResponse } from '@kbn/search-types'; import type { IScopedClusterClient } from '@kbn/core/server'; import { DEFAULT_MAX_TABLE_QUERY_SIZE } from '../../../../../../common/constants'; import type { diff --git a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/hosts/all/query.all_hosts.dsl.ts b/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/hosts/all/query.all_hosts.dsl.ts index cb3c960e1f6ea..79c055584b5fa 100644 --- a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/hosts/all/query.all_hosts.dsl.ts +++ b/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/hosts/all/query.all_hosts.dsl.ts @@ -5,7 +5,7 @@ * 2.0. */ -import type { ISearchRequestParams } from '@kbn/data-plugin/common'; +import type { ISearchRequestParams } from '@kbn/search-types'; import { hostFieldsMap } from '@kbn/securitysolution-ecs'; import { HostsFields } from '../../../../../../common/api/search_strategy/hosts/model/sort'; import type { HostsRequestOptions } from '../../../../../../common/api/search_strategy'; diff --git a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/hosts/details/__mocks__/index.ts b/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/hosts/details/__mocks__/index.ts index 3896197198ad1..257708e66925c 100644 --- a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/hosts/details/__mocks__/index.ts +++ b/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/hosts/details/__mocks__/index.ts @@ -5,7 +5,7 @@ * 2.0. */ -import type { IEsSearchResponse } from '@kbn/data-plugin/common'; +import type { IEsSearchResponse } from '@kbn/search-types'; import type { HostsFields } from '../../../../../../../common/api/search_strategy/hosts/model/sort'; import type { HostDetailsRequestOptions, diff --git a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/hosts/details/index.ts b/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/hosts/details/index.ts index 96d3a941ef8b8..7b67c09dcfcfa 100644 --- a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/hosts/details/index.ts +++ b/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/hosts/details/index.ts @@ -7,7 +7,7 @@ import { get } from 'lodash/fp'; -import type { IEsSearchResponse } from '@kbn/data-plugin/common'; +import type { IEsSearchResponse } from '@kbn/search-types'; import type { IScopedClusterClient, KibanaRequest, diff --git a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/hosts/details/query.host_details.dsl.ts b/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/hosts/details/query.host_details.dsl.ts index 9fdf6560e511c..2c68a3b6217bc 100644 --- a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/hosts/details/query.host_details.dsl.ts +++ b/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/hosts/details/query.host_details.dsl.ts @@ -5,7 +5,7 @@ * 2.0. */ -import type { ISearchRequestParams } from '@kbn/data-plugin/common'; +import type { ISearchRequestParams } from '@kbn/search-types'; import { cloudFieldsMap, hostFieldsMap } from '@kbn/securitysolution-ecs'; import type { HostDetailsRequestOptions } from '../../../../../../common/search_strategy/security_solution'; import { reduceFields } from '../../../../../utils/build_query/reduce_fields'; diff --git a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/hosts/overview/__mocks__/index.ts b/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/hosts/overview/__mocks__/index.ts index d4b1e310ae5d6..aff859410ab0c 100644 --- a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/hosts/overview/__mocks__/index.ts +++ b/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/hosts/overview/__mocks__/index.ts @@ -5,7 +5,7 @@ * 2.0. */ -import type { IEsSearchResponse } from '@kbn/data-plugin/common'; +import type { IEsSearchResponse } from '@kbn/search-types'; import type { HostOverviewRequestOptions } from '../../../../../../../common/api/search_strategy'; import { HostsQueries } from '../../../../../../../common/search_strategy'; diff --git a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/hosts/overview/index.ts b/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/hosts/overview/index.ts index 83e3f6eb93b98..8d6b856991523 100644 --- a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/hosts/overview/index.ts +++ b/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/hosts/overview/index.ts @@ -7,7 +7,7 @@ import { get, getOr } from 'lodash/fp'; -import type { IEsSearchResponse } from '@kbn/data-plugin/common'; +import type { IEsSearchResponse } from '@kbn/search-types'; import type { HostsOverviewStrategyResponse, HostsQueries, diff --git a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/hosts/overview/query.overview_host.dsl.ts b/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/hosts/overview/query.overview_host.dsl.ts index c55703e17cc47..7fd957cff1047 100644 --- a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/hosts/overview/query.overview_host.dsl.ts +++ b/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/hosts/overview/query.overview_host.dsl.ts @@ -5,7 +5,7 @@ * 2.0. */ -import type { ISearchRequestParams } from '@kbn/data-plugin/common'; +import type { ISearchRequestParams } from '@kbn/search-types'; import type { HostOverviewRequestOptions } from '../../../../../../common/api/search_strategy/hosts/hosts'; import { createQueryFilterClauses } from '../../../../../utils/build_query'; diff --git a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/hosts/uncommon_processes/index.ts b/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/hosts/uncommon_processes/index.ts index 920dbd351bf97..230e31ecccdf0 100644 --- a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/hosts/uncommon_processes/index.ts +++ b/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/hosts/uncommon_processes/index.ts @@ -7,7 +7,7 @@ import { getOr } from 'lodash/fp'; -import type { IEsSearchResponse } from '@kbn/data-plugin/common'; +import type { IEsSearchResponse } from '@kbn/search-types'; import { processFieldsMap, userFieldsMap } from '@kbn/securitysolution-ecs'; import { DEFAULT_MAX_TABLE_QUERY_SIZE } from '../../../../../../common/constants'; diff --git a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/last_first_seen/index.ts b/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/last_first_seen/index.ts index 9cd28bfc1c121..dc577c72efda8 100644 --- a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/last_first_seen/index.ts +++ b/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/last_first_seen/index.ts @@ -7,7 +7,7 @@ import { getOr } from 'lodash/fp'; -import type { IEsSearchResponse } from '@kbn/data-plugin/common'; +import type { IEsSearchResponse } from '@kbn/search-types'; import { firstLastSeenRequestOptionsSchema } from '../../../../../common/api/search_strategy'; import type { FactoryQueryTypes, diff --git a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/network/details/__mocks__/index.ts b/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/network/details/__mocks__/index.ts index 892ce7b8f1d86..919437b3723c6 100644 --- a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/network/details/__mocks__/index.ts +++ b/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/network/details/__mocks__/index.ts @@ -5,7 +5,7 @@ * 2.0. */ -import type { IEsSearchResponse } from '@kbn/data-plugin/common'; +import type { IEsSearchResponse } from '@kbn/search-types'; import type { NetworkDetailsRequestOptions } from '../../../../../../../common/api/search_strategy'; import { NetworkQueries } from '../../../../../../../common/search_strategy'; diff --git a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/network/details/index.ts b/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/network/details/index.ts index e7fa6c3e8d094..15752146dab9c 100644 --- a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/network/details/index.ts +++ b/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/network/details/index.ts @@ -7,7 +7,7 @@ import { getOr } from 'lodash/fp'; -import type { IEsSearchResponse } from '@kbn/data-plugin/common'; +import type { IEsSearchResponse } from '@kbn/search-types'; import type { NetworkDetailsStrategyResponse, diff --git a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/network/dns/__mocks__/index.ts b/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/network/dns/__mocks__/index.ts index 4e5c497c06463..2b13c84ab869b 100644 --- a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/network/dns/__mocks__/index.ts +++ b/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/network/dns/__mocks__/index.ts @@ -5,7 +5,7 @@ * 2.0. */ -import type { IEsSearchResponse } from '@kbn/data-plugin/common'; +import type { IEsSearchResponse } from '@kbn/search-types'; import type { NetworkDnsRequestOptions } from '../../../../../../../common/api/search_strategy'; import { diff --git a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/network/dns/helpers.ts b/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/network/dns/helpers.ts index ed430a19d222d..f154425ddeeda 100644 --- a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/network/dns/helpers.ts +++ b/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/network/dns/helpers.ts @@ -7,7 +7,7 @@ import { get, getOr } from 'lodash/fp'; -import type { IEsSearchResponse } from '@kbn/data-plugin/common'; +import type { IEsSearchResponse } from '@kbn/search-types'; import type { NetworkDnsBuckets, NetworkDnsEdges, diff --git a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/network/dns/index.ts b/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/network/dns/index.ts index 59b837ce7fbdc..5f702c7228f01 100644 --- a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/network/dns/index.ts +++ b/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/network/dns/index.ts @@ -7,7 +7,7 @@ import { getOr } from 'lodash/fp'; -import type { IEsSearchResponse } from '@kbn/data-plugin/common'; +import type { IEsSearchResponse } from '@kbn/search-types'; import { DEFAULT_MAX_TABLE_QUERY_SIZE } from '../../../../../../common/constants'; import type { diff --git a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/network/http/__mocks__/index.ts b/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/network/http/__mocks__/index.ts index b87c20c3f2810..0faee60330afc 100644 --- a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/network/http/__mocks__/index.ts +++ b/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/network/http/__mocks__/index.ts @@ -5,7 +5,7 @@ * 2.0. */ -import type { IEsSearchResponse } from '@kbn/data-plugin/common'; +import type { IEsSearchResponse } from '@kbn/search-types'; import type { NetworkHttpRequestOptions } from '../../../../../../../common/api/search_strategy'; import type { SortField } from '../../../../../../../common/search_strategy'; diff --git a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/network/http/helpers.ts b/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/network/http/helpers.ts index 7b458da183b71..7752283af88d5 100644 --- a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/network/http/helpers.ts +++ b/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/network/http/helpers.ts @@ -7,7 +7,7 @@ import { get, getOr } from 'lodash/fp'; -import type { IEsSearchResponse } from '@kbn/data-plugin/common'; +import type { IEsSearchResponse } from '@kbn/search-types'; import { firstNonNullValue } from '../../../../../../common/endpoint/models/ecs_safety_helpers'; import type { NetworkHttpBuckets, diff --git a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/network/http/index.ts b/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/network/http/index.ts index 170b0ba67c329..d9517190ea20e 100644 --- a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/network/http/index.ts +++ b/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/network/http/index.ts @@ -7,7 +7,7 @@ import { getOr } from 'lodash/fp'; -import type { IEsSearchResponse } from '@kbn/data-plugin/common'; +import type { IEsSearchResponse } from '@kbn/search-types'; import { DEFAULT_MAX_TABLE_QUERY_SIZE } from '../../../../../../common/constants'; import type { diff --git a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/network/overview/__mocks__/index.ts b/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/network/overview/__mocks__/index.ts index 4574a6491a40b..5a57a080b1e53 100644 --- a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/network/overview/__mocks__/index.ts +++ b/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/network/overview/__mocks__/index.ts @@ -5,7 +5,7 @@ * 2.0. */ -import type { IEsSearchResponse } from '@kbn/data-plugin/common'; +import type { IEsSearchResponse } from '@kbn/search-types'; import type { NetworkOverviewRequestOptions } from '../../../../../../../common/api/search_strategy'; import { NetworkQueries } from '../../../../../../../common/search_strategy'; diff --git a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/network/overview/index.ts b/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/network/overview/index.ts index b0c5244593464..ede146a2d98b5 100644 --- a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/network/overview/index.ts +++ b/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/network/overview/index.ts @@ -7,7 +7,7 @@ import { get, getOr } from 'lodash/fp'; -import type { IEsSearchResponse } from '@kbn/data-plugin/common'; +import type { IEsSearchResponse } from '@kbn/search-types'; import type { NetworkQueries, NetworkOverviewStrategyResponse, diff --git a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/network/overview/query.overview_network.dsl.ts b/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/network/overview/query.overview_network.dsl.ts index ff236881f05a4..8c1c7473d9ec2 100644 --- a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/network/overview/query.overview_network.dsl.ts +++ b/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/network/overview/query.overview_network.dsl.ts @@ -5,7 +5,7 @@ * 2.0. */ -import type { ISearchRequestParams } from '@kbn/data-plugin/common'; +import type { ISearchRequestParams } from '@kbn/search-types'; import type { NetworkOverviewRequestOptions } from '../../../../../../common/api/search_strategy'; import { createQueryFilterClauses } from '../../../../../utils/build_query'; diff --git a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/network/tls/__mocks__/index.ts b/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/network/tls/__mocks__/index.ts index 4f7f61be13451..b3052b45ed223 100644 --- a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/network/tls/__mocks__/index.ts +++ b/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/network/tls/__mocks__/index.ts @@ -5,7 +5,7 @@ * 2.0. */ -import type { IEsSearchResponse } from '@kbn/data-plugin/common'; +import type { IEsSearchResponse } from '@kbn/search-types'; import type { NetworkTlsRequestOptions } from '../../../../../../../common/api/search_strategy'; import { diff --git a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/network/tls/helpers.ts b/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/network/tls/helpers.ts index dc7921696b8e7..f9dae23feb2f5 100644 --- a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/network/tls/helpers.ts +++ b/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/network/tls/helpers.ts @@ -7,7 +7,7 @@ import { getOr } from 'lodash/fp'; -import type { IEsSearchResponse } from '@kbn/data-plugin/common'; +import type { IEsSearchResponse } from '@kbn/search-types'; import type { NetworkTlsBuckets, NetworkTlsEdges, diff --git a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/network/tls/index.ts b/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/network/tls/index.ts index 0d39ffc062bc4..607e5ea3c14e1 100644 --- a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/network/tls/index.ts +++ b/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/network/tls/index.ts @@ -7,7 +7,7 @@ import { getOr } from 'lodash/fp'; -import type { IEsSearchResponse } from '@kbn/data-plugin/common'; +import type { IEsSearchResponse } from '@kbn/search-types'; import { DEFAULT_MAX_TABLE_QUERY_SIZE } from '../../../../../../common/constants'; import type { diff --git a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/network/top_countries/__mocks__/index.ts b/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/network/top_countries/__mocks__/index.ts index 13c646df5a6b7..dfbc1067733bd 100644 --- a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/network/top_countries/__mocks__/index.ts +++ b/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/network/top_countries/__mocks__/index.ts @@ -5,7 +5,7 @@ * 2.0. */ -import type { IEsSearchResponse } from '@kbn/data-plugin/common'; +import type { IEsSearchResponse } from '@kbn/search-types'; import type { NetworkTopCountriesRequestOptions } from '../../../../../../../common/api/search_strategy'; import { diff --git a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/network/top_countries/helpers.ts b/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/network/top_countries/helpers.ts index d6be351ffea36..67a6b6435e7b2 100644 --- a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/network/top_countries/helpers.ts +++ b/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/network/top_countries/helpers.ts @@ -7,7 +7,7 @@ import { getOr } from 'lodash/fp'; -import type { IEsSearchResponse } from '@kbn/data-plugin/common'; +import type { IEsSearchResponse } from '@kbn/search-types'; import type { NetworkTopCountriesRequestOptions } from '../../../../../../common/api/search_strategy'; import type { NetworkTopCountriesBuckets, diff --git a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/network/top_countries/index.ts b/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/network/top_countries/index.ts index c12db1dae90c9..05403e936afa7 100644 --- a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/network/top_countries/index.ts +++ b/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/network/top_countries/index.ts @@ -7,7 +7,7 @@ import { getOr } from 'lodash/fp'; -import type { IEsSearchResponse } from '@kbn/data-plugin/common'; +import type { IEsSearchResponse } from '@kbn/search-types'; import { DEFAULT_MAX_TABLE_QUERY_SIZE } from '../../../../../../common/constants'; import type { diff --git a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/network/top_n_flow/__mocks__/index.ts b/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/network/top_n_flow/__mocks__/index.ts index 00f0924f2a80b..b6061714b6597 100644 --- a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/network/top_n_flow/__mocks__/index.ts +++ b/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/network/top_n_flow/__mocks__/index.ts @@ -5,7 +5,7 @@ * 2.0. */ -import type { IEsSearchResponse } from '@kbn/data-plugin/common'; +import type { IEsSearchResponse } from '@kbn/search-types'; import type { NetworkTopNFlowCountRequestOptions, NetworkTopNFlowRequestOptions, diff --git a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/network/top_n_flow/helpers.ts b/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/network/top_n_flow/helpers.ts index 8f4722f723af4..4db7e390edb79 100644 --- a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/network/top_n_flow/helpers.ts +++ b/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/network/top_n_flow/helpers.ts @@ -7,7 +7,7 @@ import { getOr } from 'lodash/fp'; -import type { IEsSearchResponse } from '@kbn/data-plugin/common'; +import type { IEsSearchResponse } from '@kbn/search-types'; import type { NetworkTopNFlowRequestOptions } from '../../../../../../common/api/search_strategy'; import type { Direction, diff --git a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/network/top_n_flow/index.ts b/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/network/top_n_flow/index.ts index 1668b9967ce11..4404891ecfadd 100644 --- a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/network/top_n_flow/index.ts +++ b/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/network/top_n_flow/index.ts @@ -7,7 +7,7 @@ import { getOr } from 'lodash/fp'; -import type { IEsSearchResponse } from '@kbn/data-plugin/common'; +import type { IEsSearchResponse } from '@kbn/search-types'; import { DEFAULT_MAX_TABLE_QUERY_SIZE } from '../../../../../../common/constants'; import type { diff --git a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/network/top_n_flow/query.top_n_flow_network.dsl.ts b/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/network/top_n_flow/query.top_n_flow_network.dsl.ts index 6e8154eafff9d..0bda64f6aaf0e 100644 --- a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/network/top_n_flow/query.top_n_flow_network.dsl.ts +++ b/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/network/top_n_flow/query.top_n_flow_network.dsl.ts @@ -12,7 +12,7 @@ import type { QueryDslFieldAndFormat, QueryDslQueryContainer, } from '@elastic/elasticsearch/lib/api/types'; -import type { ISearchRequestParams } from '@kbn/data-plugin/common'; +import type { ISearchRequestParams } from '@kbn/search-types'; import type { NetworkTopNFlowCountRequestOptions, NetworkTopNFlowRequestOptions, diff --git a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/network/users/__mocks__/index.ts b/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/network/users/__mocks__/index.ts index a4970837343d6..a61dd74ce68f8 100644 --- a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/network/users/__mocks__/index.ts +++ b/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/network/users/__mocks__/index.ts @@ -5,7 +5,7 @@ * 2.0. */ -import type { IEsSearchResponse } from '@kbn/data-plugin/common'; +import type { IEsSearchResponse } from '@kbn/search-types'; import type { NetworkUsersRequestOptions } from '../../../../../../../common/api/search_strategy'; import { diff --git a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/network/users/helpers.ts b/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/network/users/helpers.ts index 849a439a5b353..ad6c24469e980 100644 --- a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/network/users/helpers.ts +++ b/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/network/users/helpers.ts @@ -6,7 +6,7 @@ */ import { get, getOr } from 'lodash/fp'; -import type { IEsSearchResponse } from '@kbn/data-plugin/common'; +import type { IEsSearchResponse } from '@kbn/search-types'; import type { NetworkUsersBucketsItem, NetworkUsersEdges, diff --git a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/network/users/index.ts b/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/network/users/index.ts index 496dfa9c00485..77826dac6d77c 100644 --- a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/network/users/index.ts +++ b/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/network/users/index.ts @@ -7,7 +7,7 @@ import { getOr } from 'lodash/fp'; -import type { IEsSearchResponse } from '@kbn/data-plugin/common'; +import type { IEsSearchResponse } from '@kbn/search-types'; import { DEFAULT_MAX_TABLE_QUERY_SIZE } from '../../../../../../common/constants'; import type { diff --git a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/related_entities/related_hosts/__mocks__/index.ts b/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/related_entities/related_hosts/__mocks__/index.ts index 6a9e3ae82aa05..1978493803392 100644 --- a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/related_entities/related_hosts/__mocks__/index.ts +++ b/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/related_entities/related_hosts/__mocks__/index.ts @@ -6,7 +6,7 @@ */ import type { KibanaRequest } from '@kbn/core-http-server'; -import type { IEsSearchResponse } from '@kbn/data-plugin/common'; +import type { IEsSearchResponse } from '@kbn/search-types'; import type { SavedObjectsClientContract } from '@kbn/core-saved-objects-api-server'; import type { EndpointAppContextService } from '../../../../../../endpoint/endpoint_app_context_services'; import type { EndpointAppContext } from '../../../../../../endpoint/types'; diff --git a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/related_entities/related_hosts/index.ts b/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/related_entities/related_hosts/index.ts index 19da422fbf3ae..a736c486e9ef7 100644 --- a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/related_entities/related_hosts/index.ts +++ b/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/related_entities/related_hosts/index.ts @@ -5,7 +5,7 @@ * 2.0. */ -import type { IEsSearchResponse } from '@kbn/data-plugin/common'; +import type { IEsSearchResponse } from '@kbn/search-types'; import type { IScopedClusterClient } from '@kbn/core/server'; import { getOr } from 'lodash/fp'; import type { RiskSeverity } from '../../../../../../common/search_strategy/security_solution/risk_score/all'; diff --git a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/related_entities/related_hosts/query.related_hosts.dsl.ts b/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/related_entities/related_hosts/query.related_hosts.dsl.ts index c03fb4a25c36f..7ef08545edd46 100644 --- a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/related_entities/related_hosts/query.related_hosts.dsl.ts +++ b/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/related_entities/related_hosts/query.related_hosts.dsl.ts @@ -5,7 +5,7 @@ * 2.0. */ -import type { ISearchRequestParams } from '@kbn/data-plugin/common'; +import type { ISearchRequestParams } from '@kbn/search-types'; import type { RelatedHostsRequestOptions } from '../../../../../../common/api/search_strategy'; export const buildRelatedHostsQuery = ({ diff --git a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/related_entities/related_users/__mocks__/index.ts b/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/related_entities/related_users/__mocks__/index.ts index a7c6d3501c0f0..eb7841382a684 100644 --- a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/related_entities/related_users/__mocks__/index.ts +++ b/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/related_entities/related_users/__mocks__/index.ts @@ -6,7 +6,7 @@ */ import type { KibanaRequest } from '@kbn/core-http-server'; -import type { IEsSearchResponse } from '@kbn/data-plugin/common'; +import type { IEsSearchResponse } from '@kbn/search-types'; import type { SavedObjectsClientContract } from '@kbn/core-saved-objects-api-server'; import type { EndpointAppContextService } from '../../../../../../endpoint/endpoint_app_context_services'; import type { EndpointAppContext } from '../../../../../../endpoint/types'; diff --git a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/related_entities/related_users/index.ts b/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/related_entities/related_users/index.ts index 371083a01e42c..9ad579f5d9b54 100644 --- a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/related_entities/related_users/index.ts +++ b/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/related_entities/related_users/index.ts @@ -5,7 +5,7 @@ * 2.0. */ -import type { IEsSearchResponse } from '@kbn/data-plugin/common'; +import type { IEsSearchResponse } from '@kbn/search-types'; import type { IScopedClusterClient } from '@kbn/core-elasticsearch-server'; import { getOr } from 'lodash/fp'; import type { RiskSeverity } from '../../../../../../common/search_strategy/security_solution/risk_score/all'; diff --git a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/related_entities/related_users/query.related_users.dsl.ts b/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/related_entities/related_users/query.related_users.dsl.ts index 8cc94a2e0c8f4..dae897684d6b6 100644 --- a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/related_entities/related_users/query.related_users.dsl.ts +++ b/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/related_entities/related_users/query.related_users.dsl.ts @@ -5,7 +5,7 @@ * 2.0. */ -import type { ISearchRequestParams } from '@kbn/data-plugin/common'; +import type { ISearchRequestParams } from '@kbn/search-types'; import type { RelatedUsersRequestOptions } from '../../../../../../common/api/search_strategy'; export const buildRelatedUsersQuery = ({ diff --git a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/risk_score/all/index.test.ts b/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/risk_score/all/index.test.ts index 7501ce076b66f..b4be7a7cef71f 100644 --- a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/risk_score/all/index.test.ts +++ b/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/risk_score/all/index.test.ts @@ -9,7 +9,7 @@ import type { IScopedClusterClient } from '@kbn/core-elasticsearch-server'; import type { KibanaRequest } from '@kbn/core-http-server'; import type { SavedObjectsClientContract } from '@kbn/core-saved-objects-api-server'; import { riskScore } from '.'; -import type { IEsSearchResponse } from '@kbn/data-plugin/public'; +import type { IEsSearchResponse } from '@kbn/search-types'; import type { HostRiskScore } from '../../../../../../common/search_strategy'; import { RiskScoreEntity, RiskSeverity } from '../../../../../../common/search_strategy'; import * as buildQuery from './query.risk_score.dsl'; diff --git a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/risk_score/all/index.ts b/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/risk_score/all/index.ts index f4a5b48952af8..7a72ae7f60680 100644 --- a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/risk_score/all/index.ts +++ b/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/risk_score/all/index.ts @@ -4,8 +4,8 @@ * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ - -import type { IEsSearchResponse, SearchRequest, TimeRange } from '@kbn/data-plugin/common'; +import type { IEsSearchResponse } from '@kbn/search-types'; +import type { SearchRequest, TimeRange } from '@kbn/data-plugin/common'; import { get, getOr } from 'lodash/fp'; import type { IRuleDataClient } from '@kbn/rule-registry-plugin/server'; import type { AggregationsMinAggregate } from '@elastic/elasticsearch/lib/api/types'; diff --git a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/risk_score/kpi/index.ts b/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/risk_score/kpi/index.ts index 333b59bc15c04..2731a20e71553 100644 --- a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/risk_score/kpi/index.ts +++ b/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/risk_score/kpi/index.ts @@ -7,7 +7,7 @@ import { getOr } from 'lodash/fp'; -import type { IEsSearchResponse } from '@kbn/data-plugin/common'; +import type { IEsSearchResponse } from '@kbn/search-types'; import type { KpiRiskScoreStrategyResponse, RiskQueries, diff --git a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/types.ts b/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/types.ts index f222e2130ee26..2a70092df426c 100644 --- a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/types.ts +++ b/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/types.ts @@ -10,7 +10,7 @@ import type { KibanaRequest, SavedObjectsClientContract, } from '@kbn/core/server'; -import type { IEsSearchResponse, ISearchRequestParams } from '@kbn/data-plugin/common'; +import type { IEsSearchResponse, ISearchRequestParams } from '@kbn/search-types'; import type { IRuleDataClient } from '@kbn/rule-registry-plugin/server'; import type { FactoryQueryTypes, diff --git a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/users/all/__mocks__/index.ts b/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/users/all/__mocks__/index.ts index 0e5a7c88851dd..df8cf7449bb38 100644 --- a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/users/all/__mocks__/index.ts +++ b/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/users/all/__mocks__/index.ts @@ -6,7 +6,7 @@ */ import type { KibanaRequest } from '@kbn/core-http-server'; -import type { IEsSearchResponse } from '@kbn/data-plugin/common'; +import type { IEsSearchResponse } from '@kbn/search-types'; import { Direction } from '../../../../../../../common/search_strategy'; import { UsersQueries } from '../../../../../../../common/search_strategy/security_solution/users'; import { UsersFields } from '../../../../../../../common/search_strategy/security_solution/users/common'; diff --git a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/users/all/index.ts b/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/users/all/index.ts index a8eab4d4b92db..18d20b5080352 100644 --- a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/users/all/index.ts +++ b/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/users/all/index.ts @@ -7,7 +7,7 @@ import { getOr } from 'lodash/fp'; -import type { IEsSearchResponse } from '@kbn/data-plugin/common'; +import type { IEsSearchResponse } from '@kbn/search-types'; import type { IScopedClusterClient } from '@kbn/core-elasticsearch-server'; import { DEFAULT_MAX_TABLE_QUERY_SIZE } from '../../../../../../common/constants'; diff --git a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/users/all/query.all_users.dsl.ts b/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/users/all/query.all_users.dsl.ts index 792830bf65b78..b61f31cff4671 100644 --- a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/users/all/query.all_users.dsl.ts +++ b/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/users/all/query.all_users.dsl.ts @@ -5,7 +5,7 @@ * 2.0. */ -import type { ISearchRequestParams } from '@kbn/data-plugin/common'; +import type { ISearchRequestParams } from '@kbn/search-types'; import type { UsersRequestOptions } from '../../../../../../common/api/search_strategy'; import type { Direction } from '../../../../../../common/search_strategy'; import { createQueryFilterClauses } from '../../../../../utils/build_query'; diff --git a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/users/authentications/__mocks__/index.ts b/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/users/authentications/__mocks__/index.ts index 65da6d7a48d94..ca1530258d031 100644 --- a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/users/authentications/__mocks__/index.ts +++ b/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/users/authentications/__mocks__/index.ts @@ -5,7 +5,7 @@ * 2.0. */ -import type { IEsSearchResponse } from '@kbn/data-plugin/common'; +import type { IEsSearchResponse } from '@kbn/search-types'; import type { UserAuthenticationsRequestOptions } from '../../../../../../../common/api/search_strategy'; import type { AuthenticationHit } from '../../../../../../../common/search_strategy'; import { diff --git a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/users/authentications/index.tsx b/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/users/authentications/index.tsx index 9ef7ab6a2f7da..35a42147dffe1 100644 --- a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/users/authentications/index.tsx +++ b/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/users/authentications/index.tsx @@ -7,7 +7,7 @@ import { getOr } from 'lodash/fp'; -import type { IEsSearchResponse } from '@kbn/data-plugin/common'; +import type { IEsSearchResponse } from '@kbn/search-types'; import { DEFAULT_MAX_TABLE_QUERY_SIZE } from '../../../../../../common/constants'; import type { diff --git a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/users/managed_details/index.test.ts b/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/users/managed_details/index.test.ts index d4174198e6a84..2317ec5928883 100644 --- a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/users/managed_details/index.test.ts +++ b/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/users/managed_details/index.test.ts @@ -4,11 +4,10 @@ * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ - +import type { IEsSearchResponse } from '@kbn/search-types'; import * as buildQuery from './query.managed_user_details.dsl'; import { managedUserDetails } from '.'; import type { ManagedUserFields } from '../../../../../../common/search_strategy/security_solution/users/managed_details'; -import type { IEsSearchResponse } from '@kbn/data-plugin/public'; import type { ManagedUserDetailsRequestOptionsInput } from '../../../../../../common/api/search_strategy'; import { UsersQueries } from '../../../../../../common/api/search_strategy'; diff --git a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/users/managed_details/index.ts b/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/users/managed_details/index.ts index 70686e373acae..c46d3bd027873 100644 --- a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/users/managed_details/index.ts +++ b/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/users/managed_details/index.ts @@ -5,7 +5,7 @@ * 2.0. */ -import type { IEsSearchResponse } from '@kbn/data-plugin/common'; +import type { IEsSearchResponse } from '@kbn/search-types'; import type { SearchResponse } from '@elastic/elasticsearch/lib/api/types'; import { getOr } from 'lodash/fp'; diff --git a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/users/managed_details/query.managed_user_details.dsl.ts b/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/users/managed_details/query.managed_user_details.dsl.ts index c7ca1056ec142..7fcd48d464e34 100644 --- a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/users/managed_details/query.managed_user_details.dsl.ts +++ b/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/users/managed_details/query.managed_user_details.dsl.ts @@ -5,7 +5,7 @@ * 2.0. */ -import type { ISearchRequestParams } from '@kbn/data-plugin/common'; +import type { ISearchRequestParams } from '@kbn/search-types'; import type { QueryDslQueryContainer } from '@elastic/elasticsearch/lib/api/types'; import { ManagedUserDatasetKey } from '../../../../../../common/search_strategy/security_solution/users/managed_details'; import type { ManagedUserDetailsRequestOptions } from '../../../../../../common/api/search_strategy'; diff --git a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/users/observed_details/__mocks__/index.ts b/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/users/observed_details/__mocks__/index.ts index de5bc36045877..0e35928621a6e 100644 --- a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/users/observed_details/__mocks__/index.ts +++ b/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/users/observed_details/__mocks__/index.ts @@ -5,7 +5,7 @@ * 2.0. */ -import type { IEsSearchResponse } from '@kbn/data-plugin/common'; +import type { IEsSearchResponse } from '@kbn/search-types'; import type { ObservedUserDetailsRequestOptions } from '../../../../../../../common/api/search_strategy'; import { UsersQueries } from '../../../../../../../common/search_strategy/security_solution/users'; diff --git a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/users/observed_details/index.ts b/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/users/observed_details/index.ts index f91ab3b369466..201fb89ac237f 100644 --- a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/users/observed_details/index.ts +++ b/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/users/observed_details/index.ts @@ -5,7 +5,7 @@ * 2.0. */ -import type { IEsSearchResponse } from '@kbn/data-plugin/common'; +import type { IEsSearchResponse } from '@kbn/search-types'; import { inspectStringifyObject } from '../../../../../utils/build_query'; import type { SecuritySolutionFactory } from '../../types'; diff --git a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/users/observed_details/query.observed_user_details.dsl.ts b/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/users/observed_details/query.observed_user_details.dsl.ts index d26af4d198ae9..081b415f4bd75 100644 --- a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/users/observed_details/query.observed_user_details.dsl.ts +++ b/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/users/observed_details/query.observed_user_details.dsl.ts @@ -6,7 +6,7 @@ */ import type { QueryDslQueryContainer } from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; -import type { ISearchRequestParams } from '@kbn/data-plugin/common'; +import type { ISearchRequestParams } from '@kbn/search-types'; import type { ObservedUserDetailsRequestOptions } from '../../../../../../common/api/search_strategy'; import { createQueryFilterClauses } from '../../../../../utils/build_query'; import { buildFieldsTermAggregation } from '../../hosts/details/helpers'; diff --git a/x-pack/plugins/security_solution/tsconfig.json b/x-pack/plugins/security_solution/tsconfig.json index 17a7aea6839c7..dd625a978f316 100644 --- a/x-pack/plugins/security_solution/tsconfig.json +++ b/x-pack/plugins/security_solution/tsconfig.json @@ -200,6 +200,7 @@ "@kbn/management-plugin", "@kbn/security-plugin-types-server", "@kbn/deeplinks-security", - "@kbn/react-kibana-context-render" + "@kbn/react-kibana-context-render", + "@kbn/search-types" ] } diff --git a/x-pack/plugins/serverless_observability/public/logs_signal/overview_registration.ts b/x-pack/plugins/serverless_observability/public/logs_signal/overview_registration.ts index 02d499233f5ae..cbbb29ee83c10 100644 --- a/x-pack/plugins/serverless_observability/public/logs_signal/overview_registration.ts +++ b/x-pack/plugins/serverless_observability/public/logs_signal/overview_registration.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { ISearchGeneric } from '@kbn/data-plugin/public'; +import type { ISearchGeneric } from '@kbn/search-types'; import type { DataHandler, InfraLogsHasDataResponse, diff --git a/x-pack/plugins/serverless_observability/tsconfig.json b/x-pack/plugins/serverless_observability/tsconfig.json index f274f6fa7c027..3d909bf88b656 100644 --- a/x-pack/plugins/serverless_observability/tsconfig.json +++ b/x-pack/plugins/serverless_observability/tsconfig.json @@ -29,5 +29,6 @@ "@kbn/core-chrome-browser", "@kbn/discover-plugin", "@kbn/security-plugin", + "@kbn/search-types", ] } diff --git a/x-pack/plugins/stack_alerts/public/rule_types/es_query/expression/es_query_expression.test.tsx b/x-pack/plugins/stack_alerts/public/rule_types/es_query/expression/es_query_expression.test.tsx index df61218620750..6686d56173de4 100644 --- a/x-pack/plugins/stack_alerts/public/rule_types/es_query/expression/es_query_expression.test.tsx +++ b/x-pack/plugins/stack_alerts/public/rule_types/es_query/expression/es_query_expression.test.tsx @@ -14,11 +14,8 @@ import { dataPluginMock } from '@kbn/data-plugin/public/mocks'; import { dataViewPluginMocks } from '@kbn/data-views-plugin/public/mocks'; import { unifiedSearchPluginMock } from '@kbn/unified-search-plugin/public/mocks'; import { chartPluginMock } from '@kbn/charts-plugin/public/mocks'; -import { - DataPublicPluginStart, - IKibanaSearchResponse, - ISearchStart, -} from '@kbn/data-plugin/public'; +import type { IKibanaSearchResponse } from '@kbn/search-types'; +import { DataPublicPluginStart, ISearchStart } from '@kbn/data-plugin/public'; import { useKibana } from '@kbn/kibana-react-plugin/public'; import { EsQueryRuleParams, SearchType } from '../types'; import { EsQueryExpression } from './es_query_expression'; diff --git a/x-pack/plugins/stack_alerts/tsconfig.json b/x-pack/plugins/stack_alerts/tsconfig.json index dbeab0fce874d..a765291e89d98 100644 --- a/x-pack/plugins/stack_alerts/tsconfig.json +++ b/x-pack/plugins/stack_alerts/tsconfig.json @@ -50,6 +50,7 @@ "@kbn/code-editor", "@kbn/esql-utils", "@kbn/data-view-utils", + "@kbn/search-types", ], "exclude": [ "target/**/*", diff --git a/x-pack/plugins/threat_intelligence/public/modules/cases/components/comment_children.stories.tsx b/x-pack/plugins/threat_intelligence/public/modules/cases/components/comment_children.stories.tsx index 657cd7b5d2f41..a532c60ef4b81 100644 --- a/x-pack/plugins/threat_intelligence/public/modules/cases/components/comment_children.stories.tsx +++ b/x-pack/plugins/threat_intelligence/public/modules/cases/components/comment_children.stories.tsx @@ -8,7 +8,7 @@ import React from 'react'; import { Story } from '@storybook/react'; import { of } from 'rxjs'; -import { IKibanaSearchResponse } from '@kbn/data-plugin/common'; +import type { IKibanaSearchResponse } from '@kbn/search-types'; import { generateMockFileIndicator } from '../../../../common/types/indicator'; import { CommentChildren } from './comment_children'; import { StoryProvidersComponent } from '../../../mocks/story_providers'; diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/hooks/use_total_count.tsx b/x-pack/plugins/threat_intelligence/public/modules/indicators/hooks/use_total_count.tsx index d9b7c22f83354..f2b9fcefe11f7 100644 --- a/x-pack/plugins/threat_intelligence/public/modules/indicators/hooks/use_total_count.tsx +++ b/x-pack/plugins/threat_intelligence/public/modules/indicators/hooks/use_total_count.tsx @@ -6,11 +6,8 @@ */ import { useEffect, useState } from 'react'; -import { - IEsSearchRequest, - IKibanaSearchResponse, - isRunningResponse, -} from '@kbn/data-plugin/common'; +import type { IKibanaSearchResponse, IEsSearchRequest } from '@kbn/search-types'; +import { isRunningResponse } from '@kbn/data-plugin/common'; import { useKibana } from '../../../hooks/use_kibana'; import { useSourcererDataView } from './use_sourcerer_data_view'; import type { RawIndicatorsResponse } from '../services/fetch_indicators'; diff --git a/x-pack/plugins/threat_intelligence/public/utils/search.ts b/x-pack/plugins/threat_intelligence/public/utils/search.ts index aa0fa68f9038c..e183ba7e272b2 100644 --- a/x-pack/plugins/threat_intelligence/public/utils/search.ts +++ b/x-pack/plugins/threat_intelligence/public/utils/search.ts @@ -4,12 +4,8 @@ * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ - -import { - IEsSearchRequest, - IKibanaSearchResponse, - isRunningResponse, -} from '@kbn/data-plugin/common'; +import type { IKibanaSearchResponse, IEsSearchRequest } from '@kbn/search-types'; +import { isRunningResponse } from '@kbn/data-plugin/common'; import { ISearchStart } from '@kbn/data-plugin/public'; import { RequestAdapter } from '@kbn/inspector-plugin/common'; import { THREAT_INTELLIGENCE_SEARCH_STRATEGY_NAME } from '../../common/constants'; diff --git a/x-pack/plugins/threat_intelligence/server/search_strategy.ts b/x-pack/plugins/threat_intelligence/server/search_strategy.ts index ebd50c16425fc..6a48b83cce5a0 100644 --- a/x-pack/plugins/threat_intelligence/server/search_strategy.ts +++ b/x-pack/plugins/threat_intelligence/server/search_strategy.ts @@ -5,11 +5,8 @@ * 2.0. */ -import { - ENHANCED_ES_SEARCH_STRATEGY, - IEsSearchRequest, - ISearchRequestParams, -} from '@kbn/data-plugin/common'; +import { ENHANCED_ES_SEARCH_STRATEGY } from '@kbn/data-plugin/common'; +import type { ISearchRequestParams, IEsSearchRequest } from '@kbn/search-types'; import { ISearchStrategy, PluginStart, shimHitsTotal } from '@kbn/data-plugin/server'; import { map } from 'rxjs'; import { BARCHART_AGGREGATION_NAME, FactoryQueryType } from '../common/constants'; diff --git a/x-pack/plugins/threat_intelligence/tsconfig.json b/x-pack/plugins/threat_intelligence/tsconfig.json index 2e390483ab22c..21109d1624813 100644 --- a/x-pack/plugins/threat_intelligence/tsconfig.json +++ b/x-pack/plugins/threat_intelligence/tsconfig.json @@ -32,7 +32,8 @@ "@kbn/utility-types", "@kbn/ui-theme", "@kbn/securitysolution-io-ts-list-types", - "@kbn/core-ui-settings-browser" + "@kbn/core-ui-settings-browser", + "@kbn/search-types" ], "exclude": ["target/**/*"] } diff --git a/x-pack/plugins/timelines/common/search_strategy/index_fields/index.ts b/x-pack/plugins/timelines/common/search_strategy/index_fields/index.ts index 70591424ff560..32b5ec4e4162e 100644 --- a/x-pack/plugins/timelines/common/search_strategy/index_fields/index.ts +++ b/x-pack/plugins/timelines/common/search_strategy/index_fields/index.ts @@ -6,8 +6,9 @@ */ import type { IFieldSubType } from '@kbn/es-query'; +import type { IEsSearchRequest, IEsSearchResponse } from '@kbn/search-types'; import type { MappingRuntimeFields } from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; -import type { IEsSearchRequest, IEsSearchResponse, FieldSpec } from '@kbn/data-plugin/common'; +import type { FieldSpec } from '@kbn/data-plugin/common'; import type { RuntimeField } from '@kbn/data-views-plugin/common'; import type { Maybe } from '../common'; diff --git a/x-pack/plugins/timelines/common/search_strategy/timeline/events/all/index.ts b/x-pack/plugins/timelines/common/search_strategy/timeline/events/all/index.ts index ade162b367faf..bf1ac654161d7 100644 --- a/x-pack/plugins/timelines/common/search_strategy/timeline/events/all/index.ts +++ b/x-pack/plugins/timelines/common/search_strategy/timeline/events/all/index.ts @@ -5,7 +5,7 @@ * 2.0. */ -import type { IEsSearchResponse } from '@kbn/data-plugin/common'; +import type { IEsSearchResponse } from '@kbn/search-types'; import type { EcsSecurityExtension as Ecs } from '@kbn/securitysolution-ecs'; import type { CursorType, Inspect, Maybe, PaginationInputPaginated } from '../../../common'; diff --git a/x-pack/plugins/timelines/common/search_strategy/timeline/events/details/index.ts b/x-pack/plugins/timelines/common/search_strategy/timeline/events/details/index.ts index ae95943139b9b..5d74d14ba1d01 100644 --- a/x-pack/plugins/timelines/common/search_strategy/timeline/events/details/index.ts +++ b/x-pack/plugins/timelines/common/search_strategy/timeline/events/details/index.ts @@ -5,7 +5,7 @@ * 2.0. */ -import type { IEsSearchResponse } from '@kbn/data-plugin/common'; +import type { IEsSearchResponse } from '@kbn/search-types'; import { EcsSecurityExtension as Ecs } from '@kbn/securitysolution-ecs'; import { Inspect, Maybe } from '../../../common'; diff --git a/x-pack/plugins/timelines/common/search_strategy/timeline/events/last_event_time/index.ts b/x-pack/plugins/timelines/common/search_strategy/timeline/events/last_event_time/index.ts index 13e91cd0bca05..48494fd4f4030 100644 --- a/x-pack/plugins/timelines/common/search_strategy/timeline/events/last_event_time/index.ts +++ b/x-pack/plugins/timelines/common/search_strategy/timeline/events/last_event_time/index.ts @@ -5,7 +5,7 @@ * 2.0. */ -import type { IEsSearchResponse } from '@kbn/data-plugin/common'; +import type { IEsSearchResponse } from '@kbn/search-types'; import { Inspect, Maybe } from '../../../common'; export interface LastTimeDetails { diff --git a/x-pack/plugins/timelines/server/search_strategy/timeline/factory/events/all/index.ts b/x-pack/plugins/timelines/server/search_strategy/timeline/factory/events/all/index.ts index 7dea40b3a6c1f..db77526758bbc 100644 --- a/x-pack/plugins/timelines/server/search_strategy/timeline/factory/events/all/index.ts +++ b/x-pack/plugins/timelines/server/search_strategy/timeline/factory/events/all/index.ts @@ -6,7 +6,7 @@ */ import { cloneDeep, getOr } from 'lodash/fp'; -import type { IEsSearchResponse } from '@kbn/data-plugin/common'; +import type { IEsSearchResponse } from '@kbn/search-types'; import { buildAlertFieldsRequest as buildFieldsRequest } from '@kbn/alerts-as-data-utils'; import { TimelineEventsQueries } from '../../../../../../common/api/search_strategy'; import { DEFAULT_MAX_TABLE_QUERY_SIZE } from '../../../../../../common/constants'; diff --git a/x-pack/plugins/timelines/server/search_strategy/timeline/factory/events/details/index.ts b/x-pack/plugins/timelines/server/search_strategy/timeline/factory/events/details/index.ts index 0f70f726948a2..46edcf926d061 100644 --- a/x-pack/plugins/timelines/server/search_strategy/timeline/factory/events/details/index.ts +++ b/x-pack/plugins/timelines/server/search_strategy/timeline/factory/events/details/index.ts @@ -7,7 +7,7 @@ import { merge } from 'lodash/fp'; -import type { IEsSearchResponse } from '@kbn/data-plugin/common'; +import type { IEsSearchResponse } from '@kbn/search-types'; import { TimelineEventsQueries } from '../../../../../../common/api/search_strategy'; import { EventHit, diff --git a/x-pack/plugins/timelines/server/search_strategy/timeline/factory/events/kpi/index.ts b/x-pack/plugins/timelines/server/search_strategy/timeline/factory/events/kpi/index.ts index e12782a85fb83..cbcdeb7aa17a0 100644 --- a/x-pack/plugins/timelines/server/search_strategy/timeline/factory/events/kpi/index.ts +++ b/x-pack/plugins/timelines/server/search_strategy/timeline/factory/events/kpi/index.ts @@ -7,7 +7,7 @@ import { getOr } from 'lodash/fp'; -import type { IEsSearchResponse } from '@kbn/data-plugin/common'; +import type { IEsSearchResponse } from '@kbn/search-types'; import { TimelineEventsQueries } from '../../../../../../common/api/search_strategy'; import { TimelineKpiStrategyResponse } from '../../../../../../common/search_strategy/timeline'; import { inspectStringifyObject } from '../../../../../utils/build_query'; diff --git a/x-pack/plugins/timelines/server/search_strategy/timeline/factory/events/last_event_time/index.ts b/x-pack/plugins/timelines/server/search_strategy/timeline/factory/events/last_event_time/index.ts index 8bd21765f551e..21da54984f271 100644 --- a/x-pack/plugins/timelines/server/search_strategy/timeline/factory/events/last_event_time/index.ts +++ b/x-pack/plugins/timelines/server/search_strategy/timeline/factory/events/last_event_time/index.ts @@ -7,7 +7,7 @@ import { getOr } from 'lodash/fp'; -import type { IEsSearchResponse } from '@kbn/data-plugin/common'; +import type { IEsSearchResponse } from '@kbn/search-types'; import { TimelineEventsQueries } from '../../../../../../common/api/search_strategy'; import { TimelineEventsLastEventTimeStrategyResponse } from '../../../../../../common/search_strategy/timeline'; import { inspectStringifyObject } from '../../../../../utils/build_query'; diff --git a/x-pack/plugins/timelines/server/search_strategy/timeline/factory/events/last_event_time/query.events_last_event_time.dsl.ts b/x-pack/plugins/timelines/server/search_strategy/timeline/factory/events/last_event_time/query.events_last_event_time.dsl.ts index 6d921918f53da..b707eb07fbf34 100644 --- a/x-pack/plugins/timelines/server/search_strategy/timeline/factory/events/last_event_time/query.events_last_event_time.dsl.ts +++ b/x-pack/plugins/timelines/server/search_strategy/timeline/factory/events/last_event_time/query.events_last_event_time.dsl.ts @@ -5,7 +5,7 @@ * 2.0. */ -import type { ISearchRequestParams } from '@kbn/data-plugin/common'; +import type { ISearchRequestParams } from '@kbn/search-types'; import { LastEventIndexKey, TimelineEventsLastEventTimeRequestOptions, diff --git a/x-pack/plugins/timelines/server/search_strategy/timeline/factory/types.ts b/x-pack/plugins/timelines/server/search_strategy/timeline/factory/types.ts index 31bb37e077642..650e1ba48bf58 100644 --- a/x-pack/plugins/timelines/server/search_strategy/timeline/factory/types.ts +++ b/x-pack/plugins/timelines/server/search_strategy/timeline/factory/types.ts @@ -4,8 +4,7 @@ * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ - -import type { IEsSearchResponse, ISearchRequestParams } from '@kbn/data-plugin/common'; +import type { ISearchRequestParams, IEsSearchResponse } from '@kbn/search-types'; import { TimelineFactoryQueryTypes, TimelineStrategyRequestType, diff --git a/x-pack/plugins/timelines/server/search_strategy/timeline/index.ts b/x-pack/plugins/timelines/server/search_strategy/timeline/index.ts index 6c06b34a0fdd3..4d0296e532e62 100644 --- a/x-pack/plugins/timelines/server/search_strategy/timeline/index.ts +++ b/x-pack/plugins/timelines/server/search_strategy/timeline/index.ts @@ -12,7 +12,8 @@ import { SearchStrategyDependencies, shimHitsTotal, } from '@kbn/data-plugin/server'; -import { ENHANCED_ES_SEARCH_STRATEGY, ISearchOptions } from '@kbn/data-plugin/common'; +import type { ISearchOptions } from '@kbn/search-types'; +import { ENHANCED_ES_SEARCH_STRATEGY } from '@kbn/data-plugin/common'; import { SecurityPluginSetup } from '@kbn/security-plugin/server'; import { Logger } from '@kbn/logging'; import { z } from 'zod'; diff --git a/x-pack/plugins/timelines/tsconfig.json b/x-pack/plugins/timelines/tsconfig.json index 5697cae6120d1..3038d455e010c 100644 --- a/x-pack/plugins/timelines/tsconfig.json +++ b/x-pack/plugins/timelines/tsconfig.json @@ -35,6 +35,7 @@ "@kbn/alerts-as-data-utils", "@kbn/logging", "@kbn/search-errors", + "@kbn/search-types", ], "exclude": [ "target/**/*", diff --git a/x-pack/plugins/transform/public/app/__mocks__/app_dependencies.tsx b/x-pack/plugins/transform/public/app/__mocks__/app_dependencies.tsx index e22e5c965fc64..0feb3b2c9fc21 100644 --- a/x-pack/plugins/transform/public/app/__mocks__/app_dependencies.tsx +++ b/x-pack/plugins/transform/public/app/__mocks__/app_dependencies.tsx @@ -7,12 +7,11 @@ import { useContext } from 'react'; import { of } from 'rxjs'; - import type { IKibanaSearchResponse, IKibanaSearchRequest, ISearchGeneric, -} from '@kbn/data-plugin/public'; +} from '@kbn/search-types'; import type { ScopedHistory } from '@kbn/core/public'; import { coreMock, themeServiceMock } from '@kbn/core/public/mocks'; import { dataPluginMock } from '@kbn/data-plugin/public/mocks'; diff --git a/x-pack/plugins/transform/public/app/hooks/use_data_search.ts b/x-pack/plugins/transform/public/app/hooks/use_data_search.ts index f691cb7a0d8b6..7c5d45e5a56fd 100644 --- a/x-pack/plugins/transform/public/app/hooks/use_data_search.ts +++ b/x-pack/plugins/transform/public/app/hooks/use_data_search.ts @@ -10,7 +10,7 @@ import { lastValueFrom } from 'rxjs'; import type * as estypes from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; -import type { IKibanaSearchRequest } from '@kbn/data-plugin/common'; +import type { IKibanaSearchRequest } from '@kbn/search-types'; import { TRANSFORM_REACT_QUERY_KEYS } from '../../../common/constants'; diff --git a/x-pack/plugins/transform/tsconfig.json b/x-pack/plugins/transform/tsconfig.json index 91581e7dfc4ff..3164ed3a06c04 100644 --- a/x-pack/plugins/transform/tsconfig.json +++ b/x-pack/plugins/transform/tsconfig.json @@ -75,7 +75,8 @@ "@kbn/alerts-as-data-utils", "@kbn/code-editor", "@kbn/rule-data-utils", - "@kbn/react-kibana-context-render" + "@kbn/react-kibana-context-render", + "@kbn/search-types" ], "exclude": [ "target/**/*", diff --git a/x-pack/plugins/triggers_actions_ui/public/application/sections/alerts_table/hooks/use_fetch_alerts.test.tsx b/x-pack/plugins/triggers_actions_ui/public/application/sections/alerts_table/hooks/use_fetch_alerts.test.tsx index b3a9ba275e6aa..7171e793ef52c 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/sections/alerts_table/hooks/use_fetch_alerts.test.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/application/sections/alerts_table/hooks/use_fetch_alerts.test.tsx @@ -10,7 +10,7 @@ import { of, throwError } from 'rxjs'; import { act, renderHook } from '@testing-library/react-hooks'; import { useFetchAlerts, FetchAlertsArgs, FetchAlertResp } from './use_fetch_alerts'; import { useKibana } from '../../../../common/lib/kibana'; -import { IKibanaSearchResponse } from '@kbn/data-plugin/public'; +import type { IKibanaSearchResponse } from '@kbn/search-types'; import { QueryDslQueryContainer } from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; import { useState } from 'react'; diff --git a/x-pack/plugins/triggers_actions_ui/tsconfig.json b/x-pack/plugins/triggers_actions_ui/tsconfig.json index 879d1ca2ca4cb..12cdcbdfe1442 100644 --- a/x-pack/plugins/triggers_actions_ui/tsconfig.json +++ b/x-pack/plugins/triggers_actions_ui/tsconfig.json @@ -65,7 +65,8 @@ "@kbn/react-kibana-context-render", "@kbn/react-kibana-mount", "@kbn/react-kibana-context-theme", - "@kbn/controls-plugin" + "@kbn/controls-plugin", + "@kbn/search-types" ], "exclude": ["target/**/*"] } diff --git a/x-pack/test/common/services/bsearch_secure.ts b/x-pack/test/common/services/bsearch_secure.ts index c4f913f3b6ae7..0ab967462767f 100644 --- a/x-pack/test/common/services/bsearch_secure.ts +++ b/x-pack/test/common/services/bsearch_secure.ts @@ -11,7 +11,7 @@ import expect from '@kbn/expect'; import request from 'superagent'; import type SuperTest from 'supertest'; -import { IEsSearchResponse } from '@kbn/data-plugin/common'; +import type { IEsSearchResponse } from '@kbn/search-types'; import { ELASTIC_HTTP_VERSION_HEADER } from '@kbn/core-http-common'; import { BFETCH_ROUTE_VERSION_LATEST } from '@kbn/bfetch-plugin/common'; import { FtrService } from '../ftr_provider_context'; diff --git a/x-pack/test/tsconfig.json b/x-pack/test/tsconfig.json index cb889a3a48869..4634b40c74518 100644 --- a/x-pack/test/tsconfig.json +++ b/x-pack/test/tsconfig.json @@ -173,6 +173,7 @@ "@kbn/apm-data-view", "@kbn/core-saved-objects-api-server", "@kbn/esql-utils", + "@kbn/search-types", "@kbn/analytics-ftr-helpers-plugin", ] } diff --git a/yarn.lock b/yarn.lock index 4efd0764da08d..db51739b49228 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5866,6 +5866,10 @@ version "0.0.0" uid "" +"@kbn/search-types@link:packages/kbn-search-types": + version "0.0.0" + uid "" + "@kbn/searchprofiler-plugin@link:x-pack/plugins/searchprofiler": version "0.0.0" uid "" From 1a3ff70c5e7ebdc308fe5022acee178a43302dc5 Mon Sep 17 00:00:00 2001 From: Cristina Amico Date: Mon, 6 May 2024 12:19:13 +0200 Subject: [PATCH 2/6] [Fleet] Fix cloudflare template error (#182645) ## Summary Cloudflare 8.24 doesn't install properly and the config tab also fails with the same error. This PR fixes this error and also fixes a small UI issue with max width not sets in configs tab. The integration defines two possible options for auth (auth key or token) but only one should be used. When both are set the [compile template](https://github.com/elastic/kibana/blob/be3f66fd45db4001b9437281a2cb075e817fa25f/x-pack/plugins/fleet/server/services/epm/agent/agent.ts#L27) fails with an error ## Before ![Screenshot 2024-05-03 at 16 16 35](https://github.com/elastic/kibana/assets/16084106/cb90e72a-7cef-46eb-8542-324cce45ac37) ![Screenshot 2024-05-03 at 16 20 01](https://github.com/elastic/kibana/assets/16084106/4ffacea4-ffa7-4a1a-bf81-24213fee48f3) ## After ![Screenshot 2024-05-06 at 10 58 57](https://github.com/elastic/kibana/assets/16084106/36ca8bea-87d7-4d01-8fda-50190feb9fbb) --- .../sections/epm/screens/detail/configs/index.tsx | 9 +++++++-- x-pack/plugins/fleet/server/services/epm/agent/agent.ts | 1 + 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/x-pack/plugins/fleet/public/applications/integrations/sections/epm/screens/detail/configs/index.tsx b/x-pack/plugins/fleet/public/applications/integrations/sections/epm/screens/detail/configs/index.tsx index 034bb842f1f6f..e42957995514c 100644 --- a/x-pack/plugins/fleet/public/applications/integrations/sections/epm/screens/detail/configs/index.tsx +++ b/x-pack/plugins/fleet/public/applications/integrations/sections/epm/screens/detail/configs/index.tsx @@ -5,6 +5,7 @@ * 2.0. */ import React from 'react'; +import styled from 'styled-components'; import { EuiFlexGroup, EuiFlexItem, @@ -27,6 +28,10 @@ import { PrereleaseCallout } from '../overview/overview'; import { isPackagePrerelease } from '../../../../../../../../common/services'; +const FlexItemWithMaxWidth = styled(EuiFlexItem)` + max-width: 1000px; +`; + interface ConfigsProps { packageInfo: PackageInfo; } @@ -57,7 +62,7 @@ export const Configs: React.FC = ({ packageInfo }) => { return ( - + {isLoading && !configs ? ( ) : ( @@ -117,7 +122,7 @@ export const Configs: React.FC = ({ packageInfo }) => { )} - + ); }; diff --git a/x-pack/plugins/fleet/server/services/epm/agent/agent.ts b/x-pack/plugins/fleet/server/services/epm/agent/agent.ts index abe2153bb800f..9a26394cd1cb1 100644 --- a/x-pack/plugins/fleet/server/services/epm/agent/agent.ts +++ b/x-pack/plugins/fleet/server/services/epm/agent/agent.ts @@ -126,6 +126,7 @@ handlebars.registerHelper('contains', containsHelper); // and to respect any incoming newline we also need to double them, otherwise // they will be replaced with a space. function escapeStringHelper(str: string) { + if (!str) return undefined; return "'" + str.replace(/\'/g, "''").replace(/\n/g, '\n\n') + "'"; } handlebars.registerHelper('escape_string', escapeStringHelper); From 2df9ad83ace82dc598383cbf92ba08cd0794e84a Mon Sep 17 00:00:00 2001 From: Aleh Zasypkin Date: Mon, 6 May 2024 12:50:39 +0200 Subject: [PATCH 3/6] feat(tests): remove strict request validation flags for Elasticsearch security APIs in serverless tests (#182584) ## Summary Revert of https://github.com/elastic/kibana/pull/178705: `API keys` request strict validation is already enabled by default in production, and the decision regarding enabling `Has Privileges` request strict validation has been reverted and replaced with warnings in response headers. Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> --- x-pack/test_serverless/shared/config.base.ts | 4 ---- 1 file changed, 4 deletions(-) diff --git a/x-pack/test_serverless/shared/config.base.ts b/x-pack/test_serverless/shared/config.base.ts index 45e30f146cfe0..9c2454d4e7a39 100644 --- a/x-pack/test_serverless/shared/config.base.ts +++ b/x-pack/test_serverless/shared/config.base.ts @@ -60,10 +60,6 @@ export default async () => { `xpack.security.authc.realms.native.native1.enabled=false`, `xpack.security.authc.realms.native.native1.order=-97`, - // Enable strict request validation for security related ES APIs. - 'xpack.security.authz.has_privileges.strict_request_validation.enabled=true', - 'xpack.security.authc.api_key.strict_request_validation.enabled=true', - 'xpack.security.authc.realms.jwt.jwt1.allowed_audiences=elasticsearch', `xpack.security.authc.realms.jwt.jwt1.allowed_issuer=https://kibana.elastic.co/jwt/`, `xpack.security.authc.realms.jwt.jwt1.allowed_signature_algorithms=[RS256]`, From 8096baf940927ec7d58e1773f602bfafbaaff6c4 Mon Sep 17 00:00:00 2001 From: Ash <1849116+ashokaditya@users.noreply.github.com> Date: Mon, 6 May 2024 13:12:51 +0200 Subject: [PATCH 4/6] [Security Solution][Endpoint] Re-enable tests for automated response actions from alerts (#182102) ## Summary Re-enable skipped test for automated response actions from alerts. closes elastic/kibana/issues/169828 #### Flaky runner - https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/5809 x 50 (1 fail) - https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/5851 x 50 (all pass) ### Checklist - [x] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios - [x] [Flaky Test Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was used on any tests changed --- .../public/management/cypress/cypress_base.config.ts | 4 +++- .../automated_response_actions.cy.ts | 5 ++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/x-pack/plugins/security_solution/public/management/cypress/cypress_base.config.ts b/x-pack/plugins/security_solution/public/management/cypress/cypress_base.config.ts index 2cbd89a80d2ef..2afb55a8e6700 100644 --- a/x-pack/plugins/security_solution/public/management/cypress/cypress_base.config.ts +++ b/x-pack/plugins/security_solution/public/management/cypress/cypress_base.config.ts @@ -74,7 +74,9 @@ export const getCypressBaseConfig = ( // baseUrl: To override, set Env. variable `CYPRESS_BASE_URL` baseUrl: 'http://localhost:5601', supportFile: 'public/management/cypress/support/e2e.ts', - specPattern: 'public/management/cypress/e2e/**/*.cy.{js,jsx,ts,tsx}', + // TODO: undo before merge + specPattern: + 'public/management/cypress/e2e/**/**/automated_response_actions.cy.{js,jsx,ts,tsx}', experimentalRunAllSpecs: true, experimentalMemoryManagement: true, experimentalInteractiveRunEvents: true, diff --git a/x-pack/plugins/security_solution/public/management/cypress/e2e/automated_response_actions/automated_response_actions.cy.ts b/x-pack/plugins/security_solution/public/management/cypress/e2e/automated_response_actions/automated_response_actions.cy.ts index adaaf9c99059a..4fb913f62c820 100644 --- a/x-pack/plugins/security_solution/public/management/cypress/e2e/automated_response_actions/automated_response_actions.cy.ts +++ b/x-pack/plugins/security_solution/public/management/cypress/e2e/automated_response_actions/automated_response_actions.cy.ts @@ -73,8 +73,7 @@ describe( login(); }); - // FLAKY: https://github.com/elastic/kibana/issues/169828 - describe.skip('From alerts', () => { + describe('From alerts', () => { let ruleId: string; let ruleName: string; @@ -100,7 +99,7 @@ describe( visitRuleAlerts(ruleName); closeAllToasts(); - changeAlertsFilter('process.name: "sshd"'); + changeAlertsFilter('process.name: "agentbeat"'); cy.getByTestSubj('expand-event').eq(0).click(); cy.getByTestSubj('securitySolutionFlyoutNavigationExpandDetailButton').click(); cy.getByTestSubj('securitySolutionFlyoutResponseTab').click(); From 602baa0148d5d842b978365280c8020631cecd7e Mon Sep 17 00:00:00 2001 From: Jon Date: Mon, 6 May 2024 07:05:32 -0500 Subject: [PATCH 5/6] [failed-test-reporter] Include pipeline in comment (#182576) Instead of the static text `CI Build` when reporting a test failure, this writes the pipeline slug. The intention here is to enable test failure reporting for https://buildkite.com/elastic/kibana-elasticsearch-serverless-verify-and-promote and https://buildkite.com/elastic/kibana-elasticsearch-snapshot-verify and keep the test failures consolidated in one issue. --- .../failed_tests_reporter/failed_tests_reporter_cli.ts | 7 +++++-- .../failed_tests_reporter/report_failure.test.ts | 10 ++++++---- .../failed_tests_reporter/report_failure.ts | 10 ++++++---- 3 files changed, 17 insertions(+), 10 deletions(-) diff --git a/packages/kbn-failed-test-reporter-cli/failed_tests_reporter/failed_tests_reporter_cli.ts b/packages/kbn-failed-test-reporter-cli/failed_tests_reporter/failed_tests_reporter_cli.ts index 1c81df82ef665..0b7b6ebe0f8a8 100644 --- a/packages/kbn-failed-test-reporter-cli/failed_tests_reporter/failed_tests_reporter_cli.ts +++ b/packages/kbn-failed-test-reporter-cli/failed_tests_reporter/failed_tests_reporter_cli.ts @@ -42,11 +42,13 @@ run( } let branch: string = ''; + let pipeline: string = ''; if (updateGithub) { let isPr = false; if (process.env.BUILDKITE === 'true') { branch = process.env.BUILDKITE_BRANCH || ''; + pipeline = process.env.BUILDKITE_PIPELINE_SLUG || ''; isPr = process.env.BUILDKITE_PULL_REQUEST === 'true'; updateGithub = process.env.REPORT_FAILED_TESTS_TO_GITHUB === 'true'; } else { @@ -137,7 +139,8 @@ run( buildUrl, existingIssue, githubApi, - branch + branch, + pipeline ); const url = existingIssue.github.htmlUrl; existingIssue.github.body = newBody; @@ -150,7 +153,7 @@ run( continue; } - const newIssue = await createFailureIssue(buildUrl, failure, githubApi, branch); + const newIssue = await createFailureIssue(buildUrl, failure, githubApi, branch, pipeline); existingIssues.addNewlyCreated(failure, newIssue); pushMessage('Test has not failed recently on tracked branches'); if (updateGithub) { diff --git a/packages/kbn-failed-test-reporter-cli/failed_tests_reporter/report_failure.test.ts b/packages/kbn-failed-test-reporter-cli/failed_tests_reporter/report_failure.test.ts index fd445888ad1ee..23c2b57c6fcf2 100644 --- a/packages/kbn-failed-test-reporter-cli/failed_tests_reporter/report_failure.test.ts +++ b/packages/kbn-failed-test-reporter-cli/failed_tests_reporter/report_failure.test.ts @@ -27,7 +27,8 @@ describe('createFailureIssue()', () => { likelyIrrelevant: false, }, api, - 'main' + 'main', + 'kibana-on-merge' ); expect(api.createIssue).toMatchInlineSnapshot(` @@ -41,7 +42,7 @@ describe('createFailureIssue()', () => { this is the failure text \`\`\` - First failure: [CI Build - main](https://build-url) + First failure: [kibana-on-merge - main](https://build-url) ", Array [ @@ -81,7 +82,8 @@ describe('updateFailureIssue()', () => { }, }, api, - 'main' + 'main', + 'kibana-on-merge' ); expect(api.editIssueBodyAndEnsureOpen).toMatchInlineSnapshot(` @@ -107,7 +109,7 @@ describe('updateFailureIssue()', () => { "calls": Array [ Array [ 1234, - "New failure: [CI Build - main](https://build-url)", + "New failure: [kibana-on-merge - main](https://build-url)", ], ], "results": Array [ diff --git a/packages/kbn-failed-test-reporter-cli/failed_tests_reporter/report_failure.ts b/packages/kbn-failed-test-reporter-cli/failed_tests_reporter/report_failure.ts index ed282b44325e3..a954a1eee7dca 100644 --- a/packages/kbn-failed-test-reporter-cli/failed_tests_reporter/report_failure.ts +++ b/packages/kbn-failed-test-reporter-cli/failed_tests_reporter/report_failure.ts @@ -15,7 +15,8 @@ export async function createFailureIssue( buildUrl: string, failure: TestFailure, api: GithubApi, - branch: string + branch: string, + pipeline: string ) { const title = `Failing test: ${failure.classname} - ${failure.name}`; @@ -39,7 +40,7 @@ export async function createFailureIssue( failureBody, '```', '', - `First failure: [CI Build - ${branch}](${buildUrl})`, + `First failure: [${pipeline || 'CI Build'} - ${branch}](${buildUrl})`, ].join('\n'), { 'test.class': failure.classname, @@ -55,7 +56,8 @@ export async function updateFailureIssue( buildUrl: string, issue: ExistingFailedTestIssue, api: GithubApi, - branch: string + branch: string, + pipeline: string ) { // Increment failCount const newCount = getIssueMetadata(issue.github.body, 'test.failCount', 0) + 1; @@ -66,7 +68,7 @@ export async function updateFailureIssue( await api.editIssueBodyAndEnsureOpen(issue.github.number, newBody); await api.addIssueComment( issue.github.number, - `New failure: [CI Build - ${branch}](${buildUrl})` + `New failure: [${pipeline || 'CI Build'} - ${branch}](${buildUrl})` ); return { newBody, newCount }; From acec0e85428d4250a14f8074643d8759eff84a51 Mon Sep 17 00:00:00 2001 From: Karen Grigoryan Date: Mon, 6 May 2024 14:18:34 +0200 Subject: [PATCH 6/6] [Security Solution] Fix auto task completion (177782) (#182632) ## Summary Addresses #177782 Autostep for prebuilt rules on getstarted page is not showing up correctly. It's either hidden on load or gets toggled and eventually hidden after continuous expand and collapse of the autostep panel. Precondition for testing: Enable at least one prebuilt rule to to observe the behavior. before: https://github.com/elastic/kibana/assets/1625373/e9f825d6-1d06-403e-a8ac-7002bdd11471 after: https://github.com/elastic/kibana/assets/1625373/97d432be-8dcd-4448-8ac3-267b1a6c48d8 --- .../onboarding/card_step/helpers.test.ts | 6 ++--- .../onboarding/card_step/helpers.ts | 7 +++-- .../hooks/use_check_step_completed.test.tsx | 27 +++++++++++++++++++ .../hooks/use_check_step_completed.tsx | 15 ++++++++--- .../landing_page/onboarding/types.ts | 3 +-- 5 files changed, 45 insertions(+), 13 deletions(-) diff --git a/x-pack/plugins/security_solution/public/common/components/landing_page/onboarding/card_step/helpers.test.ts b/x-pack/plugins/security_solution/public/common/components/landing_page/onboarding/card_step/helpers.test.ts index 4cb50e8305c75..e6f79803763e2 100644 --- a/x-pack/plugins/security_solution/public/common/components/landing_page/onboarding/card_step/helpers.test.ts +++ b/x-pack/plugins/security_solution/public/common/components/landing_page/onboarding/card_step/helpers.test.ts @@ -18,7 +18,7 @@ describe('autoCheckPrebuildRuleStepCompleted', () => { it('should return true if there are enabled rules', async () => { (fetchRuleManagementFilters as jest.Mock).mockResolvedValue({ total: 1 }); const result = await autoCheckPrebuildRuleStepCompleted({ - abortSignal: { current: mockAbortController }, + abortSignal: mockAbortController, kibanaServicesHttp: mockHttp, }); expect(result).toBe(true); @@ -30,7 +30,7 @@ describe('autoCheckPrebuildRuleStepCompleted', () => { const mockOnError = jest.fn(); const result = await autoCheckPrebuildRuleStepCompleted({ - abortSignal: { current: mockAbortController }, + abortSignal: mockAbortController, kibanaServicesHttp: mockHttp, onError: mockOnError, }); @@ -46,7 +46,7 @@ describe('autoCheckPrebuildRuleStepCompleted', () => { mockAbortController.abort(); const result = await autoCheckPrebuildRuleStepCompleted({ - abortSignal: { current: mockAbortController }, + abortSignal: mockAbortController, kibanaServicesHttp: mockHttp, onError: mockOnError, }); diff --git a/x-pack/plugins/security_solution/public/common/components/landing_page/onboarding/card_step/helpers.ts b/x-pack/plugins/security_solution/public/common/components/landing_page/onboarding/card_step/helpers.ts index 369cda7d65140..a7071532b5575 100644 --- a/x-pack/plugins/security_solution/public/common/components/landing_page/onboarding/card_step/helpers.ts +++ b/x-pack/plugins/security_solution/public/common/components/landing_page/onboarding/card_step/helpers.ts @@ -5,7 +5,6 @@ * 2.0. */ -import type { MutableRefObject } from 'react'; import type { HttpSetup } from '@kbn/core/public'; import { fetchRuleManagementFilters } from '../apis'; import { ENABLED_FIELD } from '../../../../../../common/detection_engine/rule_management/rule_fields'; @@ -15,7 +14,7 @@ export const autoCheckPrebuildRuleStepCompleted = async ({ kibanaServicesHttp, onError, }: { - abortSignal: MutableRefObject; + abortSignal: AbortController; kibanaServicesHttp: HttpSetup; onError?: (e: Error) => void; }) => { @@ -23,7 +22,7 @@ export const autoCheckPrebuildRuleStepCompleted = async ({ try { const data = await fetchRuleManagementFilters({ http: kibanaServicesHttp, - signal: abortSignal.current.signal, + signal: abortSignal.signal, query: { page: 1, per_page: 20, @@ -34,7 +33,7 @@ export const autoCheckPrebuildRuleStepCompleted = async ({ }); return data?.total > 0; } catch (e) { - if (!abortSignal.current.signal.aborted) { + if (!abortSignal.signal.aborted) { onError?.(e); } diff --git a/x-pack/plugins/security_solution/public/common/components/landing_page/onboarding/hooks/use_check_step_completed.test.tsx b/x-pack/plugins/security_solution/public/common/components/landing_page/onboarding/hooks/use_check_step_completed.test.tsx index f79deee080053..cc0bec56ca9ed 100644 --- a/x-pack/plugins/security_solution/public/common/components/landing_page/onboarding/hooks/use_check_step_completed.test.tsx +++ b/x-pack/plugins/security_solution/public/common/components/landing_page/onboarding/hooks/use_check_step_completed.test.tsx @@ -17,6 +17,9 @@ import { jest.mock('../../../../lib/kibana'); describe('useCheckStepCompleted', () => { + beforeEach(() => { + jest.clearAllMocks(); + }); it('does nothing when autoCheckIfStepCompleted is not provided', () => { const { result } = renderHook(() => useCheckStepCompleted({ @@ -56,4 +59,28 @@ describe('useCheckStepCompleted', () => { }); }); }); + + it('does not toggleTaskCompleteStatus if authCheckIfStepCompleted was aborted', async () => { + const mockAutoCheck = jest.fn(({ abortSignal }) => { + abortSignal.abort(); + return Promise.resolve(false); + }); + const mockToggleTask = jest.fn(); + + const { waitFor } = renderHook(() => + useCheckStepCompleted({ + autoCheckIfStepCompleted: mockAutoCheck, + cardId: GetStartedWithAlertsCardsId.enablePrebuiltRules, + indicesExist: true, + sectionId: SectionId.getStartedWithAlerts, + stepId: EnablePrebuiltRulesSteps.enablePrebuiltRules, + toggleTaskCompleteStatus: mockToggleTask, + }) + ); + + await waitFor(() => { + expect(mockAutoCheck).toHaveBeenCalled(); + expect(mockToggleTask).not.toHaveBeenCalled(); + }); + }); }); diff --git a/x-pack/plugins/security_solution/public/common/components/landing_page/onboarding/hooks/use_check_step_completed.tsx b/x-pack/plugins/security_solution/public/common/components/landing_page/onboarding/hooks/use_check_step_completed.tsx index 13542d140002a..d360020ffcb27 100644 --- a/x-pack/plugins/security_solution/public/common/components/landing_page/onboarding/hooks/use_check_step_completed.tsx +++ b/x-pack/plugins/security_solution/public/common/components/landing_page/onboarding/hooks/use_check_step_completed.tsx @@ -38,7 +38,6 @@ export const useCheckStepCompleted = ({ http: kibanaServicesHttp, notifications: { toasts }, } = useKibana().services; - const abortSignal = useRef(new AbortController()); const addError = useRef(toasts.addError.bind(toasts)).current; useEffect(() => { @@ -46,6 +45,7 @@ export const useCheckStepCompleted = ({ return; } + const abortSignal = new AbortController(); const autoCheckStepCompleted = async () => { const isDone = await autoCheckIfStepCompleted({ indicesExist, @@ -56,12 +56,19 @@ export const useCheckStepCompleted = ({ }, }); - toggleTaskCompleteStatus({ stepId, cardId, sectionId, undo: !isDone, trigger: 'auto_check' }); + if (!abortSignal.signal.aborted) { + toggleTaskCompleteStatus({ + stepId, + cardId, + sectionId, + undo: !isDone, + trigger: 'auto_check', + }); + } }; autoCheckStepCompleted(); - const currentAbortController = abortSignal.current; return () => { - currentAbortController.abort(); + abortSignal.abort(); }; }, [ autoCheckIfStepCompleted, diff --git a/x-pack/plugins/security_solution/public/common/components/landing_page/onboarding/types.ts b/x-pack/plugins/security_solution/public/common/components/landing_page/onboarding/types.ts index 1e4e6a8a11085..bff3598a28b40 100644 --- a/x-pack/plugins/security_solution/public/common/components/landing_page/onboarding/types.ts +++ b/x-pack/plugins/security_solution/public/common/components/landing_page/onboarding/types.ts @@ -7,7 +7,6 @@ import type { EuiIconProps } from '@elastic/eui'; import type React from 'react'; -import type { MutableRefObject } from 'react'; import type { HttpSetup } from '@kbn/core/public'; import type { ProductLine } from './configs'; import type { StepLinkId } from './step_links/types'; @@ -46,7 +45,7 @@ type AutoCheckEnablePrebuiltRulesSteps = ({ kibanaServicesHttp, onError, }: { - abortSignal: MutableRefObject; + abortSignal: AbortController; kibanaServicesHttp: HttpSetup; onError?: (error: Error) => void; }) => Promise;