From e388fa7118dd65b08f382477411781396820166e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alejandro=20Fern=C3=A1ndez=20Haro?= Date: Fri, 30 Aug 2024 16:52:57 +0200 Subject: [PATCH 1/2] [Move `@kbn/config-schema` to server] `actions` --- x-pack/plugins/actions/server/routes/connector/get/get.ts | 5 +---- .../get/transforms/transform_connector_response/v1.ts | 2 +- .../actions/server/routes/connector/get_all/get_all.ts | 2 +- .../get_all/transforms/transform_connectors_response/v1.ts | 2 +- .../server/routes/connector/get_all_system/get_all_system.ts | 2 +- .../actions/server/routes/connector/list_types/list_types.ts | 4 ++-- .../transforms/transform_list_types_response/v1.ts | 2 +- .../routes/connector/list_types_system/list_types_system.ts | 4 ++-- .../routes/connector/schemas}/apis/connector_types/index.ts | 0 .../schemas}/apis/connector_types/schemas/latest.ts | 0 .../connector/schemas}/apis/connector_types/schemas/v1.ts | 0 .../connector/schemas}/apis/connector_types/types/latest.ts | 0 .../connector/schemas}/apis/connector_types/types/v1.ts | 0 .../routes/connector/schemas}/apis/get/index.ts | 0 .../routes/connector/schemas}/apis/get/schemas/latest.ts | 0 .../routes/connector/schemas}/apis/get/schemas/v1.ts | 0 .../routes/connector/schemas}/apis/get/types/latest.ts | 0 .../routes/connector/schemas}/apis/get/types/v1.ts | 0 .../routes/connector/schemas}/response/index.ts | 0 .../routes/connector/schemas}/response/schemas/latest.ts | 0 .../routes/connector/schemas}/response/schemas/v1.ts | 0 .../routes/connector/schemas}/response/types/latest.ts | 0 .../routes/connector/schemas}/response/types/v1.ts | 0 23 files changed, 10 insertions(+), 13 deletions(-) rename x-pack/plugins/actions/{common/routes/connector => server/routes/connector/schemas}/apis/connector_types/index.ts (100%) rename x-pack/plugins/actions/{common/routes/connector => server/routes/connector/schemas}/apis/connector_types/schemas/latest.ts (100%) rename x-pack/plugins/actions/{common/routes/connector => server/routes/connector/schemas}/apis/connector_types/schemas/v1.ts (100%) rename x-pack/plugins/actions/{common/routes/connector => server/routes/connector/schemas}/apis/connector_types/types/latest.ts (100%) rename x-pack/plugins/actions/{common/routes/connector => server/routes/connector/schemas}/apis/connector_types/types/v1.ts (100%) rename x-pack/plugins/actions/{common/routes/connector => server/routes/connector/schemas}/apis/get/index.ts (100%) rename x-pack/plugins/actions/{common/routes/connector => server/routes/connector/schemas}/apis/get/schemas/latest.ts (100%) rename x-pack/plugins/actions/{common/routes/connector => server/routes/connector/schemas}/apis/get/schemas/v1.ts (100%) rename x-pack/plugins/actions/{common/routes/connector => server/routes/connector/schemas}/apis/get/types/latest.ts (100%) rename x-pack/plugins/actions/{common/routes/connector => server/routes/connector/schemas}/apis/get/types/v1.ts (100%) rename x-pack/plugins/actions/{common/routes/connector => server/routes/connector/schemas}/response/index.ts (100%) rename x-pack/plugins/actions/{common/routes/connector => server/routes/connector/schemas}/response/schemas/latest.ts (100%) rename x-pack/plugins/actions/{common/routes/connector => server/routes/connector/schemas}/response/schemas/v1.ts (100%) rename x-pack/plugins/actions/{common/routes/connector => server/routes/connector/schemas}/response/types/latest.ts (100%) rename x-pack/plugins/actions/{common/routes/connector => server/routes/connector/schemas}/response/types/v1.ts (100%) diff --git a/x-pack/plugins/actions/server/routes/connector/get/get.ts b/x-pack/plugins/actions/server/routes/connector/get/get.ts index 4519673a400f..da639cdd49b2 100644 --- a/x-pack/plugins/actions/server/routes/connector/get/get.ts +++ b/x-pack/plugins/actions/server/routes/connector/get/get.ts @@ -6,10 +6,7 @@ */ import { IRouter } from '@kbn/core/server'; -import { - getConnectorParamsSchemaV1, - GetConnectorParamsV1, -} from '../../../../common/routes/connector/apis/get'; +import { getConnectorParamsSchemaV1, GetConnectorParamsV1 } from '../schemas/apis/get'; import { transformGetConnectorResponseV1 } from './transforms'; import { ILicenseState } from '../../../lib'; import { BASE_ACTION_API_PATH } from '../../../../common'; diff --git a/x-pack/plugins/actions/server/routes/connector/get/transforms/transform_connector_response/v1.ts b/x-pack/plugins/actions/server/routes/connector/get/transforms/transform_connector_response/v1.ts index ab6f6332280d..8668ea6c0dbf 100644 --- a/x-pack/plugins/actions/server/routes/connector/get/transforms/transform_connector_response/v1.ts +++ b/x-pack/plugins/actions/server/routes/connector/get/transforms/transform_connector_response/v1.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { ConnectorResponseV1 } from '../../../../../../common/routes/connector/response'; +import { ConnectorResponseV1 } from '../../../schemas/response'; import { Connector } from '../../../../../application/connector/types'; export const transformGetConnectorResponse = ({ diff --git a/x-pack/plugins/actions/server/routes/connector/get_all/get_all.ts b/x-pack/plugins/actions/server/routes/connector/get_all/get_all.ts index 27f43a75eb15..b9554bdfcf30 100644 --- a/x-pack/plugins/actions/server/routes/connector/get_all/get_all.ts +++ b/x-pack/plugins/actions/server/routes/connector/get_all/get_all.ts @@ -6,7 +6,7 @@ */ import { IRouter } from '@kbn/core/server'; -import { AllConnectorsResponseV1 } from '../../../../common/routes/connector/response'; +import { AllConnectorsResponseV1 } from '../schemas/response'; import { transformGetAllConnectorsResponseV1 } from './transforms'; import { ActionsRequestHandlerContext } from '../../../types'; import { BASE_ACTION_API_PATH } from '../../../../common'; diff --git a/x-pack/plugins/actions/server/routes/connector/get_all/transforms/transform_connectors_response/v1.ts b/x-pack/plugins/actions/server/routes/connector/get_all/transforms/transform_connectors_response/v1.ts index a651255536ea..27493043f803 100644 --- a/x-pack/plugins/actions/server/routes/connector/get_all/transforms/transform_connectors_response/v1.ts +++ b/x-pack/plugins/actions/server/routes/connector/get_all/transforms/transform_connectors_response/v1.ts @@ -6,7 +6,7 @@ */ import { ConnectorWithExtraFindData } from '../../../../../application/connector/types'; -import { AllConnectorsResponseV1 } from '../../../../../../common/routes/connector/response'; +import { AllConnectorsResponseV1 } from '../../../schemas/response'; export const transformGetAllConnectorsResponse = ( results: ConnectorWithExtraFindData[] diff --git a/x-pack/plugins/actions/server/routes/connector/get_all_system/get_all_system.ts b/x-pack/plugins/actions/server/routes/connector/get_all_system/get_all_system.ts index 9ba51287c56f..2d1b9f09c9b6 100644 --- a/x-pack/plugins/actions/server/routes/connector/get_all_system/get_all_system.ts +++ b/x-pack/plugins/actions/server/routes/connector/get_all_system/get_all_system.ts @@ -6,7 +6,7 @@ */ import { IRouter } from '@kbn/core/server'; -import { AllConnectorsResponseV1 } from '../../../../common/routes/connector/response'; +import { AllConnectorsResponseV1 } from '../schemas/response'; import { ActionsRequestHandlerContext } from '../../../types'; import { INTERNAL_BASE_ACTION_API_PATH } from '../../../../common'; import { ILicenseState } from '../../../lib'; diff --git a/x-pack/plugins/actions/server/routes/connector/list_types/list_types.ts b/x-pack/plugins/actions/server/routes/connector/list_types/list_types.ts index 20ca0d934360..547c6f8b78f8 100644 --- a/x-pack/plugins/actions/server/routes/connector/list_types/list_types.ts +++ b/x-pack/plugins/actions/server/routes/connector/list_types/list_types.ts @@ -6,11 +6,11 @@ */ import { IRouter } from '@kbn/core/server'; -import { ConnectorTypesResponseV1 } from '../../../../common/routes/connector/response'; +import { ConnectorTypesResponseV1 } from '../schemas/response'; import { connectorTypesQuerySchemaV1, ConnectorTypesRequestQueryV1, -} from '../../../../common/routes/connector/apis/connector_types'; +} from '../schemas/apis/connector_types'; import { transformListTypesResponseV1 } from './transforms'; import { ActionsRequestHandlerContext } from '../../../types'; import { BASE_ACTION_API_PATH } from '../../../../common'; diff --git a/x-pack/plugins/actions/server/routes/connector/list_types/transforms/transform_list_types_response/v1.ts b/x-pack/plugins/actions/server/routes/connector/list_types/transforms/transform_list_types_response/v1.ts index e32bec2f9e1a..41edff6819bc 100644 --- a/x-pack/plugins/actions/server/routes/connector/list_types/transforms/transform_list_types_response/v1.ts +++ b/x-pack/plugins/actions/server/routes/connector/list_types/transforms/transform_list_types_response/v1.ts @@ -6,7 +6,7 @@ */ import { ConnectorType } from '../../../../../application/connector/types'; -import { ConnectorTypesResponseV1 } from '../../../../../../common/routes/connector/response'; +import { ConnectorTypesResponseV1 } from '../../../schemas/response'; export const transformListTypesResponse = ( results: ConnectorType[] diff --git a/x-pack/plugins/actions/server/routes/connector/list_types_system/list_types_system.ts b/x-pack/plugins/actions/server/routes/connector/list_types_system/list_types_system.ts index 6611830f6a3c..2720dbbef4cb 100644 --- a/x-pack/plugins/actions/server/routes/connector/list_types_system/list_types_system.ts +++ b/x-pack/plugins/actions/server/routes/connector/list_types_system/list_types_system.ts @@ -6,11 +6,11 @@ */ import { IRouter } from '@kbn/core/server'; -import { ConnectorTypesResponseV1 } from '../../../../common/routes/connector/response'; +import { ConnectorTypesResponseV1 } from '../schemas/response'; import { connectorTypesQuerySchemaV1, ConnectorTypesRequestQueryV1, -} from '../../../../common/routes/connector/apis/connector_types'; +} from '../schemas/apis/connector_types'; import { ActionsRequestHandlerContext } from '../../../types'; import { INTERNAL_BASE_ACTION_API_PATH } from '../../../../common'; import { ILicenseState } from '../../../lib'; diff --git a/x-pack/plugins/actions/common/routes/connector/apis/connector_types/index.ts b/x-pack/plugins/actions/server/routes/connector/schemas/apis/connector_types/index.ts similarity index 100% rename from x-pack/plugins/actions/common/routes/connector/apis/connector_types/index.ts rename to x-pack/plugins/actions/server/routes/connector/schemas/apis/connector_types/index.ts diff --git a/x-pack/plugins/actions/common/routes/connector/apis/connector_types/schemas/latest.ts b/x-pack/plugins/actions/server/routes/connector/schemas/apis/connector_types/schemas/latest.ts similarity index 100% rename from x-pack/plugins/actions/common/routes/connector/apis/connector_types/schemas/latest.ts rename to x-pack/plugins/actions/server/routes/connector/schemas/apis/connector_types/schemas/latest.ts diff --git a/x-pack/plugins/actions/common/routes/connector/apis/connector_types/schemas/v1.ts b/x-pack/plugins/actions/server/routes/connector/schemas/apis/connector_types/schemas/v1.ts similarity index 100% rename from x-pack/plugins/actions/common/routes/connector/apis/connector_types/schemas/v1.ts rename to x-pack/plugins/actions/server/routes/connector/schemas/apis/connector_types/schemas/v1.ts diff --git a/x-pack/plugins/actions/common/routes/connector/apis/connector_types/types/latest.ts b/x-pack/plugins/actions/server/routes/connector/schemas/apis/connector_types/types/latest.ts similarity index 100% rename from x-pack/plugins/actions/common/routes/connector/apis/connector_types/types/latest.ts rename to x-pack/plugins/actions/server/routes/connector/schemas/apis/connector_types/types/latest.ts diff --git a/x-pack/plugins/actions/common/routes/connector/apis/connector_types/types/v1.ts b/x-pack/plugins/actions/server/routes/connector/schemas/apis/connector_types/types/v1.ts similarity index 100% rename from x-pack/plugins/actions/common/routes/connector/apis/connector_types/types/v1.ts rename to x-pack/plugins/actions/server/routes/connector/schemas/apis/connector_types/types/v1.ts diff --git a/x-pack/plugins/actions/common/routes/connector/apis/get/index.ts b/x-pack/plugins/actions/server/routes/connector/schemas/apis/get/index.ts similarity index 100% rename from x-pack/plugins/actions/common/routes/connector/apis/get/index.ts rename to x-pack/plugins/actions/server/routes/connector/schemas/apis/get/index.ts diff --git a/x-pack/plugins/actions/common/routes/connector/apis/get/schemas/latest.ts b/x-pack/plugins/actions/server/routes/connector/schemas/apis/get/schemas/latest.ts similarity index 100% rename from x-pack/plugins/actions/common/routes/connector/apis/get/schemas/latest.ts rename to x-pack/plugins/actions/server/routes/connector/schemas/apis/get/schemas/latest.ts diff --git a/x-pack/plugins/actions/common/routes/connector/apis/get/schemas/v1.ts b/x-pack/plugins/actions/server/routes/connector/schemas/apis/get/schemas/v1.ts similarity index 100% rename from x-pack/plugins/actions/common/routes/connector/apis/get/schemas/v1.ts rename to x-pack/plugins/actions/server/routes/connector/schemas/apis/get/schemas/v1.ts diff --git a/x-pack/plugins/actions/common/routes/connector/apis/get/types/latest.ts b/x-pack/plugins/actions/server/routes/connector/schemas/apis/get/types/latest.ts similarity index 100% rename from x-pack/plugins/actions/common/routes/connector/apis/get/types/latest.ts rename to x-pack/plugins/actions/server/routes/connector/schemas/apis/get/types/latest.ts diff --git a/x-pack/plugins/actions/common/routes/connector/apis/get/types/v1.ts b/x-pack/plugins/actions/server/routes/connector/schemas/apis/get/types/v1.ts similarity index 100% rename from x-pack/plugins/actions/common/routes/connector/apis/get/types/v1.ts rename to x-pack/plugins/actions/server/routes/connector/schemas/apis/get/types/v1.ts diff --git a/x-pack/plugins/actions/common/routes/connector/response/index.ts b/x-pack/plugins/actions/server/routes/connector/schemas/response/index.ts similarity index 100% rename from x-pack/plugins/actions/common/routes/connector/response/index.ts rename to x-pack/plugins/actions/server/routes/connector/schemas/response/index.ts diff --git a/x-pack/plugins/actions/common/routes/connector/response/schemas/latest.ts b/x-pack/plugins/actions/server/routes/connector/schemas/response/schemas/latest.ts similarity index 100% rename from x-pack/plugins/actions/common/routes/connector/response/schemas/latest.ts rename to x-pack/plugins/actions/server/routes/connector/schemas/response/schemas/latest.ts diff --git a/x-pack/plugins/actions/common/routes/connector/response/schemas/v1.ts b/x-pack/plugins/actions/server/routes/connector/schemas/response/schemas/v1.ts similarity index 100% rename from x-pack/plugins/actions/common/routes/connector/response/schemas/v1.ts rename to x-pack/plugins/actions/server/routes/connector/schemas/response/schemas/v1.ts diff --git a/x-pack/plugins/actions/common/routes/connector/response/types/latest.ts b/x-pack/plugins/actions/server/routes/connector/schemas/response/types/latest.ts similarity index 100% rename from x-pack/plugins/actions/common/routes/connector/response/types/latest.ts rename to x-pack/plugins/actions/server/routes/connector/schemas/response/types/latest.ts diff --git a/x-pack/plugins/actions/common/routes/connector/response/types/v1.ts b/x-pack/plugins/actions/server/routes/connector/schemas/response/types/v1.ts similarity index 100% rename from x-pack/plugins/actions/common/routes/connector/response/types/v1.ts rename to x-pack/plugins/actions/server/routes/connector/schemas/response/types/v1.ts From a6070b2e75540a9ff4164840a9d6a0aca8407975 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alejandro=20Fern=C3=A1ndez=20Haro?= Date: Fri, 30 Aug 2024 19:12:34 +0200 Subject: [PATCH 2/2] Fix imports --- .../scripts/endpoint/common/connectors_services.ts | 2 +- .../security_solution_cypress/cypress/tasks/api_calls/common.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/x-pack/plugins/security_solution/scripts/endpoint/common/connectors_services.ts b/x-pack/plugins/security_solution/scripts/endpoint/common/connectors_services.ts index 3fb2971f1236..8dd98630098c 100644 --- a/x-pack/plugins/security_solution/scripts/endpoint/common/connectors_services.ts +++ b/x-pack/plugins/security_solution/scripts/endpoint/common/connectors_services.ts @@ -6,7 +6,7 @@ */ import type { KbnClient } from '@kbn/test'; -import type { AllConnectorsResponseV1 } from '@kbn/actions-plugin/common/routes/connector/response'; +import type { AllConnectorsResponseV1 } from '@kbn/actions-plugin/server/routes/connector/schemas/response'; import type { bodySchema } from '@kbn/actions-plugin/server/routes/create'; import type { TypeOf } from '@kbn/config-schema'; import type { Connector } from '@kbn/actions-plugin/server/application/connector/types'; diff --git a/x-pack/test/security_solution_cypress/cypress/tasks/api_calls/common.ts b/x-pack/test/security_solution_cypress/cypress/tasks/api_calls/common.ts index 7c78858070a2..304d71fc7880 100644 --- a/x-pack/test/security_solution_cypress/cypress/tasks/api_calls/common.ts +++ b/x-pack/test/security_solution_cypress/cypress/tasks/api_calls/common.ts @@ -7,7 +7,7 @@ import { DATA_VIEW_PATH, INITIAL_REST_VERSION } from '@kbn/data-views-plugin/server/constants'; import { ELASTIC_HTTP_VERSION_HEADER } from '@kbn/core-http-common'; -import { AllConnectorsResponse } from '@kbn/actions-plugin/common/routes/connector/response'; +import type { AllConnectorsResponse } from '@kbn/actions-plugin/server/routes/connector/schemas/response'; import { DETECTION_ENGINE_RULES_BULK_ACTION } from '@kbn/security-solution-plugin/common/constants'; import { ELASTICSEARCH_PASSWORD, ELASTICSEARCH_USERNAME } from '../../env_var_names_constants'; import { deleteAllDocuments } from './elasticsearch';