From 7264d3a548aef55017b58a1743c81cf1c2aa6c7a Mon Sep 17 00:00:00 2001 From: Saarika Bhasi <55930906+saarikabhasi@users.noreply.github.com> Date: Fri, 13 Sep 2024 07:46:00 -0400 Subject: [PATCH] [Index Management] [Onboarding] Create new package folder for index_management (#192594) ## Summary We have to extract few components from `index_management` plugin to shared packages for onboarding project. These extracted files would be separated into small subject matter packages within a common folder - `index-management` in `x-pack/packages/`. What is covered in this PR? * Created new folder `index-management` under [ x-pack/packages/](https://github.com/elastic/kibana/tree/main/x-pack/packages) as a home for subject matter packages. * moved existing package - [@kbn/index-management](https://github.com/elastic/kibana/tree/main/x-pack/packages/index-management) under `x-pack/packages/index-management` * update name of [@kbn/index-management](https://github.com/elastic/kibana/tree/main/x-pack/packages/index-management) to `@kbn/index-management-shared-types` * updated related files which use `@kbn/index-management` to use `@kbn/index-management-shared-types` **Note** Extracting components required for onboarding project will be part of another PR --- .github/CODEOWNERS | 2 +- package.json | 2 +- packages/kbn-text-based-editor/src/types.ts | 2 +- packages/kbn-text-based-editor/tsconfig.json | 2 +- src/plugins/esql/public/kibana_services.ts | 2 +- src/plugins/esql/public/plugin.ts | 2 +- src/plugins/esql/tsconfig.json | 2 +- tsconfig.base.json | 4 ++-- .../{ => index_management_shared_types}/README.md | 2 +- .../{ => index_management_shared_types}/index.ts | 0 .../{ => index_management_shared_types}/jest.config.js | 4 ++-- .../{ => index_management_shared_types}/kibana.jsonc | 2 +- .../{ => index_management_shared_types}/package.json | 2 +- .../{ => index_management_shared_types}/src/home_sections.ts | 0 .../src/services/extensions_service.ts | 0 .../src/services/index.ts | 0 .../src/services/public_api_service.ts | 0 .../{ => index_management_shared_types}/src/types.ts | 0 .../{ => index_management_shared_types}/tsconfig.json | 2 +- .../public/applications/shared/kibana/kibana_logic.ts | 2 +- x-pack/plugins/enterprise_search/public/plugin.ts | 2 +- x-pack/plugins/enterprise_search/tsconfig.json | 2 +- .../components/index_lifecycle_summary.tsx | 2 +- x-pack/plugins/index_lifecycle_management/tsconfig.json | 2 +- x-pack/plugins/index_management/common/constants/index.ts | 4 ++-- .../plugins/index_management/common/lib/enrich_policies.ts | 2 +- x-pack/plugins/index_management/common/types/indices.ts | 2 +- .../public/application/hooks/use_index_errors.ts | 2 +- .../sections/enrich_policy_create/create_policy_context.tsx | 2 +- .../sections/enrich_policy_create/create_policy_wizard.tsx | 2 +- .../sections/enrich_policy_create/steps/create.tsx | 2 +- .../details_flyout/policy_details_flyout.tsx | 2 +- .../home/enrich_policies_list/enrich_policies_list.tsx | 2 +- .../enrich_policies_list/policies_table/policies_table.tsx | 2 +- .../details_page/index_mapping_with_context_types.tsx | 2 +- .../index_management/public/application/services/api.ts | 2 +- x-pack/plugins/index_management/public/index.ts | 2 +- x-pack/plugins/index_management/public/plugin.ts | 5 ++++- .../public/services/extensions_service.mock.ts | 2 +- .../index_management/public/services/extensions_service.ts | 2 +- .../public/services/public_api_service.mock.ts | 2 +- .../plugins/index_management/server/lib/enrich_policies.ts | 2 +- .../routes/api/enrich_policies/register_create_route.ts | 2 +- x-pack/plugins/index_management/tsconfig.json | 2 +- x-pack/plugins/search_indices/public/hooks/api/use_index.ts | 2 +- x-pack/plugins/search_indices/tsconfig.json | 2 +- .../components/index_management/index_mappings_docs_link.tsx | 2 +- .../components/index_management/index_overview_content.tsx | 2 +- x-pack/plugins/serverless_search/tsconfig.json | 2 +- yarn.lock | 2 +- 50 files changed, 50 insertions(+), 47 deletions(-) rename x-pack/packages/index-management/{ => index_management_shared_types}/README.md (77%) rename x-pack/packages/index-management/{ => index_management_shared_types}/index.ts (100%) rename x-pack/packages/index-management/{ => index_management_shared_types}/jest.config.js (72%) rename x-pack/packages/index-management/{ => index_management_shared_types}/kibana.jsonc (60%) rename x-pack/packages/index-management/{ => index_management_shared_types}/package.json (62%) rename x-pack/packages/index-management/{ => index_management_shared_types}/src/home_sections.ts (100%) rename x-pack/packages/index-management/{ => index_management_shared_types}/src/services/extensions_service.ts (100%) rename x-pack/packages/index-management/{ => index_management_shared_types}/src/services/index.ts (100%) rename x-pack/packages/index-management/{ => index_management_shared_types}/src/services/public_api_service.ts (100%) rename x-pack/packages/index-management/{ => index_management_shared_types}/src/types.ts (100%) rename x-pack/packages/index-management/{ => index_management_shared_types}/tsconfig.json (85%) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 60a15b9372e81..3a4306292b8f9 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -508,8 +508,8 @@ src/plugins/image_embeddable @elastic/appex-sharedux packages/kbn-import-locator @elastic/kibana-operations packages/kbn-import-resolver @elastic/kibana-operations x-pack/plugins/index_lifecycle_management @elastic/kibana-management -x-pack/packages/index-management @elastic/kibana-management x-pack/plugins/index_management @elastic/kibana-management +x-pack/packages/index-management/index_management_shared_types @elastic/kibana-management test/plugin_functional/plugins/index_patterns @elastic/kibana-data-discovery x-pack/packages/ml/inference_integration_flyout @elastic/ml-ui x-pack/plugins/inference @elastic/appex-ai-infra diff --git a/package.json b/package.json index 33822a9b43f61..5aec5cd34dde8 100644 --- a/package.json +++ b/package.json @@ -552,8 +552,8 @@ "@kbn/iframe-embedded-plugin": "link:x-pack/test/functional_embedded/plugins/iframe_embedded", "@kbn/image-embeddable-plugin": "link:src/plugins/image_embeddable", "@kbn/index-lifecycle-management-plugin": "link:x-pack/plugins/index_lifecycle_management", - "@kbn/index-management": "link:x-pack/packages/index-management", "@kbn/index-management-plugin": "link:x-pack/plugins/index_management", + "@kbn/index-management-shared-types": "link:x-pack/packages/index-management/index_management_shared_types", "@kbn/index-patterns-test-plugin": "link:test/plugin_functional/plugins/index_patterns", "@kbn/inference-plugin": "link:x-pack/plugins/inference", "@kbn/inference_integration_flyout": "link:x-pack/packages/ml/inference_integration_flyout", diff --git a/packages/kbn-text-based-editor/src/types.ts b/packages/kbn-text-based-editor/src/types.ts index 4dabf29308486..69968d528dbad 100644 --- a/packages/kbn-text-based-editor/src/types.ts +++ b/packages/kbn-text-based-editor/src/types.ts @@ -11,7 +11,7 @@ import type { CoreStart } from '@kbn/core/public'; import type { DataViewsPublicPluginStart } from '@kbn/data-views-plugin/public'; import type { AggregateQuery } from '@kbn/es-query'; import type { ExpressionsStart } from '@kbn/expressions-plugin/public'; -import type { IndexManagementPluginSetup } from '@kbn/index-management'; +import type { IndexManagementPluginSetup } from '@kbn/index-management-shared-types'; import type { FieldsMetadataPublicStart } from '@kbn/fields-metadata-plugin/public'; export interface TextBasedLanguagesEditorProps { diff --git a/packages/kbn-text-based-editor/tsconfig.json b/packages/kbn-text-based-editor/tsconfig.json index b5ebfb8526df0..3b51e4095c7e3 100644 --- a/packages/kbn-text-based-editor/tsconfig.json +++ b/packages/kbn-text-based-editor/tsconfig.json @@ -23,7 +23,7 @@ "@kbn/data-plugin", "@kbn/expressions-plugin", "@kbn/data-views-plugin", - "@kbn/index-management", + "@kbn/index-management-shared-types", "@kbn/code-editor", "@kbn/shared-ux-markdown", "@kbn/fields-metadata-plugin", diff --git a/src/plugins/esql/public/kibana_services.ts b/src/plugins/esql/public/kibana_services.ts index b8679d38f7852..ae6eca13715f5 100644 --- a/src/plugins/esql/public/kibana_services.ts +++ b/src/plugins/esql/public/kibana_services.ts @@ -11,7 +11,7 @@ import { BehaviorSubject } from 'rxjs'; import type { CoreStart } from '@kbn/core/public'; import type { DataViewsPublicPluginStart } from '@kbn/data-views-plugin/public'; import type { ExpressionsStart } from '@kbn/expressions-plugin/public'; -import type { IndexManagementPluginSetup } from '@kbn/index-management'; +import type { IndexManagementPluginSetup } from '@kbn/index-management-shared-types'; import type { FieldsMetadataPublicStart } from '@kbn/fields-metadata-plugin/public'; export let core: CoreStart; diff --git a/src/plugins/esql/public/plugin.ts b/src/plugins/esql/public/plugin.ts index a0220a5e95aaf..ca75c27eccdca 100755 --- a/src/plugins/esql/public/plugin.ts +++ b/src/plugins/esql/public/plugin.ts @@ -11,7 +11,7 @@ import type { Plugin, CoreStart, CoreSetup } from '@kbn/core/public'; import type { DataViewsPublicPluginStart } from '@kbn/data-views-plugin/public'; import type { ExpressionsStart } from '@kbn/expressions-plugin/public'; import type { DataPublicPluginStart } from '@kbn/data-plugin/public'; -import type { IndexManagementPluginSetup } from '@kbn/index-management'; +import type { IndexManagementPluginSetup } from '@kbn/index-management-shared-types'; import type { UiActionsSetup, UiActionsStart } from '@kbn/ui-actions-plugin/public'; import type { FieldsMetadataPublicStart } from '@kbn/fields-metadata-plugin/public'; import { diff --git a/src/plugins/esql/tsconfig.json b/src/plugins/esql/tsconfig.json index 500ff09276eaa..6420a9535197d 100644 --- a/src/plugins/esql/tsconfig.json +++ b/src/plugins/esql/tsconfig.json @@ -15,7 +15,7 @@ "@kbn/core", "@kbn/expressions-plugin", "@kbn/data-views-plugin", - "@kbn/index-management", + "@kbn/index-management-shared-types", "@kbn/i18n", "@kbn/config-schema", "@kbn/esql-utils", diff --git a/tsconfig.base.json b/tsconfig.base.json index 3c30cdbda22c9..f931b2e3ea28d 100644 --- a/tsconfig.base.json +++ b/tsconfig.base.json @@ -1010,10 +1010,10 @@ "@kbn/import-resolver/*": ["packages/kbn-import-resolver/*"], "@kbn/index-lifecycle-management-plugin": ["x-pack/plugins/index_lifecycle_management"], "@kbn/index-lifecycle-management-plugin/*": ["x-pack/plugins/index_lifecycle_management/*"], - "@kbn/index-management": ["x-pack/packages/index-management"], - "@kbn/index-management/*": ["x-pack/packages/index-management/*"], "@kbn/index-management-plugin": ["x-pack/plugins/index_management"], "@kbn/index-management-plugin/*": ["x-pack/plugins/index_management/*"], + "@kbn/index-management-shared-types": ["x-pack/packages/index-management/index_management_shared_types"], + "@kbn/index-management-shared-types/*": ["x-pack/packages/index-management/index_management_shared_types/*"], "@kbn/index-patterns-test-plugin": ["test/plugin_functional/plugins/index_patterns"], "@kbn/index-patterns-test-plugin/*": ["test/plugin_functional/plugins/index_patterns/*"], "@kbn/inference_integration_flyout": ["x-pack/packages/ml/inference_integration_flyout"], diff --git a/x-pack/packages/index-management/README.md b/x-pack/packages/index-management/index_management_shared_types/README.md similarity index 77% rename from x-pack/packages/index-management/README.md rename to x-pack/packages/index-management/index_management_shared_types/README.md index 438a6b4393892..172f59136ada4 100644 --- a/x-pack/packages/index-management/README.md +++ b/x-pack/packages/index-management/index_management_shared_types/README.md @@ -1,3 +1,3 @@ -# @kbn/index-management +# @kbn/index-management-shared-types Contains types and functions used and exported by the index management plugin. Primarily used to avoid cyclical dependencies. diff --git a/x-pack/packages/index-management/index.ts b/x-pack/packages/index-management/index_management_shared_types/index.ts similarity index 100% rename from x-pack/packages/index-management/index.ts rename to x-pack/packages/index-management/index_management_shared_types/index.ts diff --git a/x-pack/packages/index-management/jest.config.js b/x-pack/packages/index-management/index_management_shared_types/jest.config.js similarity index 72% rename from x-pack/packages/index-management/jest.config.js rename to x-pack/packages/index-management/index_management_shared_types/jest.config.js index 0d2b7feaaf550..c9238a37a56ab 100644 --- a/x-pack/packages/index-management/jest.config.js +++ b/x-pack/packages/index-management/index_management_shared_types/jest.config.js @@ -7,6 +7,6 @@ module.exports = { preset: '@kbn/test', - rootDir: '../../..', - roots: ['/x-pack/packages/index-management'], + rootDir: '../../../..', + roots: ['/x-pack/packages/index-management/index_management_shared_types'], }; diff --git a/x-pack/packages/index-management/kibana.jsonc b/x-pack/packages/index-management/index_management_shared_types/kibana.jsonc similarity index 60% rename from x-pack/packages/index-management/kibana.jsonc rename to x-pack/packages/index-management/index_management_shared_types/kibana.jsonc index dc4e61342c6bc..ad87bb2bb4797 100644 --- a/x-pack/packages/index-management/kibana.jsonc +++ b/x-pack/packages/index-management/index_management_shared_types/kibana.jsonc @@ -1,5 +1,5 @@ { "type": "shared-common", - "id": "@kbn/index-management", + "id": "@kbn/index-management-shared-types", "owner": "@elastic/kibana-management" } diff --git a/x-pack/packages/index-management/package.json b/x-pack/packages/index-management/index_management_shared_types/package.json similarity index 62% rename from x-pack/packages/index-management/package.json rename to x-pack/packages/index-management/index_management_shared_types/package.json index c1f7664895348..be6b3a888953d 100644 --- a/x-pack/packages/index-management/package.json +++ b/x-pack/packages/index-management/index_management_shared_types/package.json @@ -1,5 +1,5 @@ { - "name": "@kbn/index-management", + "name": "@kbn/index-management-shared-types", "private": true, "version": "1.0.0", "license": "Elastic License 2.0" diff --git a/x-pack/packages/index-management/src/home_sections.ts b/x-pack/packages/index-management/index_management_shared_types/src/home_sections.ts similarity index 100% rename from x-pack/packages/index-management/src/home_sections.ts rename to x-pack/packages/index-management/index_management_shared_types/src/home_sections.ts diff --git a/x-pack/packages/index-management/src/services/extensions_service.ts b/x-pack/packages/index-management/index_management_shared_types/src/services/extensions_service.ts similarity index 100% rename from x-pack/packages/index-management/src/services/extensions_service.ts rename to x-pack/packages/index-management/index_management_shared_types/src/services/extensions_service.ts diff --git a/x-pack/packages/index-management/src/services/index.ts b/x-pack/packages/index-management/index_management_shared_types/src/services/index.ts similarity index 100% rename from x-pack/packages/index-management/src/services/index.ts rename to x-pack/packages/index-management/index_management_shared_types/src/services/index.ts diff --git a/x-pack/packages/index-management/src/services/public_api_service.ts b/x-pack/packages/index-management/index_management_shared_types/src/services/public_api_service.ts similarity index 100% rename from x-pack/packages/index-management/src/services/public_api_service.ts rename to x-pack/packages/index-management/index_management_shared_types/src/services/public_api_service.ts diff --git a/x-pack/packages/index-management/src/types.ts b/x-pack/packages/index-management/index_management_shared_types/src/types.ts similarity index 100% rename from x-pack/packages/index-management/src/types.ts rename to x-pack/packages/index-management/index_management_shared_types/src/types.ts diff --git a/x-pack/packages/index-management/tsconfig.json b/x-pack/packages/index-management/index_management_shared_types/tsconfig.json similarity index 85% rename from x-pack/packages/index-management/tsconfig.json rename to x-pack/packages/index-management/index_management_shared_types/tsconfig.json index c92c31a7ea49b..351991448dba7 100644 --- a/x-pack/packages/index-management/tsconfig.json +++ b/x-pack/packages/index-management/index_management_shared_types/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig.base.json", + "extends": "../../../../tsconfig.base.json", "compilerOptions": { "outDir": "target/types", "types": [ diff --git a/x-pack/plugins/enterprise_search/public/applications/shared/kibana/kibana_logic.ts b/x-pack/plugins/enterprise_search/public/applications/shared/kibana/kibana_logic.ts index da5209a9dc1ec..2338036ccf1e8 100644 --- a/x-pack/plugins/enterprise_search/public/applications/shared/kibana/kibana_logic.ts +++ b/x-pack/plugins/enterprise_search/public/applications/shared/kibana/kibana_logic.ts @@ -24,7 +24,7 @@ import { import { DataPublicPluginStart } from '@kbn/data-plugin/public'; import { GuidedOnboardingPluginStart } from '@kbn/guided-onboarding-plugin/public'; -import { IndexMappingProps } from '@kbn/index-management'; +import { IndexMappingProps } from '@kbn/index-management-shared-types'; import { LensPublicStart } from '@kbn/lens-plugin/public'; import { MlPluginStart } from '@kbn/ml-plugin/public'; import { ELASTICSEARCH_URL_PLACEHOLDER } from '@kbn/search-api-panels/constants'; diff --git a/x-pack/plugins/enterprise_search/public/plugin.ts b/x-pack/plugins/enterprise_search/public/plugin.ts index 2ea1c55e6e037..73dbe6885fdcc 100644 --- a/x-pack/plugins/enterprise_search/public/plugin.ts +++ b/x-pack/plugins/enterprise_search/public/plugin.ts @@ -25,7 +25,7 @@ import { DataPublicPluginStart } from '@kbn/data-plugin/public'; import { GuidedOnboardingPluginStart } from '@kbn/guided-onboarding-plugin/public'; import type { HomePublicPluginSetup } from '@kbn/home-plugin/public'; import { i18n } from '@kbn/i18n'; -import type { IndexManagementPluginStart } from '@kbn/index-management'; +import type { IndexManagementPluginStart } from '@kbn/index-management-shared-types'; import { LensPublicStart } from '@kbn/lens-plugin/public'; import { LicensingPluginStart } from '@kbn/licensing-plugin/public'; import { MlPluginStart } from '@kbn/ml-plugin/public'; diff --git a/x-pack/plugins/enterprise_search/tsconfig.json b/x-pack/plugins/enterprise_search/tsconfig.json index 58b1526e14baf..841cebf28cf46 100644 --- a/x-pack/plugins/enterprise_search/tsconfig.json +++ b/x-pack/plugins/enterprise_search/tsconfig.json @@ -72,7 +72,7 @@ "@kbn/search-playground", "@kbn/search-inference-endpoints", "@kbn/utility-types", - "@kbn/index-management", + "@kbn/index-management-shared-types", "@kbn/deeplinks-search", "@kbn/react-kibana-context-theme", "@kbn/search-types", diff --git a/x-pack/plugins/index_lifecycle_management/public/extend_index_management/components/index_lifecycle_summary.tsx b/x-pack/plugins/index_lifecycle_management/public/extend_index_management/components/index_lifecycle_summary.tsx index 1d828a758b277..ac96deaef92e4 100644 --- a/x-pack/plugins/index_lifecycle_management/public/extend_index_management/components/index_lifecycle_summary.tsx +++ b/x-pack/plugins/index_lifecycle_management/public/extend_index_management/components/index_lifecycle_summary.tsx @@ -26,7 +26,7 @@ import { import { euiThemeVars } from '@kbn/ui-theme'; import { ApplicationStart } from '@kbn/core/public'; -import { Index, IndexDetailsTab } from '@kbn/index-management'; +import { Index, IndexDetailsTab } from '@kbn/index-management-shared-types'; import { IlmExplainLifecycleLifecycleExplainManaged } from '@elastic/elasticsearch/lib/api/types'; import { Phase } from '../../../common/types'; import { getPolicyEditPath } from '../../application/services/navigation'; diff --git a/x-pack/plugins/index_lifecycle_management/tsconfig.json b/x-pack/plugins/index_lifecycle_management/tsconfig.json index a70e757e8a8e0..7c3913fcae1bd 100644 --- a/x-pack/plugins/index_lifecycle_management/tsconfig.json +++ b/x-pack/plugins/index_lifecycle_management/tsconfig.json @@ -37,7 +37,7 @@ "@kbn/shared-ux-router", "@kbn/ui-theme", "@kbn/shared-ux-link-redirect-app", - "@kbn/index-management", + "@kbn/index-management-shared-types", "@kbn/react-kibana-context-render", "@kbn/unsaved-changes-prompt", "@kbn/shared-ux-table-persist", diff --git a/x-pack/plugins/index_management/common/constants/index.ts b/x-pack/plugins/index_management/common/constants/index.ts index abb931468498c..2174985095ea5 100644 --- a/x-pack/plugins/index_management/common/constants/index.ts +++ b/x-pack/plugins/index_management/common/constants/index.ts @@ -54,6 +54,6 @@ export { export { MAJOR_VERSION } from './plugin'; -export { Section, IndexDetailsSection } from '@kbn/index-management'; -export type { IndexDetailsTab, IndexDetailsTabId } from '@kbn/index-management'; +export { Section, IndexDetailsSection } from '@kbn/index-management-shared-types'; +export type { IndexDetailsTab, IndexDetailsTabId } from '@kbn/index-management-shared-types'; export * from './allow_auto_create'; diff --git a/x-pack/plugins/index_management/common/lib/enrich_policies.ts b/x-pack/plugins/index_management/common/lib/enrich_policies.ts index fc7e15addec86..7c3d4852b5e64 100644 --- a/x-pack/plugins/index_management/common/lib/enrich_policies.ts +++ b/x-pack/plugins/index_management/common/lib/enrich_policies.ts @@ -6,7 +6,7 @@ */ import type { EnrichSummary, EnrichPolicyType } from '@elastic/elasticsearch/lib/api/types'; -import type { SerializedEnrichPolicy } from '@kbn/index-management'; +import type { SerializedEnrichPolicy } from '@kbn/index-management-shared-types'; export const getPolicyType = (policy: EnrichSummary): EnrichPolicyType => { if (policy.config.match) { diff --git a/x-pack/plugins/index_management/common/types/indices.ts b/x-pack/plugins/index_management/common/types/indices.ts index 555fe1c331ae0..612aaf3bd6c9b 100644 --- a/x-pack/plugins/index_management/common/types/indices.ts +++ b/x-pack/plugins/index_management/common/types/indices.ts @@ -5,7 +5,7 @@ * 2.0. */ -export type { Index } from '@kbn/index-management'; +export type { Index } from '@kbn/index-management-shared-types'; export interface IndexModule { number_of_shards: number | string; diff --git a/x-pack/plugins/index_management/public/application/hooks/use_index_errors.ts b/x-pack/plugins/index_management/public/application/hooks/use_index_errors.ts index 58c3a359c2dce..82f1545e3a98a 100644 --- a/x-pack/plugins/index_management/public/application/hooks/use_index_errors.ts +++ b/x-pack/plugins/index_management/public/application/hooks/use_index_errors.ts @@ -6,7 +6,7 @@ */ import { i18n } from '@kbn/i18n'; -import { Index } from '@kbn/index-management'; +import { Index } from '@kbn/index-management-shared-types'; import { MlPluginStart } from '@kbn/ml-plugin/public'; import { useState, useEffect } from 'react'; import { normalize } from '../components/mappings_editor/lib'; diff --git a/x-pack/plugins/index_management/public/application/sections/enrich_policy_create/create_policy_context.tsx b/x-pack/plugins/index_management/public/application/sections/enrich_policy_create/create_policy_context.tsx index dab8056486405..5ea137b717a0d 100644 --- a/x-pack/plugins/index_management/public/application/sections/enrich_policy_create/create_policy_context.tsx +++ b/x-pack/plugins/index_management/public/application/sections/enrich_policy_create/create_policy_context.tsx @@ -6,7 +6,7 @@ */ import React, { createContext, useContext, useState } from 'react'; -import type { SerializedEnrichPolicy } from '@kbn/index-management'; +import type { SerializedEnrichPolicy } from '@kbn/index-management-shared-types'; export type DraftPolicy = Partial; diff --git a/x-pack/plugins/index_management/public/application/sections/enrich_policy_create/create_policy_wizard.tsx b/x-pack/plugins/index_management/public/application/sections/enrich_policy_create/create_policy_wizard.tsx index ff20f78830476..ab39f06fbb410 100644 --- a/x-pack/plugins/index_management/public/application/sections/enrich_policy_create/create_policy_wizard.tsx +++ b/x-pack/plugins/index_management/public/application/sections/enrich_policy_create/create_policy_wizard.tsx @@ -9,7 +9,7 @@ import React, { useState, useMemo, useCallback } from 'react'; import { i18n } from '@kbn/i18n'; import { EuiSteps, EuiStepStatus, EuiCallOut, EuiSpacer } from '@elastic/eui'; -import type { SerializedEnrichPolicy } from '@kbn/index-management'; +import type { SerializedEnrichPolicy } from '@kbn/index-management-shared-types'; import { useAppContext } from '../../app_context'; import { ConfigurationStep, FieldSelectionStep, CreateStep } from './steps'; import { useCreatePolicyContext } from './create_policy_context'; diff --git a/x-pack/plugins/index_management/public/application/sections/enrich_policy_create/steps/create.tsx b/x-pack/plugins/index_management/public/application/sections/enrich_policy_create/steps/create.tsx index 7150e2bd29bac..a8f97d7793f50 100644 --- a/x-pack/plugins/index_management/public/application/sections/enrich_policy_create/steps/create.tsx +++ b/x-pack/plugins/index_management/public/application/sections/enrich_policy_create/steps/create.tsx @@ -21,7 +21,7 @@ import { EuiCodeBlock, } from '@elastic/eui'; -import type { SerializedEnrichPolicy } from '@kbn/index-management'; +import type { SerializedEnrichPolicy } from '@kbn/index-management-shared-types'; import { useCreatePolicyContext } from '../create_policy_context'; import { serializeAsESPolicy, getESPolicyCreationApiCall } from '../../../../../common/lib'; diff --git a/x-pack/plugins/index_management/public/application/sections/home/enrich_policies_list/details_flyout/policy_details_flyout.tsx b/x-pack/plugins/index_management/public/application/sections/home/enrich_policies_list/details_flyout/policy_details_flyout.tsx index 9fb20e33e22c8..2e8c4d9c5ef6e 100644 --- a/x-pack/plugins/index_management/public/application/sections/home/enrich_policies_list/details_flyout/policy_details_flyout.tsx +++ b/x-pack/plugins/index_management/public/application/sections/home/enrich_policies_list/details_flyout/policy_details_flyout.tsx @@ -21,7 +21,7 @@ import { EuiButtonEmpty, } from '@elastic/eui'; import { CodeEditor } from '@kbn/code-editor'; -import type { SerializedEnrichPolicy } from '@kbn/index-management'; +import type { SerializedEnrichPolicy } from '@kbn/index-management-shared-types'; export interface Props { policy: SerializedEnrichPolicy; diff --git a/x-pack/plugins/index_management/public/application/sections/home/enrich_policies_list/enrich_policies_list.tsx b/x-pack/plugins/index_management/public/application/sections/home/enrich_policies_list/enrich_policies_list.tsx index e11c0e9db87fc..a036273ebdde9 100644 --- a/x-pack/plugins/index_management/public/application/sections/home/enrich_policies_list/enrich_policies_list.tsx +++ b/x-pack/plugins/index_management/public/application/sections/home/enrich_policies_list/enrich_policies_list.tsx @@ -12,7 +12,7 @@ import { RouteComponentProps } from 'react-router-dom'; import { Location } from 'history'; import { parse } from 'query-string'; -import type { SerializedEnrichPolicy } from '@kbn/index-management'; +import type { SerializedEnrichPolicy } from '@kbn/index-management-shared-types'; import { APP_WRAPPER_CLASS, useExecutionContext } from '../../../../shared_imports'; import { useAppContext } from '../../../app_context'; import { useRedirectPath } from '../../../hooks/redirect_path'; diff --git a/x-pack/plugins/index_management/public/application/sections/home/enrich_policies_list/policies_table/policies_table.tsx b/x-pack/plugins/index_management/public/application/sections/home/enrich_policies_list/policies_table/policies_table.tsx index 4c3ec85e16ea7..e78e08b829997 100644 --- a/x-pack/plugins/index_management/public/application/sections/home/enrich_policies_list/policies_table/policies_table.tsx +++ b/x-pack/plugins/index_management/public/application/sections/home/enrich_policies_list/policies_table/policies_table.tsx @@ -16,7 +16,7 @@ import { import { i18n } from '@kbn/i18n'; import { FormattedMessage } from '@kbn/i18n-react'; import { reactRouterNavigate } from '@kbn/kibana-react-plugin/public'; -import type { SerializedEnrichPolicy } from '@kbn/index-management'; +import type { SerializedEnrichPolicy } from '@kbn/index-management-shared-types'; import { useEuiTablePersist, DEFAULT_PAGE_SIZE_OPTIONS } from '@kbn/shared-ux-table-persist'; import { useAppContext } from '../../../../app_context'; diff --git a/x-pack/plugins/index_management/public/application/sections/home/index_list/details_page/index_mapping_with_context_types.tsx b/x-pack/plugins/index_management/public/application/sections/home/index_list/details_page/index_mapping_with_context_types.tsx index 5dd264d38b80e..228f928f1ec74 100644 --- a/x-pack/plugins/index_management/public/application/sections/home/index_list/details_page/index_mapping_with_context_types.tsx +++ b/x-pack/plugins/index_management/public/application/sections/home/index_list/details_page/index_mapping_with_context_types.tsx @@ -6,7 +6,7 @@ */ import { CoreStart } from '@kbn/core/public'; -import { IndexMappingProps } from '@kbn/index-management'; +import { IndexMappingProps } from '@kbn/index-management-shared-types'; import { AppDependencies } from '../../../../app_context'; import { ExtensionsService } from '../../../../../services/extensions_service'; diff --git a/x-pack/plugins/index_management/public/application/services/api.ts b/x-pack/plugins/index_management/public/application/services/api.ts index f182ffe53ce07..08baa49713573 100644 --- a/x-pack/plugins/index_management/public/application/services/api.ts +++ b/x-pack/plugins/index_management/public/application/services/api.ts @@ -6,7 +6,7 @@ */ import { METRIC_TYPE } from '@kbn/analytics'; -import type { SerializedEnrichPolicy } from '@kbn/index-management'; +import type { SerializedEnrichPolicy } from '@kbn/index-management-shared-types'; import { IndicesStatsResponse } from '@elastic/elasticsearch/lib/api/types'; import { InferenceAPIConfigResponse } from '@kbn/ml-trained-models-utils'; import { MappingTypeMapping } from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; diff --git a/x-pack/plugins/index_management/public/index.ts b/x-pack/plugins/index_management/public/index.ts index 09adb299c711f..e49b83b892add 100644 --- a/x-pack/plugins/index_management/public/index.ts +++ b/x-pack/plugins/index_management/public/index.ts @@ -19,6 +19,6 @@ export type { IndexMappingProps, IndexManagementPluginSetup, IndexManagementPluginStart, -} from '@kbn/index-management'; +} from '@kbn/index-management-shared-types'; export { getIndexListUri, getTemplateDetailsLink } from './application/services/routing'; diff --git a/x-pack/plugins/index_management/public/plugin.ts b/x-pack/plugins/index_management/public/plugin.ts index dff4880fbc66a..49693bb0d9aa9 100644 --- a/x-pack/plugins/index_management/public/plugin.ts +++ b/x-pack/plugins/index_management/public/plugin.ts @@ -15,7 +15,10 @@ import { PluginInitializerContext, ScopedHistory, } from '@kbn/core/public'; -import { IndexManagementPluginSetup, IndexManagementPluginStart } from '@kbn/index-management'; +import { + IndexManagementPluginSetup, + IndexManagementPluginStart, +} from '@kbn/index-management-shared-types'; import { setExtensionsService } from './application/store/selectors/extension_service'; import { ExtensionsService } from './services/extensions_service'; diff --git a/x-pack/plugins/index_management/public/services/extensions_service.mock.ts b/x-pack/plugins/index_management/public/services/extensions_service.mock.ts index 072acd92f5a9d..c2f80cb4e8e95 100644 --- a/x-pack/plugins/index_management/public/services/extensions_service.mock.ts +++ b/x-pack/plugins/index_management/public/services/extensions_service.mock.ts @@ -6,7 +6,7 @@ */ import type { PublicMethodsOf } from '@kbn/utility-types'; -import { ExtensionsSetup } from '@kbn/index-management/src/services/extensions_service'; +import { ExtensionsSetup } from '@kbn/index-management-shared-types/src/services/extensions_service'; import { ExtensionsService } from './extensions_service'; export type ExtensionsSetupMock = jest.Mocked; diff --git a/x-pack/plugins/index_management/public/services/extensions_service.ts b/x-pack/plugins/index_management/public/services/extensions_service.ts index 3823ad7ed28f2..116007ba1276f 100644 --- a/x-pack/plugins/index_management/public/services/extensions_service.ts +++ b/x-pack/plugins/index_management/public/services/extensions_service.ts @@ -13,7 +13,7 @@ import { EmptyListContent, IndexContent, ExtensionsSetup, -} from '@kbn/index-management'; +} from '@kbn/index-management-shared-types'; import { IndexDetailsTab } from '../../common/constants'; export class ExtensionsService { diff --git a/x-pack/plugins/index_management/public/services/public_api_service.mock.ts b/x-pack/plugins/index_management/public/services/public_api_service.mock.ts index 567c87b914654..b78ce424cbc1a 100644 --- a/x-pack/plugins/index_management/public/services/public_api_service.mock.ts +++ b/x-pack/plugins/index_management/public/services/public_api_service.mock.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { PublicApiServiceSetup } from '@kbn/index-management/src/services/public_api_service'; +import { PublicApiServiceSetup } from '@kbn/index-management-shared-types/src/services/public_api_service'; export type PublicApiServiceSetupMock = jest.Mocked; diff --git a/x-pack/plugins/index_management/server/lib/enrich_policies.ts b/x-pack/plugins/index_management/server/lib/enrich_policies.ts index 61fa1d1467006..119a865d49661 100644 --- a/x-pack/plugins/index_management/server/lib/enrich_policies.ts +++ b/x-pack/plugins/index_management/server/lib/enrich_policies.ts @@ -7,7 +7,7 @@ import { IScopedClusterClient } from '@kbn/core/server'; import type { EnrichSummary } from '@elastic/elasticsearch/lib/api/types'; -import type { SerializedEnrichPolicy } from '@kbn/index-management'; +import type { SerializedEnrichPolicy } from '@kbn/index-management-shared-types'; import { getPolicyType } from '../../common/lib'; export const serializeEnrichmentPolicies = ( diff --git a/x-pack/plugins/index_management/server/routes/api/enrich_policies/register_create_route.ts b/x-pack/plugins/index_management/server/routes/api/enrich_policies/register_create_route.ts index 24110cc685676..bb6ef8b1fff50 100644 --- a/x-pack/plugins/index_management/server/routes/api/enrich_policies/register_create_route.ts +++ b/x-pack/plugins/index_management/server/routes/api/enrich_policies/register_create_route.ts @@ -8,7 +8,7 @@ import { IScopedClusterClient } from '@kbn/core/server'; import { schema, TypeOf } from '@kbn/config-schema'; -import type { SerializedEnrichPolicy } from '@kbn/index-management'; +import type { SerializedEnrichPolicy } from '@kbn/index-management-shared-types'; import { RouteDependencies } from '../../../types'; import { addInternalBasePath } from '..'; import { enrichPoliciesActions } from '../../../lib/enrich_policies'; diff --git a/x-pack/plugins/index_management/tsconfig.json b/x-pack/plugins/index_management/tsconfig.json index e8244c57beef5..eac67aa620973 100644 --- a/x-pack/plugins/index_management/tsconfig.json +++ b/x-pack/plugins/index_management/tsconfig.json @@ -45,7 +45,7 @@ "@kbn/monaco", "@kbn/console-plugin", "@kbn/shared-ux-utility", - "@kbn/index-management", + "@kbn/index-management-shared-types", "@kbn/utility-types", "@kbn/inference_integration_flyout", "@kbn/ml-plugin", diff --git a/x-pack/plugins/search_indices/public/hooks/api/use_index.ts b/x-pack/plugins/search_indices/public/hooks/api/use_index.ts index 65a8710589393..b872d2044ff2c 100644 --- a/x-pack/plugins/search_indices/public/hooks/api/use_index.ts +++ b/x-pack/plugins/search_indices/public/hooks/api/use_index.ts @@ -5,7 +5,7 @@ * 2.0. */ -import type { Index } from '@kbn/index-management'; +import type { Index } from '@kbn/index-management-shared-types'; import { useQuery } from '@tanstack/react-query'; import { useKibana } from '../use_kibana'; diff --git a/x-pack/plugins/search_indices/tsconfig.json b/x-pack/plugins/search_indices/tsconfig.json index c8f2397b39a55..724daa51ba9a4 100644 --- a/x-pack/plugins/search_indices/tsconfig.json +++ b/x-pack/plugins/search_indices/tsconfig.json @@ -27,7 +27,7 @@ "@kbn/share-plugin", "@kbn/kibana-utils-plugin", "@kbn/shared-ux-router", - "@kbn/index-management", + "@kbn/index-management-shared-types", "@kbn/try-in-console", "@kbn/cloud-plugin", ], diff --git a/x-pack/plugins/serverless_search/public/application/components/index_management/index_mappings_docs_link.tsx b/x-pack/plugins/serverless_search/public/application/components/index_management/index_mappings_docs_link.tsx index d75a96ba45e6f..860fe28a82298 100644 --- a/x-pack/plugins/serverless_search/public/application/components/index_management/index_mappings_docs_link.tsx +++ b/x-pack/plugins/serverless_search/public/application/components/index_management/index_mappings_docs_link.tsx @@ -18,7 +18,7 @@ import { } from '@elastic/eui'; import { FormattedMessage } from '@kbn/i18n-react'; import { CoreStart } from '@kbn/core/public'; -import { IndexContent } from '@kbn/index-management'; +import { IndexContent } from '@kbn/index-management-shared-types'; const IndexMappingsDocsLink: FunctionComponent<{ docLinks: CoreStart['docLinks'] }> = ({ docLinks, diff --git a/x-pack/plugins/serverless_search/public/application/components/index_management/index_overview_content.tsx b/x-pack/plugins/serverless_search/public/application/components/index_management/index_overview_content.tsx index c1d31dd50a20c..34b07ce39cd94 100644 --- a/x-pack/plugins/serverless_search/public/application/components/index_management/index_overview_content.tsx +++ b/x-pack/plugins/serverless_search/public/application/components/index_management/index_overview_content.tsx @@ -12,7 +12,7 @@ import { QueryClient, QueryClientProvider } from '@tanstack/react-query'; import { ReactQueryDevtools } from '@tanstack/react-query-devtools'; import { EuiLoadingSpinner } from '@elastic/eui'; -import { IndexContent } from '@kbn/index-management'; +import { IndexContent } from '@kbn/index-management-shared-types'; import { ServerlessSearchPluginStartDependencies } from '../../../types'; diff --git a/x-pack/plugins/serverless_search/tsconfig.json b/x-pack/plugins/serverless_search/tsconfig.json index c19ec3af2f4fc..642ec77cd3213 100644 --- a/x-pack/plugins/serverless_search/tsconfig.json +++ b/x-pack/plugins/serverless_search/tsconfig.json @@ -45,7 +45,7 @@ "@kbn/core-logging-server-mocks", "@kbn/discover-plugin", "@kbn/search-connectors-plugin", - "@kbn/index-management", + "@kbn/index-management-shared-types", "@kbn/react-kibana-context-render", "@kbn/search-playground", "@kbn/security-api-key-management", diff --git a/yarn.lock b/yarn.lock index 74c9e419d0b2a..999921a5f9210 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5302,7 +5302,7 @@ version "0.0.0" uid "" -"@kbn/index-management@link:x-pack/packages/index-management": +"@kbn/index-management-shared-types@link:x-pack/packages/index-management/index_management_shared_types": version "0.0.0" uid ""