From 1c937dbfdf724477af903ca5f9aeb49af7282083 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alejandro=20Fern=C3=A1ndez=20Haro?= Date: Thu, 29 Aug 2024 01:27:03 +0200 Subject: [PATCH] [Move `@kbn/config-schema` to server] `transform` --- x-pack/plugins/transform/common/types/transform.ts | 5 ++++- x-pack/plugins/transform/public/app/app.tsx | 2 +- .../transform/public/app/common/data_grid.ts | 2 +- .../plugins/transform/public/app/common/request.ts | 14 +++++++------- .../transform/public/app/common/transform_stats.ts | 8 ++++---- .../public/app/hooks/use_create_transform.tsx | 2 +- .../public/app/hooks/use_delete_transform.tsx | 4 ++-- .../app/hooks/use_get_histograms_for_fields.ts | 4 ++-- .../public/app/hooks/use_get_transform.tsx | 2 +- .../app/hooks/use_get_transform_audit_messages.ts | 2 +- .../public/app/hooks/use_get_transform_nodes.ts | 2 +- .../public/app/hooks/use_get_transform_stats.ts | 2 +- .../public/app/hooks/use_get_transforms.ts | 2 +- .../public/app/hooks/use_get_transforms_preview.ts | 2 +- .../public/app/hooks/use_reauthorize_transform.tsx | 6 +++--- .../public/app/hooks/use_reset_transform.tsx | 2 +- .../app/hooks/use_schedule_now_transform.tsx | 4 ++-- .../public/app/hooks/use_start_transform.tsx | 4 ++-- .../public/app/hooks/use_stop_transform.tsx | 4 ++-- .../public/app/hooks/use_transform_config_data.ts | 2 +- .../public/app/hooks/use_update_transform.ts | 2 +- .../public/app/mount_management_section.ts | 2 +- .../components/step_create/step_create_form.tsx | 8 ++++---- .../components/step_define/common/types.ts | 2 +- .../step_define/hooks/use_advanced_pivot_editor.ts | 2 +- .../hooks/use_advanced_source_editor.ts | 2 +- .../hooks/use_latest_function_config.ts | 2 +- .../components/edit_transform_retention_policy.tsx | 2 +- .../apply_form_state_to_transform_config.ts | 2 +- .../state_management/get_update_value.ts | 2 +- .../transform/public/app/serverless_context.tsx | 2 +- x-pack/plugins/transform/public/plugin.ts | 2 +- .../plugins/transform/{common => server}/config.ts | 0 x-pack/plugins/transform/server/index.ts | 2 +- .../routes/api/audit_messages/register_route.ts | 8 ++++---- .../routes/api/audit_messages/route_handler.ts | 2 +- .../api/delete_transforms/delete_transforms.ts | 4 ++-- .../routes/api/delete_transforms/register_route.ts | 2 +- .../api/delete_transforms/route_handler_factory.ts | 2 +- .../routes/api/field_histograms/register_route.ts | 9 ++++----- .../routes/api/field_histograms/route_handler.ts | 4 ++-- .../reauthorize_and_start_transforms.ts | 4 ++-- .../api/reauthorize_transforms/register_route.ts | 4 ++-- .../route_handler_factory.ts | 2 +- .../routes/api/reset_transforms/register_route.ts | 2 +- .../api/reset_transforms/reset_transforms.ts | 6 +++--- .../routes/api/reset_transforms/route_handler.ts | 2 +- .../api/schedule_now_transforms/register_route.ts | 2 +- .../api/schedule_now_transforms/route_handler.ts | 2 +- .../schedule_now_transforms.ts | 4 ++-- .../routes/api/start_transforms/register_route.ts | 2 +- .../routes/api/start_transforms/route_handler.ts | 2 +- .../api/start_transforms/start_transforms.ts | 4 ++-- .../routes/api/stop_transforms/register_route.ts | 2 +- .../routes/api/stop_transforms/route_handler.ts | 2 +- .../routes/api/stop_transforms/stop_transforms.ts | 6 +++--- .../routes/api/transforms_create/register_route.ts | 7 ++----- .../api/transforms_create/route_handler_factory.ts | 4 ++-- .../api/transforms_preview/register_route.ts | 4 ++-- .../routes/api/transforms_preview/route_handler.ts | 2 +- .../routes/api/transforms_single/register_route.ts | 5 +---- .../routes/api/transforms_single/route_handler.ts | 2 +- .../api/transforms_stats_all/register_route.ts | 2 +- .../api/transforms_stats_all/route_handler.ts | 2 +- .../api/transforms_stats_single/register_route.ts | 7 ++----- .../api/transforms_stats_single/route_handler.ts | 4 ++-- .../routes/api/transforms_update/register_route.ts | 7 ++----- .../routes/api/transforms_update/route_handler.ts | 4 ++-- .../routes}/api_schemas/audit_messages.ts | 2 +- .../routes}/api_schemas/common.ts | 2 +- .../routes}/api_schemas/delete_transforms.ts | 0 .../routes}/api_schemas/field_histograms.ts | 0 .../routes}/api_schemas/reauthorize_transforms.ts | 0 .../routes}/api_schemas/reset_transforms.ts | 0 .../routes}/api_schemas/schedule_now_transforms.ts | 0 .../routes}/api_schemas/start_transforms.ts | 0 .../routes}/api_schemas/stop_transforms.ts | 0 .../routes}/api_schemas/transforms.ts | 8 ++++---- .../routes}/api_schemas/transforms_stats.ts | 2 +- .../routes}/api_schemas/update_transforms.ts | 2 +- .../transform/server/routes/utils/error_utils.ts | 9 +++------ .../transform_rule_types/transform_health/rule.ts | 2 +- .../test/api_integration/apis/transform/common.ts | 2 +- .../apis/transform/delete_transforms.ts | 2 +- .../apis/transform/reauthorize_transforms.ts | 2 +- .../apis/transform/reset_transforms.ts | 2 +- .../apis/transform/schedule_now_transforms.ts | 2 +- .../apis/transform/start_transforms.ts | 2 +- .../apis/transform/stop_transforms.ts | 4 ++-- .../api_integration/apis/transform/transforms.ts | 2 +- .../apis/transform/transforms_nodes.ts | 2 +- .../apis/transform/transforms_preview.ts | 2 +- .../apis/transform/transforms_stats.ts | 2 +- x-pack/test/functional/services/transform/api.ts | 6 +++--- .../api_integration/services/transform/api.ts | 6 +++--- .../test_suites/observability/slos/create_slo.ts | 2 +- 96 files changed, 143 insertions(+), 156 deletions(-) rename x-pack/plugins/transform/{common => server}/config.ts (100%) rename x-pack/plugins/transform/{common => server/routes}/api_schemas/audit_messages.ts (91%) rename x-pack/plugins/transform/{common => server/routes}/api_schemas/common.ts (97%) rename x-pack/plugins/transform/{common => server/routes}/api_schemas/delete_transforms.ts (100%) rename x-pack/plugins/transform/{common => server/routes}/api_schemas/field_histograms.ts (100%) rename x-pack/plugins/transform/{common => server/routes}/api_schemas/reauthorize_transforms.ts (100%) rename x-pack/plugins/transform/{common => server/routes}/api_schemas/reset_transforms.ts (100%) rename x-pack/plugins/transform/{common => server/routes}/api_schemas/schedule_now_transforms.ts (100%) rename x-pack/plugins/transform/{common => server/routes}/api_schemas/start_transforms.ts (100%) rename x-pack/plugins/transform/{common => server/routes}/api_schemas/stop_transforms.ts (100%) rename x-pack/plugins/transform/{common => server/routes}/api_schemas/transforms.ts (95%) rename x-pack/plugins/transform/{common => server/routes}/api_schemas/transforms_stats.ts (92%) rename x-pack/plugins/transform/{common => server/routes}/api_schemas/update_transforms.ts (94%) diff --git a/x-pack/plugins/transform/common/types/transform.ts b/x-pack/plugins/transform/common/types/transform.ts index 2e244e69b70f..913b1541f261 100644 --- a/x-pack/plugins/transform/common/types/transform.ts +++ b/x-pack/plugins/transform/common/types/transform.ts @@ -7,7 +7,10 @@ import type { EuiComboBoxOptionOption } from '@elastic/eui/src/components/combo_box/types'; import { isPopulatedObject } from '@kbn/ml-is-populated-object'; -import type { LatestFunctionConfig, PutTransformsRequestSchema } from '../api_schemas/transforms'; +import type { + LatestFunctionConfig, + PutTransformsRequestSchema, +} from '../../server/routes/api_schemas/transforms'; import type { PivotGroupByDict } from './pivot_group_by'; import type { PivotAggDict } from './pivot_aggs'; import type { TransformHealthAlertRule } from './alerting'; diff --git a/x-pack/plugins/transform/public/app/app.tsx b/x-pack/plugins/transform/public/app/app.tsx index c6481f744042..d2d7af9e69b8 100644 --- a/x-pack/plugins/transform/public/app/app.tsx +++ b/x-pack/plugins/transform/public/app/app.tsx @@ -14,7 +14,7 @@ import type { ScopedHistory } from '@kbn/core/public'; import { KibanaContextProvider } from '@kbn/kibana-react-plugin/public'; import { KibanaRenderContextProvider } from '@kbn/react-kibana-context-render'; -import type { ExperimentalFeatures } from '../../common/config'; +import type { ExperimentalFeatures } from '../../server/config'; import { SECTION_SLUG } from './common/constants'; import type { AppDependencies } from './app_dependencies'; import { CloneTransformSection } from './sections/clone_transform'; diff --git a/x-pack/plugins/transform/public/app/common/data_grid.ts b/x-pack/plugins/transform/public/app/common/data_grid.ts index cb7c048e765f..9030b4df6ea5 100644 --- a/x-pack/plugins/transform/public/app/common/data_grid.ts +++ b/x-pack/plugins/transform/public/app/common/data_grid.ts @@ -5,7 +5,7 @@ * 2.0. */ -import type { PostTransformsPreviewRequestSchema } from '../../../common/api_schemas/transforms'; +import type { PostTransformsPreviewRequestSchema } from '../../../server/routes/api_schemas/transforms'; import type { TransformConfigQuery } from './request'; diff --git a/x-pack/plugins/transform/public/app/common/request.ts b/x-pack/plugins/transform/public/app/common/request.ts index 432574270cb8..6d854d5c4e07 100644 --- a/x-pack/plugins/transform/public/app/common/request.ts +++ b/x-pack/plugins/transform/public/app/common/request.ts @@ -14,19 +14,19 @@ import { type SavedSearchQuery, } from '@kbn/ml-query-utils'; -import { - DEFAULT_CONTINUOUS_MODE_DELAY, - DEFAULT_TRANSFORM_FREQUENCY, - DEFAULT_TRANSFORM_SETTINGS_DOCS_PER_SECOND, - DEFAULT_TRANSFORM_SETTINGS_MAX_PAGE_SEARCH_SIZE, -} from '../../../common/constants'; import type { PivotTransformPreviewRequestSchema, PostTransformsPreviewRequestSchema, PutTransformsLatestRequestSchema, PutTransformsPivotRequestSchema, PutTransformsRequestSchema, -} from '../../../common/api_schemas/transforms'; +} from '../../../server/routes/api_schemas/transforms'; +import { + DEFAULT_CONTINUOUS_MODE_DELAY, + DEFAULT_TRANSFORM_FREQUENCY, + DEFAULT_TRANSFORM_SETTINGS_DOCS_PER_SECOND, + DEFAULT_TRANSFORM_SETTINGS_MAX_PAGE_SEARCH_SIZE, +} from '../../../common/constants'; import type { DateHistogramAgg, HistogramAgg, diff --git a/x-pack/plugins/transform/public/app/common/transform_stats.ts b/x-pack/plugins/transform/public/app/common/transform_stats.ts index 71103ad71f61..901a87ca03d6 100644 --- a/x-pack/plugins/transform/public/app/common/transform_stats.ts +++ b/x-pack/plugins/transform/public/app/common/transform_stats.ts @@ -5,13 +5,13 @@ * 2.0. */ -import { TRANSFORM_STATE } from '../../../common/constants'; - -import type { TransformListRow } from './transform_list'; import type { PutTransformsLatestRequestSchema, PutTransformsPivotRequestSchema, -} from '../../../common/api_schemas/transforms'; +} from '../../../server/routes/api_schemas/transforms'; +import { TRANSFORM_STATE } from '../../../common/constants'; + +import type { TransformListRow } from './transform_list'; type TransformItem = Omit & { config: diff --git a/x-pack/plugins/transform/public/app/hooks/use_create_transform.tsx b/x-pack/plugins/transform/public/app/hooks/use_create_transform.tsx index 53682db36c02..d943a7797ddf 100644 --- a/x-pack/plugins/transform/public/app/hooks/use_create_transform.tsx +++ b/x-pack/plugins/transform/public/app/hooks/use_create_transform.tsx @@ -14,7 +14,7 @@ import { toMountPoint } from '@kbn/react-kibana-mount'; import type { PutTransformsRequestSchema, PutTransformsResponseSchema, -} from '../../../common/api_schemas/transforms'; +} from '../../../server/routes/api_schemas/transforms'; import { addInternalBasePath } from '../../../common/constants'; import type { TransformId } from '../../../common/types/transform'; import { getErrorMessage } from '../../../common/utils/errors'; diff --git a/x-pack/plugins/transform/public/app/hooks/use_delete_transform.tsx b/x-pack/plugins/transform/public/app/hooks/use_delete_transform.tsx index 3a933dcc9e93..1f3dfd80a254 100644 --- a/x-pack/plugins/transform/public/app/hooks/use_delete_transform.tsx +++ b/x-pack/plugins/transform/public/app/hooks/use_delete_transform.tsx @@ -12,11 +12,11 @@ import { i18n } from '@kbn/i18n'; import { toMountPoint } from '@kbn/react-kibana-mount'; import { extractErrorMessage } from '@kbn/ml-error-utils'; -import { addInternalBasePath } from '../../../common/constants'; import type { DeleteTransformsRequestSchema, DeleteTransformsResponseSchema, -} from '../../../common/api_schemas/delete_transforms'; +} from '../../../server/routes/api_schemas/delete_transforms'; +import { addInternalBasePath } from '../../../common/constants'; import { getErrorMessage } from '../../../common/utils/errors'; import { useAppDependencies, useToastNotifications } from '../app_dependencies'; diff --git a/x-pack/plugins/transform/public/app/hooks/use_get_histograms_for_fields.ts b/x-pack/plugins/transform/public/app/hooks/use_get_histograms_for_fields.ts index 5ed81888f493..5d354aa1c7dc 100644 --- a/x-pack/plugins/transform/public/app/hooks/use_get_histograms_for_fields.ts +++ b/x-pack/plugins/transform/public/app/hooks/use_get_histograms_for_fields.ts @@ -12,11 +12,11 @@ import type { KBN_FIELD_TYPES } from '@kbn/field-types'; import { DEFAULT_SAMPLER_SHARD_SIZE } from '@kbn/ml-agg-utils'; import type { SavedSearchQuery } from '@kbn/ml-query-utils'; -import { addInternalBasePath, TRANSFORM_REACT_QUERY_KEYS } from '../../../common/constants'; import type { FieldHistogramsRequestSchema, FieldHistogramsResponseSchema, -} from '../../../common/api_schemas/field_histograms'; +} from '../../../server/routes/api_schemas/field_histograms'; +import { addInternalBasePath, TRANSFORM_REACT_QUERY_KEYS } from '../../../common/constants'; import { useAppDependencies } from '../app_dependencies'; diff --git a/x-pack/plugins/transform/public/app/hooks/use_get_transform.tsx b/x-pack/plugins/transform/public/app/hooks/use_get_transform.tsx index b9e3d977c71b..56ffda74f122 100644 --- a/x-pack/plugins/transform/public/app/hooks/use_get_transform.tsx +++ b/x-pack/plugins/transform/public/app/hooks/use_get_transform.tsx @@ -9,7 +9,7 @@ import { useQuery } from '@tanstack/react-query'; import type { IHttpFetchError } from '@kbn/core-http-browser'; -import type { GetTransformsResponseSchema } from '../../../common/api_schemas/transforms'; +import type { GetTransformsResponseSchema } from '../../../server/routes/api_schemas/transforms'; import { addInternalBasePath, TRANSFORM_REACT_QUERY_KEYS } from '../../../common/constants'; import type { TransformId } from '../../../common/types/transform'; diff --git a/x-pack/plugins/transform/public/app/hooks/use_get_transform_audit_messages.ts b/x-pack/plugins/transform/public/app/hooks/use_get_transform_audit_messages.ts index 5332c0390e2a..2c25af1ebcbe 100644 --- a/x-pack/plugins/transform/public/app/hooks/use_get_transform_audit_messages.ts +++ b/x-pack/plugins/transform/public/app/hooks/use_get_transform_audit_messages.ts @@ -9,7 +9,7 @@ import { useQuery } from '@tanstack/react-query'; import type { IHttpFetchError } from '@kbn/core-http-browser'; -import type { GetTransformsAuditMessagesResponseSchema } from '../../../common/api_schemas/audit_messages'; +import type { GetTransformsAuditMessagesResponseSchema } from '../../../server/routes/api_schemas/audit_messages'; import { addInternalBasePath, TRANSFORM_REACT_QUERY_KEYS } from '../../../common/constants'; import type { TransformMessage } from '../../../common/types/messages'; diff --git a/x-pack/plugins/transform/public/app/hooks/use_get_transform_nodes.ts b/x-pack/plugins/transform/public/app/hooks/use_get_transform_nodes.ts index 60b31f9187fd..08a400b1cfd7 100644 --- a/x-pack/plugins/transform/public/app/hooks/use_get_transform_nodes.ts +++ b/x-pack/plugins/transform/public/app/hooks/use_get_transform_nodes.ts @@ -9,7 +9,7 @@ import { useQuery } from '@tanstack/react-query'; import type { IHttpFetchError } from '@kbn/core-http-browser'; -import type { GetTransformNodesResponseSchema } from '../../../common/api_schemas/transforms'; +import type { GetTransformNodesResponseSchema } from '../../../server/routes/api_schemas/transforms'; import { addInternalBasePath, DEFAULT_REFRESH_INTERVAL_MS, diff --git a/x-pack/plugins/transform/public/app/hooks/use_get_transform_stats.ts b/x-pack/plugins/transform/public/app/hooks/use_get_transform_stats.ts index 9fa98429394a..400ac5d295f7 100644 --- a/x-pack/plugins/transform/public/app/hooks/use_get_transform_stats.ts +++ b/x-pack/plugins/transform/public/app/hooks/use_get_transform_stats.ts @@ -9,7 +9,7 @@ import { useQuery } from '@tanstack/react-query'; import type { IHttpFetchError } from '@kbn/core-http-browser'; -import type { GetTransformsStatsResponseSchema } from '../../../common/api_schemas/transforms_stats'; +import type { GetTransformsStatsResponseSchema } from '../../../server/routes/api_schemas/transforms_stats'; import { addInternalBasePath, TRANSFORM_REACT_QUERY_KEYS } from '../../../common/constants'; import type { TransformId } from '../../../common/types/transform'; diff --git a/x-pack/plugins/transform/public/app/hooks/use_get_transforms.ts b/x-pack/plugins/transform/public/app/hooks/use_get_transforms.ts index f4afb03c4e4c..51c46a2562db 100644 --- a/x-pack/plugins/transform/public/app/hooks/use_get_transforms.ts +++ b/x-pack/plugins/transform/public/app/hooks/use_get_transforms.ts @@ -10,7 +10,7 @@ import { useQuery } from '@tanstack/react-query'; import type { IHttpFetchError } from '@kbn/core-http-browser'; import { isDefined } from '@kbn/ml-is-defined'; -import type { GetTransformsResponseSchema } from '../../../common/api_schemas/transforms'; +import type { GetTransformsResponseSchema } from '../../../server/routes/api_schemas/transforms'; import { addInternalBasePath, DEFAULT_REFRESH_INTERVAL_MS, diff --git a/x-pack/plugins/transform/public/app/hooks/use_get_transforms_preview.ts b/x-pack/plugins/transform/public/app/hooks/use_get_transforms_preview.ts index ae671912b926..fea299fe26d9 100644 --- a/x-pack/plugins/transform/public/app/hooks/use_get_transforms_preview.ts +++ b/x-pack/plugins/transform/public/app/hooks/use_get_transforms_preview.ts @@ -12,7 +12,7 @@ import type { IHttpFetchError } from '@kbn/core-http-browser'; import type { PostTransformsPreviewRequestSchema, PostTransformsPreviewResponseSchema, -} from '../../../common/api_schemas/transforms'; +} from '../../../server/routes/api_schemas/transforms'; import { addInternalBasePath, TRANSFORM_REACT_QUERY_KEYS } from '../../../common/constants'; import { useAppDependencies } from '../app_dependencies'; diff --git a/x-pack/plugins/transform/public/app/hooks/use_reauthorize_transform.tsx b/x-pack/plugins/transform/public/app/hooks/use_reauthorize_transform.tsx index 65d98bbea014..8d412d9b72a2 100644 --- a/x-pack/plugins/transform/public/app/hooks/use_reauthorize_transform.tsx +++ b/x-pack/plugins/transform/public/app/hooks/use_reauthorize_transform.tsx @@ -12,12 +12,12 @@ import { i18n } from '@kbn/i18n'; import { toMountPoint } from '@kbn/react-kibana-mount'; -import { addInternalBasePath } from '../../../common/constants'; -import { getErrorMessage } from '../../../common/utils/errors'; import type { ReauthorizeTransformsRequestSchema, ReauthorizeTransformsResponseSchema, -} from '../../../common/api_schemas/reauthorize_transforms'; +} from '../../../server/routes/api_schemas/reauthorize_transforms'; +import { addInternalBasePath } from '../../../common/constants'; +import { getErrorMessage } from '../../../common/utils/errors'; import { useAppDependencies, useToastNotifications } from '../app_dependencies'; import { ToastNotificationText } from '../components'; diff --git a/x-pack/plugins/transform/public/app/hooks/use_reset_transform.tsx b/x-pack/plugins/transform/public/app/hooks/use_reset_transform.tsx index 212cb2e9b629..b2991b16dfdd 100644 --- a/x-pack/plugins/transform/public/app/hooks/use_reset_transform.tsx +++ b/x-pack/plugins/transform/public/app/hooks/use_reset_transform.tsx @@ -14,7 +14,7 @@ import { toMountPoint } from '@kbn/react-kibana-mount'; import type { ResetTransformsRequestSchema, ResetTransformsResponseSchema, -} from '../../../common/api_schemas/reset_transforms'; +} from '../../../server/routes/api_schemas/reset_transforms'; import { addInternalBasePath } from '../../../common/constants'; import { getErrorMessage } from '../../../common/utils/errors'; diff --git a/x-pack/plugins/transform/public/app/hooks/use_schedule_now_transform.tsx b/x-pack/plugins/transform/public/app/hooks/use_schedule_now_transform.tsx index 8511c2092e4c..3cf175cba996 100644 --- a/x-pack/plugins/transform/public/app/hooks/use_schedule_now_transform.tsx +++ b/x-pack/plugins/transform/public/app/hooks/use_schedule_now_transform.tsx @@ -11,11 +11,11 @@ import { useMutation } from '@tanstack/react-query'; import { i18n } from '@kbn/i18n'; import { toMountPoint } from '@kbn/react-kibana-mount'; -import { addInternalBasePath } from '../../../common/constants'; import type { ScheduleNowTransformsRequestSchema, ScheduleNowTransformsResponseSchema, -} from '../../../common/api_schemas/schedule_now_transforms'; +} from '../../../server/routes/api_schemas/schedule_now_transforms'; +import { addInternalBasePath } from '../../../common/constants'; import { getErrorMessage } from '../../../common/utils/errors'; import { useAppDependencies, useToastNotifications } from '../app_dependencies'; diff --git a/x-pack/plugins/transform/public/app/hooks/use_start_transform.tsx b/x-pack/plugins/transform/public/app/hooks/use_start_transform.tsx index 73790b09f3b1..592518b5b84c 100644 --- a/x-pack/plugins/transform/public/app/hooks/use_start_transform.tsx +++ b/x-pack/plugins/transform/public/app/hooks/use_start_transform.tsx @@ -11,11 +11,11 @@ import { useMutation } from '@tanstack/react-query'; import { i18n } from '@kbn/i18n'; import { toMountPoint } from '@kbn/react-kibana-mount'; -import { addInternalBasePath } from '../../../common/constants'; import type { StartTransformsRequestSchema, StartTransformsResponseSchema, -} from '../../../common/api_schemas/start_transforms'; +} from '../../../server/routes/api_schemas/start_transforms'; +import { addInternalBasePath } from '../../../common/constants'; import { getErrorMessage } from '../../../common/utils/errors'; import { useAppDependencies, useToastNotifications } from '../app_dependencies'; diff --git a/x-pack/plugins/transform/public/app/hooks/use_stop_transform.tsx b/x-pack/plugins/transform/public/app/hooks/use_stop_transform.tsx index 29939d9fcef7..80290b2774e4 100644 --- a/x-pack/plugins/transform/public/app/hooks/use_stop_transform.tsx +++ b/x-pack/plugins/transform/public/app/hooks/use_stop_transform.tsx @@ -12,11 +12,11 @@ import { i18n } from '@kbn/i18n'; import { toMountPoint } from '@kbn/react-kibana-mount'; -import { addInternalBasePath } from '../../../common/constants'; import type { StopTransformsRequestSchema, StopTransformsResponseSchema, -} from '../../../common/api_schemas/stop_transforms'; +} from '../../../server/routes/api_schemas/stop_transforms'; +import { addInternalBasePath } from '../../../common/constants'; import { getErrorMessage } from '../../../common/utils/errors'; import { useAppDependencies, useToastNotifications } from '../app_dependencies'; diff --git a/x-pack/plugins/transform/public/app/hooks/use_transform_config_data.ts b/x-pack/plugins/transform/public/app/hooks/use_transform_config_data.ts index f18b3778d6af..e5a9667f209b 100644 --- a/x-pack/plugins/transform/public/app/hooks/use_transform_config_data.ts +++ b/x-pack/plugins/transform/public/app/hooks/use_transform_config_data.ts @@ -28,7 +28,7 @@ import { INDEX_STATUS, } from '@kbn/ml-data-grid'; -import type { PreviewMappingsProperties } from '../../../common/api_schemas/transforms'; +import type { PreviewMappingsProperties } from '../../../server/routes/api_schemas/transforms'; import { getErrorMessage } from '../../../common/utils/errors'; diff --git a/x-pack/plugins/transform/public/app/hooks/use_update_transform.ts b/x-pack/plugins/transform/public/app/hooks/use_update_transform.ts index 3859f9a8353f..2cc9a1409d3e 100644 --- a/x-pack/plugins/transform/public/app/hooks/use_update_transform.ts +++ b/x-pack/plugins/transform/public/app/hooks/use_update_transform.ts @@ -10,7 +10,7 @@ import { useMutation } from '@tanstack/react-query'; import type { PostTransformsUpdateRequestSchema, PostTransformsUpdateResponseSchema, -} from '../../../common/api_schemas/update_transforms'; +} from '../../../server/routes/api_schemas/update_transforms'; import { addInternalBasePath } from '../../../common/constants'; import type { TransformId } from '../../../common/types/transform'; diff --git a/x-pack/plugins/transform/public/app/mount_management_section.ts b/x-pack/plugins/transform/public/app/mount_management_section.ts index edde02eddac4..e28275d20399 100644 --- a/x-pack/plugins/transform/public/app/mount_management_section.ts +++ b/x-pack/plugins/transform/public/app/mount_management_section.ts @@ -13,7 +13,7 @@ import { type TransformEnabledFeatures } from './serverless_context'; import type { PluginsDependencies } from '../plugin'; import { getMlSharedImports } from '../shared_imports'; -import type { ExperimentalFeatures } from '../../common/config'; +import type { ExperimentalFeatures } from '../../server/config'; import type { AppDependencies } from './app_dependencies'; import { breadcrumbService } from './services/navigation'; import { docTitleService } from './services/navigation'; diff --git a/x-pack/plugins/transform/public/app/sections/create_transform/components/step_create/step_create_form.tsx b/x-pack/plugins/transform/public/app/sections/create_transform/components/step_create/step_create_form.tsx index e15dec45908a..61694124d1a8 100644 --- a/x-pack/plugins/transform/public/app/sections/create_transform/components/step_create/step_create_form.tsx +++ b/x-pack/plugins/transform/public/app/sections/create_transform/components/step_create/step_create_form.tsx @@ -28,6 +28,10 @@ import { toMountPoint } from '@kbn/react-kibana-mount'; import { DISCOVER_APP_LOCATOR } from '@kbn/discover-plugin/common'; +import type { + PutTransformsLatestRequestSchema, + PutTransformsPivotRequestSchema, +} from '../../../../../../server/routes/api_schemas/transforms'; import { PROGRESS_REFRESH_INTERVAL_MS } from '../../../../../../common/constants'; import { getErrorMessage } from '../../../../../../common/utils/errors'; @@ -37,10 +41,6 @@ import { useCreateTransform, useGetTransformStats, useStartTransforms } from '.. import { useAppDependencies, useToastNotifications } from '../../../../app_dependencies'; import { RedirectToTransformManagement } from '../../../../common/navigation'; import { ToastNotificationText } from '../../../../components'; -import type { - PutTransformsLatestRequestSchema, - PutTransformsPivotRequestSchema, -} from '../../../../../../common/api_schemas/transforms'; import { isContinuousTransform } from '../../../../../../common/types/transform'; import { TransformAlertFlyout } from '../../../../../alerting/transform_alerting_flyout'; diff --git a/x-pack/plugins/transform/public/app/sections/create_transform/components/step_define/common/types.ts b/x-pack/plugins/transform/public/app/sections/create_transform/components/step_define/common/types.ts index 3f6493664f0e..db880fe91516 100644 --- a/x-pack/plugins/transform/public/app/sections/create_transform/components/step_define/common/types.ts +++ b/x-pack/plugins/transform/public/app/sections/create_transform/components/step_define/common/types.ts @@ -13,6 +13,7 @@ import type { TimeRange as TimeRangeMs } from '@kbn/ml-date-picker'; import type { RuntimeMappings } from '@kbn/ml-runtime-field-utils'; import type { SavedSearchQuery } from '@kbn/ml-query-utils'; +import type { LatestFunctionConfig } from '../../../../../../../server/routes/api_schemas/transforms'; import type { EsFieldName } from '../../../../../../../common/types/fields'; import type { @@ -26,7 +27,6 @@ import type { LatestFunctionConfigUI, PivotConfigDefinition, } from '../../../../../../../common/types/transform'; -import type { LatestFunctionConfig } from '../../../../../../../common/api_schemas/transforms'; import type { QUERY_LANGUAGE } from './constants'; diff --git a/x-pack/plugins/transform/public/app/sections/create_transform/components/step_define/hooks/use_advanced_pivot_editor.ts b/x-pack/plugins/transform/public/app/sections/create_transform/components/step_define/hooks/use_advanced_pivot_editor.ts index a67f693446f9..7e7c9470704c 100644 --- a/x-pack/plugins/transform/public/app/sections/create_transform/components/step_define/hooks/use_advanced_pivot_editor.ts +++ b/x-pack/plugins/transform/public/app/sections/create_transform/components/step_define/hooks/use_advanced_pivot_editor.ts @@ -10,7 +10,7 @@ import { XJsonMode } from '@kbn/ace'; import { XJson } from '@kbn/es-ui-shared-plugin/public'; -import type { PostTransformsPreviewRequestSchema } from '../../../../../../../common/api_schemas/transforms'; +import type { PostTransformsPreviewRequestSchema } from '../../../../../../../server/routes/api_schemas/transforms'; import type { StepDefineExposedState } from '../common'; diff --git a/x-pack/plugins/transform/public/app/sections/create_transform/components/step_define/hooks/use_advanced_source_editor.ts b/x-pack/plugins/transform/public/app/sections/create_transform/components/step_define/hooks/use_advanced_source_editor.ts index 72ae6c951c69..792f2a4e38f9 100644 --- a/x-pack/plugins/transform/public/app/sections/create_transform/components/step_define/hooks/use_advanced_source_editor.ts +++ b/x-pack/plugins/transform/public/app/sections/create_transform/components/step_define/hooks/use_advanced_source_editor.ts @@ -7,7 +7,7 @@ import { useState } from 'react'; -import type { PostTransformsPreviewRequestSchema } from '../../../../../../../common/api_schemas/transforms'; +import type { PostTransformsPreviewRequestSchema } from '../../../../../../../server/routes/api_schemas/transforms'; import type { StepDefineExposedState } from '../common'; diff --git a/x-pack/plugins/transform/public/app/sections/create_transform/components/step_define/hooks/use_latest_function_config.ts b/x-pack/plugins/transform/public/app/sections/create_transform/components/step_define/hooks/use_latest_function_config.ts index a56191f660f4..db3dc1139229 100644 --- a/x-pack/plugins/transform/public/app/sections/create_transform/components/step_define/hooks/use_latest_function_config.ts +++ b/x-pack/plugins/transform/public/app/sections/create_transform/components/step_define/hooks/use_latest_function_config.ts @@ -10,10 +10,10 @@ import { i18n } from '@kbn/i18n'; import type { EuiComboBoxOptionOption } from '@elastic/eui'; import type { AggConfigs, FieldParamType } from '@kbn/data-plugin/common'; import { isCounterTimeSeriesMetric } from '@kbn/ml-agg-utils'; +import type { LatestFunctionConfig } from '../../../../../../../server/routes/api_schemas/transforms'; import type { LatestFunctionConfigUI } from '../../../../../../../common/types/transform'; import type { StepDefineFormProps } from '../step_define_form'; import type { StepDefineExposedState } from '../common'; -import type { LatestFunctionConfig } from '../../../../../../../common/api_schemas/transforms'; import { useAppDependencies } from '../../../../../app_dependencies'; /** diff --git a/x-pack/plugins/transform/public/app/sections/edit_transform/components/edit_transform_retention_policy.tsx b/x-pack/plugins/transform/public/app/sections/edit_transform/components/edit_transform_retention_policy.tsx index b49eb67b0db0..119302cab758 100644 --- a/x-pack/plugins/transform/public/app/sections/edit_transform/components/edit_transform_retention_policy.tsx +++ b/x-pack/plugins/transform/public/app/sections/edit_transform/components/edit_transform_retention_policy.tsx @@ -12,7 +12,7 @@ import { EuiFormRow, EuiSelect, EuiSpacer, EuiSwitch } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; import { toMountPoint } from '@kbn/react-kibana-mount'; -import type { PostTransformsPreviewRequestSchema } from '../../../../../common/api_schemas/transforms'; +import type { PostTransformsPreviewRequestSchema } from '../../../../../server/routes/api_schemas/transforms'; import { isLatestTransform, isPivotTransform } from '../../../../../common/types/transform'; import { getErrorMessage } from '../../../../../common/utils/errors'; diff --git a/x-pack/plugins/transform/public/app/sections/edit_transform/state_management/apply_form_state_to_transform_config.ts b/x-pack/plugins/transform/public/app/sections/edit_transform/state_management/apply_form_state_to_transform_config.ts index 2e0f7d05ad28..a4610b440bbf 100644 --- a/x-pack/plugins/transform/public/app/sections/edit_transform/state_management/apply_form_state_to_transform_config.ts +++ b/x-pack/plugins/transform/public/app/sections/edit_transform/state_management/apply_form_state_to_transform_config.ts @@ -7,7 +7,7 @@ import { merge } from 'lodash'; -import type { PostTransformsUpdateRequestSchema } from '../../../../../common/api_schemas/update_transforms'; +import type { PostTransformsUpdateRequestSchema } from '../../../../../server/routes/api_schemas/update_transforms'; import type { TransformConfigUnion } from '../../../../../common/types/transform'; import { getUpdateValue } from './get_update_value'; diff --git a/x-pack/plugins/transform/public/app/sections/edit_transform/state_management/get_update_value.ts b/x-pack/plugins/transform/public/app/sections/edit_transform/state_management/get_update_value.ts index 82c6f012cdaf..4a1164244aad 100644 --- a/x-pack/plugins/transform/public/app/sections/edit_transform/state_management/get_update_value.ts +++ b/x-pack/plugins/transform/public/app/sections/edit_transform/state_management/get_update_value.ts @@ -9,7 +9,7 @@ import { merge } from 'lodash'; import { getNestedProperty, setNestedProperty } from '@kbn/ml-nested-property'; -import type { PostTransformsUpdateRequestSchema } from '../../../../../common/api_schemas/update_transforms'; +import type { PostTransformsUpdateRequestSchema } from '../../../../../server/routes/api_schemas/update_transforms'; import type { TransformConfigUnion } from '../../../../../common/types/transform'; import type { FormFields, FormFieldsState } from './form_field'; diff --git a/x-pack/plugins/transform/public/app/serverless_context.tsx b/x-pack/plugins/transform/public/app/serverless_context.tsx index 9faa5e0946be..f22051b93555 100644 --- a/x-pack/plugins/transform/public/app/serverless_context.tsx +++ b/x-pack/plugins/transform/public/app/serverless_context.tsx @@ -7,7 +7,7 @@ import type { FC, PropsWithChildren } from 'react'; import React, { createContext, useContext, useMemo } from 'react'; -import type { ExperimentalFeatures } from '../../common/config'; +import type { ExperimentalFeatures } from '../../server/config'; export interface TransformEnabledFeatures { showNodeInfo: boolean; diff --git a/x-pack/plugins/transform/public/plugin.ts b/x-pack/plugins/transform/public/plugin.ts index 41e657481b59..f1677bbcb7c7 100644 --- a/x-pack/plugins/transform/public/plugin.ts +++ b/x-pack/plugins/transform/public/plugin.ts @@ -25,7 +25,7 @@ import type { ContentManagementPublicStart } from '@kbn/content-management-plugi import type { SavedSearchPublicPluginStart } from '@kbn/saved-search-plugin/public'; import type { PluginInitializerContext } from '@kbn/core/public'; import type { DataViewEditorStart } from '@kbn/data-view-editor-plugin/public'; -import type { ConfigSchema } from '../common/config'; +import type { ConfigSchema } from '../server/config'; import { registerFeature } from './register_feature'; import { getTransformHealthRuleType } from './alerting'; diff --git a/x-pack/plugins/transform/common/config.ts b/x-pack/plugins/transform/server/config.ts similarity index 100% rename from x-pack/plugins/transform/common/config.ts rename to x-pack/plugins/transform/server/config.ts diff --git a/x-pack/plugins/transform/server/index.ts b/x-pack/plugins/transform/server/index.ts index 692593b0a097..54dec8e6318a 100644 --- a/x-pack/plugins/transform/server/index.ts +++ b/x-pack/plugins/transform/server/index.ts @@ -6,7 +6,7 @@ */ import type { PluginInitializerContext, PluginConfigDescriptor } from '@kbn/core/server'; -import { configSchema, type ConfigSchema } from '../common/config'; +import { configSchema, type ConfigSchema } from './config'; export const plugin = async (ctx: PluginInitializerContext) => { const { TransformServerPlugin } = await import('./plugin'); diff --git a/x-pack/plugins/transform/server/routes/api/audit_messages/register_route.ts b/x-pack/plugins/transform/server/routes/api/audit_messages/register_route.ts index be1c0ef34cca..00dd124f1aa0 100644 --- a/x-pack/plugins/transform/server/routes/api/audit_messages/register_route.ts +++ b/x-pack/plugins/transform/server/routes/api/audit_messages/register_route.ts @@ -5,13 +5,13 @@ * 2.0. */ -import { addInternalBasePath } from '../../../../common/constants'; -import type { TransformIdParamSchema } from '../../../../common/api_schemas/common'; -import { transformIdParamSchema } from '../../../../common/api_schemas/common'; +import type { TransformIdParamSchema } from '../../api_schemas/common'; +import { transformIdParamSchema } from '../../api_schemas/common'; import { getTransformAuditMessagesQuerySchema, type GetTransformAuditMessagesQuerySchema, -} from '../../../../common/api_schemas/audit_messages'; +} from '../../api_schemas/audit_messages'; +import { addInternalBasePath } from '../../../../common/constants'; import type { RouteDependencies } from '../../../types'; diff --git a/x-pack/plugins/transform/server/routes/api/audit_messages/route_handler.ts b/x-pack/plugins/transform/server/routes/api/audit_messages/route_handler.ts index defde2da5408..aeea12c881a4 100644 --- a/x-pack/plugins/transform/server/routes/api/audit_messages/route_handler.ts +++ b/x-pack/plugins/transform/server/routes/api/audit_messages/route_handler.ts @@ -7,11 +7,11 @@ import type { RequestHandler } from '@kbn/core/server'; +import type { TransformIdParamSchema } from '../../api_schemas/common'; import { DEFAULT_MAX_AUDIT_MESSAGE_SIZE, TRANSFORM_NOTIFICATIONS_INDEX, } from '../../../../common/constants'; -import type { TransformIdParamSchema } from '../../../../common/api_schemas/common'; import type { AuditMessage } from '../../../../common/types/messages'; import { wrapError, wrapEsError } from '../../utils/error_utils'; diff --git a/x-pack/plugins/transform/server/routes/api/delete_transforms/delete_transforms.ts b/x-pack/plugins/transform/server/routes/api/delete_transforms/delete_transforms.ts index 3a5c2ffd8967..0a3cabba9b5d 100644 --- a/x-pack/plugins/transform/server/routes/api/delete_transforms/delete_transforms.ts +++ b/x-pack/plugins/transform/server/routes/api/delete_transforms/delete_transforms.ts @@ -10,13 +10,13 @@ import type { DataViewsService } from '@kbn/data-views-plugin/common'; import { deleteDataViewFn } from '@kbn/ml-data-view-utils/actions/delete'; import type { DeleteDataViewApiResponseSchema } from '@kbn/ml-data-view-utils/types/api_delete_response_schema'; +import type { ResponseStatus } from '../../api_schemas/common'; import { TRANSFORM_ACTIONS } from '../../../../common/types/transform'; import { TRANSFORM_STATE } from '../../../../common/constants'; -import type { ResponseStatus } from '../../../../common/api_schemas/common'; import type { DeleteTransformsRequestSchema, DeleteTransformsResponseSchema, -} from '../../../../common/api_schemas/delete_transforms'; +} from '../../api_schemas/delete_transforms'; import { isRequestTimeout, fillResultsWithTimeouts } from '../../utils/error_utils'; diff --git a/x-pack/plugins/transform/server/routes/api/delete_transforms/register_route.ts b/x-pack/plugins/transform/server/routes/api/delete_transforms/register_route.ts index 3646889f2c00..20c169c79dda 100644 --- a/x-pack/plugins/transform/server/routes/api/delete_transforms/register_route.ts +++ b/x-pack/plugins/transform/server/routes/api/delete_transforms/register_route.ts @@ -8,7 +8,7 @@ import { deleteTransformsRequestSchema, type DeleteTransformsRequestSchema, -} from '../../../../common/api_schemas/delete_transforms'; +} from '../../api_schemas/delete_transforms'; import { addInternalBasePath } from '../../../../common/constants'; import type { RouteDependencies } from '../../../types'; diff --git a/x-pack/plugins/transform/server/routes/api/delete_transforms/route_handler_factory.ts b/x-pack/plugins/transform/server/routes/api/delete_transforms/route_handler_factory.ts index c55fa798d24e..2fa071d01444 100644 --- a/x-pack/plugins/transform/server/routes/api/delete_transforms/route_handler_factory.ts +++ b/x-pack/plugins/transform/server/routes/api/delete_transforms/route_handler_factory.ts @@ -7,7 +7,7 @@ import type { RequestHandler } from '@kbn/core/server'; -import { type DeleteTransformsRequestSchema } from '../../../../common/api_schemas/delete_transforms'; +import { type DeleteTransformsRequestSchema } from '../../api_schemas/delete_transforms'; import type { TransformRequestHandlerContext } from '../../../services/license'; import type { RouteDependencies } from '../../../types'; diff --git a/x-pack/plugins/transform/server/routes/api/field_histograms/register_route.ts b/x-pack/plugins/transform/server/routes/api/field_histograms/register_route.ts index d1949f06e1ca..c3fe803ba236 100644 --- a/x-pack/plugins/transform/server/routes/api/field_histograms/register_route.ts +++ b/x-pack/plugins/transform/server/routes/api/field_histograms/register_route.ts @@ -5,12 +5,11 @@ * 2.0. */ +import type { DataViewTitleSchema } from '../../api_schemas/common'; +import { dataViewTitleSchema } from '../../api_schemas/common'; +import type { FieldHistogramsRequestSchema } from '../../api_schemas/field_histograms'; +import { fieldHistogramsRequestSchema } from '../../api_schemas/field_histograms'; import { addInternalBasePath } from '../../../../common/constants'; - -import type { DataViewTitleSchema } from '../../../../common/api_schemas/common'; -import { dataViewTitleSchema } from '../../../../common/api_schemas/common'; -import type { FieldHistogramsRequestSchema } from '../../../../common/api_schemas/field_histograms'; -import { fieldHistogramsRequestSchema } from '../../../../common/api_schemas/field_histograms'; import type { RouteDependencies } from '../../../types'; import { routeHandler } from './route_handler'; diff --git a/x-pack/plugins/transform/server/routes/api/field_histograms/route_handler.ts b/x-pack/plugins/transform/server/routes/api/field_histograms/route_handler.ts index 1d3c8183840f..443a67e73aab 100644 --- a/x-pack/plugins/transform/server/routes/api/field_histograms/route_handler.ts +++ b/x-pack/plugins/transform/server/routes/api/field_histograms/route_handler.ts @@ -8,8 +8,8 @@ import type { RequestHandler } from '@kbn/core/server'; import { fetchHistogramsForFields } from '@kbn/ml-agg-utils'; -import type { DataViewTitleSchema } from '../../../../common/api_schemas/common'; -import type { FieldHistogramsRequestSchema } from '../../../../common/api_schemas/field_histograms'; +import type { DataViewTitleSchema } from '../../api_schemas/common'; +import type { FieldHistogramsRequestSchema } from '../../api_schemas/field_histograms'; import { wrapError, wrapEsError } from '../../utils/error_utils'; diff --git a/x-pack/plugins/transform/server/routes/api/reauthorize_transforms/reauthorize_and_start_transforms.ts b/x-pack/plugins/transform/server/routes/api/reauthorize_transforms/reauthorize_and_start_transforms.ts index 45d78999223a..6a0bfe06d05a 100644 --- a/x-pack/plugins/transform/server/routes/api/reauthorize_transforms/reauthorize_and_start_transforms.ts +++ b/x-pack/plugins/transform/server/routes/api/reauthorize_transforms/reauthorize_and_start_transforms.ts @@ -8,11 +8,11 @@ import type { ElasticsearchClient } from '@kbn/core/server'; import type { TransportRequestOptions } from '@elastic/elasticsearch'; -import { TRANSFORM_ACTIONS } from '../../../../common/types/transform'; import type { ReauthorizeTransformsRequestSchema, ReauthorizeTransformsResponseSchema, -} from '../../../../common/api_schemas/reauthorize_transforms'; +} from '../../api_schemas/reauthorize_transforms'; +import { TRANSFORM_ACTIONS } from '../../../../common/types/transform'; import { isRequestTimeout, fillResultsWithTimeouts } from '../../utils/error_utils'; diff --git a/x-pack/plugins/transform/server/routes/api/reauthorize_transforms/register_route.ts b/x-pack/plugins/transform/server/routes/api/reauthorize_transforms/register_route.ts index fc5128e0971b..2826820f8d23 100644 --- a/x-pack/plugins/transform/server/routes/api/reauthorize_transforms/register_route.ts +++ b/x-pack/plugins/transform/server/routes/api/reauthorize_transforms/register_route.ts @@ -5,8 +5,8 @@ * 2.0. */ -import type { StartTransformsRequestSchema } from '../../../../common/api_schemas/start_transforms'; -import { reauthorizeTransformsRequestSchema } from '../../../../common/api_schemas/reauthorize_transforms'; +import type { StartTransformsRequestSchema } from '../../api_schemas/start_transforms'; +import { reauthorizeTransformsRequestSchema } from '../../api_schemas/reauthorize_transforms'; import { addInternalBasePath } from '../../../../common/constants'; import type { RouteDependencies } from '../../../types'; diff --git a/x-pack/plugins/transform/server/routes/api/reauthorize_transforms/route_handler_factory.ts b/x-pack/plugins/transform/server/routes/api/reauthorize_transforms/route_handler_factory.ts index aa63936a3f6e..1b4dea70ba8e 100644 --- a/x-pack/plugins/transform/server/routes/api/reauthorize_transforms/route_handler_factory.ts +++ b/x-pack/plugins/transform/server/routes/api/reauthorize_transforms/route_handler_factory.ts @@ -7,8 +7,8 @@ import type { RequestHandler } from '@kbn/core/server'; +import type { StartTransformsRequestSchema } from '../../api_schemas/start_transforms'; import { generateTransformSecondaryAuthHeaders } from '../../../../common/utils/transform_api_key'; -import type { StartTransformsRequestSchema } from '../../../../common/api_schemas/start_transforms'; import type { TransformRequestHandlerContext } from '../../../services/license'; diff --git a/x-pack/plugins/transform/server/routes/api/reset_transforms/register_route.ts b/x-pack/plugins/transform/server/routes/api/reset_transforms/register_route.ts index adbe55b8e828..5a239f0767fa 100644 --- a/x-pack/plugins/transform/server/routes/api/reset_transforms/register_route.ts +++ b/x-pack/plugins/transform/server/routes/api/reset_transforms/register_route.ts @@ -8,7 +8,7 @@ import { resetTransformsRequestSchema, type ResetTransformsRequestSchema, -} from '../../../../common/api_schemas/reset_transforms'; +} from '../../api_schemas/reset_transforms'; import { addInternalBasePath } from '../../../../common/constants'; import type { RouteDependencies } from '../../../types'; diff --git a/x-pack/plugins/transform/server/routes/api/reset_transforms/reset_transforms.ts b/x-pack/plugins/transform/server/routes/api/reset_transforms/reset_transforms.ts index e9d2edd52f44..5af2dd2e3fec 100644 --- a/x-pack/plugins/transform/server/routes/api/reset_transforms/reset_transforms.ts +++ b/x-pack/plugins/transform/server/routes/api/reset_transforms/reset_transforms.ts @@ -7,12 +7,12 @@ import type { KibanaResponseFactory, RequestHandlerContext } from '@kbn/core/server'; -import { TRANSFORM_ACTIONS } from '../../../../common/types/transform'; -import type { ResponseStatus } from '../../../../common/api_schemas/common'; +import type { ResponseStatus } from '../../api_schemas/common'; import type { ResetTransformsRequestSchema, ResetTransformsResponseSchema, -} from '../../../../common/api_schemas/reset_transforms'; +} from '../../api_schemas/reset_transforms'; +import { TRANSFORM_ACTIONS } from '../../../../common/types/transform'; import { isRequestTimeout, fillResultsWithTimeouts } from '../../utils/error_utils'; diff --git a/x-pack/plugins/transform/server/routes/api/reset_transforms/route_handler.ts b/x-pack/plugins/transform/server/routes/api/reset_transforms/route_handler.ts index d10a093ae5ee..b40f4801e4aa 100644 --- a/x-pack/plugins/transform/server/routes/api/reset_transforms/route_handler.ts +++ b/x-pack/plugins/transform/server/routes/api/reset_transforms/route_handler.ts @@ -7,7 +7,7 @@ import type { RequestHandler } from '@kbn/core/server'; -import type { ResetTransformsRequestSchema } from '../../../../common/api_schemas/reset_transforms'; +import type { ResetTransformsRequestSchema } from '../../api_schemas/reset_transforms'; import type { TransformRequestHandlerContext } from '../../../services/license'; diff --git a/x-pack/plugins/transform/server/routes/api/schedule_now_transforms/register_route.ts b/x-pack/plugins/transform/server/routes/api/schedule_now_transforms/register_route.ts index 0ec8808ae2ec..75000050ddeb 100644 --- a/x-pack/plugins/transform/server/routes/api/schedule_now_transforms/register_route.ts +++ b/x-pack/plugins/transform/server/routes/api/schedule_now_transforms/register_route.ts @@ -8,7 +8,7 @@ import { scheduleNowTransformsRequestSchema, type ScheduleNowTransformsRequestSchema, -} from '../../../../common/api_schemas/schedule_now_transforms'; +} from '../../api_schemas/schedule_now_transforms'; import { addInternalBasePath } from '../../../../common/constants'; import type { RouteDependencies } from '../../../types'; diff --git a/x-pack/plugins/transform/server/routes/api/schedule_now_transforms/route_handler.ts b/x-pack/plugins/transform/server/routes/api/schedule_now_transforms/route_handler.ts index 53099f7270b7..26ba52f3fb94 100644 --- a/x-pack/plugins/transform/server/routes/api/schedule_now_transforms/route_handler.ts +++ b/x-pack/plugins/transform/server/routes/api/schedule_now_transforms/route_handler.ts @@ -7,7 +7,7 @@ import type { RequestHandler } from '@kbn/core/server'; -import type { ScheduleNowTransformsRequestSchema } from '../../../../common/api_schemas/schedule_now_transforms'; +import type { ScheduleNowTransformsRequestSchema } from '../../api_schemas/schedule_now_transforms'; import type { TransformRequestHandlerContext } from '../../../services/license'; diff --git a/x-pack/plugins/transform/server/routes/api/schedule_now_transforms/schedule_now_transforms.ts b/x-pack/plugins/transform/server/routes/api/schedule_now_transforms/schedule_now_transforms.ts index bc09425e73e4..7d4cb843206c 100644 --- a/x-pack/plugins/transform/server/routes/api/schedule_now_transforms/schedule_now_transforms.ts +++ b/x-pack/plugins/transform/server/routes/api/schedule_now_transforms/schedule_now_transforms.ts @@ -7,11 +7,11 @@ import type { ElasticsearchClient } from '@kbn/core/server'; -import { TRANSFORM_ACTIONS } from '../../../../common/types/transform'; import type { ScheduleNowTransformsRequestSchema, ScheduleNowTransformsResponseSchema, -} from '../../../../common/api_schemas/schedule_now_transforms'; +} from '../../api_schemas/schedule_now_transforms'; +import { TRANSFORM_ACTIONS } from '../../../../common/types/transform'; import { isRequestTimeout, fillResultsWithTimeouts } from '../../utils/error_utils'; diff --git a/x-pack/plugins/transform/server/routes/api/start_transforms/register_route.ts b/x-pack/plugins/transform/server/routes/api/start_transforms/register_route.ts index 5ce3de48e63a..1ba1a0f098a7 100644 --- a/x-pack/plugins/transform/server/routes/api/start_transforms/register_route.ts +++ b/x-pack/plugins/transform/server/routes/api/start_transforms/register_route.ts @@ -8,7 +8,7 @@ import { startTransformsRequestSchema, type StartTransformsRequestSchema, -} from '../../../../common/api_schemas/start_transforms'; +} from '../../api_schemas/start_transforms'; import { addInternalBasePath } from '../../../../common/constants'; import type { RouteDependencies } from '../../../types'; diff --git a/x-pack/plugins/transform/server/routes/api/start_transforms/route_handler.ts b/x-pack/plugins/transform/server/routes/api/start_transforms/route_handler.ts index 50bbf395a5ac..a479f3b6bab6 100644 --- a/x-pack/plugins/transform/server/routes/api/start_transforms/route_handler.ts +++ b/x-pack/plugins/transform/server/routes/api/start_transforms/route_handler.ts @@ -7,7 +7,7 @@ import type { RequestHandler } from '@kbn/core/server'; -import type { StartTransformsRequestSchema } from '../../../../common/api_schemas/start_transforms'; +import type { StartTransformsRequestSchema } from '../../api_schemas/start_transforms'; import type { TransformRequestHandlerContext } from '../../../services/license'; diff --git a/x-pack/plugins/transform/server/routes/api/start_transforms/start_transforms.ts b/x-pack/plugins/transform/server/routes/api/start_transforms/start_transforms.ts index d8097001df9b..dc9d4bfe247e 100644 --- a/x-pack/plugins/transform/server/routes/api/start_transforms/start_transforms.ts +++ b/x-pack/plugins/transform/server/routes/api/start_transforms/start_transforms.ts @@ -7,11 +7,11 @@ import type { ElasticsearchClient } from '@kbn/core/server'; -import { TRANSFORM_ACTIONS } from '../../../../common/types/transform'; import type { StartTransformsRequestSchema, StartTransformsResponseSchema, -} from '../../../../common/api_schemas/start_transforms'; +} from '../../api_schemas/start_transforms'; +import { TRANSFORM_ACTIONS } from '../../../../common/types/transform'; import { isRequestTimeout, fillResultsWithTimeouts } from '../../utils/error_utils'; diff --git a/x-pack/plugins/transform/server/routes/api/stop_transforms/register_route.ts b/x-pack/plugins/transform/server/routes/api/stop_transforms/register_route.ts index b859ee4743c4..5fdc5a97dd55 100644 --- a/x-pack/plugins/transform/server/routes/api/stop_transforms/register_route.ts +++ b/x-pack/plugins/transform/server/routes/api/stop_transforms/register_route.ts @@ -8,7 +8,7 @@ import { stopTransformsRequestSchema, type StopTransformsRequestSchema, -} from '../../../../common/api_schemas/stop_transforms'; +} from '../../api_schemas/stop_transforms'; import { addInternalBasePath } from '../../../../common/constants'; import type { RouteDependencies } from '../../../types'; diff --git a/x-pack/plugins/transform/server/routes/api/stop_transforms/route_handler.ts b/x-pack/plugins/transform/server/routes/api/stop_transforms/route_handler.ts index 3ad753ec24c5..f004003202dd 100644 --- a/x-pack/plugins/transform/server/routes/api/stop_transforms/route_handler.ts +++ b/x-pack/plugins/transform/server/routes/api/stop_transforms/route_handler.ts @@ -7,7 +7,7 @@ import type { RequestHandler } from '@kbn/core/server'; -import type { StopTransformsRequestSchema } from '../../../../common/api_schemas/stop_transforms'; +import type { StopTransformsRequestSchema } from '../../api_schemas/stop_transforms'; import type { TransformRequestHandlerContext } from '../../../services/license'; diff --git a/x-pack/plugins/transform/server/routes/api/stop_transforms/stop_transforms.ts b/x-pack/plugins/transform/server/routes/api/stop_transforms/stop_transforms.ts index 2096c9f9f0ca..52263402e8ce 100644 --- a/x-pack/plugins/transform/server/routes/api/stop_transforms/stop_transforms.ts +++ b/x-pack/plugins/transform/server/routes/api/stop_transforms/stop_transforms.ts @@ -7,12 +7,12 @@ import type { ElasticsearchClient } from '@kbn/core/server'; -import { TRANSFORM_ACTIONS } from '../../../../common/types/transform'; -import { TRANSFORM_STATE } from '../../../../common/constants'; import type { StopTransformsRequestSchema, StopTransformsResponseSchema, -} from '../../../../common/api_schemas/stop_transforms'; +} from '../../api_schemas/stop_transforms'; +import { TRANSFORM_ACTIONS } from '../../../../common/types/transform'; +import { TRANSFORM_STATE } from '../../../../common/constants'; import { isRequestTimeout, fillResultsWithTimeouts } from '../../utils/error_utils'; diff --git a/x-pack/plugins/transform/server/routes/api/transforms_create/register_route.ts b/x-pack/plugins/transform/server/routes/api/transforms_create/register_route.ts index 9237977118d0..7cfb0dc90a41 100644 --- a/x-pack/plugins/transform/server/routes/api/transforms_create/register_route.ts +++ b/x-pack/plugins/transform/server/routes/api/transforms_create/register_route.ts @@ -10,14 +10,11 @@ import { type DataViewCreateQuerySchema, } from '@kbn/ml-data-view-utils/schemas/api_create_query_schema'; -import { - transformIdParamSchema, - type TransformIdParamSchema, -} from '../../../../common/api_schemas/common'; +import { transformIdParamSchema, type TransformIdParamSchema } from '../../api_schemas/common'; import { putTransformsRequestSchema, type PutTransformsRequestSchema, -} from '../../../../common/api_schemas/transforms'; +} from '../../api_schemas/transforms'; import { addInternalBasePath } from '../../../../common/constants'; import type { RouteDependencies } from '../../../types'; diff --git a/x-pack/plugins/transform/server/routes/api/transforms_create/route_handler_factory.ts b/x-pack/plugins/transform/server/routes/api/transforms_create/route_handler_factory.ts index 0baa019808e8..d433901887e9 100644 --- a/x-pack/plugins/transform/server/routes/api/transforms_create/route_handler_factory.ts +++ b/x-pack/plugins/transform/server/routes/api/transforms_create/route_handler_factory.ts @@ -11,11 +11,11 @@ import type { DataViewCreateQuerySchema } from '@kbn/ml-data-view-utils/schemas/ import { createDataViewFn } from '@kbn/ml-data-view-utils/actions/create'; import { isPopulatedObject } from '@kbn/ml-is-populated-object'; -import type { TransformIdParamSchema } from '../../../../common/api_schemas/common'; +import type { TransformIdParamSchema } from '../../api_schemas/common'; import type { PutTransformsRequestSchema, PutTransformsResponseSchema, -} from '../../../../common/api_schemas/transforms'; +} from '../../api_schemas/transforms'; import { isLatestTransform } from '../../../../common/types/transform'; import type { RouteDependencies } from '../../../types'; diff --git a/x-pack/plugins/transform/server/routes/api/transforms_preview/register_route.ts b/x-pack/plugins/transform/server/routes/api/transforms_preview/register_route.ts index 55e1446dfe5a..21a902e575b0 100644 --- a/x-pack/plugins/transform/server/routes/api/transforms_preview/register_route.ts +++ b/x-pack/plugins/transform/server/routes/api/transforms_preview/register_route.ts @@ -5,8 +5,8 @@ * 2.0. */ -import type { PostTransformsPreviewRequestSchema } from '../../../../common/api_schemas/transforms'; -import { postTransformsPreviewRequestSchema } from '../../../../common/api_schemas/transforms'; +import type { PostTransformsPreviewRequestSchema } from '../../api_schemas/transforms'; +import { postTransformsPreviewRequestSchema } from '../../api_schemas/transforms'; import { addInternalBasePath } from '../../../../common/constants'; import type { RouteDependencies } from '../../../types'; diff --git a/x-pack/plugins/transform/server/routes/api/transforms_preview/route_handler.ts b/x-pack/plugins/transform/server/routes/api/transforms_preview/route_handler.ts index 2ce611260836..b6beb641f0b5 100644 --- a/x-pack/plugins/transform/server/routes/api/transforms_preview/route_handler.ts +++ b/x-pack/plugins/transform/server/routes/api/transforms_preview/route_handler.ts @@ -9,7 +9,7 @@ import type * as estypes from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; import type { RequestHandler } from '@kbn/core/server'; -import type { PostTransformsPreviewRequestSchema } from '../../../../common/api_schemas/transforms'; +import type { PostTransformsPreviewRequestSchema } from '../../api_schemas/transforms'; import { isLatestTransform } from '../../../../common/types/transform'; import { isKeywordDuplicate } from '../../../../common/utils/field_utils'; diff --git a/x-pack/plugins/transform/server/routes/api/transforms_single/register_route.ts b/x-pack/plugins/transform/server/routes/api/transforms_single/register_route.ts index c13c2b996dc7..30b54b384799 100644 --- a/x-pack/plugins/transform/server/routes/api/transforms_single/register_route.ts +++ b/x-pack/plugins/transform/server/routes/api/transforms_single/register_route.ts @@ -5,11 +5,8 @@ * 2.0. */ +import { transformIdParamSchema, type TransformIdParamSchema } from '../../api_schemas/common'; import { addInternalBasePath } from '../../../../common/constants'; -import { - transformIdParamSchema, - type TransformIdParamSchema, -} from '../../../../common/api_schemas/common'; import type { RouteDependencies } from '../../../types'; diff --git a/x-pack/plugins/transform/server/routes/api/transforms_single/route_handler.ts b/x-pack/plugins/transform/server/routes/api/transforms_single/route_handler.ts index 623769707b0e..7918efa2fff6 100644 --- a/x-pack/plugins/transform/server/routes/api/transforms_single/route_handler.ts +++ b/x-pack/plugins/transform/server/routes/api/transforms_single/route_handler.ts @@ -7,7 +7,7 @@ import type { RequestHandler } from '@kbn/core/server'; -import type { TransformIdParamSchema } from '../../../../common/api_schemas/common'; +import type { TransformIdParamSchema } from '../../api_schemas/common'; import { wrapError, wrapEsError } from '../../utils/error_utils'; diff --git a/x-pack/plugins/transform/server/routes/api/transforms_stats_all/register_route.ts b/x-pack/plugins/transform/server/routes/api/transforms_stats_all/register_route.ts index 8aa59649af1d..3136163cf99f 100644 --- a/x-pack/plugins/transform/server/routes/api/transforms_stats_all/register_route.ts +++ b/x-pack/plugins/transform/server/routes/api/transforms_stats_all/register_route.ts @@ -10,7 +10,7 @@ import type * as estypes from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; import { getTransformStatsQuerySchema, type GetTransformStatsQuerySchema, -} from '../../../../common/api_schemas/transforms_stats'; +} from '../../api_schemas/transforms_stats'; import { addInternalBasePath } from '../../../../common/constants'; import type { RouteDependencies } from '../../../types'; diff --git a/x-pack/plugins/transform/server/routes/api/transforms_stats_all/route_handler.ts b/x-pack/plugins/transform/server/routes/api/transforms_stats_all/route_handler.ts index 455dc6174dd5..5f44b2b732d2 100644 --- a/x-pack/plugins/transform/server/routes/api/transforms_stats_all/route_handler.ts +++ b/x-pack/plugins/transform/server/routes/api/transforms_stats_all/route_handler.ts @@ -9,7 +9,7 @@ import type * as estypes from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; import type { RequestHandler } from '@kbn/core/server'; -import { type GetTransformStatsQuerySchema } from '../../../../common/api_schemas/transforms_stats'; +import { type GetTransformStatsQuerySchema } from '../../api_schemas/transforms_stats'; import type { TransformRequestHandlerContext } from '../../../services/license'; diff --git a/x-pack/plugins/transform/server/routes/api/transforms_stats_single/register_route.ts b/x-pack/plugins/transform/server/routes/api/transforms_stats_single/register_route.ts index 9f7424cd62ac..5e784506ae57 100644 --- a/x-pack/plugins/transform/server/routes/api/transforms_stats_single/register_route.ts +++ b/x-pack/plugins/transform/server/routes/api/transforms_stats_single/register_route.ts @@ -5,14 +5,11 @@ * 2.0. */ -import { - transformIdParamSchema, - type TransformIdParamSchema, -} from '../../../../common/api_schemas/common'; +import { transformIdParamSchema, type TransformIdParamSchema } from '../../api_schemas/common'; import { getTransformStatsQuerySchema, type GetTransformStatsQuerySchema, -} from '../../../../common/api_schemas/transforms_stats'; +} from '../../api_schemas/transforms_stats'; import { addInternalBasePath } from '../../../../common/constants'; import type { RouteDependencies } from '../../../types'; diff --git a/x-pack/plugins/transform/server/routes/api/transforms_stats_single/route_handler.ts b/x-pack/plugins/transform/server/routes/api/transforms_stats_single/route_handler.ts index 50933b04dc20..5b55cdbb9b6c 100644 --- a/x-pack/plugins/transform/server/routes/api/transforms_stats_single/route_handler.ts +++ b/x-pack/plugins/transform/server/routes/api/transforms_stats_single/route_handler.ts @@ -7,8 +7,8 @@ import type { RequestHandler } from '@kbn/core/server'; -import type { TransformIdParamSchema } from '../../../../common/api_schemas/common'; -import type { GetTransformStatsQuerySchema } from '../../../../common/api_schemas/transforms_stats'; +import type { TransformIdParamSchema } from '../../api_schemas/common'; +import type { GetTransformStatsQuerySchema } from '../../api_schemas/transforms_stats'; import type { TransformRequestHandlerContext } from '../../../services/license'; diff --git a/x-pack/plugins/transform/server/routes/api/transforms_update/register_route.ts b/x-pack/plugins/transform/server/routes/api/transforms_update/register_route.ts index a90ce9395bfc..60719e68d596 100644 --- a/x-pack/plugins/transform/server/routes/api/transforms_update/register_route.ts +++ b/x-pack/plugins/transform/server/routes/api/transforms_update/register_route.ts @@ -5,14 +5,11 @@ * 2.0. */ -import { - transformIdParamSchema, - type TransformIdParamSchema, -} from '../../../../common/api_schemas/common'; +import { transformIdParamSchema, type TransformIdParamSchema } from '../../api_schemas/common'; import { postTransformsUpdateRequestSchema, type PostTransformsUpdateRequestSchema, -} from '../../../../common/api_schemas/update_transforms'; +} from '../../api_schemas/update_transforms'; import { addInternalBasePath } from '../../../../common/constants'; import type { RouteDependencies } from '../../../types'; diff --git a/x-pack/plugins/transform/server/routes/api/transforms_update/route_handler.ts b/x-pack/plugins/transform/server/routes/api/transforms_update/route_handler.ts index 9a88c4da3d48..b738b2a0898d 100644 --- a/x-pack/plugins/transform/server/routes/api/transforms_update/route_handler.ts +++ b/x-pack/plugins/transform/server/routes/api/transforms_update/route_handler.ts @@ -7,8 +7,8 @@ import type { RequestHandler } from '@kbn/core/server'; -import type { TransformIdParamSchema } from '../../../../common/api_schemas/common'; -import type { PostTransformsUpdateRequestSchema } from '../../../../common/api_schemas/update_transforms'; +import type { TransformIdParamSchema } from '../../api_schemas/common'; +import type { PostTransformsUpdateRequestSchema } from '../../api_schemas/update_transforms'; import type { TransformRequestHandlerContext } from '../../../services/license'; diff --git a/x-pack/plugins/transform/common/api_schemas/audit_messages.ts b/x-pack/plugins/transform/server/routes/api_schemas/audit_messages.ts similarity index 91% rename from x-pack/plugins/transform/common/api_schemas/audit_messages.ts rename to x-pack/plugins/transform/server/routes/api_schemas/audit_messages.ts index cb97ba4042dc..76fac4ce4a5a 100644 --- a/x-pack/plugins/transform/common/api_schemas/audit_messages.ts +++ b/x-pack/plugins/transform/server/routes/api_schemas/audit_messages.ts @@ -8,7 +8,7 @@ import type { TypeOf } from '@kbn/config-schema'; import { schema } from '@kbn/config-schema'; -import type { TransformMessage } from '../types/messages'; +import type { TransformMessage } from '../../../common/types/messages'; export interface GetTransformsAuditMessagesResponseSchema { messages: TransformMessage[]; diff --git a/x-pack/plugins/transform/common/api_schemas/common.ts b/x-pack/plugins/transform/server/routes/api_schemas/common.ts similarity index 97% rename from x-pack/plugins/transform/common/api_schemas/common.ts rename to x-pack/plugins/transform/server/routes/api_schemas/common.ts index e2465379e1b3..6eb068c19272 100644 --- a/x-pack/plugins/transform/common/api_schemas/common.ts +++ b/x-pack/plugins/transform/server/routes/api_schemas/common.ts @@ -9,7 +9,7 @@ import type { TypeOf } from '@kbn/config-schema'; import { schema } from '@kbn/config-schema'; import { i18n } from '@kbn/i18n'; import { isRuntimeField } from '@kbn/ml-runtime-field-utils'; -import { TRANSFORM_STATE } from '../constants'; +import { TRANSFORM_STATE } from '../../../common/constants'; export const transformIdsSchema = schema.arrayOf( schema.object({ diff --git a/x-pack/plugins/transform/common/api_schemas/delete_transforms.ts b/x-pack/plugins/transform/server/routes/api_schemas/delete_transforms.ts similarity index 100% rename from x-pack/plugins/transform/common/api_schemas/delete_transforms.ts rename to x-pack/plugins/transform/server/routes/api_schemas/delete_transforms.ts diff --git a/x-pack/plugins/transform/common/api_schemas/field_histograms.ts b/x-pack/plugins/transform/server/routes/api_schemas/field_histograms.ts similarity index 100% rename from x-pack/plugins/transform/common/api_schemas/field_histograms.ts rename to x-pack/plugins/transform/server/routes/api_schemas/field_histograms.ts diff --git a/x-pack/plugins/transform/common/api_schemas/reauthorize_transforms.ts b/x-pack/plugins/transform/server/routes/api_schemas/reauthorize_transforms.ts similarity index 100% rename from x-pack/plugins/transform/common/api_schemas/reauthorize_transforms.ts rename to x-pack/plugins/transform/server/routes/api_schemas/reauthorize_transforms.ts diff --git a/x-pack/plugins/transform/common/api_schemas/reset_transforms.ts b/x-pack/plugins/transform/server/routes/api_schemas/reset_transforms.ts similarity index 100% rename from x-pack/plugins/transform/common/api_schemas/reset_transforms.ts rename to x-pack/plugins/transform/server/routes/api_schemas/reset_transforms.ts diff --git a/x-pack/plugins/transform/common/api_schemas/schedule_now_transforms.ts b/x-pack/plugins/transform/server/routes/api_schemas/schedule_now_transforms.ts similarity index 100% rename from x-pack/plugins/transform/common/api_schemas/schedule_now_transforms.ts rename to x-pack/plugins/transform/server/routes/api_schemas/schedule_now_transforms.ts diff --git a/x-pack/plugins/transform/common/api_schemas/start_transforms.ts b/x-pack/plugins/transform/server/routes/api_schemas/start_transforms.ts similarity index 100% rename from x-pack/plugins/transform/common/api_schemas/start_transforms.ts rename to x-pack/plugins/transform/server/routes/api_schemas/start_transforms.ts diff --git a/x-pack/plugins/transform/common/api_schemas/stop_transforms.ts b/x-pack/plugins/transform/server/routes/api_schemas/stop_transforms.ts similarity index 100% rename from x-pack/plugins/transform/common/api_schemas/stop_transforms.ts rename to x-pack/plugins/transform/server/routes/api_schemas/stop_transforms.ts diff --git a/x-pack/plugins/transform/common/api_schemas/transforms.ts b/x-pack/plugins/transform/server/routes/api_schemas/transforms.ts similarity index 95% rename from x-pack/plugins/transform/common/api_schemas/transforms.ts rename to x-pack/plugins/transform/server/routes/api_schemas/transforms.ts index 2367e2a9eb2a..a8e991a84855 100644 --- a/x-pack/plugins/transform/common/api_schemas/transforms.ts +++ b/x-pack/plugins/transform/server/routes/api_schemas/transforms.ts @@ -9,10 +9,10 @@ import { schema, type TypeOf } from '@kbn/config-schema'; import type { ES_FIELD_TYPES } from '@kbn/field-types'; import type { CreateDataViewApiResponseSchema } from '@kbn/ml-data-view-utils/types/api_create_response_schema'; -import type { Dictionary } from '../types/common'; -import type { PivotAggDict } from '../types/pivot_aggs'; -import type { PivotGroupByDict } from '../types/pivot_group_by'; -import type { TransformId, TransformConfigUnion } from '../types/transform'; +import type { Dictionary } from '../../../common/types/common'; +import type { PivotAggDict } from '../../../common/types/pivot_aggs'; +import type { PivotGroupByDict } from '../../../common/types/pivot_group_by'; +import type { TransformId, TransformConfigUnion } from '../../../common/types/transform'; import { transformStateSchema, runtimeMappingsSchema } from './common'; diff --git a/x-pack/plugins/transform/common/api_schemas/transforms_stats.ts b/x-pack/plugins/transform/server/routes/api_schemas/transforms_stats.ts similarity index 92% rename from x-pack/plugins/transform/common/api_schemas/transforms_stats.ts rename to x-pack/plugins/transform/server/routes/api_schemas/transforms_stats.ts index 137a0fe9a204..9286842c1bb6 100644 --- a/x-pack/plugins/transform/common/api_schemas/transforms_stats.ts +++ b/x-pack/plugins/transform/server/routes/api_schemas/transforms_stats.ts @@ -8,7 +8,7 @@ import type { TypeOf } from '@kbn/config-schema'; import { schema } from '@kbn/config-schema'; -import type { TransformStats } from '../types/transform_stats'; +import type { TransformStats } from '../../../common/types/transform_stats'; import { getTransformsRequestSchema } from './transforms'; diff --git a/x-pack/plugins/transform/common/api_schemas/update_transforms.ts b/x-pack/plugins/transform/server/routes/api_schemas/update_transforms.ts similarity index 94% rename from x-pack/plugins/transform/common/api_schemas/update_transforms.ts rename to x-pack/plugins/transform/server/routes/api_schemas/update_transforms.ts index cce50167f0d1..ce3afbf340da 100644 --- a/x-pack/plugins/transform/common/api_schemas/update_transforms.ts +++ b/x-pack/plugins/transform/server/routes/api_schemas/update_transforms.ts @@ -8,7 +8,7 @@ import type { TypeOf } from '@kbn/config-schema'; import { schema } from '@kbn/config-schema'; -import type { TransformPivotConfig } from '../types/transform'; +import type { TransformPivotConfig } from '../../../common/types/transform'; import { retentionPolicySchema, settingsSchema, sourceSchema, syncSchema } from './transforms'; diff --git a/x-pack/plugins/transform/server/routes/utils/error_utils.ts b/x-pack/plugins/transform/server/routes/utils/error_utils.ts index 7a9743eea8cf..0d3f05be45ad 100644 --- a/x-pack/plugins/transform/server/routes/utils/error_utils.ts +++ b/x-pack/plugins/transform/server/routes/utils/error_utils.ts @@ -11,12 +11,9 @@ import { i18n } from '@kbn/i18n'; import type { ResponseError, CustomHttpResponseOptions } from '@kbn/core/server'; -import type { - CommonResponseStatusSchema, - TransformIdsSchema, -} from '../../../common/api_schemas/common'; -import type { DeleteTransformsResponseSchema } from '../../../common/api_schemas/delete_transforms'; -import type { ResetTransformsResponseSchema } from '../../../common/api_schemas/reset_transforms'; +import type { CommonResponseStatusSchema, TransformIdsSchema } from '../api_schemas/common'; +import type { DeleteTransformsResponseSchema } from '../api_schemas/delete_transforms'; +import type { ResetTransformsResponseSchema } from '../api_schemas/reset_transforms'; const REQUEST_TIMEOUT = 'RequestTimeout'; diff --git a/x-pack/test/alerting_api_integration/spaces_only/tests/alerting/group2/transform_rule_types/transform_health/rule.ts b/x-pack/test/alerting_api_integration/spaces_only/tests/alerting/group2/transform_rule_types/transform_health/rule.ts index d3a3faacf7fd..49a8abe7cf92 100644 --- a/x-pack/test/alerting_api_integration/spaces_only/tests/alerting/group2/transform_rule_types/transform_health/rule.ts +++ b/x-pack/test/alerting_api_integration/spaces_only/tests/alerting/group2/transform_rule_types/transform_health/rule.ts @@ -6,7 +6,7 @@ */ import expect from '@kbn/expect'; -import { PutTransformsRequestSchema } from '@kbn/transform-plugin/common/api_schemas/transforms'; +import { PutTransformsRequestSchema } from '@kbn/transform-plugin/server/routes/api_schemas/transforms'; import { ESTestIndexTool, ES_TEST_INDEX_NAME } from '@kbn/alerting-api-integration-helpers'; import { ALERT_ACTION_GROUP, diff --git a/x-pack/test/api_integration/apis/transform/common.ts b/x-pack/test/api_integration/apis/transform/common.ts index e9d2b37e2f4f..e56afe0749e8 100644 --- a/x-pack/test/api_integration/apis/transform/common.ts +++ b/x-pack/test/api_integration/apis/transform/common.ts @@ -5,7 +5,7 @@ * 2.0. */ -import type { PutTransformsRequestSchema } from '@kbn/transform-plugin/common/api_schemas/transforms'; +import type { PutTransformsRequestSchema } from '@kbn/transform-plugin/server/routes/api_schemas/transforms'; export async function asyncForEach(array: any[], callback: Function) { for (let index = 0; index < array.length; index++) { diff --git a/x-pack/test/api_integration/apis/transform/delete_transforms.ts b/x-pack/test/api_integration/apis/transform/delete_transforms.ts index a064fd28b214..ecf3b03d8484 100644 --- a/x-pack/test/api_integration/apis/transform/delete_transforms.ts +++ b/x-pack/test/api_integration/apis/transform/delete_transforms.ts @@ -7,7 +7,7 @@ import expect from '@kbn/expect'; -import { DeleteTransformsRequestSchema } from '@kbn/transform-plugin/common/api_schemas/delete_transforms'; +import { DeleteTransformsRequestSchema } from '@kbn/transform-plugin/server/routes/api_schemas/delete_transforms'; import { TRANSFORM_STATE } from '@kbn/transform-plugin/common/constants'; import { getCommonRequestHeader } from '../../../functional/services/ml/common_api'; diff --git a/x-pack/test/api_integration/apis/transform/reauthorize_transforms.ts b/x-pack/test/api_integration/apis/transform/reauthorize_transforms.ts index 1b39c99275ce..acdba779e656 100644 --- a/x-pack/test/api_integration/apis/transform/reauthorize_transforms.ts +++ b/x-pack/test/api_integration/apis/transform/reauthorize_transforms.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { ReauthorizeTransformsRequestSchema } from '@kbn/transform-plugin/common/api_schemas/reauthorize_transforms'; +import { ReauthorizeTransformsRequestSchema } from '@kbn/transform-plugin/server/routes/api_schemas/reauthorize_transforms'; import expect from '@kbn/expect'; import { TRANSFORM_STATE } from '@kbn/transform-plugin/common/constants'; import type { SecurityCreateApiKeyResponse } from '@elastic/elasticsearch/lib/api/types'; diff --git a/x-pack/test/api_integration/apis/transform/reset_transforms.ts b/x-pack/test/api_integration/apis/transform/reset_transforms.ts index 4b42281fb6d7..5a805d148d9a 100644 --- a/x-pack/test/api_integration/apis/transform/reset_transforms.ts +++ b/x-pack/test/api_integration/apis/transform/reset_transforms.ts @@ -7,7 +7,7 @@ import expect from '@kbn/expect'; -import { ResetTransformsRequestSchema } from '@kbn/transform-plugin/common/api_schemas/reset_transforms'; +import { ResetTransformsRequestSchema } from '@kbn/transform-plugin/server/routes/api_schemas/reset_transforms'; import { TRANSFORM_STATE } from '@kbn/transform-plugin/common/constants'; import { getCommonRequestHeader } from '../../../functional/services/ml/common_api'; diff --git a/x-pack/test/api_integration/apis/transform/schedule_now_transforms.ts b/x-pack/test/api_integration/apis/transform/schedule_now_transforms.ts index 4f4ca51962c2..1579444c08bd 100644 --- a/x-pack/test/api_integration/apis/transform/schedule_now_transforms.ts +++ b/x-pack/test/api_integration/apis/transform/schedule_now_transforms.ts @@ -7,7 +7,7 @@ import expect from '@kbn/expect'; -import { ScheduleNowTransformsRequestSchema } from '@kbn/transform-plugin/common/api_schemas/schedule_now_transforms'; +import { ScheduleNowTransformsRequestSchema } from '@kbn/transform-plugin/server/routes/api_schemas/schedule_now_transforms'; import { getCommonRequestHeader } from '../../../functional/services/ml/common_api'; import { USER } from '../../../functional/services/transform/security_common'; diff --git a/x-pack/test/api_integration/apis/transform/start_transforms.ts b/x-pack/test/api_integration/apis/transform/start_transforms.ts index 7102ea90f27e..f18163aa9f96 100644 --- a/x-pack/test/api_integration/apis/transform/start_transforms.ts +++ b/x-pack/test/api_integration/apis/transform/start_transforms.ts @@ -7,7 +7,7 @@ import expect from '@kbn/expect'; -import { StartTransformsRequestSchema } from '@kbn/transform-plugin/common/api_schemas/start_transforms'; +import { StartTransformsRequestSchema } from '@kbn/transform-plugin/server/routes/api_schemas/start_transforms'; import { TRANSFORM_STATE } from '@kbn/transform-plugin/common/constants'; import { getCommonRequestHeader } from '../../../functional/services/ml/common_api'; diff --git a/x-pack/test/api_integration/apis/transform/stop_transforms.ts b/x-pack/test/api_integration/apis/transform/stop_transforms.ts index c982c6b45f1c..a685dc77e61f 100644 --- a/x-pack/test/api_integration/apis/transform/stop_transforms.ts +++ b/x-pack/test/api_integration/apis/transform/stop_transforms.ts @@ -7,8 +7,8 @@ import expect from '@kbn/expect'; -import type { PutTransformsRequestSchema } from '@kbn/transform-plugin/common/api_schemas/transforms'; -import type { StopTransformsRequestSchema } from '@kbn/transform-plugin/common/api_schemas/stop_transforms'; +import type { PutTransformsRequestSchema } from '@kbn/transform-plugin/server/routes/api_schemas/transforms'; +import type { StopTransformsRequestSchema } from '@kbn/transform-plugin/server/routes/api_schemas/stop_transforms'; import { TRANSFORM_STATE } from '@kbn/transform-plugin/common/constants'; diff --git a/x-pack/test/api_integration/apis/transform/transforms.ts b/x-pack/test/api_integration/apis/transform/transforms.ts index 2016876ba93a..d2ada2e4e7ce 100644 --- a/x-pack/test/api_integration/apis/transform/transforms.ts +++ b/x-pack/test/api_integration/apis/transform/transforms.ts @@ -7,7 +7,7 @@ import expect from '@kbn/expect'; -import type { GetTransformsResponseSchema } from '@kbn/transform-plugin/common/api_schemas/transforms'; +import type { GetTransformsResponseSchema } from '@kbn/transform-plugin/server/routes/api_schemas/transforms'; import { getCommonRequestHeader } from '../../../functional/services/ml/common_api'; import { USER } from '../../../functional/services/transform/security_common'; diff --git a/x-pack/test/api_integration/apis/transform/transforms_nodes.ts b/x-pack/test/api_integration/apis/transform/transforms_nodes.ts index 10f4413a8f85..80fc18300a93 100644 --- a/x-pack/test/api_integration/apis/transform/transforms_nodes.ts +++ b/x-pack/test/api_integration/apis/transform/transforms_nodes.ts @@ -7,7 +7,7 @@ import expect from '@kbn/expect'; -import type { GetTransformNodesResponseSchema } from '@kbn/transform-plugin/common/api_schemas/transforms'; +import type { GetTransformNodesResponseSchema } from '@kbn/transform-plugin/server/routes/api_schemas/transforms'; import { getCommonRequestHeader } from '../../../functional/services/ml/common_api'; import { USER } from '../../../functional/services/transform/security_common'; diff --git a/x-pack/test/api_integration/apis/transform/transforms_preview.ts b/x-pack/test/api_integration/apis/transform/transforms_preview.ts index 56a1000e57ac..d481f031be1e 100644 --- a/x-pack/test/api_integration/apis/transform/transforms_preview.ts +++ b/x-pack/test/api_integration/apis/transform/transforms_preview.ts @@ -7,7 +7,7 @@ import expect from '@kbn/expect'; -import type { PostTransformsPreviewRequestSchema } from '@kbn/transform-plugin/common/api_schemas/transforms'; +import type { PostTransformsPreviewRequestSchema } from '@kbn/transform-plugin/server/routes/api_schemas/transforms'; import { FtrProviderContext } from '../../ftr_provider_context'; import { getCommonRequestHeader } from '../../../functional/services/ml/common_api'; diff --git a/x-pack/test/api_integration/apis/transform/transforms_stats.ts b/x-pack/test/api_integration/apis/transform/transforms_stats.ts index 2eec1f4e17b9..e9063a5a12b6 100644 --- a/x-pack/test/api_integration/apis/transform/transforms_stats.ts +++ b/x-pack/test/api_integration/apis/transform/transforms_stats.ts @@ -7,7 +7,7 @@ import expect from '@kbn/expect'; -import type { GetTransformsStatsResponseSchema } from '@kbn/transform-plugin/common/api_schemas/transforms_stats'; +import type { GetTransformsStatsResponseSchema } from '@kbn/transform-plugin/server/routes/api_schemas/transforms_stats'; import { TRANSFORM_STATE, type TransformState } from '@kbn/transform-plugin/common/constants'; import { getCommonRequestHeader } from '../../../functional/services/ml/common_api'; diff --git a/x-pack/test/functional/services/transform/api.ts b/x-pack/test/functional/services/transform/api.ts index 15751c91253e..89eb65df40ec 100644 --- a/x-pack/test/functional/services/transform/api.ts +++ b/x-pack/test/functional/services/transform/api.ts @@ -7,12 +7,12 @@ import expect from '@kbn/expect'; -import type { PutTransformsRequestSchema } from '@kbn/transform-plugin/common/api_schemas/transforms'; +import type { PutTransformsRequestSchema } from '@kbn/transform-plugin/server/routes/api_schemas/transforms'; import { TransformState, TRANSFORM_STATE } from '@kbn/transform-plugin/common/constants'; import type { TransformStats } from '@kbn/transform-plugin/common/types/transform_stats'; -import type { GetTransformsResponseSchema } from '@kbn/transform-plugin/common/api_schemas/transforms'; -import type { PostTransformsUpdateRequestSchema } from '@kbn/transform-plugin/common/api_schemas/update_transforms'; +import type { GetTransformsResponseSchema } from '@kbn/transform-plugin/server/routes/api_schemas/transforms'; +import type { PostTransformsUpdateRequestSchema } from '@kbn/transform-plugin/server/routes/api_schemas/update_transforms'; import type { TransformPivotConfig } from '@kbn/transform-plugin/common/types/transform'; import type { IndicesCreateRequest } from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; import type { FtrProviderContext } from '../../ftr_provider_context'; diff --git a/x-pack/test_serverless/api_integration/services/transform/api.ts b/x-pack/test_serverless/api_integration/services/transform/api.ts index c865dcec6e8a..b96f8aeca2ad 100644 --- a/x-pack/test_serverless/api_integration/services/transform/api.ts +++ b/x-pack/test_serverless/api_integration/services/transform/api.ts @@ -9,10 +9,10 @@ import expect from '@kbn/expect'; import { TransformState, TRANSFORM_STATE } from '@kbn/transform-plugin/common/constants'; import type { TransformStats } from '@kbn/transform-plugin/common/types/transform_stats'; -import type { GetTransformsResponseSchema } from '@kbn/transform-plugin/common/api_schemas/transforms'; -import type { PostTransformsUpdateRequestSchema } from '@kbn/transform-plugin/common/api_schemas/update_transforms'; +import type { GetTransformsResponseSchema } from '@kbn/transform-plugin/server/routes/api_schemas/transforms'; +import type { PostTransformsUpdateRequestSchema } from '@kbn/transform-plugin/server/routes/api_schemas/update_transforms'; import type { TransformPivotConfig } from '@kbn/transform-plugin/common/types/transform'; -import type { PutTransformsRequestSchema } from '@kbn/transform-plugin/common/api_schemas/transforms'; +import type { PutTransformsRequestSchema } from '@kbn/transform-plugin/server/routes/api_schemas/transforms'; import { FtrProviderContext } from '../../ftr_provider_context'; export async function asyncForEach(array: any[], callback: Function) { diff --git a/x-pack/test_serverless/api_integration/test_suites/observability/slos/create_slo.ts b/x-pack/test_serverless/api_integration/test_suites/observability/slos/create_slo.ts index 3f0686f175fc..93aaa77e4e21 100644 --- a/x-pack/test_serverless/api_integration/test_suites/observability/slos/create_slo.ts +++ b/x-pack/test_serverless/api_integration/test_suites/observability/slos/create_slo.ts @@ -7,7 +7,7 @@ import { cleanup, generate } from '@kbn/infra-forge'; import expect from '@kbn/expect'; -import type { GetTransformsResponseSchema } from '@kbn/transform-plugin/common/api_schemas/transforms'; +import type { GetTransformsResponseSchema } from '@kbn/transform-plugin/server/routes/api_schemas/transforms'; import { SO_SLO_TYPE } from '@kbn/slo-plugin/server/saved_objects'; import { ALL_VALUE } from '@kbn/slo-schema'; import {