diff --git a/.eslintrc.js b/.eslintrc.js index 79ffa9ce75e14..b10228362151c 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -1607,9 +1607,9 @@ module.exports = { { // typescript for front and back end files: [ + 'x-pack/platform/plugins/shared/actions/**/*.{ts,tsx}', 'x-pack/platform/plugins/shared/alerting/**/*.{ts,tsx}', 'x-pack/platform/plugins/shared/stack_alerts/**/*.{ts,tsx}', - 'x-pack/platform/plugins/shared/actions/**/*.{ts,tsx}', 'x-pack/platform/plugins/shared/task_manager/**/*.{ts,tsx}', 'x-pack/platform/plugins/shared/event_log/**/*.{ts,tsx}', ], @@ -1628,6 +1628,20 @@ module.exports = { }, }, + /** + * ResponseOps overrides + */ + + { + files: [ + 'src/platform/packages/shared/response-ops/**/*.{ts, tsx}', + 'x-pack/platform/plugins/shared/alerting/**/*.{ts,tsx}', + ], + rules: { + '@typescript-eslint/consistent-type-imports': 'error', + }, + }, + /** * Lens overrides */ diff --git a/src/platform/packages/shared/response-ops/alerts-apis/apis/get_muted_alerts_instances_by_rule.ts b/src/platform/packages/shared/response-ops/alerts-apis/apis/get_muted_alerts_instances_by_rule.ts index ed05514d12401..85f78d10c9c29 100644 --- a/src/platform/packages/shared/response-ops/alerts-apis/apis/get_muted_alerts_instances_by_rule.ts +++ b/src/platform/packages/shared/response-ops/alerts-apis/apis/get_muted_alerts_instances_by_rule.ts @@ -7,7 +7,7 @@ * License v3.0 only", or the "Server Side Public License, v 1". */ -import { HttpStart } from '@kbn/core-http-browser'; +import type { HttpStart } from '@kbn/core-http-browser'; import { nodeBuilder } from '@kbn/es-query'; const INTERNAL_FIND_RULES_URL = '/internal/alerting/rules/_find'; diff --git a/src/platform/packages/shared/response-ops/alerts-apis/apis/mute_alert_instance.ts b/src/platform/packages/shared/response-ops/alerts-apis/apis/mute_alert_instance.ts index 76b26fc59a3d3..5a64316a130b3 100644 --- a/src/platform/packages/shared/response-ops/alerts-apis/apis/mute_alert_instance.ts +++ b/src/platform/packages/shared/response-ops/alerts-apis/apis/mute_alert_instance.ts @@ -7,7 +7,7 @@ * License v3.0 only", or the "Server Side Public License, v 1". */ -import { HttpSetup } from '@kbn/core/public'; +import type { HttpSetup } from '@kbn/core/public'; import { BASE_ALERTING_API_PATH } from '../constants'; export interface MuteAlertInstanceParams { diff --git a/src/platform/packages/shared/response-ops/alerts-apis/apis/unmute_alert_instance.ts b/src/platform/packages/shared/response-ops/alerts-apis/apis/unmute_alert_instance.ts index f1260712e2cf6..6d55013802182 100644 --- a/src/platform/packages/shared/response-ops/alerts-apis/apis/unmute_alert_instance.ts +++ b/src/platform/packages/shared/response-ops/alerts-apis/apis/unmute_alert_instance.ts @@ -7,7 +7,7 @@ * License v3.0 only", or the "Server Side Public License, v 1". */ -import { HttpSetup } from '@kbn/core/public'; +import type { HttpSetup } from '@kbn/core/public'; import { BASE_ALERTING_API_PATH } from '../constants'; export interface UnmuteAlertInstanceParams { diff --git a/src/platform/packages/shared/response-ops/alerts-apis/types.ts b/src/platform/packages/shared/response-ops/alerts-apis/types.ts index b7e19750f6868..77f70906e5620 100644 --- a/src/platform/packages/shared/response-ops/alerts-apis/types.ts +++ b/src/platform/packages/shared/response-ops/alerts-apis/types.ts @@ -7,7 +7,7 @@ * License v3.0 only", or the "Server Side Public License, v 1". */ -import { IHttpFetchError, ResponseErrorBody } from '@kbn/core-http-browser'; +import type { IHttpFetchError, ResponseErrorBody } from '@kbn/core-http-browser'; export type ServerError = IHttpFetchError; diff --git a/src/platform/packages/shared/response-ops/alerts-fields-browser/components/categories_badges/categories_badges.styles.ts b/src/platform/packages/shared/response-ops/alerts-fields-browser/components/categories_badges/categories_badges.styles.ts index a6fad874c2a6c..073e9fe6d13fd 100644 --- a/src/platform/packages/shared/response-ops/alerts-fields-browser/components/categories_badges/categories_badges.styles.ts +++ b/src/platform/packages/shared/response-ops/alerts-fields-browser/components/categories_badges/categories_badges.styles.ts @@ -8,7 +8,7 @@ */ import { css } from '@emotion/react'; -import { UseEuiTheme } from '@elastic/eui'; +import type { UseEuiTheme } from '@elastic/eui'; export const styles = { badgesGroup: ({ euiTheme }: { euiTheme: UseEuiTheme['euiTheme'] }) => css` diff --git a/src/platform/packages/shared/response-ops/alerts-fields-browser/components/field_table/field_table.styles.ts b/src/platform/packages/shared/response-ops/alerts-fields-browser/components/field_table/field_table.styles.ts index 6eaab01b01d9f..ce14cde1b8304 100644 --- a/src/platform/packages/shared/response-ops/alerts-fields-browser/components/field_table/field_table.styles.ts +++ b/src/platform/packages/shared/response-ops/alerts-fields-browser/components/field_table/field_table.styles.ts @@ -7,7 +7,7 @@ * License v3.0 only", or the "Server Side Public License, v 1". */ -import { UseEuiTheme } from '@elastic/eui'; +import type { UseEuiTheme } from '@elastic/eui'; import { css } from '@emotion/react'; export const styles = { diff --git a/src/platform/packages/shared/response-ops/alerts-fields-browser/helpers.ts b/src/platform/packages/shared/response-ops/alerts-fields-browser/helpers.ts index 9df810d7f4c75..c32c94c380aa3 100644 --- a/src/platform/packages/shared/response-ops/alerts-fields-browser/helpers.ts +++ b/src/platform/packages/shared/response-ops/alerts-fields-browser/helpers.ts @@ -7,12 +7,9 @@ * License v3.0 only", or the "Server Side Public License, v 1". */ -import { EcsMetadata } from '@kbn/alerts-as-data-utils/src/field_maps/types'; -import { - ALERT_CASE_IDS, - ALERT_MAINTENANCE_WINDOW_IDS, - DefaultAlertFieldName, -} from '@kbn/rule-data-utils'; +import type { EcsMetadata } from '@kbn/alerts-as-data-utils/src/field_maps/types'; +import type { DefaultAlertFieldName } from '@kbn/rule-data-utils'; +import { ALERT_CASE_IDS, ALERT_MAINTENANCE_WINDOW_IDS } from '@kbn/rule-data-utils'; import type { BrowserField, BrowserFields } from '@kbn/rule-registry-plugin/common'; import { isEmpty } from 'lodash/fp'; import { CASES, MAINTENANCE_WINDOWS } from './translations'; diff --git a/src/platform/packages/shared/response-ops/alerts-fields-browser/mock.ts b/src/platform/packages/shared/response-ops/alerts-fields-browser/mock.ts index 189078d135ef6..c14aff67511dc 100644 --- a/src/platform/packages/shared/response-ops/alerts-fields-browser/mock.ts +++ b/src/platform/packages/shared/response-ops/alerts-fields-browser/mock.ts @@ -7,7 +7,7 @@ * License v3.0 only", or the "Server Side Public License, v 1". */ -import { MappingRuntimeFields } from '@elastic/elasticsearch/lib/api/types'; +import type { MappingRuntimeFields } from '@elastic/elasticsearch/lib/api/types'; import type { BrowserFields } from '@kbn/rule-registry-plugin/common'; const DEFAULT_INDEX_PATTERN = [ diff --git a/src/platform/packages/shared/response-ops/alerts-table/apis/bulk_get_cases.ts b/src/platform/packages/shared/response-ops/alerts-table/apis/bulk_get_cases.ts index 08b6df7ba5078..28dc8ac34b07d 100644 --- a/src/platform/packages/shared/response-ops/alerts-table/apis/bulk_get_cases.ts +++ b/src/platform/packages/shared/response-ops/alerts-table/apis/bulk_get_cases.ts @@ -7,8 +7,8 @@ * License v3.0 only", or the "Server Side Public License, v 1". */ -import { CaseStatuses } from '@kbn/cases-components'; -import { HttpStart } from '@kbn/core-http-browser'; +import type { CaseStatuses } from '@kbn/cases-components'; +import type { HttpStart } from '@kbn/core-http-browser'; const INTERNAL_BULK_GET_CASES_URL = '/internal/cases/_bulk_get'; diff --git a/src/platform/packages/shared/response-ops/alerts-table/configuration.ts b/src/platform/packages/shared/response-ops/alerts-table/configuration.ts index 75e75785833c9..f334f82ba34cd 100644 --- a/src/platform/packages/shared/response-ops/alerts-table/configuration.ts +++ b/src/platform/packages/shared/response-ops/alerts-table/configuration.ts @@ -20,7 +20,7 @@ import { ALERT_STATUS, TIMESTAMP, } from '@kbn/rule-data-utils'; -import { SortCombinations } from '@elastic/elasticsearch/lib/api/types'; +import type { SortCombinations } from '@elastic/elasticsearch/lib/api/types'; import { i18n } from '@kbn/i18n'; import { FEATURE_LABEL } from './translations'; diff --git a/src/platform/packages/shared/response-ops/alerts-table/constants.ts b/src/platform/packages/shared/response-ops/alerts-table/constants.ts index 35892e9563a9d..21d554afe986c 100644 --- a/src/platform/packages/shared/response-ops/alerts-table/constants.ts +++ b/src/platform/packages/shared/response-ops/alerts-table/constants.ts @@ -7,7 +7,7 @@ * License v3.0 only", or the "Server Side Public License, v 1". */ -import { EuiIconType } from '@elastic/eui/src/components/icon/icon'; +import type { EuiIconType } from '@elastic/eui/src/components/icon/icon'; import { AlertConsumers } from '@kbn/rule-data-utils'; import type { SortCombinations } from '@elastic/elasticsearch/lib/api/types'; import { @@ -22,7 +22,7 @@ import { STACK_MONITORING_DISPLAY_NAME, UPTIME_DISPLAY_NAME, } from './translations'; -import { AlertsTableSupportedConsumers } from './types'; +import type { AlertsTableSupportedConsumers } from './types'; interface AlertProducerData { displayName: string; diff --git a/src/platform/packages/shared/response-ops/alerts-table/hooks/toggle_column.ts b/src/platform/packages/shared/response-ops/alerts-table/hooks/toggle_column.ts index a7ac433ae6970..d4ffda4a3408d 100644 --- a/src/platform/packages/shared/response-ops/alerts-table/hooks/toggle_column.ts +++ b/src/platform/packages/shared/response-ops/alerts-table/hooks/toggle_column.ts @@ -7,7 +7,7 @@ * License v3.0 only", or the "Server Side Public License, v 1". */ -import { EuiDataGridColumn } from '@elastic/eui'; +import type { EuiDataGridColumn } from '@elastic/eui'; import { ALERT_CASE_IDS, ALERT_MAINTENANCE_WINDOW_IDS } from '@kbn/rule-data-utils'; import * as i18n from '../translations'; diff --git a/src/platform/packages/shared/response-ops/alerts-table/hooks/use_bulk_actions.ts b/src/platform/packages/shared/response-ops/alerts-table/hooks/use_bulk_actions.ts index 5321aa6b865e9..ed31b4186bd47 100644 --- a/src/platform/packages/shared/response-ops/alerts-table/hooks/use_bulk_actions.ts +++ b/src/platform/packages/shared/response-ops/alerts-table/hooks/use_bulk_actions.ts @@ -7,8 +7,9 @@ * License v3.0 only", or the "Server Side Public License, v 1". */ -import React, { useCallback, useEffect, useMemo } from 'react'; -import { QueryDslQueryContainer } from '@elastic/elasticsearch/lib/api/types'; +import type React from 'react'; +import { useCallback, useEffect, useMemo } from 'react'; +import type { QueryDslQueryContainer } from '@elastic/elasticsearch/lib/api/types'; import { ALERT_CASE_IDS, isSiemRuleType } from '@kbn/rule-data-utils'; import type { HttpStart } from '@kbn/core-http-browser'; import type { NotificationsStart } from '@kbn/core-notifications-browser'; @@ -306,7 +307,7 @@ export function useBulkActions({ updateBulkActionsState({ action: BulkActionsVerbs.clear }); }, [updateBulkActionsState]); const setIsBulkActionsLoading = useCallback( - (isLoading: boolean = true) => { + (isLoading = true) => { updateBulkActionsState({ action: BulkActionsVerbs.updateAllLoadingState, isLoading }); }, [updateBulkActionsState] diff --git a/src/platform/packages/shared/response-ops/alerts-table/hooks/use_case_view_navigation.ts b/src/platform/packages/shared/response-ops/alerts-table/hooks/use_case_view_navigation.ts index ffceec3f6180b..14b2d2559e61f 100644 --- a/src/platform/packages/shared/response-ops/alerts-table/hooks/use_case_view_navigation.ts +++ b/src/platform/packages/shared/response-ops/alerts-table/hooks/use_case_view_navigation.ts @@ -10,7 +10,7 @@ import { generatePath } from 'react-router-dom'; import useObservable from 'react-use/lib/useObservable'; import { useCallback } from 'react'; -import { ApplicationStart } from '@kbn/core-application-browser'; +import type { ApplicationStart } from '@kbn/core-application-browser'; type NavigateToCaseView = (pathParams: { caseId: string }) => void; diff --git a/src/platform/packages/shared/response-ops/alerts-table/hooks/use_columns.ts b/src/platform/packages/shared/response-ops/alerts-table/hooks/use_columns.ts index 8c9b18d517a2e..59bb314ca0bb8 100644 --- a/src/platform/packages/shared/response-ops/alerts-table/hooks/use_columns.ts +++ b/src/platform/packages/shared/response-ops/alerts-table/hooks/use_columns.ts @@ -8,9 +8,9 @@ */ import { type MutableRefObject, useCallback, useEffect, useMemo, useRef, useState } from 'react'; -import { EuiDataGridColumn, EuiDataGridOnColumnResizeData } from '@elastic/eui'; -import { IStorageWrapper } from '@kbn/kibana-utils-plugin/public'; -import { BrowserField, BrowserFields } from '@kbn/alerting-types'; +import type { EuiDataGridColumn, EuiDataGridOnColumnResizeData } from '@elastic/eui'; +import type { IStorageWrapper } from '@kbn/kibana-utils-plugin/public'; +import type { BrowserField, BrowserFields } from '@kbn/alerting-types'; import { isEmpty } from 'lodash'; import { useFetchAlertsFieldsQuery } from '@kbn/alerts-ui-shared/src/common/hooks/use_fetch_alerts_fields_query'; import { AlertsQueryContext } from '@kbn/alerts-ui-shared/src/common/contexts/alerts_query_context'; diff --git a/src/platform/packages/shared/response-ops/alerts-table/hooks/use_pagination.test.ts b/src/platform/packages/shared/response-ops/alerts-table/hooks/use_pagination.test.ts index 76191f3e38c15..3c198ab6688a2 100644 --- a/src/platform/packages/shared/response-ops/alerts-table/hooks/use_pagination.test.ts +++ b/src/platform/packages/shared/response-ops/alerts-table/hooks/use_pagination.test.ts @@ -7,7 +7,8 @@ * License v3.0 only", or the "Server Side Public License, v 1". */ import { renderHook, act } from '@testing-library/react'; -import { PaginationProps, usePagination } from './use_pagination'; +import type { PaginationProps } from './use_pagination'; +import { usePagination } from './use_pagination'; describe('usePagination', () => { const onPageChange = jest.fn(); diff --git a/src/platform/packages/shared/response-ops/alerts-table/hooks/use_pagination.ts b/src/platform/packages/shared/response-ops/alerts-table/hooks/use_pagination.ts index 65121a983d3b4..4d198f1e40e05 100644 --- a/src/platform/packages/shared/response-ops/alerts-table/hooks/use_pagination.ts +++ b/src/platform/packages/shared/response-ops/alerts-table/hooks/use_pagination.ts @@ -10,7 +10,7 @@ import { useCallback, useEffect, useState } from 'react'; import type { RuleRegistrySearchRequestPagination } from '@kbn/rule-registry-plugin/common'; import { BulkActionsVerbs } from '../types'; -import { AdditionalContext, RenderContext } from '../types'; +import type { AdditionalContext, RenderContext } from '../types'; export type PaginationProps = RuleRegistrySearchRequestPagination & { bulkActionsStore: RenderContext['bulkActionsStore']; diff --git a/src/platform/packages/shared/response-ops/alerts-table/hooks/use_sorting.ts b/src/platform/packages/shared/response-ops/alerts-table/hooks/use_sorting.ts index d420fc6a414d3..5ecec1203a794 100644 --- a/src/platform/packages/shared/response-ops/alerts-table/hooks/use_sorting.ts +++ b/src/platform/packages/shared/response-ops/alerts-table/hooks/use_sorting.ts @@ -9,7 +9,7 @@ import type { SortCombinations } from '@elastic/elasticsearch/lib/api/types'; import type { EuiDataGridSorting } from '@elastic/eui'; -import { EuiDataGridColumnSortingConfig } from '@elastic/eui/src/components/datagrid/data_grid_types'; +import type { EuiDataGridColumnSortingConfig } from '@elastic/eui/src/components/datagrid/data_grid_types'; import { useCallback, useMemo, useState } from 'react'; import { defaultSort } from '../constants'; diff --git a/src/platform/packages/shared/response-ops/alerts-table/reducers/bulk_actions_reducer.ts b/src/platform/packages/shared/response-ops/alerts-table/reducers/bulk_actions_reducer.ts index c0c270baaecd8..1f67c7abd6327 100644 --- a/src/platform/packages/shared/response-ops/alerts-table/reducers/bulk_actions_reducer.ts +++ b/src/platform/packages/shared/response-ops/alerts-table/reducers/bulk_actions_reducer.ts @@ -7,7 +7,8 @@ * License v3.0 only", or the "Server Side Public License, v 1". */ -import { BulkActionsReducerAction, BulkActionsState, BulkActionsVerbs } from '../types'; +import type { BulkActionsReducerAction, BulkActionsState } from '../types'; +import { BulkActionsVerbs } from '../types'; const getAllRowsInPage = (rowCount: number) => new Map(Array.from(Array(rowCount).keys()).map((idx) => [idx, { isLoading: false }])); diff --git a/src/platform/packages/shared/response-ops/alerts-table/types.ts b/src/platform/packages/shared/response-ops/alerts-table/types.ts index 7d04983868e37..8479096c8194f 100644 --- a/src/platform/packages/shared/response-ops/alerts-table/types.ts +++ b/src/platform/packages/shared/response-ops/alerts-table/types.ts @@ -20,7 +20,7 @@ import type { RefAttributes, SetStateAction, } from 'react'; -import { +import type { AlertConsumers, ALERT_CASE_IDS, ALERT_STATUS, diff --git a/src/platform/packages/shared/response-ops/alerts-table/utils/react.ts b/src/platform/packages/shared/response-ops/alerts-table/utils/react.ts index fbd117e4c1378..7dc5504dd81c1 100644 --- a/src/platform/packages/shared/response-ops/alerts-table/utils/react.ts +++ b/src/platform/packages/shared/response-ops/alerts-table/utils/react.ts @@ -7,7 +7,9 @@ * License v3.0 only", or the "Server Side Public License, v 1". */ -import React, { forwardRef, memo, ReactElement } from 'react'; +import type { ReactElement } from 'react'; +import type React from 'react'; +import { forwardRef, memo } from 'react'; /** * A `React.memo` variant that keeps generic type information diff --git a/src/platform/packages/shared/response-ops/alerts-table/utils/storage.test.ts b/src/platform/packages/shared/response-ops/alerts-table/utils/storage.test.ts index b7e5c5c379a55..ea450a2f648ad 100644 --- a/src/platform/packages/shared/response-ops/alerts-table/utils/storage.test.ts +++ b/src/platform/packages/shared/response-ops/alerts-table/utils/storage.test.ts @@ -9,7 +9,7 @@ import type { MockedKeys } from '@kbn/utility-types-jest'; import { Storage } from './storage'; -import { IStorageWrapper, IStorage } from '@kbn/kibana-utils-plugin/public'; +import type { IStorageWrapper, IStorage } from '@kbn/kibana-utils-plugin/public'; const payload = { first: 'john', last: 'smith' }; const createMockStore = (): MockedKeys => { diff --git a/src/platform/packages/shared/response-ops/alerts-table/utils/storage.ts b/src/platform/packages/shared/response-ops/alerts-table/utils/storage.ts index 1ec42311c4310..d824c5d2146f8 100644 --- a/src/platform/packages/shared/response-ops/alerts-table/utils/storage.ts +++ b/src/platform/packages/shared/response-ops/alerts-table/utils/storage.ts @@ -33,7 +33,7 @@ export class Storage implements IStorageWrapper { } }; - public set = (key: string, value: any, includeUndefined: boolean = false) => { + public set = (key: string, value: any, includeUndefined = false) => { const replacer = includeUndefined ? (_: string, currentValue: any) => typeof currentValue === 'undefined' ? null : currentValue diff --git a/src/platform/packages/shared/response-ops/alerts-table/utils/test.ts b/src/platform/packages/shared/response-ops/alerts-table/utils/test.ts index 908127ff6850d..728e3288fbfd4 100644 --- a/src/platform/packages/shared/response-ops/alerts-table/utils/test.ts +++ b/src/platform/packages/shared/response-ops/alerts-table/utils/test.ts @@ -7,7 +7,7 @@ * License v3.0 only", or the "Server Side Public License, v 1". */ -import { DeepPartial } from 'utility-types'; +import type { DeepPartial } from 'utility-types'; import MaybeMockedDeep = jest.MaybeMockedDeep; /** diff --git a/src/platform/packages/shared/response-ops/rule_form/src/common/apis/create_rule/create_rule.test.ts b/src/platform/packages/shared/response-ops/rule_form/src/common/apis/create_rule/create_rule.test.ts index 1ce5bad0cb49c..7e3cbc3dd3b8b 100644 --- a/src/platform/packages/shared/response-ops/rule_form/src/common/apis/create_rule/create_rule.test.ts +++ b/src/platform/packages/shared/response-ops/rule_form/src/common/apis/create_rule/create_rule.test.ts @@ -8,9 +8,9 @@ */ import { httpServiceMock } from '@kbn/core/public/mocks'; -import { RuleTypeParams } from '../../types'; +import type { RuleTypeParams } from '../../types'; import { createRule } from './create_rule'; -import { CreateRuleBody } from './types'; +import type { CreateRuleBody } from './types'; const http = httpServiceMock.createStartContract(); diff --git a/src/platform/packages/shared/response-ops/rule_form/src/common/apis/create_rule/create_rule.ts b/src/platform/packages/shared/response-ops/rule_form/src/common/apis/create_rule/create_rule.ts index 571bb0712f6aa..b05813c080544 100644 --- a/src/platform/packages/shared/response-ops/rule_form/src/common/apis/create_rule/create_rule.ts +++ b/src/platform/packages/shared/response-ops/rule_form/src/common/apis/create_rule/create_rule.ts @@ -10,7 +10,8 @@ import type { HttpSetup } from '@kbn/core/public'; import type { AsApiContract } from '@kbn/actions-types'; import type { Rule } from '../../types'; -import { CreateRuleBody, transformCreateRuleBody } from '.'; +import type { CreateRuleBody } from '.'; +import { transformCreateRuleBody } from '.'; import { BASE_ALERTING_API_PATH } from '../../../constants'; import { transformRule } from '../../transformations'; diff --git a/src/platform/packages/shared/response-ops/rule_form/src/common/apis/create_rule/transform_create_rule_body.ts b/src/platform/packages/shared/response-ops/rule_form/src/common/apis/create_rule/transform_create_rule_body.ts index a90a94889545f..715b3529dd3b1 100644 --- a/src/platform/packages/shared/response-ops/rule_form/src/common/apis/create_rule/transform_create_rule_body.ts +++ b/src/platform/packages/shared/response-ops/rule_form/src/common/apis/create_rule/transform_create_rule_body.ts @@ -7,9 +7,9 @@ * License v3.0 only", or the "Server Side Public License, v 1". */ -import { RewriteResponseCase } from '@kbn/actions-types'; -import { CreateRuleBody } from './types'; -import { Rule } from '../../types'; +import type { RewriteResponseCase } from '@kbn/actions-types'; +import type { CreateRuleBody } from './types'; +import type { Rule } from '../../types'; const transformCreateRuleFlapping = (flapping: Rule['flapping']) => { if (!flapping) { diff --git a/src/platform/packages/shared/response-ops/rule_form/src/common/apis/create_rule/types.ts b/src/platform/packages/shared/response-ops/rule_form/src/common/apis/create_rule/types.ts index 79cc7e3e66294..996ea3cec4b72 100644 --- a/src/platform/packages/shared/response-ops/rule_form/src/common/apis/create_rule/types.ts +++ b/src/platform/packages/shared/response-ops/rule_form/src/common/apis/create_rule/types.ts @@ -7,7 +7,7 @@ * License v3.0 only", or the "Server Side Public License, v 1". */ -import { Rule, RuleTypeParams } from '../../types'; +import type { Rule, RuleTypeParams } from '../../types'; export interface CreateRuleBody { name: Rule['name']; diff --git a/src/platform/packages/shared/response-ops/rule_form/src/common/apis/fetch_rule_types.ts b/src/platform/packages/shared/response-ops/rule_form/src/common/apis/fetch_rule_types.ts index bf2da123b8cf5..5dfc67431169c 100644 --- a/src/platform/packages/shared/response-ops/rule_form/src/common/apis/fetch_rule_types.ts +++ b/src/platform/packages/shared/response-ops/rule_form/src/common/apis/fetch_rule_types.ts @@ -7,7 +7,7 @@ * License v3.0 only", or the "Server Side Public License, v 1". */ -import { HttpSetup } from '@kbn/core/public'; +import type { HttpSetup } from '@kbn/core/public'; import type { AsApiContract, RewriteRequestCase } from '@kbn/actions-types'; import type { RuleType } from '@kbn/triggers-actions-ui-types'; import { BASE_ALERTING_API_PATH } from '../../constants'; diff --git a/src/platform/packages/shared/response-ops/rule_form/src/common/apis/fetch_ui_config/fetch_ui_config.ts b/src/platform/packages/shared/response-ops/rule_form/src/common/apis/fetch_ui_config/fetch_ui_config.ts index 0e33bd0c6497a..165bbb054035c 100644 --- a/src/platform/packages/shared/response-ops/rule_form/src/common/apis/fetch_ui_config/fetch_ui_config.ts +++ b/src/platform/packages/shared/response-ops/rule_form/src/common/apis/fetch_ui_config/fetch_ui_config.ts @@ -9,7 +9,7 @@ import type { HttpStart } from '@kbn/core-http-browser'; import { BASE_TRIGGERS_ACTIONS_UI_API_PATH } from '../../../constants'; -import { UiConfig } from '.'; +import type { UiConfig } from '.'; export const fetchUiConfig = async ({ http }: { http: HttpStart }): Promise => { return http.get(`${BASE_TRIGGERS_ACTIONS_UI_API_PATH}/_config`); diff --git a/src/platform/packages/shared/response-ops/rule_form/src/common/apis/resolve_rule/resolve_rule.ts b/src/platform/packages/shared/response-ops/rule_form/src/common/apis/resolve_rule/resolve_rule.ts index 9d9141eae9765..5502e44ca36f2 100644 --- a/src/platform/packages/shared/response-ops/rule_form/src/common/apis/resolve_rule/resolve_rule.ts +++ b/src/platform/packages/shared/response-ops/rule_form/src/common/apis/resolve_rule/resolve_rule.ts @@ -7,11 +7,11 @@ * License v3.0 only", or the "Server Side Public License, v 1". */ -import { HttpSetup } from '@kbn/core-http-browser'; -import { AsApiContract } from '@kbn/actions-types'; +import type { HttpSetup } from '@kbn/core-http-browser'; +import type { AsApiContract } from '@kbn/actions-types'; import { INTERNAL_BASE_ALERTING_API_PATH } from '../../../constants'; import { transformResolvedRule } from '../../transformations'; -import { ResolvedRule } from '../../types'; +import type { ResolvedRule } from '../../types'; export async function resolveRule({ http, diff --git a/src/platform/packages/shared/response-ops/rule_form/src/common/apis/update_rule/transform_update_rule_body.test.ts b/src/platform/packages/shared/response-ops/rule_form/src/common/apis/update_rule/transform_update_rule_body.test.ts index a5cb53522e82f..afb8fb8cd2a8f 100644 --- a/src/platform/packages/shared/response-ops/rule_form/src/common/apis/update_rule/transform_update_rule_body.test.ts +++ b/src/platform/packages/shared/response-ops/rule_form/src/common/apis/update_rule/transform_update_rule_body.test.ts @@ -7,9 +7,9 @@ * License v3.0 only", or the "Server Side Public License, v 1". */ -import { RuleTypeParams } from '../../types'; +import type { RuleTypeParams } from '../../types'; import { transformUpdateRuleBody } from './transform_update_rule_body'; -import { UpdateRuleBody } from './types'; +import type { UpdateRuleBody } from './types'; const ruleToUpdate: UpdateRuleBody = { params: { diff --git a/src/platform/packages/shared/response-ops/rule_form/src/common/apis/update_rule/transform_update_rule_body.ts b/src/platform/packages/shared/response-ops/rule_form/src/common/apis/update_rule/transform_update_rule_body.ts index 9a719c24076f7..040f753c4710c 100644 --- a/src/platform/packages/shared/response-ops/rule_form/src/common/apis/update_rule/transform_update_rule_body.ts +++ b/src/platform/packages/shared/response-ops/rule_form/src/common/apis/update_rule/transform_update_rule_body.ts @@ -7,9 +7,9 @@ * License v3.0 only", or the "Server Side Public License, v 1". */ -import { RewriteResponseCase } from '@kbn/actions-types'; -import { UpdateRuleBody } from './types'; -import { Rule } from '../../types'; +import type { RewriteResponseCase } from '@kbn/actions-types'; +import type { UpdateRuleBody } from './types'; +import type { Rule } from '../../types'; const transformUpdateRuleFlapping = (flapping: Rule['flapping']) => { if (!flapping) { diff --git a/src/platform/packages/shared/response-ops/rule_form/src/common/apis/update_rule/update_rule.test.ts b/src/platform/packages/shared/response-ops/rule_form/src/common/apis/update_rule/update_rule.test.ts index ba70efececb4b..6bd398607458d 100644 --- a/src/platform/packages/shared/response-ops/rule_form/src/common/apis/update_rule/update_rule.test.ts +++ b/src/platform/packages/shared/response-ops/rule_form/src/common/apis/update_rule/update_rule.test.ts @@ -8,7 +8,8 @@ */ import { httpServiceMock } from '@kbn/core/public/mocks'; -import { updateRule, UpdateRuleBody } from '.'; +import type { UpdateRuleBody } from '.'; +import { updateRule } from '.'; const http = httpServiceMock.createStartContract(); diff --git a/src/platform/packages/shared/response-ops/rule_form/src/common/apis/update_rule/update_rule.ts b/src/platform/packages/shared/response-ops/rule_form/src/common/apis/update_rule/update_rule.ts index 413a23e5fb279..677d6e1b13711 100644 --- a/src/platform/packages/shared/response-ops/rule_form/src/common/apis/update_rule/update_rule.ts +++ b/src/platform/packages/shared/response-ops/rule_form/src/common/apis/update_rule/update_rule.ts @@ -7,14 +7,14 @@ * License v3.0 only", or the "Server Side Public License, v 1". */ -import { HttpSetup } from '@kbn/core/public'; +import type { HttpSetup } from '@kbn/core/public'; import { pick } from 'lodash'; -import { AsApiContract } from '@kbn/actions-types'; -import { UpdateRuleBody } from './types'; +import type { AsApiContract } from '@kbn/actions-types'; +import type { UpdateRuleBody } from './types'; import { BASE_ALERTING_API_PATH } from '../../../constants'; import { transformUpdateRuleBody } from './transform_update_rule_body'; import { transformRule } from '../../transformations'; -import { Rule } from '../../types'; +import type { Rule } from '../../types'; export const UPDATE_FIELDS: Array = [ 'name', diff --git a/src/platform/packages/shared/response-ops/rule_form/src/common/hooks/use_create_rule.ts b/src/platform/packages/shared/response-ops/rule_form/src/common/hooks/use_create_rule.ts index ebdfeeafbe2fd..5597497c597b7 100644 --- a/src/platform/packages/shared/response-ops/rule_form/src/common/hooks/use_create_rule.ts +++ b/src/platform/packages/shared/response-ops/rule_form/src/common/hooks/use_create_rule.ts @@ -9,8 +9,9 @@ import { useMutation } from '@tanstack/react-query'; import type { HttpStart, IHttpFetchError } from '@kbn/core-http-browser'; -import { createRule, CreateRuleBody } from '../apis/create_rule'; -import { Rule } from '../types'; +import type { CreateRuleBody } from '../apis/create_rule'; +import { createRule } from '../apis/create_rule'; +import type { Rule } from '../types'; export interface UseCreateRuleProps { http: HttpStart; diff --git a/src/platform/packages/shared/response-ops/rule_form/src/common/hooks/use_load_rule_type_aad_template_fields.ts b/src/platform/packages/shared/response-ops/rule_form/src/common/hooks/use_load_rule_type_aad_template_fields.ts index fd0f838631958..bab19dbaf1760 100644 --- a/src/platform/packages/shared/response-ops/rule_form/src/common/hooks/use_load_rule_type_aad_template_fields.ts +++ b/src/platform/packages/shared/response-ops/rule_form/src/common/hooks/use_load_rule_type_aad_template_fields.ts @@ -7,16 +7,16 @@ * License v3.0 only", or the "Server Side Public License, v 1". */ +import type { ActionVariable } from '@kbn/alerting-types'; import { useRef } from 'react'; import { isEmpty } from 'lodash'; -import { ActionVariable } from '@kbn/alerting-types'; import type { HttpStart } from '@kbn/core-http-browser'; import { useQuery } from '@tanstack/react-query'; import { fetchRuleTypeAadTemplateFields, getDescription, } from '@kbn/alerts-ui-shared/src/common/apis'; -import { FieldsMetadataPublicStart } from '@kbn/fields-metadata-plugin/public'; +import type { FieldsMetadataPublicStart } from '@kbn/fields-metadata-plugin/public'; export interface UseLoadRuleTypeAadTemplateFieldProps { http: HttpStart; diff --git a/src/platform/packages/shared/response-ops/rule_form/src/common/hooks/use_resolve_rule.ts b/src/platform/packages/shared/response-ops/rule_form/src/common/hooks/use_resolve_rule.ts index ea480b4039e86..2dfe646477b31 100644 --- a/src/platform/packages/shared/response-ops/rule_form/src/common/hooks/use_resolve_rule.ts +++ b/src/platform/packages/shared/response-ops/rule_form/src/common/hooks/use_resolve_rule.ts @@ -10,7 +10,7 @@ import { useQuery } from '@tanstack/react-query'; import type { HttpStart } from '@kbn/core-http-browser'; import { resolveRule } from '../apis/resolve_rule'; -import { RuleFormData } from '../../types'; +import type { RuleFormData } from '../../types'; export interface UseResolveProps { http: HttpStart; diff --git a/src/platform/packages/shared/response-ops/rule_form/src/common/hooks/use_update_rule.ts b/src/platform/packages/shared/response-ops/rule_form/src/common/hooks/use_update_rule.ts index 5764b8128ef42..dd9d9335e4542 100644 --- a/src/platform/packages/shared/response-ops/rule_form/src/common/hooks/use_update_rule.ts +++ b/src/platform/packages/shared/response-ops/rule_form/src/common/hooks/use_update_rule.ts @@ -9,8 +9,9 @@ import { useMutation } from '@tanstack/react-query'; import type { HttpStart, IHttpFetchError } from '@kbn/core-http-browser'; -import { updateRule, UpdateRuleBody } from '../apis/update_rule'; -import { Rule } from '../types'; +import type { UpdateRuleBody } from '../apis/update_rule'; +import { updateRule } from '../apis/update_rule'; +import type { Rule } from '../types'; export interface UseUpdateRuleProps { http: HttpStart; diff --git a/src/platform/packages/shared/response-ops/rule_form/src/common/test_utils/actions_test_utils.ts b/src/platform/packages/shared/response-ops/rule_form/src/common/test_utils/actions_test_utils.ts index 1551541013064..a936bd399c2be 100644 --- a/src/platform/packages/shared/response-ops/rule_form/src/common/test_utils/actions_test_utils.ts +++ b/src/platform/packages/shared/response-ops/rule_form/src/common/test_utils/actions_test_utils.ts @@ -7,9 +7,9 @@ * License v3.0 only", or the "Server Side Public License, v 1". */ -import { ActionType } from '@kbn/actions-types'; -import { RuleSystemAction } from '@kbn/alerting-types'; -import { +import type { ActionType } from '@kbn/actions-types'; +import type { RuleSystemAction } from '@kbn/alerting-types'; +import type { ActionConnector, ActionTypeModel, GenericValidationResult, diff --git a/src/platform/packages/shared/response-ops/rule_form/src/common/transformations/transform_rule.ts b/src/platform/packages/shared/response-ops/rule_form/src/common/transformations/transform_rule.ts index d1f11c4109ed1..b8e5453a4fef1 100644 --- a/src/platform/packages/shared/response-ops/rule_form/src/common/transformations/transform_rule.ts +++ b/src/platform/packages/shared/response-ops/rule_form/src/common/transformations/transform_rule.ts @@ -7,8 +7,8 @@ * License v3.0 only", or the "Server Side Public License, v 1". */ -import { AsApiContract, RewriteRequestCase } from '@kbn/actions-types'; -import { RuleExecutionStatus, RuleLastRun } from '@kbn/alerting-types'; +import type { AsApiContract, RewriteRequestCase } from '@kbn/actions-types'; +import type { RuleExecutionStatus, RuleLastRun } from '@kbn/alerting-types'; import { transformAction } from '@kbn/alerts-ui-shared/src/common/transformations'; import type { ResolvedRule, Rule, RuleUiAction } from '..'; diff --git a/src/platform/packages/shared/response-ops/rule_form/src/constants/index.ts b/src/platform/packages/shared/response-ops/rule_form/src/constants/index.ts index 556cc5dbf1b88..d9359c0138acf 100644 --- a/src/platform/packages/shared/response-ops/rule_form/src/constants/index.ts +++ b/src/platform/packages/shared/response-ops/rule_form/src/constants/index.ts @@ -8,14 +8,14 @@ */ import { RuleNotifyWhen } from '@kbn/alerting-types'; +import type { RuleCreationValidConsumer } from '@kbn/rule-data-utils'; import { AlertConsumers, ES_QUERY_ID, ML_ANOMALY_DETECTION_RULE_TYPE_ID, OBSERVABILITY_THRESHOLD_RULE_TYPE_ID, - RuleCreationValidConsumer, } from '@kbn/rule-data-utils'; -import { RuleFormData } from '../types'; +import type { RuleFormData } from '../types'; export * from './routes'; export * from './rule_flapping'; diff --git a/src/platform/packages/shared/response-ops/rule_form/src/hooks/use_load_dependencies.ts b/src/platform/packages/shared/response-ops/rule_form/src/hooks/use_load_dependencies.ts index ac1778336531f..8ae69bea6772c 100644 --- a/src/platform/packages/shared/response-ops/rule_form/src/hooks/use_load_dependencies.ts +++ b/src/platform/packages/shared/response-ops/rule_form/src/hooks/use_load_dependencies.ts @@ -10,14 +10,14 @@ import type { HttpStart } from '@kbn/core-http-browser'; import type { ToastsStart } from '@kbn/core-notifications-browser'; import type { ApplicationStart } from '@kbn/core-application-browser'; -import { RuleCreationValidConsumer } from '@kbn/rule-data-utils'; +import type { RuleCreationValidConsumer } from '@kbn/rule-data-utils'; import { useMemo } from 'react'; import { useHealthCheck, useLoadRuleTypesQuery, useFetchFlappingSettings, } from '@kbn/alerts-ui-shared'; -import { FieldsMetadataPublicStart } from '@kbn/fields-metadata-plugin/public'; +import type { FieldsMetadataPublicStart } from '@kbn/fields-metadata-plugin/public'; import { useLoadConnectors, useLoadConnectorTypes, diff --git a/src/platform/packages/shared/response-ops/rule_form/src/rule_form_state/rule_form_state_reducer.ts b/src/platform/packages/shared/response-ops/rule_form/src/rule_form_state/rule_form_state_reducer.ts index 78018215c9649..0a0bffeb62f56 100644 --- a/src/platform/packages/shared/response-ops/rule_form/src/rule_form_state/rule_form_state_reducer.ts +++ b/src/platform/packages/shared/response-ops/rule_form/src/rule_form_state/rule_form_state_reducer.ts @@ -7,10 +7,10 @@ * License v3.0 only", or the "Server Side Public License, v 1". */ -import { RuleActionParams } from '@kbn/alerting-types'; +import type { RuleActionParams } from '@kbn/alerting-types'; import { isEmpty, omit } from 'lodash'; -import { RuleFormActionsErrors, RuleFormParamsErrors, RuleUiAction } from '../common'; -import { RuleFormData, RuleFormState } from '../types'; +import type { RuleFormActionsErrors, RuleFormParamsErrors, RuleUiAction } from '../common'; +import type { RuleFormData, RuleFormState } from '../types'; import { validateRuleBase, validateRuleParams } from '../validation'; export type RuleFormStateReducerAction = diff --git a/src/platform/packages/shared/response-ops/rule_form/src/rule_type_modal/components/helpers/filter_and_count_rule_types.test.ts b/src/platform/packages/shared/response-ops/rule_form/src/rule_type_modal/components/helpers/filter_and_count_rule_types.test.ts index a03f119c5b97b..3fb6b0d16a5b1 100644 --- a/src/platform/packages/shared/response-ops/rule_form/src/rule_type_modal/components/helpers/filter_and_count_rule_types.test.ts +++ b/src/platform/packages/shared/response-ops/rule_form/src/rule_type_modal/components/helpers/filter_and_count_rule_types.test.ts @@ -7,7 +7,7 @@ * License v3.0 only", or the "Server Side Public License, v 1". */ -import { RuleTypeWithDescription } from '../../types'; +import type { RuleTypeWithDescription } from '../../types'; import { filterAndCountRuleTypes } from './filter_and_count_rule_types'; const mockRuleType: ( diff --git a/src/platform/packages/shared/response-ops/rule_form/src/rule_type_modal/components/helpers/filter_and_count_rule_types.ts b/src/platform/packages/shared/response-ops/rule_form/src/rule_type_modal/components/helpers/filter_and_count_rule_types.ts index 6a6b044e6f630..82b693eb7a331 100644 --- a/src/platform/packages/shared/response-ops/rule_form/src/rule_type_modal/components/helpers/filter_and_count_rule_types.ts +++ b/src/platform/packages/shared/response-ops/rule_form/src/rule_type_modal/components/helpers/filter_and_count_rule_types.ts @@ -8,7 +8,7 @@ */ import { countBy } from 'lodash'; -import { +import type { RuleTypeIndexWithDescriptions, RuleTypeCountsByProducer, RuleTypeWithDescription, diff --git a/src/platform/packages/shared/response-ops/rule_form/src/types.ts b/src/platform/packages/shared/response-ops/rule_form/src/types.ts index 294726c22e4fd..a11a3ff64d7a4 100644 --- a/src/platform/packages/shared/response-ops/rule_form/src/types.ts +++ b/src/platform/packages/shared/response-ops/rule_form/src/types.ts @@ -7,9 +7,8 @@ * License v3.0 only", or the "Server Side Public License, v 1". */ -import { ActionType } from '@kbn/actions-types'; -import { ActionVariable, RulesSettingsFlapping } from '@kbn/alerting-types'; -import type { ActionConnector, ActionTypeRegistryContract } from '@kbn/alerts-ui-shared'; +import type { ActionType } from '@kbn/actions-types'; +import type { ActionVariable, RulesSettingsFlapping } from '@kbn/alerting-types'; import type { ChartsPluginSetup } from '@kbn/charts-plugin/public'; import type { ApplicationStart } from '@kbn/core-application-browser'; import type { DocLinksStart } from '@kbn/core-doc-links-browser'; @@ -21,10 +20,11 @@ import type { SettingsStart } from '@kbn/core-ui-settings-browser'; import type { UserProfileService } from '@kbn/core-user-profile-browser'; import type { DataPublicPluginStart } from '@kbn/data-plugin/public'; import type { DataViewsPublicPluginStart } from '@kbn/data-views-plugin/public'; -import { RuleCreationValidConsumer } from '@kbn/rule-data-utils'; +import type { RuleCreationValidConsumer } from '@kbn/rule-data-utils'; import type { UnifiedSearchPublicPluginStart } from '@kbn/unified-search-plugin/public'; -import { FieldsMetadataPublicStart } from '@kbn/fields-metadata-plugin/public'; -import { +import type { ActionConnector, ActionTypeRegistryContract } from '@kbn/alerts-ui-shared'; +import type { FieldsMetadataPublicStart } from '@kbn/fields-metadata-plugin/public'; +import type { MinimumScheduleInterval, Rule, RuleFormActionsErrors, diff --git a/src/platform/packages/shared/response-ops/rule_form/src/utils/get_authorized_consumers.ts b/src/platform/packages/shared/response-ops/rule_form/src/utils/get_authorized_consumers.ts index 7495c3e19331d..17ddaf5f59fd7 100644 --- a/src/platform/packages/shared/response-ops/rule_form/src/utils/get_authorized_consumers.ts +++ b/src/platform/packages/shared/response-ops/rule_form/src/utils/get_authorized_consumers.ts @@ -7,8 +7,8 @@ * License v3.0 only", or the "Server Side Public License, v 1". */ -import { RuleCreationValidConsumer } from '@kbn/rule-data-utils'; -import { RuleTypeWithDescription } from '../common/types'; +import type { RuleCreationValidConsumer } from '@kbn/rule-data-utils'; +import type { RuleTypeWithDescription } from '../common/types'; export const getAuthorizedConsumers = ({ ruleType, diff --git a/src/platform/packages/shared/response-ops/rule_form/src/utils/get_authorized_rule_types.ts b/src/platform/packages/shared/response-ops/rule_form/src/utils/get_authorized_rule_types.ts index ab505b64a5cb2..8aa71b4e16fce 100644 --- a/src/platform/packages/shared/response-ops/rule_form/src/utils/get_authorized_rule_types.ts +++ b/src/platform/packages/shared/response-ops/rule_form/src/utils/get_authorized_rule_types.ts @@ -7,8 +7,12 @@ * License v3.0 only", or the "Server Side Public License, v 1". */ -import { RuleCreationValidConsumer } from '@kbn/rule-data-utils'; -import { RuleTypeModel, RuleTypeRegistryContract, RuleTypeWithDescription } from '../common/types'; +import type { RuleCreationValidConsumer } from '@kbn/rule-data-utils'; +import type { + RuleTypeModel, + RuleTypeRegistryContract, + RuleTypeWithDescription, +} from '../common/types'; import { ALERTING_FEATURE_ID, MULTI_CONSUMER_RULE_TYPE_IDS } from '../constants'; export type RuleTypeItems = Array<{ diff --git a/src/platform/packages/shared/response-ops/rule_form/src/utils/get_initial_consumer.ts b/src/platform/packages/shared/response-ops/rule_form/src/utils/get_initial_consumer.ts index 0a78adb1874f2..224c79da207fd 100644 --- a/src/platform/packages/shared/response-ops/rule_form/src/utils/get_initial_consumer.ts +++ b/src/platform/packages/shared/response-ops/rule_form/src/utils/get_initial_consumer.ts @@ -7,7 +7,7 @@ * License v3.0 only", or the "Server Side Public License, v 1". */ -import { RuleTypeWithDescription } from '../common'; +import type { RuleTypeWithDescription } from '../common'; import { MULTI_CONSUMER_RULE_TYPE_IDS } from '../constants'; export const getInitialConsumer = ({ diff --git a/src/platform/packages/shared/response-ops/rule_form/src/utils/get_initial_multi_consumer.test.ts b/src/platform/packages/shared/response-ops/rule_form/src/utils/get_initial_multi_consumer.test.ts index 0a233a1352b73..6a05076c00b69 100644 --- a/src/platform/packages/shared/response-ops/rule_form/src/utils/get_initial_multi_consumer.test.ts +++ b/src/platform/packages/shared/response-ops/rule_form/src/utils/get_initial_multi_consumer.test.ts @@ -7,7 +7,7 @@ * License v3.0 only", or the "Server Side Public License, v 1". */ -import { RuleTypeWithDescription } from '@kbn/alerts-ui-shared'; +import type { RuleTypeWithDescription } from '@kbn/alerts-ui-shared'; import { getInitialMultiConsumer } from './get_initial_multi_consumer'; describe('getInitialMultiConsumer', () => { diff --git a/src/platform/packages/shared/response-ops/rule_form/src/utils/get_initial_multi_consumer.ts b/src/platform/packages/shared/response-ops/rule_form/src/utils/get_initial_multi_consumer.ts index 66498ef535e9e..a560d57bd686b 100644 --- a/src/platform/packages/shared/response-ops/rule_form/src/utils/get_initial_multi_consumer.ts +++ b/src/platform/packages/shared/response-ops/rule_form/src/utils/get_initial_multi_consumer.ts @@ -7,8 +7,9 @@ * License v3.0 only", or the "Server Side Public License, v 1". */ -import { AlertConsumers, RuleCreationValidConsumer } from '@kbn/rule-data-utils'; -import { RuleTypeWithDescription } from '../common/types'; +import type { RuleCreationValidConsumer } from '@kbn/rule-data-utils'; +import { AlertConsumers } from '@kbn/rule-data-utils'; +import type { RuleTypeWithDescription } from '../common/types'; import { MULTI_CONSUMER_RULE_TYPE_IDS } from '../constants'; import { FEATURE_NAME_MAP } from '../translations'; import { getAuthorizedConsumers } from './get_authorized_consumers'; diff --git a/src/platform/packages/shared/response-ops/rule_form/src/utils/get_initial_schedule.ts b/src/platform/packages/shared/response-ops/rule_form/src/utils/get_initial_schedule.ts index d8227e68346ca..a0007faeab3bd 100644 --- a/src/platform/packages/shared/response-ops/rule_form/src/utils/get_initial_schedule.ts +++ b/src/platform/packages/shared/response-ops/rule_form/src/utils/get_initial_schedule.ts @@ -9,8 +9,8 @@ import { parseDuration } from './parse_duration'; import { DEFAULT_RULE_INTERVAL } from '../constants'; -import { MinimumScheduleInterval, RuleTypeWithDescription } from '../common/types'; -import { RuleFormData } from '../types'; +import type { MinimumScheduleInterval, RuleTypeWithDescription } from '../common/types'; +import type { RuleFormData } from '../types'; const getInitialInterval = (interval: string) => { if (parseDuration(interval) > parseDuration(DEFAULT_RULE_INTERVAL)) { diff --git a/src/platform/packages/shared/response-ops/rule_form/src/utils/get_selected_action_group.test.ts b/src/platform/packages/shared/response-ops/rule_form/src/utils/get_selected_action_group.test.ts index 95928a5fec648..6e2fd6afeb707 100644 --- a/src/platform/packages/shared/response-ops/rule_form/src/utils/get_selected_action_group.test.ts +++ b/src/platform/packages/shared/response-ops/rule_form/src/utils/get_selected_action_group.test.ts @@ -7,7 +7,7 @@ * License v3.0 only", or the "Server Side Public License, v 1". */ -import { RuleTypeModel, RuleTypeParams, RuleTypeWithDescription } from '../common'; +import type { RuleTypeModel, RuleTypeParams, RuleTypeWithDescription } from '../common'; import { getActionGroups, getSelectedActionGroup } from './get_selected_action_group'; describe('getActionGroups', () => { diff --git a/src/platform/packages/shared/response-ops/rule_form/src/utils/get_selected_action_group.ts b/src/platform/packages/shared/response-ops/rule_form/src/utils/get_selected_action_group.ts index e6d2baf3777d4..a8c512d06584b 100644 --- a/src/platform/packages/shared/response-ops/rule_form/src/utils/get_selected_action_group.ts +++ b/src/platform/packages/shared/response-ops/rule_form/src/utils/get_selected_action_group.ts @@ -8,7 +8,7 @@ */ import { i18n } from '@kbn/i18n'; -import { RuleTypeModel, RuleTypeParams, RuleTypeWithDescription } from '../common'; +import type { RuleTypeModel, RuleTypeParams, RuleTypeWithDescription } from '../common'; const recoveredActionGroupMessage = i18n.translate( 'responseOpsRuleForm.actionForm.actionGroupRecoveredMessage', diff --git a/src/platform/packages/shared/response-ops/rule_form/src/utils/has_fields_for_aad.test.ts b/src/platform/packages/shared/response-ops/rule_form/src/utils/has_fields_for_aad.test.ts index 85204661edda2..4eec273055c69 100644 --- a/src/platform/packages/shared/response-ops/rule_form/src/utils/has_fields_for_aad.test.ts +++ b/src/platform/packages/shared/response-ops/rule_form/src/utils/has_fields_for_aad.test.ts @@ -8,7 +8,7 @@ */ import { AlertConsumers } from '@kbn/rule-data-utils'; -import { RuleTypeWithDescription } from '../common/types'; +import type { RuleTypeWithDescription } from '../common/types'; import { hasFieldsForAad } from './has_fields_for_aad'; describe('hasFieldsForAad', () => { diff --git a/src/platform/packages/shared/response-ops/rule_form/src/utils/has_fields_for_aad.ts b/src/platform/packages/shared/response-ops/rule_form/src/utils/has_fields_for_aad.ts index c46a96696d2e3..22c6a9cb5e238 100644 --- a/src/platform/packages/shared/response-ops/rule_form/src/utils/has_fields_for_aad.ts +++ b/src/platform/packages/shared/response-ops/rule_form/src/utils/has_fields_for_aad.ts @@ -7,8 +7,9 @@ * License v3.0 only", or the "Server Side Public License, v 1". */ -import { AlertConsumers, RuleCreationValidConsumer } from '@kbn/rule-data-utils'; -import { RuleTypeWithDescription } from '../common/types'; +import type { RuleCreationValidConsumer } from '@kbn/rule-data-utils'; +import { AlertConsumers } from '@kbn/rule-data-utils'; +import type { RuleTypeWithDescription } from '../common/types'; export const hasFieldsForAad = ({ ruleType, diff --git a/src/platform/packages/shared/response-ops/rule_form/src/validation/validate_form.test.ts b/src/platform/packages/shared/response-ops/rule_form/src/validation/validate_form.test.ts index 7db84ffa51477..f9ecd9c0b105e 100644 --- a/src/platform/packages/shared/response-ops/rule_form/src/validation/validate_form.test.ts +++ b/src/platform/packages/shared/response-ops/rule_form/src/validation/validate_form.test.ts @@ -13,7 +13,7 @@ import { hasRuleErrors, validateAction, } from './validate_form'; -import { RuleFormData } from '../types'; +import type { RuleFormData } from '../types'; import { CONSUMER_REQUIRED_TEXT, INTERVAL_MINIMUM_TEXT, @@ -23,7 +23,7 @@ import { RULE_TYPE_REQUIRED_TEXT, } from '../translations'; import { formatDuration } from '../utils'; -import { RuleTypeModel } from '../common'; +import type { RuleTypeModel } from '../common'; import { getAction } from '../common/test_utils/actions_test_utils'; const formDataMock: RuleFormData = { diff --git a/src/platform/packages/shared/response-ops/rule_form/src/validation/validate_form.ts b/src/platform/packages/shared/response-ops/rule_form/src/validation/validate_form.ts index de1e0ac9b1d80..6139d3504f918 100644 --- a/src/platform/packages/shared/response-ops/rule_form/src/validation/validate_form.ts +++ b/src/platform/packages/shared/response-ops/rule_form/src/validation/validate_form.ts @@ -9,7 +9,7 @@ import { isObject } from 'lodash'; import { i18n } from '@kbn/i18n'; -import { RuleFormData } from '../types'; +import type { RuleFormData } from '../types'; import { parseDuration, formatDuration } from '../utils'; import { NAME_REQUIRED_TEXT, @@ -19,7 +19,7 @@ import { INTERVAL_MINIMUM_TEXT, RULE_ALERT_DELAY_BELOW_MINIMUM_TEXT, } from '../translations'; -import { +import type { MinimumScheduleInterval, RuleFormActionsErrors, RuleFormBaseErrors, diff --git a/src/platform/packages/shared/response-ops/rule_form/src/validation/validate_params_for_warnings.test.ts b/src/platform/packages/shared/response-ops/rule_form/src/validation/validate_params_for_warnings.test.ts index 021c869d78c1a..fc7e7eeb531dd 100644 --- a/src/platform/packages/shared/response-ops/rule_form/src/validation/validate_params_for_warnings.test.ts +++ b/src/platform/packages/shared/response-ops/rule_form/src/validation/validate_params_for_warnings.test.ts @@ -7,7 +7,7 @@ * License v3.0 only", or the "Server Side Public License, v 1". */ -import { ActionVariable } from '@kbn/alerting-types'; +import type { ActionVariable } from '@kbn/alerting-types'; import { validateParamsForWarnings } from './validate_params_for_warnings'; describe('validateParamsForWarnings', () => { diff --git a/src/platform/packages/shared/response-ops/rule_form/src/validation/validate_params_for_warnings.ts b/src/platform/packages/shared/response-ops/rule_form/src/validation/validate_params_for_warnings.ts index 943de227b1c58..d021a4993bd7d 100644 --- a/src/platform/packages/shared/response-ops/rule_form/src/validation/validate_params_for_warnings.ts +++ b/src/platform/packages/shared/response-ops/rule_form/src/validation/validate_params_for_warnings.ts @@ -10,7 +10,7 @@ import { i18n } from '@kbn/i18n'; import Mustache from 'mustache'; import { some } from 'lodash'; -import { ActionVariable, RuleActionParam } from '@kbn/alerting-types'; +import type { ActionVariable, RuleActionParam } from '@kbn/alerting-types'; const publicUrlWarning = i18n.translate('responseOpsRuleForm.ruleForm.actionsForm.publicBaseUrl', { defaultMessage: diff --git a/src/platform/packages/shared/response-ops/rule_params/apm_anomaly/v1.ts b/src/platform/packages/shared/response-ops/rule_params/apm_anomaly/v1.ts index 9e550815602a8..26bdabcad6b32 100644 --- a/src/platform/packages/shared/response-ops/rule_params/apm_anomaly/v1.ts +++ b/src/platform/packages/shared/response-ops/rule_params/apm_anomaly/v1.ts @@ -7,7 +7,8 @@ * License v3.0 only", or the "Server Side Public License, v 1". */ -import { TypeOf, schema } from '@kbn/config-schema'; +import type { TypeOf } from '@kbn/config-schema'; +import { schema } from '@kbn/config-schema'; import { ML_ANOMALY_SEVERITY } from '@kbn/ml-anomaly-utils/anomaly_severity'; export enum AnomalyDetectorType { diff --git a/src/platform/packages/shared/response-ops/rule_params/common/data_view_spec_schema.ts b/src/platform/packages/shared/response-ops/rule_params/common/data_view_spec_schema.ts index 88fd0ff91e417..ff9075fc80309 100644 --- a/src/platform/packages/shared/response-ops/rule_params/common/data_view_spec_schema.ts +++ b/src/platform/packages/shared/response-ops/rule_params/common/data_view_spec_schema.ts @@ -7,12 +7,10 @@ * License v3.0 only", or the "Server Side Public License, v 1". */ -import { schema, Type } from '@kbn/config-schema'; -import { - MAX_DATA_VIEW_FIELD_DESCRIPTION_LENGTH, - RUNTIME_FIELD_TYPES, - RUNTIME_FIELD_TYPES2, -} from './constants'; +import type { Type } from '@kbn/config-schema'; +import { schema } from '@kbn/config-schema'; +import type { RUNTIME_FIELD_TYPES } from './constants'; +import { MAX_DATA_VIEW_FIELD_DESCRIPTION_LENGTH, RUNTIME_FIELD_TYPES2 } from './constants'; /** * Runtime field types diff --git a/src/platform/packages/shared/response-ops/rule_params/common/search_configuration_schema.ts b/src/platform/packages/shared/response-ops/rule_params/common/search_configuration_schema.ts index 50b1f3ed1a561..ebdd1ac1537b9 100644 --- a/src/platform/packages/shared/response-ops/rule_params/common/search_configuration_schema.ts +++ b/src/platform/packages/shared/response-ops/rule_params/common/search_configuration_schema.ts @@ -7,7 +7,8 @@ * License v3.0 only", or the "Server Side Public License, v 1". */ -import { TypeOf, schema } from '@kbn/config-schema'; +import type { TypeOf } from '@kbn/config-schema'; +import { schema } from '@kbn/config-schema'; export const searchConfigurationSchema = schema.object({ query: schema.object({ diff --git a/src/platform/packages/shared/response-ops/rule_params/error_count/v1.ts b/src/platform/packages/shared/response-ops/rule_params/error_count/v1.ts index cbbd6742bf235..0fbc21609bff7 100644 --- a/src/platform/packages/shared/response-ops/rule_params/error_count/v1.ts +++ b/src/platform/packages/shared/response-ops/rule_params/error_count/v1.ts @@ -7,7 +7,8 @@ * License v3.0 only", or the "Server Side Public License, v 1". */ -import { TypeOf, schema } from '@kbn/config-schema'; +import type { TypeOf } from '@kbn/config-schema'; +import { schema } from '@kbn/config-schema'; import { searchConfigurationSchema } from '../common/search_configuration_schema'; export const errorCountParamsSchema = schema.object({ diff --git a/src/platform/packages/shared/response-ops/rule_params/es_query/v1.ts b/src/platform/packages/shared/response-ops/rule_params/es_query/v1.ts index db2b32b0342f9..2941e1519e2e1 100644 --- a/src/platform/packages/shared/response-ops/rule_params/es_query/v1.ts +++ b/src/platform/packages/shared/response-ops/rule_params/es_query/v1.ts @@ -6,7 +6,8 @@ * your election, the "Elastic License 2.0", the "GNU Affero General Public * License v3.0 only", or the "Server Side Public License, v 1". */ -import { schema, TypeOf } from '@kbn/config-schema'; +import type { TypeOf } from '@kbn/config-schema'; +import { schema } from '@kbn/config-schema'; import { i18n } from '@kbn/i18n'; import { diff --git a/src/platform/packages/shared/response-ops/rule_params/geo_containment/v1.ts b/src/platform/packages/shared/response-ops/rule_params/geo_containment/v1.ts index 2e13f368cfa74..09a937c929744 100644 --- a/src/platform/packages/shared/response-ops/rule_params/geo_containment/v1.ts +++ b/src/platform/packages/shared/response-ops/rule_params/geo_containment/v1.ts @@ -7,7 +7,8 @@ * License v3.0 only", or the "Server Side Public License, v 1". */ -import { schema, TypeOf } from '@kbn/config-schema'; +import type { TypeOf } from '@kbn/config-schema'; +import { schema } from '@kbn/config-schema'; export const trackingContainmentRuleParamsSchema = schema.object({ index: schema.string({ minLength: 1 }), diff --git a/src/platform/packages/shared/response-ops/rule_params/index_threshold/v1.ts b/src/platform/packages/shared/response-ops/rule_params/index_threshold/v1.ts index aa794ce3c878e..fcf91f73f80ec 100644 --- a/src/platform/packages/shared/response-ops/rule_params/index_threshold/v1.ts +++ b/src/platform/packages/shared/response-ops/rule_params/index_threshold/v1.ts @@ -7,7 +7,8 @@ * License v3.0 only", or the "Server Side Public License, v 1". */ -import { schema, TypeOf } from '@kbn/config-schema'; +import type { TypeOf } from '@kbn/config-schema'; +import { schema } from '@kbn/config-schema'; import { i18n } from '@kbn/i18n'; import { MAX_GROUPS } from '../common/constants'; diff --git a/src/platform/packages/shared/response-ops/rule_params/metric_inventory_threshold/v1.ts b/src/platform/packages/shared/response-ops/rule_params/metric_inventory_threshold/v1.ts index 59b74200f2f12..756e9d4290560 100644 --- a/src/platform/packages/shared/response-ops/rule_params/metric_inventory_threshold/v1.ts +++ b/src/platform/packages/shared/response-ops/rule_params/metric_inventory_threshold/v1.ts @@ -7,12 +7,13 @@ * License v3.0 only", or the "Server Side Public License, v 1". */ -import { schema, Type } from '@kbn/config-schema'; +import type { Type } from '@kbn/config-schema'; +import { schema } from '@kbn/config-schema'; import { COMPARATORS } from '@kbn/alerting-comparators'; +import type { TimeUnitChar } from '../common/utils'; import { LEGACY_COMPARATORS, - TimeUnitChar, oneOfLiterals, validateIsStringElasticsearchJSONFilter, } from '../common/utils'; diff --git a/src/platform/packages/shared/response-ops/rule_params/synthetics_monitor_status/v1.ts b/src/platform/packages/shared/response-ops/rule_params/synthetics_monitor_status/v1.ts index b2356b2630455..8409cac085526 100644 --- a/src/platform/packages/shared/response-ops/rule_params/synthetics_monitor_status/v1.ts +++ b/src/platform/packages/shared/response-ops/rule_params/synthetics_monitor_status/v1.ts @@ -7,7 +7,8 @@ * License v3.0 only", or the "Server Side Public License, v 1". */ -import { TypeOf, schema } from '@kbn/config-schema'; +import type { TypeOf } from '@kbn/config-schema'; +import { schema } from '@kbn/config-schema'; const TimeWindowSchema = schema.object({ unit: schema.oneOf( diff --git a/src/platform/packages/shared/response-ops/rule_params/synthetics_tls/v1.ts b/src/platform/packages/shared/response-ops/rule_params/synthetics_tls/v1.ts index 6bf7c0ffbd744..9aa7408d65624 100644 --- a/src/platform/packages/shared/response-ops/rule_params/synthetics_tls/v1.ts +++ b/src/platform/packages/shared/response-ops/rule_params/synthetics_tls/v1.ts @@ -7,7 +7,8 @@ * License v3.0 only", or the "Server Side Public License, v 1". */ -import { TypeOf, schema } from '@kbn/config-schema'; +import type { TypeOf } from '@kbn/config-schema'; +import { schema } from '@kbn/config-schema'; export const tlsRuleParamsSchema = schema.object( { diff --git a/src/platform/packages/shared/response-ops/rule_params/transaction_duration/v1.ts b/src/platform/packages/shared/response-ops/rule_params/transaction_duration/v1.ts index ab80398666607..d1aa94908515e 100644 --- a/src/platform/packages/shared/response-ops/rule_params/transaction_duration/v1.ts +++ b/src/platform/packages/shared/response-ops/rule_params/transaction_duration/v1.ts @@ -7,7 +7,8 @@ * License v3.0 only", or the "Server Side Public License, v 1". */ -import { TypeOf, schema } from '@kbn/config-schema'; +import type { TypeOf } from '@kbn/config-schema'; +import { schema } from '@kbn/config-schema'; import { searchConfigurationSchema } from '../common/search_configuration_schema'; export enum AggregationType { diff --git a/src/platform/packages/shared/response-ops/rule_params/transaction_error_rate/v1.ts b/src/platform/packages/shared/response-ops/rule_params/transaction_error_rate/v1.ts index 452279d8ddd19..f413ec94d8a89 100644 --- a/src/platform/packages/shared/response-ops/rule_params/transaction_error_rate/v1.ts +++ b/src/platform/packages/shared/response-ops/rule_params/transaction_error_rate/v1.ts @@ -7,7 +7,8 @@ * License v3.0 only", or the "Server Side Public License, v 1". */ -import { TypeOf, schema } from '@kbn/config-schema'; +import type { TypeOf } from '@kbn/config-schema'; +import { schema } from '@kbn/config-schema'; import { searchConfigurationSchema } from '../common/search_configuration_schema'; export const transactionErrorRateParamsSchema = schema.object({ diff --git a/src/platform/packages/shared/response-ops/rule_params/transform_health/v1.ts b/src/platform/packages/shared/response-ops/rule_params/transform_health/v1.ts index bba2815ab0ba9..0fd4db22fcb28 100644 --- a/src/platform/packages/shared/response-ops/rule_params/transform_health/v1.ts +++ b/src/platform/packages/shared/response-ops/rule_params/transform_health/v1.ts @@ -7,7 +7,8 @@ * License v3.0 only", or the "Server Side Public License, v 1". */ -import { schema, TypeOf } from '@kbn/config-schema'; +import type { TypeOf } from '@kbn/config-schema'; +import { schema } from '@kbn/config-schema'; export const transformHealthRuleParamsSchema = schema.object({ includeTransforms: schema.arrayOf(schema.string()), diff --git a/src/platform/packages/shared/response-ops/rule_params/uptime_duration_anomaly/v1.ts b/src/platform/packages/shared/response-ops/rule_params/uptime_duration_anomaly/v1.ts index f3cb96ac42dbe..a3ddb306243d8 100644 --- a/src/platform/packages/shared/response-ops/rule_params/uptime_duration_anomaly/v1.ts +++ b/src/platform/packages/shared/response-ops/rule_params/uptime_duration_anomaly/v1.ts @@ -7,7 +7,8 @@ * License v3.0 only", or the "Server Side Public License, v 1". */ -import { TypeOf, schema } from '@kbn/config-schema'; +import type { TypeOf } from '@kbn/config-schema'; +import { schema } from '@kbn/config-schema'; export const uptimeDurationAnomalyRuleParamsSchema = schema.object({ stackVersion: schema.maybe(schema.string()), diff --git a/src/platform/packages/shared/response-ops/rule_params/uptime_monitor_status/v1.ts b/src/platform/packages/shared/response-ops/rule_params/uptime_monitor_status/v1.ts index c8588dffdcd1c..8dc99e1228967 100644 --- a/src/platform/packages/shared/response-ops/rule_params/uptime_monitor_status/v1.ts +++ b/src/platform/packages/shared/response-ops/rule_params/uptime_monitor_status/v1.ts @@ -7,7 +7,8 @@ * License v3.0 only", or the "Server Side Public License, v 1". */ -import { TypeOf, schema } from '@kbn/config-schema'; +import type { TypeOf } from '@kbn/config-schema'; +import { schema } from '@kbn/config-schema'; export const uptimeMonitorStatusRuleParamsSchema = schema.object({ stackVersion: schema.maybe(schema.string()), diff --git a/src/platform/packages/shared/response-ops/rule_params/uptime_tls/v1.ts b/src/platform/packages/shared/response-ops/rule_params/uptime_tls/v1.ts index c92b67fb26b23..143dec217cab0 100644 --- a/src/platform/packages/shared/response-ops/rule_params/uptime_tls/v1.ts +++ b/src/platform/packages/shared/response-ops/rule_params/uptime_tls/v1.ts @@ -7,7 +7,8 @@ * License v3.0 only", or the "Server Side Public License, v 1". */ -import { TypeOf, schema } from '@kbn/config-schema'; +import type { TypeOf } from '@kbn/config-schema'; +import { schema } from '@kbn/config-schema'; export const uptimeTLSRuleParamsSchema = schema.object({ stackVersion: schema.maybe(schema.string()), diff --git a/src/platform/packages/shared/response-ops/rule_params/v1.ts b/src/platform/packages/shared/response-ops/rule_params/v1.ts index a083f67f10c8c..fcff248122c1a 100644 --- a/src/platform/packages/shared/response-ops/rule_params/v1.ts +++ b/src/platform/packages/shared/response-ops/rule_params/v1.ts @@ -7,7 +7,8 @@ * License v3.0 only", or the "Server Side Public License, v 1". */ -import { TypeOf, schema } from '@kbn/config-schema'; +import type { TypeOf } from '@kbn/config-schema'; +import { schema } from '@kbn/config-schema'; export const ruleParamsSchema = schema.recordOf(schema.string(), schema.maybe(schema.any()), { meta: { description: 'The parameters for the rule.' }, diff --git a/x-pack/platform/plugins/shared/alerting/common/alert_schema/field_maps/component_template_from_field_map.ts b/x-pack/platform/plugins/shared/alerting/common/alert_schema/field_maps/component_template_from_field_map.ts index 9d5c651e92cda..74257f2f286e6 100644 --- a/x-pack/platform/plugins/shared/alerting/common/alert_schema/field_maps/component_template_from_field_map.ts +++ b/x-pack/platform/plugins/shared/alerting/common/alert_schema/field_maps/component_template_from_field_map.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { ClusterPutComponentTemplateRequest } from '@elastic/elasticsearch/lib/api/types'; +import type { ClusterPutComponentTemplateRequest } from '@elastic/elasticsearch/lib/api/types'; import { type FieldMap } from '@kbn/alerts-as-data-utils'; import { mappingFromFieldMap } from './mapping_from_field_map'; diff --git a/x-pack/platform/plugins/shared/alerting/common/bulk_edit.ts b/x-pack/platform/plugins/shared/alerting/common/bulk_edit.ts index 73773032f5280..fe0f73b00550d 100644 --- a/x-pack/platform/plugins/shared/alerting/common/bulk_edit.ts +++ b/x-pack/platform/plugins/shared/alerting/common/bulk_edit.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { Rule } from './rule'; +import type { Rule } from './rule'; export type BulkEditSkipReason = 'RULE_NOT_MODIFIED'; diff --git a/x-pack/platform/plugins/shared/alerting/common/maintenance_window.ts b/x-pack/platform/plugins/shared/alerting/common/maintenance_window.ts index 8b893835f9157..f3f2c3d2399cf 100644 --- a/x-pack/platform/plugins/shared/alerting/common/maintenance_window.ts +++ b/x-pack/platform/plugins/shared/alerting/common/maintenance_window.ts @@ -5,8 +5,8 @@ * 2.0. */ import type { IUiSettingsClient, Logger, SavedObjectsClientContract } from '@kbn/core/server'; -import { FilterStateStore } from '@kbn/es-query'; -import { RRuleParams } from './rrule_type'; +import type { FilterStateStore } from '@kbn/es-query'; +import type { RRuleParams } from './rrule_type'; export enum MaintenanceWindowStatus { Running = 'running', diff --git a/x-pack/platform/plugins/shared/alerting/common/routes/backfill/apis/delete/types/v1.ts b/x-pack/platform/plugins/shared/alerting/common/routes/backfill/apis/delete/types/v1.ts index 3dfb1c8e78c0e..9a4aeac74cb37 100644 --- a/x-pack/platform/plugins/shared/alerting/common/routes/backfill/apis/delete/types/v1.ts +++ b/x-pack/platform/plugins/shared/alerting/common/routes/backfill/apis/delete/types/v1.ts @@ -6,6 +6,6 @@ */ import type { TypeOf } from '@kbn/config-schema'; -import { deleteParamsSchemaV1 } from '..'; +import type { deleteParamsSchemaV1 } from '..'; export type DeleteBackfillRequestParams = TypeOf; diff --git a/x-pack/platform/plugins/shared/alerting/common/routes/backfill/apis/find/types/v1.ts b/x-pack/platform/plugins/shared/alerting/common/routes/backfill/apis/find/types/v1.ts index 90f3ccf8592c6..d6c8029338ad9 100644 --- a/x-pack/platform/plugins/shared/alerting/common/routes/backfill/apis/find/types/v1.ts +++ b/x-pack/platform/plugins/shared/alerting/common/routes/backfill/apis/find/types/v1.ts @@ -6,7 +6,7 @@ */ import type { TypeOf } from '@kbn/config-schema'; -import { findQuerySchemaV1, findResponseSchemaV1 } from '..'; +import type { findQuerySchemaV1, findResponseSchemaV1 } from '..'; export type FindBackfillRequestQuery = TypeOf; export type FindBackfillResponseBody = TypeOf; diff --git a/x-pack/platform/plugins/shared/alerting/common/routes/backfill/apis/get/types/v1.ts b/x-pack/platform/plugins/shared/alerting/common/routes/backfill/apis/get/types/v1.ts index 199bac2fe8435..f304ae615d93e 100644 --- a/x-pack/platform/plugins/shared/alerting/common/routes/backfill/apis/get/types/v1.ts +++ b/x-pack/platform/plugins/shared/alerting/common/routes/backfill/apis/get/types/v1.ts @@ -6,7 +6,7 @@ */ import type { TypeOf } from '@kbn/config-schema'; -import { getParamsSchemaV1, getResponseSchemaV1 } from '..'; +import type { getParamsSchemaV1, getResponseSchemaV1 } from '..'; export type GetBackfillRequestParams = TypeOf; export type GetBackfillResponseBody = TypeOf; diff --git a/x-pack/platform/plugins/shared/alerting/common/routes/backfill/apis/schedule/types/v1.ts b/x-pack/platform/plugins/shared/alerting/common/routes/backfill/apis/schedule/types/v1.ts index 3fe5c2989f648..3ae009bb25b30 100644 --- a/x-pack/platform/plugins/shared/alerting/common/routes/backfill/apis/schedule/types/v1.ts +++ b/x-pack/platform/plugins/shared/alerting/common/routes/backfill/apis/schedule/types/v1.ts @@ -6,7 +6,7 @@ */ import type { TypeOf } from '@kbn/config-schema'; -import { scheduleBodySchemaV1, scheduleResponseSchemaV1 } from '..'; +import type { scheduleBodySchemaV1, scheduleResponseSchemaV1 } from '..'; export type ScheduleBackfillRequestBody = TypeOf; export type ScheduleBackfillResponseBody = TypeOf; diff --git a/x-pack/platform/plugins/shared/alerting/common/routes/backfill/response/types/v1.ts b/x-pack/platform/plugins/shared/alerting/common/routes/backfill/response/types/v1.ts index ff0d94f164f7e..4252eb08c03c7 100644 --- a/x-pack/platform/plugins/shared/alerting/common/routes/backfill/response/types/v1.ts +++ b/x-pack/platform/plugins/shared/alerting/common/routes/backfill/response/types/v1.ts @@ -6,7 +6,7 @@ */ import type { TypeOf } from '@kbn/config-schema'; -import { backfillResponseSchemaV1, errorResponseSchemaV1 } from '..'; +import type { backfillResponseSchemaV1, errorResponseSchemaV1 } from '..'; export type BackfillResponse = TypeOf; export type ErrorResponse = TypeOf; diff --git a/x-pack/platform/plugins/shared/alerting/common/routes/framework/apis/health/types/v1.ts b/x-pack/platform/plugins/shared/alerting/common/routes/framework/apis/health/types/v1.ts index 188e3d0816a54..5dcc542dada84 100644 --- a/x-pack/platform/plugins/shared/alerting/common/routes/framework/apis/health/types/v1.ts +++ b/x-pack/platform/plugins/shared/alerting/common/routes/framework/apis/health/types/v1.ts @@ -7,7 +7,7 @@ import type { TypeOf } from '@kbn/config-schema'; -import { healthFrameworkResponseBodySchemaV1, healthFrameworkResponseSchemaV1 } from '..'; +import type { healthFrameworkResponseBodySchemaV1, healthFrameworkResponseSchemaV1 } from '..'; export type HealthFrameworkResponseBody = TypeOf; export type HealthFrameworkResponse = TypeOf; diff --git a/x-pack/platform/plugins/shared/alerting/common/routes/gaps/apis/fill/types/v1.ts b/x-pack/platform/plugins/shared/alerting/common/routes/gaps/apis/fill/types/v1.ts index 64bee71b53643..81b27626e19bb 100644 --- a/x-pack/platform/plugins/shared/alerting/common/routes/gaps/apis/fill/types/v1.ts +++ b/x-pack/platform/plugins/shared/alerting/common/routes/gaps/apis/fill/types/v1.ts @@ -6,6 +6,6 @@ */ import type { TypeOf } from '@kbn/config-schema'; -import { fillGapByIdQuerySchemaV1 } from '..'; +import type { fillGapByIdQuerySchemaV1 } from '..'; export type FillGapByIdQuery = TypeOf; diff --git a/x-pack/platform/plugins/shared/alerting/common/routes/gaps/apis/find/types/v1.ts b/x-pack/platform/plugins/shared/alerting/common/routes/gaps/apis/find/types/v1.ts index 0fa53d8dcf6f4..6ba1268f53161 100644 --- a/x-pack/platform/plugins/shared/alerting/common/routes/gaps/apis/find/types/v1.ts +++ b/x-pack/platform/plugins/shared/alerting/common/routes/gaps/apis/find/types/v1.ts @@ -6,7 +6,7 @@ */ import type { TypeOf } from '@kbn/config-schema'; -import { findGapsBodySchemaV1, findGapsResponseSchemaV1 } from '..'; +import type { findGapsBodySchemaV1, findGapsResponseSchemaV1 } from '..'; export type FindGapsRequestBody = TypeOf; export type FindGapsResponseBody = TypeOf; diff --git a/x-pack/platform/plugins/shared/alerting/common/routes/gaps/apis/get_gaps_summary_by_rule_ids/types/v1.ts b/x-pack/platform/plugins/shared/alerting/common/routes/gaps/apis/get_gaps_summary_by_rule_ids/types/v1.ts index b9439d796017e..920575bb05f3f 100644 --- a/x-pack/platform/plugins/shared/alerting/common/routes/gaps/apis/get_gaps_summary_by_rule_ids/types/v1.ts +++ b/x-pack/platform/plugins/shared/alerting/common/routes/gaps/apis/get_gaps_summary_by_rule_ids/types/v1.ts @@ -6,7 +6,7 @@ */ import type { TypeOf } from '@kbn/config-schema'; -import { getGapsSummaryByRuleIdsBodySchema, getGapsSummaryByRuleIdsResponseSchema } from '..'; +import type { getGapsSummaryByRuleIdsBodySchema, getGapsSummaryByRuleIdsResponseSchema } from '..'; export type GetGapsSummaryByRuleIdsBody = TypeOf; export type GetGapsSummaryByRuleIdsResponseBody = TypeOf< diff --git a/x-pack/platform/plugins/shared/alerting/common/routes/gaps/apis/get_rules_with_gaps/types/v1.ts b/x-pack/platform/plugins/shared/alerting/common/routes/gaps/apis/get_rules_with_gaps/types/v1.ts index 863ba146d9062..0982a8463b626 100644 --- a/x-pack/platform/plugins/shared/alerting/common/routes/gaps/apis/get_rules_with_gaps/types/v1.ts +++ b/x-pack/platform/plugins/shared/alerting/common/routes/gaps/apis/get_rules_with_gaps/types/v1.ts @@ -6,7 +6,7 @@ */ import type { TypeOf } from '@kbn/config-schema'; -import { getRuleIdsWithGapBodySchemaV1, getRuleIdsWithGapResponseSchemaV1 } from '..'; +import type { getRuleIdsWithGapBodySchemaV1, getRuleIdsWithGapResponseSchemaV1 } from '..'; export type GetRuleIdsWithGapBody = TypeOf; export type GetRuleIdsWithGapResponseBody = TypeOf; diff --git a/x-pack/platform/plugins/shared/alerting/common/routes/gaps/response/types/v1.ts b/x-pack/platform/plugins/shared/alerting/common/routes/gaps/response/types/v1.ts index 3b538a97b0136..f4c646f8aec13 100644 --- a/x-pack/platform/plugins/shared/alerting/common/routes/gaps/response/types/v1.ts +++ b/x-pack/platform/plugins/shared/alerting/common/routes/gaps/response/types/v1.ts @@ -6,7 +6,7 @@ */ import type { TypeOf } from '@kbn/config-schema'; -import { gapsResponseSchemaV1, errorResponseSchemaV1 } from '..'; +import type { gapsResponseSchemaV1, errorResponseSchemaV1 } from '..'; export type GapsResponse = TypeOf; export type ErrorResponse = TypeOf; diff --git a/x-pack/platform/plugins/shared/alerting/common/routes/maintenance_window/apis/archive/types/v1.ts b/x-pack/platform/plugins/shared/alerting/common/routes/maintenance_window/apis/archive/types/v1.ts index 37ce349e23a1e..9417b74cea703 100644 --- a/x-pack/platform/plugins/shared/alerting/common/routes/maintenance_window/apis/archive/types/v1.ts +++ b/x-pack/platform/plugins/shared/alerting/common/routes/maintenance_window/apis/archive/types/v1.ts @@ -6,8 +6,8 @@ */ import type { TypeOf } from '@kbn/config-schema'; -import { MaintenanceWindowResponseV1 } from '../../../response'; -import { archiveBodySchemaV1, archiveParamsSchemaV1 } from '..'; +import type { MaintenanceWindowResponseV1 } from '../../../response'; +import type { archiveBodySchemaV1, archiveParamsSchemaV1 } from '..'; export type ArchiveMaintenanceWindowRequestBody = TypeOf; export type ArchiveMaintenanceWindowRequestParams = TypeOf; diff --git a/x-pack/platform/plugins/shared/alerting/common/routes/maintenance_window/apis/bulk_get/types/v1.ts b/x-pack/platform/plugins/shared/alerting/common/routes/maintenance_window/apis/bulk_get/types/v1.ts index 153df0010293a..1a7e9c49f4802 100644 --- a/x-pack/platform/plugins/shared/alerting/common/routes/maintenance_window/apis/bulk_get/types/v1.ts +++ b/x-pack/platform/plugins/shared/alerting/common/routes/maintenance_window/apis/bulk_get/types/v1.ts @@ -6,8 +6,8 @@ */ import type { TypeOf } from '@kbn/config-schema'; -import { MaintenanceWindowResponseV1 } from '../../../response'; -import { bulkGetBodySchemaV1 } from '..'; +import type { MaintenanceWindowResponseV1 } from '../../../response'; +import type { bulkGetBodySchemaV1 } from '..'; export type BulkGetMaintenanceWindowsRequestBody = TypeOf; diff --git a/x-pack/platform/plugins/shared/alerting/common/routes/maintenance_window/apis/create/types/v1.ts b/x-pack/platform/plugins/shared/alerting/common/routes/maintenance_window/apis/create/types/v1.ts index 269206c977687..5812a3b1b0215 100644 --- a/x-pack/platform/plugins/shared/alerting/common/routes/maintenance_window/apis/create/types/v1.ts +++ b/x-pack/platform/plugins/shared/alerting/common/routes/maintenance_window/apis/create/types/v1.ts @@ -6,8 +6,8 @@ */ import type { TypeOf } from '@kbn/config-schema'; -import { MaintenanceWindowResponseV1 } from '../../../response'; -import { createBodySchemaV1 } from '..'; +import type { MaintenanceWindowResponseV1 } from '../../../response'; +import type { createBodySchemaV1 } from '..'; export type CreateMaintenanceWindowRequestBody = TypeOf; diff --git a/x-pack/platform/plugins/shared/alerting/common/routes/maintenance_window/apis/delete/types/v1.ts b/x-pack/platform/plugins/shared/alerting/common/routes/maintenance_window/apis/delete/types/v1.ts index 64c02f23b703c..5538a81a86528 100644 --- a/x-pack/platform/plugins/shared/alerting/common/routes/maintenance_window/apis/delete/types/v1.ts +++ b/x-pack/platform/plugins/shared/alerting/common/routes/maintenance_window/apis/delete/types/v1.ts @@ -6,6 +6,6 @@ */ import type { TypeOf } from '@kbn/config-schema'; -import { deleteParamsSchemaV1 } from '..'; +import type { deleteParamsSchemaV1 } from '..'; export type DeleteMaintenanceWindowRequestParams = TypeOf; diff --git a/x-pack/platform/plugins/shared/alerting/common/routes/maintenance_window/apis/find/types/v1.ts b/x-pack/platform/plugins/shared/alerting/common/routes/maintenance_window/apis/find/types/v1.ts index 0176d2e6689f8..b4f09df18ba4a 100644 --- a/x-pack/platform/plugins/shared/alerting/common/routes/maintenance_window/apis/find/types/v1.ts +++ b/x-pack/platform/plugins/shared/alerting/common/routes/maintenance_window/apis/find/types/v1.ts @@ -5,8 +5,8 @@ * 2.0. */ -import { TypeOf } from '@kbn/config-schema'; -import { +import type { TypeOf } from '@kbn/config-schema'; +import type { findMaintenanceWindowsResponseBodySchema, findMaintenanceWindowsRequestQuerySchema, } from '..'; diff --git a/x-pack/platform/plugins/shared/alerting/common/routes/maintenance_window/apis/finish/types/v1.ts b/x-pack/platform/plugins/shared/alerting/common/routes/maintenance_window/apis/finish/types/v1.ts index aff9df5ba9c45..117d759d4210b 100644 --- a/x-pack/platform/plugins/shared/alerting/common/routes/maintenance_window/apis/finish/types/v1.ts +++ b/x-pack/platform/plugins/shared/alerting/common/routes/maintenance_window/apis/finish/types/v1.ts @@ -6,8 +6,8 @@ */ import type { TypeOf } from '@kbn/config-schema'; -import { MaintenanceWindowResponseV1 } from '../../../response'; -import { finishParamsSchemaV1 } from '..'; +import type { MaintenanceWindowResponseV1 } from '../../../response'; +import type { finishParamsSchemaV1 } from '..'; export type FinishMaintenanceWindowRequestParams = TypeOf; diff --git a/x-pack/platform/plugins/shared/alerting/common/routes/maintenance_window/apis/get/types/v1.ts b/x-pack/platform/plugins/shared/alerting/common/routes/maintenance_window/apis/get/types/v1.ts index c264150229540..a51fa7bdf330d 100644 --- a/x-pack/platform/plugins/shared/alerting/common/routes/maintenance_window/apis/get/types/v1.ts +++ b/x-pack/platform/plugins/shared/alerting/common/routes/maintenance_window/apis/get/types/v1.ts @@ -6,8 +6,8 @@ */ import type { TypeOf } from '@kbn/config-schema'; -import { MaintenanceWindowResponseV1 } from '../../../response'; -import { getParamsSchemaV1 } from '..'; +import type { MaintenanceWindowResponseV1 } from '../../../response'; +import type { getParamsSchemaV1 } from '..'; export type GetMaintenanceWindowRequestParams = TypeOf; diff --git a/x-pack/platform/plugins/shared/alerting/common/routes/maintenance_window/apis/get_active/types/v1.ts b/x-pack/platform/plugins/shared/alerting/common/routes/maintenance_window/apis/get_active/types/v1.ts index 3e6ed18dc18c2..87f5355c083f4 100644 --- a/x-pack/platform/plugins/shared/alerting/common/routes/maintenance_window/apis/get_active/types/v1.ts +++ b/x-pack/platform/plugins/shared/alerting/common/routes/maintenance_window/apis/get_active/types/v1.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { MaintenanceWindowResponseV1 } from '../../../response'; +import type { MaintenanceWindowResponseV1 } from '../../../response'; export interface GetActiveMaintenanceWindowsResponse { body: MaintenanceWindowResponseV1[]; diff --git a/x-pack/platform/plugins/shared/alerting/common/routes/maintenance_window/apis/update/types/v1.ts b/x-pack/platform/plugins/shared/alerting/common/routes/maintenance_window/apis/update/types/v1.ts index d56107619687a..7410a9e299345 100644 --- a/x-pack/platform/plugins/shared/alerting/common/routes/maintenance_window/apis/update/types/v1.ts +++ b/x-pack/platform/plugins/shared/alerting/common/routes/maintenance_window/apis/update/types/v1.ts @@ -6,8 +6,8 @@ */ import type { TypeOf } from '@kbn/config-schema'; -import { MaintenanceWindowResponseV1 } from '../../../response'; -import { updateParamsSchemaV1, updateBodySchemaV1 } from '..'; +import type { MaintenanceWindowResponseV1 } from '../../../response'; +import type { updateParamsSchemaV1, updateBodySchemaV1 } from '..'; export type UpdateMaintenanceWindowRequestParams = TypeOf; export type UpdateMaintenanceWindowRequestBody = TypeOf; diff --git a/x-pack/platform/plugins/shared/alerting/common/routes/maintenance_window/response/types/v1.ts b/x-pack/platform/plugins/shared/alerting/common/routes/maintenance_window/response/types/v1.ts index 91fdcbc16674b..83fe9fd0b688b 100644 --- a/x-pack/platform/plugins/shared/alerting/common/routes/maintenance_window/response/types/v1.ts +++ b/x-pack/platform/plugins/shared/alerting/common/routes/maintenance_window/response/types/v1.ts @@ -6,6 +6,6 @@ */ import type { TypeOf } from '@kbn/config-schema'; -import { maintenanceWindowResponseSchemaV1 } from '..'; +import type { maintenanceWindowResponseSchemaV1 } from '..'; export type MaintenanceWindowResponse = TypeOf; diff --git a/x-pack/platform/plugins/shared/alerting/common/routes/maintenance_window/shared/types/v1.ts b/x-pack/platform/plugins/shared/alerting/common/routes/maintenance_window/shared/types/v1.ts index 19c5ae2a133ba..fbda0b6ed998c 100644 --- a/x-pack/platform/plugins/shared/alerting/common/routes/maintenance_window/shared/types/v1.ts +++ b/x-pack/platform/plugins/shared/alerting/common/routes/maintenance_window/shared/types/v1.ts @@ -6,6 +6,6 @@ */ import type { TypeOf } from '@kbn/config-schema'; -import { maintenanceWindowCategoryIdsSchemaV1 } from '..'; +import type { maintenanceWindowCategoryIdsSchemaV1 } from '..'; export type MaintenanceWindowCategoryIds = TypeOf; diff --git a/x-pack/platform/plugins/shared/alerting/common/routes/r_rule/request/types/v1.ts b/x-pack/platform/plugins/shared/alerting/common/routes/r_rule/request/types/v1.ts index 8a5605b6f9152..796f4247b7cfb 100644 --- a/x-pack/platform/plugins/shared/alerting/common/routes/r_rule/request/types/v1.ts +++ b/x-pack/platform/plugins/shared/alerting/common/routes/r_rule/request/types/v1.ts @@ -5,6 +5,6 @@ * 2.0. */ import type { TypeOf } from '@kbn/config-schema'; -import { rRuleRequestSchemaV1 } from '../..'; +import type { rRuleRequestSchemaV1 } from '../..'; export type RRuleRequest = TypeOf; diff --git a/x-pack/platform/plugins/shared/alerting/common/routes/r_rule/response/types/v1.ts b/x-pack/platform/plugins/shared/alerting/common/routes/r_rule/response/types/v1.ts index 1a35454a87655..c454673770e86 100644 --- a/x-pack/platform/plugins/shared/alerting/common/routes/r_rule/response/types/v1.ts +++ b/x-pack/platform/plugins/shared/alerting/common/routes/r_rule/response/types/v1.ts @@ -5,6 +5,6 @@ * 2.0. */ import type { TypeOf } from '@kbn/config-schema'; -import { rRuleResponseSchemaV1 } from '../..'; +import type { rRuleResponseSchemaV1 } from '../..'; export type RRuleResponse = TypeOf; diff --git a/x-pack/platform/plugins/shared/alerting/common/routes/rule/apis/aggregate/types/v1.ts b/x-pack/platform/plugins/shared/alerting/common/routes/rule/apis/aggregate/types/v1.ts index 2dc21a72b3783..31dd5dc287230 100644 --- a/x-pack/platform/plugins/shared/alerting/common/routes/rule/apis/aggregate/types/v1.ts +++ b/x-pack/platform/plugins/shared/alerting/common/routes/rule/apis/aggregate/types/v1.ts @@ -6,7 +6,7 @@ */ import type { TypeOf } from '@kbn/config-schema'; -import { aggregateRulesRequestBodySchemaV1, aggregateRulesResponseBodySchemaV1 } from '..'; +import type { aggregateRulesRequestBodySchemaV1, aggregateRulesResponseBodySchemaV1 } from '..'; export type AggregateRulesRequestBody = TypeOf; export type AggregateRulesResponseBody = TypeOf; diff --git a/x-pack/platform/plugins/shared/alerting/common/routes/rule/apis/bulk_delete/types/v1.ts b/x-pack/platform/plugins/shared/alerting/common/routes/rule/apis/bulk_delete/types/v1.ts index 3b7f062b836af..90993fa6240af 100644 --- a/x-pack/platform/plugins/shared/alerting/common/routes/rule/apis/bulk_delete/types/v1.ts +++ b/x-pack/platform/plugins/shared/alerting/common/routes/rule/apis/bulk_delete/types/v1.ts @@ -5,8 +5,8 @@ * 2.0. */ import type { TypeOf } from '@kbn/config-schema'; -import { bulkDeleteRulesRequestBodySchemaV1 } from '..'; -import { RuleParamsV1, RuleResponseV1 } from '../../../response'; +import type { bulkDeleteRulesRequestBodySchemaV1 } from '..'; +import type { RuleParamsV1, RuleResponseV1 } from '../../../response'; export interface BulkOperationError { message: string; diff --git a/x-pack/platform/plugins/shared/alerting/common/routes/rule/apis/bulk_delete/validation/v1.ts b/x-pack/platform/plugins/shared/alerting/common/routes/rule/apis/bulk_delete/validation/v1.ts index 86972849da204..2090d936fa447 100644 --- a/x-pack/platform/plugins/shared/alerting/common/routes/rule/apis/bulk_delete/validation/v1.ts +++ b/x-pack/platform/plugins/shared/alerting/common/routes/rule/apis/bulk_delete/validation/v1.ts @@ -6,7 +6,7 @@ */ import Boom from '@hapi/boom'; -import { BulkDeleteRulesRequestBody } from '..'; +import type { BulkDeleteRulesRequestBody } from '..'; export const validateBulkDeleteRulesBody = (options: BulkDeleteRulesRequestBody) => { const filter = options.filter; diff --git a/x-pack/platform/plugins/shared/alerting/common/routes/rule/apis/bulk_disable/types/v1.ts b/x-pack/platform/plugins/shared/alerting/common/routes/rule/apis/bulk_disable/types/v1.ts index ed537d6dbb653..4ba4b37bd07e8 100644 --- a/x-pack/platform/plugins/shared/alerting/common/routes/rule/apis/bulk_disable/types/v1.ts +++ b/x-pack/platform/plugins/shared/alerting/common/routes/rule/apis/bulk_disable/types/v1.ts @@ -5,8 +5,8 @@ * 2.0. */ import type { TypeOf } from '@kbn/config-schema'; -import { bulkDisableRulesRequestBodySchemaV1 } from '..'; -import { RuleParamsV1, RuleResponseV1 } from '../../../response'; +import type { bulkDisableRulesRequestBodySchemaV1 } from '..'; +import type { RuleParamsV1, RuleResponseV1 } from '../../../response'; export interface BulkOperationError { message: string; diff --git a/x-pack/platform/plugins/shared/alerting/common/routes/rule/apis/bulk_disable/validation/v1.ts b/x-pack/platform/plugins/shared/alerting/common/routes/rule/apis/bulk_disable/validation/v1.ts index 560e61017cd57..b08810be43597 100644 --- a/x-pack/platform/plugins/shared/alerting/common/routes/rule/apis/bulk_disable/validation/v1.ts +++ b/x-pack/platform/plugins/shared/alerting/common/routes/rule/apis/bulk_disable/validation/v1.ts @@ -6,7 +6,7 @@ */ import Boom from '@hapi/boom'; -import { BulkDisableRulesRequestBody } from '..'; +import type { BulkDisableRulesRequestBody } from '..'; export const validateBulkDisableRulesBody = (options: BulkDisableRulesRequestBody) => { const filter = options.filter; diff --git a/x-pack/platform/plugins/shared/alerting/common/routes/rule/apis/bulk_edit/types/v1.ts b/x-pack/platform/plugins/shared/alerting/common/routes/rule/apis/bulk_edit/types/v1.ts index 3070f09964c3c..a9515e2546e72 100644 --- a/x-pack/platform/plugins/shared/alerting/common/routes/rule/apis/bulk_edit/types/v1.ts +++ b/x-pack/platform/plugins/shared/alerting/common/routes/rule/apis/bulk_edit/types/v1.ts @@ -5,8 +5,8 @@ * 2.0. */ import type { TypeOf } from '@kbn/config-schema'; -import { RuleParamsV1, RuleResponseV1 } from '../../../response'; -import { bulkEditRulesRequestBodySchemaV1 } from '..'; +import type { RuleParamsV1, RuleResponseV1 } from '../../../response'; +import type { bulkEditRulesRequestBodySchemaV1 } from '..'; export type BulkEditRulesRequestBody = TypeOf; diff --git a/x-pack/platform/plugins/shared/alerting/common/routes/rule/apis/bulk_enable/types/v1.ts b/x-pack/platform/plugins/shared/alerting/common/routes/rule/apis/bulk_enable/types/v1.ts index 49a78d2f82615..35a540c5563de 100644 --- a/x-pack/platform/plugins/shared/alerting/common/routes/rule/apis/bulk_enable/types/v1.ts +++ b/x-pack/platform/plugins/shared/alerting/common/routes/rule/apis/bulk_enable/types/v1.ts @@ -6,8 +6,8 @@ */ import type { TypeOf } from '@kbn/config-schema'; -import { RuleParamsV1, RuleResponseV1 } from '../../../response'; -import { bulkEnableBodySchemaV1 } from '..'; +import type { RuleParamsV1, RuleResponseV1 } from '../../../response'; +import type { bulkEnableBodySchemaV1 } from '..'; export type BulkEnableRulesRequestBody = TypeOf; diff --git a/x-pack/platform/plugins/shared/alerting/common/routes/rule/apis/bulk_untrack/types/v1.ts b/x-pack/platform/plugins/shared/alerting/common/routes/rule/apis/bulk_untrack/types/v1.ts index 011499122e90a..50f252027d971 100644 --- a/x-pack/platform/plugins/shared/alerting/common/routes/rule/apis/bulk_untrack/types/v1.ts +++ b/x-pack/platform/plugins/shared/alerting/common/routes/rule/apis/bulk_untrack/types/v1.ts @@ -5,6 +5,6 @@ * 2.0. */ import type { TypeOf } from '@kbn/config-schema'; -import { bulkUntrackBodySchemaV1 } from '..'; +import type { bulkUntrackBodySchemaV1 } from '..'; export type BulkUntrackRequestBody = TypeOf; diff --git a/x-pack/platform/plugins/shared/alerting/common/routes/rule/apis/bulk_untrack_by_query/types/v1.ts b/x-pack/platform/plugins/shared/alerting/common/routes/rule/apis/bulk_untrack_by_query/types/v1.ts index 8e6e7b329c112..b4f71dfe4f69f 100644 --- a/x-pack/platform/plugins/shared/alerting/common/routes/rule/apis/bulk_untrack_by_query/types/v1.ts +++ b/x-pack/platform/plugins/shared/alerting/common/routes/rule/apis/bulk_untrack_by_query/types/v1.ts @@ -5,6 +5,6 @@ * 2.0. */ import type { TypeOf } from '@kbn/config-schema'; -import { bulkUntrackByQueryBodySchemaV1 } from '..'; +import type { bulkUntrackByQueryBodySchemaV1 } from '..'; export type BulkUntrackByQueryRequestBody = TypeOf; diff --git a/x-pack/platform/plugins/shared/alerting/common/routes/rule/apis/clone/types/v1.ts b/x-pack/platform/plugins/shared/alerting/common/routes/rule/apis/clone/types/v1.ts index 7c2baf997f16c..adcf11dd3b39d 100644 --- a/x-pack/platform/plugins/shared/alerting/common/routes/rule/apis/clone/types/v1.ts +++ b/x-pack/platform/plugins/shared/alerting/common/routes/rule/apis/clone/types/v1.ts @@ -6,8 +6,8 @@ */ import type { TypeOf } from '@kbn/config-schema'; -import { RuleParamsV1, RuleResponseV1 } from '../../../response'; -import { cloneRuleRequestParamsSchemaV1 } from '..'; +import type { RuleParamsV1, RuleResponseV1 } from '../../../response'; +import type { cloneRuleRequestParamsSchemaV1 } from '..'; export type CloneRuleRequestParams = TypeOf; diff --git a/x-pack/platform/plugins/shared/alerting/common/routes/rule/apis/create/types/v1.ts b/x-pack/platform/plugins/shared/alerting/common/routes/rule/apis/create/types/v1.ts index 9524c05424724..7256a00f45d40 100644 --- a/x-pack/platform/plugins/shared/alerting/common/routes/rule/apis/create/types/v1.ts +++ b/x-pack/platform/plugins/shared/alerting/common/routes/rule/apis/create/types/v1.ts @@ -5,8 +5,8 @@ * 2.0. */ import type { TypeOf } from '@kbn/config-schema'; -import { RuleParamsV1, RuleResponseV1 } from '../../../response'; -import { +import type { RuleParamsV1, RuleResponseV1 } from '../../../response'; +import type { actionSchemaV1, actionFrequencySchemaV1, createParamsSchemaV1, diff --git a/x-pack/platform/plugins/shared/alerting/common/routes/rule/apis/delete/types/v1.ts b/x-pack/platform/plugins/shared/alerting/common/routes/rule/apis/delete/types/v1.ts index 8e019949e8139..106fac3cf8cc7 100644 --- a/x-pack/platform/plugins/shared/alerting/common/routes/rule/apis/delete/types/v1.ts +++ b/x-pack/platform/plugins/shared/alerting/common/routes/rule/apis/delete/types/v1.ts @@ -6,6 +6,6 @@ */ import type { TypeOf } from '@kbn/config-schema'; -import { deleteRuleRequestParamsSchemaV1 } from '..'; +import type { deleteRuleRequestParamsSchemaV1 } from '..'; export type DeleteRuleRequestParams = TypeOf; diff --git a/x-pack/platform/plugins/shared/alerting/common/routes/rule/apis/disable/types/v1.ts b/x-pack/platform/plugins/shared/alerting/common/routes/rule/apis/disable/types/v1.ts index fdbe84a020606..ae9d12a994601 100644 --- a/x-pack/platform/plugins/shared/alerting/common/routes/rule/apis/disable/types/v1.ts +++ b/x-pack/platform/plugins/shared/alerting/common/routes/rule/apis/disable/types/v1.ts @@ -5,7 +5,7 @@ * 2.0. */ import type { TypeOf } from '@kbn/config-schema'; -import { disableRuleRequestBodySchemaV1, disableRuleRequestParamsSchemaV1 } from '..'; +import type { disableRuleRequestBodySchemaV1, disableRuleRequestParamsSchemaV1 } from '..'; export type DisableRuleRequestBody = TypeOf; export type DisableRuleRequestParams = TypeOf; diff --git a/x-pack/platform/plugins/shared/alerting/common/routes/rule/apis/enable/types/v1.ts b/x-pack/platform/plugins/shared/alerting/common/routes/rule/apis/enable/types/v1.ts index c9be3f3c78db7..424cb9ee50448 100644 --- a/x-pack/platform/plugins/shared/alerting/common/routes/rule/apis/enable/types/v1.ts +++ b/x-pack/platform/plugins/shared/alerting/common/routes/rule/apis/enable/types/v1.ts @@ -6,6 +6,6 @@ */ import type { TypeOf } from '@kbn/config-schema'; -import { enableRuleRequestParamsSchemaV1 } from '..'; +import type { enableRuleRequestParamsSchemaV1 } from '..'; export type EnableRuleRequestParams = TypeOf; diff --git a/x-pack/platform/plugins/shared/alerting/common/routes/rule/apis/find/types/v1.ts b/x-pack/platform/plugins/shared/alerting/common/routes/rule/apis/find/types/v1.ts index e09b4871eabc9..d553a885b147f 100644 --- a/x-pack/platform/plugins/shared/alerting/common/routes/rule/apis/find/types/v1.ts +++ b/x-pack/platform/plugins/shared/alerting/common/routes/rule/apis/find/types/v1.ts @@ -6,8 +6,8 @@ */ import type { TypeOf } from '@kbn/config-schema'; -import { RuleParamsV1, RuleResponseV1 } from '../../../response'; -import { findRulesRequestQuerySchemaV1, findRulesInternalRequestBodySchemaV1 } from '..'; +import type { RuleParamsV1, RuleResponseV1 } from '../../../response'; +import type { findRulesRequestQuerySchemaV1, findRulesInternalRequestBodySchemaV1 } from '..'; export type FindRulesRequestQuery = TypeOf; export type FindRulesInternalRequestBody = TypeOf; diff --git a/x-pack/platform/plugins/shared/alerting/common/routes/rule/apis/get/types/v1.ts b/x-pack/platform/plugins/shared/alerting/common/routes/rule/apis/get/types/v1.ts index 84370ebd28240..18f75a126c343 100644 --- a/x-pack/platform/plugins/shared/alerting/common/routes/rule/apis/get/types/v1.ts +++ b/x-pack/platform/plugins/shared/alerting/common/routes/rule/apis/get/types/v1.ts @@ -6,8 +6,8 @@ */ import type { TypeOf } from '@kbn/config-schema'; -import { RuleParamsV1, RuleResponseV1 } from '../../../response'; -import { getRuleRequestParamsSchemaV1 } from '..'; +import type { RuleParamsV1, RuleResponseV1 } from '../../../response'; +import type { getRuleRequestParamsSchemaV1 } from '..'; export type GetRuleRequestParams = TypeOf; diff --git a/x-pack/platform/plugins/shared/alerting/common/routes/rule/apis/get_schedule_frequency/types/v1.ts b/x-pack/platform/plugins/shared/alerting/common/routes/rule/apis/get_schedule_frequency/types/v1.ts index 2d117b03c49b9..72ffc70a8af09 100644 --- a/x-pack/platform/plugins/shared/alerting/common/routes/rule/apis/get_schedule_frequency/types/v1.ts +++ b/x-pack/platform/plugins/shared/alerting/common/routes/rule/apis/get_schedule_frequency/types/v1.ts @@ -6,7 +6,10 @@ */ import type { TypeOf } from '@kbn/config-schema'; -import { getScheduleFrequencyResponseSchemaV1, getScheduleFrequencyResponseBodySchemaV1 } from '..'; +import type { + getScheduleFrequencyResponseSchemaV1, + getScheduleFrequencyResponseBodySchemaV1, +} from '..'; export type GetScheduleFrequencyResponseBody = TypeOf< typeof getScheduleFrequencyResponseBodySchemaV1 diff --git a/x-pack/platform/plugins/shared/alerting/common/routes/rule/apis/list_types/types/v1.ts b/x-pack/platform/plugins/shared/alerting/common/routes/rule/apis/list_types/types/v1.ts index 380b48c1c6615..3239b8a72ba89 100644 --- a/x-pack/platform/plugins/shared/alerting/common/routes/rule/apis/list_types/types/v1.ts +++ b/x-pack/platform/plugins/shared/alerting/common/routes/rule/apis/list_types/types/v1.ts @@ -7,7 +7,7 @@ import type { TypeOf } from '@kbn/config-schema'; -import { typesRulesResponseSchemaV1, typesRulesResponseBodySchemaV1 } from '..'; +import type { typesRulesResponseSchemaV1, typesRulesResponseBodySchemaV1 } from '..'; export type TypesRulesResponse = TypeOf; export type TypesRulesResponseBody = TypeOf; diff --git a/x-pack/platform/plugins/shared/alerting/common/routes/rule/apis/mute_alert/types/v1.ts b/x-pack/platform/plugins/shared/alerting/common/routes/rule/apis/mute_alert/types/v1.ts index af3832641d530..d25a324722ee7 100644 --- a/x-pack/platform/plugins/shared/alerting/common/routes/rule/apis/mute_alert/types/v1.ts +++ b/x-pack/platform/plugins/shared/alerting/common/routes/rule/apis/mute_alert/types/v1.ts @@ -5,6 +5,6 @@ * 2.0. */ import type { TypeOf } from '@kbn/config-schema'; -import { muteAlertParamsSchemaV1 } from '..'; +import type { muteAlertParamsSchemaV1 } from '..'; export type MuteAlertRequestParams = TypeOf; diff --git a/x-pack/platform/plugins/shared/alerting/common/routes/rule/apis/mute_all/types/v1.ts b/x-pack/platform/plugins/shared/alerting/common/routes/rule/apis/mute_all/types/v1.ts index c18aa22dadd13..8808bd2175e98 100644 --- a/x-pack/platform/plugins/shared/alerting/common/routes/rule/apis/mute_all/types/v1.ts +++ b/x-pack/platform/plugins/shared/alerting/common/routes/rule/apis/mute_all/types/v1.ts @@ -6,6 +6,6 @@ */ import type { TypeOf } from '@kbn/config-schema'; -import { muteAllRuleRequestParamsSchemaV1 } from '..'; +import type { muteAllRuleRequestParamsSchemaV1 } from '..'; export type MuteAllRuleRequestParams = TypeOf; diff --git a/x-pack/platform/plugins/shared/alerting/common/routes/rule/apis/resolve/types/v1.ts b/x-pack/platform/plugins/shared/alerting/common/routes/rule/apis/resolve/types/v1.ts index eb86327c07712..2f821c1c2f7cc 100644 --- a/x-pack/platform/plugins/shared/alerting/common/routes/rule/apis/resolve/types/v1.ts +++ b/x-pack/platform/plugins/shared/alerting/common/routes/rule/apis/resolve/types/v1.ts @@ -4,7 +4,7 @@ * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ -import { RuleParamsV1, RuleResponseV1 } from '../../../response'; +import type { RuleParamsV1, RuleResponseV1 } from '../../../response'; export interface ResolveRuleResponse { body: RuleResponseV1; diff --git a/x-pack/platform/plugins/shared/alerting/common/routes/rule/apis/tags/types/v1.ts b/x-pack/platform/plugins/shared/alerting/common/routes/rule/apis/tags/types/v1.ts index bcd7680a17c97..f18ca216f0289 100644 --- a/x-pack/platform/plugins/shared/alerting/common/routes/rule/apis/tags/types/v1.ts +++ b/x-pack/platform/plugins/shared/alerting/common/routes/rule/apis/tags/types/v1.ts @@ -4,8 +4,8 @@ * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ -import { TypeOf } from '@kbn/config-schema'; -import { ruleTagsRequestQuerySchema, ruleTagsFormattedResponseSchema } from '..'; +import type { TypeOf } from '@kbn/config-schema'; +import type { ruleTagsRequestQuerySchema, ruleTagsFormattedResponseSchema } from '..'; export type RuleTagsRequestQuery = TypeOf; export type RuleTagsFormattedResponse = TypeOf; diff --git a/x-pack/platform/plugins/shared/alerting/common/routes/rule/apis/unmute_alert/types/v1.ts b/x-pack/platform/plugins/shared/alerting/common/routes/rule/apis/unmute_alert/types/v1.ts index 0de4e0e767ceb..a09b9cfc964be 100644 --- a/x-pack/platform/plugins/shared/alerting/common/routes/rule/apis/unmute_alert/types/v1.ts +++ b/x-pack/platform/plugins/shared/alerting/common/routes/rule/apis/unmute_alert/types/v1.ts @@ -5,6 +5,6 @@ * 2.0. */ import type { TypeOf } from '@kbn/config-schema'; -import { unmuteAlertParamsSchemaV1 } from '..'; +import type { unmuteAlertParamsSchemaV1 } from '..'; export type UnmuteAlertRequestParams = TypeOf; diff --git a/x-pack/platform/plugins/shared/alerting/common/routes/rule/apis/unmute_all/types/v1.ts b/x-pack/platform/plugins/shared/alerting/common/routes/rule/apis/unmute_all/types/v1.ts index 25638574f3972..ff40dcdd618eb 100644 --- a/x-pack/platform/plugins/shared/alerting/common/routes/rule/apis/unmute_all/types/v1.ts +++ b/x-pack/platform/plugins/shared/alerting/common/routes/rule/apis/unmute_all/types/v1.ts @@ -6,6 +6,6 @@ */ import type { TypeOf } from '@kbn/config-schema'; -import { unmuteAllRuleRequestParamsSchemaV1 } from '..'; +import type { unmuteAllRuleRequestParamsSchemaV1 } from '..'; export type UnmuteAllRuleRequestParams = TypeOf; diff --git a/x-pack/platform/plugins/shared/alerting/common/routes/rule/apis/update/types/v1.ts b/x-pack/platform/plugins/shared/alerting/common/routes/rule/apis/update/types/v1.ts index 74ad18cac8e87..a06c726628796 100644 --- a/x-pack/platform/plugins/shared/alerting/common/routes/rule/apis/update/types/v1.ts +++ b/x-pack/platform/plugins/shared/alerting/common/routes/rule/apis/update/types/v1.ts @@ -6,9 +6,9 @@ */ import type { TypeOf } from '@kbn/config-schema'; -import { RuleParamsV1, RuleResponseV1 } from '../../../response'; +import type { RuleParamsV1, RuleResponseV1 } from '../../../response'; -import { +import type { actionSchemaV1, actionFrequencySchemaV1, updateParamsSchemaV1, diff --git a/x-pack/platform/plugins/shared/alerting/common/routes/rule/apis/update_api_key/types/v1.ts b/x-pack/platform/plugins/shared/alerting/common/routes/rule/apis/update_api_key/types/v1.ts index 8966e2875eb5a..58ccea3b3b6fa 100644 --- a/x-pack/platform/plugins/shared/alerting/common/routes/rule/apis/update_api_key/types/v1.ts +++ b/x-pack/platform/plugins/shared/alerting/common/routes/rule/apis/update_api_key/types/v1.ts @@ -6,6 +6,6 @@ */ import type { TypeOf } from '@kbn/config-schema'; -import { updateApiKeyParamsSchemaV1 } from '..'; +import type { updateApiKeyParamsSchemaV1 } from '..'; export type UpdateApiKeyParams = TypeOf; diff --git a/x-pack/platform/plugins/shared/alerting/common/routes/rule/common/flapping/types/v1.ts b/x-pack/platform/plugins/shared/alerting/common/routes/rule/common/flapping/types/v1.ts index 66e338e16ea4c..62b85e897608f 100644 --- a/x-pack/platform/plugins/shared/alerting/common/routes/rule/common/flapping/types/v1.ts +++ b/x-pack/platform/plugins/shared/alerting/common/routes/rule/common/flapping/types/v1.ts @@ -6,6 +6,6 @@ */ import type { TypeOf } from '@kbn/config-schema'; -import { flappingSchemaV1 } from '../..'; +import type { flappingSchemaV1 } from '../..'; export type Flapping = TypeOf; diff --git a/x-pack/platform/plugins/shared/alerting/common/routes/rule/response/types/v1.ts b/x-pack/platform/plugins/shared/alerting/common/routes/rule/response/types/v1.ts index e32a56a302e63..8b305195610b6 100644 --- a/x-pack/platform/plugins/shared/alerting/common/routes/rule/response/types/v1.ts +++ b/x-pack/platform/plugins/shared/alerting/common/routes/rule/response/types/v1.ts @@ -6,8 +6,8 @@ */ import type { TypeOf } from '@kbn/config-schema'; -import { RuleParamsV1 } from '@kbn/response-ops-rule-params'; -import { +import type { RuleParamsV1 } from '@kbn/response-ops-rule-params'; +import type { ruleResponseSchemaV1, ruleSnoozeScheduleSchemaV1, ruleLastRunSchemaV1, diff --git a/x-pack/platform/plugins/shared/alerting/common/routes/rule/validation/validate_notify_when/v1.ts b/x-pack/platform/plugins/shared/alerting/common/routes/rule/validation/validate_notify_when/v1.ts index 38ccd877c49ae..3ed0ebac29ca1 100644 --- a/x-pack/platform/plugins/shared/alerting/common/routes/rule/validation/validate_notify_when/v1.ts +++ b/x-pack/platform/plugins/shared/alerting/common/routes/rule/validation/validate_notify_when/v1.ts @@ -5,7 +5,8 @@ * 2.0. */ -import { ruleNotifyWhenV1, RuleNotifyWhenV1 } from '../../common'; +import type { RuleNotifyWhenV1 } from '../../common'; +import { ruleNotifyWhenV1 } from '../../common'; export function validateNotifyWhen(notifyWhen: string) { if (Object.values(ruleNotifyWhenV1).includes(notifyWhen as RuleNotifyWhenV1)) { diff --git a/x-pack/platform/plugins/shared/alerting/common/routes/rule/validation/validate_snooze_schedule/v1.ts b/x-pack/platform/plugins/shared/alerting/common/routes/rule/validation/validate_snooze_schedule/v1.ts index 4a93f130e8248..246cd875e8dbc 100644 --- a/x-pack/platform/plugins/shared/alerting/common/routes/rule/validation/validate_snooze_schedule/v1.ts +++ b/x-pack/platform/plugins/shared/alerting/common/routes/rule/validation/validate_snooze_schedule/v1.ts @@ -5,10 +5,10 @@ * 2.0. */ -import { TypeOf } from '@kbn/config-schema'; +import type { TypeOf } from '@kbn/config-schema'; import { Frequency } from '@kbn/rrule'; import moment from 'moment'; -import { rRuleRequestSchema } from '../../../r_rule'; +import type { rRuleRequestSchema } from '../../../r_rule'; export const validateSnoozeSchedule = (schedule: { rRule: TypeOf; diff --git a/x-pack/platform/plugins/shared/alerting/common/routes/rules_settings/apis/get/types/v1.ts b/x-pack/platform/plugins/shared/alerting/common/routes/rules_settings/apis/get/types/v1.ts index 040f3c4813478..03230c4d4c8b7 100644 --- a/x-pack/platform/plugins/shared/alerting/common/routes/rules_settings/apis/get/types/v1.ts +++ b/x-pack/platform/plugins/shared/alerting/common/routes/rules_settings/apis/get/types/v1.ts @@ -6,6 +6,6 @@ */ import type { TypeOf } from '@kbn/config-schema'; -import { queryDelaySettingsResponseSchemaV1 } from '../../../response'; +import type { queryDelaySettingsResponseSchemaV1 } from '../../../response'; export type GetQueryDelaySettingsResponse = TypeOf; diff --git a/x-pack/platform/plugins/shared/alerting/common/routes/rules_settings/apis/update/types/v1.ts b/x-pack/platform/plugins/shared/alerting/common/routes/rules_settings/apis/update/types/v1.ts index 0b421e73150f5..5c97eac41f6d0 100644 --- a/x-pack/platform/plugins/shared/alerting/common/routes/rules_settings/apis/update/types/v1.ts +++ b/x-pack/platform/plugins/shared/alerting/common/routes/rules_settings/apis/update/types/v1.ts @@ -6,8 +6,8 @@ */ import type { TypeOf } from '@kbn/config-schema'; -import { queryDelaySettingsResponseSchemaV1 } from '../../../response'; -import { updateQueryDelaySettingsBodySchemaV1 } from '..'; +import type { queryDelaySettingsResponseSchemaV1 } from '../../../response'; +import type { updateQueryDelaySettingsBodySchemaV1 } from '..'; export type UpdateQueryDelaySettingsRequestBody = TypeOf< typeof updateQueryDelaySettingsBodySchemaV1 diff --git a/x-pack/platform/plugins/shared/alerting/common/routes/rules_settings/response/types/v1.ts b/x-pack/platform/plugins/shared/alerting/common/routes/rules_settings/response/types/v1.ts index b5671b2d54628..7051f322b5b77 100644 --- a/x-pack/platform/plugins/shared/alerting/common/routes/rules_settings/response/types/v1.ts +++ b/x-pack/platform/plugins/shared/alerting/common/routes/rules_settings/response/types/v1.ts @@ -6,6 +6,6 @@ */ import type { TypeOf } from '@kbn/config-schema'; -import { queryDelaySettingsResponseSchemaV1 } from '..'; +import type { queryDelaySettingsResponseSchemaV1 } from '..'; export type QueryDelaySettingsResponse = TypeOf; diff --git a/x-pack/platform/plugins/shared/alerting/public/alert_navigation_registry/alert_navigation_registry.mock.ts b/x-pack/platform/plugins/shared/alerting/public/alert_navigation_registry/alert_navigation_registry.mock.ts index c7d6131f92d52..6f345ba71aaa4 100644 --- a/x-pack/platform/plugins/shared/alerting/public/alert_navigation_registry/alert_navigation_registry.mock.ts +++ b/x-pack/platform/plugins/shared/alerting/public/alert_navigation_registry/alert_navigation_registry.mock.ts @@ -6,7 +6,7 @@ */ import type { PublicMethodsOf } from '@kbn/utility-types'; -import { AlertNavigationRegistry } from './alert_navigation_registry'; +import type { AlertNavigationRegistry } from './alert_navigation_registry'; type Schema = PublicMethodsOf; diff --git a/x-pack/platform/plugins/shared/alerting/public/alert_navigation_registry/alert_navigation_registry.test.ts b/x-pack/platform/plugins/shared/alerting/public/alert_navigation_registry/alert_navigation_registry.test.ts index c95278fd477a4..63f2ea7f02013 100644 --- a/x-pack/platform/plugins/shared/alerting/public/alert_navigation_registry/alert_navigation_registry.test.ts +++ b/x-pack/platform/plugins/shared/alerting/public/alert_navigation_registry/alert_navigation_registry.test.ts @@ -6,7 +6,8 @@ */ import { AlertNavigationRegistry } from './alert_navigation_registry'; -import { RuleType, RecoveredActionGroup, SanitizedRule } from '../../common'; +import type { RuleType, SanitizedRule } from '../../common'; +import { RecoveredActionGroup } from '../../common'; import { v4 as uuidv4 } from 'uuid'; beforeEach(() => jest.resetAllMocks()); diff --git a/x-pack/platform/plugins/shared/alerting/public/alert_navigation_registry/alert_navigation_registry.ts b/x-pack/platform/plugins/shared/alerting/public/alert_navigation_registry/alert_navigation_registry.ts index 4bc65c6baf4ef..18afe145bb5d4 100644 --- a/x-pack/platform/plugins/shared/alerting/public/alert_navigation_registry/alert_navigation_registry.ts +++ b/x-pack/platform/plugins/shared/alerting/public/alert_navigation_registry/alert_navigation_registry.ts @@ -6,8 +6,8 @@ */ import { i18n } from '@kbn/i18n'; -import { RuleType } from '../../common'; -import { AlertNavigationHandler } from './types'; +import type { RuleType } from '../../common'; +import type { AlertNavigationHandler } from './types'; const DEFAULT_HANDLER = Symbol('*'); export class AlertNavigationRegistry { diff --git a/x-pack/platform/plugins/shared/alerting/public/alert_navigation_registry/types.ts b/x-pack/platform/plugins/shared/alerting/public/alert_navigation_registry/types.ts index 136c44b2cd513..9ea8a05480aca 100644 --- a/x-pack/platform/plugins/shared/alerting/public/alert_navigation_registry/types.ts +++ b/x-pack/platform/plugins/shared/alerting/public/alert_navigation_registry/types.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { SanitizedRule } from '../../common'; +import type { SanitizedRule } from '../../common'; /** * Returns information that can be used to navigate to a specific page to view the given rule. diff --git a/x-pack/platform/plugins/shared/alerting/public/application/maintenance_windows.tsx b/x-pack/platform/plugins/shared/alerting/public/application/maintenance_windows.tsx index 9ac8245cd8288..bbc9dc99d824e 100644 --- a/x-pack/platform/plugins/shared/alerting/public/application/maintenance_windows.tsx +++ b/x-pack/platform/plugins/shared/alerting/public/application/maintenance_windows.tsx @@ -9,16 +9,16 @@ import React, { Suspense } from 'react'; import ReactDOM from 'react-dom'; import { EuiLoadingSpinner } from '@elastic/eui'; -import { CoreStart } from '@kbn/core/public'; +import type { CoreStart } from '@kbn/core/public'; import { KibanaContextProvider } from '@kbn/kibana-react-plugin/public'; import { Storage } from '@kbn/kibana-utils-plugin/public'; -import { ManagementAppMountParams } from '@kbn/management-plugin/public'; +import type { ManagementAppMountParams } from '@kbn/management-plugin/public'; import { KibanaRenderContextProvider } from '@kbn/react-kibana-context-render'; import { Route, Router, Routes } from '@kbn/shared-ux-router'; import { QueryClient, QueryClientProvider } from '@tanstack/react-query'; import { MAINTENANCE_WINDOW_PATHS } from '../../common'; import { useLicense } from '../hooks/use_license'; -import { AlertingPluginStart } from '../plugin'; +import type { AlertingPluginStart } from '../plugin'; const MaintenanceWindowsLazy: React.FC = React.lazy(() => import('../pages/maintenance_windows')); const MaintenanceWindowsCreateLazy: React.FC = React.lazy( diff --git a/x-pack/platform/plugins/shared/alerting/public/hooks/use_archive_maintenance_window.test.tsx b/x-pack/platform/plugins/shared/alerting/public/hooks/use_archive_maintenance_window.test.tsx index 367da7e65811a..cacab0e520e73 100644 --- a/x-pack/platform/plugins/shared/alerting/public/hooks/use_archive_maintenance_window.test.tsx +++ b/x-pack/platform/plugins/shared/alerting/public/hooks/use_archive_maintenance_window.test.tsx @@ -7,7 +7,8 @@ import { waitFor, renderHook, act } from '@testing-library/react'; -import { AppMockRenderer, createAppMockRenderer } from '../lib/test_utils'; +import type { AppMockRenderer } from '../lib/test_utils'; +import { createAppMockRenderer } from '../lib/test_utils'; import { useArchiveMaintenanceWindow } from './use_archive_maintenance_window'; const mockAddDanger = jest.fn(); diff --git a/x-pack/platform/plugins/shared/alerting/public/hooks/use_breadcrumbs.test.tsx b/x-pack/platform/plugins/shared/alerting/public/hooks/use_breadcrumbs.test.tsx index f06fd2be67996..07c8cb0c5cf07 100644 --- a/x-pack/platform/plugins/shared/alerting/public/hooks/use_breadcrumbs.test.tsx +++ b/x-pack/platform/plugins/shared/alerting/public/hooks/use_breadcrumbs.test.tsx @@ -8,7 +8,8 @@ import { renderHook } from '@testing-library/react'; import { useBreadcrumbs } from './use_breadcrumbs'; import { MAINTENANCE_WINDOW_DEEP_LINK_IDS } from '../../common'; -import { AppMockRenderer, createAppMockRenderer } from '../lib/test_utils'; +import type { AppMockRenderer } from '../lib/test_utils'; +import { createAppMockRenderer } from '../lib/test_utils'; const mockSetBreadcrumbs = jest.fn(); const mockSetTitle = jest.fn(); diff --git a/x-pack/platform/plugins/shared/alerting/public/hooks/use_breadcrumbs.ts b/x-pack/platform/plugins/shared/alerting/public/hooks/use_breadcrumbs.ts index d68e6f5816781..e3354ac82b8d7 100644 --- a/x-pack/platform/plugins/shared/alerting/public/hooks/use_breadcrumbs.ts +++ b/x-pack/platform/plugins/shared/alerting/public/hooks/use_breadcrumbs.ts @@ -6,15 +6,13 @@ */ import { i18n } from '@kbn/i18n'; -import { ChromeBreadcrumb } from '@kbn/core/public'; -import { MouseEvent, useEffect } from 'react'; +import type { ChromeBreadcrumb } from '@kbn/core/public'; +import type { MouseEvent } from 'react'; +import { useEffect } from 'react'; import { useKibana } from '../utils/kibana_react'; import { useNavigation } from './use_navigation'; -import { - MANAGEMENT_APP_ID, - MaintenanceWindowDeepLinkIds, - MAINTENANCE_WINDOW_DEEP_LINK_IDS, -} from '../../common'; +import type { MaintenanceWindowDeepLinkIds } from '../../common'; +import { MANAGEMENT_APP_ID, MAINTENANCE_WINDOW_DEEP_LINK_IDS } from '../../common'; const breadcrumbTitle: Record = { [MAINTENANCE_WINDOW_DEEP_LINK_IDS.maintenanceWindows]: i18n.translate( diff --git a/x-pack/platform/plugins/shared/alerting/public/hooks/use_create_maintenance_window.test.tsx b/x-pack/platform/plugins/shared/alerting/public/hooks/use_create_maintenance_window.test.tsx index 12564df1bf1b4..71c066e689dbe 100644 --- a/x-pack/platform/plugins/shared/alerting/public/hooks/use_create_maintenance_window.test.tsx +++ b/x-pack/platform/plugins/shared/alerting/public/hooks/use_create_maintenance_window.test.tsx @@ -7,7 +7,8 @@ import { waitFor, renderHook, act } from '@testing-library/react'; -import { AppMockRenderer, createAppMockRenderer } from '../lib/test_utils'; +import type { AppMockRenderer } from '../lib/test_utils'; +import { createAppMockRenderer } from '../lib/test_utils'; import { useCreateMaintenanceWindow } from './use_create_maintenance_window'; const mockAddDanger = jest.fn(); diff --git a/x-pack/platform/plugins/shared/alerting/public/hooks/use_create_maintenance_window.ts b/x-pack/platform/plugins/shared/alerting/public/hooks/use_create_maintenance_window.ts index 399f49f9a4cc0..b20d0b580a5a9 100644 --- a/x-pack/platform/plugins/shared/alerting/public/hooks/use_create_maintenance_window.ts +++ b/x-pack/platform/plugins/shared/alerting/public/hooks/use_create_maintenance_window.ts @@ -11,7 +11,8 @@ import type { IHttpFetchError } from '@kbn/core-http-browser'; import type { KibanaServerError } from '@kbn/kibana-utils-plugin/public'; import { useKibana } from '../utils/kibana_react'; -import { createMaintenanceWindow, CreateParams } from '../services/maintenance_windows_api/create'; +import type { CreateParams } from '../services/maintenance_windows_api/create'; +import { createMaintenanceWindow } from '../services/maintenance_windows_api/create'; const onErrorWithMessage = (message: string) => i18n.translate('xpack.alerting.maintenanceWindowsCreateFailureWithMessage', { diff --git a/x-pack/platform/plugins/shared/alerting/public/hooks/use_delete_maintenance_window.test.tsx b/x-pack/platform/plugins/shared/alerting/public/hooks/use_delete_maintenance_window.test.tsx index 353aca0f98e45..4f6d30bb81b51 100644 --- a/x-pack/platform/plugins/shared/alerting/public/hooks/use_delete_maintenance_window.test.tsx +++ b/x-pack/platform/plugins/shared/alerting/public/hooks/use_delete_maintenance_window.test.tsx @@ -7,7 +7,8 @@ import { waitFor, renderHook } from '@testing-library/react'; -import { AppMockRenderer, createAppMockRenderer } from '../lib/test_utils'; +import type { AppMockRenderer } from '../lib/test_utils'; +import { createAppMockRenderer } from '../lib/test_utils'; import { useDeleteMaintenanceWindow } from './use_delete_maintenance_window'; const mockAddDanger = jest.fn(); diff --git a/x-pack/platform/plugins/shared/alerting/public/hooks/use_find_maintenance_windows.test.tsx b/x-pack/platform/plugins/shared/alerting/public/hooks/use_find_maintenance_windows.test.tsx index 19a4f65d88036..103456bd12241 100644 --- a/x-pack/platform/plugins/shared/alerting/public/hooks/use_find_maintenance_windows.test.tsx +++ b/x-pack/platform/plugins/shared/alerting/public/hooks/use_find_maintenance_windows.test.tsx @@ -7,7 +7,8 @@ import { waitFor, renderHook } from '@testing-library/react'; -import { AppMockRenderer, createAppMockRenderer } from '../lib/test_utils'; +import type { AppMockRenderer } from '../lib/test_utils'; +import { createAppMockRenderer } from '../lib/test_utils'; import { useFindMaintenanceWindows } from './use_find_maintenance_windows'; const mockAddDanger = jest.fn(); diff --git a/x-pack/platform/plugins/shared/alerting/public/hooks/use_finish_and_archive_maintenance_window.test.tsx b/x-pack/platform/plugins/shared/alerting/public/hooks/use_finish_and_archive_maintenance_window.test.tsx index 7e453d5d78d59..cd9687a68bad6 100644 --- a/x-pack/platform/plugins/shared/alerting/public/hooks/use_finish_and_archive_maintenance_window.test.tsx +++ b/x-pack/platform/plugins/shared/alerting/public/hooks/use_finish_and_archive_maintenance_window.test.tsx @@ -7,7 +7,8 @@ import { waitFor, renderHook, act } from '@testing-library/react'; -import { AppMockRenderer, createAppMockRenderer } from '../lib/test_utils'; +import type { AppMockRenderer } from '../lib/test_utils'; +import { createAppMockRenderer } from '../lib/test_utils'; import { useFinishAndArchiveMaintenanceWindow } from './use_finish_and_archive_maintenance_window'; const mockAddDanger = jest.fn(); diff --git a/x-pack/platform/plugins/shared/alerting/public/hooks/use_finish_maintenance_window.test.tsx b/x-pack/platform/plugins/shared/alerting/public/hooks/use_finish_maintenance_window.test.tsx index fc972eddeafee..8f0fbae771a58 100644 --- a/x-pack/platform/plugins/shared/alerting/public/hooks/use_finish_maintenance_window.test.tsx +++ b/x-pack/platform/plugins/shared/alerting/public/hooks/use_finish_maintenance_window.test.tsx @@ -7,7 +7,8 @@ import { waitFor, renderHook, act } from '@testing-library/react'; -import { AppMockRenderer, createAppMockRenderer } from '../lib/test_utils'; +import type { AppMockRenderer } from '../lib/test_utils'; +import { createAppMockRenderer } from '../lib/test_utils'; import { useFinishMaintenanceWindow } from './use_finish_maintenance_window'; const mockAddDanger = jest.fn(); diff --git a/x-pack/platform/plugins/shared/alerting/public/hooks/use_get_maintenance_window.test.tsx b/x-pack/platform/plugins/shared/alerting/public/hooks/use_get_maintenance_window.test.tsx index d58aebe0a1578..623cabe55fe8f 100644 --- a/x-pack/platform/plugins/shared/alerting/public/hooks/use_get_maintenance_window.test.tsx +++ b/x-pack/platform/plugins/shared/alerting/public/hooks/use_get_maintenance_window.test.tsx @@ -7,7 +7,8 @@ import { waitFor, renderHook } from '@testing-library/react'; -import { AppMockRenderer, createAppMockRenderer } from '../lib/test_utils'; +import type { AppMockRenderer } from '../lib/test_utils'; +import { createAppMockRenderer } from '../lib/test_utils'; import { useGetMaintenanceWindow } from './use_get_maintenance_window'; const mockAddDanger = jest.fn(); diff --git a/x-pack/platform/plugins/shared/alerting/public/hooks/use_license.test.tsx b/x-pack/platform/plugins/shared/alerting/public/hooks/use_license.test.tsx index f9d4396072574..1a9193ff14bd6 100644 --- a/x-pack/platform/plugins/shared/alerting/public/hooks/use_license.test.tsx +++ b/x-pack/platform/plugins/shared/alerting/public/hooks/use_license.test.tsx @@ -8,7 +8,8 @@ import { licensingMock } from '@kbn/licensing-plugin/public/mocks'; import { renderHook } from '@testing-library/react'; import { useLicense } from './use_license'; -import { AppMockRenderer, createAppMockRenderer } from '../lib/test_utils'; +import type { AppMockRenderer } from '../lib/test_utils'; +import { createAppMockRenderer } from '../lib/test_utils'; let appMockRenderer: AppMockRenderer; diff --git a/x-pack/platform/plugins/shared/alerting/public/hooks/use_navigation.test.tsx b/x-pack/platform/plugins/shared/alerting/public/hooks/use_navigation.test.tsx index 1b7c48ee684e9..35b4360e03b24 100644 --- a/x-pack/platform/plugins/shared/alerting/public/hooks/use_navigation.test.tsx +++ b/x-pack/platform/plugins/shared/alerting/public/hooks/use_navigation.test.tsx @@ -12,7 +12,8 @@ import { useEditMaintenanceWindowsNavigation, useMaintenanceWindowsNavigation, } from './use_navigation'; -import { AppMockRenderer, createAppMockRenderer } from '../lib/test_utils'; +import type { AppMockRenderer } from '../lib/test_utils'; +import { createAppMockRenderer } from '../lib/test_utils'; import { MANAGEMENT_APP_ID, MAINTENANCE_WINDOWS_APP_ID } from '../../common'; const mockNavigateTo = jest.fn(); diff --git a/x-pack/platform/plugins/shared/alerting/public/hooks/use_update_maintenance_window.test.tsx b/x-pack/platform/plugins/shared/alerting/public/hooks/use_update_maintenance_window.test.tsx index a1da94422c898..03928e7490c57 100644 --- a/x-pack/platform/plugins/shared/alerting/public/hooks/use_update_maintenance_window.test.tsx +++ b/x-pack/platform/plugins/shared/alerting/public/hooks/use_update_maintenance_window.test.tsx @@ -7,7 +7,8 @@ import { waitFor, renderHook, act } from '@testing-library/react'; -import { AppMockRenderer, createAppMockRenderer } from '../lib/test_utils'; +import type { AppMockRenderer } from '../lib/test_utils'; +import { createAppMockRenderer } from '../lib/test_utils'; import { useUpdateMaintenanceWindow } from './use_update_maintenance_window'; const mockAddDanger = jest.fn(); diff --git a/x-pack/platform/plugins/shared/alerting/public/hooks/use_update_maintenance_window.ts b/x-pack/platform/plugins/shared/alerting/public/hooks/use_update_maintenance_window.ts index fcc10e1265d18..febf4900368d8 100644 --- a/x-pack/platform/plugins/shared/alerting/public/hooks/use_update_maintenance_window.ts +++ b/x-pack/platform/plugins/shared/alerting/public/hooks/use_update_maintenance_window.ts @@ -12,7 +12,8 @@ import type { KibanaServerError } from '@kbn/kibana-utils-plugin/public'; import type { MaintenanceWindow } from '../../common'; import { useKibana } from '../utils/kibana_react'; -import { updateMaintenanceWindow, UpdateParams } from '../services/maintenance_windows_api/update'; +import type { UpdateParams } from '../services/maintenance_windows_api/update'; +import { updateMaintenanceWindow } from '../services/maintenance_windows_api/update'; interface UseUpdateMaintenanceWindowProps { onError?: (error: IHttpFetchError) => void; diff --git a/x-pack/platform/plugins/shared/alerting/public/lib/common_transformations.test.ts b/x-pack/platform/plugins/shared/alerting/public/lib/common_transformations.test.ts index 0a3cdcb336386..65b0747edee95 100644 --- a/x-pack/platform/plugins/shared/alerting/public/lib/common_transformations.test.ts +++ b/x-pack/platform/plugins/shared/alerting/public/lib/common_transformations.test.ts @@ -5,7 +5,8 @@ * 2.0. */ -import { ApiRule, transformRule } from './common_transformations'; +import type { ApiRule } from './common_transformations'; +import { transformRule } from './common_transformations'; import { RuleExecutionStatusErrorReasons, RuleLastRunOutcomeValues } from '../../common'; beforeEach(() => jest.resetAllMocks()); diff --git a/x-pack/platform/plugins/shared/alerting/public/lib/common_transformations.ts b/x-pack/platform/plugins/shared/alerting/public/lib/common_transformations.ts index e79bed27ec3d8..97560c0227a2a 100644 --- a/x-pack/platform/plugins/shared/alerting/public/lib/common_transformations.ts +++ b/x-pack/platform/plugins/shared/alerting/public/lib/common_transformations.ts @@ -4,8 +4,8 @@ * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ -import { AsApiContract } from '@kbn/actions-plugin/common'; -import { +import type { AsApiContract } from '@kbn/actions-plugin/common'; +import type { RuleExecutionStatus, RuleMonitoring, Rule, diff --git a/x-pack/platform/plugins/shared/alerting/public/lib/test_utils.tsx b/x-pack/platform/plugins/shared/alerting/public/lib/test_utils.tsx index 3693e2ea6ccb0..e5ac0de9b5be4 100644 --- a/x-pack/platform/plugins/shared/alerting/public/lib/test_utils.tsx +++ b/x-pack/platform/plugins/shared/alerting/public/lib/test_utils.tsx @@ -5,13 +5,15 @@ * 2.0. */ -import React, { FC, PropsWithChildren } from 'react'; +import type { FC, PropsWithChildren } from 'react'; +import React from 'react'; import { BehaviorSubject } from 'rxjs'; import { QueryClient, QueryClientProvider } from '@tanstack/react-query'; import { KibanaContextProvider } from '@kbn/kibana-react-plugin/public'; import { KibanaRenderContextProvider } from '@kbn/react-kibana-context-render'; -import { render as reactRender, RenderOptions, RenderResult } from '@testing-library/react'; -import { Capabilities, CoreStart } from '@kbn/core/public'; +import type { RenderOptions, RenderResult } from '@testing-library/react'; +import { render as reactRender } from '@testing-library/react'; +import type { Capabilities, CoreStart } from '@kbn/core/public'; import { coreMock } from '@kbn/core/public/mocks'; import type { ILicense } from '@kbn/licensing-plugin/public'; import { licensingMock } from '@kbn/licensing-plugin/public/mocks'; diff --git a/x-pack/platform/plugins/shared/alerting/public/mocks.ts b/x-pack/platform/plugins/shared/alerting/public/mocks.ts index 977447f29f365..ea2391b11cf8c 100644 --- a/x-pack/platform/plugins/shared/alerting/public/mocks.ts +++ b/x-pack/platform/plugins/shared/alerting/public/mocks.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { AlertingPublicPlugin } from './plugin'; +import type { AlertingPublicPlugin } from './plugin'; export type Setup = jest.Mocked>; export type Start = jest.Mocked>; diff --git a/x-pack/platform/plugins/shared/alerting/public/pages/maintenance_windows/components/center_justified_spinner.test.tsx b/x-pack/platform/plugins/shared/alerting/public/pages/maintenance_windows/components/center_justified_spinner.test.tsx index f3c6bacaa7917..f2006e5c216a0 100644 --- a/x-pack/platform/plugins/shared/alerting/public/pages/maintenance_windows/components/center_justified_spinner.test.tsx +++ b/x-pack/platform/plugins/shared/alerting/public/pages/maintenance_windows/components/center_justified_spinner.test.tsx @@ -7,7 +7,8 @@ import React from 'react'; -import { AppMockRenderer, createAppMockRenderer } from '../../../lib/test_utils'; +import type { AppMockRenderer } from '../../../lib/test_utils'; +import { createAppMockRenderer } from '../../../lib/test_utils'; import { CenterJustifiedSpinner } from './center_justified_spinner'; describe('CenterJustifiedSpinner', () => { diff --git a/x-pack/platform/plugins/shared/alerting/public/pages/maintenance_windows/components/center_justified_spinner.tsx b/x-pack/platform/plugins/shared/alerting/public/pages/maintenance_windows/components/center_justified_spinner.tsx index 72cf6345623e3..17e158b792f38 100644 --- a/x-pack/platform/plugins/shared/alerting/public/pages/maintenance_windows/components/center_justified_spinner.tsx +++ b/x-pack/platform/plugins/shared/alerting/public/pages/maintenance_windows/components/center_justified_spinner.tsx @@ -8,7 +8,7 @@ import React from 'react'; import { EuiFlexGroup, EuiFlexItem, EuiLoadingSpinner } from '@elastic/eui'; -import { EuiLoadingSpinnerSize } from '@elastic/eui/src/components/loading/loading_spinner'; +import type { EuiLoadingSpinnerSize } from '@elastic/eui/src/components/loading/loading_spinner'; interface Props { size?: EuiLoadingSpinnerSize; diff --git a/x-pack/platform/plugins/shared/alerting/public/pages/maintenance_windows/components/create_maintenance_windows_form.test.tsx b/x-pack/platform/plugins/shared/alerting/public/pages/maintenance_windows/components/create_maintenance_windows_form.test.tsx index 77a6090b21621..c7387a35abf98 100644 --- a/x-pack/platform/plugins/shared/alerting/public/pages/maintenance_windows/components/create_maintenance_windows_form.test.tsx +++ b/x-pack/platform/plugins/shared/alerting/public/pages/maintenance_windows/components/create_maintenance_windows_form.test.tsx @@ -7,11 +7,10 @@ import React from 'react'; import { within, fireEvent, waitFor } from '@testing-library/react'; -import { AppMockRenderer, createAppMockRenderer } from '../../../lib/test_utils'; -import { - CreateMaintenanceWindowFormProps, - CreateMaintenanceWindowForm, -} from './create_maintenance_windows_form'; +import type { AppMockRenderer } from '../../../lib/test_utils'; +import { createAppMockRenderer } from '../../../lib/test_utils'; +import type { CreateMaintenanceWindowFormProps } from './create_maintenance_windows_form'; +import { CreateMaintenanceWindowForm } from './create_maintenance_windows_form'; jest.mock('../../../utils/kibana_react'); jest.mock('../../../services/rule_api', () => ({ diff --git a/x-pack/platform/plugins/shared/alerting/public/pages/maintenance_windows/components/create_maintenance_windows_form.tsx b/x-pack/platform/plugins/shared/alerting/public/pages/maintenance_windows/components/create_maintenance_windows_form.tsx index 04bab61eb5c6f..4e249f9233295 100644 --- a/x-pack/platform/plugins/shared/alerting/public/pages/maintenance_windows/components/create_maintenance_windows_form.tsx +++ b/x-pack/platform/plugins/shared/alerting/public/pages/maintenance_windows/components/create_maintenance_windows_form.tsx @@ -6,10 +6,10 @@ */ import React, { useCallback, useMemo, useState, useRef, useEffect } from 'react'; import moment from 'moment'; +import type { FormSubmitHandler } from '@kbn/es-ui-shared-plugin/static/forms/hook_form_lib'; import { FIELD_TYPES, Form, - FormSubmitHandler, getUseField, useForm, useFormData, @@ -34,7 +34,8 @@ import { DEFAULT_APP_CATEGORIES } from '@kbn/core-application-common'; import type { Filter } from '@kbn/es-query'; import type { IHttpFetchError } from '@kbn/core-http-browser'; import type { KibanaServerError } from '@kbn/kibana-utils-plugin/public'; -import { FormProps, schema } from './schema'; +import type { FormProps } from './schema'; +import { schema } from './schema'; import * as i18n from '../translations'; import { RecurringSchedule } from './recurring_schedule_form/recurring_schedule'; import { SubmitButton } from './submit_button'; diff --git a/x-pack/platform/plugins/shared/alerting/public/pages/maintenance_windows/components/empty_prompt.test.tsx b/x-pack/platform/plugins/shared/alerting/public/pages/maintenance_windows/components/empty_prompt.test.tsx index 614e0de265cda..54af3aed1b9ff 100644 --- a/x-pack/platform/plugins/shared/alerting/public/pages/maintenance_windows/components/empty_prompt.test.tsx +++ b/x-pack/platform/plugins/shared/alerting/public/pages/maintenance_windows/components/empty_prompt.test.tsx @@ -8,7 +8,8 @@ import React from 'react'; import { docLinksServiceMock } from '@kbn/core-doc-links-server-mocks'; -import { AppMockRenderer, createAppMockRenderer } from '../../../lib/test_utils'; +import type { AppMockRenderer } from '../../../lib/test_utils'; +import { createAppMockRenderer } from '../../../lib/test_utils'; import { EmptyPrompt } from './empty_prompt'; describe('EmptyPrompt', () => { diff --git a/x-pack/platform/plugins/shared/alerting/public/pages/maintenance_windows/components/empty_prompt.tsx b/x-pack/platform/plugins/shared/alerting/public/pages/maintenance_windows/components/empty_prompt.tsx index d6b7055f48fcd..d5514ac2bb972 100644 --- a/x-pack/platform/plugins/shared/alerting/public/pages/maintenance_windows/components/empty_prompt.tsx +++ b/x-pack/platform/plugins/shared/alerting/public/pages/maintenance_windows/components/empty_prompt.tsx @@ -7,7 +7,7 @@ import React, { useMemo } from 'react'; import { EuiButton, EuiButtonEmpty, EuiPageTemplate } from '@elastic/eui'; -import { DocLinks } from '@kbn/doc-links'; +import type { DocLinks } from '@kbn/doc-links'; import * as i18n from '../translations'; interface EmptyPromptProps { diff --git a/x-pack/platform/plugins/shared/alerting/public/pages/maintenance_windows/components/fields/date_picker_range_field.test.tsx b/x-pack/platform/plugins/shared/alerting/public/pages/maintenance_windows/components/fields/date_picker_range_field.test.tsx index 8e4013aa74acd..be1faa6ca02cc 100644 --- a/x-pack/platform/plugins/shared/alerting/public/pages/maintenance_windows/components/fields/date_picker_range_field.test.tsx +++ b/x-pack/platform/plugins/shared/alerting/public/pages/maintenance_windows/components/fields/date_picker_range_field.test.tsx @@ -5,14 +5,16 @@ * 2.0. */ -import React, { FC, PropsWithChildren } from 'react'; +import type { FC, PropsWithChildren } from 'react'; +import React from 'react'; import moment from 'moment'; import { screen } from '@testing-library/react'; -import { FieldHook } from '@kbn/es-ui-shared-plugin/static/forms/hook_form_lib'; +import type { FieldHook } from '@kbn/es-ui-shared-plugin/static/forms/hook_form_lib'; import { useForm, Form } from '@kbn/es-ui-shared-plugin/static/forms/hook_form_lib'; -import { AppMockRenderer, createAppMockRenderer } from '../../../../lib/test_utils'; +import type { AppMockRenderer } from '../../../../lib/test_utils'; +import { createAppMockRenderer } from '../../../../lib/test_utils'; import type { FormProps } from '../schema'; import { DatePickerRangeField } from './date_picker_range_field'; diff --git a/x-pack/platform/plugins/shared/alerting/public/pages/maintenance_windows/components/fields/date_picker_range_field.tsx b/x-pack/platform/plugins/shared/alerting/public/pages/maintenance_windows/components/fields/date_picker_range_field.tsx index 46dfbb06e0f5f..55a771338529a 100644 --- a/x-pack/platform/plugins/shared/alerting/public/pages/maintenance_windows/components/fields/date_picker_range_field.tsx +++ b/x-pack/platform/plugins/shared/alerting/public/pages/maintenance_windows/components/fields/date_picker_range_field.tsx @@ -6,13 +6,11 @@ */ import React, { useCallback, useState } from 'react'; -import moment, { Moment } from 'moment'; +import type { Moment } from 'moment'; +import moment from 'moment'; import { EuiDatePicker, EuiDatePickerRange, EuiFormRow, EuiSpacer, EuiText } from '@elastic/eui'; -import { - useFormData, - useFormContext, - FieldHook, -} from '@kbn/es-ui-shared-plugin/static/forms/hook_form_lib'; +import type { FieldHook } from '@kbn/es-ui-shared-plugin/static/forms/hook_form_lib'; +import { useFormData, useFormContext } from '@kbn/es-ui-shared-plugin/static/forms/hook_form_lib'; import { UI_SETTINGS } from '@kbn/data-plugin/common'; import { MAINTENANCE_WINDOW_DATE_FORMAT } from '../../../../../common'; diff --git a/x-pack/platform/plugins/shared/alerting/public/pages/maintenance_windows/components/license_prompt.test.tsx b/x-pack/platform/plugins/shared/alerting/public/pages/maintenance_windows/components/license_prompt.test.tsx index 3a5ecc97ae1dc..18d3a2e40ef25 100644 --- a/x-pack/platform/plugins/shared/alerting/public/pages/maintenance_windows/components/license_prompt.test.tsx +++ b/x-pack/platform/plugins/shared/alerting/public/pages/maintenance_windows/components/license_prompt.test.tsx @@ -6,7 +6,8 @@ */ import React from 'react'; -import { AppMockRenderer, createAppMockRenderer } from '../../../lib/test_utils'; +import type { AppMockRenderer } from '../../../lib/test_utils'; +import { createAppMockRenderer } from '../../../lib/test_utils'; import { LicensePrompt } from './license_prompt'; describe('LicensePrompt', () => { diff --git a/x-pack/platform/plugins/shared/alerting/public/pages/maintenance_windows/components/link_icon.test.tsx b/x-pack/platform/plugins/shared/alerting/public/pages/maintenance_windows/components/link_icon.test.tsx index 9d1ad779471cb..81828c8cdd818 100644 --- a/x-pack/platform/plugins/shared/alerting/public/pages/maintenance_windows/components/link_icon.test.tsx +++ b/x-pack/platform/plugins/shared/alerting/public/pages/maintenance_windows/components/link_icon.test.tsx @@ -8,7 +8,8 @@ import React from 'react'; import { LinkIcon } from './link_icon'; -import { AppMockRenderer, createAppMockRenderer } from '../../../lib/test_utils'; +import type { AppMockRenderer } from '../../../lib/test_utils'; +import { createAppMockRenderer } from '../../../lib/test_utils'; describe('LinkIcon', () => { let appMockRenderer: AppMockRenderer; diff --git a/x-pack/platform/plugins/shared/alerting/public/pages/maintenance_windows/components/maintenance_window_category_selection.test.tsx b/x-pack/platform/plugins/shared/alerting/public/pages/maintenance_windows/components/maintenance_window_category_selection.test.tsx index d99f75bd3ed64..742984d6edfd5 100644 --- a/x-pack/platform/plugins/shared/alerting/public/pages/maintenance_windows/components/maintenance_window_category_selection.test.tsx +++ b/x-pack/platform/plugins/shared/alerting/public/pages/maintenance_windows/components/maintenance_window_category_selection.test.tsx @@ -8,7 +8,8 @@ import React from 'react'; import { screen, fireEvent } from '@testing-library/react'; import { MaintenanceWindowCategorySelection } from './maintenance_window_category_selection'; -import { AppMockRenderer, createAppMockRenderer } from '../../../lib/test_utils'; +import type { AppMockRenderer } from '../../../lib/test_utils'; +import { createAppMockRenderer } from '../../../lib/test_utils'; const mockOnChange = jest.fn(); diff --git a/x-pack/platform/plugins/shared/alerting/public/pages/maintenance_windows/components/maintenance_window_scoped_query.test.tsx b/x-pack/platform/plugins/shared/alerting/public/pages/maintenance_windows/components/maintenance_window_scoped_query.test.tsx index 3474805485ac0..ac1ffbe746793 100644 --- a/x-pack/platform/plugins/shared/alerting/public/pages/maintenance_windows/components/maintenance_window_scoped_query.test.tsx +++ b/x-pack/platform/plugins/shared/alerting/public/pages/maintenance_windows/components/maintenance_window_scoped_query.test.tsx @@ -7,7 +7,8 @@ import React from 'react'; import { screen } from '@testing-library/react'; -import { AppMockRenderer, createAppMockRenderer } from '../../../lib/test_utils'; +import type { AppMockRenderer } from '../../../lib/test_utils'; +import { createAppMockRenderer } from '../../../lib/test_utils'; import { MaintenanceWindowScopedQuery } from './maintenance_window_scoped_query'; jest.mock('../../../utils/kibana_react'); diff --git a/x-pack/platform/plugins/shared/alerting/public/pages/maintenance_windows/components/maintenance_window_scoped_query_switch.tsx b/x-pack/platform/plugins/shared/alerting/public/pages/maintenance_windows/components/maintenance_window_scoped_query_switch.tsx index db6ebf0282669..03e23cf1c4b81 100644 --- a/x-pack/platform/plugins/shared/alerting/public/pages/maintenance_windows/components/maintenance_window_scoped_query_switch.tsx +++ b/x-pack/platform/plugins/shared/alerting/public/pages/maintenance_windows/components/maintenance_window_scoped_query_switch.tsx @@ -6,14 +6,8 @@ */ import React, { useCallback } from 'react'; -import { - EuiFlexGroup, - EuiText, - EuiFlexItem, - EuiTextColor, - EuiSwitch, - EuiSwitchEvent, -} from '@elastic/eui'; +import type { EuiSwitchEvent } from '@elastic/eui'; +import { EuiFlexGroup, EuiText, EuiFlexItem, EuiTextColor, EuiSwitch } from '@elastic/eui'; import * as i18n from '../translations'; diff --git a/x-pack/platform/plugins/shared/alerting/public/pages/maintenance_windows/components/maintenance_windows_list.test.tsx b/x-pack/platform/plugins/shared/alerting/public/pages/maintenance_windows/components/maintenance_windows_list.test.tsx index 99477a8ed35d6..0d6c43bd91aef 100644 --- a/x-pack/platform/plugins/shared/alerting/public/pages/maintenance_windows/components/maintenance_windows_list.test.tsx +++ b/x-pack/platform/plugins/shared/alerting/public/pages/maintenance_windows/components/maintenance_windows_list.test.tsx @@ -8,9 +8,11 @@ import React from 'react'; import moment from 'moment'; import { fireEvent, waitFor, screen } from '@testing-library/react'; -import { AppMockRenderer, createAppMockRenderer } from '../../../lib/test_utils'; +import type { AppMockRenderer } from '../../../lib/test_utils'; +import { createAppMockRenderer } from '../../../lib/test_utils'; import { MaintenanceWindowsList } from './maintenance_windows_list'; -import { MaintenanceWindowStatus, MaintenanceWindow } from '../../../../common'; +import type { MaintenanceWindow } from '../../../../common'; +import { MaintenanceWindowStatus } from '../../../../common'; jest.mock('../../../utils/kibana_react', () => { const originalModule = jest.requireActual('../../../utils/kibana_react'); diff --git a/x-pack/platform/plugins/shared/alerting/public/pages/maintenance_windows/components/maintenance_windows_list.tsx b/x-pack/platform/plugins/shared/alerting/public/pages/maintenance_windows/components/maintenance_windows_list.tsx index a1b76247d908e..eec452dcfe465 100644 --- a/x-pack/platform/plugins/shared/alerting/public/pages/maintenance_windows/components/maintenance_windows_list.tsx +++ b/x-pack/platform/plugins/shared/alerting/public/pages/maintenance_windows/components/maintenance_windows_list.tsx @@ -6,9 +6,9 @@ */ import React, { useState, useCallback, useMemo } from 'react'; +import type { EuiBasicTableColumn } from '@elastic/eui'; import { formatDate, - EuiBasicTableColumn, EuiFlexGroup, EuiFlexItem, EuiBadge, @@ -23,13 +23,11 @@ import * as i18n from '../translations'; import { useEditMaintenanceWindowsNavigation } from '../../../hooks/use_navigation'; import { STATUS_DISPLAY, STATUS_SORT } from '../constants'; import { UpcomingEventsPopover } from './upcoming_events_popover'; -import { - MaintenanceWindowStatus, - MAINTENANCE_WINDOW_DATE_FORMAT, - MaintenanceWindow, -} from '../../../../common'; +import type { MaintenanceWindowStatus, MaintenanceWindow } from '../../../../common'; +import { MAINTENANCE_WINDOW_DATE_FORMAT } from '../../../../common'; import { StatusFilter } from './status_filter'; -import { TableActionsPopover, TableActionsPopoverProps } from './table_actions_popover'; +import type { TableActionsPopoverProps } from './table_actions_popover'; +import { TableActionsPopover } from './table_actions_popover'; import { useFinishMaintenanceWindow } from '../../../hooks/use_finish_maintenance_window'; import { useArchiveMaintenanceWindow } from '../../../hooks/use_archive_maintenance_window'; import { useFinishAndArchiveMaintenanceWindow } from '../../../hooks/use_finish_and_archive_maintenance_window'; diff --git a/x-pack/platform/plugins/shared/alerting/public/pages/maintenance_windows/components/page_header.test.tsx b/x-pack/platform/plugins/shared/alerting/public/pages/maintenance_windows/components/page_header.test.tsx index fea66d0148d06..b91a2f146401b 100644 --- a/x-pack/platform/plugins/shared/alerting/public/pages/maintenance_windows/components/page_header.test.tsx +++ b/x-pack/platform/plugins/shared/alerting/public/pages/maintenance_windows/components/page_header.test.tsx @@ -8,7 +8,8 @@ import React from 'react'; import { PageHeader } from './page_header'; -import { AppMockRenderer, createAppMockRenderer } from '../../../lib/test_utils'; +import type { AppMockRenderer } from '../../../lib/test_utils'; +import { createAppMockRenderer } from '../../../lib/test_utils'; describe('PageHeader', () => { let appMockRenderer: AppMockRenderer; diff --git a/x-pack/platform/plugins/shared/alerting/public/pages/maintenance_windows/components/recurring_schedule_form/custom_recurring_schedule.test.tsx b/x-pack/platform/plugins/shared/alerting/public/pages/maintenance_windows/components/recurring_schedule_form/custom_recurring_schedule.test.tsx index 873eedddd9b46..db60f4a73247b 100644 --- a/x-pack/platform/plugins/shared/alerting/public/pages/maintenance_windows/components/recurring_schedule_form/custom_recurring_schedule.test.tsx +++ b/x-pack/platform/plugins/shared/alerting/public/pages/maintenance_windows/components/recurring_schedule_form/custom_recurring_schedule.test.tsx @@ -5,12 +5,15 @@ * 2.0. */ -import React, { FC, PropsWithChildren } from 'react'; +import type { FC, PropsWithChildren } from 'react'; +import React from 'react'; import { fireEvent, waitFor, within } from '@testing-library/react'; import { useForm, Form } from '@kbn/es-ui-shared-plugin/static/forms/hook_form_lib'; import { Frequency } from '@kbn/rrule'; -import { AppMockRenderer, createAppMockRenderer } from '../../../../lib/test_utils'; -import { FormProps, schema } from '../schema'; +import type { AppMockRenderer } from '../../../../lib/test_utils'; +import { createAppMockRenderer } from '../../../../lib/test_utils'; +import type { FormProps } from '../schema'; +import { schema } from '../schema'; import { CustomRecurringSchedule } from './custom_recurring_schedule'; import { EndsOptions } from '../../constants'; diff --git a/x-pack/platform/plugins/shared/alerting/public/pages/maintenance_windows/components/recurring_schedule_form/custom_recurring_schedule.tsx b/x-pack/platform/plugins/shared/alerting/public/pages/maintenance_windows/components/recurring_schedule_form/custom_recurring_schedule.tsx index cc8b42b2f6339..149378a155f98 100644 --- a/x-pack/platform/plugins/shared/alerting/public/pages/maintenance_windows/components/recurring_schedule_form/custom_recurring_schedule.tsx +++ b/x-pack/platform/plugins/shared/alerting/public/pages/maintenance_windows/components/recurring_schedule_form/custom_recurring_schedule.tsx @@ -13,16 +13,14 @@ import { getUseField, useFormData, } from '@kbn/es-ui-shared-plugin/static/forms/hook_form_lib'; -import { - Field, - MultiButtonGroupFieldValue, -} from '@kbn/es-ui-shared-plugin/static/forms/components'; +import type { MultiButtonGroupFieldValue } from '@kbn/es-ui-shared-plugin/static/forms/components'; +import { Field } from '@kbn/es-ui-shared-plugin/static/forms/components'; import { EuiFlexGroup, EuiFlexItem, EuiFormLabel, EuiSpacer } from '@elastic/eui'; import { CREATE_FORM_CUSTOM_FREQUENCY, WEEKDAY_OPTIONS } from '../../constants'; import * as i18n from '../../translations'; import { getInitialByWeekday } from '../../helpers/get_initial_by_weekday'; import { getWeekdayInfo } from '../../helpers/get_weekday_info'; -import { FormProps } from '../schema'; +import type { FormProps } from '../schema'; import { parseSchedule } from '../../helpers/parse_schedule'; const UseField = getUseField({ component: Field }); diff --git a/x-pack/platform/plugins/shared/alerting/public/pages/maintenance_windows/components/recurring_schedule_form/recurring_schedule.test.tsx b/x-pack/platform/plugins/shared/alerting/public/pages/maintenance_windows/components/recurring_schedule_form/recurring_schedule.test.tsx index 5cf7d7cf58ea0..80978c465faac 100644 --- a/x-pack/platform/plugins/shared/alerting/public/pages/maintenance_windows/components/recurring_schedule_form/recurring_schedule.test.tsx +++ b/x-pack/platform/plugins/shared/alerting/public/pages/maintenance_windows/components/recurring_schedule_form/recurring_schedule.test.tsx @@ -5,12 +5,15 @@ * 2.0. */ -import React, { FC, PropsWithChildren } from 'react'; +import type { FC, PropsWithChildren } from 'react'; +import React from 'react'; import { Frequency } from '@kbn/rrule'; import { fireEvent, within } from '@testing-library/react'; import { useForm, Form } from '@kbn/es-ui-shared-plugin/static/forms/hook_form_lib'; -import { AppMockRenderer, createAppMockRenderer } from '../../../../lib/test_utils'; -import { FormProps, schema } from '../schema'; +import type { AppMockRenderer } from '../../../../lib/test_utils'; +import { createAppMockRenderer } from '../../../../lib/test_utils'; +import type { FormProps } from '../schema'; +import { schema } from '../schema'; import { RecurringSchedule } from './recurring_schedule'; import { EndsOptions } from '../../constants'; diff --git a/x-pack/platform/plugins/shared/alerting/public/pages/maintenance_windows/components/recurring_schedule_form/recurring_schedule.tsx b/x-pack/platform/plugins/shared/alerting/public/pages/maintenance_windows/components/recurring_schedule_form/recurring_schedule.tsx index 444012ba456a8..248e765e08df0 100644 --- a/x-pack/platform/plugins/shared/alerting/public/pages/maintenance_windows/components/recurring_schedule_form/recurring_schedule.tsx +++ b/x-pack/platform/plugins/shared/alerting/public/pages/maintenance_windows/components/recurring_schedule_form/recurring_schedule.tsx @@ -5,7 +5,8 @@ * 2.0. */ import React, { useMemo, useState } from 'react'; -import moment, { Moment } from 'moment'; +import type { Moment } from 'moment'; +import moment from 'moment'; import { EuiComboBox, EuiFlexGroup, @@ -33,7 +34,7 @@ import * as i18n from '../../translations'; import { CustomRecurringSchedule } from './custom_recurring_schedule'; import { recurringSummary } from '../../helpers/recurring_summary'; import { getPresets } from '../../helpers/get_presets'; -import { FormProps } from '../schema'; +import type { FormProps } from '../schema'; import { parseSchedule } from '../../helpers/parse_schedule'; const UseField = getUseField({ component: Field }); diff --git a/x-pack/platform/plugins/shared/alerting/public/pages/maintenance_windows/components/schema.ts b/x-pack/platform/plugins/shared/alerting/public/pages/maintenance_windows/components/schema.ts index 3bf01ddc51f9f..a3b4ad1a88278 100644 --- a/x-pack/platform/plugins/shared/alerting/public/pages/maintenance_windows/components/schema.ts +++ b/x-pack/platform/plugins/shared/alerting/public/pages/maintenance_windows/components/schema.ts @@ -10,8 +10,9 @@ import { FIELD_TYPES } from '@kbn/es-ui-shared-plugin/static/forms/hook_form_lib import { fieldValidators } from '@kbn/es-ui-shared-plugin/static/forms/helpers'; import { Frequency } from '@kbn/rrule'; import * as i18n from '../translations'; -import { EndsOptions, MaintenanceWindowFrequency } from '../constants'; -import { ScopedQueryAttributes } from '../../../../common'; +import type { MaintenanceWindowFrequency } from '../constants'; +import { EndsOptions } from '../constants'; +import type { ScopedQueryAttributes } from '../../../../common'; const { emptyField } = fieldValidators; diff --git a/x-pack/platform/plugins/shared/alerting/public/pages/maintenance_windows/components/status_filter.test.tsx b/x-pack/platform/plugins/shared/alerting/public/pages/maintenance_windows/components/status_filter.test.tsx index b5fa6c1d6b871..85ac1bab4f8ac 100644 --- a/x-pack/platform/plugins/shared/alerting/public/pages/maintenance_windows/components/status_filter.test.tsx +++ b/x-pack/platform/plugins/shared/alerting/public/pages/maintenance_windows/components/status_filter.test.tsx @@ -8,7 +8,8 @@ import React from 'react'; import { fireEvent, screen } from '@testing-library/react'; import { waitForEuiPopoverOpen } from '@elastic/eui/lib/test/rtl'; -import { AppMockRenderer, createAppMockRenderer } from '../../../lib/test_utils'; +import type { AppMockRenderer } from '../../../lib/test_utils'; +import { createAppMockRenderer } from '../../../lib/test_utils'; import { StatusFilter } from './status_filter'; import { MaintenanceWindowStatus } from '../../../../common'; diff --git a/x-pack/platform/plugins/shared/alerting/public/pages/maintenance_windows/components/status_filter.tsx b/x-pack/platform/plugins/shared/alerting/public/pages/maintenance_windows/components/status_filter.tsx index f8c3ff8880857..0d6cd062be72f 100644 --- a/x-pack/platform/plugins/shared/alerting/public/pages/maintenance_windows/components/status_filter.tsx +++ b/x-pack/platform/plugins/shared/alerting/public/pages/maintenance_windows/components/status_filter.tsx @@ -9,7 +9,7 @@ import React, { useState, useCallback } from 'react'; import { EuiFilterButton, EuiPopover, EuiFilterGroup, EuiFilterSelectItem } from '@elastic/eui'; import { STATUS_OPTIONS } from '../constants'; import * as i18n from '../translations'; -import { MaintenanceWindowStatus } from '../../../../common'; +import type { MaintenanceWindowStatus } from '../../../../common'; export interface RuleStatusFilterProps { selectedStatus: MaintenanceWindowStatus[]; diff --git a/x-pack/platform/plugins/shared/alerting/public/pages/maintenance_windows/components/submit_button.test.tsx b/x-pack/platform/plugins/shared/alerting/public/pages/maintenance_windows/components/submit_button.test.tsx index 0821200e98475..813beb78e8d9f 100644 --- a/x-pack/platform/plugins/shared/alerting/public/pages/maintenance_windows/components/submit_button.test.tsx +++ b/x-pack/platform/plugins/shared/alerting/public/pages/maintenance_windows/components/submit_button.test.tsx @@ -5,14 +5,16 @@ * 2.0. */ -import React, { FC, PropsWithChildren } from 'react'; +import type { FC, PropsWithChildren } from 'react'; +import React from 'react'; import { fireEvent, waitFor } from '@testing-library/react'; import { useForm, Form } from '@kbn/es-ui-shared-plugin/static/forms/hook_form_lib'; import { SubmitButton } from './submit_button'; import type { FormProps } from './schema'; import { schema } from './schema'; -import { AppMockRenderer, createAppMockRenderer } from '../../../lib/test_utils'; +import type { AppMockRenderer } from '../../../lib/test_utils'; +import { createAppMockRenderer } from '../../../lib/test_utils'; describe('SubmitButton', () => { const onSubmit = jest.fn(); diff --git a/x-pack/platform/plugins/shared/alerting/public/pages/maintenance_windows/components/table_actions_popover.test.tsx b/x-pack/platform/plugins/shared/alerting/public/pages/maintenance_windows/components/table_actions_popover.test.tsx index de45d47c7579f..b52e7b85db210 100644 --- a/x-pack/platform/plugins/shared/alerting/public/pages/maintenance_windows/components/table_actions_popover.test.tsx +++ b/x-pack/platform/plugins/shared/alerting/public/pages/maintenance_windows/components/table_actions_popover.test.tsx @@ -9,7 +9,8 @@ import { fireEvent } from '@testing-library/react'; import React from 'react'; import userEvent from '@testing-library/user-event'; -import { AppMockRenderer, createAppMockRenderer } from '../../../lib/test_utils'; +import type { AppMockRenderer } from '../../../lib/test_utils'; +import { createAppMockRenderer } from '../../../lib/test_utils'; import { TableActionsPopover } from './table_actions_popover'; import { MaintenanceWindowStatus } from '../../../../common'; diff --git a/x-pack/platform/plugins/shared/alerting/public/pages/maintenance_windows/components/table_actions_popover.tsx b/x-pack/platform/plugins/shared/alerting/public/pages/maintenance_windows/components/table_actions_popover.tsx index c7419933818b6..4733974df3f84 100644 --- a/x-pack/platform/plugins/shared/alerting/public/pages/maintenance_windows/components/table_actions_popover.tsx +++ b/x-pack/platform/plugins/shared/alerting/public/pages/maintenance_windows/components/table_actions_popover.tsx @@ -16,7 +16,7 @@ import { EuiPopover, } from '@elastic/eui'; import * as i18n from '../translations'; -import { MaintenanceWindowStatus } from '../../../../common'; +import type { MaintenanceWindowStatus } from '../../../../common'; import { useKibana } from '../../../utils/kibana_react'; export interface TableActionsPopoverProps { diff --git a/x-pack/platform/plugins/shared/alerting/public/pages/maintenance_windows/components/truncated_text.test.tsx b/x-pack/platform/plugins/shared/alerting/public/pages/maintenance_windows/components/truncated_text.test.tsx index 0a117f0cabb39..21d08881c065b 100644 --- a/x-pack/platform/plugins/shared/alerting/public/pages/maintenance_windows/components/truncated_text.test.tsx +++ b/x-pack/platform/plugins/shared/alerting/public/pages/maintenance_windows/components/truncated_text.test.tsx @@ -8,7 +8,8 @@ import React from 'react'; import { TruncatedText } from './truncated_text'; -import { AppMockRenderer, createAppMockRenderer } from '../../../lib/test_utils'; +import type { AppMockRenderer } from '../../../lib/test_utils'; +import { createAppMockRenderer } from '../../../lib/test_utils'; describe('TruncatedText', () => { let appMockRenderer: AppMockRenderer; diff --git a/x-pack/platform/plugins/shared/alerting/public/pages/maintenance_windows/components/upcoming_events_popover.test.tsx b/x-pack/platform/plugins/shared/alerting/public/pages/maintenance_windows/components/upcoming_events_popover.test.tsx index 74d4d2f1dbfd6..e40a0ef8a4dd0 100644 --- a/x-pack/platform/plugins/shared/alerting/public/pages/maintenance_windows/components/upcoming_events_popover.test.tsx +++ b/x-pack/platform/plugins/shared/alerting/public/pages/maintenance_windows/components/upcoming_events_popover.test.tsx @@ -6,7 +6,8 @@ */ import { fireEvent, screen } from '@testing-library/react'; import * as React from 'react'; -import { AppMockRenderer, createAppMockRenderer } from '../../../lib/test_utils'; +import type { AppMockRenderer } from '../../../lib/test_utils'; +import { createAppMockRenderer } from '../../../lib/test_utils'; import { UpcomingEventsPopover } from './upcoming_events_popover'; import { MaintenanceWindowStatus } from '../../../../common'; diff --git a/x-pack/platform/plugins/shared/alerting/public/pages/maintenance_windows/components/upcoming_events_popover.tsx b/x-pack/platform/plugins/shared/alerting/public/pages/maintenance_windows/components/upcoming_events_popover.tsx index 53a125bdf78be..bcc9a02308a4e 100644 --- a/x-pack/platform/plugins/shared/alerting/public/pages/maintenance_windows/components/upcoming_events_popover.tsx +++ b/x-pack/platform/plugins/shared/alerting/public/pages/maintenance_windows/components/upcoming_events_popover.tsx @@ -22,7 +22,8 @@ import { } from '@elastic/eui'; import { UI_SETTINGS } from '@kbn/data-plugin/common'; import * as i18n from '../translations'; -import { MAINTENANCE_WINDOW_DATE_FORMAT, MaintenanceWindow } from '../../../../common'; +import type { MaintenanceWindow } from '../../../../common'; +import { MAINTENANCE_WINDOW_DATE_FORMAT } from '../../../../common'; import { useUiSetting } from '../../../utils/kibana_react'; import { recurringSummary } from '../helpers/recurring_summary'; import { getPresets } from '../helpers/get_presets'; diff --git a/x-pack/platform/plugins/shared/alerting/public/pages/maintenance_windows/constants.ts b/x-pack/platform/plugins/shared/alerting/public/pages/maintenance_windows/constants.ts index 05e19f0ede52c..9711cf59b9873 100644 --- a/x-pack/platform/plugins/shared/alerting/public/pages/maintenance_windows/constants.ts +++ b/x-pack/platform/plugins/shared/alerting/public/pages/maintenance_windows/constants.ts @@ -77,7 +77,7 @@ export const RECURRENCE_END_OPTIONS = [ }, ]; -export const CREATE_FORM_CUSTOM_FREQUENCY = (interval: number = 1) => [ +export const CREATE_FORM_CUSTOM_FREQUENCY = (interval = 1) => [ { text: i18n.CREATE_FORM_CUSTOM_FREQUENCY_DAILY(interval), value: Frequency.DAILY, diff --git a/x-pack/platform/plugins/shared/alerting/public/pages/maintenance_windows/helpers/convert_from_maintenance_window_to_form.ts b/x-pack/platform/plugins/shared/alerting/public/pages/maintenance_windows/helpers/convert_from_maintenance_window_to_form.ts index 6adc7310b25b7..93f8ec22b5294 100644 --- a/x-pack/platform/plugins/shared/alerting/public/pages/maintenance_windows/helpers/convert_from_maintenance_window_to_form.ts +++ b/x-pack/platform/plugins/shared/alerting/public/pages/maintenance_windows/helpers/convert_from_maintenance_window_to_form.ts @@ -10,7 +10,8 @@ import { Frequency } from '@kbn/rrule'; import { has } from 'lodash'; import type { FormProps, RecurringScheduleFormProps } from '../components/schema'; import type { RRuleParams, MaintenanceWindow } from '../../../../common'; -import { EndsOptions, MaintenanceWindowFrequency } from '../constants'; +import type { MaintenanceWindowFrequency } from '../constants'; +import { EndsOptions } from '../constants'; import { getInitialByWeekday } from './get_initial_by_weekday'; export const convertFromMaintenanceWindowToForm = ( diff --git a/x-pack/platform/plugins/shared/alerting/public/pages/maintenance_windows/helpers/convert_to_rrule.ts b/x-pack/platform/plugins/shared/alerting/public/pages/maintenance_windows/helpers/convert_to_rrule.ts index 67e95ce3d3dbd..ad98286db2dd3 100644 --- a/x-pack/platform/plugins/shared/alerting/public/pages/maintenance_windows/helpers/convert_to_rrule.ts +++ b/x-pack/platform/plugins/shared/alerting/public/pages/maintenance_windows/helpers/convert_to_rrule.ts @@ -5,13 +5,13 @@ * 2.0. */ -import { Moment } from 'moment'; +import type { Moment } from 'moment'; import { Frequency } from '@kbn/rrule'; import { ISO_WEEKDAYS_TO_RRULE } from '../constants'; import { getNthByWeekday } from './get_nth_by_weekday'; -import { RecurringScheduleFormProps } from '../components/schema'; +import type { RecurringScheduleFormProps } from '../components/schema'; import { getPresets } from './get_presets'; -import { RRuleParams } from '../../../../common'; +import type { RRuleParams } from '../../../../common'; import { parseSchedule } from './parse_schedule'; export const convertToRRule = ( diff --git a/x-pack/platform/plugins/shared/alerting/public/pages/maintenance_windows/helpers/get_initial_by_weekday.ts b/x-pack/platform/plugins/shared/alerting/public/pages/maintenance_windows/helpers/get_initial_by_weekday.ts index b11d3bcf6a5e6..5cd6c9e256a72 100644 --- a/x-pack/platform/plugins/shared/alerting/public/pages/maintenance_windows/helpers/get_initial_by_weekday.ts +++ b/x-pack/platform/plugins/shared/alerting/public/pages/maintenance_windows/helpers/get_initial_by_weekday.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { Moment } from 'moment'; +import type { Moment } from 'moment'; import { ISO_WEEKDAYS } from '../../../../common'; import { ISO_WEEKDAYS_TO_RRULE } from '../constants'; diff --git a/x-pack/platform/plugins/shared/alerting/public/pages/maintenance_windows/helpers/get_nth_by_weekday.ts b/x-pack/platform/plugins/shared/alerting/public/pages/maintenance_windows/helpers/get_nth_by_weekday.ts index 2f7c9516e0e7c..250137a8af0ad 100644 --- a/x-pack/platform/plugins/shared/alerting/public/pages/maintenance_windows/helpers/get_nth_by_weekday.ts +++ b/x-pack/platform/plugins/shared/alerting/public/pages/maintenance_windows/helpers/get_nth_by_weekday.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { Moment } from 'moment'; +import type { Moment } from 'moment'; import { ISO_WEEKDAYS_TO_RRULE } from '../constants'; import { getWeekdayInfo } from './get_weekday_info'; diff --git a/x-pack/platform/plugins/shared/alerting/public/pages/maintenance_windows/helpers/get_presets.ts b/x-pack/platform/plugins/shared/alerting/public/pages/maintenance_windows/helpers/get_presets.ts index 529922eac5e87..2d650263fe8cb 100644 --- a/x-pack/platform/plugins/shared/alerting/public/pages/maintenance_windows/helpers/get_presets.ts +++ b/x-pack/platform/plugins/shared/alerting/public/pages/maintenance_windows/helpers/get_presets.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { Moment } from 'moment'; +import type { Moment } from 'moment'; import { Frequency } from '@kbn/rrule'; import { getInitialByWeekday } from './get_initial_by_weekday'; diff --git a/x-pack/platform/plugins/shared/alerting/public/pages/maintenance_windows/helpers/get_selected_for_date_picker.ts b/x-pack/platform/plugins/shared/alerting/public/pages/maintenance_windows/helpers/get_selected_for_date_picker.ts index 31bfdc206be9d..5b45f3b0ef9c4 100644 --- a/x-pack/platform/plugins/shared/alerting/public/pages/maintenance_windows/helpers/get_selected_for_date_picker.ts +++ b/x-pack/platform/plugins/shared/alerting/public/pages/maintenance_windows/helpers/get_selected_for_date_picker.ts @@ -6,10 +6,11 @@ */ import { get } from 'lodash'; -import moment, { Moment } from 'moment'; +import type { Moment } from 'moment'; +import moment from 'moment'; import 'moment-timezone'; -import { FormData } from '@kbn/es-ui-shared-plugin/static/forms/hook_form_lib'; +import type { FormData } from '@kbn/es-ui-shared-plugin/static/forms/hook_form_lib'; export function getSelectedForDatePicker( form: FormData, diff --git a/x-pack/platform/plugins/shared/alerting/public/pages/maintenance_windows/helpers/get_weekday_info.ts b/x-pack/platform/plugins/shared/alerting/public/pages/maintenance_windows/helpers/get_weekday_info.ts index e70083480d519..0aa2b2470c186 100644 --- a/x-pack/platform/plugins/shared/alerting/public/pages/maintenance_windows/helpers/get_weekday_info.ts +++ b/x-pack/platform/plugins/shared/alerting/public/pages/maintenance_windows/helpers/get_weekday_info.ts @@ -5,9 +5,10 @@ * 2.0. */ -import moment, { Moment } from 'moment'; +import type { Moment } from 'moment'; +import moment from 'moment'; -export const getWeekdayInfo = (date: Moment, dayOfWeekFmt: string = 'dddd') => { +export const getWeekdayInfo = (date: Moment, dayOfWeekFmt = 'dddd') => { const dayOfWeek = date.format(dayOfWeekFmt); const nthWeekdayOfMonth = Math.ceil(date.date() / 7); const isLastOfMonth = nthWeekdayOfMonth > 4 || !date.isSame(moment(date).add(7, 'd'), 'month'); diff --git a/x-pack/platform/plugins/shared/alerting/public/pages/maintenance_windows/helpers/parse_schedule.ts b/x-pack/platform/plugins/shared/alerting/public/pages/maintenance_windows/helpers/parse_schedule.ts index 6968db721d1fb..fdc541bdba9ce 100644 --- a/x-pack/platform/plugins/shared/alerting/public/pages/maintenance_windows/helpers/parse_schedule.ts +++ b/x-pack/platform/plugins/shared/alerting/public/pages/maintenance_windows/helpers/parse_schedule.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { RecurringScheduleFormProps } from '../components/schema'; +import type { RecurringScheduleFormProps } from '../components/schema'; export const parseSchedule = ( schedule: RecurringScheduleFormProps | undefined diff --git a/x-pack/platform/plugins/shared/alerting/public/pages/maintenance_windows/helpers/recurring_summary.ts b/x-pack/platform/plugins/shared/alerting/public/pages/maintenance_windows/helpers/recurring_summary.ts index 34054bbb736ac..546e6f058d580 100644 --- a/x-pack/platform/plugins/shared/alerting/public/pages/maintenance_windows/helpers/recurring_summary.ts +++ b/x-pack/platform/plugins/shared/alerting/public/pages/maintenance_windows/helpers/recurring_summary.ts @@ -5,17 +5,15 @@ * 2.0. */ -import moment, { Moment } from 'moment'; +import type { Moment } from 'moment'; +import moment from 'moment'; import { Frequency } from '@kbn/rrule'; import * as i18n from '../translations'; -import { - MaintenanceWindowFrequency, - ISO_WEEKDAYS_TO_RRULE, - RRULE_WEEKDAYS_TO_ISO_WEEKDAYS, -} from '../constants'; +import type { MaintenanceWindowFrequency } from '../constants'; +import { ISO_WEEKDAYS_TO_RRULE, RRULE_WEEKDAYS_TO_ISO_WEEKDAYS } from '../constants'; import { monthDayDate } from './month_day_date'; import { getNthByWeekday } from './get_nth_by_weekday'; -import { RecurringScheduleFormProps } from '../components/schema'; +import type { RecurringScheduleFormProps } from '../components/schema'; export const recurringSummary = ( startDate: Moment, diff --git a/x-pack/platform/plugins/shared/alerting/public/pages/maintenance_windows/index.test.tsx b/x-pack/platform/plugins/shared/alerting/public/pages/maintenance_windows/index.test.tsx index ad3f8cd52b2af..aebc6062b8ccf 100644 --- a/x-pack/platform/plugins/shared/alerting/public/pages/maintenance_windows/index.test.tsx +++ b/x-pack/platform/plugins/shared/alerting/public/pages/maintenance_windows/index.test.tsx @@ -7,7 +7,8 @@ import React from 'react'; import { licensingMock } from '@kbn/licensing-plugin/public/mocks'; import type { Capabilities } from '@kbn/core-capabilities-common'; -import { AppMockRenderer, createAppMockRenderer } from '../../lib/test_utils'; +import type { AppMockRenderer } from '../../lib/test_utils'; +import { createAppMockRenderer } from '../../lib/test_utils'; import { useFindMaintenanceWindows } from '../../hooks/use_find_maintenance_windows'; import { MaintenanceWindowsPage } from '.'; import { MAINTENANCE_WINDOW_FEATURE_ID } from '../../../common'; diff --git a/x-pack/platform/plugins/shared/alerting/public/pages/maintenance_windows/index.tsx b/x-pack/platform/plugins/shared/alerting/public/pages/maintenance_windows/index.tsx index f1f08f5f37c1f..a1ab03eefb892 100644 --- a/x-pack/platform/plugins/shared/alerting/public/pages/maintenance_windows/index.tsx +++ b/x-pack/platform/plugins/shared/alerting/public/pages/maintenance_windows/index.tsx @@ -26,12 +26,12 @@ import { useFindMaintenanceWindows } from '../../hooks/use_find_maintenance_wind import { ExperimentalBadge } from './components/page_header'; import { useLicense } from '../../hooks/use_license'; import { LicensePrompt } from './components/license_prompt'; +import type { MaintenanceWindowStatus } from '../../../common'; import { MAINTENANCE_WINDOW_FEATURE_ID, MAINTENANCE_WINDOW_DEEP_LINK_IDS, MAINTENANCE_WINDOW_DEFAULT_PER_PAGE, MAINTENANCE_WINDOW_DEFAULT_TABLE_ACTIVE_PAGE, - MaintenanceWindowStatus, } from '../../../common'; export const MaintenanceWindowsPage = React.memo(() => { diff --git a/x-pack/platform/plugins/shared/alerting/public/pages/maintenance_windows/translations.ts b/x-pack/platform/plugins/shared/alerting/public/pages/maintenance_windows/translations.ts index 2a61019a292ec..52203094cd7ec 100644 --- a/x-pack/platform/plugins/shared/alerting/public/pages/maintenance_windows/translations.ts +++ b/x-pack/platform/plugins/shared/alerting/public/pages/maintenance_windows/translations.ts @@ -5,7 +5,7 @@ * 2.0. */ import { i18n } from '@kbn/i18n'; -import { Moment } from 'moment'; +import type { Moment } from 'moment'; import { Frequency } from '@kbn/rrule'; import { monthDayDate } from './helpers/month_day_date'; diff --git a/x-pack/platform/plugins/shared/alerting/public/plugin.test.ts b/x-pack/platform/plugins/shared/alerting/public/plugin.test.ts index 87b7e4573c79f..b74be3c0c244d 100644 --- a/x-pack/platform/plugins/shared/alerting/public/plugin.test.ts +++ b/x-pack/platform/plugins/shared/alerting/public/plugin.test.ts @@ -5,7 +5,8 @@ * 2.0. */ -import { AlertingPublicPlugin, AlertingUIConfig } from './plugin'; +import type { AlertingUIConfig } from './plugin'; +import { AlertingPublicPlugin } from './plugin'; import { coreMock } from '@kbn/core/public/mocks'; import { createManagementSectionMock, diff --git a/x-pack/platform/plugins/shared/alerting/public/plugin.ts b/x-pack/platform/plugins/shared/alerting/public/plugin.ts index 66f93cfe124a8..9fef178fb13f4 100644 --- a/x-pack/platform/plugins/shared/alerting/public/plugin.ts +++ b/x-pack/platform/plugins/shared/alerting/public/plugin.ts @@ -6,17 +6,19 @@ */ import { i18n } from '@kbn/i18n'; -import { CoreSetup, CoreStart, Plugin, PluginInitializerContext } from '@kbn/core/public'; -import { ManagementAppMountParams, ManagementSetup } from '@kbn/management-plugin/public'; -import { SpacesPluginStart } from '@kbn/spaces-plugin/public'; -import { LicensingPluginStart } from '@kbn/licensing-plugin/public'; +import type { CoreSetup, CoreStart, Plugin, PluginInitializerContext } from '@kbn/core/public'; +import type { ManagementAppMountParams, ManagementSetup } from '@kbn/management-plugin/public'; +import type { SpacesPluginStart } from '@kbn/spaces-plugin/public'; +import type { LicensingPluginStart } from '@kbn/licensing-plugin/public'; import type { DataPublicPluginStart } from '@kbn/data-plugin/public'; import type { UnifiedSearchPublicPluginStart } from '@kbn/unified-search-plugin/public'; import type { ServerlessPluginStart } from '@kbn/serverless/public'; -import { AlertNavigationRegistry, AlertNavigationHandler } from './alert_navigation_registry'; +import type { AlertNavigationHandler } from './alert_navigation_registry'; +import { AlertNavigationRegistry } from './alert_navigation_registry'; import { loadRule, loadRuleType } from './services/rule_api'; -import { ENABLE_MAINTENANCE_WINDOWS, Rule, MAINTENANCE_WINDOWS_APP_ID } from '../common'; +import type { Rule } from '../common'; +import { ENABLE_MAINTENANCE_WINDOWS, MAINTENANCE_WINDOWS_APP_ID } from '../common'; export interface PluginSetupContract { /** diff --git a/x-pack/platform/plugins/shared/alerting/public/services/rule_api.test.ts b/x-pack/platform/plugins/shared/alerting/public/services/rule_api.test.ts index d9131221be11a..ac665e71751ed 100644 --- a/x-pack/platform/plugins/shared/alerting/public/services/rule_api.test.ts +++ b/x-pack/platform/plugins/shared/alerting/public/services/rule_api.test.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { Rule, RuleType } from '../../common'; +import type { Rule, RuleType } from '../../common'; import { httpServiceMock } from '@kbn/core/public/mocks'; import { loadRule, loadRuleType, loadRuleTypes } from './rule_api'; diff --git a/x-pack/platform/plugins/shared/alerting/public/services/rule_api.ts b/x-pack/platform/plugins/shared/alerting/public/services/rule_api.ts index 346914bb9b8ca..92aba4270adbd 100644 --- a/x-pack/platform/plugins/shared/alerting/public/services/rule_api.ts +++ b/x-pack/platform/plugins/shared/alerting/public/services/rule_api.ts @@ -5,11 +5,12 @@ * 2.0. */ -import { HttpSetup } from '@kbn/core/public'; -import { AsApiContract } from '@kbn/actions-plugin/common'; +import type { HttpSetup } from '@kbn/core/public'; +import type { AsApiContract } from '@kbn/actions-plugin/common'; import { BASE_ALERTING_API_PATH, INTERNAL_BASE_ALERTING_API_PATH } from '../../common'; import type { Rule, RuleType } from '../../common'; -import { transformRule, transformRuleType, ApiRule } from '../lib/common_transformations'; +import type { ApiRule } from '../lib/common_transformations'; +import { transformRule, transformRuleType } from '../lib/common_transformations'; export async function loadRuleTypes({ http }: { http: HttpSetup }): Promise { const res = await http.get>>( diff --git a/x-pack/platform/plugins/shared/alerting/public/utils/kibana_react.ts b/x-pack/platform/plugins/shared/alerting/public/utils/kibana_react.ts index 22b271ee4a288..4e7943fae50b8 100644 --- a/x-pack/platform/plugins/shared/alerting/public/utils/kibana_react.ts +++ b/x-pack/platform/plugins/shared/alerting/public/utils/kibana_react.ts @@ -5,10 +5,10 @@ * 2.0. */ -import { CoreStart } from '@kbn/core/public'; +import type { CoreStart } from '@kbn/core/public'; import { useKibana, useUiSetting } from '@kbn/kibana-react-plugin/public'; -import { Storage } from '@kbn/kibana-utils-plugin/public'; -import { AlertingPluginStart } from '../plugin'; +import type { Storage } from '@kbn/kibana-utils-plugin/public'; +import type { AlertingPluginStart } from '../plugin'; export type StartServices = CoreStart & AlertingPluginStart & diff --git a/x-pack/platform/plugins/shared/alerting/server/alert/alert.test.ts b/x-pack/platform/plugins/shared/alerting/server/alert/alert.test.ts index 6008f86289141..7dde1c27f64d9 100644 --- a/x-pack/platform/plugins/shared/alerting/server/alert/alert.test.ts +++ b/x-pack/platform/plugins/shared/alerting/server/alert/alert.test.ts @@ -7,9 +7,9 @@ import sinon from 'sinon'; import { Alert } from './alert'; -import { AlertInstanceState, AlertInstanceContext, DefaultActionGroupId } from '../../common'; +import type { AlertInstanceState, AlertInstanceContext, DefaultActionGroupId } from '../../common'; import { alertWithAnyUUID } from '../test_utils'; -import { CombinedSummarizedAlerts } from '../types'; +import type { CombinedSummarizedAlerts } from '../types'; let clock: sinon.SinonFakeTimers; diff --git a/x-pack/platform/plugins/shared/alerting/server/alert/alert.ts b/x-pack/platform/plugins/shared/alerting/server/alert/alert.ts index 51a9f29891bcf..14212d395461c 100644 --- a/x-pack/platform/plugins/shared/alerting/server/alert/alert.ts +++ b/x-pack/platform/plugins/shared/alerting/server/alert/alert.ts @@ -6,12 +6,12 @@ */ import { v4 as uuidV4 } from 'uuid'; -import { AADAlert } from '@kbn/alerts-as-data-utils'; +import type { AADAlert } from '@kbn/alerts-as-data-utils'; import { get, isEmpty } from 'lodash'; -import { MutableAlertInstanceMeta } from '@kbn/alerting-state-types'; +import type { MutableAlertInstanceMeta } from '@kbn/alerting-state-types'; import { ALERT_UUID } from '@kbn/rule-data-utils'; -import { AlertHit, CombinedSummarizedAlerts } from '../types'; -import { +import type { AlertHit, CombinedSummarizedAlerts } from '../types'; +import type { AlertInstanceMeta, AlertInstanceState, RawAlertInstance, @@ -245,7 +245,7 @@ export class Alert< return this.toRaw(); } - toRaw(recovered: boolean = false): RawAlertInstance { + toRaw(recovered = false): RawAlertInstance { return recovered ? { // for a recovered alert, we only care to track the flappingHistory, diff --git a/x-pack/platform/plugins/shared/alerting/server/alert/create_alert_factory.ts b/x-pack/platform/plugins/shared/alerting/server/alert/create_alert_factory.ts index fd4c6ebbf1667..efd8175f7d4cc 100644 --- a/x-pack/platform/plugins/shared/alerting/server/alert/create_alert_factory.ts +++ b/x-pack/platform/plugins/shared/alerting/server/alert/create_alert_factory.ts @@ -5,10 +5,11 @@ * 2.0. */ -import { Logger } from '@kbn/core/server'; +import type { Logger } from '@kbn/core/server'; import { cloneDeep } from 'lodash'; -import { AlertInstanceContext, AlertInstanceState } from '../types'; -import { Alert, PublicAlert } from './alert'; +import type { AlertInstanceContext, AlertInstanceState } from '../types'; +import type { PublicAlert } from './alert'; +import { Alert } from './alert'; import { processAlerts } from '../lib'; export interface AlertFactory< diff --git a/x-pack/platform/plugins/shared/alerting/server/alerting_authorization_client_factory.mock.ts b/x-pack/platform/plugins/shared/alerting/server/alerting_authorization_client_factory.mock.ts index d80f1d7289627..3cfa0d8dde465 100644 --- a/x-pack/platform/plugins/shared/alerting/server/alerting_authorization_client_factory.mock.ts +++ b/x-pack/platform/plugins/shared/alerting/server/alerting_authorization_client_factory.mock.ts @@ -6,7 +6,7 @@ */ import type { PublicMethodsOf } from '@kbn/utility-types'; -import { AlertingAuthorizationClientFactory } from './alerting_authorization_client_factory'; +import type { AlertingAuthorizationClientFactory } from './alerting_authorization_client_factory'; const creatAlertingAuthorizationClientFactoryMock = () => { const mocked: jest.Mocked> = { diff --git a/x-pack/platform/plugins/shared/alerting/server/alerting_authorization_client_factory.test.ts b/x-pack/platform/plugins/shared/alerting/server/alerting_authorization_client_factory.test.ts index f29b7acb8eee3..220b0c7e6b9f4 100644 --- a/x-pack/platform/plugins/shared/alerting/server/alerting_authorization_client_factory.test.ts +++ b/x-pack/platform/plugins/shared/alerting/server/alerting_authorization_client_factory.test.ts @@ -7,10 +7,8 @@ import { mockRouter } from '@kbn/core-http-router-server-mocks'; import { ruleTypeRegistryMock } from './rule_type_registry.mock'; import { securityMock } from '@kbn/security-plugin/server/mocks'; -import { - AlertingAuthorizationClientFactory, - AlertingAuthorizationClientFactoryOpts, -} from './alerting_authorization_client_factory'; +import type { AlertingAuthorizationClientFactoryOpts } from './alerting_authorization_client_factory'; +import { AlertingAuthorizationClientFactory } from './alerting_authorization_client_factory'; import { featuresPluginMock } from '@kbn/features-plugin/server/mocks'; jest.mock('./authorization/alerting_authorization'); diff --git a/x-pack/platform/plugins/shared/alerting/server/alerting_authorization_client_factory.ts b/x-pack/platform/plugins/shared/alerting/server/alerting_authorization_client_factory.ts index 8c5a772501f2b..8bf4c4a5e5998 100644 --- a/x-pack/platform/plugins/shared/alerting/server/alerting_authorization_client_factory.ts +++ b/x-pack/platform/plugins/shared/alerting/server/alerting_authorization_client_factory.ts @@ -5,12 +5,12 @@ * 2.0. */ -import { KibanaRequest } from '@kbn/core/server'; -import { SecurityPluginStart } from '@kbn/security-plugin/server'; -import { FeaturesPluginStart } from '@kbn/features-plugin/server'; -import { Space } from '@kbn/spaces-plugin/server'; +import type { KibanaRequest } from '@kbn/core/server'; +import type { SecurityPluginStart } from '@kbn/security-plugin/server'; +import type { FeaturesPluginStart } from '@kbn/features-plugin/server'; +import type { Space } from '@kbn/spaces-plugin/server'; import { AlertingAuthorization } from './authorization/alerting_authorization'; -import { RuleTypeRegistry } from './types'; +import type { RuleTypeRegistry } from './types'; export interface AlertingAuthorizationClientFactoryOpts { ruleTypeRegistry: RuleTypeRegistry; diff --git a/x-pack/platform/plugins/shared/alerting/server/alerts_client/alerts_client.test.ts b/x-pack/platform/plugins/shared/alerting/server/alerts_client/alerts_client.test.ts index e361b90d9c14a..846c1535d9b7d 100644 --- a/x-pack/platform/plugins/shared/alerting/server/alerts_client/alerts_client.test.ts +++ b/x-pack/platform/plugins/shared/alerting/server/alerts_client/alerts_client.test.ts @@ -7,14 +7,9 @@ import { elasticsearchServiceMock, loggingSystemMock } from '@kbn/core/server/mocks'; import type { UpdateByQueryRequest } from '@elastic/elasticsearch/lib/api/types'; -import { UntypedNormalizedRuleType } from '../rule_type_registry'; -import { - AlertsFilter, - DEFAULT_FLAPPING_SETTINGS, - MaintenanceWindowStatus, - RecoveredActionGroup, - RuleAlertData, -} from '../types'; +import type { UntypedNormalizedRuleType } from '../rule_type_registry'; +import type { AlertsFilter, RuleAlertData } from '../types'; +import { DEFAULT_FLAPPING_SETTINGS, MaintenanceWindowStatus, RecoveredActionGroup } from '../types'; import { ALERT_ACTION_GROUP, ALERT_CONSECUTIVE_MATCHES, @@ -53,8 +48,9 @@ import { import * as LegacyAlertsClientModule from './legacy_alerts_client'; import { LegacyAlertsClient } from './legacy_alerts_client'; import { Alert } from '../alert/alert'; -import { AlertsClient, AlertsClientParams } from './alerts_client'; -import { +import type { AlertsClientParams } from './alerts_client'; +import { AlertsClient } from './alerts_client'; +import type { GetSummarizedAlertsParams, GetMaintenanceWindowScopedQueryAlertsParams, DetermineDelayedAlertsOpts, @@ -76,10 +72,10 @@ import { mockAAD, } from './alerts_client_fixtures'; import { getDataStreamAdapter } from '../alerts_service/lib/data_stream_adapter'; -import { MaintenanceWindow } from '../application/maintenance_window/types'; +import type { MaintenanceWindow } from '../application/maintenance_window/types'; import { maintenanceWindowsServiceMock } from '../task_runner/maintenance_windows/maintenance_windows_service.mock'; import { getMockMaintenanceWindow } from '../data/maintenance_window/test_helpers'; -import { KibanaRequest } from '@kbn/core/server'; +import type { KibanaRequest } from '@kbn/core/server'; import { rule } from './lib/test_fixtures'; const date = '2023-03-28T22:27:28.159Z'; @@ -469,7 +465,7 @@ describe('Alerts Client', () => { test('should split queries into chunks when there are greater than 10,000 alert UUIDs', async () => { mockLegacyAlertsClient.getTrackedAlerts.mockImplementation(() => ({ active: range(15000).reduce((acc: Record>, value: number) => { - const id: string = `${value}`; + const id = `${value}`; acc[id] = new Alert(id, { state: { foo: true }, meta: { diff --git a/x-pack/platform/plugins/shared/alerting/server/alerts_client/alerts_client.ts b/x-pack/platform/plugins/shared/alerting/server/alerts_client/alerts_client.ts index 12637ec68e795..05ebc54345116 100644 --- a/x-pack/platform/plugins/shared/alerting/server/alerts_client/alerts_client.ts +++ b/x-pack/platform/plugins/shared/alerting/server/alerts_client/alerts_client.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { ElasticsearchClient } from '@kbn/core/server'; +import type { ElasticsearchClient } from '@kbn/core/server'; import { ALERT_INSTANCE_ID, @@ -15,14 +15,14 @@ import { ALERT_MAINTENANCE_WINDOW_IDS, } from '@kbn/rule-data-utils'; import { chunk, flatMap, get, isEmpty, keys } from 'lodash'; -import { SearchRequest } from '@elastic/elasticsearch/lib/api/types'; +import type { SearchRequest } from '@elastic/elasticsearch/lib/api/types'; import type { Alert } from '@kbn/alerts-as-data-utils'; import { DEFAULT_NAMESPACE_STRING } from '@kbn/core-saved-objects-utils-server'; -import { DeepPartial } from '@kbn/utility-types'; -import { BulkResponse } from '@elastic/elasticsearch/lib/api/types'; +import type { DeepPartial } from '@kbn/utility-types'; +import type { BulkResponse } from '@elastic/elasticsearch/lib/api/types'; import { CLUSTER_BLOCK_EXCEPTION, isClusterBlockError } from '../lib/error_with_type'; -import { UntypedNormalizedRuleType } from '../rule_type_registry'; -import { +import type { UntypedNormalizedRuleType } from '../rule_type_registry'; +import type { SummarizedAlerts, ScopedQueryAlerts, AlertInstanceContext, @@ -32,13 +32,11 @@ import { DataStreamAdapter, } from '../types'; import { LegacyAlertsClient } from './legacy_alerts_client'; -import { - getIndexTemplateAndPattern, - IIndexPatternString, -} from '../alerts_service/resource_installer_utils'; -import { CreateAlertsClientParams } from '../alerts_service/alerts_service'; +import type { IIndexPatternString } from '../alerts_service/resource_installer_utils'; +import { getIndexTemplateAndPattern } from '../alerts_service/resource_installer_utils'; +import type { CreateAlertsClientParams } from '../alerts_service/alerts_service'; import type { AlertRule, LogAlertsOpts, SearchResult, DetermineDelayedAlertsOpts } from './types'; -import { +import type { IAlertsClient, InitializeExecutionOpts, TrackedAlerts, @@ -367,7 +365,7 @@ export class AlertsClient< if (!ruleId || !spaceId) { throw new Error(`Must specify both rule ID and space ID for AAD alert query.`); } - const queryByExecutionUuid: boolean = !!executionUuid; + const queryByExecutionUuid = !!executionUuid; const queryByTimeRange: boolean = !!start && !!end; // Either executionUuid or start/end dates must be specified, but not both if ( @@ -436,7 +434,7 @@ export class AlertsClient< const activeAlertsToIndex: Array = []; for (const id of keys(rawActiveAlerts)) { // See if there's an existing active alert document - if (!!activeAlerts[id]) { + if (activeAlerts[id]) { if ( Object.hasOwn(this.fetchedAlerts.data, id) && get(this.fetchedAlerts.data[id], ALERT_STATUS) === 'active' diff --git a/x-pack/platform/plugins/shared/alerting/server/alerts_client/alerts_client_fixtures.ts b/x-pack/platform/plugins/shared/alerting/server/alerts_client/alerts_client_fixtures.ts index 7f65cf89e527f..91f61e02cc591 100644 --- a/x-pack/platform/plugins/shared/alerting/server/alerts_client/alerts_client_fixtures.ts +++ b/x-pack/platform/plugins/shared/alerting/server/alerts_client/alerts_client_fixtures.ts @@ -5,14 +5,14 @@ * 2.0. */ -import { +import type { GetSummarizedAlertsParams, GetMaintenanceWindowScopedQueryAlertsParams, UpdateAlertsMaintenanceWindowIdByScopedQueryParams, } from './types'; import type { MaintenanceWindow } from '../application/maintenance_window/types'; -import { AlertRuleData } from '.'; -import { AlertsFilter } from '../types'; +import type { AlertRuleData } from '.'; +import type { AlertsFilter } from '../types'; export const alertRuleData: AlertRuleData = { consumer: 'bar', @@ -255,7 +255,7 @@ export const getExpectedQueryByTimeRange = ({ }, { term: { 'kibana.alert.rule.uuid': ruleId } } ); - if (!!excludedAlertInstanceIds?.length) { + if (excludedAlertInstanceIds?.length) { filter.push({ bool: { must_not: { diff --git a/x-pack/platform/plugins/shared/alerting/server/alerts_client/legacy_alerts_client.test.ts b/x-pack/platform/plugins/shared/alerting/server/alerts_client/legacy_alerts_client.test.ts index c5400b17eaf63..d1aba6aa8ff5b 100644 --- a/x-pack/platform/plugins/shared/alerting/server/alerts_client/legacy_alerts_client.test.ts +++ b/x-pack/platform/plugins/shared/alerting/server/alerts_client/legacy_alerts_client.test.ts @@ -5,8 +5,9 @@ * 2.0. */ import { loggingSystemMock } from '@kbn/core/server/mocks'; -import { UntypedNormalizedRuleType } from '../rule_type_registry'; -import { AlertInstanceContext, MaintenanceWindowStatus, RecoveredActionGroup } from '../types'; +import type { UntypedNormalizedRuleType } from '../rule_type_registry'; +import type { AlertInstanceContext } from '../types'; +import { MaintenanceWindowStatus, RecoveredActionGroup } from '../types'; import { LegacyAlertsClient } from './legacy_alerts_client'; import { createAlertFactory, getPublicAlertFactory } from '../alert/create_alert_factory'; import { Alert } from '../alert/alert'; @@ -16,7 +17,7 @@ import { DEFAULT_FLAPPING_SETTINGS } from '../../common/rules_settings'; import { schema } from '@kbn/config-schema'; import { maintenanceWindowsServiceMock } from '../task_runner/maintenance_windows/maintenance_windows_service.mock'; import { getMockMaintenanceWindow } from '../data/maintenance_window/test_helpers'; -import { KibanaRequest } from '@kbn/core/server'; +import type { KibanaRequest } from '@kbn/core/server'; import { alertingEventLoggerMock } from '../lib/alerting_event_logger/alerting_event_logger.mock'; import { determineFlappingAlerts } from '../lib/flapping/determine_flapping_alerts'; import { determineDelayedAlerts } from '../lib/determine_delayed_alerts'; diff --git a/x-pack/platform/plugins/shared/alerting/server/alerts_client/legacy_alerts_client.ts b/x-pack/platform/plugins/shared/alerting/server/alerts_client/legacy_alerts_client.ts index 3fc416b64a537..18eb24eae87b7 100644 --- a/x-pack/platform/plugins/shared/alerting/server/alerts_client/legacy_alerts_client.ts +++ b/x-pack/platform/plugins/shared/alerting/server/alerts_client/legacy_alerts_client.ts @@ -4,22 +4,22 @@ * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ -import { KibanaRequest, Logger } from '@kbn/core/server'; +import type { KibanaRequest, Logger } from '@kbn/core/server'; import { cloneDeep, keys } from 'lodash'; import { Alert } from '../alert/alert'; -import { - AlertFactory, - createAlertFactory, - getPublicAlertFactory, -} from '../alert/create_alert_factory'; +import type { AlertFactory } from '../alert/create_alert_factory'; +import { createAlertFactory, getPublicAlertFactory } from '../alert/create_alert_factory'; import { toRawAlertInstances, processAlerts } from '../lib'; + import { logAlerts } from '../task_runner/log_alerts'; -import { AlertInstanceContext, AlertInstanceState, WithoutReservedActionGroups } from '../types'; -import { - DEFAULT_FLAPPING_SETTINGS, - RulesSettingsFlappingProperties, -} from '../../common/rules_settings'; -import { +import type { + AlertInstanceContext, + AlertInstanceState, + WithoutReservedActionGroups, +} from '../types'; +import type { RulesSettingsFlappingProperties } from '../../common/rules_settings'; +import { DEFAULT_FLAPPING_SETTINGS } from '../../common/rules_settings'; +import type { IAlertsClient, InitializeExecutionOpts, LogAlertsOpts, @@ -27,9 +27,9 @@ import { DetermineDelayedAlertsOpts, } from './types'; import { DEFAULT_MAX_ALERTS } from '../config'; -import { UntypedNormalizedRuleType } from '../rule_type_registry'; -import { MaintenanceWindowsService } from '../task_runner/maintenance_windows'; -import { AlertingEventLogger } from '../lib/alerting_event_logger/alerting_event_logger'; +import type { UntypedNormalizedRuleType } from '../rule_type_registry'; +import type { MaintenanceWindowsService } from '../task_runner/maintenance_windows'; +import type { AlertingEventLogger } from '../lib/alerting_event_logger/alerting_event_logger'; import { determineFlappingAlerts } from '../lib/flapping/determine_flapping_alerts'; import { determineDelayedAlerts } from '../lib/determine_delayed_alerts'; @@ -51,7 +51,7 @@ export class LegacyAlertsClient< { private maxAlerts: number = DEFAULT_MAX_ALERTS; private flappingSettings: RulesSettingsFlappingProperties = DEFAULT_FLAPPING_SETTINGS; - private ruleLogPrefix: string = ''; + private ruleLogPrefix = ''; private startedAtString: string | null = null; // Alerts from the previous execution that are deserialized from the task state diff --git a/x-pack/platform/plugins/shared/alerting/server/alerts_client/lib/alert_conflict_resolver.test.ts b/x-pack/platform/plugins/shared/alerting/server/alerts_client/lib/alert_conflict_resolver.test.ts index cc6b43b40da7b..143cb26e3f4e0 100644 --- a/x-pack/platform/plugins/shared/alerting/server/alerts_client/lib/alert_conflict_resolver.test.ts +++ b/x-pack/platform/plugins/shared/alerting/server/alerts_client/lib/alert_conflict_resolver.test.ts @@ -14,7 +14,7 @@ import { ALERT_WORKFLOW_TAGS, EVENT_ACTION, } from '@kbn/rule-data-utils'; -import { +import type { BulkRequest, BulkResponse, BulkResponseItem, diff --git a/x-pack/platform/plugins/shared/alerting/server/alerts_client/lib/alert_conflict_resolver.ts b/x-pack/platform/plugins/shared/alerting/server/alerts_client/lib/alert_conflict_resolver.ts index 549ddd747c902..654936ede407b 100644 --- a/x-pack/platform/plugins/shared/alerting/server/alerts_client/lib/alert_conflict_resolver.ts +++ b/x-pack/platform/plugins/shared/alerting/server/alerts_client/lib/alert_conflict_resolver.ts @@ -5,14 +5,14 @@ * 2.0. */ -import { +import type { BulkRequest, BulkResponse, BulkOperationContainer, MgetResponseItem, } from '@elastic/elasticsearch/lib/api/types'; -import { Logger, ElasticsearchClient } from '@kbn/core/server'; +import type { Logger, ElasticsearchClient } from '@kbn/core/server'; import { ALERT_STATUS, ALERT_STATUS_ACTIVE, diff --git a/x-pack/platform/plugins/shared/alerting/server/alerts_client/lib/build_new_alert.test.ts b/x-pack/platform/plugins/shared/alerting/server/alerts_client/lib/build_new_alert.test.ts index 730d3af906920..527bbaeca2c33 100644 --- a/x-pack/platform/plugins/shared/alerting/server/alerts_client/lib/build_new_alert.test.ts +++ b/x-pack/platform/plugins/shared/alerting/server/alerts_client/lib/build_new_alert.test.ts @@ -6,7 +6,7 @@ */ import { Alert as LegacyAlert } from '../../alert/alert'; import { buildNewAlert } from './build_new_alert'; -import { Alert } from '@kbn/alerts-as-data-utils'; +import type { Alert } from '@kbn/alerts-as-data-utils'; import { SPACE_IDS, ALERT_ACTION_GROUP, diff --git a/x-pack/platform/plugins/shared/alerting/server/alerts_client/lib/build_new_alert.ts b/x-pack/platform/plugins/shared/alerting/server/alerts_client/lib/build_new_alert.ts index 456421a221ba5..b1bfd79d88fe8 100644 --- a/x-pack/platform/plugins/shared/alerting/server/alerts_client/lib/build_new_alert.ts +++ b/x-pack/platform/plugins/shared/alerting/server/alerts_client/lib/build_new_alert.ts @@ -31,9 +31,9 @@ import { ALERT_RULE_EXECUTION_TIMESTAMP, ALERT_SEVERITY_IMPROVING, } from '@kbn/rule-data-utils'; -import { DeepPartial } from '@kbn/utility-types'; -import { Alert as LegacyAlert } from '../../alert/alert'; -import { AlertInstanceContext, AlertInstanceState, RuleAlertData } from '../../types'; +import type { DeepPartial } from '@kbn/utility-types'; +import type { Alert as LegacyAlert } from '../../alert/alert'; +import type { AlertInstanceContext, AlertInstanceState, RuleAlertData } from '../../types'; import type { AlertRule } from '../types'; import { stripFrameworkFields } from './strip_framework_fields'; import { nanosToMicros } from './nanos_to_micros'; diff --git a/x-pack/platform/plugins/shared/alerting/server/alerts_client/lib/build_ongoing_alert.ts b/x-pack/platform/plugins/shared/alerting/server/alerts_client/lib/build_ongoing_alert.ts index 6d0fb63be5e99..e3318326ce32e 100644 --- a/x-pack/platform/plugins/shared/alerting/server/alerts_client/lib/build_ongoing_alert.ts +++ b/x-pack/platform/plugins/shared/alerting/server/alerts_client/lib/build_ongoing_alert.ts @@ -26,10 +26,10 @@ import { TIMESTAMP, VERSION, } from '@kbn/rule-data-utils'; -import { DeepPartial } from '@kbn/utility-types'; +import type { DeepPartial } from '@kbn/utility-types'; import { get, omit } from 'lodash'; -import { Alert as LegacyAlert } from '../../alert/alert'; -import { AlertInstanceContext, AlertInstanceState, RuleAlertData } from '../../types'; +import type { Alert as LegacyAlert } from '../../alert/alert'; +import type { AlertInstanceContext, AlertInstanceState, RuleAlertData } from '../../types'; import type { AlertRule } from '../types'; import { stripFrameworkFields } from './strip_framework_fields'; import { nanosToMicros } from './nanos_to_micros'; diff --git a/x-pack/platform/plugins/shared/alerting/server/alerts_client/lib/build_recovered_alert.ts b/x-pack/platform/plugins/shared/alerting/server/alerts_client/lib/build_recovered_alert.ts index aef3f6d17bb69..9bc9229b7c414 100644 --- a/x-pack/platform/plugins/shared/alerting/server/alerts_client/lib/build_recovered_alert.ts +++ b/x-pack/platform/plugins/shared/alerting/server/alerts_client/lib/build_recovered_alert.ts @@ -29,10 +29,10 @@ import { ALERT_SEVERITY_IMPROVING, ALERT_RULE_EXECUTION_UUID, } from '@kbn/rule-data-utils'; -import { DeepPartial } from '@kbn/utility-types'; +import type { DeepPartial } from '@kbn/utility-types'; import { get } from 'lodash'; -import { Alert as LegacyAlert } from '../../alert/alert'; -import { AlertInstanceContext, AlertInstanceState, RuleAlertData } from '../../types'; +import type { Alert as LegacyAlert } from '../../alert/alert'; +import type { AlertInstanceContext, AlertInstanceState, RuleAlertData } from '../../types'; import type { AlertRule } from '../types'; import { stripFrameworkFields } from './strip_framework_fields'; import { nanosToMicros } from './nanos_to_micros'; diff --git a/x-pack/platform/plugins/shared/alerting/server/alerts_client/lib/build_updated_recovered_alert.ts b/x-pack/platform/plugins/shared/alerting/server/alerts_client/lib/build_updated_recovered_alert.ts index ba1e0c4b5f56a..40f5be75dfbb7 100644 --- a/x-pack/platform/plugins/shared/alerting/server/alerts_client/lib/build_updated_recovered_alert.ts +++ b/x-pack/platform/plugins/shared/alerting/server/alerts_client/lib/build_updated_recovered_alert.ts @@ -17,10 +17,10 @@ import { ALERT_RULE_EXECUTION_UUID, TIMESTAMP, } from '@kbn/rule-data-utils'; -import { RawAlertInstance } from '@kbn/alerting-state-types'; +import type { RawAlertInstance } from '@kbn/alerting-state-types'; import { get, omit } from 'lodash'; -import { RuleAlertData } from '../../types'; -import { AlertRule } from '../types'; +import type { RuleAlertData } from '../../types'; +import type { AlertRule } from '../types'; import { removeUnflattenedFieldsFromAlert, replaceRefreshableAlertFields } from './format_alert'; interface BuildUpdatedRecoveredAlertOpts { diff --git a/x-pack/platform/plugins/shared/alerting/server/alerts_client/lib/format_alert.ts b/x-pack/platform/plugins/shared/alerting/server/alerts_client/lib/format_alert.ts index 45043bf334be6..d7a8299eb83d2 100644 --- a/x-pack/platform/plugins/shared/alerting/server/alerts_client/lib/format_alert.ts +++ b/x-pack/platform/plugins/shared/alerting/server/alerts_client/lib/format_alert.ts @@ -7,7 +7,7 @@ import { cloneDeep, get, isEmpty, isNull, isUndefined, merge, omit } from 'lodash'; import type { Alert } from '@kbn/alerts-as-data-utils'; -import { RuleAlertData } from '../../types'; +import type { RuleAlertData } from '../../types'; import { REFRESH_FIELDS_ALL } from './alert_conflict_resolver'; const expandDottedField = (dottedFieldName: string, val: unknown): object => { diff --git a/x-pack/platform/plugins/shared/alerting/server/alerts_client/lib/format_rule.test.ts b/x-pack/platform/plugins/shared/alerting/server/alerts_client/lib/format_rule.test.ts index c9cc7fbefbfa4..10475cf436e59 100644 --- a/x-pack/platform/plugins/shared/alerting/server/alerts_client/lib/format_rule.test.ts +++ b/x-pack/platform/plugins/shared/alerting/server/alerts_client/lib/format_rule.test.ts @@ -5,7 +5,7 @@ * 2.0. */ import { formatRule } from './format_rule'; -import { UntypedNormalizedRuleType } from '../../rule_type_registry'; +import type { UntypedNormalizedRuleType } from '../../rule_type_registry'; import { RecoveredActionGroup } from '../../types'; import { ALERT_RULE_CATEGORY, diff --git a/x-pack/platform/plugins/shared/alerting/server/alerts_client/lib/format_rule.ts b/x-pack/platform/plugins/shared/alerting/server/alerts_client/lib/format_rule.ts index 33281b918c2a9..130f6033a868f 100644 --- a/x-pack/platform/plugins/shared/alerting/server/alerts_client/lib/format_rule.ts +++ b/x-pack/platform/plugins/shared/alerting/server/alerts_client/lib/format_rule.ts @@ -18,7 +18,7 @@ import { SPACE_IDS, } from '@kbn/rule-data-utils'; import type { AlertRule, AlertRuleData } from '../types'; -import { UntypedNormalizedRuleType } from '../../rule_type_registry'; +import type { UntypedNormalizedRuleType } from '../../rule_type_registry'; interface FormatRuleOpts { rule: AlertRuleData; diff --git a/x-pack/platform/plugins/shared/alerting/server/alerts_client/lib/get_summarized_alerts_query.ts b/x-pack/platform/plugins/shared/alerting/server/alerts_client/lib/get_summarized_alerts_query.ts index cbad081b05961..18afef67e3e6d 100644 --- a/x-pack/platform/plugins/shared/alerting/server/alerts_client/lib/get_summarized_alerts_query.ts +++ b/x-pack/platform/plugins/shared/alerting/server/alerts_client/lib/get_summarized_alerts_query.ts @@ -5,13 +5,13 @@ * 2.0. */ -import { +import type { QueryDslQueryContainer, SearchRequest, SearchTotalHits, AggregationsAggregationContainer, } from '@elastic/elasticsearch/lib/api/types'; -import { BoolQuery } from '@kbn/es-query'; +import type { BoolQuery } from '@kbn/es-query'; import { ALERT_END, ALERT_INSTANCE_ID, @@ -23,9 +23,10 @@ import { EVENT_ACTION, TIMESTAMP, } from '@kbn/rule-data-utils'; -import { Alert } from '@kbn/alerts-as-data-utils'; -import { AlertsFilter, ISO_WEEKDAYS, RuleAlertData } from '../../../common'; -import { +import type { Alert } from '@kbn/alerts-as-data-utils'; +import type { AlertsFilter, RuleAlertData } from '../../../common'; +import { ISO_WEEKDAYS } from '../../../common'; +import type { GetLifecycleAlertsQueryByExecutionUuidParams, GetLifecycleAlertsQueryByTimeRangeParams, GetAlertsQueryParams, @@ -36,8 +37,8 @@ import { ScopedQueryAggregationResult, SearchResult, } from '../types'; -import { SummarizedAlertsChunk, ScopedQueryAlerts } from '../..'; -import { FormatAlert } from '../../types'; +import type { SummarizedAlertsChunk, ScopedQueryAlerts } from '../..'; +import type { FormatAlert } from '../../types'; import { expandFlattenedAlert } from './format_alert'; import { injectAnalyzeWildcard } from './inject_analyze_wildcard'; @@ -473,7 +474,7 @@ const getLifecycleAlertsQueries = ({ maxAlertLimit, }: GetAlertsQueryParams): SearchRequest[] => { let queryBodies; - if (!!executionUuid) { + if (executionUuid) { queryBodies = getLifecycleAlertsQueryByExecutionUuid({ executionUuid: executionUuid!, ruleId, @@ -505,7 +506,7 @@ const getContinualAlertsQuery = ({ maxAlertLimit, }: GetAlertsQueryParams): SearchRequest => { let queryBody; - if (!!executionUuid) { + if (executionUuid) { queryBody = getQueryByExecutionUuid({ executionUuid, ruleId, diff --git a/x-pack/platform/plugins/shared/alerting/server/alerts_client/lib/initialize_alerts_client.test.ts b/x-pack/platform/plugins/shared/alerting/server/alerts_client/lib/initialize_alerts_client.test.ts index 78339ed5906b0..7587f5f0ed60a 100644 --- a/x-pack/platform/plugins/shared/alerting/server/alerts_client/lib/initialize_alerts_client.test.ts +++ b/x-pack/platform/plugins/shared/alerting/server/alerts_client/lib/initialize_alerts_client.test.ts @@ -19,11 +19,12 @@ import { ruleRunMetricsStoreMock } from '../../lib/rule_run_metrics_store.mock'; import { alertingEventLoggerMock } from '../../lib/alerting_event_logger/alerting_event_logger.mock'; import { DEFAULT_FLAPPING_SETTINGS } from '../../types'; import { alertsClientMock } from '../alerts_client.mock'; -import { UntypedNormalizedRuleType } from '../../rule_type_registry'; +import type { UntypedNormalizedRuleType } from '../../rule_type_registry'; import { legacyAlertsClientMock } from '../legacy_alerts_client.mock'; -import { initializeAlertsClient, RuleData } from './initialize_alerts_client'; +import type { RuleData } from './initialize_alerts_client'; +import { initializeAlertsClient } from './initialize_alerts_client'; import { maintenanceWindowsServiceMock } from '../../task_runner/maintenance_windows/maintenance_windows_service.mock'; -import { KibanaRequest } from '@kbn/core/server'; +import type { KibanaRequest } from '@kbn/core/server'; const alertingEventLogger = alertingEventLoggerMock.create(); const ruleRunMetricsStore = ruleRunMetricsStoreMock.create(); diff --git a/x-pack/platform/plugins/shared/alerting/server/alerts_client/lib/initialize_alerts_client.ts b/x-pack/platform/plugins/shared/alerting/server/alerts_client/lib/initialize_alerts_client.ts index 97c31ae787427..31055ffb630d4 100644 --- a/x-pack/platform/plugins/shared/alerting/server/alerts_client/lib/initialize_alerts_client.ts +++ b/x-pack/platform/plugins/shared/alerting/server/alerts_client/lib/initialize_alerts_client.ts @@ -6,20 +6,20 @@ */ import { DEFAULT_NAMESPACE_STRING } from '@kbn/core-saved-objects-utils-server'; -import { Logger } from '@kbn/core/server'; +import type { Logger } from '@kbn/core/server'; import { LegacyAlertsClient } from '..'; -import { IAlertsClient } from '../types'; -import { AlertsService } from '../../alerts_service'; -import { UntypedNormalizedRuleType } from '../../rule_type_registry'; -import { +import type { IAlertsClient } from '../types'; +import type { AlertsService } from '../../alerts_service'; +import type { UntypedNormalizedRuleType } from '../../rule_type_registry'; +import type { AlertInstanceContext, AlertInstanceState, - DEFAULT_FLAPPING_SETTINGS, RuleAlertData, RuleTypeParams, SanitizedRule, } from '../../types'; -import { RuleTaskInstance, RuleTypeRunnerContext } from '../../task_runner/types'; +import { DEFAULT_FLAPPING_SETTINGS } from '../../types'; +import type { RuleTaskInstance, RuleTypeRunnerContext } from '../../task_runner/types'; export type RuleData = Pick< SanitizedRule, diff --git a/x-pack/platform/plugins/shared/alerting/server/alerts_client/lib/inject_analyze_wildcard.ts b/x-pack/platform/plugins/shared/alerting/server/alerts_client/lib/inject_analyze_wildcard.ts index 2a6f6a3e0b754..46ccbf2b17942 100644 --- a/x-pack/platform/plugins/shared/alerting/server/alerts_client/lib/inject_analyze_wildcard.ts +++ b/x-pack/platform/plugins/shared/alerting/server/alerts_client/lib/inject_analyze_wildcard.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { QueryDslQueryContainer } from '@elastic/elasticsearch/lib/api/types'; +import type { QueryDslQueryContainer } from '@elastic/elasticsearch/lib/api/types'; export const injectAnalyzeWildcard = (query: QueryDslQueryContainer): void => { if (!query) { diff --git a/x-pack/platform/plugins/shared/alerting/server/alerts_client/lib/is_alert_improving.test.ts b/x-pack/platform/plugins/shared/alerting/server/alerts_client/lib/is_alert_improving.test.ts index e2b4136dac163..cf819a69a3515 100644 --- a/x-pack/platform/plugins/shared/alerting/server/alerts_client/lib/is_alert_improving.test.ts +++ b/x-pack/platform/plugins/shared/alerting/server/alerts_client/lib/is_alert_improving.test.ts @@ -11,7 +11,7 @@ import { ALERT_ACTION_GROUP } from '@kbn/rule-data-utils'; import { Alert as LegacyAlert } from '../../alert'; import { isAlertImproving } from './is_alert_improving'; import { existingExpandedNewAlert, existingFlattenedNewAlert } from './test_fixtures'; -import { ActionGroup } from '../../types'; +import type { ActionGroup } from '../../types'; const actionGroupsWithSeverity: Array> = [ { id: 'info', name: 'Info', severity: { level: 0 } }, diff --git a/x-pack/platform/plugins/shared/alerting/server/alerts_client/lib/is_alert_improving.ts b/x-pack/platform/plugins/shared/alerting/server/alerts_client/lib/is_alert_improving.ts index cf8b3205606ee..e495367226ba5 100644 --- a/x-pack/platform/plugins/shared/alerting/server/alerts_client/lib/is_alert_improving.ts +++ b/x-pack/platform/plugins/shared/alerting/server/alerts_client/lib/is_alert_improving.ts @@ -8,8 +8,13 @@ import { get } from 'lodash'; import type { Alert } from '@kbn/alerts-as-data-utils'; import { ALERT_ACTION_GROUP } from '@kbn/rule-data-utils'; -import { Alert as LegacyAlert } from '../../alert'; -import { ActionGroup, AlertInstanceState, AlertInstanceContext, RuleAlertData } from '../../types'; +import type { Alert as LegacyAlert } from '../../alert'; +import type { + ActionGroup, + AlertInstanceState, + AlertInstanceContext, + RuleAlertData, +} from '../../types'; export const isAlertImproving = < AlertData extends RuleAlertData, diff --git a/x-pack/platform/plugins/shared/alerting/server/alerts_client/lib/sanitize_bulk_response.test.ts b/x-pack/platform/plugins/shared/alerting/server/alerts_client/lib/sanitize_bulk_response.test.ts index ec0211646a1be..59b07b2074320 100644 --- a/x-pack/platform/plugins/shared/alerting/server/alerts_client/lib/sanitize_bulk_response.test.ts +++ b/x-pack/platform/plugins/shared/alerting/server/alerts_client/lib/sanitize_bulk_response.test.ts @@ -4,8 +4,8 @@ * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ -import { TransportResult } from '@elastic/elasticsearch'; -import type { estypes } from '@elastic/elasticsearch'; +import type { TransportResult } from '@elastic/elasticsearch'; +import type * as estypes from '@elastic/elasticsearch/lib/api/types'; import { sanitizeBulkErrorResponse } from './sanitize_bulk_response'; // Using https://www.elastic.co/guide/en/elasticsearch/reference/8.11/docs-bulk.html @@ -231,7 +231,7 @@ describe('sanitizeBulkErrorResponse', () => { function wrapResponseBody( body: estypes.BulkResponse, - statusCode: number = 200 + statusCode = 200 ): TransportResult { return { body, diff --git a/x-pack/platform/plugins/shared/alerting/server/alerts_client/lib/sanitize_bulk_response.ts b/x-pack/platform/plugins/shared/alerting/server/alerts_client/lib/sanitize_bulk_response.ts index 0c79b6e2e13f1..b1d3305bdc4d8 100644 --- a/x-pack/platform/plugins/shared/alerting/server/alerts_client/lib/sanitize_bulk_response.ts +++ b/x-pack/platform/plugins/shared/alerting/server/alerts_client/lib/sanitize_bulk_response.ts @@ -5,7 +5,7 @@ * 2.0. */ import { cloneDeep } from 'lodash'; -import { TransportResult } from '@elastic/elasticsearch'; +import type { TransportResult } from '@elastic/elasticsearch'; import { get } from 'lodash'; import { set } from '@kbn/safer-lodash-set'; import type { estypes } from '@elastic/elasticsearch'; diff --git a/x-pack/platform/plugins/shared/alerting/server/alerts_client/lib/strip_framework_fields.ts b/x-pack/platform/plugins/shared/alerting/server/alerts_client/lib/strip_framework_fields.ts index bc55f72147d62..5c9ad368cddec 100644 --- a/x-pack/platform/plugins/shared/alerting/server/alerts_client/lib/strip_framework_fields.ts +++ b/x-pack/platform/plugins/shared/alerting/server/alerts_client/lib/strip_framework_fields.ts @@ -8,7 +8,7 @@ import { omit } from 'lodash'; import { ALERT_REASON, ALERT_WORKFLOW_STATUS, TAGS, ALERT_URL } from '@kbn/rule-data-utils'; import { alertFieldMap } from '@kbn/alerts-as-data-utils'; -import { RuleAlertData } from '../../types'; +import type { RuleAlertData } from '../../types'; const allowedFrameworkFields = new Set([ ALERT_REASON, diff --git a/x-pack/platform/plugins/shared/alerting/server/alerts_client/lib/test_fixtures.ts b/x-pack/platform/plugins/shared/alerting/server/alerts_client/lib/test_fixtures.ts index a0ce91d145911..e4e6d1e194e2d 100644 --- a/x-pack/platform/plugins/shared/alerting/server/alerts_client/lib/test_fixtures.ts +++ b/x-pack/platform/plugins/shared/alerting/server/alerts_client/lib/test_fixtures.ts @@ -37,7 +37,7 @@ import { ALERT_END, ALERT_SEVERITY_IMPROVING, } from '@kbn/rule-data-utils'; -import { AlertRule } from '../types'; +import type { AlertRule } from '../types'; import { expandFlattenedAlert } from './format_alert'; export const rule = { diff --git a/x-pack/platform/plugins/shared/alerting/server/alerts_client/types.ts b/x-pack/platform/plugins/shared/alerting/server/alerts_client/types.ts index 02416f46ec1f7..6034683af725b 100644 --- a/x-pack/platform/plugins/shared/alerting/server/alerts_client/types.ts +++ b/x-pack/platform/plugins/shared/alerting/server/alerts_client/types.ts @@ -6,9 +6,9 @@ */ import type { Alert } from '@kbn/alerts-as-data-utils'; -import { DeepPartial } from '@kbn/utility-types'; -import { SearchResponseBody } from '@elastic/elasticsearch/lib/api/types'; -import { +import type { DeepPartial } from '@kbn/utility-types'; +import type { SearchResponseBody } from '@elastic/elasticsearch/lib/api/types'; +import type { ALERT_RULE_CATEGORY, ALERT_RULE_CONSUMER, ALERT_RULE_EXECUTION_UUID, @@ -22,8 +22,8 @@ import { ALERT_UUID, SPACE_IDS, } from '@kbn/rule-data-utils'; -import { Alert as LegacyAlert } from '../alert/alert'; -import { +import type { Alert as LegacyAlert } from '../alert/alert'; +import type { AlertInstanceContext, AlertInstanceState, AlertsFilter, @@ -32,11 +32,11 @@ import { RuleAlertData, WithoutReservedActionGroups, } from '../types'; -import { AlertingEventLogger } from '../lib/alerting_event_logger/alerting_event_logger'; -import { RuleRunMetricsStore } from '../lib/rule_run_metrics_store'; -import { RulesSettingsFlappingProperties } from '../../common/rules_settings'; +import type { AlertingEventLogger } from '../lib/alerting_event_logger/alerting_event_logger'; +import type { RuleRunMetricsStore } from '../lib/rule_run_metrics_store'; +import type { RulesSettingsFlappingProperties } from '../../common/rules_settings'; import type { PublicAlertFactory } from '../alert/create_alert_factory'; -import { MaintenanceWindow } from '../application/maintenance_window/types'; +import type { MaintenanceWindow } from '../application/maintenance_window/types'; export interface AlertRuleData { consumer: string; diff --git a/x-pack/platform/plugins/shared/alerting/server/alerts_service/alerts_service.test.ts b/x-pack/platform/plugins/shared/alerting/server/alerts_service/alerts_service.test.ts index 51fe6e8608514..2a78570353341 100644 --- a/x-pack/platform/plugins/shared/alerting/server/alerts_service/alerts_service.test.ts +++ b/x-pack/platform/plugins/shared/alerting/server/alerts_service/alerts_service.test.ts @@ -7,22 +7,23 @@ import { elasticsearchServiceMock, loggingSystemMock } from '@kbn/core/server/mocks'; import { elasticsearchClientMock } from '@kbn/core-elasticsearch-client-server-mocks'; -import { +import type { IndicesGetDataStreamResponse, IndicesDataStreamIndex, } from '@elastic/elasticsearch/lib/api/types'; import { errors as EsErrors } from '@elastic/elasticsearch'; import { ReplaySubject, Subject, of } from 'rxjs'; import { AlertsService } from './alerts_service'; -import { IRuleTypeAlerts, RecoveredActionGroup } from '../types'; +import type { IRuleTypeAlerts } from '../types'; +import { RecoveredActionGroup } from '../types'; import { retryUntil } from './test_utils'; import { DEFAULT_NAMESPACE_STRING } from '@kbn/core-saved-objects-utils-server'; -import { UntypedNormalizedRuleType } from '../rule_type_registry'; +import type { UntypedNormalizedRuleType } from '../rule_type_registry'; import { AlertsClient } from '../alerts_client'; import { alertsClientMock } from '../alerts_client/alerts_client.mock'; import { getDataStreamAdapter } from './lib/data_stream_adapter'; import { maintenanceWindowsServiceMock } from '../task_runner/maintenance_windows/maintenance_windows_service.mock'; -import { KibanaRequest } from '@kbn/core/server'; +import type { KibanaRequest } from '@kbn/core/server'; import { alertingEventLoggerMock } from '../lib/alerting_event_logger/alerting_event_logger.mock'; jest.mock('../alerts_client'); diff --git a/x-pack/platform/plugins/shared/alerting/server/alerts_service/alerts_service.ts b/x-pack/platform/plugins/shared/alerting/server/alerts_service/alerts_service.ts index 6a6dbbdb58dfc..4a8de5ccc2eee 100644 --- a/x-pack/platform/plugins/shared/alerting/server/alerts_service/alerts_service.ts +++ b/x-pack/platform/plugins/shared/alerting/server/alerts_service/alerts_service.ts @@ -6,8 +6,9 @@ */ import { isEmpty, isEqual, omit } from 'lodash'; -import { Logger, ElasticsearchClient } from '@kbn/core/server'; -import { filter, firstValueFrom, Observable } from 'rxjs'; +import type { Logger, ElasticsearchClient } from '@kbn/core/server'; +import type { Observable } from 'rxjs'; +import { filter, firstValueFrom } from 'rxjs'; import { alertFieldMap, ecsFieldMap, legacyAlertFieldMap } from '@kbn/alerts-as-data-utils'; import { DEFAULT_NAMESPACE_STRING } from '@kbn/core-saved-objects-utils-server'; import { @@ -19,18 +20,20 @@ import { getComponentTemplateName, getIndexTemplateAndPattern, } from './resource_installer_utils'; -import { +import type { AlertInstanceContext, AlertInstanceState, IRuleTypeAlerts, RuleAlertData, DataStreamAdapter, } from '../types'; +import type { + InitializationPromise, + ResourceInstallationHelper, +} from './create_resource_installation_helper'; import { createResourceInstallationHelper, errorResult, - InitializationPromise, - ResourceInstallationHelper, successResult, } from './create_resource_installation_helper'; import { @@ -44,8 +47,9 @@ import { } from './lib'; import type { LegacyAlertsClientParams, AlertRuleData } from '../alerts_client'; import { AlertsClient } from '../alerts_client'; -import { IAlertsClient } from '../alerts_client/types'; -import { setAlertsToUntracked, SetAlertsToUntrackedParams } from './lib/set_alerts_to_untracked'; +import type { IAlertsClient } from '../alerts_client/types'; +import type { SetAlertsToUntrackedParams } from './lib/set_alerts_to_untracked'; +import { setAlertsToUntracked } from './lib/set_alerts_to_untracked'; export const TOTAL_FIELDS_LIMIT = 2500; const LEGACY_ALERT_CONTEXT = 'legacy-alert'; @@ -122,7 +126,7 @@ export type PublicFrameworkAlertsService = PublicAlertsService & { export class AlertsService implements IAlertsService { private initialized: boolean; private isServerless: boolean; - private isInitializing: boolean = false; + private isInitializing = false; private resourceInitializationHelper: ResourceInstallationHelper; private registeredContexts: Map = new Map(); private commonInitPromise: Promise; diff --git a/x-pack/platform/plugins/shared/alerting/server/alerts_service/create_resource_installation_helper.test.ts b/x-pack/platform/plugins/shared/alerting/server/alerts_service/create_resource_installation_helper.test.ts index 872ce7fc43920..b24aad79716e2 100644 --- a/x-pack/platform/plugins/shared/alerting/server/alerts_service/create_resource_installation_helper.test.ts +++ b/x-pack/platform/plugins/shared/alerting/server/alerts_service/create_resource_installation_helper.test.ts @@ -8,12 +8,14 @@ import { range } from 'lodash'; import { DEFAULT_NAMESPACE_STRING } from '@kbn/core-saved-objects-utils-server'; import { loggingSystemMock } from '@kbn/core/server/mocks'; -import { IRuleTypeAlerts } from '../types'; +import type { IRuleTypeAlerts } from '../types'; +import type { + InitializationPromise, + ResourceInstallationHelper, +} from './create_resource_installation_helper'; import { createResourceInstallationHelper, errorResult, - InitializationPromise, - ResourceInstallationHelper, successResult, calculateDelay, getShouldRetry, @@ -33,8 +35,8 @@ const initFnWithError = async (context: IRuleTypeAlerts, namespace: string, time const getCommonInitPromise = async ( resolution: boolean, - timeoutMs: number = 1, - customLogString: string = '' + timeoutMs = 1, + customLogString = '' ): Promise => { if (timeoutMs < 0) { throw new Error('fail'); @@ -48,7 +50,7 @@ const getCommonInitPromise = async ( const getContextInitialized = async ( helper: ResourceInstallationHelper, - context: string = 'test1', + context = 'test1', namespace: string = DEFAULT_NAMESPACE_STRING ) => { const { result } = await helper.getInitializedContext(context, namespace); diff --git a/x-pack/platform/plugins/shared/alerting/server/alerts_service/create_resource_installation_helper.ts b/x-pack/platform/plugins/shared/alerting/server/alerts_service/create_resource_installation_helper.ts index 3e62dad46606c..07be499e08c30 100644 --- a/x-pack/platform/plugins/shared/alerting/server/alerts_service/create_resource_installation_helper.ts +++ b/x-pack/platform/plugins/shared/alerting/server/alerts_service/create_resource_installation_helper.ts @@ -6,8 +6,8 @@ */ import { DEFAULT_NAMESPACE_STRING } from '@kbn/core-saved-objects-utils-server'; -import { Logger } from '@kbn/core/server'; -import { IRuleTypeAlerts } from '../types'; +import type { Logger } from '@kbn/core/server'; +import type { IRuleTypeAlerts } from '../types'; export interface InitializationPromise { result: boolean; diff --git a/x-pack/platform/plugins/shared/alerting/server/alerts_service/default_lifecycle_policy.ts b/x-pack/platform/plugins/shared/alerting/server/alerts_service/default_lifecycle_policy.ts index e6717f408b342..14e4b389498b8 100644 --- a/x-pack/platform/plugins/shared/alerting/server/alerts_service/default_lifecycle_policy.ts +++ b/x-pack/platform/plugins/shared/alerting/server/alerts_service/default_lifecycle_policy.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { IlmPolicy } from '@elastic/elasticsearch/lib/api/types'; +import type { IlmPolicy } from '@elastic/elasticsearch/lib/api/types'; /** * Default alert index ILM policy diff --git a/x-pack/platform/plugins/shared/alerting/server/alerts_service/lib/create_concrete_write_index.test.ts b/x-pack/platform/plugins/shared/alerting/server/alerts_service/lib/create_concrete_write_index.test.ts index 2683007ca86f4..85a7a31a97357 100644 --- a/x-pack/platform/plugins/shared/alerting/server/alerts_service/lib/create_concrete_write_index.test.ts +++ b/x-pack/platform/plugins/shared/alerting/server/alerts_service/lib/create_concrete_write_index.test.ts @@ -6,7 +6,7 @@ */ import { elasticsearchServiceMock, loggingSystemMock } from '@kbn/core/server/mocks'; import { errors as EsErrors } from '@elastic/elasticsearch'; -import { IndicesGetDataStreamResponse } from '@elastic/elasticsearch/lib/api/types'; +import type { IndicesGetDataStreamResponse } from '@elastic/elasticsearch/lib/api/types'; import { createConcreteWriteIndex, setConcreteWriteIndex } from './create_concrete_write_index'; import { getDataStreamAdapter } from './data_stream_adapter'; diff --git a/x-pack/platform/plugins/shared/alerting/server/alerts_service/lib/create_concrete_write_index.ts b/x-pack/platform/plugins/shared/alerting/server/alerts_service/lib/create_concrete_write_index.ts index 672aee63c7a80..84fe76d71aca2 100644 --- a/x-pack/platform/plugins/shared/alerting/server/alerts_service/lib/create_concrete_write_index.ts +++ b/x-pack/platform/plugins/shared/alerting/server/alerts_service/lib/create_concrete_write_index.ts @@ -5,12 +5,12 @@ * 2.0. */ -import { IndicesSimulateIndexTemplateResponse } from '@elastic/elasticsearch/lib/api/types'; -import { Logger, ElasticsearchClient } from '@kbn/core/server'; +import type { IndicesSimulateIndexTemplateResponse } from '@elastic/elasticsearch/lib/api/types'; +import type { Logger, ElasticsearchClient } from '@kbn/core/server'; import { get, sortBy } from 'lodash'; -import { IIndexPatternString } from '../resource_installer_utils'; +import type { IIndexPatternString } from '../resource_installer_utils'; import { retryTransientEsErrors } from './retry_transient_es_errors'; -import { DataStreamAdapter } from './data_stream_adapter'; +import type { DataStreamAdapter } from './data_stream_adapter'; export interface ConcreteIndexInfo { index: string; diff --git a/x-pack/platform/plugins/shared/alerting/server/alerts_service/lib/create_or_update_component_template.test.ts b/x-pack/platform/plugins/shared/alerting/server/alerts_service/lib/create_or_update_component_template.test.ts index 54f02fd687359..0f53d1eadb976 100644 --- a/x-pack/platform/plugins/shared/alerting/server/alerts_service/lib/create_or_update_component_template.test.ts +++ b/x-pack/platform/plugins/shared/alerting/server/alerts_service/lib/create_or_update_component_template.test.ts @@ -8,7 +8,7 @@ import { elasticsearchServiceMock, loggingSystemMock } from '@kbn/core/server/mo import { errors as EsErrors } from '@elastic/elasticsearch'; import { createOrUpdateComponentTemplate } from './create_or_update_component_template'; import { elasticsearchClientMock } from '@kbn/core-elasticsearch-client-server-mocks'; -import { ClusterPutComponentTemplateRequest } from '@elastic/elasticsearch/lib/api/types'; +import type { ClusterPutComponentTemplateRequest } from '@elastic/elasticsearch/lib/api/types'; const randomDelayMultiplier = 0.01; const logger = loggingSystemMock.createLogger(); diff --git a/x-pack/platform/plugins/shared/alerting/server/alerts_service/lib/create_or_update_component_template.ts b/x-pack/platform/plugins/shared/alerting/server/alerts_service/lib/create_or_update_component_template.ts index d9485c95b006e..778795fd46eca 100644 --- a/x-pack/platform/plugins/shared/alerting/server/alerts_service/lib/create_or_update_component_template.ts +++ b/x-pack/platform/plugins/shared/alerting/server/alerts_service/lib/create_or_update_component_template.ts @@ -5,11 +5,11 @@ * 2.0. */ -import { +import type { ClusterPutComponentTemplateRequest, IndicesGetIndexTemplateIndexTemplateItem, } from '@elastic/elasticsearch/lib/api/types'; -import { Logger, ElasticsearchClient } from '@kbn/core/server'; +import type { Logger, ElasticsearchClient } from '@kbn/core/server'; import { asyncForEach } from '@kbn/std'; import { retryTransientEsErrors } from './retry_transient_es_errors'; diff --git a/x-pack/platform/plugins/shared/alerting/server/alerts_service/lib/create_or_update_ilm_policy.ts b/x-pack/platform/plugins/shared/alerting/server/alerts_service/lib/create_or_update_ilm_policy.ts index aabdfbf5dde52..a59d719b7a53d 100644 --- a/x-pack/platform/plugins/shared/alerting/server/alerts_service/lib/create_or_update_ilm_policy.ts +++ b/x-pack/platform/plugins/shared/alerting/server/alerts_service/lib/create_or_update_ilm_policy.ts @@ -5,10 +5,10 @@ * 2.0. */ -import { IlmPolicy } from '@elastic/elasticsearch/lib/api/types'; -import { Logger, ElasticsearchClient } from '@kbn/core/server'; +import type { IlmPolicy } from '@elastic/elasticsearch/lib/api/types'; +import type { Logger, ElasticsearchClient } from '@kbn/core/server'; import { retryTransientEsErrors } from './retry_transient_es_errors'; -import { DataStreamAdapter } from './data_stream_adapter'; +import type { DataStreamAdapter } from './data_stream_adapter'; interface CreateOrUpdateIlmPolicyOpts { logger: Logger; diff --git a/x-pack/platform/plugins/shared/alerting/server/alerts_service/lib/create_or_update_index_template.test.ts b/x-pack/platform/plugins/shared/alerting/server/alerts_service/lib/create_or_update_index_template.test.ts index b130976f6bcb0..a6232e75db3a2 100644 --- a/x-pack/platform/plugins/shared/alerting/server/alerts_service/lib/create_or_update_index_template.test.ts +++ b/x-pack/platform/plugins/shared/alerting/server/alerts_service/lib/create_or_update_index_template.test.ts @@ -8,13 +8,13 @@ import { elasticsearchServiceMock, loggingSystemMock } from '@kbn/core/server/mo import { errors as EsErrors } from '@elastic/elasticsearch'; import { getIndexTemplate, createOrUpdateIndexTemplate } from './create_or_update_index_template'; import { createDataStreamAdapterMock } from './data_stream_adapter.mock'; -import { DataStreamAdapter } from './data_stream_adapter'; +import type { DataStreamAdapter } from './data_stream_adapter'; const randomDelayMultiplier = 0.01; const logger = loggingSystemMock.createLogger(); const clusterClient = elasticsearchServiceMock.createClusterClient().asInternalUser; -const IndexTemplate = (namespace: string = 'default', useDataStream: boolean = false) => ({ +const IndexTemplate = (namespace = 'default', useDataStream = false) => ({ name: `.alerts-test.alerts-${namespace}-index-template`, _meta: { kibana: { diff --git a/x-pack/platform/plugins/shared/alerting/server/alerts_service/lib/create_or_update_index_template.ts b/x-pack/platform/plugins/shared/alerting/server/alerts_service/lib/create_or_update_index_template.ts index d54d9cd09572a..0883c349e7abb 100644 --- a/x-pack/platform/plugins/shared/alerting/server/alerts_service/lib/create_or_update_index_template.ts +++ b/x-pack/platform/plugins/shared/alerting/server/alerts_service/lib/create_or_update_index_template.ts @@ -5,16 +5,16 @@ * 2.0. */ -import { +import type { IndicesPutIndexTemplateRequest, MappingTypeMapping, Metadata, } from '@elastic/elasticsearch/lib/api/types'; -import { Logger, ElasticsearchClient } from '@kbn/core/server'; +import type { Logger, ElasticsearchClient } from '@kbn/core/server'; import { isEmpty } from 'lodash'; -import { IIndexPatternString } from '../resource_installer_utils'; +import type { IIndexPatternString } from '../resource_installer_utils'; import { retryTransientEsErrors } from './retry_transient_es_errors'; -import { DataStreamAdapter } from './data_stream_adapter'; +import type { DataStreamAdapter } from './data_stream_adapter'; interface GetIndexTemplateOpts { componentTemplateRefs: string[]; diff --git a/x-pack/platform/plugins/shared/alerting/server/alerts_service/lib/data_stream_adapter.mock.ts b/x-pack/platform/plugins/shared/alerting/server/alerts_service/lib/data_stream_adapter.mock.ts index 8de9f7bcc1731..5a767044c90ea 100644 --- a/x-pack/platform/plugins/shared/alerting/server/alerts_service/lib/data_stream_adapter.mock.ts +++ b/x-pack/platform/plugins/shared/alerting/server/alerts_service/lib/data_stream_adapter.mock.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { DataStreamAdapter, GetDataStreamAdapterOpts } from './data_stream_adapter'; +import type { DataStreamAdapter, GetDataStreamAdapterOpts } from './data_stream_adapter'; export function createDataStreamAdapterMock(opts?: GetDataStreamAdapterOpts): DataStreamAdapter { return { diff --git a/x-pack/platform/plugins/shared/alerting/server/alerts_service/lib/data_stream_adapter.ts b/x-pack/platform/plugins/shared/alerting/server/alerts_service/lib/data_stream_adapter.ts index 5293cc73c1100..6be25ad9fb543 100644 --- a/x-pack/platform/plugins/shared/alerting/server/alerts_service/lib/data_stream_adapter.ts +++ b/x-pack/platform/plugins/shared/alerting/server/alerts_service/lib/data_stream_adapter.ts @@ -6,12 +6,11 @@ */ // eslint-disable-next-line max-classes-per-file -import { +import type { CreateConcreteWriteIndexOpts, ConcreteIndexInfo, - updateIndexMappings, - setConcreteWriteIndex, } from './create_concrete_write_index'; +import { updateIndexMappings, setConcreteWriteIndex } from './create_concrete_write_index'; import { retryTransientEsErrors } from './retry_transient_es_errors'; export interface DataStreamAdapter { diff --git a/x-pack/platform/plugins/shared/alerting/server/alerts_service/lib/install_with_timeout.test.ts b/x-pack/platform/plugins/shared/alerting/server/alerts_service/lib/install_with_timeout.test.ts index 83961c1c8fbfd..57d0be00e0bf6 100644 --- a/x-pack/platform/plugins/shared/alerting/server/alerts_service/lib/install_with_timeout.test.ts +++ b/x-pack/platform/plugins/shared/alerting/server/alerts_service/lib/install_with_timeout.test.ts @@ -7,7 +7,8 @@ import { loggerMock } from '@kbn/logging-mocks'; import { installWithTimeout } from './install_with_timeout'; -import { ReplaySubject, Subject } from 'rxjs'; +import type { Subject } from 'rxjs'; +import { ReplaySubject } from 'rxjs'; const logger = loggerMock.create(); diff --git a/x-pack/platform/plugins/shared/alerting/server/alerts_service/lib/install_with_timeout.ts b/x-pack/platform/plugins/shared/alerting/server/alerts_service/lib/install_with_timeout.ts index e93dcf2e09f34..35d95f1e1edd9 100644 --- a/x-pack/platform/plugins/shared/alerting/server/alerts_service/lib/install_with_timeout.ts +++ b/x-pack/platform/plugins/shared/alerting/server/alerts_service/lib/install_with_timeout.ts @@ -5,8 +5,9 @@ * 2.0. */ -import { firstValueFrom, Observable } from 'rxjs'; -import { Logger } from '@kbn/core/server'; +import type { Observable } from 'rxjs'; +import { firstValueFrom } from 'rxjs'; +import type { Logger } from '@kbn/core/server'; const INSTALLATION_TIMEOUT = 20 * 60 * 1000; // 20 minutes diff --git a/x-pack/platform/plugins/shared/alerting/server/alerts_service/lib/retry_transient_es_errors.ts b/x-pack/platform/plugins/shared/alerting/server/alerts_service/lib/retry_transient_es_errors.ts index 2df03e65690f1..519ac21d3af30 100644 --- a/x-pack/platform/plugins/shared/alerting/server/alerts_service/lib/retry_transient_es_errors.ts +++ b/x-pack/platform/plugins/shared/alerting/server/alerts_service/lib/retry_transient_es_errors.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { Logger } from '@kbn/core/server'; +import type { Logger } from '@kbn/core/server'; import { errors as EsErrors } from '@elastic/elasticsearch'; const MAX_ATTEMPTS = 3; diff --git a/x-pack/platform/plugins/shared/alerting/server/alerts_service/lib/set_alerts_to_untracked.test.ts b/x-pack/platform/plugins/shared/alerting/server/alerts_service/lib/set_alerts_to_untracked.test.ts index 5c911ed35a2e7..035dec7effa5c 100644 --- a/x-pack/platform/plugins/shared/alerting/server/alerts_service/lib/set_alerts_to_untracked.test.ts +++ b/x-pack/platform/plugins/shared/alerting/server/alerts_service/lib/set_alerts_to_untracked.test.ts @@ -4,11 +4,8 @@ * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ -import { - ElasticsearchClientMock, - elasticsearchServiceMock, - loggingSystemMock, -} from '@kbn/core/server/mocks'; +import type { ElasticsearchClientMock } from '@kbn/core/server/mocks'; +import { elasticsearchServiceMock, loggingSystemMock } from '@kbn/core/server/mocks'; import { ALERT_RULE_UUID, ALERT_UUID } from '@kbn/rule-data-utils'; import { setAlertsToUntracked } from './set_alerts_to_untracked'; diff --git a/x-pack/platform/plugins/shared/alerting/server/alerts_service/lib/set_alerts_to_untracked.ts b/x-pack/platform/plugins/shared/alerting/server/alerts_service/lib/set_alerts_to_untracked.ts index 6389f4e6639db..df55b83d81b7a 100644 --- a/x-pack/platform/plugins/shared/alerting/server/alerts_service/lib/set_alerts_to_untracked.ts +++ b/x-pack/platform/plugins/shared/alerting/server/alerts_service/lib/set_alerts_to_untracked.ts @@ -6,8 +6,9 @@ */ import { isEmpty } from 'lodash'; -import { ElasticsearchClient } from '@kbn/core-elasticsearch-server'; -import { Logger } from '@kbn/logging'; +import type { ElasticsearchClient } from '@kbn/core-elasticsearch-server'; +import type { Logger } from '@kbn/logging'; +import type { AlertStatus } from '@kbn/rule-data-utils'; import { ALERT_END, ALERT_RULE_CONSUMER, @@ -18,7 +19,6 @@ import { ALERT_STATUS_UNTRACKED, ALERT_TIME_RANGE, ALERT_UUID, - AlertStatus, } from '@kbn/rule-data-utils'; import type { QueryDslQueryContainer } from '@elastic/elasticsearch/lib/api/types'; import type { RulesClientContext } from '../../rules_client'; diff --git a/x-pack/platform/plugins/shared/alerting/server/alerts_service/resource_installer_utils.ts b/x-pack/platform/plugins/shared/alerting/server/alerts_service/resource_installer_utils.ts index fe510bd4df1de..c7445da8368b0 100644 --- a/x-pack/platform/plugins/shared/alerting/server/alerts_service/resource_installer_utils.ts +++ b/x-pack/platform/plugins/shared/alerting/server/alerts_service/resource_installer_utils.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { ClusterPutComponentTemplateRequest } from '@elastic/elasticsearch/lib/api/types'; +import type { ClusterPutComponentTemplateRequest } from '@elastic/elasticsearch/lib/api/types'; import type { FieldMap } from '@kbn/alerts-as-data-utils'; import { getComponentTemplateFromFieldMap } from '../../common'; diff --git a/x-pack/platform/plugins/shared/alerting/server/application/alerts_filter_query/types/alerts_filter_query.ts b/x-pack/platform/plugins/shared/alerting/server/application/alerts_filter_query/types/alerts_filter_query.ts index 926d27e89fa94..ad8a64318a4bf 100644 --- a/x-pack/platform/plugins/shared/alerting/server/application/alerts_filter_query/types/alerts_filter_query.ts +++ b/x-pack/platform/plugins/shared/alerting/server/application/alerts_filter_query/types/alerts_filter_query.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { TypeOf } from '@kbn/config-schema'; -import { alertsFilterQuerySchema } from '../schemas/alerts_filter_query_schemas'; +import type { TypeOf } from '@kbn/config-schema'; +import type { alertsFilterQuerySchema } from '../schemas/alerts_filter_query_schemas'; export type AlertsFilterQuery = TypeOf; diff --git a/x-pack/platform/plugins/shared/alerting/server/application/backfill/methods/delete/delete_backfill.test.ts b/x-pack/platform/plugins/shared/alerting/server/application/backfill/methods/delete/delete_backfill.test.ts index d65ddf092813c..795431329bd5f 100644 --- a/x-pack/platform/plugins/shared/alerting/server/application/backfill/methods/delete/delete_backfill.test.ts +++ b/x-pack/platform/plugins/shared/alerting/server/application/backfill/methods/delete/delete_backfill.test.ts @@ -5,10 +5,10 @@ * 2.0. */ -import { ActionsAuthorization } from '@kbn/actions-plugin/server'; +import type { ActionsAuthorization } from '@kbn/actions-plugin/server'; import { actionsAuthorizationMock } from '@kbn/actions-plugin/server/mocks'; import { RULE_SAVED_OBJECT_TYPE } from '../../../..'; -import { AlertingAuthorization } from '../../../../authorization'; +import type { AlertingAuthorization } from '../../../../authorization'; import { alertingAuthorizationMock } from '../../../../authorization/alerting_authorization.mock'; import { backfillClientMock } from '../../../../backfill_client/backfill_client.mock'; import { ruleTypeRegistryMock } from '../../../../rule_type_registry.mock'; @@ -21,12 +21,13 @@ import { uiSettingsServiceMock } from '@kbn/core-ui-settings-server-mocks'; import { encryptedSavedObjectsMock } from '@kbn/encrypted-saved-objects-plugin/server/mocks'; import { auditLoggerMock } from '@kbn/security-plugin/server/audit/mocks'; import { taskManagerMock } from '@kbn/task-manager-plugin/server/mocks'; -import { ConstructorOptions, RulesClient } from '../../../../rules_client'; +import type { ConstructorOptions } from '../../../../rules_client'; +import { RulesClient } from '../../../../rules_client'; import { adHocRunStatus } from '../../../../../common/constants'; import { ConnectorAdapterRegistry } from '../../../../connector_adapters/connector_adapter_registry'; import { AD_HOC_RUN_SAVED_OBJECT_TYPE } from '../../../../saved_objects'; -import { SavedObject } from '@kbn/core-saved-objects-api-server'; -import { AdHocRunSO } from '../../../../data/ad_hoc_run/types'; +import type { SavedObject } from '@kbn/core-saved-objects-api-server'; +import type { AdHocRunSO } from '../../../../data/ad_hoc_run/types'; import { SavedObjectsErrorHelpers } from '@kbn/core/server'; import { updateGaps } from '../../../../lib/rule_gaps/update/update_gaps'; import { eventLogClientMock } from '@kbn/event-log-plugin/server/event_log_client.mock'; diff --git a/x-pack/platform/plugins/shared/alerting/server/application/backfill/methods/delete/delete_backfill.ts b/x-pack/platform/plugins/shared/alerting/server/application/backfill/methods/delete/delete_backfill.ts index 7911c39a99a09..f7188acf77fc3 100644 --- a/x-pack/platform/plugins/shared/alerting/server/application/backfill/methods/delete/delete_backfill.ts +++ b/x-pack/platform/plugins/shared/alerting/server/application/backfill/methods/delete/delete_backfill.ts @@ -7,9 +7,9 @@ import Boom from '@hapi/boom'; import { retryIfConflicts } from '../../../../lib/retry_if_conflicts'; -import { AdHocRunSO } from '../../../../data/ad_hoc_run/types'; +import type { AdHocRunSO } from '../../../../data/ad_hoc_run/types'; import { AD_HOC_RUN_SAVED_OBJECT_TYPE } from '../../../../saved_objects'; -import { RulesClientContext } from '../../../../rules_client'; +import type { RulesClientContext } from '../../../../rules_client'; import { AlertingAuthorizationEntity, WriteOperations } from '../../../../authorization'; import { AdHocRunAuditAction, diff --git a/x-pack/platform/plugins/shared/alerting/server/application/backfill/methods/find/find_backfill.test.ts b/x-pack/platform/plugins/shared/alerting/server/application/backfill/methods/find/find_backfill.test.ts index 7f140622310be..7c19f6afbd526 100644 --- a/x-pack/platform/plugins/shared/alerting/server/application/backfill/methods/find/find_backfill.test.ts +++ b/x-pack/platform/plugins/shared/alerting/server/application/backfill/methods/find/find_backfill.test.ts @@ -5,10 +5,10 @@ * 2.0. */ -import { ActionsAuthorization } from '@kbn/actions-plugin/server'; +import type { ActionsAuthorization } from '@kbn/actions-plugin/server'; import { actionsAuthorizationMock, actionsClientMock } from '@kbn/actions-plugin/server/mocks'; import { RULE_SAVED_OBJECT_TYPE } from '../../../..'; -import { AlertingAuthorization } from '../../../../authorization'; +import type { AlertingAuthorization } from '../../../../authorization'; import { alertingAuthorizationMock } from '../../../../authorization/alerting_authorization.mock'; import { backfillClientMock } from '../../../../backfill_client/backfill_client.mock'; import { ruleTypeRegistryMock } from '../../../../rule_type_registry.mock'; @@ -25,8 +25,8 @@ import { taskManagerMock } from '@kbn/task-manager-plugin/server/mocks'; import { RulesClient } from '../../../../rules_client'; import { adHocRunStatus } from '../../../../../common/constants'; import { ConnectorAdapterRegistry } from '../../../../connector_adapters/connector_adapter_registry'; -import { SavedObject } from '@kbn/core/server'; -import { AdHocRunSO } from '../../../../data/ad_hoc_run/types'; +import type { SavedObject } from '@kbn/core/server'; +import type { AdHocRunSO } from '../../../../data/ad_hoc_run/types'; import { AD_HOC_RUN_SAVED_OBJECT_TYPE } from '../../../../saved_objects'; import { transformAdHocRunToBackfillResult } from '../../transforms'; diff --git a/x-pack/platform/plugins/shared/alerting/server/application/backfill/methods/find/find_backfill.ts b/x-pack/platform/plugins/shared/alerting/server/application/backfill/methods/find/find_backfill.ts index d6f723d31b06d..6e859d8c93489 100644 --- a/x-pack/platform/plugins/shared/alerting/server/application/backfill/methods/find/find_backfill.ts +++ b/x-pack/platform/plugins/shared/alerting/server/application/backfill/methods/find/find_backfill.ts @@ -6,11 +6,12 @@ */ import Boom from '@hapi/boom'; -import { KueryNode, nodeBuilder } from '@kbn/es-query'; -import { SavedObject, SavedObjectsFindOptionsReference } from '@kbn/core/server'; +import type { KueryNode } from '@kbn/es-query'; +import { nodeBuilder } from '@kbn/es-query'; +import type { SavedObject, SavedObjectsFindOptionsReference } from '@kbn/core/server'; import { buildKueryNodeFilter } from '../../../../rules_client/common'; import { AD_HOC_RUN_SAVED_OBJECT_TYPE, RULE_SAVED_OBJECT_TYPE } from '../../../../saved_objects'; -import { RulesClientContext } from '../../../../rules_client'; +import type { RulesClientContext } from '../../../../rules_client'; import { AlertingAuthorizationEntity, AlertingAuthorizationFilterType, @@ -21,9 +22,9 @@ import { } from '../../../../rules_client/common/audit_events'; import type { FindBackfillParams, FindBackfillResult } from './types'; import { findBackfillQuerySchema } from './schemas'; -import { AdHocRunSO } from '../../../../data/ad_hoc_run/types'; +import type { AdHocRunSO } from '../../../../data/ad_hoc_run/types'; import { transformAdHocRunToBackfillResult } from '../../transforms'; -import { Backfill } from '../../result/types'; +import type { Backfill } from '../../result/types'; export async function findBackfill( context: RulesClientContext, diff --git a/x-pack/platform/plugins/shared/alerting/server/application/backfill/methods/find/types/index.ts b/x-pack/platform/plugins/shared/alerting/server/application/backfill/methods/find/types/index.ts index 8d88732bcad0d..3d8b3a494be91 100644 --- a/x-pack/platform/plugins/shared/alerting/server/application/backfill/methods/find/types/index.ts +++ b/x-pack/platform/plugins/shared/alerting/server/application/backfill/methods/find/types/index.ts @@ -5,8 +5,8 @@ * 2.0. */ -import { TypeOf } from '@kbn/config-schema'; -import { findBackfillQuerySchema, findBackfillResultSchema } from '../schemas'; +import type { TypeOf } from '@kbn/config-schema'; +import type { findBackfillQuerySchema, findBackfillResultSchema } from '../schemas'; export type FindBackfillParams = TypeOf; export type FindBackfillResult = TypeOf; diff --git a/x-pack/platform/plugins/shared/alerting/server/application/backfill/methods/get/get_backfill.test.ts b/x-pack/platform/plugins/shared/alerting/server/application/backfill/methods/get/get_backfill.test.ts index 7ed0db8a0a9fd..975b382745b7b 100644 --- a/x-pack/platform/plugins/shared/alerting/server/application/backfill/methods/get/get_backfill.test.ts +++ b/x-pack/platform/plugins/shared/alerting/server/application/backfill/methods/get/get_backfill.test.ts @@ -5,10 +5,10 @@ * 2.0. */ -import { ActionsAuthorization } from '@kbn/actions-plugin/server'; +import type { ActionsAuthorization } from '@kbn/actions-plugin/server'; import { actionsAuthorizationMock, actionsClientMock } from '@kbn/actions-plugin/server/mocks'; import { RULE_SAVED_OBJECT_TYPE } from '../../../..'; -import { AlertingAuthorization } from '../../../../authorization'; +import type { AlertingAuthorization } from '../../../../authorization'; import { alertingAuthorizationMock } from '../../../../authorization/alerting_authorization.mock'; import { backfillClientMock } from '../../../../backfill_client/backfill_client.mock'; import { ruleTypeRegistryMock } from '../../../../rule_type_registry.mock'; @@ -26,8 +26,8 @@ import { adHocRunStatus } from '../../../../../common/constants'; import { ConnectorAdapterRegistry } from '../../../../connector_adapters/connector_adapter_registry'; import { AD_HOC_RUN_SAVED_OBJECT_TYPE } from '../../../../saved_objects'; import { transformAdHocRunToBackfillResult } from '../../transforms'; -import { SavedObject } from '@kbn/core-saved-objects-api-server'; -import { AdHocRunSO } from '../../../../data/ad_hoc_run/types'; +import type { SavedObject } from '@kbn/core-saved-objects-api-server'; +import type { AdHocRunSO } from '../../../../data/ad_hoc_run/types'; const kibanaVersion = 'v8.0.0'; const taskManager = taskManagerMock.createStart(); diff --git a/x-pack/platform/plugins/shared/alerting/server/application/backfill/methods/get/get_backfill.ts b/x-pack/platform/plugins/shared/alerting/server/application/backfill/methods/get/get_backfill.ts index 4bd2ff3a5d4b3..832ea2a82e42f 100644 --- a/x-pack/platform/plugins/shared/alerting/server/application/backfill/methods/get/get_backfill.ts +++ b/x-pack/platform/plugins/shared/alerting/server/application/backfill/methods/get/get_backfill.ts @@ -6,15 +6,15 @@ */ import Boom from '@hapi/boom'; -import { AdHocRunSO } from '../../../../data/ad_hoc_run/types'; +import type { AdHocRunSO } from '../../../../data/ad_hoc_run/types'; import { AD_HOC_RUN_SAVED_OBJECT_TYPE } from '../../../../saved_objects'; -import { RulesClientContext } from '../../../../rules_client'; +import type { RulesClientContext } from '../../../../rules_client'; import { ReadOperations, AlertingAuthorizationEntity } from '../../../../authorization'; import { AdHocRunAuditAction, adHocRunAuditEvent, } from '../../../../rules_client/common/audit_events'; -import { Backfill } from '../../result/types'; +import type { Backfill } from '../../result/types'; import { transformAdHocRunToBackfillResult } from '../../transforms'; export async function getBackfill(context: RulesClientContext, id: string): Promise { diff --git a/x-pack/platform/plugins/shared/alerting/server/application/backfill/methods/schedule/schedule_backfill.test.ts b/x-pack/platform/plugins/shared/alerting/server/application/backfill/methods/schedule/schedule_backfill.test.ts index 8e486387ff4bc..9cc23bfd7d99d 100644 --- a/x-pack/platform/plugins/shared/alerting/server/application/backfill/methods/schedule/schedule_backfill.test.ts +++ b/x-pack/platform/plugins/shared/alerting/server/application/backfill/methods/schedule/schedule_backfill.test.ts @@ -5,10 +5,10 @@ * 2.0. */ -import { ActionsAuthorization } from '@kbn/actions-plugin/server'; +import type { ActionsAuthorization } from '@kbn/actions-plugin/server'; import { actionsAuthorizationMock } from '@kbn/actions-plugin/server/mocks'; import { RULE_SAVED_OBJECT_TYPE } from '../../../..'; -import { AlertingAuthorization } from '../../../../authorization'; +import type { AlertingAuthorization } from '../../../../authorization'; import { alertingAuthorizationMock } from '../../../../authorization/alerting_authorization.mock'; import { backfillClientMock } from '../../../../backfill_client/backfill_client.mock'; import { ruleTypeRegistryMock } from '../../../../rule_type_registry.mock'; @@ -26,8 +26,9 @@ import { asyncForEach } from '@kbn/std'; import { taskManagerMock } from '@kbn/task-manager-plugin/server/mocks'; import { eventLoggerMock } from '@kbn/event-log-plugin/server/event_logger.mock'; import { eventLogClientMock } from '@kbn/event-log-plugin/server/event_log_client.mock'; -import { ConstructorOptions, RulesClient } from '../../../../rules_client'; -import { ScheduleBackfillParam } from './types'; +import type { ConstructorOptions } from '../../../../rules_client'; +import { RulesClient } from '../../../../rules_client'; +import type { ScheduleBackfillParam } from './types'; import { adHocRunStatus } from '../../../../../common/constants'; import { ConnectorAdapterRegistry } from '../../../../connector_adapters/connector_adapter_registry'; diff --git a/x-pack/platform/plugins/shared/alerting/server/application/backfill/methods/schedule/schedule_backfill.ts b/x-pack/platform/plugins/shared/alerting/server/application/backfill/methods/schedule/schedule_backfill.ts index a7438ded371e3..94546292062cf 100644 --- a/x-pack/platform/plugins/shared/alerting/server/application/backfill/methods/schedule/schedule_backfill.ts +++ b/x-pack/platform/plugins/shared/alerting/server/application/backfill/methods/schedule/schedule_backfill.ts @@ -7,8 +7,9 @@ import pMap from 'p-map'; import Boom from '@hapi/boom'; -import { KueryNode, nodeBuilder } from '@kbn/es-query'; -import { SavedObjectsFindResult } from '@kbn/core/server'; +import type { KueryNode } from '@kbn/es-query'; +import { nodeBuilder } from '@kbn/es-query'; +import type { SavedObjectsFindResult } from '@kbn/core/server'; import { RULE_SAVED_OBJECT_TYPE } from '../../../../saved_objects'; import { findRulesSo } from '../../../../data/rule'; import { @@ -16,7 +17,7 @@ import { RULE_TYPE_CHECKS_CONCURRENCY, } from '../../../../rules_client/common/constants'; import { convertRuleIdsToKueryNode } from '../../../../lib'; -import { RuleBulkOperationAggregation, RulesClientContext } from '../../../../rules_client'; +import type { RuleBulkOperationAggregation, RulesClientContext } from '../../../../rules_client'; import { AlertingAuthorizationEntity, WriteOperations } from '../../../../authorization'; import { ruleAuditEvent, RuleAuditAction } from '../../../../rules_client/common/audit_events'; import type { @@ -26,7 +27,7 @@ import type { } from './types'; import { scheduleBackfillParamsSchema } from './schemas'; import { transformRuleAttributesToRuleDomain } from '../../../rule/transforms'; -import { RawRule } from '../../../../types'; +import type { RawRule } from '../../../../types'; export async function scheduleBackfill( context: RulesClientContext, diff --git a/x-pack/platform/plugins/shared/alerting/server/application/backfill/methods/schedule/types/index.ts b/x-pack/platform/plugins/shared/alerting/server/application/backfill/methods/schedule/types/index.ts index bd7f3e4e371ae..5c94bcb923ab3 100644 --- a/x-pack/platform/plugins/shared/alerting/server/application/backfill/methods/schedule/types/index.ts +++ b/x-pack/platform/plugins/shared/alerting/server/application/backfill/methods/schedule/types/index.ts @@ -5,8 +5,8 @@ * 2.0. */ -import { TypeOf } from '@kbn/config-schema'; -import { +import type { TypeOf } from '@kbn/config-schema'; +import type { scheduleBackfillErrorSchema, scheduleBackfillParamSchema, scheduleBackfillParamsSchema, diff --git a/x-pack/platform/plugins/shared/alerting/server/application/backfill/result/types/index.ts b/x-pack/platform/plugins/shared/alerting/server/application/backfill/result/types/index.ts index f62663894ca89..7b8b3ae3f31a3 100644 --- a/x-pack/platform/plugins/shared/alerting/server/application/backfill/result/types/index.ts +++ b/x-pack/platform/plugins/shared/alerting/server/application/backfill/result/types/index.ts @@ -5,8 +5,8 @@ * 2.0. */ -import { TypeOf } from '@kbn/config-schema'; -import { backfillSchema, backfillScheduleSchema } from '../schemas'; +import type { TypeOf } from '@kbn/config-schema'; +import type { backfillSchema, backfillScheduleSchema } from '../schemas'; export type BackfillSchedule = TypeOf; export type Backfill = TypeOf; diff --git a/x-pack/platform/plugins/shared/alerting/server/application/backfill/transforms/transform_ad_hoc_run_to_backfill_result.test.ts b/x-pack/platform/plugins/shared/alerting/server/application/backfill/transforms/transform_ad_hoc_run_to_backfill_result.test.ts index 2d0e6ff20da08..f2a4b576d229b 100644 --- a/x-pack/platform/plugins/shared/alerting/server/application/backfill/transforms/transform_ad_hoc_run_to_backfill_result.test.ts +++ b/x-pack/platform/plugins/shared/alerting/server/application/backfill/transforms/transform_ad_hoc_run_to_backfill_result.test.ts @@ -5,14 +5,14 @@ * 2.0. */ -import { AdHocRunSO } from '../../../data/ad_hoc_run/types'; -import { SavedObject } from '@kbn/core/server'; +import type { AdHocRunSO } from '../../../data/ad_hoc_run/types'; +import type { SavedObject } from '@kbn/core/server'; import { adHocRunStatus } from '../../../../common/constants'; import { transformAdHocRunToAdHocRunData, transformAdHocRunToBackfillResult, } from './transform_ad_hoc_run_to_backfill_result'; -import { RawRule } from '../../../types'; +import type { RawRule } from '../../../types'; const isSystemAction = jest.fn().mockReturnValue(false); diff --git a/x-pack/platform/plugins/shared/alerting/server/application/backfill/transforms/transform_ad_hoc_run_to_backfill_result.ts b/x-pack/platform/plugins/shared/alerting/server/application/backfill/transforms/transform_ad_hoc_run_to_backfill_result.ts index 78b228711df7d..0ba64e4a857a3 100644 --- a/x-pack/platform/plugins/shared/alerting/server/application/backfill/transforms/transform_ad_hoc_run_to_backfill_result.ts +++ b/x-pack/platform/plugins/shared/alerting/server/application/backfill/transforms/transform_ad_hoc_run_to_backfill_result.ts @@ -5,10 +5,10 @@ * 2.0. */ -import { SavedObject, SavedObjectsBulkCreateObject } from '@kbn/core/server'; -import { AdHocRun, AdHocRunSO } from '../../../data/ad_hoc_run/types'; +import type { SavedObject, SavedObjectsBulkCreateObject } from '@kbn/core/server'; +import type { AdHocRun, AdHocRunSO } from '../../../data/ad_hoc_run/types'; import { createBackfillError } from '../../../backfill_client/lib'; -import { ScheduleBackfillResult } from '../methods/schedule/types'; +import type { ScheduleBackfillResult } from '../methods/schedule/types'; import { transformRawActionsToDomainActions } from '../../rule/transforms'; interface TransformAdHocRunToBackfillResultOpts { diff --git a/x-pack/platform/plugins/shared/alerting/server/application/backfill/transforms/transform_backfill_param_to_ad_hoc_run.test.ts b/x-pack/platform/plugins/shared/alerting/server/application/backfill/transforms/transform_backfill_param_to_ad_hoc_run.test.ts index 822ffed9dfce6..da75494e721ad 100644 --- a/x-pack/platform/plugins/shared/alerting/server/application/backfill/transforms/transform_backfill_param_to_ad_hoc_run.test.ts +++ b/x-pack/platform/plugins/shared/alerting/server/application/backfill/transforms/transform_backfill_param_to_ad_hoc_run.test.ts @@ -6,8 +6,8 @@ */ import { adHocRunStatus } from '../../../../common/constants'; -import { RuleDomain } from '../../rule/types'; -import { ScheduleBackfillParam } from '../methods/schedule/types'; +import type { RuleDomain } from '../../rule/types'; +import type { ScheduleBackfillParam } from '../methods/schedule/types'; import { transformBackfillParamToAdHocRun } from './transform_backfill_param_to_ad_hoc_run'; function getMockData(overwrites: Record = {}): ScheduleBackfillParam { diff --git a/x-pack/platform/plugins/shared/alerting/server/application/backfill/transforms/transform_backfill_param_to_ad_hoc_run.ts b/x-pack/platform/plugins/shared/alerting/server/application/backfill/transforms/transform_backfill_param_to_ad_hoc_run.ts index b293f7215fec4..0c0fa0adf5d6e 100644 --- a/x-pack/platform/plugins/shared/alerting/server/application/backfill/transforms/transform_backfill_param_to_ad_hoc_run.ts +++ b/x-pack/platform/plugins/shared/alerting/server/application/backfill/transforms/transform_backfill_param_to_ad_hoc_run.ts @@ -6,12 +6,12 @@ */ import { isString } from 'lodash'; -import { DenormalizedAction } from '../../../rules_client'; -import { AdHocRunSO } from '../../../data/ad_hoc_run/types'; +import type { DenormalizedAction } from '../../../rules_client'; +import type { AdHocRunSO } from '../../../data/ad_hoc_run/types'; import { calculateSchedule } from '../../../backfill_client/lib'; import { adHocRunStatus } from '../../../../common/constants'; -import { RuleDomain } from '../../rule/types'; -import { ScheduleBackfillParam } from '../methods/schedule/types'; +import type { RuleDomain } from '../../rule/types'; +import type { ScheduleBackfillParam } from '../methods/schedule/types'; export const transformBackfillParamToAdHocRun = ( param: ScheduleBackfillParam, diff --git a/x-pack/platform/plugins/shared/alerting/server/application/maintenance_window/lib/generate_maintenance_window_events.ts b/x-pack/platform/plugins/shared/alerting/server/application/maintenance_window/lib/generate_maintenance_window_events.ts index 78227dab5864a..458d24aef7602 100644 --- a/x-pack/platform/plugins/shared/alerting/server/application/maintenance_window/lib/generate_maintenance_window_events.ts +++ b/x-pack/platform/plugins/shared/alerting/server/application/maintenance_window/lib/generate_maintenance_window_events.ts @@ -8,8 +8,8 @@ import _ from 'lodash'; import moment from 'moment-timezone'; import { RRule, Weekday } from '@kbn/rrule'; -import { RRuleParams, DateRange } from '../../../../common'; -import { MaintenanceWindow } from '../types'; +import type { RRuleParams, DateRange } from '../../../../common'; +import type { MaintenanceWindow } from '../types'; export interface GenerateMaintenanceWindowEventsParams { rRule: RRuleParams; diff --git a/x-pack/platform/plugins/shared/alerting/server/application/maintenance_window/lib/get_maintenance_window_date_and_status.test.ts b/x-pack/platform/plugins/shared/alerting/server/application/maintenance_window/lib/get_maintenance_window_date_and_status.test.ts index 2ee4e2d8ea20b..56aa5a16ad1a1 100644 --- a/x-pack/platform/plugins/shared/alerting/server/application/maintenance_window/lib/get_maintenance_window_date_and_status.test.ts +++ b/x-pack/platform/plugins/shared/alerting/server/application/maintenance_window/lib/get_maintenance_window_date_and_status.test.ts @@ -10,7 +10,8 @@ import { getMaintenanceWindowDateAndStatus, findRecentEventWithStatus, } from './get_maintenance_window_date_and_status'; -import { DateRange, MaintenanceWindowStatus } from '../../../../common'; +import type { DateRange } from '../../../../common'; +import { MaintenanceWindowStatus } from '../../../../common'; const events: DateRange[] = [ { diff --git a/x-pack/platform/plugins/shared/alerting/server/application/maintenance_window/lib/get_maintenance_window_date_and_status.ts b/x-pack/platform/plugins/shared/alerting/server/application/maintenance_window/lib/get_maintenance_window_date_and_status.ts index 877f6f2fe32eb..dd1e7ca26efdf 100644 --- a/x-pack/platform/plugins/shared/alerting/server/application/maintenance_window/lib/get_maintenance_window_date_and_status.ts +++ b/x-pack/platform/plugins/shared/alerting/server/application/maintenance_window/lib/get_maintenance_window_date_and_status.ts @@ -5,7 +5,8 @@ * 2.0. */ import moment from 'moment'; -import { DateRange, MaintenanceWindowStatus } from '../../../../common'; +import type { DateRange } from '../../../../common'; +import { MaintenanceWindowStatus } from '../../../../common'; export interface DateSearchResult { event: DateRange; diff --git a/x-pack/platform/plugins/shared/alerting/server/application/maintenance_window/methods/archive/archive_maintenance_window.test.ts b/x-pack/platform/plugins/shared/alerting/server/application/maintenance_window/methods/archive/archive_maintenance_window.test.ts index fb8d1bccd89c1..6140db62ba2ac 100644 --- a/x-pack/platform/plugins/shared/alerting/server/application/maintenance_window/methods/archive/archive_maintenance_window.test.ts +++ b/x-pack/platform/plugins/shared/alerting/server/application/maintenance_window/methods/archive/archive_maintenance_window.test.ts @@ -13,11 +13,9 @@ import { loggingSystemMock, uiSettingsServiceMock, } from '@kbn/core/server/mocks'; -import { SavedObjectsUpdateResponse, SavedObject } from '@kbn/core/server'; -import { - MaintenanceWindowClientContext, - MAINTENANCE_WINDOW_SAVED_OBJECT_TYPE, -} from '../../../../../common'; +import type { SavedObjectsUpdateResponse, SavedObject } from '@kbn/core/server'; +import type { MaintenanceWindowClientContext } from '../../../../../common'; +import { MAINTENANCE_WINDOW_SAVED_OBJECT_TYPE } from '../../../../../common'; import { getMockMaintenanceWindow } from '../../../../data/maintenance_window/test_helpers'; import type { MaintenanceWindow } from '../../types'; diff --git a/x-pack/platform/plugins/shared/alerting/server/application/maintenance_window/methods/archive/types/archive_maintenance_window_params.ts b/x-pack/platform/plugins/shared/alerting/server/application/maintenance_window/methods/archive/types/archive_maintenance_window_params.ts index 81ad31de9c6a9..532baead46f7c 100644 --- a/x-pack/platform/plugins/shared/alerting/server/application/maintenance_window/methods/archive/types/archive_maintenance_window_params.ts +++ b/x-pack/platform/plugins/shared/alerting/server/application/maintenance_window/methods/archive/types/archive_maintenance_window_params.ts @@ -6,6 +6,6 @@ */ import type { TypeOf } from '@kbn/config-schema'; -import { archiveMaintenanceWindowParamsSchema } from '../schemas'; +import type { archiveMaintenanceWindowParamsSchema } from '../schemas'; export type ArchiveMaintenanceWindowParams = TypeOf; diff --git a/x-pack/platform/plugins/shared/alerting/server/application/maintenance_window/methods/bulk_get/bulk_get_maintenance_windows.test.ts b/x-pack/platform/plugins/shared/alerting/server/application/maintenance_window/methods/bulk_get/bulk_get_maintenance_windows.test.ts index 86eee6b564b80..e66a54a4e04aa 100644 --- a/x-pack/platform/plugins/shared/alerting/server/application/maintenance_window/methods/bulk_get/bulk_get_maintenance_windows.test.ts +++ b/x-pack/platform/plugins/shared/alerting/server/application/maintenance_window/methods/bulk_get/bulk_get_maintenance_windows.test.ts @@ -11,11 +11,9 @@ import { loggingSystemMock, uiSettingsServiceMock, } from '@kbn/core/server/mocks'; -import { SavedObject } from '@kbn/core/server'; -import { - MaintenanceWindowClientContext, - MAINTENANCE_WINDOW_SAVED_OBJECT_TYPE, -} from '../../../../../common'; +import type { SavedObject } from '@kbn/core/server'; +import type { MaintenanceWindowClientContext } from '../../../../../common'; +import { MAINTENANCE_WINDOW_SAVED_OBJECT_TYPE } from '../../../../../common'; import { getMockMaintenanceWindow } from '../../../../data/maintenance_window/test_helpers'; const savedObjectsClient = savedObjectsClientMock.create(); diff --git a/x-pack/platform/plugins/shared/alerting/server/application/maintenance_window/methods/bulk_get/types/bulk_get_maintenance_window_params.ts b/x-pack/platform/plugins/shared/alerting/server/application/maintenance_window/methods/bulk_get/types/bulk_get_maintenance_window_params.ts index 7b0a155880926..86ee4543295dd 100644 --- a/x-pack/platform/plugins/shared/alerting/server/application/maintenance_window/methods/bulk_get/types/bulk_get_maintenance_window_params.ts +++ b/x-pack/platform/plugins/shared/alerting/server/application/maintenance_window/methods/bulk_get/types/bulk_get_maintenance_window_params.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { TypeOf } from '@kbn/config-schema'; -import { bulkGetMaintenanceWindowsParamsSchema } from '../schemas'; +import type { TypeOf } from '@kbn/config-schema'; +import type { bulkGetMaintenanceWindowsParamsSchema } from '../schemas'; export type BulkGetMaintenanceWindowsParams = TypeOf; diff --git a/x-pack/platform/plugins/shared/alerting/server/application/maintenance_window/methods/bulk_get/types/bulk_get_maintenance_window_result.ts b/x-pack/platform/plugins/shared/alerting/server/application/maintenance_window/methods/bulk_get/types/bulk_get_maintenance_window_result.ts index 7f640342bf651..5788c74ad4a9a 100644 --- a/x-pack/platform/plugins/shared/alerting/server/application/maintenance_window/methods/bulk_get/types/bulk_get_maintenance_window_result.ts +++ b/x-pack/platform/plugins/shared/alerting/server/application/maintenance_window/methods/bulk_get/types/bulk_get_maintenance_window_result.ts @@ -5,8 +5,8 @@ * 2.0. */ -import { TypeOf } from '@kbn/config-schema'; -import { +import type { TypeOf } from '@kbn/config-schema'; +import type { bulkGetMaintenanceWindowsErrorSchema, bulkGetMaintenanceWindowsResultSchema, } from '../schemas'; diff --git a/x-pack/platform/plugins/shared/alerting/server/application/maintenance_window/methods/create/create_maintenance_window.test.ts b/x-pack/platform/plugins/shared/alerting/server/application/maintenance_window/methods/create/create_maintenance_window.test.ts index c1091f58abe13..34591eaee71c2 100644 --- a/x-pack/platform/plugins/shared/alerting/server/application/maintenance_window/methods/create/create_maintenance_window.test.ts +++ b/x-pack/platform/plugins/shared/alerting/server/application/maintenance_window/methods/create/create_maintenance_window.test.ts @@ -12,18 +12,16 @@ import { loggingSystemMock, uiSettingsServiceMock, } from '@kbn/core/server/mocks'; -import { SavedObject } from '@kbn/core/server'; +import type { SavedObject } from '@kbn/core/server'; import { FilterStateStore } from '@kbn/es-query'; import { Frequency } from '@kbn/rrule'; -import { - MaintenanceWindowClientContext, - MAINTENANCE_WINDOW_SAVED_OBJECT_TYPE, -} from '../../../../../common'; +import type { MaintenanceWindowClientContext } from '../../../../../common'; +import { MAINTENANCE_WINDOW_SAVED_OBJECT_TYPE } from '../../../../../common'; import { getMockMaintenanceWindow } from '../../../../data/maintenance_window/test_helpers'; import type { MaintenanceWindow } from '../../types'; import { createMaintenanceWindow } from './create_maintenance_window'; -import { CreateMaintenanceWindowParams } from './types'; +import type { CreateMaintenanceWindowParams } from './types'; const savedObjectsClient = savedObjectsClientMock.create(); const uiSettings = uiSettingsServiceMock.createClient(); diff --git a/x-pack/platform/plugins/shared/alerting/server/application/maintenance_window/methods/create/create_maintenance_window.ts b/x-pack/platform/plugins/shared/alerting/server/application/maintenance_window/methods/create/create_maintenance_window.ts index 97bf8747ffc90..f9b801e9cd1bd 100644 --- a/x-pack/platform/plugins/shared/alerting/server/application/maintenance_window/methods/create/create_maintenance_window.ts +++ b/x-pack/platform/plugins/shared/alerting/server/application/maintenance_window/methods/create/create_maintenance_window.ts @@ -8,7 +8,8 @@ import moment from 'moment'; import Boom from '@hapi/boom'; import { SavedObjectsUtils } from '@kbn/core/server'; -import { buildEsQuery, Filter } from '@kbn/es-query'; +import type { Filter } from '@kbn/es-query'; +import { buildEsQuery } from '@kbn/es-query'; import { getEsQueryConfig } from '../../../../lib/get_es_query_config'; import { generateMaintenanceWindowEvents } from '../../lib/generate_maintenance_window_events'; import type { MaintenanceWindowClientContext } from '../../../../../common'; diff --git a/x-pack/platform/plugins/shared/alerting/server/application/maintenance_window/methods/create/types/create_maintenance_window_params.ts b/x-pack/platform/plugins/shared/alerting/server/application/maintenance_window/methods/create/types/create_maintenance_window_params.ts index 66f9070f24277..6cae14b535784 100644 --- a/x-pack/platform/plugins/shared/alerting/server/application/maintenance_window/methods/create/types/create_maintenance_window_params.ts +++ b/x-pack/platform/plugins/shared/alerting/server/application/maintenance_window/methods/create/types/create_maintenance_window_params.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { TypeOf } from '@kbn/config-schema'; -import { createMaintenanceWindowParamsSchema } from '../schemas'; +import type { TypeOf } from '@kbn/config-schema'; +import type { createMaintenanceWindowParamsSchema } from '../schemas'; export type CreateMaintenanceWindowParams = TypeOf; diff --git a/x-pack/platform/plugins/shared/alerting/server/application/maintenance_window/methods/delete/delete_maintenance_window.test.ts b/x-pack/platform/plugins/shared/alerting/server/application/maintenance_window/methods/delete/delete_maintenance_window.test.ts index 50e1307bf257b..a757a9c89d41c 100644 --- a/x-pack/platform/plugins/shared/alerting/server/application/maintenance_window/methods/delete/delete_maintenance_window.test.ts +++ b/x-pack/platform/plugins/shared/alerting/server/application/maintenance_window/methods/delete/delete_maintenance_window.test.ts @@ -11,10 +11,8 @@ import { loggingSystemMock, uiSettingsServiceMock, } from '@kbn/core/server/mocks'; -import { - MaintenanceWindowClientContext, - MAINTENANCE_WINDOW_SAVED_OBJECT_TYPE, -} from '../../../../../common'; +import type { MaintenanceWindowClientContext } from '../../../../../common'; +import { MAINTENANCE_WINDOW_SAVED_OBJECT_TYPE } from '../../../../../common'; const savedObjectsClient = savedObjectsClientMock.create(); const uiSettings = uiSettingsServiceMock.createClient(); diff --git a/x-pack/platform/plugins/shared/alerting/server/application/maintenance_window/methods/delete/types/delete_maintenance_window_params.ts b/x-pack/platform/plugins/shared/alerting/server/application/maintenance_window/methods/delete/types/delete_maintenance_window_params.ts index e241528ec2011..cf470262ca5df 100644 --- a/x-pack/platform/plugins/shared/alerting/server/application/maintenance_window/methods/delete/types/delete_maintenance_window_params.ts +++ b/x-pack/platform/plugins/shared/alerting/server/application/maintenance_window/methods/delete/types/delete_maintenance_window_params.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { TypeOf } from '@kbn/config-schema'; -import { deleteMaintenanceWindowParamsSchema } from '../schemas'; +import type { TypeOf } from '@kbn/config-schema'; +import type { deleteMaintenanceWindowParamsSchema } from '../schemas'; export type DeleteMaintenanceWindowParams = TypeOf; diff --git a/x-pack/platform/plugins/shared/alerting/server/application/maintenance_window/methods/find/find_maintenance_windows.test.ts b/x-pack/platform/plugins/shared/alerting/server/application/maintenance_window/methods/find/find_maintenance_windows.test.ts index 5e52824d3e249..9c4da552f7e36 100644 --- a/x-pack/platform/plugins/shared/alerting/server/application/maintenance_window/methods/find/find_maintenance_windows.test.ts +++ b/x-pack/platform/plugins/shared/alerting/server/application/maintenance_window/methods/find/find_maintenance_windows.test.ts @@ -11,12 +11,12 @@ import { loggingSystemMock, uiSettingsServiceMock, } from '@kbn/core/server/mocks'; -import { SavedObjectsFindResponse } from '@kbn/core/server'; -import { +import type { SavedObjectsFindResponse } from '@kbn/core/server'; +import type { MaintenanceWindowClientContext, - MAINTENANCE_WINDOW_SAVED_OBJECT_TYPE, MaintenanceWindowStatus, } from '../../../../../common'; +import { MAINTENANCE_WINDOW_SAVED_OBJECT_TYPE } from '../../../../../common'; import { getMockMaintenanceWindow } from '../../../../data/maintenance_window/test_helpers'; import { findMaintenanceWindowsParamsSchema } from './schemas'; diff --git a/x-pack/platform/plugins/shared/alerting/server/application/maintenance_window/methods/find/find_maintenance_windows.ts b/x-pack/platform/plugins/shared/alerting/server/application/maintenance_window/methods/find/find_maintenance_windows.ts index 86db5b699a029..a37adfa6834de 100644 --- a/x-pack/platform/plugins/shared/alerting/server/application/maintenance_window/methods/find/find_maintenance_windows.ts +++ b/x-pack/platform/plugins/shared/alerting/server/application/maintenance_window/methods/find/find_maintenance_windows.ts @@ -6,8 +6,10 @@ */ import Boom from '@hapi/boom'; -import { fromKueryExpression, KueryNode } from '@kbn/es-query'; -import { MaintenanceWindowClientContext, MaintenanceWindowStatus } from '../../../../../common'; +import type { KueryNode } from '@kbn/es-query'; +import { fromKueryExpression } from '@kbn/es-query'; +import type { MaintenanceWindowClientContext } from '../../../../../common'; +import { MaintenanceWindowStatus } from '../../../../../common'; import { transformMaintenanceWindowAttributesToMaintenanceWindow } from '../../transforms'; import { findMaintenanceWindowSo } from '../../../../data/maintenance_window'; import type { diff --git a/x-pack/platform/plugins/shared/alerting/server/application/maintenance_window/methods/find/types/find_maintenance_window_params.ts b/x-pack/platform/plugins/shared/alerting/server/application/maintenance_window/methods/find/types/find_maintenance_window_params.ts index 5e3aced564cca..77816e5fd5307 100644 --- a/x-pack/platform/plugins/shared/alerting/server/application/maintenance_window/methods/find/types/find_maintenance_window_params.ts +++ b/x-pack/platform/plugins/shared/alerting/server/application/maintenance_window/methods/find/types/find_maintenance_window_params.ts @@ -5,8 +5,11 @@ * 2.0. */ -import { TypeOf } from '@kbn/config-schema'; -import { findMaintenanceWindowsParamsSchema, maintenanceWindowsStatusSchema } from '../schemas'; +import type { TypeOf } from '@kbn/config-schema'; +import type { + findMaintenanceWindowsParamsSchema, + maintenanceWindowsStatusSchema, +} from '../schemas'; export type MaintenanceWindowsStatus = TypeOf; export type FindMaintenanceWindowsParams = TypeOf; diff --git a/x-pack/platform/plugins/shared/alerting/server/application/maintenance_window/methods/find/types/find_maintenance_window_result.ts b/x-pack/platform/plugins/shared/alerting/server/application/maintenance_window/methods/find/types/find_maintenance_window_result.ts index 6a16366cd8f29..4c98d93f453f5 100644 --- a/x-pack/platform/plugins/shared/alerting/server/application/maintenance_window/methods/find/types/find_maintenance_window_result.ts +++ b/x-pack/platform/plugins/shared/alerting/server/application/maintenance_window/methods/find/types/find_maintenance_window_result.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { TypeOf } from '@kbn/config-schema'; -import { findMaintenanceWindowsResultSchema } from '../schemas'; +import type { TypeOf } from '@kbn/config-schema'; +import type { findMaintenanceWindowsResultSchema } from '../schemas'; export type FindMaintenanceWindowsResult = TypeOf; diff --git a/x-pack/platform/plugins/shared/alerting/server/application/maintenance_window/methods/finish/finish_maintenance_window.test.ts b/x-pack/platform/plugins/shared/alerting/server/application/maintenance_window/methods/finish/finish_maintenance_window.test.ts index 6fa79cdb20fcf..ff026876bcbb8 100644 --- a/x-pack/platform/plugins/shared/alerting/server/application/maintenance_window/methods/finish/finish_maintenance_window.test.ts +++ b/x-pack/platform/plugins/shared/alerting/server/application/maintenance_window/methods/finish/finish_maintenance_window.test.ts @@ -13,11 +13,9 @@ import { loggingSystemMock, uiSettingsServiceMock, } from '@kbn/core/server/mocks'; -import { SavedObjectsUpdateResponse, SavedObject } from '@kbn/core/server'; -import { - MaintenanceWindowClientContext, - MAINTENANCE_WINDOW_SAVED_OBJECT_TYPE, -} from '../../../../../common'; +import type { SavedObjectsUpdateResponse, SavedObject } from '@kbn/core/server'; +import type { MaintenanceWindowClientContext } from '../../../../../common'; +import { MAINTENANCE_WINDOW_SAVED_OBJECT_TYPE } from '../../../../../common'; import { getMockMaintenanceWindow } from '../../../../data/maintenance_window/test_helpers'; import type { MaintenanceWindow } from '../../types'; diff --git a/x-pack/platform/plugins/shared/alerting/server/application/maintenance_window/methods/finish/finish_maintenance_window.ts b/x-pack/platform/plugins/shared/alerting/server/application/maintenance_window/methods/finish/finish_maintenance_window.ts index e318971993542..e7ef970ba4c0b 100644 --- a/x-pack/platform/plugins/shared/alerting/server/application/maintenance_window/methods/finish/finish_maintenance_window.ts +++ b/x-pack/platform/plugins/shared/alerting/server/application/maintenance_window/methods/finish/finish_maintenance_window.ts @@ -12,11 +12,8 @@ import { mergeEvents, } from '../../lib/generate_maintenance_window_events'; import { getMaintenanceWindowDateAndStatus } from '../../lib/get_maintenance_window_date_and_status'; -import { - DateRange, - MaintenanceWindowClientContext, - MaintenanceWindowStatus, -} from '../../../../../common'; +import type { DateRange, MaintenanceWindowClientContext } from '../../../../../common'; +import { MaintenanceWindowStatus } from '../../../../../common'; import { retryIfConflicts } from '../../../../lib/retry_if_conflicts'; import { getMaintenanceWindowSo, diff --git a/x-pack/platform/plugins/shared/alerting/server/application/maintenance_window/methods/finish/types/finish_maintenance_window_params.ts b/x-pack/platform/plugins/shared/alerting/server/application/maintenance_window/methods/finish/types/finish_maintenance_window_params.ts index 7356042f758fa..d605cc37b7ec9 100644 --- a/x-pack/platform/plugins/shared/alerting/server/application/maintenance_window/methods/finish/types/finish_maintenance_window_params.ts +++ b/x-pack/platform/plugins/shared/alerting/server/application/maintenance_window/methods/finish/types/finish_maintenance_window_params.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { TypeOf } from '@kbn/config-schema'; -import { finishMaintenanceWindowParamsSchema } from '../schemas'; +import type { TypeOf } from '@kbn/config-schema'; +import type { finishMaintenanceWindowParamsSchema } from '../schemas'; export type FinishMaintenanceWindowParams = TypeOf; diff --git a/x-pack/platform/plugins/shared/alerting/server/application/maintenance_window/methods/get/get_maintenance_window.test.ts b/x-pack/platform/plugins/shared/alerting/server/application/maintenance_window/methods/get/get_maintenance_window.test.ts index 54724c6cdfdc7..0f6af91df9234 100644 --- a/x-pack/platform/plugins/shared/alerting/server/application/maintenance_window/methods/get/get_maintenance_window.test.ts +++ b/x-pack/platform/plugins/shared/alerting/server/application/maintenance_window/methods/get/get_maintenance_window.test.ts @@ -11,11 +11,9 @@ import { loggingSystemMock, uiSettingsServiceMock, } from '@kbn/core/server/mocks'; -import { SavedObject } from '@kbn/core/server'; -import { - MaintenanceWindowClientContext, - MAINTENANCE_WINDOW_SAVED_OBJECT_TYPE, -} from '../../../../../common'; +import type { SavedObject } from '@kbn/core/server'; +import type { MaintenanceWindowClientContext } from '../../../../../common'; +import { MAINTENANCE_WINDOW_SAVED_OBJECT_TYPE } from '../../../../../common'; import { getMockMaintenanceWindow } from '../../../../data/maintenance_window/test_helpers'; const savedObjectsClient = savedObjectsClientMock.create(); diff --git a/x-pack/platform/plugins/shared/alerting/server/application/maintenance_window/methods/get/types/get_maintenance_window_params.ts b/x-pack/platform/plugins/shared/alerting/server/application/maintenance_window/methods/get/types/get_maintenance_window_params.ts index e9bf4c7f3d1c4..aefdef05fd37f 100644 --- a/x-pack/platform/plugins/shared/alerting/server/application/maintenance_window/methods/get/types/get_maintenance_window_params.ts +++ b/x-pack/platform/plugins/shared/alerting/server/application/maintenance_window/methods/get/types/get_maintenance_window_params.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { TypeOf } from '@kbn/config-schema'; -import { getMaintenanceWindowParamsSchema } from '../schemas'; +import type { TypeOf } from '@kbn/config-schema'; +import type { getMaintenanceWindowParamsSchema } from '../schemas'; export type GetMaintenanceWindowParams = TypeOf; diff --git a/x-pack/platform/plugins/shared/alerting/server/application/maintenance_window/methods/get_active/get_active_maintenance_windows.test.ts b/x-pack/platform/plugins/shared/alerting/server/application/maintenance_window/methods/get_active/get_active_maintenance_windows.test.ts index b26af5a9c2349..1ab812bf2a959 100644 --- a/x-pack/platform/plugins/shared/alerting/server/application/maintenance_window/methods/get_active/get_active_maintenance_windows.test.ts +++ b/x-pack/platform/plugins/shared/alerting/server/application/maintenance_window/methods/get_active/get_active_maintenance_windows.test.ts @@ -12,11 +12,9 @@ import { loggingSystemMock, uiSettingsServiceMock, } from '@kbn/core/server/mocks'; -import { SavedObjectsFindResponse } from '@kbn/core/server'; -import { - MaintenanceWindowClientContext, - MAINTENANCE_WINDOW_SAVED_OBJECT_TYPE, -} from '../../../../../common'; +import type { SavedObjectsFindResponse } from '@kbn/core/server'; +import type { MaintenanceWindowClientContext } from '../../../../../common'; +import { MAINTENANCE_WINDOW_SAVED_OBJECT_TYPE } from '../../../../../common'; import { getMockMaintenanceWindow } from '../../../../data/maintenance_window/test_helpers'; const savedObjectsClient = savedObjectsClientMock.create(); diff --git a/x-pack/platform/plugins/shared/alerting/server/application/maintenance_window/methods/get_active/get_active_maintenance_windows.ts b/x-pack/platform/plugins/shared/alerting/server/application/maintenance_window/methods/get_active/get_active_maintenance_windows.ts index 4d42cb0f23688..fcce48b0e8674 100644 --- a/x-pack/platform/plugins/shared/alerting/server/application/maintenance_window/methods/get_active/get_active_maintenance_windows.ts +++ b/x-pack/platform/plugins/shared/alerting/server/application/maintenance_window/methods/get_active/get_active_maintenance_windows.ts @@ -6,7 +6,8 @@ */ import Boom from '@hapi/boom'; -import { KueryNode, nodeBuilder } from '@kbn/es-query'; +import type { KueryNode } from '@kbn/es-query'; +import { nodeBuilder } from '@kbn/es-query'; import type { MaintenanceWindowClientContext } from '../../../../../common'; import type { MaintenanceWindow } from '../../types'; import { transformMaintenanceWindowAttributesToMaintenanceWindow } from '../../transforms'; diff --git a/x-pack/platform/plugins/shared/alerting/server/application/maintenance_window/methods/update/types/update_maintenance_window_params.ts b/x-pack/platform/plugins/shared/alerting/server/application/maintenance_window/methods/update/types/update_maintenance_window_params.ts index a8497347a52b7..e66457405320b 100644 --- a/x-pack/platform/plugins/shared/alerting/server/application/maintenance_window/methods/update/types/update_maintenance_window_params.ts +++ b/x-pack/platform/plugins/shared/alerting/server/application/maintenance_window/methods/update/types/update_maintenance_window_params.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { TypeOf } from '@kbn/config-schema'; -import { updateMaintenanceWindowParamsSchema } from '../schemas'; +import type { TypeOf } from '@kbn/config-schema'; +import type { updateMaintenanceWindowParamsSchema } from '../schemas'; export type UpdateMaintenanceWindowParams = TypeOf; diff --git a/x-pack/platform/plugins/shared/alerting/server/application/maintenance_window/methods/update/update_maintenance_window.test.ts b/x-pack/platform/plugins/shared/alerting/server/application/maintenance_window/methods/update/update_maintenance_window.test.ts index 586a5a0e882ed..e6fbfec547ca1 100644 --- a/x-pack/platform/plugins/shared/alerting/server/application/maintenance_window/methods/update/update_maintenance_window.test.ts +++ b/x-pack/platform/plugins/shared/alerting/server/application/maintenance_window/methods/update/update_maintenance_window.test.ts @@ -8,17 +8,15 @@ import moment from 'moment-timezone'; import { Frequency } from '@kbn/rrule'; import { updateMaintenanceWindow } from './update_maintenance_window'; -import { UpdateMaintenanceWindowParams } from './types'; +import type { UpdateMaintenanceWindowParams } from './types'; import { savedObjectsClientMock, loggingSystemMock, uiSettingsServiceMock, } from '@kbn/core/server/mocks'; -import { SavedObject } from '@kbn/core/server'; -import { - MaintenanceWindowClientContext, - MAINTENANCE_WINDOW_SAVED_OBJECT_TYPE, -} from '../../../../../common'; +import type { SavedObject } from '@kbn/core/server'; +import type { MaintenanceWindowClientContext } from '../../../../../common'; +import { MAINTENANCE_WINDOW_SAVED_OBJECT_TYPE } from '../../../../../common'; import { getMockMaintenanceWindow } from '../../../../data/maintenance_window/test_helpers'; import type { MaintenanceWindow } from '../../types'; import { FilterStateStore } from '@kbn/es-query'; diff --git a/x-pack/platform/plugins/shared/alerting/server/application/maintenance_window/methods/update/update_maintenance_window.ts b/x-pack/platform/plugins/shared/alerting/server/application/maintenance_window/methods/update/update_maintenance_window.ts index 6c8fd65b6988f..09fa2efe36075 100644 --- a/x-pack/platform/plugins/shared/alerting/server/application/maintenance_window/methods/update/update_maintenance_window.ts +++ b/x-pack/platform/plugins/shared/alerting/server/application/maintenance_window/methods/update/update_maintenance_window.ts @@ -7,7 +7,8 @@ import moment from 'moment'; import Boom from '@hapi/boom'; -import { buildEsQuery, Filter } from '@kbn/es-query'; +import type { Filter } from '@kbn/es-query'; +import { buildEsQuery } from '@kbn/es-query'; import type { MaintenanceWindowClientContext } from '../../../../../common'; import { getScopedQueryErrorMessage } from '../../../../../common'; import { getEsQueryConfig } from '../../../../lib/get_es_query_config'; @@ -26,7 +27,7 @@ import { getMaintenanceWindowSo, createMaintenanceWindowSo, } from '../../../../data/maintenance_window'; -import { UpdateMaintenanceWindowParams } from './types'; +import type { UpdateMaintenanceWindowParams } from './types'; import { updateMaintenanceWindowParamsSchema } from './schemas'; export async function updateMaintenanceWindow( diff --git a/x-pack/platform/plugins/shared/alerting/server/application/maintenance_window/transforms/transform_maintenance_window_attributes_to_maintenance_window.ts b/x-pack/platform/plugins/shared/alerting/server/application/maintenance_window/transforms/transform_maintenance_window_attributes_to_maintenance_window.ts index 6a2f25ce18dd9..2dfc4645ca120 100644 --- a/x-pack/platform/plugins/shared/alerting/server/application/maintenance_window/transforms/transform_maintenance_window_attributes_to_maintenance_window.ts +++ b/x-pack/platform/plugins/shared/alerting/server/application/maintenance_window/transforms/transform_maintenance_window_attributes_to_maintenance_window.ts @@ -4,8 +4,8 @@ * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ -import { MaintenanceWindow } from '../types'; -import { MaintenanceWindowAttributes } from '../../../data/maintenance_window/types'; +import type { MaintenanceWindow } from '../types'; +import type { MaintenanceWindowAttributes } from '../../../data/maintenance_window/types'; import { getMaintenanceWindowDateAndStatus } from '../lib'; export interface TransformMaintenanceWindowAttributesMaintenanceWindowParams { diff --git a/x-pack/platform/plugins/shared/alerting/server/application/maintenance_window/transforms/transform_maintenance_window_to_maintenance_window_attributes.ts b/x-pack/platform/plugins/shared/alerting/server/application/maintenance_window/transforms/transform_maintenance_window_to_maintenance_window_attributes.ts index b6c0e22d04bc4..afb6eaff5593d 100644 --- a/x-pack/platform/plugins/shared/alerting/server/application/maintenance_window/transforms/transform_maintenance_window_to_maintenance_window_attributes.ts +++ b/x-pack/platform/plugins/shared/alerting/server/application/maintenance_window/transforms/transform_maintenance_window_to_maintenance_window_attributes.ts @@ -5,8 +5,8 @@ * 2.0. */ -import { MaintenanceWindowWithoutComputedProperties } from '../types'; -import { MaintenanceWindowAttributes } from '../../../data/maintenance_window/types'; +import type { MaintenanceWindowWithoutComputedProperties } from '../types'; +import type { MaintenanceWindowAttributes } from '../../../data/maintenance_window/types'; export const transformMaintenanceWindowToMaintenanceWindowAttributes = ( maintenanceWindow: MaintenanceWindowWithoutComputedProperties diff --git a/x-pack/platform/plugins/shared/alerting/server/application/maintenance_window/types/maintenance_window.ts b/x-pack/platform/plugins/shared/alerting/server/application/maintenance_window/types/maintenance_window.ts index 55fc8888a497b..95c7ebcbac40a 100644 --- a/x-pack/platform/plugins/shared/alerting/server/application/maintenance_window/types/maintenance_window.ts +++ b/x-pack/platform/plugins/shared/alerting/server/application/maintenance_window/types/maintenance_window.ts @@ -5,9 +5,9 @@ * 2.0. */ -import { TypeOf } from '@kbn/config-schema'; -import { maintenanceWindowStatus } from '../constants'; -import { maintenanceWindowSchema } from '../schemas'; +import type { TypeOf } from '@kbn/config-schema'; +import type { maintenanceWindowStatus } from '../constants'; +import type { maintenanceWindowSchema } from '../schemas'; export type MaintenanceWindow = TypeOf; export type MaintenanceWindowStatus = diff --git a/x-pack/platform/plugins/shared/alerting/server/application/r_rule/types/r_rule.ts b/x-pack/platform/plugins/shared/alerting/server/application/r_rule/types/r_rule.ts index 57700ea1b57d2..c4e2d7aaeb835 100644 --- a/x-pack/platform/plugins/shared/alerting/server/application/r_rule/types/r_rule.ts +++ b/x-pack/platform/plugins/shared/alerting/server/application/r_rule/types/r_rule.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { TypeOf } from '@kbn/config-schema'; -import { rRuleSchema } from '../schemas/r_rule_schema'; +import type { TypeOf } from '@kbn/config-schema'; +import type { rRuleSchema } from '../schemas/r_rule_schema'; export type RRule = TypeOf; diff --git a/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/aggregate/aggregate_rules.test.ts b/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/aggregate/aggregate_rules.test.ts index 23ccbf97cb6ce..a8733618b9c2f 100644 --- a/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/aggregate/aggregate_rules.test.ts +++ b/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/aggregate/aggregate_rules.test.ts @@ -5,7 +5,8 @@ * 2.0. */ -import { RulesClient, ConstructorOptions } from '../../../../rules_client'; +import type { ConstructorOptions } from '../../../../rules_client'; +import { RulesClient } from '../../../../rules_client'; import { savedObjectsClientMock, loggingSystemMock, @@ -17,15 +18,15 @@ import { ruleTypeRegistryMock } from '../../../../rule_type_registry.mock'; import { alertingAuthorizationMock } from '../../../../authorization/alerting_authorization.mock'; import { encryptedSavedObjectsMock } from '@kbn/encrypted-saved-objects-plugin/server/mocks'; import { actionsAuthorizationMock } from '@kbn/actions-plugin/server/mocks'; -import { AlertingAuthorization } from '../../../../authorization/alerting_authorization'; -import { ActionsAuthorization } from '@kbn/actions-plugin/server'; +import type { AlertingAuthorization } from '../../../../authorization/alerting_authorization'; +import type { ActionsAuthorization } from '@kbn/actions-plugin/server'; import { auditLoggerMock } from '@kbn/security-plugin/server/audit/mocks'; import { getBeforeSetup, setGlobalDate } from '../../../../rules_client/tests/lib'; -import { RegistryRuleType } from '../../../../rule_type_registry'; +import type { RegistryRuleType } from '../../../../rule_type_registry'; import { fromKueryExpression, nodeTypes, toKqlExpression } from '@kbn/es-query'; import { RecoveredActionGroup } from '../../../../../common'; -import { DefaultRuleAggregationResult } from '../../../../routes/rule/apis/aggregate/types'; +import type { DefaultRuleAggregationResult } from '../../../../routes/rule/apis/aggregate/types'; import { defaultRuleAggregationFactory } from '.'; import { ConnectorAdapterRegistry } from '../../../../connector_adapters/connector_adapter_registry'; import { RULE_SAVED_OBJECT_TYPE } from '../../../../saved_objects'; diff --git a/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/aggregate/aggregate_rules.ts b/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/aggregate/aggregate_rules.ts index 307e27184ca7e..3bdeaec41e674 100644 --- a/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/aggregate/aggregate_rules.ts +++ b/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/aggregate/aggregate_rules.ts @@ -17,7 +17,7 @@ import { AlertingAuthorizationEntity } from '../../../../authorization'; import { ruleAuditEvent, RuleAuditAction } from '../../../../rules_client/common/audit_events'; import { buildKueryNodeFilter } from '../../../../rules_client/common'; import { alertingAuthorizationFilterOpts } from '../../../../rules_client/common/constants'; -import { RulesClientContext } from '../../../../rules_client/types'; +import type { RulesClientContext } from '../../../../rules_client/types'; import { aggregateOptionsSchema } from './schemas'; import type { AggregateParams } from './types'; import { validateRuleAggregationFields } from './validation'; diff --git a/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/aggregate/factories/default_rule_aggregation_factory/v1.ts b/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/aggregate/factories/default_rule_aggregation_factory/v1.ts index 371c12c1fada3..4cbd64281634c 100644 --- a/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/aggregate/factories/default_rule_aggregation_factory/v1.ts +++ b/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/aggregate/factories/default_rule_aggregation_factory/v1.ts @@ -5,8 +5,8 @@ * 2.0. */ -import { AggregationsAggregationContainer } from '@elastic/elasticsearch/lib/api/types'; -import { DefaultRuleAggregationParams } from '../../types'; +import type { AggregationsAggregationContainer } from '@elastic/elasticsearch/lib/api/types'; +import type { DefaultRuleAggregationParams } from '../../types'; export const defaultRuleAggregationFactory = ( params?: DefaultRuleAggregationParams diff --git a/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/aggregate/types/index.ts b/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/aggregate/types/index.ts index 804ed47227e99..344caaba861c3 100644 --- a/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/aggregate/types/index.ts +++ b/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/aggregate/types/index.ts @@ -5,10 +5,9 @@ * 2.0. */ import type { AggregationsAggregationContainer } from '@elastic/elasticsearch/lib/api/types'; -import { TypeOf } from '@kbn/config-schema'; -import { KueryNode } from '@kbn/es-query'; -import { aggregateOptionsSchema } from '../schemas'; - +import type { TypeOf } from '@kbn/config-schema'; +import type { KueryNode } from '@kbn/es-query'; +import type { aggregateOptionsSchema } from '../schemas'; export type AggregateOptions = TypeOf & { // Adding filter as in schema it's defined as any instead of KueryNode filter?: string | KueryNode; diff --git a/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/bulk_delete/bulk_delete_rules.test.ts b/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/bulk_delete/bulk_delete_rules.test.ts index 366b98fc31714..9fd1709d5f5ff 100644 --- a/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/bulk_delete/bulk_delete_rules.test.ts +++ b/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/bulk_delete/bulk_delete_rules.test.ts @@ -5,7 +5,8 @@ * 2.0. */ -import { RulesClient, ConstructorOptions } from '../../../../rules_client/rules_client'; +import type { ConstructorOptions } from '../../../../rules_client/rules_client'; +import { RulesClient } from '../../../../rules_client/rules_client'; import { savedObjectsClientMock, savedObjectsRepositoryMock, @@ -15,14 +16,14 @@ import { taskManagerMock } from '@kbn/task-manager-plugin/server/mocks'; import { schema } from '@kbn/config-schema'; import { encryptedSavedObjectsMock } from '@kbn/encrypted-saved-objects-plugin/server/mocks'; import { actionsAuthorizationMock } from '@kbn/actions-plugin/server/mocks'; -import { ActionsAuthorization } from '@kbn/actions-plugin/server'; +import type { ActionsAuthorization } from '@kbn/actions-plugin/server'; import { auditLoggerMock } from '@kbn/security-plugin/server/audit/mocks'; import { loggerMock } from '@kbn/logging-mocks'; -import { ActionsClient } from '@kbn/actions-plugin/server'; +import type { ActionsClient } from '@kbn/actions-plugin/server'; import { ruleTypeRegistryMock } from '../../../../rule_type_registry.mock'; import { alertingAuthorizationMock } from '../../../../authorization/alerting_authorization.mock'; import { RecoveredActionGroup } from '../../../../../common'; -import { AlertingAuthorization } from '../../../../authorization/alerting_authorization'; +import type { AlertingAuthorization } from '../../../../authorization/alerting_authorization'; import { getBeforeSetup, setGlobalDate } from '../../../../rules_client/tests/lib'; import { bulkMarkApiKeysForInvalidation } from '../../../../invalidate_pending_api_keys/bulk_mark_api_keys_for_invalidation'; import { diff --git a/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/bulk_delete/bulk_delete_rules.ts b/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/bulk_delete/bulk_delete_rules.ts index 0c1fa9a3fe1e9..c7899a60d014f 100644 --- a/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/bulk_delete/bulk_delete_rules.ts +++ b/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/bulk_delete/bulk_delete_rules.ts @@ -6,8 +6,9 @@ */ import pMap from 'p-map'; import Boom from '@hapi/boom'; -import { KueryNode, nodeBuilder } from '@kbn/es-query'; -import { SavedObjectsBulkUpdateObject } from '@kbn/core/server'; +import type { KueryNode } from '@kbn/es-query'; +import { nodeBuilder } from '@kbn/es-query'; +import type { SavedObjectsBulkUpdateObject } from '@kbn/core/server'; import { withSpan } from '@kbn/apm-utils'; import { RULE_SAVED_OBJECT_TYPE } from '../../../../saved_objects'; import { convertRuleIdsToKueryNode } from '../../../../lib'; diff --git a/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/bulk_delete/types/index.ts b/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/bulk_delete/types/index.ts index d7075638a5027..f78a41ac49b7c 100644 --- a/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/bulk_delete/types/index.ts +++ b/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/bulk_delete/types/index.ts @@ -5,7 +5,7 @@ * 2.0. */ import type { TypeOf } from '@kbn/config-schema'; -import { bulkDeleteRulesRequestBodySchema } from '../schemas'; +import type { bulkDeleteRulesRequestBodySchema } from '../schemas'; import type { SanitizedRule } from '../../../../../types'; import type { RuleParams } from '../../../types'; diff --git a/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/bulk_delete/validation/index.ts b/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/bulk_delete/validation/index.ts index 746802899efc4..0c333755a2d82 100644 --- a/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/bulk_delete/validation/index.ts +++ b/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/bulk_delete/validation/index.ts @@ -6,7 +6,7 @@ */ import Boom from '@hapi/boom'; -import { BulkDeleteRulesRequestBody } from '../types'; +import type { BulkDeleteRulesRequestBody } from '../types'; export const validateBulkDeleteRulesBody = (options: BulkDeleteRulesRequestBody) => { const filter = options.filter; diff --git a/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/bulk_disable/bulk_disable_rules.test.ts b/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/bulk_disable/bulk_disable_rules.test.ts index 949bf35361dc0..3a18fafce2783 100644 --- a/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/bulk_disable/bulk_disable_rules.test.ts +++ b/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/bulk_disable/bulk_disable_rules.test.ts @@ -5,7 +5,8 @@ * 2.0. */ import { AlertConsumers } from '@kbn/rule-data-utils'; -import { RulesClient, ConstructorOptions } from '../../../../rules_client/rules_client'; +import type { ConstructorOptions } from '../../../../rules_client/rules_client'; +import { RulesClient } from '../../../../rules_client/rules_client'; import { savedObjectsClientMock, savedObjectsRepositoryMock, @@ -17,12 +18,12 @@ import { ruleTypeRegistryMock } from '../../../../rule_type_registry.mock'; import { alertingAuthorizationMock } from '../../../../authorization/alerting_authorization.mock'; import { encryptedSavedObjectsMock } from '@kbn/encrypted-saved-objects-plugin/server/mocks'; import { actionsAuthorizationMock } from '@kbn/actions-plugin/server/mocks'; -import { AlertingAuthorization } from '../../../../authorization/alerting_authorization'; -import { ActionsAuthorization } from '@kbn/actions-plugin/server'; +import type { AlertingAuthorization } from '../../../../authorization/alerting_authorization'; +import type { ActionsAuthorization } from '@kbn/actions-plugin/server'; import { auditLoggerMock } from '@kbn/security-plugin/server/audit/mocks'; import { getBeforeSetup, setGlobalDate } from '../../../../rules_client/tests/lib'; import { loggerMock } from '@kbn/logging-mocks'; -import { BulkUpdateTaskResult } from '@kbn/task-manager-plugin/server/task_scheduling'; +import type { BulkUpdateTaskResult } from '@kbn/task-manager-plugin/server/task_scheduling'; import { eventLoggerMock } from '@kbn/event-log-plugin/server/mocks'; import { enabledRule1, @@ -44,7 +45,7 @@ import { } from '../../../../rules_client/tests/test_helpers'; import { migrateLegacyActions } from '../../../../rules_client/lib'; import { ConnectorAdapterRegistry } from '../../../../connector_adapters/connector_adapter_registry'; -import { ActionsClient } from '@kbn/actions-plugin/server'; +import type { ActionsClient } from '@kbn/actions-plugin/server'; import { RULE_SAVED_OBJECT_TYPE } from '../../../../saved_objects'; import { backfillClientMock } from '../../../../backfill_client/backfill_client.mock'; diff --git a/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/bulk_disable/bulk_disable_rules.ts b/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/bulk_disable/bulk_disable_rules.ts index 1e56be531b0ca..27138456456e8 100644 --- a/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/bulk_disable/bulk_disable_rules.ts +++ b/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/bulk_disable/bulk_disable_rules.ts @@ -4,13 +4,14 @@ * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ -import { KueryNode, nodeBuilder } from '@kbn/es-query'; -import { SavedObjectsBulkUpdateObject, SavedObjectsBulkCreateObject } from '@kbn/core/server'; +import type { KueryNode } from '@kbn/es-query'; +import { nodeBuilder } from '@kbn/es-query'; +import type { SavedObjectsBulkUpdateObject, SavedObjectsBulkCreateObject } from '@kbn/core/server'; import Boom from '@hapi/boom'; import { withSpan } from '@kbn/apm-utils'; import pMap from 'p-map'; -import { Logger } from '@kbn/core/server'; -import { TaskManagerStartContract } from '@kbn/task-manager-plugin/server'; +import type { Logger } from '@kbn/core/server'; +import type { TaskManagerStartContract } from '@kbn/task-manager-plugin/server'; import { RULE_SAVED_OBJECT_TYPE } from '../../../../saved_objects'; import type { RawRule, SanitizedRule, RawRuleAction } from '../../../../types'; import { convertRuleIdsToKueryNode } from '../../../../lib'; diff --git a/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/bulk_disable/types/index.ts b/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/bulk_disable/types/index.ts index 9966fefdd921f..52b54d0172de5 100644 --- a/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/bulk_disable/types/index.ts +++ b/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/bulk_disable/types/index.ts @@ -5,7 +5,7 @@ * 2.0. */ import type { TypeOf } from '@kbn/config-schema'; -import { bulkDisableRulesRequestBodySchema } from '../schemas'; +import type { bulkDisableRulesRequestBodySchema } from '../schemas'; import type { SanitizedRule } from '../../../../../types'; import type { RuleParams } from '../../../types'; diff --git a/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/bulk_disable/validation/index.ts b/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/bulk_disable/validation/index.ts index a162a510e9fa2..14a13eb5880ff 100644 --- a/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/bulk_disable/validation/index.ts +++ b/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/bulk_disable/validation/index.ts @@ -6,7 +6,7 @@ */ import Boom from '@hapi/boom'; -import { BulkDisableRulesRequestBody } from '../types'; +import type { BulkDisableRulesRequestBody } from '../types'; export const validateBulkDisableRulesBody = (options: BulkDisableRulesRequestBody) => { const filter = options.filter; diff --git a/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/bulk_edit/bulk_edit_rules.test.ts b/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/bulk_edit/bulk_edit_rules.test.ts index 45d6fbc0a1eba..cfc43af6a7733 100644 --- a/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/bulk_edit/bulk_edit_rules.test.ts +++ b/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/bulk_edit/bulk_edit_rules.test.ts @@ -11,7 +11,8 @@ import { schema } from '@kbn/config-schema'; import { omit } from 'lodash'; import { v4 as uuidv4 } from 'uuid'; import { AlertConsumers } from '@kbn/rule-data-utils'; -import { RulesClient, ConstructorOptions } from '../../../../rules_client/rules_client'; +import type { ConstructorOptions } from '../../../../rules_client/rules_client'; +import { RulesClient } from '../../../../rules_client/rules_client'; import { savedObjectsClientMock, loggingSystemMock, @@ -21,11 +22,12 @@ import { import { taskManagerMock } from '@kbn/task-manager-plugin/server/mocks'; import { ruleTypeRegistryMock } from '../../../../rule_type_registry.mock'; import { alertingAuthorizationMock } from '../../../../authorization/alerting_authorization.mock'; -import { RecoveredActionGroup, RuleTypeParams } from '../../../../../common'; +import type { RuleTypeParams } from '../../../../../common'; +import { RecoveredActionGroup } from '../../../../../common'; import { encryptedSavedObjectsMock } from '@kbn/encrypted-saved-objects-plugin/server/mocks'; import { actionsAuthorizationMock } from '@kbn/actions-plugin/server/mocks'; -import { AlertingAuthorization } from '../../../../authorization/alerting_authorization'; -import { ActionsAuthorization, ActionsClient } from '@kbn/actions-plugin/server'; +import type { AlertingAuthorization } from '../../../../authorization/alerting_authorization'; +import type { ActionsAuthorization, ActionsClient } from '@kbn/actions-plugin/server'; import { auditLoggerMock } from '@kbn/security-plugin/server/audit/mocks'; import { getBeforeSetup, setGlobalDate } from '../../../../rules_client/tests/lib'; import { bulkMarkApiKeysForInvalidation } from '../../../../invalidate_pending_api_keys/bulk_mark_api_keys_for_invalidation'; @@ -38,12 +40,12 @@ import { import { migrateLegacyActions } from '../../../../rules_client/lib'; import { migrateLegacyActionsMock } from '../../../../rules_client/lib/siem_legacy_actions/retrieve_migrated_legacy_actions.mock'; import { ConnectorAdapterRegistry } from '../../../../connector_adapters/connector_adapter_registry'; -import { ConnectorAdapter } from '../../../../connector_adapters/types'; -import { SavedObject } from '@kbn/core/server'; +import type { ConnectorAdapter } from '../../../../connector_adapters/types'; +import type { SavedObject } from '@kbn/core/server'; import { bulkEditOperationsSchema } from './schemas'; import { RULE_SAVED_OBJECT_TYPE } from '../../../../saved_objects'; import { backfillClientMock } from '../../../../backfill_client/backfill_client.mock'; -import { RawRule } from '../../../../types'; +import type { RawRule } from '../../../../types'; jest.mock('../../../../rules_client/lib/siem_legacy_actions/migrate_legacy_actions', () => { return { @@ -1891,7 +1893,7 @@ describe('bulkEdit()', () => { getActiveSnoozeIfExist.mockImplementation(() => false); }); - const getSnoozeSchedule = (useId: boolean = true) => { + const getSnoozeSchedule = (useId = true) => { return { ...(useId && { id: uuidv4() }), duration: 28800000, diff --git a/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/bulk_edit/bulk_edit_rules.ts b/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/bulk_edit/bulk_edit_rules.ts index 4ef8a2284c47b..49b5fc6285187 100644 --- a/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/bulk_edit/bulk_edit_rules.ts +++ b/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/bulk_edit/bulk_edit_rules.ts @@ -8,18 +8,19 @@ import pMap from 'p-map'; import Boom from '@hapi/boom'; import { cloneDeep } from 'lodash'; -import { KueryNode, nodeBuilder } from '@kbn/es-query'; -import { +import type { KueryNode } from '@kbn/es-query'; +import { nodeBuilder } from '@kbn/es-query'; +import type { SavedObjectsBulkUpdateObject, SavedObjectsBulkCreateObject, SavedObjectsFindResult, SavedObjectsUpdateResponse, } from '@kbn/core/server'; import { validateAndAuthorizeSystemActions } from '../../../../lib/validate_authorize_system_actions'; -import { Rule, RuleAction, RuleSystemAction } from '../../../../../common'; +import type { Rule, RuleAction, RuleSystemAction } from '../../../../../common'; import { RULE_SAVED_OBJECT_TYPE } from '../../../../saved_objects'; -import { BulkActionSkipResult } from '../../../../../common/bulk_edit'; -import { RuleTypeRegistry } from '../../../../types'; +import type { BulkActionSkipResult } from '../../../../../common/bulk_edit'; +import type { RuleTypeRegistry } from '../../../../types'; import { validateRuleTypeParams, getRuleNotifyWhenType, @@ -53,7 +54,7 @@ import { addGeneratedActionValues, createNewAPIKeySet, } from '../../../../rules_client/lib'; -import { +import type { BulkOperationError, RuleBulkOperationAggregation, RulesClientContext, @@ -61,7 +62,7 @@ import { NormalizedAlertAction, } from '../../../../rules_client/types'; import { migrateLegacyActions } from '../../../../rules_client/lib'; -import { +import type { BulkEditFields, BulkEditOperation, BulkEditOptionsFilter, @@ -69,17 +70,18 @@ import { ParamsModifier, ShouldIncrementRevision, } from './types'; -import { RawRuleAction, RawRule, SanitizedRule } from '../../../../types'; +import type { RawRuleAction, RawRule, SanitizedRule } from '../../../../types'; import { ruleNotifyWhen } from '../../constants'; import { actionRequestSchema, ruleDomainSchema, systemActionRequestSchema } from '../../schemas'; -import { RuleParams, RuleDomain, RuleSnoozeSchedule } from '../../types'; +import type { RuleParams, RuleDomain, RuleSnoozeSchedule } from '../../types'; import { findRulesSo, bulkCreateRulesSo } from '../../../../data/rule'; import { transformRuleAttributesToRuleDomain, transformRuleDomainToRuleAttributes, transformRuleDomainToRule, } from '../../transforms'; -import { validateScheduleLimit, ValidateScheduleLimitResult } from '../get_schedule_frequency'; +import type { ValidateScheduleLimitResult } from '../get_schedule_frequency'; +import { validateScheduleLimit } from '../get_schedule_frequency'; const isValidInterval = (interval: string | undefined): interval is string => { return interval !== undefined; diff --git a/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/bulk_edit/types/bulk_edit_rules_options.ts b/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/bulk_edit/types/bulk_edit_rules_options.ts index 7c30f6583865e..5a3620e5327f5 100644 --- a/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/bulk_edit/types/bulk_edit_rules_options.ts +++ b/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/bulk_edit/types/bulk_edit_rules_options.ts @@ -6,14 +6,14 @@ */ import type { TypeOf } from '@kbn/config-schema'; -import { KueryNode } from '@kbn/es-query'; -import { +import type { KueryNode } from '@kbn/es-query'; +import type { bulkEditRuleSnoozeScheduleSchema, bulkEditOperationsSchema, bulkEditOperationSchema, } from '../schemas'; -import { RuleParams, RuleDomain } from '../../../types'; -import { Rule } from '../../../../../../common'; +import type { RuleParams, RuleDomain } from '../../../types'; +import type { Rule } from '../../../../../../common'; export type BulkEditRuleSnoozeSchedule = TypeOf; export type BulkEditOperation = TypeOf; diff --git a/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/bulk_edit/validation/validate_snooze_schedule.ts b/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/bulk_edit/validation/validate_snooze_schedule.ts index 16fd324cfcb7c..37c83e1d5deab 100644 --- a/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/bulk_edit/validation/validate_snooze_schedule.ts +++ b/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/bulk_edit/validation/validate_snooze_schedule.ts @@ -7,7 +7,7 @@ import { Frequency } from '@kbn/rrule'; import moment from 'moment'; -import { BulkEditRuleSnoozeSchedule } from '../types'; +import type { BulkEditRuleSnoozeSchedule } from '../types'; export const validateSnoozeSchedule = (schedule: BulkEditRuleSnoozeSchedule) => { const intervalIsDaily = schedule.rRule.freq === Frequency.DAILY; diff --git a/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/bulk_enable/bulk_enable_rules.test.ts b/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/bulk_enable/bulk_enable_rules.test.ts index 7138c2cb3a318..9c7723a3c550f 100644 --- a/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/bulk_enable/bulk_enable_rules.test.ts +++ b/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/bulk_enable/bulk_enable_rules.test.ts @@ -5,7 +5,8 @@ * 2.0. */ import { AlertConsumers } from '@kbn/rule-data-utils'; -import { RulesClient, ConstructorOptions } from '../../../../rules_client/rules_client'; +import type { ConstructorOptions } from '../../../../rules_client/rules_client'; +import { RulesClient } from '../../../../rules_client/rules_client'; import { savedObjectsClientMock, savedObjectsRepositoryMock, @@ -16,13 +17,13 @@ import { ruleTypeRegistryMock } from '../../../../rule_type_registry.mock'; import { alertingAuthorizationMock } from '../../../../authorization/alerting_authorization.mock'; import { encryptedSavedObjectsMock } from '@kbn/encrypted-saved-objects-plugin/server/mocks'; import { actionsAuthorizationMock } from '@kbn/actions-plugin/server/mocks'; -import { AlertingAuthorization } from '../../../../authorization/alerting_authorization'; -import { ActionsAuthorization } from '@kbn/actions-plugin/server'; +import type { AlertingAuthorization } from '../../../../authorization/alerting_authorization'; +import type { ActionsAuthorization } from '@kbn/actions-plugin/server'; import { auditLoggerMock } from '@kbn/security-plugin/server/audit/mocks'; import { getBeforeSetup, setGlobalDate } from '../../../../rules_client/tests/lib'; import { loggerMock } from '@kbn/logging-mocks'; -import { BulkUpdateTaskResult } from '@kbn/task-manager-plugin/server/task_scheduling'; -import { ActionsClient } from '@kbn/actions-plugin/server'; +import type { BulkUpdateTaskResult } from '@kbn/task-manager-plugin/server/task_scheduling'; +import type { ActionsClient } from '@kbn/actions-plugin/server'; import { disabledRule1, disabledRule2, diff --git a/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/bulk_enable/bulk_enable_rules.ts b/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/bulk_enable/bulk_enable_rules.ts index ac7510c2a5a9c..c351fe21ed66e 100644 --- a/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/bulk_enable/bulk_enable_rules.ts +++ b/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/bulk_enable/bulk_enable_rules.ts @@ -7,19 +7,21 @@ import pMap from 'p-map'; import Boom from '@hapi/boom'; -import { KueryNode, nodeBuilder } from '@kbn/es-query'; -import { +import type { KueryNode } from '@kbn/es-query'; +import { nodeBuilder } from '@kbn/es-query'; +import type { SavedObjectsBulkCreateObject, SavedObjectsBulkUpdateObject, SavedObjectsFindResult, } from '@kbn/core/server'; import { withSpan } from '@kbn/apm-utils'; -import { Logger } from '@kbn/core/server'; -import { TaskManagerStartContract, TaskStatus } from '@kbn/task-manager-plugin/server'; -import { TaskInstanceWithDeprecatedFields } from '@kbn/task-manager-plugin/server/task'; +import type { Logger } from '@kbn/core/server'; +import type { TaskManagerStartContract } from '@kbn/task-manager-plugin/server'; +import { TaskStatus } from '@kbn/task-manager-plugin/server'; +import type { TaskInstanceWithDeprecatedFields } from '@kbn/task-manager-plugin/server/task'; import { bulkCreateRulesSo } from '../../../../data/rule'; -import { RawRule } from '../../../../types'; -import { RuleDomain, RuleParams } from '../../types'; +import type { RawRule } from '../../../../types'; +import type { RuleDomain, RuleParams } from '../../types'; import { convertRuleIdsToKueryNode } from '../../../../lib'; import { ruleAuditEvent, RuleAuditAction } from '../../../../rules_client/common/audit_events'; import { @@ -27,7 +29,8 @@ import { buildKueryNodeFilter, getAndValidateCommonBulkOptions, } from '../../../../rules_client/common'; -import { getRuleCircuitBreakerErrorMessage, SanitizedRule } from '../../../../../common'; +import type { SanitizedRule } from '../../../../../common'; +import { getRuleCircuitBreakerErrorMessage } from '../../../../../common'; import { getAuthorizationFilter, checkAuthorizationAndGetTotal, @@ -35,10 +38,10 @@ import { migrateLegacyActions, updateMetaAttributes, } from '../../../../rules_client/lib'; -import { RulesClientContext, BulkOperationError } from '../../../../rules_client/types'; +import type { RulesClientContext, BulkOperationError } from '../../../../rules_client/types'; import { validateScheduleLimit } from '../get_schedule_frequency'; import { RULE_SAVED_OBJECT_TYPE } from '../../../../saved_objects'; -import { BulkEnableRulesParams, BulkEnableRulesResult } from './types'; +import type { BulkEnableRulesParams, BulkEnableRulesResult } from './types'; import { bulkEnableRulesParamsSchema } from './schemas'; import { transformRuleAttributesToRuleDomain, transformRuleDomainToRule } from '../../transforms'; import { ruleDomainSchema } from '../../schemas'; diff --git a/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/bulk_enable/types/bulk_enable_rules_types.ts b/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/bulk_enable/types/bulk_enable_rules_types.ts index c33e2ef964915..c93394366f061 100644 --- a/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/bulk_enable/types/bulk_enable_rules_types.ts +++ b/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/bulk_enable/types/bulk_enable_rules_types.ts @@ -5,8 +5,8 @@ * 2.0. */ -import { RuleParams } from '../../../types/rule'; -import { SanitizedRule } from '../../../../../types'; +import type { RuleParams } from '../../../types/rule'; +import type { SanitizedRule } from '../../../../../types'; export interface BulkEnableRulesParams { filter?: string; diff --git a/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/bulk_untrack/bulk_untrack_alerts.test.ts b/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/bulk_untrack/bulk_untrack_alerts.test.ts index befd240286a06..811ed968c036b 100644 --- a/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/bulk_untrack/bulk_untrack_alerts.test.ts +++ b/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/bulk_untrack/bulk_untrack_alerts.test.ts @@ -4,7 +4,8 @@ * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ -import { RulesClient, ConstructorOptions } from '../../../../rules_client/rules_client'; +import type { ConstructorOptions } from '../../../../rules_client/rules_client'; +import { RulesClient } from '../../../../rules_client/rules_client'; import { savedObjectsClientMock, savedObjectsRepositoryMock, @@ -13,15 +14,16 @@ import { import { taskManagerMock } from '@kbn/task-manager-plugin/server/mocks'; import { encryptedSavedObjectsMock } from '@kbn/encrypted-saved-objects-plugin/server/mocks'; import { actionsAuthorizationMock } from '@kbn/actions-plugin/server/mocks'; -import { ActionsAuthorization } from '@kbn/actions-plugin/server'; +import type { ActionsAuthorization } from '@kbn/actions-plugin/server'; import { auditLoggerMock } from '@kbn/security-plugin/server/audit/mocks'; import { loggerMock } from '@kbn/logging-mocks'; import { ruleTypeRegistryMock } from '../../../../rule_type_registry.mock'; import { alertingAuthorizationMock } from '../../../../authorization/alerting_authorization.mock'; -import { AlertingAuthorization } from '../../../../authorization/alerting_authorization'; +import type { AlertingAuthorization } from '../../../../authorization/alerting_authorization'; import { alertsServiceMock } from '../../../../alerts_service/alerts_service.mock'; import { ALERT_RULE_UUID, ALERT_UUID } from '@kbn/rule-data-utils'; -import { ConcreteTaskInstance, TaskStatus } from '@kbn/task-manager-plugin/server'; +import type { ConcreteTaskInstance } from '@kbn/task-manager-plugin/server'; +import { TaskStatus } from '@kbn/task-manager-plugin/server'; import { backfillClientMock } from '../../../../backfill_client/backfill_client.mock'; import { ConnectorAdapterRegistry } from '../../../../connector_adapters/connector_adapter_registry'; diff --git a/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/bulk_untrack/bulk_untrack_alerts.ts b/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/bulk_untrack/bulk_untrack_alerts.ts index e93f82da28cbe..fa21f446bdf2f 100644 --- a/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/bulk_untrack/bulk_untrack_alerts.ts +++ b/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/bulk_untrack/bulk_untrack_alerts.ts @@ -9,13 +9,13 @@ import { omitBy } from 'lodash'; import Boom from '@hapi/boom'; import { withSpan } from '@kbn/apm-utils'; import { ALERT_RULE_UUID, ALERT_UUID } from '@kbn/rule-data-utils'; -import { AuditLogger } from '@kbn/core-security-server'; +import type { AuditLogger } from '@kbn/core-security-server'; import { bulkUntrackBodySchema } from './schemas'; import type { BulkUntrackBody } from './types'; import { WriteOperations, AlertingAuthorizationEntity } from '../../../../authorization'; import { retryIfConflicts } from '../../../../lib/retry_if_conflicts'; import { ruleAuditEvent, RuleAuditAction } from '../../../../rules_client/common/audit_events'; -import { RulesClientContext } from '../../../../rules_client/types'; +import type { RulesClientContext } from '../../../../rules_client/types'; export type { BulkUntrackBody }; diff --git a/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/bulk_untrack/types/bulk_untrack_body.ts b/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/bulk_untrack/types/bulk_untrack_body.ts index f515314b2ef50..40cfa7a484a76 100644 --- a/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/bulk_untrack/types/bulk_untrack_body.ts +++ b/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/bulk_untrack/types/bulk_untrack_body.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { TypeOf } from '@kbn/config-schema'; -import { bulkUntrackBodySchema } from '../schemas'; +import type { TypeOf } from '@kbn/config-schema'; +import type { bulkUntrackBodySchema } from '../schemas'; export type BulkUntrackBody = TypeOf; diff --git a/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/clone/clone_rule.test.ts b/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/clone/clone_rule.test.ts index 336224b4f40c1..e7a80eda8e38d 100644 --- a/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/clone/clone_rule.test.ts +++ b/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/clone/clone_rule.test.ts @@ -16,14 +16,15 @@ import { ruleTypeRegistryMock } from '../../../../rule_type_registry.mock'; import { alertingAuthorizationMock } from '../../../../authorization/alerting_authorization.mock'; import { encryptedSavedObjectsMock } from '@kbn/encrypted-saved-objects-plugin/server/mocks'; import { actionsAuthorizationMock } from '@kbn/actions-plugin/server/mocks'; -import { AlertingAuthorization } from '../../../../authorization/alerting_authorization'; -import { ActionsAuthorization } from '@kbn/actions-plugin/server'; +import type { AlertingAuthorization } from '../../../../authorization/alerting_authorization'; +import type { ActionsAuthorization } from '@kbn/actions-plugin/server'; import { auditLoggerMock } from '@kbn/security-plugin/server/audit/mocks'; import { ConnectorAdapterRegistry } from '../../../../connector_adapters/connector_adapter_registry'; import { RULE_SAVED_OBJECT_TYPE } from '../../../../saved_objects'; import { getBeforeSetup } from '../../../../rules_client/tests/lib'; -import { RuleDomain } from '../../types'; -import { ConstructorOptions, RulesClient } from '../../../../rules_client/rules_client'; +import type { RuleDomain } from '../../types'; +import type { ConstructorOptions } from '../../../../rules_client/rules_client'; +import { RulesClient } from '../../../../rules_client/rules_client'; import { backfillClientMock } from '../../../../backfill_client/backfill_client.mock'; describe('clone', () => { diff --git a/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/clone/clone_rule.ts b/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/clone/clone_rule.ts index 9383a32b7c60a..eb5bf0b09bd29 100644 --- a/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/clone/clone_rule.ts +++ b/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/clone/clone_rule.ts @@ -8,9 +8,10 @@ import Semver from 'semver'; import Boom from '@hapi/boom'; import { AlertConsumers } from '@kbn/rule-data-utils'; -import { SavedObject, SavedObjectsUtils } from '@kbn/core/server'; +import type { SavedObject } from '@kbn/core/server'; +import { SavedObjectsUtils } from '@kbn/core/server'; import { withSpan } from '@kbn/apm-utils'; -import { SanitizedRule, RawRule } from '../../../../types'; +import type { SanitizedRule, RawRule } from '../../../../types'; import { getDefaultMonitoring } from '../../../../lib'; import { WriteOperations, AlertingAuthorizationEntity } from '../../../../authorization'; import { parseDuration } from '../../../../../common/parse_duration'; @@ -18,10 +19,10 @@ import { ruleAuditEvent, RuleAuditAction } from '../../../../rules_client/common import { getRuleExecutionStatusPendingAttributes } from '../../../../lib/rule_execution_status'; import { isDetectionEngineAADRuleType } from '../../../../saved_objects/migrations/utils'; import { createNewAPIKeySet, createRuleSavedObject } from '../../../../rules_client/lib'; -import { RulesClientContext } from '../../../../rules_client/types'; +import type { RulesClientContext } from '../../../../rules_client/types'; import { RULE_SAVED_OBJECT_TYPE } from '../../../../saved_objects'; -import { CloneRuleParams } from './types'; -import { RuleDomain, RuleParams } from '../../types'; +import type { CloneRuleParams } from './types'; +import type { RuleDomain, RuleParams } from '../../types'; import { getDecryptedRuleSo, getRuleSo } from '../../../../data/rule'; import { transformRuleAttributesToRuleDomain, transformRuleDomainToRule } from '../../transforms'; import { ruleDomainSchema } from '../../schemas'; diff --git a/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/clone/types/clone_rule_params.ts b/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/clone/types/clone_rule_params.ts index 349b3b3b538f0..2aab498ec00d0 100644 --- a/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/clone/types/clone_rule_params.ts +++ b/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/clone/types/clone_rule_params.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { TypeOf } from '@kbn/config-schema'; -import { cloneRuleParamsSchema } from '../schemas'; +import type { TypeOf } from '@kbn/config-schema'; +import type { cloneRuleParamsSchema } from '../schemas'; export type CloneRuleParams = TypeOf; diff --git a/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/create/create_rule.test.ts b/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/create/create_rule.test.ts index 5e675edd14d67..b61f88f2aed12 100644 --- a/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/create/create_rule.test.ts +++ b/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/create/create_rule.test.ts @@ -6,8 +6,9 @@ */ import { schema } from '@kbn/config-schema'; -import { CreateRuleParams } from './create_rule'; -import { RulesClient, ConstructorOptions } from '../../../../rules_client'; +import type { CreateRuleParams } from './create_rule'; +import type { ConstructorOptions } from '../../../../rules_client'; +import { RulesClient } from '../../../../rules_client'; import { savedObjectsClientMock, loggingSystemMock, @@ -19,8 +20,8 @@ import { ruleTypeRegistryMock } from '../../../../rule_type_registry.mock'; import { alertingAuthorizationMock } from '../../../../authorization/alerting_authorization.mock'; import { encryptedSavedObjectsMock } from '@kbn/encrypted-saved-objects-plugin/server/mocks'; import { actionsAuthorizationMock } from '@kbn/actions-plugin/server/mocks'; -import { AlertingAuthorization } from '../../../../authorization/alerting_authorization'; -import { ActionsAuthorization, ActionsClient } from '@kbn/actions-plugin/server'; +import type { AlertingAuthorization } from '../../../../authorization/alerting_authorization'; +import type { ActionsAuthorization, ActionsClient } from '@kbn/actions-plugin/server'; import { ruleNotifyWhen } from '../../constants'; import { TaskStatus } from '@kbn/task-manager-plugin/server'; import { auditLoggerMock } from '@kbn/security-plugin/server/audit/mocks'; @@ -29,9 +30,9 @@ import { RecoveredActionGroup } from '../../../../../common'; import { bulkMarkApiKeysForInvalidation } from '../../../../invalidate_pending_api_keys/bulk_mark_api_keys_for_invalidation'; import { getRuleExecutionStatusPending, getDefaultMonitoring } from '../../../../lib'; import { ConnectorAdapterRegistry } from '../../../../connector_adapters/connector_adapter_registry'; -import { ConnectorAdapter } from '../../../../connector_adapters/types'; -import { RuleDomain } from '../../types'; -import { RuleSystemAction } from '../../../../types'; +import type { ConnectorAdapter } from '../../../../connector_adapters/types'; +import type { RuleDomain } from '../../types'; +import type { RuleSystemAction } from '../../../../types'; import { RULE_SAVED_OBJECT_TYPE } from '../../../../saved_objects'; import { backfillClientMock } from '../../../../backfill_client/backfill_client.mock'; diff --git a/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/create/create_rule.ts b/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/create/create_rule.ts index 3514f8ce2237b..a4307499a9fbd 100644 --- a/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/create/create_rule.ts +++ b/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/create/create_rule.ts @@ -6,7 +6,8 @@ */ import Semver from 'semver'; import Boom from '@hapi/boom'; -import { SavedObject, SavedObjectsUtils } from '@kbn/core/server'; +import type { SavedObject } from '@kbn/core/server'; +import { SavedObjectsUtils } from '@kbn/core/server'; import { withSpan } from '@kbn/apm-utils'; import { validateAndAuthorizeSystemActions } from '../../../../lib/validate_authorize_system_actions'; import { RULE_SAVED_OBJECT_TYPE } from '../../../../saved_objects'; @@ -25,9 +26,9 @@ import { } from '../../../../rules_client/lib'; import { generateAPIKeyName, apiKeyAsRuleDomainProperties } from '../../../../rules_client/common'; import { ruleAuditEvent, RuleAuditAction } from '../../../../rules_client/common/audit_events'; -import { RulesClientContext } from '../../../../rules_client/types'; -import { RuleDomain, RuleParams } from '../../types'; -import { RawRule, SanitizedRule } from '../../../../types'; +import type { RulesClientContext } from '../../../../rules_client/types'; +import type { RuleDomain, RuleParams } from '../../types'; +import type { RawRule, SanitizedRule } from '../../../../types'; import { transformRuleAttributesToRuleDomain, transformRuleDomainToRuleAttributes, @@ -37,7 +38,8 @@ import { ruleDomainSchema } from '../../schemas'; import type { CreateRuleData } from './types'; import { createRuleDataSchema } from './schemas'; import { createRuleSavedObject } from '../../../../rules_client/lib'; -import { validateScheduleLimit, ValidateScheduleLimitResult } from '../get_schedule_frequency'; +import type { ValidateScheduleLimitResult } from '../get_schedule_frequency'; +import { validateScheduleLimit } from '../get_schedule_frequency'; export interface CreateRuleOptions { id?: string; diff --git a/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/create/types/create_rule_data.ts b/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/create/types/create_rule_data.ts index 0c7a14b9f9727..0fd75188fd6cb 100644 --- a/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/create/types/create_rule_data.ts +++ b/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/create/types/create_rule_data.ts @@ -5,9 +5,9 @@ * 2.0. */ -import { TypeOf } from '@kbn/config-schema'; -import { createRuleDataSchema } from '../schemas'; -import { RuleParams } from '../../../types'; +import type { TypeOf } from '@kbn/config-schema'; +import type { createRuleDataSchema } from '../schemas'; +import type { RuleParams } from '../../../types'; type CreateRuleDataType = TypeOf; diff --git a/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/delete/delete_rule.test.ts b/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/delete/delete_rule.test.ts index 7491df9d3df19..9ddc962c261d1 100644 --- a/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/delete/delete_rule.test.ts +++ b/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/delete/delete_rule.test.ts @@ -7,7 +7,8 @@ import { AlertConsumers } from '@kbn/rule-data-utils'; -import { RulesClient, ConstructorOptions } from '../../../../rules_client/rules_client'; +import type { ConstructorOptions } from '../../../../rules_client/rules_client'; +import { RulesClient } from '../../../../rules_client/rules_client'; import { savedObjectsClientMock, loggingSystemMock, @@ -19,8 +20,8 @@ import { ruleTypeRegistryMock } from '../../../../rule_type_registry.mock'; import { alertingAuthorizationMock } from '../../../../authorization/alerting_authorization.mock'; import { encryptedSavedObjectsMock } from '@kbn/encrypted-saved-objects-plugin/server/mocks'; import { actionsAuthorizationMock } from '@kbn/actions-plugin/server/mocks'; -import { AlertingAuthorization } from '../../../../authorization/alerting_authorization'; -import { ActionsAuthorization } from '@kbn/actions-plugin/server'; +import type { AlertingAuthorization } from '../../../../authorization/alerting_authorization'; +import type { ActionsAuthorization } from '@kbn/actions-plugin/server'; import { auditLoggerMock } from '@kbn/security-plugin/server/audit/mocks'; import { getBeforeSetup } from '../../../../rules_client/tests/lib'; import { bulkMarkApiKeysForInvalidation } from '../../../../invalidate_pending_api_keys/bulk_mark_api_keys_for_invalidation'; diff --git a/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/delete/delete_rule.ts b/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/delete/delete_rule.ts index dd3aaf5e82f78..2e92665f5fb2f 100644 --- a/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/delete/delete_rule.ts +++ b/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/delete/delete_rule.ts @@ -7,15 +7,15 @@ import Boom from '@hapi/boom'; import { AlertConsumers } from '@kbn/rule-data-utils'; -import { RawRule } from '../../../../types'; +import type { RawRule } from '../../../../types'; import { WriteOperations, AlertingAuthorizationEntity } from '../../../../authorization'; import { retryIfConflicts } from '../../../../lib/retry_if_conflicts'; import { bulkMarkApiKeysForInvalidation } from '../../../../invalidate_pending_api_keys/bulk_mark_api_keys_for_invalidation'; import { ruleAuditEvent, RuleAuditAction } from '../../../../rules_client/common/audit_events'; -import { RulesClientContext } from '../../../../rules_client/types'; +import type { RulesClientContext } from '../../../../rules_client/types'; import { untrackRuleAlerts, migrateLegacyActions } from '../../../../rules_client/lib'; import { RULE_SAVED_OBJECT_TYPE } from '../../../../saved_objects'; -import { DeleteRuleParams } from './types'; +import type { DeleteRuleParams } from './types'; import { deleteRuleParamsSchema } from './schemas'; import { deleteRuleSo, getDecryptedRuleSo, getRuleSo } from '../../../../data/rule'; diff --git a/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/delete/types/delete_rule_params.ts b/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/delete/types/delete_rule_params.ts index 69d54b9387f72..d2da0885db088 100644 --- a/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/delete/types/delete_rule_params.ts +++ b/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/delete/types/delete_rule_params.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { TypeOf } from '@kbn/config-schema'; -import { deleteRuleParamsSchema } from '../schemas'; +import type { TypeOf } from '@kbn/config-schema'; +import type { deleteRuleParamsSchema } from '../schemas'; export type DeleteRuleParams = TypeOf; diff --git a/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/disable/disable_rule.test.ts b/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/disable/disable_rule.test.ts index 62608ed8271da..200032812ceb1 100644 --- a/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/disable/disable_rule.test.ts +++ b/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/disable/disable_rule.test.ts @@ -6,7 +6,8 @@ */ import { AlertConsumers } from '@kbn/rule-data-utils'; -import { RulesClient, ConstructorOptions } from '../../../../rules_client/rules_client'; +import type { ConstructorOptions } from '../../../../rules_client/rules_client'; +import { RulesClient } from '../../../../rules_client/rules_client'; import { savedObjectsClientMock, loggingSystemMock, @@ -18,8 +19,8 @@ import { ruleTypeRegistryMock } from '../../../../rule_type_registry.mock'; import { alertingAuthorizationMock } from '../../../../authorization/alerting_authorization.mock'; import { encryptedSavedObjectsMock } from '@kbn/encrypted-saved-objects-plugin/server/mocks'; import { actionsAuthorizationMock } from '@kbn/actions-plugin/server/mocks'; -import { AlertingAuthorization } from '../../../../authorization/alerting_authorization'; -import { ActionsAuthorization } from '@kbn/actions-plugin/server'; +import type { AlertingAuthorization } from '../../../../authorization/alerting_authorization'; +import type { ActionsAuthorization } from '@kbn/actions-plugin/server'; import { auditLoggerMock } from '@kbn/security-plugin/server/audit/mocks'; import { getBeforeSetup, setGlobalDate } from '../../../../rules_client/tests/lib'; import { eventLoggerMock } from '@kbn/event-log-plugin/server/event_logger.mock'; diff --git a/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/disable/disable_rule.ts b/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/disable/disable_rule.ts index f1865f123484b..03dae00237f5f 100644 --- a/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/disable/disable_rule.ts +++ b/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/disable/disable_rule.ts @@ -7,14 +7,14 @@ import type { SavedObjectReference } from '@kbn/core/server'; import Boom from '@hapi/boom'; -import { RawRule } from '../../../../types'; +import type { RawRule } from '../../../../types'; import { WriteOperations, AlertingAuthorizationEntity } from '../../../../authorization'; import { retryIfConflicts } from '../../../../lib/retry_if_conflicts'; import { ruleAuditEvent, RuleAuditAction } from '../../../../rules_client/common/audit_events'; -import { RulesClientContext } from '../../../../rules_client/types'; +import type { RulesClientContext } from '../../../../rules_client/types'; import { untrackRuleAlerts, updateMeta, migrateLegacyActions } from '../../../../rules_client/lib'; import { RULE_SAVED_OBJECT_TYPE } from '../../../../saved_objects'; -import { DisableRuleParams } from './types'; +import type { DisableRuleParams } from './types'; import { disableRuleParamsSchema } from './schemas'; export async function disableRule( diff --git a/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/disable/types/index.ts b/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/disable/types/index.ts index 19b12bc91c2e8..10902eece3be5 100644 --- a/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/disable/types/index.ts +++ b/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/disable/types/index.ts @@ -5,6 +5,6 @@ * 2.0. */ import type { TypeOf } from '@kbn/config-schema'; -import { disableRuleParamsSchema } from '../schemas'; +import type { disableRuleParamsSchema } from '../schemas'; export type DisableRuleParams = TypeOf; diff --git a/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/enable_rule/enable_rule.test.ts b/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/enable_rule/enable_rule.test.ts index fd4536db38946..90f1bdef9155f 100644 --- a/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/enable_rule/enable_rule.test.ts +++ b/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/enable_rule/enable_rule.test.ts @@ -6,7 +6,8 @@ */ import { AlertConsumers } from '@kbn/rule-data-utils'; -import { RulesClient, ConstructorOptions } from '../../../../rules_client/rules_client'; +import type { ConstructorOptions } from '../../../../rules_client/rules_client'; +import { RulesClient } from '../../../../rules_client/rules_client'; import { savedObjectsClientMock, loggingSystemMock, @@ -18,8 +19,8 @@ import { ruleTypeRegistryMock } from '../../../../rule_type_registry.mock'; import { alertingAuthorizationMock } from '../../../../authorization/alerting_authorization.mock'; import { encryptedSavedObjectsMock } from '@kbn/encrypted-saved-objects-plugin/server/mocks'; import { actionsAuthorizationMock } from '@kbn/actions-plugin/server/mocks'; -import { AlertingAuthorization } from '../../../../authorization/alerting_authorization'; -import { ActionsAuthorization } from '@kbn/actions-plugin/server'; +import type { AlertingAuthorization } from '../../../../authorization/alerting_authorization'; +import type { ActionsAuthorization } from '@kbn/actions-plugin/server'; import { TaskStatus } from '@kbn/task-manager-plugin/server'; import { auditLoggerMock } from '@kbn/security-plugin/server/audit/mocks'; import { getBeforeSetup, setGlobalDate } from '../../../../rules_client/tests/lib'; diff --git a/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/enable_rule/enable_rule.ts b/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/enable_rule/enable_rule.ts index d4c2e91787aef..4daafd6cf53d6 100644 --- a/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/enable_rule/enable_rule.ts +++ b/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/enable_rule/enable_rule.ts @@ -7,12 +7,12 @@ import Boom from '@hapi/boom'; import type { SavedObjectReference } from '@kbn/core/server'; import { TaskStatus } from '@kbn/task-manager-plugin/server'; -import { RawRule, IntervalSchedule } from '../../../../types'; +import type { RawRule, IntervalSchedule } from '../../../../types'; import { resetMonitoringLastRun, getNextRun } from '../../../../lib'; import { WriteOperations, AlertingAuthorizationEntity } from '../../../../authorization'; import { retryIfConflicts } from '../../../../lib/retry_if_conflicts'; import { ruleAuditEvent, RuleAuditAction } from '../../../../rules_client/common/audit_events'; -import { RulesClientContext } from '../../../../rules_client/types'; +import type { RulesClientContext } from '../../../../rules_client/types'; import { updateMeta, createNewAPIKeySet, @@ -22,7 +22,7 @@ import { import { validateScheduleLimit } from '../get_schedule_frequency'; import { getRuleCircuitBreakerErrorMessage } from '../../../../../common'; import { RULE_SAVED_OBJECT_TYPE } from '../../../../saved_objects'; -import { EnableRuleParams } from './types'; +import type { EnableRuleParams } from './types'; import { enableRuleParamsSchema } from './schemas'; export async function enableRule( diff --git a/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/enable_rule/types/enable_rule_types.ts b/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/enable_rule/types/enable_rule_types.ts index d1291a05307a1..a54f785438ca6 100644 --- a/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/enable_rule/types/enable_rule_types.ts +++ b/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/enable_rule/types/enable_rule_types.ts @@ -6,6 +6,6 @@ */ import type { TypeOf } from '@kbn/config-schema'; -import { enableRuleParamsSchema } from '../schemas'; +import type { enableRuleParamsSchema } from '../schemas'; export type EnableRuleParams = TypeOf; diff --git a/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/fill_gap_by_id/fill_gap_by_id.test.ts b/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/fill_gap_by_id/fill_gap_by_id.test.ts index e31980f691037..64e8e238e9f1e 100644 --- a/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/fill_gap_by_id/fill_gap_by_id.test.ts +++ b/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/fill_gap_by_id/fill_gap_by_id.test.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { ActionsAuthorization } from '@kbn/actions-plugin/server'; +import type { ActionsAuthorization } from '@kbn/actions-plugin/server'; import { actionsAuthorizationMock } from '@kbn/actions-plugin/server/mocks'; import { loggingSystemMock } from '@kbn/core-logging-server-mocks'; import { @@ -18,16 +18,14 @@ import { eventLoggerMock } from '@kbn/event-log-plugin/server/event_logger.mock' import { eventLogClientMock } from '@kbn/event-log-plugin/server/event_log_client.mock'; import { auditLoggerMock } from '@kbn/security-plugin/server/audit/mocks'; import { taskManagerMock } from '@kbn/task-manager-plugin/server/mocks'; -import { - AlertingAuthorization, - WriteOperations, - AlertingAuthorizationEntity, -} from '../../../../authorization'; +import type { AlertingAuthorization } from '../../../../authorization'; +import { WriteOperations, AlertingAuthorizationEntity } from '../../../../authorization'; import { alertingAuthorizationMock } from '../../../../authorization/alerting_authorization.mock'; import { backfillClientMock } from '../../../../backfill_client/backfill_client.mock'; import { ruleTypeRegistryMock } from '../../../../rule_type_registry.mock'; import { ConnectorAdapterRegistry } from '../../../../connector_adapters/connector_adapter_registry'; -import { ConstructorOptions, RulesClient } from '../../../../rules_client'; +import type { ConstructorOptions } from '../../../../rules_client'; +import { RulesClient } from '../../../../rules_client'; import { findGapsById } from '../../../../lib/rule_gaps/find_gaps_by_id'; import { scheduleBackfill } from '../../../backfill/methods/schedule'; import { getRule } from '../get/get_rule'; diff --git a/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/fill_gap_by_id/fill_gap_by_id.ts b/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/fill_gap_by_id/fill_gap_by_id.ts index 8e51fdc5683b6..ba53d9bcece6e 100644 --- a/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/fill_gap_by_id/fill_gap_by_id.ts +++ b/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/fill_gap_by_id/fill_gap_by_id.ts @@ -8,14 +8,14 @@ import Boom from '@hapi/boom'; import { AlertingAuthorizationEntity, WriteOperations } from '../../../../authorization'; -import { RulesClientContext } from '../../../../rules_client'; +import type { RulesClientContext } from '../../../../rules_client'; import { findGapsById } from '../../../../lib/rule_gaps/find_gaps_by_id'; -import { FillGapByIdParams } from './types'; +import type { FillGapByIdParams } from './types'; import { scheduleBackfill } from '../../../backfill/methods/schedule'; import { ruleAuditEvent, RuleAuditAction } from '../../../../rules_client/common/audit_events'; import { getRule } from '../get/get_rule'; -import { SanitizedRuleWithLegacyId } from '../../../../types'; +import type { SanitizedRuleWithLegacyId } from '../../../../types'; import { RULE_SAVED_OBJECT_TYPE } from '../../../../saved_objects'; export async function fillGapById(context: RulesClientContext, params: FillGapByIdParams) { diff --git a/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/fill_gap_by_id/types/fill_gap_by_id.ts b/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/fill_gap_by_id/types/fill_gap_by_id.ts index cbb7b3c380f2d..edda94608ad93 100644 --- a/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/fill_gap_by_id/types/fill_gap_by_id.ts +++ b/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/fill_gap_by_id/types/fill_gap_by_id.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { TypeOf } from '@kbn/config-schema'; -import { fillGapByIdParamsSchema } from '../schemas'; +import type { TypeOf } from '@kbn/config-schema'; +import type { fillGapByIdParamsSchema } from '../schemas'; export type FillGapByIdParams = TypeOf; diff --git a/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/find/find_rules.test.ts b/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/find/find_rules.test.ts index 369549d839c79..b1c3dce42bae5 100644 --- a/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/find/find_rules.test.ts +++ b/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/find/find_rules.test.ts @@ -5,7 +5,8 @@ * 2.0. */ -import { RulesClient, ConstructorOptions } from '../../../../rules_client/rules_client'; +import type { ConstructorOptions } from '../../../../rules_client/rules_client'; +import { RulesClient } from '../../../../rules_client/rules_client'; import { savedObjectsClientMock, loggingSystemMock, @@ -18,12 +19,12 @@ import { alertingAuthorizationMock } from '../../../../authorization/alerting_au import { nodeTypes, fromKueryExpression, toKqlExpression } from '@kbn/es-query'; import { encryptedSavedObjectsMock } from '@kbn/encrypted-saved-objects-plugin/server/mocks'; import { actionsAuthorizationMock } from '@kbn/actions-plugin/server/mocks'; -import { AlertingAuthorization } from '../../../../authorization/alerting_authorization'; -import { ActionsAuthorization } from '@kbn/actions-plugin/server'; +import type { AlertingAuthorization } from '../../../../authorization/alerting_authorization'; +import type { ActionsAuthorization } from '@kbn/actions-plugin/server'; import { auditLoggerMock } from '@kbn/security-plugin/server/audit/mocks'; import { getBeforeSetup, setGlobalDate } from '../../../../rules_client/tests/lib'; import { RecoveredActionGroup } from '../../../../../common'; -import { RegistryRuleType } from '../../../../rule_type_registry'; +import type { RegistryRuleType } from '../../../../rule_type_registry'; import { schema } from '@kbn/config-schema'; import { enabledRule1, diff --git a/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/find/find_rules.ts b/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/find/find_rules.ts index 26441a4474473..8dc20a84014d6 100644 --- a/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/find/find_rules.ts +++ b/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/find/find_rules.ts @@ -7,7 +7,7 @@ import Boom from '@hapi/boom'; import { pick } from 'lodash'; -import { KueryNode } from '@kbn/es-query'; +import type { KueryNode } from '@kbn/es-query'; import { AlertConsumers } from '@kbn/rule-data-utils'; import { buildConsumersFilter, @@ -16,7 +16,7 @@ import { combineFilters, } from '../../../../rules_client/common/filters'; import { AlertingAuthorizationEntity } from '../../../../authorization/types'; -import { SanitizedRule, Rule as DeprecatedRule, RawRule } from '../../../../types'; +import type { SanitizedRule, Rule as DeprecatedRule, RawRule } from '../../../../types'; import { ruleAuditEvent, RuleAuditAction } from '../../../../rules_client/common/audit_events'; import { mapSortField, @@ -36,7 +36,7 @@ import { formatLegacyActions, getAlertFromRaw } from '../../../../rules_client/l import { RULE_SAVED_OBJECT_TYPE } from '../../../../saved_objects'; import type { FindRulesParams } from './types'; import { findRulesParamsSchema } from './schemas'; -import { Rule, RuleParams } from '../../types'; +import type { Rule, RuleParams } from '../../types'; import { findRulesSo } from '../../../../data/rule'; export interface FindResult { diff --git a/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/find/types/find_rules_types.ts b/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/find/types/find_rules_types.ts index 77694f150c5a9..467d99c122293 100644 --- a/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/find/types/find_rules_types.ts +++ b/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/find/types/find_rules_types.ts @@ -5,8 +5,8 @@ * 2.0. */ -import { TypeOf } from '@kbn/config-schema'; -import { findRulesOptionsSchema, findRulesParamsSchema } from '../schemas'; +import type { TypeOf } from '@kbn/config-schema'; +import type { findRulesOptionsSchema, findRulesParamsSchema } from '../schemas'; export type FindRulesOptions = TypeOf; export type FindRulesParams = TypeOf; diff --git a/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/find_gaps/find_gaps.test.ts b/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/find_gaps/find_gaps.test.ts index 5916a7a9ef96c..1a0917e6c80a9 100644 --- a/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/find_gaps/find_gaps.test.ts +++ b/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/find_gaps/find_gaps.test.ts @@ -5,9 +5,9 @@ * 2.0. */ -import { ActionsAuthorization } from '@kbn/actions-plugin/server'; +import type { ActionsAuthorization } from '@kbn/actions-plugin/server'; import { actionsAuthorizationMock } from '@kbn/actions-plugin/server/mocks'; -import { AlertingAuthorization } from '../../../../authorization'; +import type { AlertingAuthorization } from '../../../../authorization'; import { alertingAuthorizationMock } from '../../../../authorization/alerting_authorization.mock'; import { ruleTypeRegistryMock } from '../../../../rule_type_registry.mock'; import { loggingSystemMock } from '@kbn/core-logging-server-mocks'; @@ -23,7 +23,8 @@ import { encryptedSavedObjectsMock } from '@kbn/encrypted-saved-objects-plugin/s import { uiSettingsServiceMock } from '@kbn/core-ui-settings-server-mocks'; import { backfillClientMock } from '../../../../backfill_client/backfill_client.mock'; import { ConnectorAdapterRegistry } from '../../../../connector_adapters/connector_adapter_registry'; -import { ConstructorOptions, RulesClient } from '../../../../rules_client'; +import type { ConstructorOptions } from '../../../../rules_client'; +import { RulesClient } from '../../../../rules_client'; import { RULE_SAVED_OBJECT_TYPE } from '../../../../saved_objects'; import { ReadOperations, AlertingAuthorizationEntity } from '../../../../authorization'; import { getRule } from '../get/get_rule'; diff --git a/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/find_gaps/find_gaps.ts b/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/find_gaps/find_gaps.ts index 801b054577404..3338f87a8a7cb 100644 --- a/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/find_gaps/find_gaps.ts +++ b/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/find_gaps/find_gaps.ts @@ -9,11 +9,11 @@ import Boom from '@hapi/boom'; import { ReadOperations, AlertingAuthorizationEntity } from '../../../../authorization'; -import { RulesClientContext } from '../../../../rules_client'; +import type { RulesClientContext } from '../../../../rules_client'; import { findGaps as _findGaps } from '../../../../lib/rule_gaps/find_gaps'; -import { FindGapsParams } from '../../../../lib/rule_gaps/types'; +import type { FindGapsParams } from '../../../../lib/rule_gaps/types'; import { getRule } from '../get/get_rule'; -import { SanitizedRuleWithLegacyId } from '../../../../types'; +import type { SanitizedRuleWithLegacyId } from '../../../../types'; import { ruleAuditEvent, RuleAuditAction } from '../../../../rules_client/common/audit_events'; import { RULE_SAVED_OBJECT_TYPE } from '../../../../saved_objects'; diff --git a/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/get/get_rule.test.ts b/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/get/get_rule.test.ts index 6c51b7e25f288..91f8fefad14eb 100644 --- a/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/get/get_rule.test.ts +++ b/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/get/get_rule.test.ts @@ -6,7 +6,8 @@ */ import { AlertConsumers } from '@kbn/rule-data-utils'; -import { RulesClient, ConstructorOptions } from '../../../../rules_client/rules_client'; +import type { ConstructorOptions } from '../../../../rules_client/rules_client'; +import { RulesClient } from '../../../../rules_client/rules_client'; import { savedObjectsClientMock, loggingSystemMock, @@ -18,8 +19,8 @@ import { ruleTypeRegistryMock } from '../../../../rule_type_registry.mock'; import { alertingAuthorizationMock } from '../../../../authorization/alerting_authorization.mock'; import { encryptedSavedObjectsMock } from '@kbn/encrypted-saved-objects-plugin/server/mocks'; import { actionsAuthorizationMock } from '@kbn/actions-plugin/server/mocks'; -import { AlertingAuthorization } from '../../../../authorization/alerting_authorization'; -import { ActionsAuthorization } from '@kbn/actions-plugin/server'; +import type { AlertingAuthorization } from '../../../../authorization/alerting_authorization'; +import type { ActionsAuthorization } from '@kbn/actions-plugin/server'; import { auditLoggerMock } from '@kbn/security-plugin/server/audit/mocks'; import { getBeforeSetup, setGlobalDate } from '../../../../rules_client/tests/lib'; import { RecoveredActionGroup } from '../../../../../common'; diff --git a/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/get/get_rule.ts b/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/get/get_rule.ts index 548e25fad87c6..cd7868b9243d7 100644 --- a/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/get/get_rule.ts +++ b/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/get/get_rule.ts @@ -7,21 +7,21 @@ import Boom from '@hapi/boom'; import { AlertConsumers } from '@kbn/rule-data-utils'; -import { +import type { SanitizedRule, SanitizedRuleWithLegacyId, Rule as DeprecatedRule, } from '../../../../types'; import { ReadOperations, AlertingAuthorizationEntity } from '../../../../authorization'; import { ruleAuditEvent, RuleAuditAction } from '../../../../rules_client/common/audit_events'; -import { RulesClientContext } from '../../../../rules_client/types'; +import type { RulesClientContext } from '../../../../rules_client/types'; import { formatLegacyActions } from '../../../../rules_client/lib'; import { RULE_SAVED_OBJECT_TYPE } from '../../../../saved_objects'; -import { GetRuleParams } from './types'; +import type { GetRuleParams } from './types'; import { getRuleParamsSchema } from './schemas'; import { getRuleSo } from '../../../../data/rule'; import { transformRuleAttributesToRuleDomain, transformRuleDomainToRule } from '../../transforms'; -import { RuleParams } from '../../types'; +import type { RuleParams } from '../../types'; import { ruleDomainSchema } from '../../schemas'; export async function getRule( diff --git a/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/get/types/get_rule_params.ts b/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/get/types/get_rule_params.ts index 63f6724829f28..8c6b3ee785c44 100644 --- a/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/get/types/get_rule_params.ts +++ b/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/get/types/get_rule_params.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { TypeOf } from '@kbn/config-schema'; -import { getRuleParamsSchema } from '../schemas'; +import type { TypeOf } from '@kbn/config-schema'; +import type { getRuleParamsSchema } from '../schemas'; export type GetRuleParams = TypeOf; diff --git a/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/get_gaps_summary_by_rule_ids/get_gaps_summary_by_rule_ids.test.ts b/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/get_gaps_summary_by_rule_ids/get_gaps_summary_by_rule_ids.test.ts index 3f4c88c4dd6f7..e3bc4b8c0998e 100644 --- a/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/get_gaps_summary_by_rule_ids/get_gaps_summary_by_rule_ids.test.ts +++ b/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/get_gaps_summary_by_rule_ids/get_gaps_summary_by_rule_ids.test.ts @@ -5,9 +5,9 @@ * 2.0. */ -import { ActionsAuthorization } from '@kbn/actions-plugin/server'; +import type { ActionsAuthorization } from '@kbn/actions-plugin/server'; import { actionsAuthorizationMock } from '@kbn/actions-plugin/server/mocks'; -import { AlertingAuthorization } from '../../../../authorization'; +import type { AlertingAuthorization } from '../../../../authorization'; import { alertingAuthorizationMock } from '../../../../authorization/alerting_authorization.mock'; import { ruleTypeRegistryMock } from '../../../../rule_type_registry.mock'; import { loggingSystemMock } from '@kbn/core-logging-server-mocks'; @@ -24,7 +24,8 @@ import { encryptedSavedObjectsMock } from '@kbn/encrypted-saved-objects-plugin/s import { uiSettingsServiceMock } from '@kbn/core-ui-settings-server-mocks'; import { backfillClientMock } from '../../../../backfill_client/backfill_client.mock'; import { ConnectorAdapterRegistry } from '../../../../connector_adapters/connector_adapter_registry'; -import { ConstructorOptions, RulesClient } from '../../../../rules_client'; +import type { ConstructorOptions } from '../../../../rules_client'; +import { RulesClient } from '../../../../rules_client'; const kibanaVersion = 'v8.0.0'; const taskManager = taskManagerMock.createStart(); diff --git a/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/get_gaps_summary_by_rule_ids/get_gaps_summary_by_rule_ids.ts b/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/get_gaps_summary_by_rule_ids/get_gaps_summary_by_rule_ids.ts index 4c69f3f74426e..eb116a1182569 100644 --- a/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/get_gaps_summary_by_rule_ids/get_gaps_summary_by_rule_ids.ts +++ b/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/get_gaps_summary_by_rule_ids/get_gaps_summary_by_rule_ids.ts @@ -6,10 +6,11 @@ */ import pMap from 'p-map'; import Boom from '@hapi/boom'; -import { KueryNode, nodeBuilder } from '@kbn/es-query'; +import type { KueryNode } from '@kbn/es-query'; +import { nodeBuilder } from '@kbn/es-query'; import { AlertingAuthorizationEntity, ReadOperations } from '../../../../authorization'; -import { RuleBulkOperationAggregation, RulesClientContext } from '../../../../rules_client'; -import { GetGapsSummaryByRuleIdsParams, GetGapsSummaryByRuleIdsResponse } from './types'; +import type { RuleBulkOperationAggregation, RulesClientContext } from '../../../../rules_client'; +import type { GetGapsSummaryByRuleIdsParams, GetGapsSummaryByRuleIdsResponse } from './types'; import { ruleAuditEvent, RuleAuditAction } from '../../../../rules_client/common/audit_events'; export const RULE_SAVED_OBJECT_TYPE = 'alert'; import { convertRuleIdsToKueryNode } from '../../../../lib'; diff --git a/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/get_gaps_summary_by_rule_ids/types/get_gaps_summary_by_rule_ids.ts b/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/get_gaps_summary_by_rule_ids/types/get_gaps_summary_by_rule_ids.ts index a82cad3cdaaee..6fb2fd0821c27 100644 --- a/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/get_gaps_summary_by_rule_ids/types/get_gaps_summary_by_rule_ids.ts +++ b/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/get_gaps_summary_by_rule_ids/types/get_gaps_summary_by_rule_ids.ts @@ -5,8 +5,8 @@ * 2.0. */ -import { TypeOf } from '@kbn/config-schema'; -import { +import type { TypeOf } from '@kbn/config-schema'; +import type { getGapsSummaryByRuleIdsParamsSchema, getGapsSummaryByRuleIdsResponseSchema, } from '../schemas'; diff --git a/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/get_rule_ids_with_gaps/get_rule_ids_with_gaps.test.ts b/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/get_rule_ids_with_gaps/get_rule_ids_with_gaps.test.ts index 84ba407349372..4eb7ca4e9663e 100644 --- a/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/get_rule_ids_with_gaps/get_rule_ids_with_gaps.test.ts +++ b/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/get_rule_ids_with_gaps/get_rule_ids_with_gaps.test.ts @@ -5,9 +5,9 @@ * 2.0. */ -import { ActionsAuthorization } from '@kbn/actions-plugin/server'; +import type { ActionsAuthorization } from '@kbn/actions-plugin/server'; import { actionsAuthorizationMock } from '@kbn/actions-plugin/server/mocks'; -import { AlertingAuthorization } from '../../../../authorization'; +import type { AlertingAuthorization } from '../../../../authorization'; import { alertingAuthorizationMock } from '../../../../authorization/alerting_authorization.mock'; import { ruleTypeRegistryMock } from '../../../../rule_type_registry.mock'; import { loggingSystemMock } from '@kbn/core-logging-server-mocks'; @@ -23,7 +23,8 @@ import { encryptedSavedObjectsMock } from '@kbn/encrypted-saved-objects-plugin/s import { uiSettingsServiceMock } from '@kbn/core-ui-settings-server-mocks'; import { backfillClientMock } from '../../../../backfill_client/backfill_client.mock'; import { ConnectorAdapterRegistry } from '../../../../connector_adapters/connector_adapter_registry'; -import { ConstructorOptions, RulesClient } from '../../../../rules_client'; +import type { ConstructorOptions } from '../../../../rules_client'; +import { RulesClient } from '../../../../rules_client'; import { RULE_SAVED_OBJECT_TYPE } from '../../../../saved_objects'; describe('getRuleIdsWithGaps', () => { diff --git a/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/get_rule_ids_with_gaps/get_rule_ids_with_gaps.ts b/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/get_rule_ids_with_gaps/get_rule_ids_with_gaps.ts index 6fb5194e7d24a..e77b5ec306b51 100644 --- a/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/get_rule_ids_with_gaps/get_rule_ids_with_gaps.ts +++ b/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/get_rule_ids_with_gaps/get_rule_ids_with_gaps.ts @@ -6,13 +6,13 @@ */ import Boom from '@hapi/boom'; -import { KueryNode } from '@kbn/es-query'; +import type { KueryNode } from '@kbn/es-query'; import { AlertingAuthorizationEntity, AlertingAuthorizationFilterType, } from '../../../../authorization'; -import { RulesClientContext } from '../../../../rules_client'; -import { GetRuleIdsWithGapsParams, GetRuleIdsWithGapsResponse } from './types'; +import type { RulesClientContext } from '../../../../rules_client'; +import type { GetRuleIdsWithGapsParams, GetRuleIdsWithGapsResponse } from './types'; import { ruleAuditEvent, RuleAuditAction } from '../../../../rules_client/common/audit_events'; import { buildGapsFilter } from '../../../../lib/rule_gaps/build_gaps_filter'; export const RULE_SAVED_OBJECT_TYPE = 'alert'; diff --git a/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/get_rule_ids_with_gaps/types/get_rules_with_gaps.ts b/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/get_rule_ids_with_gaps/types/get_rules_with_gaps.ts index 16a9a7c753bcb..a847859f096bb 100644 --- a/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/get_rule_ids_with_gaps/types/get_rules_with_gaps.ts +++ b/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/get_rule_ids_with_gaps/types/get_rules_with_gaps.ts @@ -5,8 +5,8 @@ * 2.0. */ -import { TypeOf } from '@kbn/config-schema'; -import { getRuleIdsWithGapsParamsSchema, getRuleIdsWithGapsResponseSchema } from '../schemas'; +import type { TypeOf } from '@kbn/config-schema'; +import type { getRuleIdsWithGapsParamsSchema, getRuleIdsWithGapsResponseSchema } from '../schemas'; export type GetRuleIdsWithGapsParams = TypeOf; export type GetRuleIdsWithGapsResponse = TypeOf; diff --git a/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/get_schedule_frequency/get_schedule_frequency.test.ts b/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/get_schedule_frequency/get_schedule_frequency.test.ts index f7f8e069e9822..7cf8554419934 100644 --- a/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/get_schedule_frequency/get_schedule_frequency.test.ts +++ b/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/get_schedule_frequency/get_schedule_frequency.test.ts @@ -6,7 +6,8 @@ */ import { validateScheduleLimit } from './get_schedule_frequency'; -import { RulesClient, ConstructorOptions } from '../../../../rules_client'; +import type { ConstructorOptions } from '../../../../rules_client'; +import { RulesClient } from '../../../../rules_client'; import { savedObjectsClientMock, loggingSystemMock, @@ -18,8 +19,8 @@ import { ruleTypeRegistryMock } from '../../../../rule_type_registry.mock'; import { alertingAuthorizationMock } from '../../../../authorization/alerting_authorization.mock'; import { encryptedSavedObjectsMock } from '@kbn/encrypted-saved-objects-plugin/server/mocks'; import { actionsAuthorizationMock } from '@kbn/actions-plugin/server/mocks'; -import { AlertingAuthorization } from '../../../../authorization/alerting_authorization'; -import { ActionsAuthorization } from '@kbn/actions-plugin/server'; +import type { AlertingAuthorization } from '../../../../authorization/alerting_authorization'; +import type { ActionsAuthorization } from '@kbn/actions-plugin/server'; import { auditLoggerMock } from '@kbn/security-plugin/server/audit/mocks'; import { backfillClientMock } from '../../../../backfill_client/backfill_client.mock'; import { ConnectorAdapterRegistry } from '../../../../connector_adapters/connector_adapter_registry'; diff --git a/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/get_schedule_frequency/get_schedule_frequency.ts b/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/get_schedule_frequency/get_schedule_frequency.ts index d30d172113248..b0e6d7ee50fcf 100644 --- a/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/get_schedule_frequency/get_schedule_frequency.ts +++ b/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/get_schedule_frequency/get_schedule_frequency.ts @@ -5,10 +5,10 @@ * 2.0. */ import { RULE_SAVED_OBJECT_TYPE } from '../../../../saved_objects'; -import { RulesClientContext } from '../../../../rules_client/types'; -import { RuleDomain } from '../../types'; +import type { RulesClientContext } from '../../../../rules_client/types'; +import type { RuleDomain } from '../../types'; import { convertDurationToFrequency } from '../../../../../common/parse_duration'; -import { GetScheduleFrequencyResult } from './types'; +import type { GetScheduleFrequencyResult } from './types'; import { getSchemaFrequencyResultSchema } from './schema'; export interface SchedulesIntervalAggregationResult { diff --git a/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/get_schedule_frequency/types/get_schedule_frequency_result.ts b/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/get_schedule_frequency/types/get_schedule_frequency_result.ts index 4f53ea2e82810..d485889da3209 100644 --- a/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/get_schedule_frequency/types/get_schedule_frequency_result.ts +++ b/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/get_schedule_frequency/types/get_schedule_frequency_result.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { TypeOf } from '@kbn/config-schema'; -import { getSchemaFrequencyResultSchema } from '../schema'; +import type { TypeOf } from '@kbn/config-schema'; +import type { getSchemaFrequencyResultSchema } from '../schema'; export type GetScheduleFrequencyResult = TypeOf; diff --git a/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/mute_alert/mute_instance.ts b/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/mute_alert/mute_instance.ts index 62283bf6e111a..72dde6e74fb7a 100644 --- a/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/mute_alert/mute_instance.ts +++ b/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/mute_alert/mute_instance.ts @@ -10,11 +10,11 @@ import { RULE_SAVED_OBJECT_TYPE } from '../../../../saved_objects'; import { updateRuleSo } from '../../../../data/rule/methods/update_rule_so'; import { muteAlertParamsSchema } from './schemas'; import type { MuteAlertParams } from './types'; -import { Rule } from '../../../../types'; +import type { Rule } from '../../../../types'; import { WriteOperations, AlertingAuthorizationEntity } from '../../../../authorization'; import { retryIfConflicts } from '../../../../lib/retry_if_conflicts'; import { ruleAuditEvent, RuleAuditAction } from '../../../../rules_client/common/audit_events'; -import { RulesClientContext } from '../../../../rules_client/types'; +import type { RulesClientContext } from '../../../../rules_client/types'; import { updateMeta } from '../../../../rules_client/lib'; export async function muteInstance( diff --git a/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/mute_alert/types/mute_alert_params.ts b/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/mute_alert/types/mute_alert_params.ts index f94f454f1f78c..9138b451cbbcb 100644 --- a/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/mute_alert/types/mute_alert_params.ts +++ b/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/mute_alert/types/mute_alert_params.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { TypeOf } from '@kbn/config-schema'; -import { muteAlertParamsSchema } from '../schemas'; +import type { TypeOf } from '@kbn/config-schema'; +import type { muteAlertParamsSchema } from '../schemas'; export type MuteAlertParams = TypeOf; diff --git a/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/mute_all/mute_all.test.ts b/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/mute_all/mute_all.test.ts index eba9fc4cbf7d4..176eb54540c00 100644 --- a/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/mute_all/mute_all.test.ts +++ b/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/mute_all/mute_all.test.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { RulesClientContext } from '../../../../rules_client'; +import type { RulesClientContext } from '../../../../rules_client'; import { muteAll } from './mute_all'; import { savedObjectsRepositoryMock } from '@kbn/core-saved-objects-api-server-mocks'; diff --git a/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/mute_all/mute_all.ts b/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/mute_all/mute_all.ts index d0d2c186ba126..a9b92699acec8 100644 --- a/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/mute_all/mute_all.ts +++ b/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/mute_all/mute_all.ts @@ -6,15 +6,15 @@ */ import Boom from '@hapi/boom'; -import { RawRule } from '../../../../types'; +import type { RawRule } from '../../../../types'; import { WriteOperations, AlertingAuthorizationEntity } from '../../../../authorization'; import { retryIfConflicts } from '../../../../lib/retry_if_conflicts'; import { partiallyUpdateRule, RULE_SAVED_OBJECT_TYPE } from '../../../../saved_objects'; import { ruleAuditEvent, RuleAuditAction } from '../../../../rules_client/common/audit_events'; -import { RulesClientContext } from '../../../../rules_client/types'; +import type { RulesClientContext } from '../../../../rules_client/types'; import { updateMetaAttributes } from '../../../../rules_client/lib'; import { clearUnscheduledSnoozeAttributes } from '../../../../rules_client/common'; -import { MuteAllRuleParams } from './types'; +import type { MuteAllRuleParams } from './types'; import { muteAllRuleParamsSchema } from './schemas'; export async function muteAll( diff --git a/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/mute_all/types/mute_all_rule_types.ts b/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/mute_all/types/mute_all_rule_types.ts index 4f4ad36dbc23a..7187951e441f8 100644 --- a/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/mute_all/types/mute_all_rule_types.ts +++ b/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/mute_all/types/mute_all_rule_types.ts @@ -6,6 +6,6 @@ */ import type { TypeOf } from '@kbn/config-schema'; -import { muteAllRuleParamsSchema } from '../schemas'; +import type { muteAllRuleParamsSchema } from '../schemas'; export type MuteAllRuleParams = TypeOf; diff --git a/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/resolve/resolve.test.ts b/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/resolve/resolve.test.ts index d1706a890c8e8..d8e38dc6b5f5c 100644 --- a/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/resolve/resolve.test.ts +++ b/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/resolve/resolve.test.ts @@ -5,7 +5,8 @@ * 2.0. */ -import { ConstructorOptions, RulesClient } from '../../../../rules_client/rules_client'; +import type { ConstructorOptions } from '../../../../rules_client/rules_client'; +import { RulesClient } from '../../../../rules_client/rules_client'; import { savedObjectsClientMock, loggingSystemMock, @@ -17,8 +18,8 @@ import { ruleTypeRegistryMock } from '../../../../rule_type_registry.mock'; import { alertingAuthorizationMock } from '../../../../authorization/alerting_authorization.mock'; import { encryptedSavedObjectsMock } from '@kbn/encrypted-saved-objects-plugin/server/mocks'; import { actionsAuthorizationMock } from '@kbn/actions-plugin/server/mocks'; -import { AlertingAuthorization } from '../../../../authorization/alerting_authorization'; -import { ActionsAuthorization } from '@kbn/actions-plugin/server'; +import type { AlertingAuthorization } from '../../../../authorization/alerting_authorization'; +import type { ActionsAuthorization } from '@kbn/actions-plugin/server'; import { auditLoggerMock } from '@kbn/security-plugin/server/audit/mocks'; import { ConnectorAdapterRegistry } from '../../../../connector_adapters/connector_adapter_registry'; import { RULE_SAVED_OBJECT_TYPE } from '../../../../saved_objects'; diff --git a/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/resolve/resolve_rule.ts b/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/resolve/resolve_rule.ts index fd9ae07d7ebd2..78b0a3177e72f 100644 --- a/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/resolve/resolve_rule.ts +++ b/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/resolve/resolve_rule.ts @@ -10,12 +10,12 @@ import { AlertConsumers } from '@kbn/rule-data-utils'; import { RULE_SAVED_OBJECT_TYPE } from '../../../../saved_objects'; import { resolveRuleSavedObject } from '../../../../rules_client/lib'; import { ruleAuditEvent, RuleAuditAction } from '../../../../rules_client/common/audit_events'; -import { RuleTypeParams } from '../../../../types'; +import type { RuleTypeParams } from '../../../../types'; import { ReadOperations, AlertingAuthorizationEntity } from '../../../../authorization'; -import { RulesClientContext } from '../../../../rules_client/types'; +import type { RulesClientContext } from '../../../../rules_client/types'; import { formatLegacyActions } from '../../../../rules_client/lib'; import { transformRuleAttributesToRuleDomain, transformRuleDomainToRule } from '../../transforms'; -import { Rule } from '../../types'; +import type { Rule } from '../../types'; import { ruleSchema } from '../../schemas'; import { resolveRuleParamsSchema } from './schemas'; import type { ResolvedSanitizedRule } from '../../../../types'; diff --git a/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/rule_types/rule_types.ts b/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/rule_types/rule_types.ts index 4bcb6fdece3e2..a93e6e7bfeae8 100644 --- a/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/rule_types/rule_types.ts +++ b/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/rule_types/rule_types.ts @@ -5,13 +5,13 @@ * 2.0. */ +import type { RegistryAlertTypeWithAuth } from '../../../../authorization'; import { AlertingAuthorizationEntity, ReadOperations, - RegistryAlertTypeWithAuth, WriteOperations, } from '../../../../authorization'; -import { RulesClientContext } from '../../../../rules_client/types'; +import type { RulesClientContext } from '../../../../rules_client/types'; export async function listRuleTypes( context: RulesClientContext diff --git a/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/snooze/snooze_rule.test.ts b/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/snooze/snooze_rule.test.ts index 9e86aeab24fc4..4fc76dd5db95e 100644 --- a/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/snooze/snooze_rule.test.ts +++ b/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/snooze/snooze_rule.test.ts @@ -5,10 +5,10 @@ * 2.0. */ -import { RulesClientContext } from '../../../../rules_client'; +import type { RulesClientContext } from '../../../../rules_client'; import { snoozeRule } from './snooze_rule'; import { savedObjectsRepositoryMock } from '@kbn/core-saved-objects-api-server-mocks'; -import { SnoozeRuleOptions } from './types'; +import type { SnoozeRuleOptions } from './types'; const loggerErrorMock = jest.fn(); const getBulkMock = jest.fn(); diff --git a/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/snooze/snooze_rule.ts b/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/snooze/snooze_rule.ts index 7d8634e4be006..96ef28be0e0cc 100644 --- a/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/snooze/snooze_rule.ts +++ b/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/snooze/snooze_rule.ts @@ -15,7 +15,7 @@ import { WriteOperations, AlertingAuthorizationEntity } from '../../../../author import { retryIfConflicts } from '../../../../lib/retry_if_conflicts'; import { validateSnoozeStartDate } from '../../../../lib/validate_snooze_date'; import { RuleMutedError } from '../../../../lib/errors/rule_muted'; -import { RulesClientContext } from '../../../../rules_client/types'; +import type { RulesClientContext } from '../../../../rules_client/types'; import { getSnoozeAttributes, verifySnoozeAttributeScheduleLimit, diff --git a/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/snooze/types/snooze_rule_options.ts b/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/snooze/types/snooze_rule_options.ts index 77d077b6ee0e5..805b42bb82432 100644 --- a/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/snooze/types/snooze_rule_options.ts +++ b/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/snooze/types/snooze_rule_options.ts @@ -4,8 +4,8 @@ * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ -import { TypeOf } from '@kbn/config-schema'; -import { ruleSnoozeScheduleSchema as ruleSnoozeScheduleRequestSchema } from '../../../../../../common/routes/rule/request'; +import type { TypeOf } from '@kbn/config-schema'; +import type { ruleSnoozeScheduleSchema as ruleSnoozeScheduleRequestSchema } from '../../../../../../common/routes/rule/request'; export interface SnoozeRuleOptions { id: string; diff --git a/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/tags/get_rule_tags.test.ts b/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/tags/get_rule_tags.test.ts index a62b4177328c6..e939be2e7f95f 100644 --- a/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/tags/get_rule_tags.test.ts +++ b/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/tags/get_rule_tags.test.ts @@ -5,7 +5,8 @@ * 2.0. */ import { v4 } from 'uuid'; -import { RulesClient, ConstructorOptions } from '../../../../rules_client/rules_client'; +import type { ConstructorOptions } from '../../../../rules_client/rules_client'; +import { RulesClient } from '../../../../rules_client/rules_client'; import { savedObjectsClientMock, loggingSystemMock, @@ -17,12 +18,12 @@ import { ruleTypeRegistryMock } from '../../../../rule_type_registry.mock'; import { alertingAuthorizationMock } from '../../../../authorization/alerting_authorization.mock'; import { encryptedSavedObjectsMock } from '@kbn/encrypted-saved-objects-plugin/server/mocks'; import { actionsAuthorizationMock } from '@kbn/actions-plugin/server/mocks'; -import { AlertingAuthorization } from '../../../../authorization/alerting_authorization'; -import { ActionsAuthorization } from '@kbn/actions-plugin/server'; +import type { AlertingAuthorization } from '../../../../authorization/alerting_authorization'; +import type { ActionsAuthorization } from '@kbn/actions-plugin/server'; import { auditLoggerMock } from '@kbn/security-plugin/server/audit/mocks'; import { getBeforeSetup } from '../../../../rules_client/tests/lib'; import { RecoveredActionGroup } from '../../../../../common'; -import { RegistryRuleType } from '../../../../rule_type_registry'; +import type { RegistryRuleType } from '../../../../rule_type_registry'; import { ConnectorAdapterRegistry } from '../../../../connector_adapters/connector_adapter_registry'; import { RULE_SAVED_OBJECT_TYPE } from '../../../../saved_objects'; import { backfillClientMock } from '../../../../backfill_client/backfill_client.mock'; diff --git a/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/tags/get_rule_tags.ts b/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/tags/get_rule_tags.ts index 41c49f5f96b1d..e0dba6eb393f7 100644 --- a/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/tags/get_rule_tags.ts +++ b/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/tags/get_rule_tags.ts @@ -5,17 +5,19 @@ * 2.0. */ import Boom from '@hapi/boom'; -import { KueryNode, nodeBuilder, nodeTypes } from '@kbn/es-query'; +import type { KueryNode } from '@kbn/es-query'; +import { nodeBuilder, nodeTypes } from '@kbn/es-query'; import { buildRuleTypeIdsFilter, combineFilters, combineFilterWithAuthorizationFilter, } from '../../../../rules_client/common/filters'; import { findRulesSo } from '../../../../data/rule/methods/find_rules_so'; -import { ruleTagsParamsSchema, RuleTagsParams, RuleTagsAggregationResult } from '.'; +import type { RuleTagsParams, RuleTagsAggregationResult } from '.'; +import { ruleTagsParamsSchema } from '.'; import type { RuleTagsFormattedResponse } from '../../../../../common/routes/rule/apis/tags'; import { DEFAULT_TAGS_PER_PAGE } from '../../../../../common/routes/rule/apis/tags/constants/latest'; -import { RulesClientContext } from '../../../../rules_client/types'; +import type { RulesClientContext } from '../../../../rules_client/types'; import { AlertingAuthorizationEntity } from '../../../../authorization'; import { alertingAuthorizationFilterOpts } from '../../../../rules_client/common/constants'; import { ruleAuditEvent, RuleAuditAction } from '../../../../rules_client/common/audit_events'; diff --git a/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/tags/types/rule_tags_aggregation_result.ts b/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/tags/types/rule_tags_aggregation_result.ts index 4dabbc9393ea2..c90a123821c9a 100644 --- a/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/tags/types/rule_tags_aggregation_result.ts +++ b/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/tags/types/rule_tags_aggregation_result.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { TypeOf } from '@kbn/config-schema'; -import { ruleTagsAggregationResultSchema } from '../schemas'; +import type { TypeOf } from '@kbn/config-schema'; +import type { ruleTagsAggregationResultSchema } from '../schemas'; export type RuleTagsAggregationResult = TypeOf; diff --git a/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/tags/types/rule_tags_params.ts b/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/tags/types/rule_tags_params.ts index c5142616ed56b..436875dc67761 100644 --- a/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/tags/types/rule_tags_params.ts +++ b/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/tags/types/rule_tags_params.ts @@ -4,7 +4,7 @@ * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ -import { TypeOf } from '@kbn/config-schema'; -import { ruleTagsParamsSchema } from '../schemas'; +import type { TypeOf } from '@kbn/config-schema'; +import type { ruleTagsParamsSchema } from '../schemas'; export type RuleTagsParams = TypeOf; diff --git a/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/unmute_alert/types/unmute_alert_params.ts b/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/unmute_alert/types/unmute_alert_params.ts index ae83c5b6d4b7e..26ebd723458c0 100644 --- a/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/unmute_alert/types/unmute_alert_params.ts +++ b/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/unmute_alert/types/unmute_alert_params.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { TypeOf } from '@kbn/config-schema'; -import { unmuteAlertParamsSchema } from '../schemas'; +import type { TypeOf } from '@kbn/config-schema'; +import type { unmuteAlertParamsSchema } from '../schemas'; export type UnmuteAlertParams = TypeOf; diff --git a/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/unmute_alert/unmute_instance.test.ts b/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/unmute_alert/unmute_instance.test.ts index 31d0e997b7ffe..3f041799f248b 100644 --- a/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/unmute_alert/unmute_instance.test.ts +++ b/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/unmute_alert/unmute_instance.test.ts @@ -5,7 +5,8 @@ * 2.0. */ -import { RulesClient, ConstructorOptions } from '../../../../rules_client/rules_client'; +import type { ConstructorOptions } from '../../../../rules_client/rules_client'; +import { RulesClient } from '../../../../rules_client/rules_client'; import { savedObjectsClientMock, loggingSystemMock, @@ -17,8 +18,8 @@ import { ruleTypeRegistryMock } from '../../../../rule_type_registry.mock'; import { alertingAuthorizationMock } from '../../../../authorization/alerting_authorization.mock'; import { encryptedSavedObjectsMock } from '@kbn/encrypted-saved-objects-plugin/server/mocks'; import { actionsAuthorizationMock } from '@kbn/actions-plugin/server/mocks'; -import { AlertingAuthorization } from '../../../../authorization/alerting_authorization'; -import { ActionsAuthorization } from '@kbn/actions-plugin/server'; +import type { AlertingAuthorization } from '../../../../authorization/alerting_authorization'; +import type { ActionsAuthorization } from '@kbn/actions-plugin/server'; import { auditLoggerMock } from '@kbn/security-plugin/server/audit/mocks'; import { getBeforeSetup, setGlobalDate } from '../../../../rules_client/tests/lib'; import { ConnectorAdapterRegistry } from '../../../../connector_adapters/connector_adapter_registry'; diff --git a/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/unmute_all/types/unmute_all_rule_types.ts b/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/unmute_all/types/unmute_all_rule_types.ts index 3e82d8901dc01..dd4a662619fba 100644 --- a/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/unmute_all/types/unmute_all_rule_types.ts +++ b/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/unmute_all/types/unmute_all_rule_types.ts @@ -6,6 +6,6 @@ */ import type { TypeOf } from '@kbn/config-schema'; -import { unmuteAllRuleParamsSchema } from '../schemas'; +import type { unmuteAllRuleParamsSchema } from '../schemas'; export type UnmuteAllRuleParams = TypeOf; diff --git a/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/unmute_all/unmute_all.test.ts b/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/unmute_all/unmute_all.test.ts index 531b157a66899..fb48e80ef26e5 100644 --- a/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/unmute_all/unmute_all.test.ts +++ b/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/unmute_all/unmute_all.test.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { RulesClientContext } from '../../../../rules_client'; +import type { RulesClientContext } from '../../../../rules_client'; import { unmuteAll } from './unmute_all'; import { savedObjectsRepositoryMock } from '@kbn/core-saved-objects-api-server-mocks'; diff --git a/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/unmute_all/unmute_all.ts b/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/unmute_all/unmute_all.ts index bc70f7206fbb4..556a2614c77f5 100644 --- a/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/unmute_all/unmute_all.ts +++ b/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/unmute_all/unmute_all.ts @@ -6,15 +6,15 @@ */ import Boom from '@hapi/boom'; -import { RawRule } from '../../../../types'; +import type { RawRule } from '../../../../types'; import { WriteOperations, AlertingAuthorizationEntity } from '../../../../authorization'; import { retryIfConflicts } from '../../../../lib/retry_if_conflicts'; import { partiallyUpdateRule, RULE_SAVED_OBJECT_TYPE } from '../../../../saved_objects'; import { ruleAuditEvent, RuleAuditAction } from '../../../../rules_client/common/audit_events'; -import { RulesClientContext } from '../../../../rules_client/types'; +import type { RulesClientContext } from '../../../../rules_client/types'; import { updateMetaAttributes } from '../../../../rules_client/lib'; import { clearUnscheduledSnoozeAttributes } from '../../../../rules_client/common'; -import { UnmuteAllRuleParams } from './types'; +import type { UnmuteAllRuleParams } from './types'; import { unmuteAllRuleParamsSchema } from './schemas'; export async function unmuteAll( diff --git a/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/unsnooze/unsnooze_rule.ts b/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/unsnooze/unsnooze_rule.ts index 13a9a96b53ad4..e1e1ae723d97c 100644 --- a/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/unsnooze/unsnooze_rule.ts +++ b/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/unsnooze/unsnooze_rule.ts @@ -12,7 +12,7 @@ import { ruleAuditEvent, RuleAuditAction } from '../../../../rules_client/common import { getRuleSavedObject } from '../../../../rules_client/lib'; import { WriteOperations, AlertingAuthorizationEntity } from '../../../../authorization'; import { retryIfConflicts } from '../../../../lib/retry_if_conflicts'; -import { RulesClientContext } from '../../../../rules_client/types'; +import type { RulesClientContext } from '../../../../rules_client/types'; import { getUnsnoozeAttributes } from '../../../../rules_client/common'; import { updateRuleSo } from '../../../../data/rule'; import { updateMetaAttributes } from '../../../../rules_client/lib/update_meta_attributes'; diff --git a/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/update/types/update_rule_data.ts b/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/update/types/update_rule_data.ts index cfde60b91c1f3..34ae35ac4c0f9 100644 --- a/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/update/types/update_rule_data.ts +++ b/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/update/types/update_rule_data.ts @@ -5,9 +5,9 @@ * 2.0. */ -import { TypeOf } from '@kbn/config-schema'; -import { updateRuleDataSchema } from '../schemas'; -import { RuleParams } from '../../../types'; +import type { TypeOf } from '@kbn/config-schema'; +import type { updateRuleDataSchema } from '../schemas'; +import type { RuleParams } from '../../../types'; type UpdateRuleDataType = TypeOf; diff --git a/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/update/update_rule.test.ts b/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/update/update_rule.test.ts index 7def9349c94a0..55d46a7a13945 100644 --- a/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/update/update_rule.test.ts +++ b/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/update/update_rule.test.ts @@ -8,7 +8,8 @@ import { v4 as uuidv4 } from 'uuid'; import { schema } from '@kbn/config-schema'; import { AlertConsumers } from '@kbn/rule-data-utils'; -import { RulesClient, ConstructorOptions } from '../../../../rules_client/rules_client'; +import type { ConstructorOptions } from '../../../../rules_client/rules_client'; +import { RulesClient } from '../../../../rules_client/rules_client'; import { savedObjectsClientMock, loggingSystemMock, @@ -18,12 +19,13 @@ import { import { taskManagerMock } from '@kbn/task-manager-plugin/server/mocks'; import { ruleTypeRegistryMock } from '../../../../rule_type_registry.mock'; import { alertingAuthorizationMock } from '../../../../authorization/alerting_authorization.mock'; -import { IntervalSchedule, RuleNotifyWhen } from '../../../../types'; +import type { IntervalSchedule } from '../../../../types'; +import { RuleNotifyWhen } from '../../../../types'; import { RecoveredActionGroup } from '../../../../../common'; import { encryptedSavedObjectsMock } from '@kbn/encrypted-saved-objects-plugin/server/mocks'; import { actionsAuthorizationMock } from '@kbn/actions-plugin/server/mocks'; -import { AlertingAuthorization } from '../../../../authorization/alerting_authorization'; -import { ActionsAuthorization, ActionsClient } from '@kbn/actions-plugin/server'; +import type { AlertingAuthorization } from '../../../../authorization/alerting_authorization'; +import type { ActionsAuthorization, ActionsClient } from '@kbn/actions-plugin/server'; import { TaskStatus } from '@kbn/task-manager-plugin/server'; import { auditLoggerMock } from '@kbn/security-plugin/server/audit/mocks'; import { getBeforeSetup, setGlobalDate } from '../../../../rules_client/tests/lib'; @@ -31,7 +33,7 @@ import { bulkMarkApiKeysForInvalidation } from '../../../../invalidate_pending_a import { migrateLegacyActions } from '../../../../rules_client/lib'; import { RULE_SAVED_OBJECT_TYPE } from '../../../../saved_objects'; import { ConnectorAdapterRegistry } from '../../../../connector_adapters/connector_adapter_registry'; -import { RuleDomain } from '../../types'; +import type { RuleDomain } from '../../types'; import { backfillClientMock } from '../../../../backfill_client/backfill_client.mock'; jest.mock('../../../../rules_client/lib/siem_legacy_actions/migrate_legacy_actions', () => { diff --git a/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/update/update_rule.ts b/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/update/update_rule.ts index 25759e8e06c70..8cd814f155ddb 100644 --- a/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/update/update_rule.ts +++ b/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/update/update_rule.ts @@ -7,8 +7,8 @@ import Boom from '@hapi/boom'; import { isEqual, omit } from 'lodash'; -import { SavedObject } from '@kbn/core/server'; -import { SanitizedRule, RawRule } from '../../../../types'; +import type { SavedObject } from '@kbn/core/server'; +import type { SanitizedRule, RawRule } from '../../../../types'; import { validateRuleTypeParams, getRuleNotifyWhenType } from '../../../../lib'; import { validateAndAuthorizeSystemActions } from '../../../../lib/validate_authorize_system_actions'; import { WriteOperations, AlertingAuthorizationEntity } from '../../../../authorization'; @@ -17,7 +17,7 @@ import { getMappedParams } from '../../../../rules_client/common/mapped_params_u import { retryIfConflicts } from '../../../../lib/retry_if_conflicts'; import { bulkMarkApiKeysForInvalidation } from '../../../../invalidate_pending_api_keys/bulk_mark_api_keys_for_invalidation'; import { ruleAuditEvent, RuleAuditAction } from '../../../../rules_client/common/audit_events'; -import { +import type { RulesClientContext, NormalizedAlertActionWithGeneratedValues, } from '../../../../rules_client/types'; @@ -30,11 +30,12 @@ import { migrateLegacyActions, updateMetaAttributes, } from '../../../../rules_client/lib'; -import { RuleParams } from '../../types'; +import type { RuleParams } from '../../types'; import type { UpdateRuleData } from './types'; import { createRuleSo, getDecryptedRuleSo, getRuleSo } from '../../../../data/rule'; -import { validateScheduleLimit, ValidateScheduleLimitResult } from '../get_schedule_frequency'; +import type { ValidateScheduleLimitResult } from '../get_schedule_frequency'; +import { validateScheduleLimit } from '../get_schedule_frequency'; import { RULE_SAVED_OBJECT_TYPE } from '../../../../saved_objects'; import { updateRuleDataSchema } from './schemas'; import { transformRuleAttributesToRuleDomain, transformRuleDomainToRule } from '../../transforms'; diff --git a/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/update_api_key/types/update_rule_api_key_types.ts b/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/update_api_key/types/update_rule_api_key_types.ts index 07dffdc3124b8..5b09282ae4dce 100644 --- a/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/update_api_key/types/update_rule_api_key_types.ts +++ b/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/update_api_key/types/update_rule_api_key_types.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { TypeOf } from '@kbn/config-schema'; -import { updateApiKeyParamsSchema } from '../schemas'; +import type { TypeOf } from '@kbn/config-schema'; +import type { updateApiKeyParamsSchema } from '../schemas'; export type UpdateApiKeyParams = TypeOf; diff --git a/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/update_api_key/update_rule_api_key.test.ts b/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/update_api_key/update_rule_api_key.test.ts index 003bae5da67bc..a486ae5bbabe4 100644 --- a/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/update_api_key/update_rule_api_key.test.ts +++ b/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/update_api_key/update_rule_api_key.test.ts @@ -5,7 +5,8 @@ * 2.0. */ -import { RulesClient, ConstructorOptions } from '../../../../rules_client/rules_client'; +import type { ConstructorOptions } from '../../../../rules_client/rules_client'; +import { RulesClient } from '../../../../rules_client/rules_client'; import { savedObjectsClientMock, loggingSystemMock, @@ -17,8 +18,8 @@ import { ruleTypeRegistryMock } from '../../../../rule_type_registry.mock'; import { alertingAuthorizationMock } from '../../../../authorization/alerting_authorization.mock'; import { encryptedSavedObjectsMock } from '@kbn/encrypted-saved-objects-plugin/server/mocks'; import { actionsAuthorizationMock } from '@kbn/actions-plugin/server/mocks'; -import { AlertingAuthorization } from '../../../../authorization/alerting_authorization'; -import { ActionsAuthorization } from '@kbn/actions-plugin/server'; +import type { AlertingAuthorization } from '../../../../authorization/alerting_authorization'; +import type { ActionsAuthorization } from '@kbn/actions-plugin/server'; import { auditLoggerMock } from '@kbn/security-plugin/server/audit/mocks'; import { getBeforeSetup, setGlobalDate } from '../../../../rules_client/tests/lib'; import { bulkMarkApiKeysForInvalidation } from '../../../../invalidate_pending_api_keys/bulk_mark_api_keys_for_invalidation'; diff --git a/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/update_api_key/update_rule_api_key.ts b/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/update_api_key/update_rule_api_key.ts index 955109c05bde7..7f37583019ada 100644 --- a/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/update_api_key/update_rule_api_key.ts +++ b/x-pack/platform/plugins/shared/alerting/server/application/rule/methods/update_api_key/update_rule_api_key.ts @@ -6,15 +6,15 @@ */ import Boom from '@hapi/boom'; -import { RawRule } from '../../../../types'; +import type { RawRule } from '../../../../types'; import { WriteOperations, AlertingAuthorizationEntity } from '../../../../authorization'; import { retryIfConflicts } from '../../../../lib/retry_if_conflicts'; import { bulkMarkApiKeysForInvalidation } from '../../../../invalidate_pending_api_keys/bulk_mark_api_keys_for_invalidation'; import { ruleAuditEvent, RuleAuditAction } from '../../../../rules_client/common/audit_events'; import { createNewAPIKeySet, updateMeta } from '../../../../rules_client/lib'; -import { RulesClientContext } from '../../../../rules_client/types'; +import type { RulesClientContext } from '../../../../rules_client/types'; import { RULE_SAVED_OBJECT_TYPE } from '../../../../saved_objects'; -import { UpdateApiKeyParams } from './types'; +import type { UpdateApiKeyParams } from './types'; import { updateApiKeyParamsSchema } from './schemas'; export async function updateRuleApiKey( diff --git a/x-pack/platform/plugins/shared/alerting/server/application/rule/transforms/transform_raw_actions_to_domain_actions.test.ts b/x-pack/platform/plugins/shared/alerting/server/application/rule/transforms/transform_raw_actions_to_domain_actions.test.ts index 7b25ebf45ce8d..5e091d330dd0a 100644 --- a/x-pack/platform/plugins/shared/alerting/server/application/rule/transforms/transform_raw_actions_to_domain_actions.test.ts +++ b/x-pack/platform/plugins/shared/alerting/server/application/rule/transforms/transform_raw_actions_to_domain_actions.test.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { RawRuleAction } from '../../../types'; +import type { RawRuleAction } from '../../../types'; import { transformRawActionsToDomainActions, transformRawActionsToDomainSystemActions, diff --git a/x-pack/platform/plugins/shared/alerting/server/application/rule/transforms/transform_raw_actions_to_domain_actions.ts b/x-pack/platform/plugins/shared/alerting/server/application/rule/transforms/transform_raw_actions_to_domain_actions.ts index 7242f4bb1c716..9cde36d1c5583 100644 --- a/x-pack/platform/plugins/shared/alerting/server/application/rule/transforms/transform_raw_actions_to_domain_actions.ts +++ b/x-pack/platform/plugins/shared/alerting/server/application/rule/transforms/transform_raw_actions_to_domain_actions.ts @@ -6,10 +6,10 @@ */ import { omit } from 'lodash'; -import { SavedObjectReference } from '@kbn/core/server'; +import type { SavedObjectReference } from '@kbn/core/server'; import { injectReferencesIntoActions } from '../../../rules_client/common'; -import { RawRule } from '../../../types'; -import { RuleDomain } from '../types'; +import type { RawRule } from '../../../types'; +import type { RuleDomain } from '../types'; interface Args { ruleId: string; diff --git a/x-pack/platform/plugins/shared/alerting/server/application/rule/transforms/transform_rule_attributes_to_rule_domain.test.ts b/x-pack/platform/plugins/shared/alerting/server/application/rule/transforms/transform_rule_attributes_to_rule_domain.test.ts index a96fbcceaffba..f9da684baa9e8 100644 --- a/x-pack/platform/plugins/shared/alerting/server/application/rule/transforms/transform_rule_attributes_to_rule_domain.test.ts +++ b/x-pack/platform/plugins/shared/alerting/server/application/rule/transforms/transform_rule_attributes_to_rule_domain.test.ts @@ -8,8 +8,8 @@ import { RecoveredActionGroup } from '../../../../common'; import { loggingSystemMock } from '@kbn/core-logging-server-mocks'; import { transformRuleAttributesToRuleDomain } from './transform_rule_attributes_to_rule_domain'; -import { UntypedNormalizedRuleType } from '../../../rule_type_registry'; -import { RawRuleAction } from '../../../types'; +import type { UntypedNormalizedRuleType } from '../../../rule_type_registry'; +import type { RawRuleAction } from '../../../types'; const ruleType: jest.Mocked = { id: 'test.rule-type', diff --git a/x-pack/platform/plugins/shared/alerting/server/application/rule/transforms/transform_rule_attributes_to_rule_domain.ts b/x-pack/platform/plugins/shared/alerting/server/application/rule/transforms/transform_rule_attributes_to_rule_domain.ts index 5489143792f1b..afb0e76bc8526 100644 --- a/x-pack/platform/plugins/shared/alerting/server/application/rule/transforms/transform_rule_attributes_to_rule_domain.ts +++ b/x-pack/platform/plugins/shared/alerting/server/application/rule/transforms/transform_rule_attributes_to_rule_domain.ts @@ -5,13 +5,13 @@ * 2.0. */ import { isEmpty } from 'lodash'; -import { Logger } from '@kbn/core/server'; -import { SavedObjectReference } from '@kbn/core/server'; +import type { Logger } from '@kbn/core/server'; +import type { SavedObjectReference } from '@kbn/core/server'; import { ruleExecutionStatusValues } from '../constants'; import { getRuleSnoozeEndTime } from '../../../lib'; -import { RuleDomain, Monitoring, RuleParams } from '../types'; -import { PartialRule, RawRule, RawRuleExecutionStatus, SanitizedRule } from '../../../types'; -import { UntypedNormalizedRuleType } from '../../../rule_type_registry'; +import type { RuleDomain, Monitoring, RuleParams } from '../types'; +import type { PartialRule, RawRule, RawRuleExecutionStatus, SanitizedRule } from '../../../types'; +import type { UntypedNormalizedRuleType } from '../../../rule_type_registry'; import { injectReferencesIntoParams } from '../../../rules_client/common'; import { getActiveScheduledSnoozes } from '../../../lib/is_rule_snoozed'; import { diff --git a/x-pack/platform/plugins/shared/alerting/server/application/rule/transforms/transform_rule_domain_to_rule.test.ts b/x-pack/platform/plugins/shared/alerting/server/application/rule/transforms/transform_rule_domain_to_rule.test.ts index dba50d17612ad..e80b526cca349 100644 --- a/x-pack/platform/plugins/shared/alerting/server/application/rule/transforms/transform_rule_domain_to_rule.test.ts +++ b/x-pack/platform/plugins/shared/alerting/server/application/rule/transforms/transform_rule_domain_to_rule.test.ts @@ -6,7 +6,7 @@ */ import { transformRuleDomainToRule } from './transform_rule_domain_to_rule'; -import { RuleDomain } from '../types'; +import type { RuleDomain } from '../types'; describe('transformRuleDomainToRule', () => { const MOCK_API_KEY = Buffer.from('123:abc').toString('base64'); diff --git a/x-pack/platform/plugins/shared/alerting/server/application/rule/transforms/transform_rule_domain_to_rule.ts b/x-pack/platform/plugins/shared/alerting/server/application/rule/transforms/transform_rule_domain_to_rule.ts index db9f63a5d0338..3373052d67b2e 100644 --- a/x-pack/platform/plugins/shared/alerting/server/application/rule/transforms/transform_rule_domain_to_rule.ts +++ b/x-pack/platform/plugins/shared/alerting/server/application/rule/transforms/transform_rule_domain_to_rule.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { RuleDomain, Rule, RuleParams } from '../types'; +import type { RuleDomain, Rule, RuleParams } from '../types'; interface TransformRuleDomainToRuleOptions { isPublic?: boolean; diff --git a/x-pack/platform/plugins/shared/alerting/server/application/rule/transforms/transform_rule_domain_to_rule_attributes.test.ts b/x-pack/platform/plugins/shared/alerting/server/application/rule/transforms/transform_rule_domain_to_rule_attributes.test.ts index 73c39532b9ab9..52246dde4f647 100644 --- a/x-pack/platform/plugins/shared/alerting/server/application/rule/transforms/transform_rule_domain_to_rule_attributes.test.ts +++ b/x-pack/platform/plugins/shared/alerting/server/application/rule/transforms/transform_rule_domain_to_rule_attributes.test.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { RuleDomain } from '../types'; +import type { RuleDomain } from '../types'; import { transformRuleDomainToRuleAttributes } from './transform_rule_domain_to_rule_attributes'; describe('transformRuleDomainToRuleAttributes', () => { diff --git a/x-pack/platform/plugins/shared/alerting/server/application/rule/transforms/transform_rule_domain_to_rule_attributes.ts b/x-pack/platform/plugins/shared/alerting/server/application/rule/transforms/transform_rule_domain_to_rule_attributes.ts index f3769f48e8110..07f6d1c50deaa 100644 --- a/x-pack/platform/plugins/shared/alerting/server/application/rule/transforms/transform_rule_domain_to_rule_attributes.ts +++ b/x-pack/platform/plugins/shared/alerting/server/application/rule/transforms/transform_rule_domain_to_rule_attributes.ts @@ -4,10 +4,10 @@ * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ -import { RawRule } from '../../../types'; -import { RuleDomain } from '../types'; +import type { RawRule } from '../../../types'; +import type { RuleDomain } from '../types'; import { getMappedParams } from '../../../rules_client/common'; -import { DenormalizedAction } from '../../../rules_client'; +import type { DenormalizedAction } from '../../../rules_client'; interface TransformRuleToEsParams { legacyId: RawRule['legacyId']; diff --git a/x-pack/platform/plugins/shared/alerting/server/application/rule/types/action.ts b/x-pack/platform/plugins/shared/alerting/server/application/rule/types/action.ts index 559b708dd9038..979c8b21916eb 100644 --- a/x-pack/platform/plugins/shared/alerting/server/application/rule/types/action.ts +++ b/x-pack/platform/plugins/shared/alerting/server/application/rule/types/action.ts @@ -5,8 +5,8 @@ * 2.0. */ -import { TypeOf } from '@kbn/config-schema'; -import { +import type { TypeOf } from '@kbn/config-schema'; +import type { actionSchema, actionRequestSchema, systemActionSchema, diff --git a/x-pack/platform/plugins/shared/alerting/server/application/rule/types/rule.ts b/x-pack/platform/plugins/shared/alerting/server/application/rule/types/rule.ts index 2e5cad45cf92f..103b397caefb5 100644 --- a/x-pack/platform/plugins/shared/alerting/server/application/rule/types/rule.ts +++ b/x-pack/platform/plugins/shared/alerting/server/application/rule/types/rule.ts @@ -5,16 +5,16 @@ * 2.0. */ -import { TypeOf } from '@kbn/config-schema'; -import { ruleParamsSchema } from '@kbn/response-ops-rule-params'; -import { +import type { TypeOf } from '@kbn/config-schema'; +import type { ruleParamsSchema } from '@kbn/response-ops-rule-params'; +import type { ruleNotifyWhen, ruleLastRunOutcomeValues, ruleExecutionStatusValues, ruleExecutionStatusErrorReason, ruleExecutionStatusWarningReason, } from '../constants'; -import { +import type { snoozeScheduleSchema, ruleExecutionStatusSchema, ruleLastRunSchema, diff --git a/x-pack/platform/plugins/shared/alerting/server/authorization/alerting_authorization.mock.ts b/x-pack/platform/plugins/shared/alerting/server/authorization/alerting_authorization.mock.ts index 12e360c7cd644..29fcde62e3e46 100644 --- a/x-pack/platform/plugins/shared/alerting/server/authorization/alerting_authorization.mock.ts +++ b/x-pack/platform/plugins/shared/alerting/server/authorization/alerting_authorization.mock.ts @@ -6,7 +6,7 @@ */ import type { PublicMethodsOf } from '@kbn/utility-types'; -import { AlertingAuthorization } from './alerting_authorization'; +import type { AlertingAuthorization } from './alerting_authorization'; type Schema = PublicMethodsOf; export type AlertingAuthorizationMock = jest.Mocked; diff --git a/x-pack/platform/plugins/shared/alerting/server/authorization/alerting_authorization.test.ts b/x-pack/platform/plugins/shared/alerting/server/authorization/alerting_authorization.test.ts index 9c470823362d8..995673849bee9 100644 --- a/x-pack/platform/plugins/shared/alerting/server/authorization/alerting_authorization.test.ts +++ b/x-pack/platform/plugins/shared/alerting/server/authorization/alerting_authorization.test.ts @@ -6,8 +6,9 @@ */ import Boom from '@hapi/boom'; -import { KueryNode, toKqlExpression } from '@kbn/es-query'; -import { KibanaRequest } from '@kbn/core/server'; +import type { KueryNode } from '@kbn/es-query'; +import { toKqlExpression } from '@kbn/es-query'; +import type { KibanaRequest } from '@kbn/core/server'; import { ruleTypeRegistryMock } from '../rule_type_registry.mock'; import { securityMock } from '@kbn/security-plugin/server/mocks'; import { KibanaFeature } from '@kbn/features-plugin/server'; @@ -15,10 +16,10 @@ import { featuresPluginMock } from '@kbn/features-plugin/server/mocks'; import { AlertingAuthorization } from './alerting_authorization'; import { AlertingAuthorizationFilterType } from './alerting_authorization_kuery'; import { httpServerMock } from '@kbn/core-http-server-mocks'; -import { CheckPrivilegesResponse } from '@kbn/security-plugin-types-server'; +import type { CheckPrivilegesResponse } from '@kbn/security-plugin-types-server'; import type { FeaturesPluginStart } from '@kbn/features-plugin/server'; import { WriteOperations, AlertingAuthorizationEntity, ReadOperations } from './types'; -import { AlertingKibanaPrivilege } from '@kbn/features-plugin/common/alerting_kibana_privilege'; +import type { AlertingKibanaPrivilege } from '@kbn/features-plugin/common/alerting_kibana_privilege'; const mockAuthorizationAction = ( ruleType: string, diff --git a/x-pack/platform/plugins/shared/alerting/server/authorization/alerting_authorization.ts b/x-pack/platform/plugins/shared/alerting/server/authorization/alerting_authorization.ts index a7e36590d2217..8b06e23220548 100644 --- a/x-pack/platform/plugins/shared/alerting/server/authorization/alerting_authorization.ts +++ b/x-pack/platform/plugins/shared/alerting/server/authorization/alerting_authorization.ts @@ -6,20 +6,18 @@ */ import Boom from '@hapi/boom'; -import { KibanaRequest } from '@kbn/core/server'; -import { JsonObject } from '@kbn/utility-types'; -import { KueryNode } from '@kbn/es-query'; -import { SecurityPluginStart } from '@kbn/security-plugin/server'; -import { FeaturesPluginStart } from '@kbn/features-plugin/server'; -import { Space } from '@kbn/spaces-plugin/server'; -import { RegistryRuleType } from '../rule_type_registry'; -import { RuleTypeRegistry } from '../types'; -import { - asFiltersByRuleTypeAndConsumer, - asFiltersBySpaceId, - AlertingAuthorizationFilterOpts, -} from './alerting_authorization_kuery'; -import { ReadOperations, WriteOperations, AlertingAuthorizationEntity } from './types'; +import type { KibanaRequest } from '@kbn/core/server'; +import type { JsonObject } from '@kbn/utility-types'; +import type { KueryNode } from '@kbn/es-query'; +import type { SecurityPluginStart } from '@kbn/security-plugin/server'; +import type { FeaturesPluginStart } from '@kbn/features-plugin/server'; +import type { Space } from '@kbn/spaces-plugin/server'; +import type { RegistryRuleType } from '../rule_type_registry'; +import type { RuleTypeRegistry } from '../types'; +import type { AlertingAuthorizationFilterOpts } from './alerting_authorization_kuery'; +import { asFiltersByRuleTypeAndConsumer, asFiltersBySpaceId } from './alerting_authorization_kuery'; +import type { AlertingAuthorizationEntity } from './types'; +import { ReadOperations, WriteOperations } from './types'; export interface EnsureAuthorizedOpts { ruleTypeId: string; diff --git a/x-pack/platform/plugins/shared/alerting/server/authorization/alerting_authorization_kuery.test.ts b/x-pack/platform/plugins/shared/alerting/server/authorization/alerting_authorization_kuery.test.ts index bcc2b37dca7dd..d18acb1d47a4b 100644 --- a/x-pack/platform/plugins/shared/alerting/server/authorization/alerting_authorization_kuery.test.ts +++ b/x-pack/platform/plugins/shared/alerting/server/authorization/alerting_authorization_kuery.test.ts @@ -11,7 +11,8 @@ import { ensureFieldIsSafeForQuery, asFiltersBySpaceId, } from './alerting_authorization_kuery'; -import { KueryNode, toKqlExpression } from '@kbn/es-query'; +import type { KueryNode } from '@kbn/es-query'; +import { toKqlExpression } from '@kbn/es-query'; describe('asKqlFiltersByRuleTypeAndConsumer', () => { test('constructs KQL filter for single rule type with single authorized consumer', async () => { diff --git a/x-pack/platform/plugins/shared/alerting/server/authorization/alerting_authorization_kuery.ts b/x-pack/platform/plugins/shared/alerting/server/authorization/alerting_authorization_kuery.ts index 165cdcb2f819d..00e2cacde4b22 100644 --- a/x-pack/platform/plugins/shared/alerting/server/authorization/alerting_authorization_kuery.ts +++ b/x-pack/platform/plugins/shared/alerting/server/authorization/alerting_authorization_kuery.ts @@ -6,10 +6,10 @@ */ import { remove } from 'lodash'; -import { EsQueryConfig, nodeBuilder, toElasticsearchQuery, KueryNode } from '@kbn/es-query'; - -import type { estypes } from '@elastic/elasticsearch'; -import { AuthorizedRuleTypes } from './alerting_authorization'; +import type { EsQueryConfig, KueryNode } from '@kbn/es-query'; +import { nodeBuilder, toElasticsearchQuery } from '@kbn/es-query'; +import type * as estypes from '@elastic/elasticsearch/lib/api/types'; +import type { AuthorizedRuleTypes } from './alerting_authorization'; export enum AlertingAuthorizationFilterType { KQL = 'kql', diff --git a/x-pack/platform/plugins/shared/alerting/server/backfill_client/backfill_client.test.ts b/x-pack/platform/plugins/shared/alerting/server/backfill_client/backfill_client.test.ts index 0a8e5286b8a87..64756ef8accc6 100644 --- a/x-pack/platform/plugins/shared/alerting/server/backfill_client/backfill_client.test.ts +++ b/x-pack/platform/plugins/shared/alerting/server/backfill_client/backfill_client.test.ts @@ -7,21 +7,21 @@ import { adHocRunStatus } from '../../common/constants'; import { loggingSystemMock } from '@kbn/core-logging-server-mocks'; -import { SavedObject, SavedObjectsBulkResponse } from '@kbn/core/server'; +import type { SavedObject, SavedObjectsBulkResponse } from '@kbn/core/server'; import { savedObjectsClientMock, savedObjectsRepositoryMock } from '@kbn/core/server/mocks'; -import { ScheduleBackfillParam } from '../application/backfill/methods/schedule/types'; -import { RuleDomain } from '../application/rule/types'; +import type { ScheduleBackfillParam } from '../application/backfill/methods/schedule/types'; +import type { RuleDomain } from '../application/rule/types'; import { ruleTypeRegistryMock } from '../rule_type_registry.mock'; import { AD_HOC_RUN_SAVED_OBJECT_TYPE, RULE_SAVED_OBJECT_TYPE } from '../saved_objects'; import { BackfillClient } from './backfill_client'; -import { AdHocRunSO } from '../data/ad_hoc_run/types'; +import type { AdHocRunSO } from '../data/ad_hoc_run/types'; import { transformAdHocRunToBackfillResult } from '../application/backfill/transforms'; import { RecoveredActionGroup } from '@kbn/alerting-types'; import { auditLoggerMock } from '@kbn/security-plugin/server/audit/mocks'; import { taskManagerMock } from '@kbn/task-manager-plugin/server/mocks'; import { TaskRunnerFactory } from '../task_runner'; import { TaskPriority } from '@kbn/task-manager-plugin/server'; -import { UntypedNormalizedRuleType } from '../rule_type_registry'; +import type { UntypedNormalizedRuleType } from '../rule_type_registry'; import { eventLogClientMock, eventLoggerMock } from '@kbn/event-log-plugin/server/mocks'; import { updateGaps } from '../lib/rule_gaps/update/update_gaps'; @@ -29,7 +29,7 @@ jest.mock('../lib/rule_gaps/update/update_gaps', () => ({ updateGaps: jest.fn(), })); import { actionsClientMock } from '@kbn/actions-plugin/server/mocks'; -import { RawRule, RawRuleAction } from '../types'; +import type { RawRule, RawRuleAction } from '../types'; const logger = loggingSystemMock.create().get(); const taskManagerSetup = taskManagerMock.createSetup(); diff --git a/x-pack/platform/plugins/shared/alerting/server/backfill_client/backfill_client.ts b/x-pack/platform/plugins/shared/alerting/server/backfill_client/backfill_client.ts index 336dfbbd9aa33..9886761e9d2fd 100644 --- a/x-pack/platform/plugins/shared/alerting/server/backfill_client/backfill_client.ts +++ b/x-pack/platform/plugins/shared/alerting/server/backfill_client/backfill_client.ts @@ -5,48 +5,48 @@ * 2.0. */ -import { +import type { ISavedObjectsRepository, Logger, SavedObject, SavedObjectReference, SavedObjectsBulkCreateObject, SavedObjectsClientContract, - SavedObjectsErrorHelpers, SavedObjectsFindResult, } from '@kbn/core/server'; -import { AuditLogger } from '@kbn/security-plugin/server'; -import { +import { SavedObjectsErrorHelpers } from '@kbn/core/server'; +import type { AuditLogger } from '@kbn/security-plugin/server'; +import type { RunContext, TaskInstance, TaskManagerSetupContract, TaskManagerStartContract, - TaskPriority, } from '@kbn/task-manager-plugin/server'; -import { IEventLogger, IEventLogClient } from '@kbn/event-log-plugin/server'; +import { TaskPriority } from '@kbn/task-manager-plugin/server'; +import type { IEventLogger, IEventLogClient } from '@kbn/event-log-plugin/server'; import { isNumber } from 'lodash'; -import { ActionsClient } from '@kbn/actions-plugin/server'; -import { +import type { ActionsClient } from '@kbn/actions-plugin/server'; +import type { ScheduleBackfillError, ScheduleBackfillParams, ScheduleBackfillResult, ScheduleBackfillResults, } from '../application/backfill/methods/schedule/types'; -import { Backfill } from '../application/backfill/result/types'; +import type { Backfill } from '../application/backfill/result/types'; import { transformBackfillParamToAdHocRun, transformAdHocRunToBackfillResult, } from '../application/backfill/transforms'; -import { RuleDomain } from '../application/rule/types'; -import { AdHocRunSO } from '../data/ad_hoc_run/types'; +import type { RuleDomain } from '../application/rule/types'; +import type { AdHocRunSO } from '../data/ad_hoc_run/types'; import { AdHocRunAuditAction, adHocRunAuditEvent } from '../rules_client/common/audit_events'; import { AD_HOC_RUN_SAVED_OBJECT_TYPE, RULE_SAVED_OBJECT_TYPE } from '../saved_objects'; -import { TaskRunnerFactory } from '../task_runner'; -import { RuleTypeRegistry } from '../types'; +import type { TaskRunnerFactory } from '../task_runner'; +import type { RuleTypeRegistry } from '../types'; import { createBackfillError } from './lib'; import { updateGaps } from '../lib/rule_gaps/update/update_gaps'; import { denormalizeActions } from '../rules_client/lib/denormalize_actions'; -import { DenormalizedAction, NormalizedAlertActionWithGeneratedValues } from '../rules_client'; +import type { DenormalizedAction, NormalizedAlertActionWithGeneratedValues } from '../rules_client'; export const BACKFILL_TASK_TYPE = 'ad_hoc_run-backfill'; diff --git a/x-pack/platform/plugins/shared/alerting/server/backfill_client/lib/calculate_schedule.ts b/x-pack/platform/plugins/shared/alerting/server/backfill_client/lib/calculate_schedule.ts index f86738c296218..ccc681e805ed2 100644 --- a/x-pack/platform/plugins/shared/alerting/server/backfill_client/lib/calculate_schedule.ts +++ b/x-pack/platform/plugins/shared/alerting/server/backfill_client/lib/calculate_schedule.ts @@ -7,7 +7,7 @@ import { adHocRunStatus } from '../../../common/constants'; import { parseDuration } from '../../../common'; -import { AdHocRunSchedule } from '../../data/ad_hoc_run/types'; +import type { AdHocRunSchedule } from '../../data/ad_hoc_run/types'; export function calculateSchedule( start: string, diff --git a/x-pack/platform/plugins/shared/alerting/server/backfill_client/lib/create_backfill_error.ts b/x-pack/platform/plugins/shared/alerting/server/backfill_client/lib/create_backfill_error.ts index 917e9edd0e208..e08b0cebbb262 100644 --- a/x-pack/platform/plugins/shared/alerting/server/backfill_client/lib/create_backfill_error.ts +++ b/x-pack/platform/plugins/shared/alerting/server/backfill_client/lib/create_backfill_error.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { ScheduleBackfillError } from '../../application/backfill/methods/schedule/types'; +import type { ScheduleBackfillError } from '../../application/backfill/methods/schedule/types'; export function createBackfillError( message: string, diff --git a/x-pack/platform/plugins/shared/alerting/server/config.ts b/x-pack/platform/plugins/shared/alerting/server/config.ts index 776576cce2993..c030536d2dd1a 100644 --- a/x-pack/platform/plugins/shared/alerting/server/config.ts +++ b/x-pack/platform/plugins/shared/alerting/server/config.ts @@ -5,7 +5,8 @@ * 2.0. */ -import { schema, TypeOf } from '@kbn/config-schema'; +import type { TypeOf } from '@kbn/config-schema'; +import { schema } from '@kbn/config-schema'; import { validateDurationSchema, parseDuration } from './lib'; import { DEFAULT_CACHE_INTERVAL_MS } from './rules_settings'; diff --git a/x-pack/platform/plugins/shared/alerting/server/connector_adapters/connector_adapter_registry.ts b/x-pack/platform/plugins/shared/alerting/server/connector_adapters/connector_adapter_registry.ts index 4558ca5a2d3ee..9adad4a4c9273 100644 --- a/x-pack/platform/plugins/shared/alerting/server/connector_adapters/connector_adapter_registry.ts +++ b/x-pack/platform/plugins/shared/alerting/server/connector_adapters/connector_adapter_registry.ts @@ -8,7 +8,7 @@ import Boom from '@hapi/boom'; import { i18n } from '@kbn/i18n'; -import { ConnectorAdapter, ConnectorAdapterParams } from './types'; +import type { ConnectorAdapter, ConnectorAdapterParams } from './types'; export class ConnectorAdapterRegistry { private readonly connectorAdapters: Map = new Map(); diff --git a/x-pack/platform/plugins/shared/alerting/server/connector_adapters/get_system_action_kibana_privileges.ts b/x-pack/platform/plugins/shared/alerting/server/connector_adapters/get_system_action_kibana_privileges.ts index 0dd06e7776ba7..b7ffbc94f4e0f 100644 --- a/x-pack/platform/plugins/shared/alerting/server/connector_adapters/get_system_action_kibana_privileges.ts +++ b/x-pack/platform/plugins/shared/alerting/server/connector_adapters/get_system_action_kibana_privileges.ts @@ -5,8 +5,8 @@ * 2.0. */ -import { RuleSystemAction } from '../types'; -import { ConnectorAdapterRegistry } from './connector_adapter_registry'; +import type { RuleSystemAction } from '../types'; +import type { ConnectorAdapterRegistry } from './connector_adapter_registry'; interface Args { connectorAdapterRegistry: ConnectorAdapterRegistry; diff --git a/x-pack/platform/plugins/shared/alerting/server/connector_adapters/types.ts b/x-pack/platform/plugins/shared/alerting/server/connector_adapters/types.ts index e189c53cfecfe..2130f6107796d 100644 --- a/x-pack/platform/plugins/shared/alerting/server/connector_adapters/types.ts +++ b/x-pack/platform/plugins/shared/alerting/server/connector_adapters/types.ts @@ -5,9 +5,9 @@ * 2.0. */ -import { ObjectType } from '@kbn/config-schema'; +import type { ObjectType } from '@kbn/config-schema'; import type { RuleTypeParams, SanitizedRule } from '../../common'; -import { CombinedSummarizedAlerts } from '../types'; +import type { CombinedSummarizedAlerts } from '../types'; type Rule = Pick, 'id' | 'name' | 'tags' | 'consumer'> & { producer: string; diff --git a/x-pack/platform/plugins/shared/alerting/server/connector_adapters/validate_rule_action_params.ts b/x-pack/platform/plugins/shared/alerting/server/connector_adapters/validate_rule_action_params.ts index abfd56f0e9079..6cc37200002de 100644 --- a/x-pack/platform/plugins/shared/alerting/server/connector_adapters/validate_rule_action_params.ts +++ b/x-pack/platform/plugins/shared/alerting/server/connector_adapters/validate_rule_action_params.ts @@ -6,7 +6,7 @@ */ import Boom from '@hapi/boom'; -import { ConnectorAdapterRegistry } from './connector_adapter_registry'; +import type { ConnectorAdapterRegistry } from './connector_adapter_registry'; interface ValidateSchemaArgs { connectorAdapterRegistry: ConnectorAdapterRegistry; diff --git a/x-pack/platform/plugins/shared/alerting/server/data/ad_hoc_run/types/ad_hoc_run.ts b/x-pack/platform/plugins/shared/alerting/server/data/ad_hoc_run/types/ad_hoc_run.ts index ca4bbe91cd41f..8dca4e4d385df 100644 --- a/x-pack/platform/plugins/shared/alerting/server/data/ad_hoc_run/types/ad_hoc_run.ts +++ b/x-pack/platform/plugins/shared/alerting/server/data/ad_hoc_run/types/ad_hoc_run.ts @@ -5,9 +5,9 @@ * 2.0. */ -import { RawRule } from '../../../types'; -import { RuleDomain } from '../../../application/rule/types'; -import { AdHocRunStatus } from '../../../../common/constants'; +import type { RawRule } from '../../../types'; +import type { RuleDomain } from '../../../application/rule/types'; +import type { AdHocRunStatus } from '../../../../common/constants'; export interface AdHocRunSchedule extends Record { interval: string; diff --git a/x-pack/platform/plugins/shared/alerting/server/data/alerts_filter_query/types/alerts_filter_query_attributes.ts b/x-pack/platform/plugins/shared/alerting/server/data/alerts_filter_query/types/alerts_filter_query_attributes.ts index 33742f81daa77..47d98ab8df9b1 100644 --- a/x-pack/platform/plugins/shared/alerting/server/data/alerts_filter_query/types/alerts_filter_query_attributes.ts +++ b/x-pack/platform/plugins/shared/alerting/server/data/alerts_filter_query/types/alerts_filter_query_attributes.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { FilterStateStore } from '@kbn/es-query'; +import type { FilterStateStore } from '@kbn/es-query'; export interface AlertsFilterAttributes { query?: Record; diff --git a/x-pack/platform/plugins/shared/alerting/server/data/maintenance_window/methods/bulk_get_maintenance_window_so.ts b/x-pack/platform/plugins/shared/alerting/server/data/maintenance_window/methods/bulk_get_maintenance_window_so.ts index 4023948caf7ad..23c0b0c09dde6 100644 --- a/x-pack/platform/plugins/shared/alerting/server/data/maintenance_window/methods/bulk_get_maintenance_window_so.ts +++ b/x-pack/platform/plugins/shared/alerting/server/data/maintenance_window/methods/bulk_get_maintenance_window_so.ts @@ -5,8 +5,8 @@ * 2.0. */ -import { SavedObjectsClientContract, SavedObjectsBulkResponse } from '@kbn/core/server'; -import { MaintenanceWindowAttributes } from '../types'; +import type { SavedObjectsClientContract, SavedObjectsBulkResponse } from '@kbn/core/server'; +import type { MaintenanceWindowAttributes } from '../types'; import { MAINTENANCE_WINDOW_SAVED_OBJECT_TYPE } from '../../../../common'; export interface BulkGetMaintenanceWindowObject { diff --git a/x-pack/platform/plugins/shared/alerting/server/data/maintenance_window/methods/create_maintenance_window_so.ts b/x-pack/platform/plugins/shared/alerting/server/data/maintenance_window/methods/create_maintenance_window_so.ts index 6beee4db0d9e8..c26f142e62f01 100644 --- a/x-pack/platform/plugins/shared/alerting/server/data/maintenance_window/methods/create_maintenance_window_so.ts +++ b/x-pack/platform/plugins/shared/alerting/server/data/maintenance_window/methods/create_maintenance_window_so.ts @@ -5,12 +5,12 @@ * 2.0. */ -import { +import type { SavedObjectsClientContract, SavedObjectsCreateOptions, SavedObject, } from '@kbn/core/server'; -import { MaintenanceWindowAttributes } from '../types'; +import type { MaintenanceWindowAttributes } from '../types'; import { MAINTENANCE_WINDOW_SAVED_OBJECT_TYPE } from '../../../../common'; export interface CreateMaintenanceWindowSoParams { diff --git a/x-pack/platform/plugins/shared/alerting/server/data/maintenance_window/methods/delete_maintenance_window_so.ts b/x-pack/platform/plugins/shared/alerting/server/data/maintenance_window/methods/delete_maintenance_window_so.ts index 18725da8dbd5a..7dd7b80091981 100644 --- a/x-pack/platform/plugins/shared/alerting/server/data/maintenance_window/methods/delete_maintenance_window_so.ts +++ b/x-pack/platform/plugins/shared/alerting/server/data/maintenance_window/methods/delete_maintenance_window_so.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { SavedObjectsClientContract, SavedObjectsDeleteOptions } from '@kbn/core/server'; +import type { SavedObjectsClientContract, SavedObjectsDeleteOptions } from '@kbn/core/server'; import { MAINTENANCE_WINDOW_SAVED_OBJECT_TYPE } from '../../../../common'; export interface DeleteMaintenanceWindowSoParams { diff --git a/x-pack/platform/plugins/shared/alerting/server/data/maintenance_window/methods/find_maintenance_window_so.ts b/x-pack/platform/plugins/shared/alerting/server/data/maintenance_window/methods/find_maintenance_window_so.ts index 82c8e3d65a98a..6df9ca0d28f15 100644 --- a/x-pack/platform/plugins/shared/alerting/server/data/maintenance_window/methods/find_maintenance_window_so.ts +++ b/x-pack/platform/plugins/shared/alerting/server/data/maintenance_window/methods/find_maintenance_window_so.ts @@ -5,12 +5,12 @@ * 2.0. */ -import { +import type { SavedObjectsClientContract, SavedObjectsFindOptions, SavedObjectsFindResponse, } from '@kbn/core/server'; -import { MaintenanceWindowAttributes } from '../types'; +import type { MaintenanceWindowAttributes } from '../types'; import { MAINTENANCE_WINDOW_SAVED_OBJECT_TYPE } from '../../../../common'; export interface FindMaintenanceWindowSoParams { diff --git a/x-pack/platform/plugins/shared/alerting/server/data/maintenance_window/methods/get_maintenance_window_so.ts b/x-pack/platform/plugins/shared/alerting/server/data/maintenance_window/methods/get_maintenance_window_so.ts index 9dfb11ee7ee0b..d86c213c43c34 100644 --- a/x-pack/platform/plugins/shared/alerting/server/data/maintenance_window/methods/get_maintenance_window_so.ts +++ b/x-pack/platform/plugins/shared/alerting/server/data/maintenance_window/methods/get_maintenance_window_so.ts @@ -5,8 +5,8 @@ * 2.0. */ -import { SavedObjectsClientContract, SavedObject } from '@kbn/core/server'; -import { MaintenanceWindowAttributes } from '../types'; +import type { SavedObjectsClientContract, SavedObject } from '@kbn/core/server'; +import type { MaintenanceWindowAttributes } from '../types'; import { MAINTENANCE_WINDOW_SAVED_OBJECT_TYPE } from '../../../../common'; export interface GetMaintenanceWindowSoParams { diff --git a/x-pack/platform/plugins/shared/alerting/server/data/maintenance_window/methods/update_maintenance_window_so.ts b/x-pack/platform/plugins/shared/alerting/server/data/maintenance_window/methods/update_maintenance_window_so.ts index b65516da3c726..d5fc46294398b 100644 --- a/x-pack/platform/plugins/shared/alerting/server/data/maintenance_window/methods/update_maintenance_window_so.ts +++ b/x-pack/platform/plugins/shared/alerting/server/data/maintenance_window/methods/update_maintenance_window_so.ts @@ -5,12 +5,12 @@ * 2.0. */ -import { +import type { SavedObjectsClientContract, SavedObjectsUpdateOptions, SavedObjectsUpdateResponse, } from '@kbn/core/server'; -import { MaintenanceWindowAttributes } from '../types'; +import type { MaintenanceWindowAttributes } from '../types'; import { MAINTENANCE_WINDOW_SAVED_OBJECT_TYPE } from '../../../../common'; export interface UpdateMaintenanceWindowSoParams { diff --git a/x-pack/platform/plugins/shared/alerting/server/data/maintenance_window/test_helpers.ts b/x-pack/platform/plugins/shared/alerting/server/data/maintenance_window/test_helpers.ts index 2d18b736fdc14..c3afc28f00851 100644 --- a/x-pack/platform/plugins/shared/alerting/server/data/maintenance_window/test_helpers.ts +++ b/x-pack/platform/plugins/shared/alerting/server/data/maintenance_window/test_helpers.ts @@ -6,7 +6,7 @@ */ import { Frequency } from '@kbn/rrule'; -import { MaintenanceWindowAttributes } from './types'; +import type { MaintenanceWindowAttributes } from './types'; export const getMockMaintenanceWindow = ( overwrites?: Partial diff --git a/x-pack/platform/plugins/shared/alerting/server/data/maintenance_window/types/maintenance_window_attributes.ts b/x-pack/platform/plugins/shared/alerting/server/data/maintenance_window/types/maintenance_window_attributes.ts index afb217abaf139..cadadb37913d2 100644 --- a/x-pack/platform/plugins/shared/alerting/server/data/maintenance_window/types/maintenance_window_attributes.ts +++ b/x-pack/platform/plugins/shared/alerting/server/data/maintenance_window/types/maintenance_window_attributes.ts @@ -5,9 +5,9 @@ * 2.0. */ -import { RRuleAttributes } from '../../r_rule/types'; +import type { RRuleAttributes } from '../../r_rule/types'; import type { MaintenanceWindowCategoryIdTypes } from '../constants'; -import { AlertsFilterQueryAttributes } from '../../alerts_filter_query/types'; +import type { AlertsFilterQueryAttributes } from '../../alerts_filter_query/types'; export interface MaintenanceWindowEventAttributes { gte: string; diff --git a/x-pack/platform/plugins/shared/alerting/server/data/rule/methods/bulk_create_rule_so.ts b/x-pack/platform/plugins/shared/alerting/server/data/rule/methods/bulk_create_rule_so.ts index 057e44446030f..2690579cdd80b 100644 --- a/x-pack/platform/plugins/shared/alerting/server/data/rule/methods/bulk_create_rule_so.ts +++ b/x-pack/platform/plugins/shared/alerting/server/data/rule/methods/bulk_create_rule_so.ts @@ -5,13 +5,13 @@ * 2.0. */ -import { +import type { SavedObjectsClientContract, SavedObjectsCreateOptions, SavedObjectsBulkCreateObject, SavedObjectsBulkResponse, } from '@kbn/core/server'; -import { RawRule } from '../../../types'; +import type { RawRule } from '../../../types'; export interface BulkCreateRulesSoParams { savedObjectsClient: SavedObjectsClientContract; diff --git a/x-pack/platform/plugins/shared/alerting/server/data/rule/methods/bulk_delete_rules_so.ts b/x-pack/platform/plugins/shared/alerting/server/data/rule/methods/bulk_delete_rules_so.ts index 15449dc003cd2..d9b3908494bf9 100644 --- a/x-pack/platform/plugins/shared/alerting/server/data/rule/methods/bulk_delete_rules_so.ts +++ b/x-pack/platform/plugins/shared/alerting/server/data/rule/methods/bulk_delete_rules_so.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { +import type { SavedObjectsClientContract, SavedObjectsBulkDeleteOptions, SavedObjectsBulkDeleteResponse, diff --git a/x-pack/platform/plugins/shared/alerting/server/data/rule/methods/bulk_disable_rules_so.ts b/x-pack/platform/plugins/shared/alerting/server/data/rule/methods/bulk_disable_rules_so.ts index a32e38f255c3e..711d051f45a2e 100644 --- a/x-pack/platform/plugins/shared/alerting/server/data/rule/methods/bulk_disable_rules_so.ts +++ b/x-pack/platform/plugins/shared/alerting/server/data/rule/methods/bulk_disable_rules_so.ts @@ -5,13 +5,13 @@ * 2.0. */ -import { +import type { SavedObjectsClientContract, SavedObjectsCreateOptions, SavedObjectsBulkCreateObject, SavedObjectsBulkResponse, } from '@kbn/core/server'; -import { RawRule } from '../../../types'; +import type { RawRule } from '../../../types'; export interface BulkDisableRulesSoParams { savedObjectsClient: SavedObjectsClientContract; diff --git a/x-pack/platform/plugins/shared/alerting/server/data/rule/methods/create_rule_so.ts b/x-pack/platform/plugins/shared/alerting/server/data/rule/methods/create_rule_so.ts index e5a45ee9f386e..6677931968670 100644 --- a/x-pack/platform/plugins/shared/alerting/server/data/rule/methods/create_rule_so.ts +++ b/x-pack/platform/plugins/shared/alerting/server/data/rule/methods/create_rule_so.ts @@ -5,12 +5,12 @@ * 2.0. */ -import { +import type { SavedObjectsClientContract, SavedObjectsCreateOptions, SavedObject, } from '@kbn/core/server'; -import { RawRule } from '../../../types'; +import type { RawRule } from '../../../types'; import { RULE_SAVED_OBJECT_TYPE } from '../../../saved_objects'; export interface CreateRuleSoParams { diff --git a/x-pack/platform/plugins/shared/alerting/server/data/rule/methods/delete_rule_so.ts b/x-pack/platform/plugins/shared/alerting/server/data/rule/methods/delete_rule_so.ts index 7c15fd847303f..a7f4f90a3683a 100644 --- a/x-pack/platform/plugins/shared/alerting/server/data/rule/methods/delete_rule_so.ts +++ b/x-pack/platform/plugins/shared/alerting/server/data/rule/methods/delete_rule_so.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { SavedObjectsClientContract, SavedObjectsDeleteOptions } from '@kbn/core/server'; +import type { SavedObjectsClientContract, SavedObjectsDeleteOptions } from '@kbn/core/server'; import { RULE_SAVED_OBJECT_TYPE } from '../../../saved_objects'; export interface DeleteRuleSoParams { diff --git a/x-pack/platform/plugins/shared/alerting/server/data/rule/methods/find_rules_so.ts b/x-pack/platform/plugins/shared/alerting/server/data/rule/methods/find_rules_so.ts index 1e73d52aba955..61753a0394fe7 100644 --- a/x-pack/platform/plugins/shared/alerting/server/data/rule/methods/find_rules_so.ts +++ b/x-pack/platform/plugins/shared/alerting/server/data/rule/methods/find_rules_so.ts @@ -5,13 +5,13 @@ * 2.0. */ -import { +import type { SavedObjectsClientContract, SavedObjectsFindOptions, SavedObjectsFindResponse, } from '@kbn/core/server'; import { RULE_SAVED_OBJECT_TYPE } from '../../../saved_objects'; -import { RawRule } from '../../../types'; +import type { RawRule } from '../../../types'; export interface FindRulesSoParams { savedObjectsClient: SavedObjectsClientContract; diff --git a/x-pack/platform/plugins/shared/alerting/server/data/rule/methods/get_decrypted_rule_so.ts b/x-pack/platform/plugins/shared/alerting/server/data/rule/methods/get_decrypted_rule_so.ts index 1171e53abda6f..fa5831620af05 100644 --- a/x-pack/platform/plugins/shared/alerting/server/data/rule/methods/get_decrypted_rule_so.ts +++ b/x-pack/platform/plugins/shared/alerting/server/data/rule/methods/get_decrypted_rule_so.ts @@ -5,10 +5,10 @@ * 2.0. */ -import { SavedObject } from '@kbn/core/server'; -import { EncryptedSavedObjectsClient } from '@kbn/encrypted-saved-objects-plugin/server'; -import { SavedObjectsGetOptions } from '@kbn/core-saved-objects-api-server'; -import { RawRule } from '../../../types'; +import type { SavedObject } from '@kbn/core/server'; +import type { EncryptedSavedObjectsClient } from '@kbn/encrypted-saved-objects-plugin/server'; +import type { SavedObjectsGetOptions } from '@kbn/core-saved-objects-api-server'; +import type { RawRule } from '../../../types'; import { RULE_SAVED_OBJECT_TYPE } from '../../../saved_objects'; export interface GetDecryptedRuleSoParams { diff --git a/x-pack/platform/plugins/shared/alerting/server/data/rule/methods/get_rule_so.ts b/x-pack/platform/plugins/shared/alerting/server/data/rule/methods/get_rule_so.ts index e02813d855ce9..5fb608ada6898 100644 --- a/x-pack/platform/plugins/shared/alerting/server/data/rule/methods/get_rule_so.ts +++ b/x-pack/platform/plugins/shared/alerting/server/data/rule/methods/get_rule_so.ts @@ -5,9 +5,9 @@ * 2.0. */ -import { SavedObjectsClientContract, SavedObject } from '@kbn/core/server'; -import { SavedObjectsGetOptions } from '@kbn/core-saved-objects-api-server'; -import { RawRule } from '../../../types'; +import type { SavedObjectsClientContract, SavedObject } from '@kbn/core/server'; +import type { SavedObjectsGetOptions } from '@kbn/core-saved-objects-api-server'; +import type { RawRule } from '../../../types'; import { RULE_SAVED_OBJECT_TYPE } from '../../../saved_objects'; export interface GetRuleSoParams { diff --git a/x-pack/platform/plugins/shared/alerting/server/data/rule/methods/resolve_rule_so.ts b/x-pack/platform/plugins/shared/alerting/server/data/rule/methods/resolve_rule_so.ts index 0c8e876dac540..e07305a05c58d 100644 --- a/x-pack/platform/plugins/shared/alerting/server/data/rule/methods/resolve_rule_so.ts +++ b/x-pack/platform/plugins/shared/alerting/server/data/rule/methods/resolve_rule_so.ts @@ -5,10 +5,10 @@ * 2.0. */ -import { SavedObjectsClientContract, SavedObjectsResolveResponse } from '@kbn/core/server'; -import { SavedObjectsResolveOptions } from '@kbn/core-saved-objects-api-server'; +import type { SavedObjectsClientContract, SavedObjectsResolveResponse } from '@kbn/core/server'; +import type { SavedObjectsResolveOptions } from '@kbn/core-saved-objects-api-server'; import { RULE_SAVED_OBJECT_TYPE } from '../../../saved_objects'; -import { RawRule } from '../../../types'; +import type { RawRule } from '../../../types'; export interface ResolveRuleSoParams { savedObjectsClient: SavedObjectsClientContract; diff --git a/x-pack/platform/plugins/shared/alerting/server/data/rule/methods/update_rule_so.ts b/x-pack/platform/plugins/shared/alerting/server/data/rule/methods/update_rule_so.ts index 7358cf609d3c3..a8cc2b37e1283 100644 --- a/x-pack/platform/plugins/shared/alerting/server/data/rule/methods/update_rule_so.ts +++ b/x-pack/platform/plugins/shared/alerting/server/data/rule/methods/update_rule_so.ts @@ -5,13 +5,13 @@ * 2.0. */ -import { +import type { SavedObjectsClientContract, SavedObjectsUpdateOptions, SavedObjectsUpdateResponse, } from '@kbn/core/server'; import { RULE_SAVED_OBJECT_TYPE } from '../../../saved_objects'; -import { RawRule } from '../../../types'; +import type { RawRule } from '../../../types'; export interface UpdateRuleSoParams { savedObjectsClient: SavedObjectsClientContract; diff --git a/x-pack/platform/plugins/shared/alerting/server/health/get_health.ts b/x-pack/platform/plugins/shared/alerting/server/health/get_health.ts index f29a88dec6489..ba814ee01bf91 100644 --- a/x-pack/platform/plugins/shared/alerting/server/health/get_health.ts +++ b/x-pack/platform/plugins/shared/alerting/server/health/get_health.ts @@ -5,10 +5,12 @@ * 2.0. */ -import { ISavedObjectsRepository, SavedObjectsServiceStart } from '@kbn/core/server'; -import { AlertsHealth, HealthStatus } from '@kbn/alerting-types'; +import type { ISavedObjectsRepository, SavedObjectsServiceStart } from '@kbn/core/server'; +import type { AlertsHealth } from '@kbn/alerting-types'; +import { HealthStatus } from '@kbn/alerting-types'; import { RULE_SAVED_OBJECT_TYPE } from '../saved_objects'; -import { RawRule, RuleExecutionStatusErrorReasons } from '../types'; +import type { RawRule } from '../types'; +import { RuleExecutionStatusErrorReasons } from '../types'; import type { LatestTaskStateSchema } from './task_state'; export const getHealth = async ( diff --git a/x-pack/platform/plugins/shared/alerting/server/health/task.ts b/x-pack/platform/plugins/shared/alerting/server/health/task.ts index fb22fcf63c3fe..045775b92c70d 100644 --- a/x-pack/platform/plugins/shared/alerting/server/health/task.ts +++ b/x-pack/platform/plugins/shared/alerting/server/health/task.ts @@ -5,15 +5,15 @@ * 2.0. */ -import { CoreStart, Logger } from '@kbn/core/server'; -import { +import type { CoreStart, Logger } from '@kbn/core/server'; +import type { RunContext, TaskManagerSetupContract, TaskManagerStartContract, } from '@kbn/task-manager-plugin/server'; import { HealthStatus } from '@kbn/alerting-types'; -import { AlertingConfig } from '../config'; -import { AlertingPluginsStart } from '../plugin'; +import type { AlertingConfig } from '../config'; +import type { AlertingPluginsStart } from '../plugin'; import { getAlertingHealthStatus } from './get_health'; import { stateSchemaByVersion, emptyState, type LatestTaskStateSchema } from './task_state'; diff --git a/x-pack/platform/plugins/shared/alerting/server/health/task_state.ts b/x-pack/platform/plugins/shared/alerting/server/health/task_state.ts index fcb950f59d2c7..68b756da6d1f5 100644 --- a/x-pack/platform/plugins/shared/alerting/server/health/task_state.ts +++ b/x-pack/platform/plugins/shared/alerting/server/health/task_state.ts @@ -5,7 +5,8 @@ * 2.0. */ -import { schema, TypeOf } from '@kbn/config-schema'; +import type { TypeOf } from '@kbn/config-schema'; +import { schema } from '@kbn/config-schema'; import { HealthStatus } from '@kbn/alerting-types'; /** diff --git a/x-pack/platform/plugins/shared/alerting/server/index.ts b/x-pack/platform/plugins/shared/alerting/server/index.ts index fc00d37e6ebc3..f9247d8d914bd 100644 --- a/x-pack/platform/plugins/shared/alerting/server/index.ts +++ b/x-pack/platform/plugins/shared/alerting/server/index.ts @@ -5,9 +5,10 @@ * 2.0. */ import type { PublicMethodsOf } from '@kbn/utility-types'; -import { PluginConfigDescriptor, PluginInitializerContext } from '@kbn/core/server'; -import { RulesClient as RulesClientClass } from './rules_client'; -import { AlertingConfig, configSchema } from './config'; +import type { PluginConfigDescriptor, PluginInitializerContext } from '@kbn/core/server'; +import type { RulesClient as RulesClientClass } from './rules_client'; +import type { AlertingConfig } from './config'; +import { configSchema } from './config'; export type RulesClient = PublicMethodsOf; diff --git a/x-pack/platform/plugins/shared/alerting/server/invalidate_pending_api_keys/bulk_mark_api_keys_for_invalidation.ts b/x-pack/platform/plugins/shared/alerting/server/invalidate_pending_api_keys/bulk_mark_api_keys_for_invalidation.ts index bde9cd8aa2131..6c060f2e64518 100644 --- a/x-pack/platform/plugins/shared/alerting/server/invalidate_pending_api_keys/bulk_mark_api_keys_for_invalidation.ts +++ b/x-pack/platform/plugins/shared/alerting/server/invalidate_pending_api_keys/bulk_mark_api_keys_for_invalidation.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { Logger, SavedObjectsClientContract } from '@kbn/core/server'; +import type { Logger, SavedObjectsClientContract } from '@kbn/core/server'; import { withSpan } from '@kbn/apm-utils'; import { API_KEY_PENDING_INVALIDATION_TYPE } from '..'; diff --git a/x-pack/platform/plugins/shared/alerting/server/invalidate_pending_api_keys/task.ts b/x-pack/platform/plugins/shared/alerting/server/invalidate_pending_api_keys/task.ts index b2e992623a643..916f3db49f600 100644 --- a/x-pack/platform/plugins/shared/alerting/server/invalidate_pending_api_keys/task.ts +++ b/x-pack/platform/plugins/shared/alerting/server/invalidate_pending_api_keys/task.ts @@ -5,33 +5,33 @@ * 2.0. */ -import { +import type { Logger, CoreStart, SavedObjectsFindResponse, SavedObjectsClientContract, } from '@kbn/core/server'; -import { EncryptedSavedObjectsClient } from '@kbn/encrypted-saved-objects-plugin/server'; -import { InvalidateAPIKeysParams, SecurityPluginStart } from '@kbn/security-plugin/server'; -import { +import type { EncryptedSavedObjectsClient } from '@kbn/encrypted-saved-objects-plugin/server'; +import type { InvalidateAPIKeysParams, SecurityPluginStart } from '@kbn/security-plugin/server'; +import type { RunContext, TaskManagerSetupContract, TaskManagerStartContract, } from '@kbn/task-manager-plugin/server'; -import { +import type { AggregationsStringTermsBucketKeys, AggregationsTermsAggregateBase, } from '@elastic/elasticsearch/lib/api/types'; import { ACTION_TASK_PARAMS_SAVED_OBJECT_TYPE } from '@kbn/actions-plugin/server/constants/saved_objects'; -import { InvalidateAPIKeyResult } from '../rules_client'; -import { AlertingConfig } from '../config'; +import type { InvalidateAPIKeyResult } from '../rules_client'; +import type { AlertingConfig } from '../config'; import { timePeriodBeforeDate } from '../lib/get_cadence'; -import { AlertingPluginsStart } from '../plugin'; -import { InvalidatePendingApiKey } from '../types'; +import type { AlertingPluginsStart } from '../plugin'; +import type { InvalidatePendingApiKey } from '../types'; import { stateSchemaByVersion, emptyState, type LatestTaskStateSchema } from './task_state'; import { API_KEY_PENDING_INVALIDATION_TYPE } from '..'; import { AD_HOC_RUN_SAVED_OBJECT_TYPE } from '../saved_objects'; -import { AdHocRunSO } from '../data/ad_hoc_run/types'; +import type { AdHocRunSO } from '../data/ad_hoc_run/types'; const TASK_TYPE = 'alerts_invalidate_api_keys'; const PAGE_SIZE = 100; diff --git a/x-pack/platform/plugins/shared/alerting/server/invalidate_pending_api_keys/task_state.ts b/x-pack/platform/plugins/shared/alerting/server/invalidate_pending_api_keys/task_state.ts index 81f873412f8b9..cdad9ffe6c361 100644 --- a/x-pack/platform/plugins/shared/alerting/server/invalidate_pending_api_keys/task_state.ts +++ b/x-pack/platform/plugins/shared/alerting/server/invalidate_pending_api_keys/task_state.ts @@ -5,7 +5,8 @@ * 2.0. */ -import { schema, TypeOf } from '@kbn/config-schema'; +import type { TypeOf } from '@kbn/config-schema'; +import { schema } from '@kbn/config-schema'; /** * WARNING: Do not modify the existing versioned schema(s) below, instead define a new version (ex: 2, 3, 4). diff --git a/x-pack/platform/plugins/shared/alerting/server/lib/alert_summary_from_event_log.test.ts b/x-pack/platform/plugins/shared/alerting/server/lib/alert_summary_from_event_log.test.ts index a4bdc2f88bfa0..b5c47cae3d596 100644 --- a/x-pack/platform/plugins/shared/alerting/server/lib/alert_summary_from_event_log.test.ts +++ b/x-pack/platform/plugins/shared/alerting/server/lib/alert_summary_from_event_log.test.ts @@ -6,8 +6,9 @@ */ import { random, mean } from 'lodash'; -import { SanitizedRule, AlertSummary } from '../types'; -import { IValidatedEvent, millisToNanos, nanosToMillis } from '@kbn/event-log-plugin/server'; +import type { SanitizedRule, AlertSummary } from '../types'; +import type { IValidatedEvent } from '@kbn/event-log-plugin/server'; +import { millisToNanos, nanosToMillis } from '@kbn/event-log-plugin/server'; import { EVENT_LOG_ACTIONS, EVENT_LOG_PROVIDER, LEGACY_EVENT_LOG_ACTIONS } from '../plugin'; import { alertSummaryFromEventLog } from './alert_summary_from_event_log'; diff --git a/x-pack/platform/plugins/shared/alerting/server/lib/alert_summary_from_event_log.ts b/x-pack/platform/plugins/shared/alerting/server/lib/alert_summary_from_event_log.ts index e20b92370bbc6..b74970146e316 100644 --- a/x-pack/platform/plugins/shared/alerting/server/lib/alert_summary_from_event_log.ts +++ b/x-pack/platform/plugins/shared/alerting/server/lib/alert_summary_from_event_log.ts @@ -6,8 +6,9 @@ */ import { mean } from 'lodash'; -import { IEvent, nanosToMillis } from '@kbn/event-log-plugin/server'; -import { SanitizedRule, AlertSummary, AlertStatus } from '../types'; +import type { IEvent } from '@kbn/event-log-plugin/server'; +import { nanosToMillis } from '@kbn/event-log-plugin/server'; +import type { SanitizedRule, AlertSummary, AlertStatus } from '../types'; import { EVENT_LOG_ACTIONS, EVENT_LOG_PROVIDER, LEGACY_EVENT_LOG_ACTIONS } from '../plugin'; export interface AlertSummaryFromEventLogParams { diff --git a/x-pack/platform/plugins/shared/alerting/server/lib/alerting_event_logger/alerting_event_logger.test.ts b/x-pack/platform/plugins/shared/alerting/server/lib/alerting_event_logger/alerting_event_logger.test.ts index deae1727a3892..7ef8823817190 100644 --- a/x-pack/platform/plugins/shared/alerting/server/lib/alerting_event_logger/alerting_event_logger.test.ts +++ b/x-pack/platform/plugins/shared/alerting/server/lib/alerting_event_logger/alerting_event_logger.test.ts @@ -6,13 +6,12 @@ */ import { eventLoggerMock } from '@kbn/event-log-plugin/server/event_logger.mock'; -import { IEvent, SAVED_OBJECT_REL_PRIMARY } from '@kbn/event-log-plugin/server'; +import type { IEvent } from '@kbn/event-log-plugin/server'; +import { SAVED_OBJECT_REL_PRIMARY } from '@kbn/event-log-plugin/server'; import { ActionsCompletion } from '@kbn/alerting-state-types'; +import type { ContextOpts, Context, RuleContext, SavedObjects } from './alerting_event_logger'; import { AlertingEventLogger, - ContextOpts, - Context, - RuleContext, initializeExecuteRecord, createExecuteTimeoutRecord, createAlertRecord, @@ -20,23 +19,22 @@ import { updateEvent, executionType, initializeExecuteBackfillRecord, - SavedObjects, updateEventWithRuleData, createGapRecord, } from './alerting_event_logger'; -import { UntypedNormalizedRuleType } from '../../rule_type_registry'; +import type { UntypedNormalizedRuleType } from '../../rule_type_registry'; import { RecoveredActionGroup, RuleExecutionStatusErrorReasons, RuleExecutionStatusWarningReasons, } from '../../types'; -import { RuleRunMetrics } from '../rule_run_metrics_store'; +import type { RuleRunMetrics } from '../rule_run_metrics_store'; import { EVENT_LOG_ACTIONS } from '../../plugin'; import { TaskRunnerTimerSpan } from '../../task_runner/task_runner_timer'; import { schema } from '@kbn/config-schema'; import { RULE_SAVED_OBJECT_TYPE } from '../..'; import { AD_HOC_RUN_SAVED_OBJECT_TYPE } from '../../saved_objects'; -import { GapBase } from '../rule_gaps/types'; +import type { GapBase } from '../rule_gaps/types'; const mockNow = '2020-01-01T02:00:00.000Z'; const eventLogger = eventLoggerMock.create(); diff --git a/x-pack/platform/plugins/shared/alerting/server/lib/alerting_event_logger/alerting_event_logger.ts b/x-pack/platform/plugins/shared/alerting/server/lib/alerting_event_logger/alerting_event_logger.ts index 8cc372858f5d6..86245de9def45 100644 --- a/x-pack/platform/plugins/shared/alerting/server/lib/alerting_event_logger/alerting_event_logger.ts +++ b/x-pack/platform/plugins/shared/alerting/server/lib/alerting_event_logger/alerting_event_logger.ts @@ -5,23 +5,18 @@ * 2.0. */ -import { - IEvent, - IEventLogger, - millisToNanos, - SAVED_OBJECT_REL_PRIMARY, - InternalFields, -} from '@kbn/event-log-plugin/server'; -import { BulkResponse } from '@elastic/elasticsearch/lib/api/types'; +import type { IEvent, IEventLogger, InternalFields } from '@kbn/event-log-plugin/server'; +import { millisToNanos, SAVED_OBJECT_REL_PRIMARY } from '@kbn/event-log-plugin/server'; +import type { BulkResponse } from '@elastic/elasticsearch/lib/api/types'; import { EVENT_LOG_ACTIONS } from '../../plugin'; -import { UntypedNormalizedRuleType } from '../../rule_type_registry'; +import type { UntypedNormalizedRuleType } from '../../rule_type_registry'; import { RULE_SAVED_OBJECT_TYPE } from '../../saved_objects'; -import { TaskRunnerTimings } from '../../task_runner/task_runner_timer'; -import { AlertInstanceState, RuleExecutionStatus } from '../../types'; +import type { TaskRunnerTimings } from '../../task_runner/task_runner_timer'; +import type { AlertInstanceState, RuleExecutionStatus } from '../../types'; import { createAlertEventLogRecordObject } from '../create_alert_event_log_record_object'; -import { RuleRunMetrics } from '../rule_run_metrics_store'; +import type { RuleRunMetrics } from '../rule_run_metrics_store'; import { Gap } from '../rule_gaps/gap'; -import { GapBase } from '../rule_gaps/types'; +import type { GapBase } from '../rule_gaps/types'; // 1,000,000 nanoseconds in 1 millisecond const Millis2Nanos = 1000 * 1000; diff --git a/x-pack/platform/plugins/shared/alerting/server/lib/create_alert_event_log_record_object.test.ts b/x-pack/platform/plugins/shared/alerting/server/lib/create_alert_event_log_record_object.test.ts index 2936df04c9cdb..e1faceff8319a 100644 --- a/x-pack/platform/plugins/shared/alerting/server/lib/create_alert_event_log_record_object.test.ts +++ b/x-pack/platform/plugins/shared/alerting/server/lib/create_alert_event_log_record_object.test.ts @@ -6,7 +6,7 @@ */ import { createAlertEventLogRecordObject } from './create_alert_event_log_record_object'; -import { UntypedNormalizedRuleType } from '../rule_type_registry'; +import type { UntypedNormalizedRuleType } from '../rule_type_registry'; import { RecoveredActionGroup } from '../types'; import { schema } from '@kbn/config-schema'; diff --git a/x-pack/platform/plugins/shared/alerting/server/lib/create_alert_event_log_record_object.ts b/x-pack/platform/plugins/shared/alerting/server/lib/create_alert_event_log_record_object.ts index 47208e06b1234..a70b657f7c7dd 100644 --- a/x-pack/platform/plugins/shared/alerting/server/lib/create_alert_event_log_record_object.ts +++ b/x-pack/platform/plugins/shared/alerting/server/lib/create_alert_event_log_record_object.ts @@ -5,9 +5,9 @@ * 2.0. */ -import { IEvent } from '@kbn/event-log-plugin/server'; -import { AlertInstanceState } from '../types'; -import { UntypedNormalizedRuleType } from '../rule_type_registry'; +import type { IEvent } from '@kbn/event-log-plugin/server'; +import type { AlertInstanceState } from '../types'; +import type { UntypedNormalizedRuleType } from '../rule_type_registry'; export type Event = Exclude; diff --git a/x-pack/platform/plugins/shared/alerting/server/lib/create_get_alert_indices_alias.test.ts b/x-pack/platform/plugins/shared/alerting/server/lib/create_get_alert_indices_alias.test.ts index 9a8109977962c..b749a426fb446 100644 --- a/x-pack/platform/plugins/shared/alerting/server/lib/create_get_alert_indices_alias.test.ts +++ b/x-pack/platform/plugins/shared/alerting/server/lib/create_get_alert_indices_alias.test.ts @@ -9,13 +9,14 @@ import { loggingSystemMock } from '@kbn/core-logging-server-mocks'; import { taskManagerMock } from '@kbn/task-manager-plugin/server/mocks'; import { licensingMock } from '@kbn/licensing-plugin/server/mocks'; import { inMemoryMetricsMock } from '../monitoring/in_memory_metrics.mock'; -import { ConstructorOptions, RuleTypeRegistry } from '../rule_type_registry'; +import type { ConstructorOptions } from '../rule_type_registry'; +import { RuleTypeRegistry } from '../rule_type_registry'; import { TaskRunnerFactory } from '../task_runner/task_runner_factory'; -import { ILicenseState } from './license_state'; +import type { ILicenseState } from './license_state'; import { licenseStateMock } from './license_state.mock'; import { schema } from '@kbn/config-schema'; import { createGetAlertIndicesAliasFn } from './create_get_alert_indices_alias'; -import { AlertingConfig } from '../config'; +import type { AlertingConfig } from '../config'; describe('createGetAlertIndicesAliasFn', () => { const logger = loggingSystemMock.create().get(); diff --git a/x-pack/platform/plugins/shared/alerting/server/lib/create_get_alert_indices_alias.ts b/x-pack/platform/plugins/shared/alerting/server/lib/create_get_alert_indices_alias.ts index f6c08c4793fb2..28f872c2828fb 100644 --- a/x-pack/platform/plugins/shared/alerting/server/lib/create_get_alert_indices_alias.ts +++ b/x-pack/platform/plugins/shared/alerting/server/lib/create_get_alert_indices_alias.ts @@ -7,7 +7,7 @@ import { DEFAULT_NAMESPACE_STRING } from '@kbn/core-saved-objects-utils-server'; import { getIndexTemplateAndPattern } from '../alerts_service/resource_installer_utils'; -import { RuleTypeRegistry } from '../rule_type_registry'; +import type { RuleTypeRegistry } from '../rule_type_registry'; export type GetAlertIndicesAlias = (rulesTypes: string[], spaceId?: string) => string[]; diff --git a/x-pack/platform/plugins/shared/alerting/server/lib/determine_delayed_alerts.ts b/x-pack/platform/plugins/shared/alerting/server/lib/determine_delayed_alerts.ts index 642d17e695a6a..ffab59db9c9a3 100644 --- a/x-pack/platform/plugins/shared/alerting/server/lib/determine_delayed_alerts.ts +++ b/x-pack/platform/plugins/shared/alerting/server/lib/determine_delayed_alerts.ts @@ -6,9 +6,9 @@ */ import { keys } from 'lodash'; -import { Alert } from '../alert'; -import { AlertInstanceState, AlertInstanceContext } from '../types'; -import { RuleRunMetricsStore } from './rule_run_metrics_store'; +import type { Alert } from '../alert'; +import type { AlertInstanceState, AlertInstanceContext } from '../types'; +import type { RuleRunMetricsStore } from './rule_run_metrics_store'; interface DetermineDelayedAlertsOpts< State extends AlertInstanceState, diff --git a/x-pack/platform/plugins/shared/alerting/server/lib/errors/es_error_parser.ts b/x-pack/platform/plugins/shared/alerting/server/lib/errors/es_error_parser.ts index f26fa22f8d730..a8cf017daad93 100644 --- a/x-pack/platform/plugins/shared/alerting/server/lib/errors/es_error_parser.ts +++ b/x-pack/platform/plugins/shared/alerting/server/lib/errors/es_error_parser.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { ElasticsearchError, ElasticsearchErrorCausedByObject } from './types'; +import type { ElasticsearchError, ElasticsearchErrorCausedByObject } from './types'; const getEsCause = ( obj: ElasticsearchErrorCausedByObject = {}, diff --git a/x-pack/platform/plugins/shared/alerting/server/lib/errors/index.ts b/x-pack/platform/plugins/shared/alerting/server/lib/errors/index.ts index a2dcd45bbb63b..cd6a62a7863b2 100644 --- a/x-pack/platform/plugins/shared/alerting/server/lib/errors/index.ts +++ b/x-pack/platform/plugins/shared/alerting/server/lib/errors/index.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { ErrorThatHandlesItsOwnResponse, ElasticsearchError } from './types'; +import type { ErrorThatHandlesItsOwnResponse, ElasticsearchError } from './types'; import { getEsErrorMessage } from './es_error_parser'; export function isErrorThatHandlesItsOwnResponse( diff --git a/x-pack/platform/plugins/shared/alerting/server/lib/errors/rule_muted.ts b/x-pack/platform/plugins/shared/alerting/server/lib/errors/rule_muted.ts index c95fbb2e0b34c..13c04df0be045 100644 --- a/x-pack/platform/plugins/shared/alerting/server/lib/errors/rule_muted.ts +++ b/x-pack/platform/plugins/shared/alerting/server/lib/errors/rule_muted.ts @@ -5,8 +5,8 @@ * 2.0. */ -import { KibanaResponseFactory } from '@kbn/core/server'; -import { ErrorThatHandlesItsOwnResponse } from './types'; +import type { KibanaResponseFactory } from '@kbn/core/server'; +import type { ErrorThatHandlesItsOwnResponse } from './types'; export class RuleMutedError extends Error implements ErrorThatHandlesItsOwnResponse { constructor(message: string) { diff --git a/x-pack/platform/plugins/shared/alerting/server/lib/errors/rule_type_disabled.ts b/x-pack/platform/plugins/shared/alerting/server/lib/errors/rule_type_disabled.ts index 387f48fdaefcb..03ed39e6fbb56 100644 --- a/x-pack/platform/plugins/shared/alerting/server/lib/errors/rule_type_disabled.ts +++ b/x-pack/platform/plugins/shared/alerting/server/lib/errors/rule_type_disabled.ts @@ -5,8 +5,8 @@ * 2.0. */ -import { KibanaResponseFactory } from '@kbn/core/server'; -import { ErrorThatHandlesItsOwnResponse } from './types'; +import type { KibanaResponseFactory } from '@kbn/core/server'; +import type { ErrorThatHandlesItsOwnResponse } from './types'; export type RuleTypeDisabledReason = | 'config' diff --git a/x-pack/platform/plugins/shared/alerting/server/lib/errors/types.ts b/x-pack/platform/plugins/shared/alerting/server/lib/errors/types.ts index 78b114d71c511..2b864dbb8cbd1 100644 --- a/x-pack/platform/plugins/shared/alerting/server/lib/errors/types.ts +++ b/x-pack/platform/plugins/shared/alerting/server/lib/errors/types.ts @@ -4,7 +4,7 @@ * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ -import { KibanaResponseFactory, IKibanaResponse } from '@kbn/core/server'; +import type { KibanaResponseFactory, IKibanaResponse } from '@kbn/core/server'; export interface ErrorThatHandlesItsOwnResponse extends Error { sendResponse(res: KibanaResponseFactory): IKibanaResponse; diff --git a/x-pack/platform/plugins/shared/alerting/server/lib/flapping/delay_recovered_flapping_alerts.ts b/x-pack/platform/plugins/shared/alerting/server/lib/flapping/delay_recovered_flapping_alerts.ts index 3e6ca809238bf..08bd5cf730a4d 100644 --- a/x-pack/platform/plugins/shared/alerting/server/lib/flapping/delay_recovered_flapping_alerts.ts +++ b/x-pack/platform/plugins/shared/alerting/server/lib/flapping/delay_recovered_flapping_alerts.ts @@ -6,10 +6,10 @@ */ import { keys, map } from 'lodash'; -import { Logger } from '@kbn/logging'; -import { RulesSettingsFlappingProperties } from '../../../common/rules_settings'; +import type { Logger } from '@kbn/logging'; +import type { RulesSettingsFlappingProperties } from '../../../common/rules_settings'; import { Alert } from '../../alert'; -import { AlertInstanceState, AlertInstanceContext } from '../../types'; +import type { AlertInstanceState, AlertInstanceContext } from '../../types'; export function delayRecoveredFlappingAlerts< State extends AlertInstanceState, diff --git a/x-pack/platform/plugins/shared/alerting/server/lib/flapping/determine_flapping_alerts.ts b/x-pack/platform/plugins/shared/alerting/server/lib/flapping/determine_flapping_alerts.ts index 92d0235f6318a..806ad97afd035 100644 --- a/x-pack/platform/plugins/shared/alerting/server/lib/flapping/determine_flapping_alerts.ts +++ b/x-pack/platform/plugins/shared/alerting/server/lib/flapping/determine_flapping_alerts.ts @@ -5,10 +5,10 @@ * 2.0. */ -import { Logger } from '@kbn/logging'; -import { Alert } from '../../alert'; -import { AlertInstanceState, AlertInstanceContext } from '../../types'; -import { RulesSettingsFlappingProperties } from '../../../common/rules_settings'; +import type { Logger } from '@kbn/logging'; +import type { Alert } from '../../alert'; +import type { AlertInstanceState, AlertInstanceContext } from '../../types'; +import type { RulesSettingsFlappingProperties } from '../../../common/rules_settings'; import { setFlapping } from './set_flapping'; import { setFlappingHistoryAndTrackedAlerts } from './set_flapping_history_and_tracked_alerts'; import { delayRecoveredFlappingAlerts } from './delay_recovered_flapping_alerts'; diff --git a/x-pack/platform/plugins/shared/alerting/server/lib/flapping/flapping_utils.ts b/x-pack/platform/plugins/shared/alerting/server/lib/flapping/flapping_utils.ts index cef35674ee97b..7d3c599be756e 100644 --- a/x-pack/platform/plugins/shared/alerting/server/lib/flapping/flapping_utils.ts +++ b/x-pack/platform/plugins/shared/alerting/server/lib/flapping/flapping_utils.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { RulesSettingsFlappingProperties } from '../../../common/rules_settings'; +import type { RulesSettingsFlappingProperties } from '../../../common/rules_settings'; export function updateFlappingHistory( flappingSettings: RulesSettingsFlappingProperties, @@ -24,7 +24,7 @@ export function updateFlappingHistory( export function isFlapping( flappingSettings: RulesSettingsFlappingProperties, flappingHistory: boolean[], - isCurrentlyFlapping: boolean = false + isCurrentlyFlapping = false ): boolean { if (flappingSettings.enabled) { const numStateChanges = flappingHistory.filter((f) => f).length; diff --git a/x-pack/platform/plugins/shared/alerting/server/lib/flapping/set_flapping.test.ts b/x-pack/platform/plugins/shared/alerting/server/lib/flapping/set_flapping.test.ts index dbabf09c7dc52..231bfb149f2b7 100644 --- a/x-pack/platform/plugins/shared/alerting/server/lib/flapping/set_flapping.test.ts +++ b/x-pack/platform/plugins/shared/alerting/server/lib/flapping/set_flapping.test.ts @@ -7,7 +7,11 @@ import { pick } from 'lodash'; import { Alert } from '../../alert'; -import { AlertInstanceState, AlertInstanceContext, DefaultActionGroupId } from '../../../common'; +import type { + AlertInstanceState, + AlertInstanceContext, + DefaultActionGroupId, +} from '../../../common'; import { setFlapping, isAlertFlapping } from './set_flapping'; import { DEFAULT_FLAPPING_SETTINGS, diff --git a/x-pack/platform/plugins/shared/alerting/server/lib/flapping/set_flapping.ts b/x-pack/platform/plugins/shared/alerting/server/lib/flapping/set_flapping.ts index 10db2be751371..ccbe83a7e27fc 100644 --- a/x-pack/platform/plugins/shared/alerting/server/lib/flapping/set_flapping.ts +++ b/x-pack/platform/plugins/shared/alerting/server/lib/flapping/set_flapping.ts @@ -6,10 +6,10 @@ */ import { keys } from 'lodash'; -import { Alert } from '../../alert'; -import { AlertInstanceState, AlertInstanceContext } from '../../types'; +import type { Alert } from '../../alert'; +import type { AlertInstanceState, AlertInstanceContext } from '../../types'; import { isFlapping } from './flapping_utils'; -import { RulesSettingsFlappingProperties } from '../../../common/rules_settings'; +import type { RulesSettingsFlappingProperties } from '../../../common/rules_settings'; export function setFlapping< State extends AlertInstanceState, diff --git a/x-pack/platform/plugins/shared/alerting/server/lib/flapping/set_flapping_history_and_tracked_alerts.test.ts b/x-pack/platform/plugins/shared/alerting/server/lib/flapping/set_flapping_history_and_tracked_alerts.test.ts index adae5f63c08ca..71e9ee5d81c0a 100644 --- a/x-pack/platform/plugins/shared/alerting/server/lib/flapping/set_flapping_history_and_tracked_alerts.test.ts +++ b/x-pack/platform/plugins/shared/alerting/server/lib/flapping/set_flapping_history_and_tracked_alerts.test.ts @@ -12,7 +12,7 @@ import { setFlappingHistoryAndTrackedAlerts, } from './set_flapping_history_and_tracked_alerts'; import { Alert } from '../../alert'; -import { AlertInstanceState, AlertInstanceContext } from '../../types'; +import type { AlertInstanceState, AlertInstanceContext } from '../../types'; import { DEFAULT_FLAPPING_SETTINGS, DISABLE_FLAPPING_SETTINGS, diff --git a/x-pack/platform/plugins/shared/alerting/server/lib/flapping/set_flapping_history_and_tracked_alerts.ts b/x-pack/platform/plugins/shared/alerting/server/lib/flapping/set_flapping_history_and_tracked_alerts.ts index 05ccc09ab4a1b..c6a43d28ecdb7 100644 --- a/x-pack/platform/plugins/shared/alerting/server/lib/flapping/set_flapping_history_and_tracked_alerts.ts +++ b/x-pack/platform/plugins/shared/alerting/server/lib/flapping/set_flapping_history_and_tracked_alerts.ts @@ -6,10 +6,10 @@ */ import { keys } from 'lodash'; -import { Alert } from '../../alert'; -import { AlertInstanceState, AlertInstanceContext } from '../../types'; +import type { Alert } from '../../alert'; +import type { AlertInstanceState, AlertInstanceContext } from '../../types'; import { updateFlappingHistory } from './flapping_utils'; -import { RulesSettingsFlappingProperties } from '../../../common/rules_settings'; +import type { RulesSettingsFlappingProperties } from '../../../common/rules_settings'; export function setFlappingHistoryAndTrackedAlerts< State extends AlertInstanceState, diff --git a/x-pack/platform/plugins/shared/alerting/server/lib/format_execution_log_errors.test.ts b/x-pack/platform/plugins/shared/alerting/server/lib/format_execution_log_errors.test.ts index ac99e13db642b..1621706eca8e3 100644 --- a/x-pack/platform/plugins/shared/alerting/server/lib/format_execution_log_errors.test.ts +++ b/x-pack/platform/plugins/shared/alerting/server/lib/format_execution_log_errors.test.ts @@ -6,7 +6,7 @@ */ import { formatExecutionErrorsResult } from './format_execution_log_errors'; -import { QueryEventsBySavedObjectResult } from '@kbn/event-log-plugin/server'; +import type { QueryEventsBySavedObjectResult } from '@kbn/event-log-plugin/server'; describe('formatExecutionErrorsResult', () => { test('should return empty results if data is undefined', () => { diff --git a/x-pack/platform/plugins/shared/alerting/server/lib/format_execution_log_errors.ts b/x-pack/platform/plugins/shared/alerting/server/lib/format_execution_log_errors.ts index 34970350b1461..195f8cbcfc107 100644 --- a/x-pack/platform/plugins/shared/alerting/server/lib/format_execution_log_errors.ts +++ b/x-pack/platform/plugins/shared/alerting/server/lib/format_execution_log_errors.ts @@ -6,8 +6,8 @@ */ import { get } from 'lodash'; -import { QueryEventsBySavedObjectResult, IValidatedEvent } from '@kbn/event-log-plugin/server'; -import { IExecutionErrors, IExecutionErrorsResult } from '../../common'; +import type { QueryEventsBySavedObjectResult, IValidatedEvent } from '@kbn/event-log-plugin/server'; +import type { IExecutionErrors, IExecutionErrorsResult } from '../../common'; const EXECUTION_UUID_FIELD = 'kibana.alert.rule.execution.uuid'; const TIMESTAMP_FIELD = '@timestamp'; diff --git a/x-pack/platform/plugins/shared/alerting/server/lib/get_actions_config_map.ts b/x-pack/platform/plugins/shared/alerting/server/lib/get_actions_config_map.ts index 2ef7c97814648..b640c7d2281de 100644 --- a/x-pack/platform/plugins/shared/alerting/server/lib/get_actions_config_map.ts +++ b/x-pack/platform/plugins/shared/alerting/server/lib/get_actions_config_map.ts @@ -6,7 +6,7 @@ */ import { omit } from 'lodash'; -import { ActionsConfig, ActionTypeConfig } from '../config'; +import type { ActionsConfig, ActionTypeConfig } from '../config'; export interface ActionsConfigMap { default: ActionTypeConfig; diff --git a/x-pack/platform/plugins/shared/alerting/server/lib/get_es_query_config.ts b/x-pack/platform/plugins/shared/alerting/server/lib/get_es_query_config.ts index 2c0668371a4de..8ad3581c67ca2 100644 --- a/x-pack/platform/plugins/shared/alerting/server/lib/get_es_query_config.ts +++ b/x-pack/platform/plugins/shared/alerting/server/lib/get_es_query_config.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { IUiSettingsClient } from '@kbn/core/server'; +import type { IUiSettingsClient } from '@kbn/core/server'; import { UI_SETTINGS } from '@kbn/data-plugin/server'; export async function getEsQueryConfig(uiSettings: IUiSettingsClient) { diff --git a/x-pack/platform/plugins/shared/alerting/server/lib/get_es_request_timeout.ts b/x-pack/platform/plugins/shared/alerting/server/lib/get_es_request_timeout.ts index 7fb82f55993fc..1c69cdf21dc6d 100644 --- a/x-pack/platform/plugins/shared/alerting/server/lib/get_es_request_timeout.ts +++ b/x-pack/platform/plugins/shared/alerting/server/lib/get_es_request_timeout.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { Logger } from '@kbn/core/server'; +import type { Logger } from '@kbn/core/server'; import { parseDuration } from '../../common'; import { DEFAULT_EXECUTION_TIMEOUT } from './get_rule_task_timeout'; diff --git a/x-pack/platform/plugins/shared/alerting/server/lib/get_execution_log_aggregation.test.ts b/x-pack/platform/plugins/shared/alerting/server/lib/get_execution_log_aggregation.test.ts index a7d0ec20cda8c..c57fb601cb059 100644 --- a/x-pack/platform/plugins/shared/alerting/server/lib/get_execution_log_aggregation.test.ts +++ b/x-pack/platform/plugins/shared/alerting/server/lib/get_execution_log_aggregation.test.ts @@ -7,13 +7,13 @@ import type { estypes } from '@elastic/elasticsearch'; import { fromKueryExpression } from '@kbn/es-query'; +import type { ExecutionUuidAggResult } from './get_execution_log_aggregation'; import { getNumExecutions, getExecutionLogAggregation, formatExecutionLogResult, formatSortForBucketSort, formatSortForTermSort, - ExecutionUuidAggResult, getExecutionKPIAggregation, formatExecutionKPIResult, } from './get_execution_log_aggregation'; diff --git a/x-pack/platform/plugins/shared/alerting/server/lib/get_execution_log_aggregation.ts b/x-pack/platform/plugins/shared/alerting/server/lib/get_execution_log_aggregation.ts index 511360475929c..36b80775b6b4e 100644 --- a/x-pack/platform/plugins/shared/alerting/server/lib/get_execution_log_aggregation.ts +++ b/x-pack/platform/plugins/shared/alerting/server/lib/get_execution_log_aggregation.ts @@ -6,14 +6,15 @@ */ import { i18n } from '@kbn/i18n'; -import { KueryNode } from '@kbn/es-query'; -import type { estypes } from '@elastic/elasticsearch'; +import type { KueryNode } from '@kbn/es-query'; +import type * as estypes from '@elastic/elasticsearch/lib/api/types'; import Boom from '@hapi/boom'; import { flatMap, get, isEmpty } from 'lodash'; -import { AggregateEventsBySavedObjectResult } from '@kbn/event-log-plugin/server'; +import type { AggregateEventsBySavedObjectResult } from '@kbn/event-log-plugin/server'; import { fromKueryExpression, toElasticsearchQuery } from '@kbn/es-query'; import { parseDuration } from '.'; -import { IExecutionLog, IExecutionLogResult, EMPTY_EXECUTION_KPI_RESULT } from '../../common'; +import type { IExecutionLog, IExecutionLogResult } from '../../common'; +import { EMPTY_EXECUTION_KPI_RESULT } from '../../common'; const DEFAULT_MAX_BUCKETS_LIMIT = 10000; // do not retrieve more than this number of executions. UI limits 1000 to display, but we need to fetch all 10000 to accurately reflect the KPIs const DEFAULT_MAX_KPI_BUCKETS_LIMIT = 10000; diff --git a/x-pack/platform/plugins/shared/alerting/server/lib/get_rule_notify_when_type.ts b/x-pack/platform/plugins/shared/alerting/server/lib/get_rule_notify_when_type.ts index 2ee07a3db4a29..d1b7acd5936fb 100644 --- a/x-pack/platform/plugins/shared/alerting/server/lib/get_rule_notify_when_type.ts +++ b/x-pack/platform/plugins/shared/alerting/server/lib/get_rule_notify_when_type.ts @@ -6,7 +6,7 @@ */ import { ruleNotifyWhen } from '../application/rule/constants'; -import { RuleNotifyWhen } from '../application/rule/types'; +import type { RuleNotifyWhen } from '../application/rule/types'; export function getRuleNotifyWhenType( notifyWhen: RuleNotifyWhen | null, diff --git a/x-pack/platform/plugins/shared/alerting/server/lib/get_rule_task_timeout.test.ts b/x-pack/platform/plugins/shared/alerting/server/lib/get_rule_task_timeout.test.ts index 59d4260261ebb..391ae566a0536 100644 --- a/x-pack/platform/plugins/shared/alerting/server/lib/get_rule_task_timeout.test.ts +++ b/x-pack/platform/plugins/shared/alerting/server/lib/get_rule_task_timeout.test.ts @@ -6,7 +6,7 @@ */ import { getRuleTaskTimeout } from './get_rule_task_timeout'; -import { RulesConfig } from '../config'; +import type { RulesConfig } from '../config'; const ruleTypeId = 'test-rule-type-id'; const config = { diff --git a/x-pack/platform/plugins/shared/alerting/server/lib/get_rule_task_timeout.ts b/x-pack/platform/plugins/shared/alerting/server/lib/get_rule_task_timeout.ts index 52919bd54de0b..a6e61590fa61f 100644 --- a/x-pack/platform/plugins/shared/alerting/server/lib/get_rule_task_timeout.ts +++ b/x-pack/platform/plugins/shared/alerting/server/lib/get_rule_task_timeout.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { RulesConfig } from '../config'; +import type { RulesConfig } from '../config'; export const DEFAULT_EXECUTION_TIMEOUT = '5m'; diff --git a/x-pack/platform/plugins/shared/alerting/server/lib/get_time_range.ts b/x-pack/platform/plugins/shared/alerting/server/lib/get_time_range.ts index 405d194da8a47..d320b1a7a3638 100644 --- a/x-pack/platform/plugins/shared/alerting/server/lib/get_time_range.ts +++ b/x-pack/platform/plugins/shared/alerting/server/lib/get_time_range.ts @@ -6,7 +6,7 @@ */ import { i18n } from '@kbn/i18n'; -import { Logger } from '@kbn/logging'; +import type { Logger } from '@kbn/logging'; import { parseDuration } from '../../common'; export interface GetTimeRangeResult { @@ -22,7 +22,7 @@ interface GetTimeRangeOpts { } const getWindowDurationInMs = (window?: string): number => { - let durationInMs: number = 0; + let durationInMs = 0; if (window) { try { durationInMs = parseDuration(window); diff --git a/x-pack/platform/plugins/shared/alerting/server/lib/is_rule_snoozed.test.ts b/x-pack/platform/plugins/shared/alerting/server/lib/is_rule_snoozed.test.ts index 74baec92aa430..5a8d10797d045 100644 --- a/x-pack/platform/plugins/shared/alerting/server/lib/is_rule_snoozed.test.ts +++ b/x-pack/platform/plugins/shared/alerting/server/lib/is_rule_snoozed.test.ts @@ -9,7 +9,7 @@ import sinon from 'sinon'; import moment from 'moment-timezone'; import { Frequency } from '@kbn/rrule'; import { isRuleSnoozed } from './is_rule_snoozed'; -import { RRuleRecord } from '../types'; +import type { RRuleRecord } from '../types'; const DATE_9999 = '9999-12-31T12:34:56.789Z'; const DATE_1970 = '1970-01-01T00:00:00.000Z'; diff --git a/x-pack/platform/plugins/shared/alerting/server/lib/is_rule_snoozed.ts b/x-pack/platform/plugins/shared/alerting/server/lib/is_rule_snoozed.ts index 89aeea85e0cb3..cdfd53f96fde9 100644 --- a/x-pack/platform/plugins/shared/alerting/server/lib/is_rule_snoozed.ts +++ b/x-pack/platform/plugins/shared/alerting/server/lib/is_rule_snoozed.ts @@ -6,7 +6,7 @@ */ import { first, isEmpty } from 'lodash'; -import { SanitizedRule, RuleTypeParams } from '../../common/rule'; +import type { SanitizedRule, RuleTypeParams } from '../../common/rule'; import { getActiveSnoozeIfExist } from './snooze/get_active_snooze_if_exist'; type RuleSnoozeProps = Pick, 'muteAll' | 'snoozeSchedule'>; diff --git a/x-pack/platform/plugins/shared/alerting/server/lib/last_run_status.test.ts b/x-pack/platform/plugins/shared/alerting/server/lib/last_run_status.test.ts index 954054fa46c0c..41957c628b88f 100644 --- a/x-pack/platform/plugins/shared/alerting/server/lib/last_run_status.test.ts +++ b/x-pack/platform/plugins/shared/alerting/server/lib/last_run_status.test.ts @@ -7,8 +7,9 @@ import { ActionsCompletion } from '@kbn/alerting-state-types'; import { lastRunFromState } from './last_run_status'; -import { RuleRunMetrics } from './rule_run_metrics_store'; -import { RuleResultServiceResults, RuleResultService } from '../monitoring/rule_result_service'; +import type { RuleRunMetrics } from './rule_run_metrics_store'; +import type { RuleResultServiceResults } from '../monitoring/rule_result_service'; +import { RuleResultService } from '../monitoring/rule_result_service'; const getMetrics = ({ hasReachedAlertLimit = false, diff --git a/x-pack/platform/plugins/shared/alerting/server/lib/last_run_status.ts b/x-pack/platform/plugins/shared/alerting/server/lib/last_run_status.ts index dedee9a658360..5fe7dfeb3e222 100644 --- a/x-pack/platform/plugins/shared/alerting/server/lib/last_run_status.ts +++ b/x-pack/platform/plugins/shared/alerting/server/lib/last_run_status.ts @@ -6,19 +6,16 @@ */ import { ActionsCompletion } from '@kbn/alerting-state-types'; -import { RuleTaskStateAndMetrics } from '../task_runner/types'; +import type { RuleTaskStateAndMetrics } from '../task_runner/types'; import { getReasonFromError } from './error_with_reason'; import { getEsErrorMessage } from './errors'; -import { RuleLastRunOutcomeOrderMap, RuleLastRunOutcomes } from '../../common'; -import { - RuleLastRunOutcomeValues, - RuleExecutionStatusWarningReasons, - RawRuleLastRun, - RuleLastRun, -} from '../types'; +import type { RuleLastRunOutcomes } from '../../common'; +import { RuleLastRunOutcomeOrderMap } from '../../common'; +import type { RawRuleLastRun, RuleLastRun } from '../types'; +import { RuleLastRunOutcomeValues, RuleExecutionStatusWarningReasons } from '../types'; import { translations } from '../constants/translations'; -import { RuleRunMetrics } from './rule_run_metrics_store'; -import { RuleResultService } from '../monitoring/rule_result_service'; +import type { RuleRunMetrics } from './rule_run_metrics_store'; +import type { RuleResultService } from '../monitoring/rule_result_service'; export interface ILastRun { lastRun: RuleLastRun; diff --git a/x-pack/platform/plugins/shared/alerting/server/lib/license_api_access.ts b/x-pack/platform/plugins/shared/alerting/server/lib/license_api_access.ts index 7076918498b00..77571f584593f 100644 --- a/x-pack/platform/plugins/shared/alerting/server/lib/license_api_access.ts +++ b/x-pack/platform/plugins/shared/alerting/server/lib/license_api_access.ts @@ -6,7 +6,7 @@ */ import Boom from '@hapi/boom'; -import { ILicenseState } from './license_state'; +import type { ILicenseState } from './license_state'; export function verifyApiAccess(licenseState: ILicenseState) { const licenseCheckResults = licenseState.getLicenseInformation(); diff --git a/x-pack/platform/plugins/shared/alerting/server/lib/license_state.mock.ts b/x-pack/platform/plugins/shared/alerting/server/lib/license_state.mock.ts index f76dfad16c6e7..d127a4e815ceb 100644 --- a/x-pack/platform/plugins/shared/alerting/server/lib/license_state.mock.ts +++ b/x-pack/platform/plugins/shared/alerting/server/lib/license_state.mock.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { ILicenseState } from './license_state'; +import type { ILicenseState } from './license_state'; export const createLicenseStateMock = () => { const licenseState: jest.Mocked = { diff --git a/x-pack/platform/plugins/shared/alerting/server/lib/license_state.test.ts b/x-pack/platform/plugins/shared/alerting/server/lib/license_state.test.ts index ff1fc0a835396..c6a6bf4fd6b87 100644 --- a/x-pack/platform/plugins/shared/alerting/server/lib/license_state.test.ts +++ b/x-pack/platform/plugins/shared/alerting/server/lib/license_state.test.ts @@ -5,11 +5,12 @@ * 2.0. */ -import { RuleType } from '../types'; +import type { RuleType } from '../types'; import { Subject } from 'rxjs'; -import { LicenseState, ILicenseState } from './license_state'; +import type { ILicenseState } from './license_state'; +import { LicenseState } from './license_state'; import { licensingMock } from '@kbn/licensing-plugin/server/mocks'; -import { ILicense } from '@kbn/licensing-plugin/server'; +import type { ILicense } from '@kbn/licensing-plugin/server'; describe('checkLicense()', () => { const getRawLicense = jest.fn(); diff --git a/x-pack/platform/plugins/shared/alerting/server/lib/license_state.ts b/x-pack/platform/plugins/shared/alerting/server/lib/license_state.ts index 99be775f7c3c6..455a0c7baac85 100644 --- a/x-pack/platform/plugins/shared/alerting/server/lib/license_state.ts +++ b/x-pack/platform/plugins/shared/alerting/server/lib/license_state.ts @@ -10,12 +10,12 @@ import { i18n } from '@kbn/i18n'; import type { PublicMethodsOf } from '@kbn/utility-types'; import { assertNever } from '@kbn/std'; import { capitalize } from 'lodash'; -import { Observable, Subscription } from 'rxjs'; -import { LicensingPluginStart } from '@kbn/licensing-plugin/server'; -import { ILicense, LicenseType } from '@kbn/licensing-plugin/common/types'; +import type { Observable, Subscription } from 'rxjs'; +import type { LicensingPluginStart } from '@kbn/licensing-plugin/server'; +import type { ILicense, LicenseType } from '@kbn/licensing-plugin/common/types'; import { PLUGIN } from '../../common/constants/plugin'; import { getRuleTypeFeatureUsageName } from './get_rule_type_feature_usage_name'; -import { +import type { RuleType, RuleTypeParams, RuleTypeState, diff --git a/x-pack/platform/plugins/shared/alerting/server/lib/monitoring.test.ts b/x-pack/platform/plugins/shared/alerting/server/lib/monitoring.test.ts index 9a9c7e84e7110..23509465679ef 100644 --- a/x-pack/platform/plugins/shared/alerting/server/lib/monitoring.test.ts +++ b/x-pack/platform/plugins/shared/alerting/server/lib/monitoring.test.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { RuleMonitoring, RuleMonitoringHistory } from '../types'; +import type { RuleMonitoring, RuleMonitoringHistory } from '../types'; import { getExecutionDurationPercentiles, updateMonitoring, diff --git a/x-pack/platform/plugins/shared/alerting/server/lib/monitoring.ts b/x-pack/platform/plugins/shared/alerting/server/lib/monitoring.ts index 66b06af30f43f..b691cab14ec63 100644 --- a/x-pack/platform/plugins/shared/alerting/server/lib/monitoring.ts +++ b/x-pack/platform/plugins/shared/alerting/server/lib/monitoring.ts @@ -4,15 +4,15 @@ * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ -import { Logger } from '@kbn/core/server'; +import type { Logger } from '@kbn/core/server'; import stats from 'stats-lite'; -import { +import type { RuleMonitoring, RawRuleMonitoring, RuleMonitoringHistory, RuleMonitoringLastRunMetrics, } from '../types'; -import { RuleDomain } from '../application/rule/types'; +import type { RuleDomain } from '../application/rule/types'; const INITIAL_LAST_RUN_METRICS: RuleMonitoringLastRunMetrics = { duration: 0, diff --git a/x-pack/platform/plugins/shared/alerting/server/lib/process_alerts.test.ts b/x-pack/platform/plugins/shared/alerting/server/lib/process_alerts.test.ts index f112f620a6c0e..f575abb2c9bfe 100644 --- a/x-pack/platform/plugins/shared/alerting/server/lib/process_alerts.test.ts +++ b/x-pack/platform/plugins/shared/alerting/server/lib/process_alerts.test.ts @@ -9,7 +9,7 @@ import sinon from 'sinon'; import { cloneDeep } from 'lodash'; import { processAlerts } from './process_alerts'; import { Alert } from '../alert'; -import { AlertInstanceState, AlertInstanceContext } from '../types'; +import type { AlertInstanceState, AlertInstanceContext } from '../types'; describe('processAlerts', () => { let clock: sinon.SinonFakeTimers; diff --git a/x-pack/platform/plugins/shared/alerting/server/lib/process_alerts.ts b/x-pack/platform/plugins/shared/alerting/server/lib/process_alerts.ts index 3594ec964bc46..fdfa16d55f397 100644 --- a/x-pack/platform/plugins/shared/alerting/server/lib/process_alerts.ts +++ b/x-pack/platform/plugins/shared/alerting/server/lib/process_alerts.ts @@ -7,8 +7,8 @@ import { millisToNanos } from '@kbn/event-log-plugin/server'; import { cloneDeep } from 'lodash'; -import { Alert } from '../alert'; -import { AlertInstanceState, AlertInstanceContext } from '../types'; +import type { Alert } from '../alert'; +import type { AlertInstanceState, AlertInstanceContext } from '../types'; interface ProcessAlertsOpts< State extends AlertInstanceState, diff --git a/x-pack/platform/plugins/shared/alerting/server/lib/retry_if_conflicts.ts b/x-pack/platform/plugins/shared/alerting/server/lib/retry_if_conflicts.ts index 0f9377e83ee6c..7327d2b9d1952 100644 --- a/x-pack/platform/plugins/shared/alerting/server/lib/retry_if_conflicts.ts +++ b/x-pack/platform/plugins/shared/alerting/server/lib/retry_if_conflicts.ts @@ -11,7 +11,8 @@ // have the caller make explicit conflict checks, where the conflict was // caused by a background update. -import { Logger, SavedObjectsErrorHelpers } from '@kbn/core/server'; +import type { Logger } from '@kbn/core/server'; +import { SavedObjectsErrorHelpers } from '@kbn/core/server'; type RetryableForConflicts = () => Promise; diff --git a/x-pack/platform/plugins/shared/alerting/server/lib/rule_execution_status.test.ts b/x-pack/platform/plugins/shared/alerting/server/lib/rule_execution_status.test.ts index bad1ba413f782..45afe9ab76f69 100644 --- a/x-pack/platform/plugins/shared/alerting/server/lib/rule_execution_status.test.ts +++ b/x-pack/platform/plugins/shared/alerting/server/lib/rule_execution_status.test.ts @@ -16,7 +16,8 @@ import { } from './rule_execution_status'; import { ErrorWithReason } from './error_with_reason'; import { translations } from '../constants/translations'; -import { RuleRunMetrics, RuleRunMetricsStore } from './rule_run_metrics_store'; +import type { RuleRunMetrics } from './rule_run_metrics_store'; +import { RuleRunMetricsStore } from './rule_run_metrics_store'; import { RuleResultService } from '../monitoring/rule_result_service'; const MockLogger = loggingSystemMock.create().get(); diff --git a/x-pack/platform/plugins/shared/alerting/server/lib/rule_execution_status.ts b/x-pack/platform/plugins/shared/alerting/server/lib/rule_execution_status.ts index 5ad7b8992a1ac..537c14216e245 100644 --- a/x-pack/platform/plugins/shared/alerting/server/lib/rule_execution_status.ts +++ b/x-pack/platform/plugins/shared/alerting/server/lib/rule_execution_status.ts @@ -5,24 +5,21 @@ * 2.0. */ -import { Logger } from '@kbn/core/server'; +import type { Logger } from '@kbn/core/server'; import { ActionsCompletion } from '@kbn/alerting-state-types'; -import { RuleResultService } from '../monitoring/rule_result_service'; +import type { RuleResultService } from '../monitoring/rule_result_service'; +import type { RuleExecutionStatus, RawRuleExecutionStatus, RawRule, Rule } from '../types'; import { - RuleExecutionStatus, RuleExecutionStatusValues, RuleExecutionStatusWarningReasons, - RawRuleExecutionStatus, - RawRule, - Rule, RuleExecutionStatusErrorReasons, } from '../types'; import { getReasonFromError } from './error_with_reason'; import { getEsErrorMessage } from './errors'; -import { RuleExecutionStatuses } from '../../common'; +import type { RuleExecutionStatuses } from '../../common'; import { translations } from '../constants/translations'; -import { RuleTaskStateAndMetrics } from '../task_runner/types'; -import { RuleRunMetrics } from './rule_run_metrics_store'; +import type { RuleTaskStateAndMetrics } from '../task_runner/types'; +import type { RuleRunMetrics } from './rule_run_metrics_store'; export interface IExecutionStatusAndMetrics { status: RuleExecutionStatus; diff --git a/x-pack/platform/plugins/shared/alerting/server/lib/rule_gaps/find_gaps.ts b/x-pack/platform/plugins/shared/alerting/server/lib/rule_gaps/find_gaps.ts index 7fabc8d9c877b..ea02707fe1b70 100644 --- a/x-pack/platform/plugins/shared/alerting/server/lib/rule_gaps/find_gaps.ts +++ b/x-pack/platform/plugins/shared/alerting/server/lib/rule_gaps/find_gaps.ts @@ -5,12 +5,12 @@ * 2.0. */ -import { IEventLogClient } from '@kbn/event-log-plugin/server'; -import { Logger } from '@kbn/core/server'; -import { SortResults } from '@elastic/elasticsearch/lib/api/types'; +import type { IEventLogClient } from '@kbn/event-log-plugin/server'; +import type { Logger } from '@kbn/core/server'; +import type { SortResults } from '@elastic/elasticsearch/lib/api/types'; import { RULE_SAVED_OBJECT_TYPE } from '../../saved_objects'; -import { FindGapsParams, FindGapsSearchAfterParams } from './types'; -import { Gap } from './gap'; +import type { FindGapsParams, FindGapsSearchAfterParams } from './types'; +import type { Gap } from './gap'; import { transformToGap } from './transforms/transform_to_gap'; import { buildGapsFilter } from './build_gaps_filter'; export const findGaps = async ({ diff --git a/x-pack/platform/plugins/shared/alerting/server/lib/rule_gaps/find_gaps_by_id.ts b/x-pack/platform/plugins/shared/alerting/server/lib/rule_gaps/find_gaps_by_id.ts index 2c79d20f6af75..457fc1fc9a103 100644 --- a/x-pack/platform/plugins/shared/alerting/server/lib/rule_gaps/find_gaps_by_id.ts +++ b/x-pack/platform/plugins/shared/alerting/server/lib/rule_gaps/find_gaps_by_id.ts @@ -5,11 +5,11 @@ * 2.0. */ -import { IEventLogClient } from '@kbn/event-log-plugin/server'; -import { Logger } from '@kbn/core/server'; +import type { IEventLogClient } from '@kbn/event-log-plugin/server'; +import type { Logger } from '@kbn/core/server'; import { RULE_SAVED_OBJECT_TYPE } from '../../saved_objects'; -import { FindGapsByIdParams } from './types'; -import { Gap } from './gap'; +import type { FindGapsByIdParams } from './types'; +import type { Gap } from './gap'; import { transformToGap } from './transforms/transform_to_gap'; export const findGapsById = async ({ diff --git a/x-pack/platform/plugins/shared/alerting/server/lib/rule_gaps/gap/index.test.ts b/x-pack/platform/plugins/shared/alerting/server/lib/rule_gaps/gap/index.test.ts index f37680deb0d9a..98f11c8815ef5 100644 --- a/x-pack/platform/plugins/shared/alerting/server/lib/rule_gaps/gap/index.test.ts +++ b/x-pack/platform/plugins/shared/alerting/server/lib/rule_gaps/gap/index.test.ts @@ -7,7 +7,7 @@ import { Gap } from '.'; // Adjust this import path as needed import { gapStatus } from '../../../../common/constants'; // Adjust as needed -import { Interval, StringInterval } from '../types'; // Adjust as needed +import type { Interval, StringInterval } from '../types'; // Adjust as needed // Helper function to create Interval objects from ISO strings function toInterval(gte: string, lte: string): Interval { diff --git a/x-pack/platform/plugins/shared/alerting/server/lib/rule_gaps/gap/index.ts b/x-pack/platform/plugins/shared/alerting/server/lib/rule_gaps/gap/index.ts index 7ad05c23f9bcc..a7ce79a050126 100644 --- a/x-pack/platform/plugins/shared/alerting/server/lib/rule_gaps/gap/index.ts +++ b/x-pack/platform/plugins/shared/alerting/server/lib/rule_gaps/gap/index.ts @@ -4,10 +4,11 @@ * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ -import { InternalFields } from '@kbn/event-log-plugin/server/es/cluster_client_adapter'; -import { GapStatus, gapStatus } from '../../../../common/constants'; +import type { InternalFields } from '@kbn/event-log-plugin/server/es/cluster_client_adapter'; +import type { GapStatus } from '../../../../common/constants'; +import { gapStatus } from '../../../../common/constants'; -import { Interval, StringInterval, GapBase } from '../types'; +import type { Interval, StringInterval, GapBase } from '../types'; import { mergeIntervals, diff --git a/x-pack/platform/plugins/shared/alerting/server/lib/rule_gaps/gap/interval_utils.test.ts b/x-pack/platform/plugins/shared/alerting/server/lib/rule_gaps/gap/interval_utils.test.ts index 25c85e6b4f5ae..6bf13a2ee9152 100644 --- a/x-pack/platform/plugins/shared/alerting/server/lib/rule_gaps/gap/interval_utils.test.ts +++ b/x-pack/platform/plugins/shared/alerting/server/lib/rule_gaps/gap/interval_utils.test.ts @@ -16,7 +16,7 @@ import { denormalizeInterval, clipInterval, } from './interval_utils'; -import { Interval, StringInterval } from '../types'; +import type { Interval, StringInterval } from '../types'; describe('interval_utils', () => { describe('getOverlap', () => { diff --git a/x-pack/platform/plugins/shared/alerting/server/lib/rule_gaps/gap/interval_utils.ts b/x-pack/platform/plugins/shared/alerting/server/lib/rule_gaps/gap/interval_utils.ts index fc80efc26a9fa..3adb694b9ea88 100644 --- a/x-pack/platform/plugins/shared/alerting/server/lib/rule_gaps/gap/interval_utils.ts +++ b/x-pack/platform/plugins/shared/alerting/server/lib/rule_gaps/gap/interval_utils.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { Interval, StringInterval } from '../types'; +import type { Interval, StringInterval } from '../types'; /** * Finds the overlapping portion of two intervals, if any. diff --git a/x-pack/platform/plugins/shared/alerting/server/lib/rule_gaps/mget_gaps.ts b/x-pack/platform/plugins/shared/alerting/server/lib/rule_gaps/mget_gaps.ts index 42b266a1efd32..22939b8c47901 100644 --- a/x-pack/platform/plugins/shared/alerting/server/lib/rule_gaps/mget_gaps.ts +++ b/x-pack/platform/plugins/shared/alerting/server/lib/rule_gaps/mget_gaps.ts @@ -5,9 +5,9 @@ * 2.0. */ -import { IEventLogClient } from '@kbn/event-log-plugin/server'; -import { Logger } from '@kbn/core/server'; -import { Gap } from './gap'; +import type { IEventLogClient } from '@kbn/event-log-plugin/server'; +import type { Logger } from '@kbn/core/server'; +import type { Gap } from './gap'; import { transformToGap } from './transforms/transform_to_gap'; export const mgetGaps = async ({ diff --git a/x-pack/platform/plugins/shared/alerting/server/lib/rule_gaps/transforms/transform_to_gap.test.ts b/x-pack/platform/plugins/shared/alerting/server/lib/rule_gaps/transforms/transform_to_gap.test.ts index 79f05f2e4bced..bb12184d8d17a 100644 --- a/x-pack/platform/plugins/shared/alerting/server/lib/rule_gaps/transforms/transform_to_gap.test.ts +++ b/x-pack/platform/plugins/shared/alerting/server/lib/rule_gaps/transforms/transform_to_gap.test.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { QueryEventsBySavedObjectResult } from '@kbn/event-log-plugin/server'; +import type { QueryEventsBySavedObjectResult } from '@kbn/event-log-plugin/server'; import { transformToGap } from './transform_to_gap'; import { Gap } from '../gap'; diff --git a/x-pack/platform/plugins/shared/alerting/server/lib/rule_gaps/transforms/transform_to_gap.ts b/x-pack/platform/plugins/shared/alerting/server/lib/rule_gaps/transforms/transform_to_gap.ts index cb1aa5b8f88f6..79d07f14b078a 100644 --- a/x-pack/platform/plugins/shared/alerting/server/lib/rule_gaps/transforms/transform_to_gap.ts +++ b/x-pack/platform/plugins/shared/alerting/server/lib/rule_gaps/transforms/transform_to_gap.ts @@ -4,9 +4,9 @@ * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ -import { QueryEventsBySavedObjectResult } from '@kbn/event-log-plugin/server'; +import type { QueryEventsBySavedObjectResult } from '@kbn/event-log-plugin/server'; import { Gap } from '../gap'; -import { StringInterval } from '../types'; +import type { StringInterval } from '../types'; type PotentialInterval = { lte?: string; gte?: string } | undefined; diff --git a/x-pack/platform/plugins/shared/alerting/server/lib/rule_gaps/types/index.ts b/x-pack/platform/plugins/shared/alerting/server/lib/rule_gaps/types/index.ts index 2dd27a04acc81..98a9a4180bbd7 100644 --- a/x-pack/platform/plugins/shared/alerting/server/lib/rule_gaps/types/index.ts +++ b/x-pack/platform/plugins/shared/alerting/server/lib/rule_gaps/types/index.ts @@ -5,14 +5,13 @@ * 2.0. */ -import { TypeOf } from '@kbn/config-schema'; -import { +import type { TypeOf } from '@kbn/config-schema'; +import type { gapBaseSchema, findGapsParamsSchema, findGapsByIdParamsSchema, findGapsSearchAfterParamsSchema, } from '../schemas'; - export type GapBase = TypeOf; export type FindGapsParams = TypeOf; export type FindGapsSearchAfterParams = TypeOf; diff --git a/x-pack/platform/plugins/shared/alerting/server/lib/rule_gaps/update/calculate_gaps_state.ts b/x-pack/platform/plugins/shared/alerting/server/lib/rule_gaps/update/calculate_gaps_state.ts index 711c60deccfe6..a863ac873893e 100644 --- a/x-pack/platform/plugins/shared/alerting/server/lib/rule_gaps/update/calculate_gaps_state.ts +++ b/x-pack/platform/plugins/shared/alerting/server/lib/rule_gaps/update/calculate_gaps_state.ts @@ -5,11 +5,11 @@ * 2.0. */ -import { ISavedObjectsRepository } from '@kbn/core/server'; -import { ActionsClient } from '@kbn/actions-plugin/server'; -import { Gap } from '../gap'; +import type { ISavedObjectsRepository } from '@kbn/core/server'; +import type { ActionsClient } from '@kbn/actions-plugin/server'; +import type { Gap } from '../gap'; import { updateGapFromSchedule } from './update_gap_from_schedule'; -import { BackfillClient } from '../../../backfill_client/backfill_client'; +import type { BackfillClient } from '../../../backfill_client/backfill_client'; /** * Find all overlapping backfill tasks and update the gap status accordingly diff --git a/x-pack/platform/plugins/shared/alerting/server/lib/rule_gaps/update/update_gap_from_schedule.ts b/x-pack/platform/plugins/shared/alerting/server/lib/rule_gaps/update/update_gap_from_schedule.ts index 5b15a754a8e11..e4f48a7edd424 100644 --- a/x-pack/platform/plugins/shared/alerting/server/lib/rule_gaps/update/update_gap_from_schedule.ts +++ b/x-pack/platform/plugins/shared/alerting/server/lib/rule_gaps/update/update_gap_from_schedule.ts @@ -5,10 +5,10 @@ * 2.0. */ -import { Gap } from '../gap'; +import type { Gap } from '../gap'; import { adHocRunStatus } from '../../../../common/constants'; import { parseDuration } from '../../../../common'; -import { BackfillSchedule } from '../../../application/backfill/result/types'; +import type { BackfillSchedule } from '../../../application/backfill/result/types'; export const updateGapFromSchedule = ({ gap, diff --git a/x-pack/platform/plugins/shared/alerting/server/lib/rule_gaps/update/update_gaps.ts b/x-pack/platform/plugins/shared/alerting/server/lib/rule_gaps/update/update_gaps.ts index 443ba4000202f..5fdf9d5198d4e 100644 --- a/x-pack/platform/plugins/shared/alerting/server/lib/rule_gaps/update/update_gaps.ts +++ b/x-pack/platform/plugins/shared/alerting/server/lib/rule_gaps/update/update_gaps.ts @@ -5,16 +5,16 @@ * 2.0. */ -import { Logger, ISavedObjectsRepository } from '@kbn/core/server'; -import { IEventLogClient, IEventLogger } from '@kbn/event-log-plugin/server'; -import { ActionsClient } from '@kbn/actions-plugin/server'; -import { SortResults } from '@elastic/elasticsearch/lib/api/types'; -import { BackfillClient } from '../../../backfill_client/backfill_client'; +import type { Logger, ISavedObjectsRepository } from '@kbn/core/server'; +import type { IEventLogClient, IEventLogger } from '@kbn/event-log-plugin/server'; +import type { SortResults } from '@elastic/elasticsearch/lib/api/types'; +import type { ActionsClient } from '@kbn/actions-plugin/server'; +import type { BackfillClient } from '../../../backfill_client/backfill_client'; import { AlertingEventLogger } from '../../alerting_event_logger/alerting_event_logger'; import { findGapsSearchAfter } from '../find_gaps'; -import { Gap } from '../gap'; +import type { Gap } from '../gap'; import { gapStatus } from '../../../../common/constants'; -import { BackfillSchedule } from '../../../application/backfill/result/types'; +import type { BackfillSchedule } from '../../../application/backfill/result/types'; import { adHocRunStatus } from '../../../../common/constants'; import { calculateGapStateFromAllBackfills } from './calculate_gaps_state'; import { updateGapFromSchedule } from './update_gap_from_schedule'; diff --git a/x-pack/platform/plugins/shared/alerting/server/lib/rule_run_metrics_store.ts b/x-pack/platform/plugins/shared/alerting/server/lib/rule_run_metrics_store.ts index e088586136eab..0d0a83d9c9468 100644 --- a/x-pack/platform/plugins/shared/alerting/server/lib/rule_run_metrics_store.ts +++ b/x-pack/platform/plugins/shared/alerting/server/lib/rule_run_metrics_store.ts @@ -7,8 +7,8 @@ import { set } from '@kbn/safer-lodash-set'; import { ActionsCompletion } from '@kbn/alerting-state-types'; -import { ActionsConfigMap } from './get_actions_config_map'; -import { SearchMetrics } from './types'; +import type { ActionsConfigMap } from './get_actions_config_map'; +import type { SearchMetrics } from './types'; interface State { numSearches: number; diff --git a/x-pack/platform/plugins/shared/alerting/server/lib/snooze/get_active_snooze_if_exist.test.ts b/x-pack/platform/plugins/shared/alerting/server/lib/snooze/get_active_snooze_if_exist.test.ts index 065986afded85..47d473e822e53 100644 --- a/x-pack/platform/plugins/shared/alerting/server/lib/snooze/get_active_snooze_if_exist.test.ts +++ b/x-pack/platform/plugins/shared/alerting/server/lib/snooze/get_active_snooze_if_exist.test.ts @@ -8,7 +8,7 @@ import moment from 'moment'; import { Frequency } from '@kbn/rrule'; import sinon from 'sinon'; -import { RRuleRecord } from '../../types'; +import type { RRuleRecord } from '../../types'; import { getActiveSnoozeIfExist } from './get_active_snooze_if_exist'; let fakeTimer: sinon.SinonFakeTimers; diff --git a/x-pack/platform/plugins/shared/alerting/server/lib/snooze/get_active_snooze_if_exist.ts b/x-pack/platform/plugins/shared/alerting/server/lib/snooze/get_active_snooze_if_exist.ts index 16d64b63f36f9..a7a1b4c240984 100644 --- a/x-pack/platform/plugins/shared/alerting/server/lib/snooze/get_active_snooze_if_exist.ts +++ b/x-pack/platform/plugins/shared/alerting/server/lib/snooze/get_active_snooze_if_exist.ts @@ -6,7 +6,7 @@ */ import { RRule, Weekday } from '@kbn/rrule'; -import { RuleSnoozeSchedule } from '../../types'; +import type { RuleSnoozeSchedule } from '../../types'; const MAX_TIMESTAMP = 8640000000000000; diff --git a/x-pack/platform/plugins/shared/alerting/server/lib/snooze/is_snooze_expired.test.ts b/x-pack/platform/plugins/shared/alerting/server/lib/snooze/is_snooze_expired.test.ts index f0a516e855aab..8494c1c6c5975 100644 --- a/x-pack/platform/plugins/shared/alerting/server/lib/snooze/is_snooze_expired.test.ts +++ b/x-pack/platform/plugins/shared/alerting/server/lib/snooze/is_snooze_expired.test.ts @@ -8,7 +8,7 @@ import sinon from 'sinon'; import { Frequency } from '@kbn/rrule'; import { isSnoozeExpired } from './is_snooze_expired'; -import { RRuleRecord } from '../../types'; +import type { RRuleRecord } from '../../types'; const DATE_9999 = '9999-12-31T12:34:56.789Z'; const DATE_1970 = '1970-01-01T00:00:00.000Z'; diff --git a/x-pack/platform/plugins/shared/alerting/server/lib/snooze/is_snooze_expired.ts b/x-pack/platform/plugins/shared/alerting/server/lib/snooze/is_snooze_expired.ts index 8222e895bc0c7..5198f79b2ea90 100644 --- a/x-pack/platform/plugins/shared/alerting/server/lib/snooze/is_snooze_expired.ts +++ b/x-pack/platform/plugins/shared/alerting/server/lib/snooze/is_snooze_expired.ts @@ -6,7 +6,7 @@ */ import { RRule, Weekday } from '@kbn/rrule'; -import { RuleSnoozeSchedule } from '../../types'; +import type { RuleSnoozeSchedule } from '../../types'; import { getActiveSnoozeIfExist } from './get_active_snooze_if_exist'; export function isSnoozeExpired(snooze: RuleSnoozeSchedule) { diff --git a/x-pack/platform/plugins/shared/alerting/server/lib/to_raw_alert_instances.ts b/x-pack/platform/plugins/shared/alerting/server/lib/to_raw_alert_instances.ts index df367d2db9b02..1676432aa3acf 100644 --- a/x-pack/platform/plugins/shared/alerting/server/lib/to_raw_alert_instances.ts +++ b/x-pack/platform/plugins/shared/alerting/server/lib/to_raw_alert_instances.ts @@ -6,8 +6,8 @@ */ import { keys } from 'lodash'; -import { Alert } from '../alert'; -import { AlertInstanceState, AlertInstanceContext, RawAlertInstance } from '../types'; +import type { Alert } from '../alert'; +import type { AlertInstanceState, AlertInstanceContext, RawAlertInstance } from '../types'; export function toRawAlertInstances< State extends AlertInstanceState, diff --git a/x-pack/platform/plugins/shared/alerting/server/lib/track_deprecated_route_usage.ts b/x-pack/platform/plugins/shared/alerting/server/lib/track_deprecated_route_usage.ts index aa163d5cd409a..47b2813cd85fe 100644 --- a/x-pack/platform/plugins/shared/alerting/server/lib/track_deprecated_route_usage.ts +++ b/x-pack/platform/plugins/shared/alerting/server/lib/track_deprecated_route_usage.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { UsageCounter } from '@kbn/usage-collection-plugin/server'; +import type { UsageCounter } from '@kbn/usage-collection-plugin/server'; export function trackDeprecatedRouteUsage(route: string, usageCounter?: UsageCounter) { if (usageCounter) { diff --git a/x-pack/platform/plugins/shared/alerting/server/lib/track_legacy_route_usage.ts b/x-pack/platform/plugins/shared/alerting/server/lib/track_legacy_route_usage.ts index 2d33322630ef4..e0484031b10e4 100644 --- a/x-pack/platform/plugins/shared/alerting/server/lib/track_legacy_route_usage.ts +++ b/x-pack/platform/plugins/shared/alerting/server/lib/track_legacy_route_usage.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { UsageCounter } from '@kbn/usage-collection-plugin/server'; +import type { UsageCounter } from '@kbn/usage-collection-plugin/server'; export function trackLegacyRouteUsage(route: string, usageCounter?: UsageCounter) { if (usageCounter) { diff --git a/x-pack/platform/plugins/shared/alerting/server/lib/types.ts b/x-pack/platform/plugins/shared/alerting/server/lib/types.ts index aa5c13c3fb564..4cce74aa090ef 100644 --- a/x-pack/platform/plugins/shared/alerting/server/lib/types.ts +++ b/x-pack/platform/plugins/shared/alerting/server/lib/types.ts @@ -5,8 +5,8 @@ * 2.0. */ -import { Rule } from '../types'; -import { RuleRunMetrics } from './rule_run_metrics_store'; +import type { Rule } from '../types'; +import type { RuleRunMetrics } from './rule_run_metrics_store'; export type RuleInfo = Pick & { spaceId: string }; diff --git a/x-pack/platform/plugins/shared/alerting/server/lib/validate_authorize_system_actions.test.ts b/x-pack/platform/plugins/shared/alerting/server/lib/validate_authorize_system_actions.test.ts index d5aeaa3f02bbe..22b7148b40d50 100644 --- a/x-pack/platform/plugins/shared/alerting/server/lib/validate_authorize_system_actions.test.ts +++ b/x-pack/platform/plugins/shared/alerting/server/lib/validate_authorize_system_actions.test.ts @@ -5,13 +5,13 @@ * 2.0. */ -import { ActionsAuthorization, ActionsClient } from '@kbn/actions-plugin/server'; +import type { ActionsAuthorization, ActionsClient } from '@kbn/actions-plugin/server'; import { actionsAuthorizationMock, actionsClientMock } from '@kbn/actions-plugin/server/mocks'; import { schema } from '@kbn/config-schema'; import { ConnectorAdapterRegistry } from '../connector_adapters/connector_adapter_registry'; -import { ConnectorAdapter } from '../connector_adapters/types'; -import { NormalizedSystemAction } from '../rules_client'; -import { RuleSystemAction } from '../types'; +import type { ConnectorAdapter } from '../connector_adapters/types'; +import type { NormalizedSystemAction } from '../rules_client'; +import type { RuleSystemAction } from '../types'; import { validateAndAuthorizeSystemActions } from './validate_authorize_system_actions'; describe('validateAndAuthorizeSystemActions', () => { diff --git a/x-pack/platform/plugins/shared/alerting/server/lib/validate_authorize_system_actions.ts b/x-pack/platform/plugins/shared/alerting/server/lib/validate_authorize_system_actions.ts index 3c88797581ef1..8ef3374352abf 100644 --- a/x-pack/platform/plugins/shared/alerting/server/lib/validate_authorize_system_actions.ts +++ b/x-pack/platform/plugins/shared/alerting/server/lib/validate_authorize_system_actions.ts @@ -6,12 +6,12 @@ */ import Boom from '@hapi/boom'; -import { ActionsAuthorization, ActionsClient } from '@kbn/actions-plugin/server'; -import { ConnectorAdapterRegistry } from '../connector_adapters/connector_adapter_registry'; +import type { ActionsAuthorization, ActionsClient } from '@kbn/actions-plugin/server'; +import type { ConnectorAdapterRegistry } from '../connector_adapters/connector_adapter_registry'; import { getSystemActionKibanaPrivileges } from '../connector_adapters/get_system_action_kibana_privileges'; import { bulkValidateConnectorAdapterActionParams } from '../connector_adapters/validate_rule_action_params'; -import { NormalizedSystemAction } from '../rules_client'; -import { RuleSystemAction } from '../types'; +import type { NormalizedSystemAction } from '../rules_client'; +import type { RuleSystemAction } from '../types'; interface Params { actionsClient: ActionsClient; actionsAuthorization: ActionsAuthorization; diff --git a/x-pack/platform/plugins/shared/alerting/server/lib/validate_mutated_rule_type_params.ts b/x-pack/platform/plugins/shared/alerting/server/lib/validate_mutated_rule_type_params.ts index 52d7b768137b2..aa66e3d8d9841 100644 --- a/x-pack/platform/plugins/shared/alerting/server/lib/validate_mutated_rule_type_params.ts +++ b/x-pack/platform/plugins/shared/alerting/server/lib/validate_mutated_rule_type_params.ts @@ -6,7 +6,7 @@ */ import Boom from '@hapi/boom'; -import { RuleTypeParams, RuleTypeParamsValidator } from '../types'; +import type { RuleTypeParams, RuleTypeParamsValidator } from '../types'; export function validateMutatedRuleTypeParams( mutatedParams: Params, diff --git a/x-pack/platform/plugins/shared/alerting/server/lib/validate_rule_type_params.ts b/x-pack/platform/plugins/shared/alerting/server/lib/validate_rule_type_params.ts index 0f152bb6f641b..c9608d3bb8a99 100644 --- a/x-pack/platform/plugins/shared/alerting/server/lib/validate_rule_type_params.ts +++ b/x-pack/platform/plugins/shared/alerting/server/lib/validate_rule_type_params.ts @@ -6,7 +6,7 @@ */ import Boom from '@hapi/boom'; -import { RuleTypeParams, RuleTypeParamsValidator } from '../types'; +import type { RuleTypeParams, RuleTypeParamsValidator } from '../types'; export function validateRuleTypeParams( params: Record, diff --git a/x-pack/platform/plugins/shared/alerting/server/lib/validate_snooze_schedule.ts b/x-pack/platform/plugins/shared/alerting/server/lib/validate_snooze_schedule.ts index a6e9059be9857..6940a9d64fbfb 100644 --- a/x-pack/platform/plugins/shared/alerting/server/lib/validate_snooze_schedule.ts +++ b/x-pack/platform/plugins/shared/alerting/server/lib/validate_snooze_schedule.ts @@ -7,7 +7,7 @@ import { Frequency } from '@kbn/rrule'; import moment from 'moment'; -import { RuleSnoozeSchedule } from '../types'; +import type { RuleSnoozeSchedule } from '../types'; export const validateSnoozeSchedule = (schedule: RuleSnoozeSchedule) => { const intervalIsDaily = schedule.rRule.freq === Frequency.DAILY; diff --git a/x-pack/platform/plugins/shared/alerting/server/lib/wrap_scoped_cluster_client.test.ts b/x-pack/platform/plugins/shared/alerting/server/lib/wrap_scoped_cluster_client.test.ts index 60c4de3859fcc..c7edae07f22a6 100644 --- a/x-pack/platform/plugins/shared/alerting/server/lib/wrap_scoped_cluster_client.test.ts +++ b/x-pack/platform/plugins/shared/alerting/server/lib/wrap_scoped_cluster_client.test.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { Client } from '@elastic/elasticsearch'; +import type { Client } from '@elastic/elasticsearch'; import { loggingSystemMock } from '@kbn/core/server/mocks'; import { elasticsearchServiceMock } from '@kbn/core/server/mocks'; import { createWrappedScopedClusterClientFactory } from './wrap_scoped_cluster_client'; @@ -741,7 +741,7 @@ describe('wrapScopedClusterClient', () => { }); }); -function getMockClusterClients(asCurrentUser: boolean = false) { +function getMockClusterClients(asCurrentUser = false) { const abortController = new AbortController(); const scopedClusterClient = elasticsearchServiceMock.createScopedClusterClient(); const childClient = elasticsearchServiceMock.createElasticsearchClient(); diff --git a/x-pack/platform/plugins/shared/alerting/server/lib/wrap_scoped_cluster_client.ts b/x-pack/platform/plugins/shared/alerting/server/lib/wrap_scoped_cluster_client.ts index 002895843bf48..e8fcebe70e13f 100644 --- a/x-pack/platform/plugins/shared/alerting/server/lib/wrap_scoped_cluster_client.ts +++ b/x-pack/platform/plugins/shared/alerting/server/lib/wrap_scoped_cluster_client.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { +import type { TransportRequestOptions, TransportResult, TransportRequestOptionsWithMeta, @@ -25,7 +25,7 @@ import type { EqlSearchRequest as EqlSearchRequestWithBody, } from '@elastic/elasticsearch/lib/api/types'; import type { IScopedClusterClient, ElasticsearchClient, Logger } from '@kbn/core/server'; -import { SearchMetrics, RuleInfo } from './types'; +import type { SearchMetrics, RuleInfo } from './types'; interface WrapScopedClusterClientFactoryOpts { scopedClusterClient: IScopedClusterClient; @@ -57,9 +57,9 @@ export interface WrappedScopedClusterClient { export function createWrappedScopedClusterClientFactory( opts: WrapScopedClusterClientFactoryOpts ): WrappedScopedClusterClient { - let numSearches: number = 0; - let esSearchDurationMs: number = 0; - let totalSearchDurationMs: number = 0; + let numSearches = 0; + let esSearchDurationMs = 0; + let totalSearchDurationMs = 0; function logMetrics(metrics: LogSearchMetricsOpts) { numSearches++; diff --git a/x-pack/platform/plugins/shared/alerting/server/lib/wrap_search_source_client.test.ts b/x-pack/platform/plugins/shared/alerting/server/lib/wrap_search_source_client.test.ts index 2eb51cfd06f7a..c1603c6c98055 100644 --- a/x-pack/platform/plugins/shared/alerting/server/lib/wrap_search_source_client.test.ts +++ b/x-pack/platform/plugins/shared/alerting/server/lib/wrap_search_source_client.test.ts @@ -6,7 +6,7 @@ */ import { loggingSystemMock } from '@kbn/core/server/mocks'; -import { ISearchStartSearchSource } from '@kbn/data-plugin/common'; +import type { ISearchStartSearchSource } from '@kbn/data-plugin/common'; import { createSearchSourceMock } from '@kbn/data-plugin/common/search/search_source/mocks'; import { of, throwError } from 'rxjs'; import { wrapSearchSourceClient } from './wrap_search_source_client'; diff --git a/x-pack/platform/plugins/shared/alerting/server/lib/wrap_search_source_client.ts b/x-pack/platform/plugins/shared/alerting/server/lib/wrap_search_source_client.ts index e1cf3cba0bd24..4d814f7006a93 100644 --- a/x-pack/platform/plugins/shared/alerting/server/lib/wrap_search_source_client.ts +++ b/x-pack/platform/plugins/shared/alerting/server/lib/wrap_search_source_client.ts @@ -5,16 +5,16 @@ * 2.0. */ -import { Logger } from '@kbn/core/server'; -import { ISearchOptions } from '@kbn/search-types'; -import { +import type { Logger } from '@kbn/core/server'; +import type { ISearchOptions } from '@kbn/search-types'; +import type { ISearchSource, ISearchStartSearchSource, SearchSource, SerializedSearchSourceFields, } from '@kbn/data-plugin/common'; import { catchError, tap, throwError } from 'rxjs'; -import { LogSearchMetricsOpts, RuleInfo, SearchMetrics } from './types'; +import type { LogSearchMetricsOpts, RuleInfo, SearchMetrics } from './types'; interface Props { logger: Logger; @@ -45,9 +45,9 @@ export function wrapSearchSourceClient({ searchSourceClient: pureSearchSourceClient, requestTimeout, }: Props): WrappedSearchSourceClient { - let numSearches: number = 0; - let esSearchDurationMs: number = 0; - let totalSearchDurationMs: number = 0; + let numSearches = 0; + let esSearchDurationMs = 0; + let totalSearchDurationMs = 0; function logMetrics(metrics: LogSearchMetricsOpts) { numSearches++; diff --git a/x-pack/platform/plugins/shared/alerting/server/maintenance_window_client.mock.ts b/x-pack/platform/plugins/shared/alerting/server/maintenance_window_client.mock.ts index f7b8d685d73bc..a42c2fdc1ffbd 100644 --- a/x-pack/platform/plugins/shared/alerting/server/maintenance_window_client.mock.ts +++ b/x-pack/platform/plugins/shared/alerting/server/maintenance_window_client.mock.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { MaintenanceWindowClientApi } from './types'; +import type { MaintenanceWindowClientApi } from './types'; type Schema = MaintenanceWindowClientApi; export type MaintenanceWindowClientMock = jest.Mocked; diff --git a/x-pack/platform/plugins/shared/alerting/server/maintenance_window_client/maintenance_window_client.ts b/x-pack/platform/plugins/shared/alerting/server/maintenance_window_client/maintenance_window_client.ts index dba7ae0800ede..f80496cd479ce 100644 --- a/x-pack/platform/plugins/shared/alerting/server/maintenance_window_client/maintenance_window_client.ts +++ b/x-pack/platform/plugins/shared/alerting/server/maintenance_window_client/maintenance_window_client.ts @@ -4,7 +4,7 @@ * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ -import { IUiSettingsClient, Logger, SavedObjectsClientContract } from '@kbn/core/server'; +import type { IUiSettingsClient, Logger, SavedObjectsClientContract } from '@kbn/core/server'; import { createMaintenanceWindow } from '../application/maintenance_window/methods/create/create_maintenance_window'; import type { CreateMaintenanceWindowParams } from '../application/maintenance_window/methods/create/types'; @@ -29,7 +29,7 @@ import type { BulkGetMaintenanceWindowsParams, BulkGetMaintenanceWindowsResult, } from '../application/maintenance_window/methods/bulk_get/types'; -import { +import type { MaintenanceWindowModificationMetadata, MaintenanceWindowClientContext, } from '../../common'; diff --git a/x-pack/platform/plugins/shared/alerting/server/maintenance_window_client_factory.test.ts b/x-pack/platform/plugins/shared/alerting/server/maintenance_window_client_factory.test.ts index 85ac758da1737..8f2fb3b177667 100644 --- a/x-pack/platform/plugins/shared/alerting/server/maintenance_window_client_factory.test.ts +++ b/x-pack/platform/plugins/shared/alerting/server/maintenance_window_client_factory.test.ts @@ -5,10 +5,8 @@ * 2.0. */ import { mockRouter } from '@kbn/core-http-router-server-mocks'; -import { - MaintenanceWindowClientFactory, - MaintenanceWindowClientFactoryOpts, -} from './maintenance_window_client_factory'; +import type { MaintenanceWindowClientFactoryOpts } from './maintenance_window_client_factory'; +import { MaintenanceWindowClientFactory } from './maintenance_window_client_factory'; import { savedObjectsClientMock, savedObjectsServiceMock, @@ -16,7 +14,7 @@ import { uiSettingsServiceMock, securityServiceMock, } from '@kbn/core/server/mocks'; -import { AuthenticatedUser } from '@kbn/security-plugin/common'; +import type { AuthenticatedUser } from '@kbn/security-plugin/common'; import { SECURITY_EXTENSION_ID } from '@kbn/core-saved-objects-server'; import { MAINTENANCE_WINDOW_SAVED_OBJECT_TYPE } from '../common'; diff --git a/x-pack/platform/plugins/shared/alerting/server/maintenance_window_client_factory.ts b/x-pack/platform/plugins/shared/alerting/server/maintenance_window_client_factory.ts index 5cd013784637c..b9dc22ded1480 100644 --- a/x-pack/platform/plugins/shared/alerting/server/maintenance_window_client_factory.ts +++ b/x-pack/platform/plugins/shared/alerting/server/maintenance_window_client_factory.ts @@ -5,14 +5,14 @@ * 2.0. */ -import { +import type { KibanaRequest, Logger, SavedObjectsServiceStart, - SECURITY_EXTENSION_ID, SecurityServiceStart, UiSettingsServiceStart, } from '@kbn/core/server'; +import { SECURITY_EXTENSION_ID } from '@kbn/core/server'; import { MaintenanceWindowClient } from './maintenance_window_client'; import { MAINTENANCE_WINDOW_SAVED_OBJECT_TYPE } from '../common'; diff --git a/x-pack/platform/plugins/shared/alerting/server/maintenance_window_feature.ts b/x-pack/platform/plugins/shared/alerting/server/maintenance_window_feature.ts index 1ae24c1c45f09..6395d05387d84 100644 --- a/x-pack/platform/plugins/shared/alerting/server/maintenance_window_feature.ts +++ b/x-pack/platform/plugins/shared/alerting/server/maintenance_window_feature.ts @@ -6,7 +6,7 @@ */ import { i18n } from '@kbn/i18n'; -import { KibanaFeatureConfig } from '@kbn/features-plugin/common'; +import type { KibanaFeatureConfig } from '@kbn/features-plugin/common'; import { DEFAULT_APP_CATEGORIES } from '@kbn/core/server'; import { KibanaFeatureScope } from '@kbn/features-plugin/common'; import { diff --git a/x-pack/platform/plugins/shared/alerting/server/mocks.ts b/x-pack/platform/plugins/shared/alerting/server/mocks.ts index d885cf0721b4e..61fe1c1193e18 100644 --- a/x-pack/platform/plugins/shared/alerting/server/mocks.ts +++ b/x-pack/platform/plugins/shared/alerting/server/mocks.ts @@ -12,11 +12,11 @@ import { } from '@kbn/core/server/mocks'; import { dataViewPluginMocks } from '@kbn/data-views-plugin/public/mocks'; import { searchSourceCommonMock } from '@kbn/data-plugin/common/search/search_source/mocks'; -import { SharePluginStart } from '@kbn/share-plugin/server'; +import type { SharePluginStart } from '@kbn/share-plugin/server'; import { rulesClientMock } from './rules_client.mock'; -import { AlertingServerSetup, AlertingServerStart } from './plugin'; -import { Alert, AlertFactoryDoneUtils } from './alert'; -import { +import type { AlertingServerSetup, AlertingServerStart } from './plugin'; +import type { Alert, AlertFactoryDoneUtils } from './alert'; +import type { AlertInstanceContext, AlertInstanceState, PublicRuleResultService, diff --git a/x-pack/platform/plugins/shared/alerting/server/monitoring/in_memory_metrics.ts b/x-pack/platform/plugins/shared/alerting/server/monitoring/in_memory_metrics.ts index a2d0425da1427..9c8ef9809a1b0 100644 --- a/x-pack/platform/plugins/shared/alerting/server/monitoring/in_memory_metrics.ts +++ b/x-pack/platform/plugins/shared/alerting/server/monitoring/in_memory_metrics.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { Logger } from '@kbn/logging'; +import type { Logger } from '@kbn/logging'; export enum IN_MEMORY_METRICS { RULE_EXECUTIONS = 'ruleExecutions', diff --git a/x-pack/platform/plugins/shared/alerting/server/monitoring/register_cluster_collector.test.ts b/x-pack/platform/plugins/shared/alerting/server/monitoring/register_cluster_collector.test.ts index 0fac6df62330f..2a5e47e3f1c01 100644 --- a/x-pack/platform/plugins/shared/alerting/server/monitoring/register_cluster_collector.test.ts +++ b/x-pack/platform/plugins/shared/alerting/server/monitoring/register_cluster_collector.test.ts @@ -5,12 +5,12 @@ * 2.0. */ import { coreMock } from '@kbn/core/public/mocks'; -import { CoreSetup } from '@kbn/core/server'; +import type { CoreSetup } from '@kbn/core/server'; import { monitoringCollectionMock } from '@kbn/monitoring-collection-plugin/server/mocks'; -import { Metric } from '@kbn/monitoring-collection-plugin/server'; +import type { Metric } from '@kbn/monitoring-collection-plugin/server'; import { registerClusterCollector } from './register_cluster_collector'; -import { AlertingPluginsStart } from '../plugin'; -import { ClusterRulesMetric } from './types'; +import type { AlertingPluginsStart } from '../plugin'; +import type { ClusterRulesMetric } from './types'; jest.useFakeTimers(); jest.setSystemTime(new Date('2020-03-09').getTime()); diff --git a/x-pack/platform/plugins/shared/alerting/server/monitoring/register_cluster_collector.ts b/x-pack/platform/plugins/shared/alerting/server/monitoring/register_cluster_collector.ts index 93fe8a44f1367..fd2ff60291a7f 100644 --- a/x-pack/platform/plugins/shared/alerting/server/monitoring/register_cluster_collector.ts +++ b/x-pack/platform/plugins/shared/alerting/server/monitoring/register_cluster_collector.ts @@ -8,11 +8,12 @@ import type { AggregationsKeyedPercentiles, AggregationsPercentilesAggregateBase, } from '@elastic/elasticsearch/lib/api/types'; -import { MonitoringCollectionSetup } from '@kbn/monitoring-collection-plugin/server'; +import type { MonitoringCollectionSetup } from '@kbn/monitoring-collection-plugin/server'; import { aggregateTaskOverduePercentilesForType } from '@kbn/task-manager-plugin/server'; -import { CoreSetup } from '@kbn/core/server'; -import { AlertingPluginsStart } from '../plugin'; -import { ClusterRulesMetric, EMPTY_CLUSTER_RULES_METRICS } from './types'; +import type { CoreSetup } from '@kbn/core/server'; +import type { AlertingPluginsStart } from '../plugin'; +import type { ClusterRulesMetric } from './types'; +import { EMPTY_CLUSTER_RULES_METRICS } from './types'; export function registerClusterCollector({ monitoringCollection, diff --git a/x-pack/platform/plugins/shared/alerting/server/monitoring/register_node_collector.test.ts b/x-pack/platform/plugins/shared/alerting/server/monitoring/register_node_collector.test.ts index a17cf5b47020b..06173531612f8 100644 --- a/x-pack/platform/plugins/shared/alerting/server/monitoring/register_node_collector.test.ts +++ b/x-pack/platform/plugins/shared/alerting/server/monitoring/register_node_collector.test.ts @@ -6,9 +6,9 @@ */ import { monitoringCollectionMock } from '@kbn/monitoring-collection-plugin/server/mocks'; import { loggingSystemMock } from '@kbn/core/server/mocks'; -import { Metric } from '@kbn/monitoring-collection-plugin/server'; +import type { Metric } from '@kbn/monitoring-collection-plugin/server'; import { registerNodeCollector } from './register_node_collector'; -import { NodeRulesMetric } from './types'; +import type { NodeRulesMetric } from './types'; import { InMemoryMetrics, IN_MEMORY_METRICS } from '.'; jest.mock('./in_memory_metrics'); diff --git a/x-pack/platform/plugins/shared/alerting/server/monitoring/register_node_collector.ts b/x-pack/platform/plugins/shared/alerting/server/monitoring/register_node_collector.ts index 839787c6e78fc..172a17cc1794a 100644 --- a/x-pack/platform/plugins/shared/alerting/server/monitoring/register_node_collector.ts +++ b/x-pack/platform/plugins/shared/alerting/server/monitoring/register_node_collector.ts @@ -4,9 +4,9 @@ * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ -import { MonitoringCollectionSetup } from '@kbn/monitoring-collection-plugin/server'; +import type { MonitoringCollectionSetup } from '@kbn/monitoring-collection-plugin/server'; import { IN_MEMORY_METRICS } from '.'; -import { InMemoryMetrics } from './in_memory_metrics'; +import type { InMemoryMetrics } from './in_memory_metrics'; export function registerNodeCollector({ monitoringCollection, diff --git a/x-pack/platform/plugins/shared/alerting/server/monitoring/rule_monitoring_service.ts b/x-pack/platform/plugins/shared/alerting/server/monitoring/rule_monitoring_service.ts index 07d4098018610..ebe6db019758d 100644 --- a/x-pack/platform/plugins/shared/alerting/server/monitoring/rule_monitoring_service.ts +++ b/x-pack/platform/plugins/shared/alerting/server/monitoring/rule_monitoring_service.ts @@ -6,7 +6,7 @@ */ import { getDefaultMonitoring, getExecutionDurationPercentiles } from '../lib/monitoring'; -import { RuleMonitoring, RuleMonitoringHistory, PublicRuleMonitoringService } from '../types'; +import type { RuleMonitoring, RuleMonitoringHistory, PublicRuleMonitoringService } from '../types'; export class RuleMonitoringService { private monitoring: RuleMonitoring = getDefaultMonitoring(new Date().toISOString()); diff --git a/x-pack/platform/plugins/shared/alerting/server/monitoring/rule_result_service.test.ts b/x-pack/platform/plugins/shared/alerting/server/monitoring/rule_result_service.test.ts index bb4168b7d162a..4f2c52c06083f 100644 --- a/x-pack/platform/plugins/shared/alerting/server/monitoring/rule_result_service.test.ts +++ b/x-pack/platform/plugins/shared/alerting/server/monitoring/rule_result_service.test.ts @@ -5,8 +5,9 @@ * 2.0. */ -import { PublicLastRunSetters } from '../types'; -import { RuleResultServiceResults, RuleResultService } from './rule_result_service'; +import type { PublicLastRunSetters } from '../types'; +import type { RuleResultServiceResults } from './rule_result_service'; +import { RuleResultService } from './rule_result_service'; describe('RuleResultService', () => { let ruleResultService: RuleResultService; diff --git a/x-pack/platform/plugins/shared/alerting/server/monitoring/rule_result_service.ts b/x-pack/platform/plugins/shared/alerting/server/monitoring/rule_result_service.ts index 1646efb29797a..f2f9d01ddbaf0 100644 --- a/x-pack/platform/plugins/shared/alerting/server/monitoring/rule_result_service.ts +++ b/x-pack/platform/plugins/shared/alerting/server/monitoring/rule_result_service.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { PublicLastRunSetters } from '../types'; +import type { PublicLastRunSetters } from '../types'; export interface RuleResultServiceResults { errors: LastRunError[]; @@ -21,7 +21,7 @@ interface LastRunError { export class RuleResultService { private errors: LastRunError[] = []; private warnings: string[] = []; - private outcomeMessage: string = ''; + private outcomeMessage = ''; public getLastRunErrors(): LastRunError[] { return this.errors; @@ -51,7 +51,7 @@ export class RuleResultService { }; } - private addLastRunError(message: string, userError: boolean = false) { + private addLastRunError(message: string, userError = false) { this.errors.push({ message, userError }); } diff --git a/x-pack/platform/plugins/shared/alerting/server/monitoring/types.ts b/x-pack/platform/plugins/shared/alerting/server/monitoring/types.ts index ae469733a1f07..e8f4a2f2904e1 100644 --- a/x-pack/platform/plugins/shared/alerting/server/monitoring/types.ts +++ b/x-pack/platform/plugins/shared/alerting/server/monitoring/types.ts @@ -4,7 +4,7 @@ * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ -import { MetricResult } from '@kbn/monitoring-collection-plugin/server'; +import type { MetricResult } from '@kbn/monitoring-collection-plugin/server'; export const EMPTY_CLUSTER_RULES_METRICS: ClusterRulesMetric = { overdue: { diff --git a/x-pack/platform/plugins/shared/alerting/server/plugin.test.ts b/x-pack/platform/plugins/shared/alerting/server/plugin.test.ts index bfc8b3ef8b7b8..b3ccb66a7f258 100644 --- a/x-pack/platform/plugins/shared/alerting/server/plugin.test.ts +++ b/x-pack/platform/plugins/shared/alerting/server/plugin.test.ts @@ -5,24 +5,25 @@ * 2.0. */ -import { AlertingPlugin, AlertingServerSetup } from './plugin'; +import type { AlertingServerSetup } from './plugin'; +import { AlertingPlugin } from './plugin'; import { createUsageCollectionSetupMock } from '@kbn/usage-collection-plugin/server/mocks'; import { coreMock, statusServiceMock } from '@kbn/core/server/mocks'; import { licensingMock } from '@kbn/licensing-plugin/server/mocks'; import { encryptedSavedObjectsMock } from '@kbn/encrypted-saved-objects-plugin/server/mocks'; import { taskManagerMock } from '@kbn/task-manager-plugin/server/mocks'; import { eventLogServiceMock } from '@kbn/event-log-plugin/server/event_log_service.mock'; -import { KibanaRequest } from '@kbn/core/server'; +import type { KibanaRequest } from '@kbn/core/server'; import { featuresPluginMock } from '@kbn/features-plugin/server/mocks'; import { KibanaFeature } from '@kbn/features-plugin/server'; -import { AlertingConfig } from './config'; -import { RuleType } from './types'; +import type { AlertingConfig } from './config'; +import type { RuleType } from './types'; import { eventLogMock } from '@kbn/event-log-plugin/server/mocks'; import { actionsMock } from '@kbn/actions-plugin/server/mocks'; import { dataPluginMock } from '@kbn/data-plugin/server/mocks'; import { dataPluginMock as autocompletePluginMock } from '@kbn/unified-search-plugin/server/mocks'; import { monitoringCollectionMock } from '@kbn/monitoring-collection-plugin/server/mocks'; -import { +import type { DataViewsServerPluginStart, PluginSetup as DataPluginSetup, } from '@kbn/data-plugin/server'; @@ -36,7 +37,7 @@ const mockAlertService = alertsServiceMock.create(); jest.mock('./alerts_service/alerts_service', () => ({ AlertsService: jest.fn().mockImplementation(() => mockAlertService), })); -import { SharePluginStart } from '@kbn/share-plugin/server'; +import type { SharePluginStart } from '@kbn/share-plugin/server'; import { dataViewPluginMocks } from '@kbn/data-views-plugin/public/mocks'; import { generateAlertingConfig } from './test_utils'; diff --git a/x-pack/platform/plugins/shared/alerting/server/plugin.ts b/x-pack/platform/plugins/shared/alerting/server/plugin.ts index c9d9f0164cdd4..953815940be05 100644 --- a/x-pack/platform/plugins/shared/alerting/server/plugin.ts +++ b/x-pack/platform/plugins/shared/alerting/server/plugin.ts @@ -6,30 +6,24 @@ */ import type { PublicMethodsOf } from '@kbn/utility-types'; -import { - BehaviorSubject, - ReplaySubject, - Subject, - Observable, - map, - distinctUntilChanged, -} from 'rxjs'; +import type { Subject, Observable } from 'rxjs'; +import { BehaviorSubject, ReplaySubject, map, distinctUntilChanged } from 'rxjs'; import { pick } from 'lodash'; -import { UsageCollectionSetup, UsageCounter } from '@kbn/usage-collection-plugin/server'; -import { SecurityPluginSetup, SecurityPluginStart } from '@kbn/security-plugin/server'; -import { PluginSetup as DataPluginSetup } from '@kbn/data-plugin/server'; -import { PluginStart as DataViewsPluginStart } from '@kbn/data-views-plugin/server'; -import { +import type { UsageCollectionSetup, UsageCounter } from '@kbn/usage-collection-plugin/server'; +import type { SecurityPluginSetup, SecurityPluginStart } from '@kbn/security-plugin/server'; +import type { PluginSetup as DataPluginSetup } from '@kbn/data-plugin/server'; +import type { PluginStart as DataViewsPluginStart } from '@kbn/data-views-plugin/server'; +import type { EncryptedSavedObjectsPluginSetup, EncryptedSavedObjectsPluginStart, } from '@kbn/encrypted-saved-objects-plugin/server'; -import { +import type { TaskManagerSetupContract, TaskManagerStartContract, } from '@kbn/task-manager-plugin/server'; import { DEFAULT_SPACE_ID } from '@kbn/spaces-plugin/common'; -import { SpacesPluginStart } from '@kbn/spaces-plugin/server'; -import { +import type { SpacesPluginStart } from '@kbn/spaces-plugin/server'; +import type { KibanaRequest, Logger, PluginInitializerContext, @@ -39,28 +33,25 @@ import { StatusServiceSetup, ServiceStatus, SavedObjectsBulkGetObject, - ServiceStatusLevels, CoreStatus, } from '@kbn/core/server'; -import { - LICENSE_TYPE, - LicensingPluginSetup, - LicensingPluginStart, -} from '@kbn/licensing-plugin/server'; -import { +import { ServiceStatusLevels } from '@kbn/core/server'; +import type { LicensingPluginSetup, LicensingPluginStart } from '@kbn/licensing-plugin/server'; +import { LICENSE_TYPE } from '@kbn/licensing-plugin/server'; +import type { PluginSetupContract as ActionsPluginSetupContract, PluginStartContract as ActionsPluginStartContract, } from '@kbn/actions-plugin/server'; -import { +import type { IEventLogger, IEventLogService, IEventLogClientService, } from '@kbn/event-log-plugin/server'; -import { FeaturesPluginStart, FeaturesPluginSetup } from '@kbn/features-plugin/server'; +import type { FeaturesPluginStart, FeaturesPluginSetup } from '@kbn/features-plugin/server'; import type { PluginSetup as UnifiedSearchServerPluginSetup } from '@kbn/unified-search-plugin/server'; -import { PluginStart as DataPluginStart } from '@kbn/data-plugin/server'; -import { MonitoringCollectionSetup } from '@kbn/monitoring-collection-plugin/server'; -import { SharePluginStart } from '@kbn/share-plugin/server'; +import type { PluginStart as DataPluginStart } from '@kbn/data-plugin/server'; +import type { MonitoringCollectionSetup } from '@kbn/monitoring-collection-plugin/server'; +import type { SharePluginStart } from '@kbn/share-plugin/server'; import { RuleTypeRegistry } from './rule_type_registry'; import { TaskRunnerFactory } from './task_runner'; @@ -71,10 +62,12 @@ import { getRulesSettingsFeature, } from './rules_settings'; import { MaintenanceWindowClientFactory } from './maintenance_window_client_factory'; -import { ILicenseState, LicenseState } from './lib/license_state'; -import { AlertingRequestHandlerContext, ALERTING_FEATURE_ID, RuleAlertData } from './types'; +import type { ILicenseState } from './lib/license_state'; +import { LicenseState } from './lib/license_state'; +import type { AlertingRequestHandlerContext, RuleAlertData } from './types'; +import { ALERTING_FEATURE_ID } from './types'; import { defineRoutes } from './routes'; -import { +import type { AlertInstanceContext, AlertInstanceState, AlertsHealth, @@ -95,11 +88,12 @@ import { scheduleApiKeyInvalidatorTask, } from './invalidate_pending_api_keys/task'; import { scheduleAlertingHealthCheck, initializeAlertingHealth } from './health'; -import { AlertingConfig, AlertingRulesConfig } from './config'; +import type { AlertingConfig, AlertingRulesConfig } from './config'; import { getHealth } from './health/get_health'; import { AlertingAuthorizationClientFactory } from './alerting_authorization_client_factory'; -import { AlertingAuthorization } from './authorization'; -import { getSecurityHealth, SecurityHealth } from './lib/get_security_health'; +import type { AlertingAuthorization } from './authorization'; +import type { SecurityHealth } from './lib/get_security_health'; +import { getSecurityHealth } from './lib/get_security_health'; import { registerNodeCollector, registerClusterCollector, InMemoryMetrics } from './monitoring'; import { getRuleTaskTimeout } from './lib/get_rule_task_timeout'; import { getActionsConfigMap } from './lib/get_actions_config_map'; @@ -111,9 +105,11 @@ import { } from './alerts_service'; import { maintenanceWindowFeature } from './maintenance_window_feature'; import { ConnectorAdapterRegistry } from './connector_adapters/connector_adapter_registry'; -import { ConnectorAdapter, ConnectorAdapterParams } from './connector_adapters/types'; -import { DataStreamAdapter, getDataStreamAdapter } from './alerts_service/lib/data_stream_adapter'; -import { createGetAlertIndicesAliasFn, GetAlertIndicesAlias } from './lib'; +import type { ConnectorAdapter, ConnectorAdapterParams } from './connector_adapters/types'; +import type { DataStreamAdapter } from './alerts_service/lib/data_stream_adapter'; +import { getDataStreamAdapter } from './alerts_service/lib/data_stream_adapter'; +import type { GetAlertIndicesAlias } from './lib'; +import { createGetAlertIndicesAliasFn } from './lib'; import { BackfillClient } from './backfill_client/backfill_client'; import { MaintenanceWindowsService } from './task_runner/maintenance_windows'; diff --git a/x-pack/platform/plugins/shared/alerting/server/routes/_mock_handler_arguments.ts b/x-pack/platform/plugins/shared/alerting/server/routes/_mock_handler_arguments.ts index a24ea147d4113..282e9e9aafecd 100644 --- a/x-pack/platform/plugins/shared/alerting/server/routes/_mock_handler_arguments.ts +++ b/x-pack/platform/plugins/shared/alerting/server/routes/_mock_handler_arguments.ts @@ -5,22 +5,19 @@ * 2.0. */ -import { KibanaRequest, KibanaResponseFactory } from '@kbn/core/server'; +import type { KibanaRequest, KibanaResponseFactory } from '@kbn/core/server'; import { identity } from 'lodash'; import type { MethodKeysOf } from '@kbn/utility-types'; import { httpServerMock } from '@kbn/core/server/mocks'; import { actionsClientMock } from '@kbn/actions-plugin/server/mocks'; import type { ActionsClientMock } from '@kbn/actions-plugin/server/mocks'; -import { rulesClientMock, RulesClientMock } from '../rules_client.mock'; -import { - rulesSettingsClientMock, - RulesSettingsClientMock, -} from '../rules_settings/rules_settings_client.mock'; -import { - maintenanceWindowClientMock, - MaintenanceWindowClientMock, -} from '../maintenance_window_client.mock'; -import { AlertsHealth, RuleType } from '../../common'; +import type { RulesClientMock } from '../rules_client.mock'; +import { rulesClientMock } from '../rules_client.mock'; +import type { RulesSettingsClientMock } from '../rules_settings/rules_settings_client.mock'; +import { rulesSettingsClientMock } from '../rules_settings/rules_settings_client.mock'; +import type { MaintenanceWindowClientMock } from '../maintenance_window_client.mock'; +import { maintenanceWindowClientMock } from '../maintenance_window_client.mock'; +import type { AlertsHealth, RuleType } from '../../common'; import type { AlertingRequestHandlerContext } from '../types'; export function mockHandlerArguments( diff --git a/x-pack/platform/plugins/shared/alerting/server/routes/backfill/apis/delete/delete_backfill_route.ts b/x-pack/platform/plugins/shared/alerting/server/routes/backfill/apis/delete/delete_backfill_route.ts index 0f9b62db62d79..1fd7bb941c354 100644 --- a/x-pack/platform/plugins/shared/alerting/server/routes/backfill/apis/delete/delete_backfill_route.ts +++ b/x-pack/platform/plugins/shared/alerting/server/routes/backfill/apis/delete/delete_backfill_route.ts @@ -4,14 +4,13 @@ * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ -import { IRouter } from '@kbn/core/server'; -import { - deleteParamsSchemaV1, - DeleteBackfillRequestParamsV1, -} from '../../../../../common/routes/backfill/apis/delete'; -import { ILicenseState } from '../../../../lib'; +import type { IRouter } from '@kbn/core/server'; +import type { DeleteBackfillRequestParamsV1 } from '../../../../../common/routes/backfill/apis/delete'; +import { deleteParamsSchemaV1 } from '../../../../../common/routes/backfill/apis/delete'; +import type { ILicenseState } from '../../../../lib'; import { verifyAccessAndContext } from '../../../lib'; -import { AlertingRequestHandlerContext, INTERNAL_BASE_ALERTING_API_PATH } from '../../../../types'; +import type { AlertingRequestHandlerContext } from '../../../../types'; +import { INTERNAL_BASE_ALERTING_API_PATH } from '../../../../types'; import { DEFAULT_ALERTING_ROUTE_SECURITY } from '../../../constants'; export const deleteBackfillRoute = ( diff --git a/x-pack/platform/plugins/shared/alerting/server/routes/backfill/apis/find/find_backfill_route.test.ts b/x-pack/platform/plugins/shared/alerting/server/routes/backfill/apis/find/find_backfill_route.test.ts index 47d8e7c8f69aa..3329c4d3700e1 100644 --- a/x-pack/platform/plugins/shared/alerting/server/routes/backfill/apis/find/find_backfill_route.test.ts +++ b/x-pack/platform/plugins/shared/alerting/server/routes/backfill/apis/find/find_backfill_route.test.ts @@ -12,7 +12,7 @@ import { mockHandlerArguments } from '../../../_mock_handler_arguments'; import { transformRequestV1, transformResponseV1 } from './transforms'; import { rulesClientMock } from '../../../../rules_client.mock'; import { findBackfillRoute } from './find_backfill_route'; -import { FindBackfillResult } from '../../../../application/backfill/methods/find/types'; +import type { FindBackfillResult } from '../../../../application/backfill/methods/find/types'; const rulesClient = rulesClientMock.create(); diff --git a/x-pack/platform/plugins/shared/alerting/server/routes/backfill/apis/find/find_backfill_route.ts b/x-pack/platform/plugins/shared/alerting/server/routes/backfill/apis/find/find_backfill_route.ts index bc092b8bf9cc6..1816020e474bc 100644 --- a/x-pack/platform/plugins/shared/alerting/server/routes/backfill/apis/find/find_backfill_route.ts +++ b/x-pack/platform/plugins/shared/alerting/server/routes/backfill/apis/find/find_backfill_route.ts @@ -4,18 +4,16 @@ * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ -import { IRouter } from '@kbn/core/server'; -import { - findQuerySchemaV1, +import type { IRouter } from '@kbn/core/server'; +import type { FindBackfillRequestQueryV1, FindBackfillResponseV1, } from '../../../../../common/routes/backfill/apis/find'; -import { ILicenseState } from '../../../../lib'; +import { findQuerySchemaV1 } from '../../../../../common/routes/backfill/apis/find'; +import type { ILicenseState } from '../../../../lib'; import { verifyAccessAndContext } from '../../../lib'; -import { - AlertingRequestHandlerContext, - INTERNAL_ALERTING_BACKFILL_FIND_API_PATH, -} from '../../../../types'; +import type { AlertingRequestHandlerContext } from '../../../../types'; +import { INTERNAL_ALERTING_BACKFILL_FIND_API_PATH } from '../../../../types'; import { transformRequestV1, transformResponseV1 } from './transforms'; import { DEFAULT_ALERTING_ROUTE_SECURITY } from '../../../constants'; diff --git a/x-pack/platform/plugins/shared/alerting/server/routes/backfill/apis/find/transforms/transform_request/v1.ts b/x-pack/platform/plugins/shared/alerting/server/routes/backfill/apis/find/transforms/transform_request/v1.ts index 3425f5dea83f4..d3781651ea338 100644 --- a/x-pack/platform/plugins/shared/alerting/server/routes/backfill/apis/find/transforms/transform_request/v1.ts +++ b/x-pack/platform/plugins/shared/alerting/server/routes/backfill/apis/find/transforms/transform_request/v1.ts @@ -6,8 +6,8 @@ */ /* eslint-disable @typescript-eslint/naming-convention */ -import { FindBackfillRequestQueryV1 } from '../../../../../../../common/routes/backfill/apis/find'; -import { FindBackfillParams } from '../../../../../../application/backfill/methods/find/types'; +import type { FindBackfillRequestQueryV1 } from '../../../../../../../common/routes/backfill/apis/find'; +import type { FindBackfillParams } from '../../../../../../application/backfill/methods/find/types'; export const transformRequest = ({ end, diff --git a/x-pack/platform/plugins/shared/alerting/server/routes/backfill/apis/find/transforms/transform_response/v1.ts b/x-pack/platform/plugins/shared/alerting/server/routes/backfill/apis/find/transforms/transform_response/v1.ts index ce959b92d963b..8ac884ff60086 100644 --- a/x-pack/platform/plugins/shared/alerting/server/routes/backfill/apis/find/transforms/transform_response/v1.ts +++ b/x-pack/platform/plugins/shared/alerting/server/routes/backfill/apis/find/transforms/transform_response/v1.ts @@ -6,7 +6,7 @@ */ import type { FindBackfillResult } from '../../../../../../application/backfill/methods/find/types'; -import { FindBackfillResponseBodyV1 } from '../../../../../../../common/routes/backfill/apis/find'; +import type { FindBackfillResponseBodyV1 } from '../../../../../../../common/routes/backfill/apis/find'; import { transformBackfillToBackfillResponseV1 } from '../../../../transforms'; export const transformResponse = ({ diff --git a/x-pack/platform/plugins/shared/alerting/server/routes/backfill/apis/get/get_backfill_route.test.ts b/x-pack/platform/plugins/shared/alerting/server/routes/backfill/apis/get/get_backfill_route.test.ts index 6b7aafbc14e86..bad94cd111dbf 100644 --- a/x-pack/platform/plugins/shared/alerting/server/routes/backfill/apis/get/get_backfill_route.test.ts +++ b/x-pack/platform/plugins/shared/alerting/server/routes/backfill/apis/get/get_backfill_route.test.ts @@ -11,7 +11,7 @@ import { verifyApiAccess } from '../../../../lib/license_api_access'; import { mockHandlerArguments } from '../../../_mock_handler_arguments'; import { rulesClientMock } from '../../../../rules_client.mock'; import { getBackfillRoute } from './get_backfill_route'; -import { Backfill } from '../../../../application/backfill/result/types'; +import type { Backfill } from '../../../../application/backfill/result/types'; import { transformBackfillToBackfillResponseV1 } from '../../transforms'; const rulesClient = rulesClientMock.create(); diff --git a/x-pack/platform/plugins/shared/alerting/server/routes/backfill/apis/get/get_backfill_route.ts b/x-pack/platform/plugins/shared/alerting/server/routes/backfill/apis/get/get_backfill_route.ts index 8bd306931b867..196658884b156 100644 --- a/x-pack/platform/plugins/shared/alerting/server/routes/backfill/apis/get/get_backfill_route.ts +++ b/x-pack/platform/plugins/shared/alerting/server/routes/backfill/apis/get/get_backfill_route.ts @@ -4,15 +4,16 @@ * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ -import { IRouter } from '@kbn/core/server'; -import { - getParamsSchemaV1, +import type { IRouter } from '@kbn/core/server'; +import type { GetBackfillRequestParamsV1, GetBackfillResponseV1, } from '../../../../../common/routes/backfill/apis/get'; -import { ILicenseState } from '../../../../lib'; +import { getParamsSchemaV1 } from '../../../../../common/routes/backfill/apis/get'; +import type { ILicenseState } from '../../../../lib'; import { verifyAccessAndContext } from '../../../lib'; -import { AlertingRequestHandlerContext, INTERNAL_BASE_ALERTING_API_PATH } from '../../../../types'; +import type { AlertingRequestHandlerContext } from '../../../../types'; +import { INTERNAL_BASE_ALERTING_API_PATH } from '../../../../types'; import { transformBackfillToBackfillResponseV1 } from '../../transforms'; import { DEFAULT_ALERTING_ROUTE_SECURITY } from '../../../constants'; diff --git a/x-pack/platform/plugins/shared/alerting/server/routes/backfill/apis/schedule/schedule_backfill_route.test.ts b/x-pack/platform/plugins/shared/alerting/server/routes/backfill/apis/schedule/schedule_backfill_route.test.ts index 670f86671ff8b..fe33c8cfd7705 100644 --- a/x-pack/platform/plugins/shared/alerting/server/routes/backfill/apis/schedule/schedule_backfill_route.test.ts +++ b/x-pack/platform/plugins/shared/alerting/server/routes/backfill/apis/schedule/schedule_backfill_route.test.ts @@ -12,7 +12,7 @@ import { mockHandlerArguments } from '../../../_mock_handler_arguments'; import { transformRequestV1, transformResponseV1 } from './transforms'; import { rulesClientMock } from '../../../../rules_client.mock'; import { scheduleBackfillRoute } from './schedule_backfill_route'; -import { ScheduleBackfillResults } from '../../../../application/backfill/methods/schedule/types'; +import type { ScheduleBackfillResults } from '../../../../application/backfill/methods/schedule/types'; const rulesClient = rulesClientMock.create(); diff --git a/x-pack/platform/plugins/shared/alerting/server/routes/backfill/apis/schedule/schedule_backfill_route.ts b/x-pack/platform/plugins/shared/alerting/server/routes/backfill/apis/schedule/schedule_backfill_route.ts index e73e0dd83ec8d..5a6269e5d46f8 100644 --- a/x-pack/platform/plugins/shared/alerting/server/routes/backfill/apis/schedule/schedule_backfill_route.ts +++ b/x-pack/platform/plugins/shared/alerting/server/routes/backfill/apis/schedule/schedule_backfill_route.ts @@ -4,15 +4,16 @@ * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ -import { IRouter } from '@kbn/core/server'; -import { - scheduleBodySchemaV1, +import type { IRouter } from '@kbn/core/server'; +import type { ScheduleBackfillRequestBodyV1, ScheduleBackfillResponseV1, } from '../../../../../common/routes/backfill/apis/schedule'; -import { ILicenseState } from '../../../../lib'; +import { scheduleBodySchemaV1 } from '../../../../../common/routes/backfill/apis/schedule'; +import type { ILicenseState } from '../../../../lib'; import { verifyAccessAndContext } from '../../../lib'; -import { AlertingRequestHandlerContext, INTERNAL_BASE_ALERTING_API_PATH } from '../../../../types'; +import type { AlertingRequestHandlerContext } from '../../../../types'; +import { INTERNAL_BASE_ALERTING_API_PATH } from '../../../../types'; import { transformRequestV1, transformResponseV1 } from './transforms'; import { DEFAULT_ALERTING_ROUTE_SECURITY } from '../../../constants'; diff --git a/x-pack/platform/plugins/shared/alerting/server/routes/backfill/apis/schedule/transforms/transform_request/v1.ts b/x-pack/platform/plugins/shared/alerting/server/routes/backfill/apis/schedule/transforms/transform_request/v1.ts index 83e8a6e82c5ca..973d004e7d9dd 100644 --- a/x-pack/platform/plugins/shared/alerting/server/routes/backfill/apis/schedule/transforms/transform_request/v1.ts +++ b/x-pack/platform/plugins/shared/alerting/server/routes/backfill/apis/schedule/transforms/transform_request/v1.ts @@ -6,8 +6,8 @@ */ /* eslint-disable @typescript-eslint/naming-convention */ -import { ScheduleBackfillRequestBodyV1 } from '../../../../../../../common/routes/backfill/apis/schedule'; -import { ScheduleBackfillParams } from '../../../../../../application/backfill/methods/schedule/types'; +import type { ScheduleBackfillRequestBodyV1 } from '../../../../../../../common/routes/backfill/apis/schedule'; +import type { ScheduleBackfillParams } from '../../../../../../application/backfill/methods/schedule/types'; export const transformRequest = (request: ScheduleBackfillRequestBodyV1): ScheduleBackfillParams => request.map(({ rule_id, start, end, run_actions }) => ({ diff --git a/x-pack/platform/plugins/shared/alerting/server/routes/backfill/apis/schedule/transforms/transform_response/v1.ts b/x-pack/platform/plugins/shared/alerting/server/routes/backfill/apis/schedule/transforms/transform_response/v1.ts index 697169277e75f..f2845ebaaaa9c 100644 --- a/x-pack/platform/plugins/shared/alerting/server/routes/backfill/apis/schedule/transforms/transform_response/v1.ts +++ b/x-pack/platform/plugins/shared/alerting/server/routes/backfill/apis/schedule/transforms/transform_response/v1.ts @@ -11,7 +11,7 @@ import type { ScheduleBackfillResult, ScheduleBackfillResults, } from '../../../../../../application/backfill/methods/schedule/types'; -import { ScheduleBackfillResponseBodyV1 } from '../../../../../../../common/routes/backfill/apis/schedule'; +import type { ScheduleBackfillResponseBodyV1 } from '../../../../../../../common/routes/backfill/apis/schedule'; import { transformBackfillToBackfillResponseV1 } from '../../../../transforms'; export const transformResponse = ( diff --git a/x-pack/platform/plugins/shared/alerting/server/routes/backfill/transforms/transform_backfill_to_backfill_response/v1.test.ts b/x-pack/platform/plugins/shared/alerting/server/routes/backfill/transforms/transform_backfill_to_backfill_response/v1.test.ts index fe4a0c96e6d4f..7f03b2903698c 100644 --- a/x-pack/platform/plugins/shared/alerting/server/routes/backfill/transforms/transform_backfill_to_backfill_response/v1.test.ts +++ b/x-pack/platform/plugins/shared/alerting/server/routes/backfill/transforms/transform_backfill_to_backfill_response/v1.test.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { Backfill } from '../../../../application/backfill/result/types'; +import type { Backfill } from '../../../../application/backfill/result/types'; import { transformBackfillToBackfillResponse } from './v1'; describe('transformBackfillToBackfillResponse', () => { diff --git a/x-pack/platform/plugins/shared/alerting/server/routes/backfill/transforms/transform_backfill_to_backfill_response/v1.ts b/x-pack/platform/plugins/shared/alerting/server/routes/backfill/transforms/transform_backfill_to_backfill_response/v1.ts index c1c0a3aa53cd1..3f8d264b0fc13 100644 --- a/x-pack/platform/plugins/shared/alerting/server/routes/backfill/transforms/transform_backfill_to_backfill_response/v1.ts +++ b/x-pack/platform/plugins/shared/alerting/server/routes/backfill/transforms/transform_backfill_to_backfill_response/v1.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { Backfill } from '../../../../application/backfill/result/types'; +import type { Backfill } from '../../../../application/backfill/result/types'; export const transformBackfillToBackfillResponse = (backfill: Backfill) => { const { createdAt, rule, spaceId, schedule, ...rest } = backfill; diff --git a/x-pack/platform/plugins/shared/alerting/server/routes/framework/apis/health/health.test.ts b/x-pack/platform/plugins/shared/alerting/server/routes/framework/apis/health/health.test.ts index 83773ab8531b7..62da7fc000fd1 100644 --- a/x-pack/platform/plugins/shared/alerting/server/routes/framework/apis/health/health.test.ts +++ b/x-pack/platform/plugins/shared/alerting/server/routes/framework/apis/health/health.test.ts @@ -15,7 +15,7 @@ import { encryptedSavedObjectsMock } from '@kbn/encrypted-saved-objects-plugin/s import { rulesClientMock } from '../../../../rules_client.mock'; import { alertsMock } from '../../../../mocks'; import { RecoveredActionGroup } from '../../../../../common'; -import { RegistryAlertTypeWithAuth } from '../../../../authorization'; +import type { RegistryAlertTypeWithAuth } from '../../../../authorization'; const rulesClient = rulesClientMock.create(); diff --git a/x-pack/platform/plugins/shared/alerting/server/routes/framework/apis/health/health.ts b/x-pack/platform/plugins/shared/alerting/server/routes/framework/apis/health/health.ts index df926820e2af8..1bdd000ba9385 100644 --- a/x-pack/platform/plugins/shared/alerting/server/routes/framework/apis/health/health.ts +++ b/x-pack/platform/plugins/shared/alerting/server/routes/framework/apis/health/health.ts @@ -5,16 +5,13 @@ * 2.0. */ -import { IRouter } from '@kbn/core/server'; -import { EncryptedSavedObjectsPluginSetup } from '@kbn/encrypted-saved-objects-plugin/server'; +import type { IRouter } from '@kbn/core/server'; +import type { EncryptedSavedObjectsPluginSetup } from '@kbn/encrypted-saved-objects-plugin/server'; import { healthFrameworkResponseSchemaV1 } from '../../../../../common/routes/framework/apis/health'; -import { ILicenseState } from '../../../../lib'; +import type { ILicenseState } from '../../../../lib'; import { verifyAccessAndContext } from '../../../lib'; -import { - AlertingRequestHandlerContext, - BASE_ALERTING_API_PATH, - AlertingFrameworkHealth, -} from '../../../../types'; +import type { AlertingRequestHandlerContext, AlertingFrameworkHealth } from '../../../../types'; +import { BASE_ALERTING_API_PATH } from '../../../../types'; import { getSecurityHealth } from '../../../../lib/get_security_health'; import { transformHealthBodyResponse } from './transforms/transform_health_response/v1'; import { DEFAULT_ALERTING_ROUTE_SECURITY } from '../../../constants'; diff --git a/x-pack/platform/plugins/shared/alerting/server/routes/framework/apis/health/transforms/transform_health_response/v1.ts b/x-pack/platform/plugins/shared/alerting/server/routes/framework/apis/health/transforms/transform_health_response/v1.ts index 76c4a46aee5d1..cf9ea5adeea7a 100644 --- a/x-pack/platform/plugins/shared/alerting/server/routes/framework/apis/health/transforms/transform_health_response/v1.ts +++ b/x-pack/platform/plugins/shared/alerting/server/routes/framework/apis/health/transforms/transform_health_response/v1.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { AlertingFrameworkHealth } from '../../../../../../types'; +import type { AlertingFrameworkHealth } from '../../../../../../types'; import type { HealthFrameworkResponseBodyV1 } from '../../../../../../../common/routes/framework/apis/health'; export const transformHealthBodyResponse = ( diff --git a/x-pack/platform/plugins/shared/alerting/server/routes/gaps/apis/fill/fill_gap_by_id_route.test.ts b/x-pack/platform/plugins/shared/alerting/server/routes/gaps/apis/fill/fill_gap_by_id_route.test.ts index a840b00a514a2..6764e25e5b7d0 100644 --- a/x-pack/platform/plugins/shared/alerting/server/routes/gaps/apis/fill/fill_gap_by_id_route.test.ts +++ b/x-pack/platform/plugins/shared/alerting/server/routes/gaps/apis/fill/fill_gap_by_id_route.test.ts @@ -11,7 +11,7 @@ import { verifyApiAccess } from '../../../../lib/license_api_access'; import { mockHandlerArguments } from '../../../_mock_handler_arguments'; import { rulesClientMock } from '../../../../rules_client.mock'; import { fillGapByIdRoute } from './fill_gap_by_id_route'; -import { ScheduleBackfillResults } from '../../../../application/backfill/methods/schedule/types'; +import type { ScheduleBackfillResults } from '../../../../application/backfill/methods/schedule/types'; jest.mock('../../../../lib/license_api_access', () => ({ verifyApiAccess: jest.fn(), diff --git a/x-pack/platform/plugins/shared/alerting/server/routes/gaps/apis/fill/fill_gap_by_id_route.ts b/x-pack/platform/plugins/shared/alerting/server/routes/gaps/apis/fill/fill_gap_by_id_route.ts index 678cf5ee7df4a..da3442da0926a 100644 --- a/x-pack/platform/plugins/shared/alerting/server/routes/gaps/apis/fill/fill_gap_by_id_route.ts +++ b/x-pack/platform/plugins/shared/alerting/server/routes/gaps/apis/fill/fill_gap_by_id_route.ts @@ -4,18 +4,14 @@ * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ -import { IRouter } from '@kbn/core/server'; -import { - fillGapByIdQuerySchemaV1, - FillGapByIdQueryV1, -} from '../../../../../common/routes/gaps/apis/fill'; -import { ScheduleBackfillResponseV1 } from '../../../../../common/routes/backfill/apis/schedule'; -import { ILicenseState } from '../../../../lib'; +import type { IRouter } from '@kbn/core/server'; +import type { FillGapByIdQueryV1 } from '../../../../../common/routes/gaps/apis/fill'; +import { fillGapByIdQuerySchemaV1 } from '../../../../../common/routes/gaps/apis/fill'; +import type { ScheduleBackfillResponseV1 } from '../../../../../common/routes/backfill/apis/schedule'; +import type { ILicenseState } from '../../../../lib'; import { verifyAccessAndContext } from '../../../lib'; -import { - AlertingRequestHandlerContext, - INTERNAL_ALERTING_GAPS_FILL_BY_ID_API_PATH, -} from '../../../../types'; +import type { AlertingRequestHandlerContext } from '../../../../types'; +import { INTERNAL_ALERTING_GAPS_FILL_BY_ID_API_PATH } from '../../../../types'; import { transformRequestV1 } from './transforms'; import { transformResponseV1 } from '../../../backfill/apis/schedule/transforms'; diff --git a/x-pack/platform/plugins/shared/alerting/server/routes/gaps/apis/fill/transforms/transform_request/v1.ts b/x-pack/platform/plugins/shared/alerting/server/routes/gaps/apis/fill/transforms/transform_request/v1.ts index 4edde31754726..3b4c22928f9f4 100644 --- a/x-pack/platform/plugins/shared/alerting/server/routes/gaps/apis/fill/transforms/transform_request/v1.ts +++ b/x-pack/platform/plugins/shared/alerting/server/routes/gaps/apis/fill/transforms/transform_request/v1.ts @@ -6,8 +6,8 @@ */ /* eslint-disable @typescript-eslint/naming-convention */ -import { FillGapByIdQueryV1 } from '../../../../../../../common/routes/gaps/apis/fill'; -import { FillGapByIdParams } from '../../../../../../application/rule/methods/fill_gap_by_id/types'; +import type { FillGapByIdQueryV1 } from '../../../../../../../common/routes/gaps/apis/fill'; +import type { FillGapByIdParams } from '../../../../../../application/rule/methods/fill_gap_by_id/types'; export const transformRequest = ({ rule_id, gap_id }: FillGapByIdQueryV1): FillGapByIdParams => ({ gapId: gap_id, diff --git a/x-pack/platform/plugins/shared/alerting/server/routes/gaps/apis/find/find_gaps_route.ts b/x-pack/platform/plugins/shared/alerting/server/routes/gaps/apis/find/find_gaps_route.ts index 4efd7db6ff698..e1cbc97d1df6b 100644 --- a/x-pack/platform/plugins/shared/alerting/server/routes/gaps/apis/find/find_gaps_route.ts +++ b/x-pack/platform/plugins/shared/alerting/server/routes/gaps/apis/find/find_gaps_route.ts @@ -4,18 +4,16 @@ * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ -import { IRouter } from '@kbn/core/server'; -import { - findGapsBodySchemaV1, +import type { IRouter } from '@kbn/core/server'; +import type { FindGapsRequestBodyV1, FindGapsResponseV1, } from '../../../../../common/routes/gaps/apis/find'; -import { ILicenseState } from '../../../../lib'; +import { findGapsBodySchemaV1 } from '../../../../../common/routes/gaps/apis/find'; +import type { ILicenseState } from '../../../../lib'; import { verifyAccessAndContext } from '../../../lib'; -import { - AlertingRequestHandlerContext, - INTERNAL_ALERTING_GAPS_FIND_API_PATH, -} from '../../../../types'; +import type { AlertingRequestHandlerContext } from '../../../../types'; +import { INTERNAL_ALERTING_GAPS_FIND_API_PATH } from '../../../../types'; import { transformRequestV1, transformResponseV1 } from './transforms'; export const findGapsRoute = ( diff --git a/x-pack/platform/plugins/shared/alerting/server/routes/gaps/apis/find/transforms/transform_request/v1.ts b/x-pack/platform/plugins/shared/alerting/server/routes/gaps/apis/find/transforms/transform_request/v1.ts index 10676936c369f..b74e389fdd61c 100644 --- a/x-pack/platform/plugins/shared/alerting/server/routes/gaps/apis/find/transforms/transform_request/v1.ts +++ b/x-pack/platform/plugins/shared/alerting/server/routes/gaps/apis/find/transforms/transform_request/v1.ts @@ -6,8 +6,8 @@ */ /* eslint-disable @typescript-eslint/naming-convention */ -import { FindGapsRequestBodyV1 } from '../../../../../../../common/routes/gaps/apis/find'; -import { FindGapsParams } from '../../../../../../lib/rule_gaps/types'; +import type { FindGapsRequestBodyV1 } from '../../../../../../../common/routes/gaps/apis/find'; +import type { FindGapsParams } from '../../../../../../lib/rule_gaps/types'; export const transformRequest = ({ page, diff --git a/x-pack/platform/plugins/shared/alerting/server/routes/gaps/apis/find/transforms/transform_response/v1.ts b/x-pack/platform/plugins/shared/alerting/server/routes/gaps/apis/find/transforms/transform_response/v1.ts index 25d1108a51e82..7f2fc60c9e57a 100644 --- a/x-pack/platform/plugins/shared/alerting/server/routes/gaps/apis/find/transforms/transform_response/v1.ts +++ b/x-pack/platform/plugins/shared/alerting/server/routes/gaps/apis/find/transforms/transform_response/v1.ts @@ -5,9 +5,9 @@ * 2.0. */ -import { FindGapsResponseBodyV1 } from '../../../../../../../common/routes/gaps/apis/find'; +import type { FindGapsResponseBodyV1 } from '../../../../../../../common/routes/gaps/apis/find'; -import { Gap } from '../../../../../../lib/rule_gaps/gap'; +import type { Gap } from '../../../../../../lib/rule_gaps/gap'; export const transformResponse = ({ page, diff --git a/x-pack/platform/plugins/shared/alerting/server/routes/gaps/apis/get_gaps_summary_by_rule_ids/get_gaps_summary_by_rule_ids_route.ts b/x-pack/platform/plugins/shared/alerting/server/routes/gaps/apis/get_gaps_summary_by_rule_ids/get_gaps_summary_by_rule_ids_route.ts index e8c070d1961ab..aaa04e6bf929a 100644 --- a/x-pack/platform/plugins/shared/alerting/server/routes/gaps/apis/get_gaps_summary_by_rule_ids/get_gaps_summary_by_rule_ids_route.ts +++ b/x-pack/platform/plugins/shared/alerting/server/routes/gaps/apis/get_gaps_summary_by_rule_ids/get_gaps_summary_by_rule_ids_route.ts @@ -4,18 +4,16 @@ * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ -import { IRouter } from '@kbn/core/server'; -import { - getGapsSummaryByRuleIdsBodySchemaV1, +import type { IRouter } from '@kbn/core/server'; +import type { GetGapsSummaryByRuleIdsBodyV1, GetGapsSummaryByRuleIdsResponseV1, } from '../../../../../common/routes/gaps/apis/get_gaps_summary_by_rule_ids'; -import { ILicenseState } from '../../../../lib'; +import { getGapsSummaryByRuleIdsBodySchemaV1 } from '../../../../../common/routes/gaps/apis/get_gaps_summary_by_rule_ids'; +import type { ILicenseState } from '../../../../lib'; import { verifyAccessAndContext } from '../../../lib'; -import { - AlertingRequestHandlerContext, - INTERNAL_ALERTING_GAPS_GET_SUMMARY_BY_RULE_IDS_API_PATH, -} from '../../../../types'; +import type { AlertingRequestHandlerContext } from '../../../../types'; +import { INTERNAL_ALERTING_GAPS_GET_SUMMARY_BY_RULE_IDS_API_PATH } from '../../../../types'; import { transformRequestV1, transformResponseV1 } from './transforms'; export const getGapsSummaryByRuleIdsRoute = ( diff --git a/x-pack/platform/plugins/shared/alerting/server/routes/gaps/apis/get_gaps_summary_by_rule_ids/transforms/transform_request/v1.ts b/x-pack/platform/plugins/shared/alerting/server/routes/gaps/apis/get_gaps_summary_by_rule_ids/transforms/transform_request/v1.ts index b55de9dbdc45b..4dcb3c3bd99b3 100644 --- a/x-pack/platform/plugins/shared/alerting/server/routes/gaps/apis/get_gaps_summary_by_rule_ids/transforms/transform_request/v1.ts +++ b/x-pack/platform/plugins/shared/alerting/server/routes/gaps/apis/get_gaps_summary_by_rule_ids/transforms/transform_request/v1.ts @@ -6,8 +6,8 @@ */ /* eslint-disable @typescript-eslint/naming-convention */ -import { GetGapsSummaryByRuleIdsParams } from '../../../../../../application/rule/methods/get_gaps_summary_by_rule_ids/types'; -import { GetGapsSummaryByRuleIdsBodyV1 } from '../../../../../../../common/routes/gaps/apis/get_gaps_summary_by_rule_ids'; +import type { GetGapsSummaryByRuleIdsParams } from '../../../../../../application/rule/methods/get_gaps_summary_by_rule_ids/types'; +import type { GetGapsSummaryByRuleIdsBodyV1 } from '../../../../../../../common/routes/gaps/apis/get_gaps_summary_by_rule_ids'; export const transformRequest = ({ rule_ids, diff --git a/x-pack/platform/plugins/shared/alerting/server/routes/gaps/apis/get_gaps_summary_by_rule_ids/transforms/transform_response/v1.ts b/x-pack/platform/plugins/shared/alerting/server/routes/gaps/apis/get_gaps_summary_by_rule_ids/transforms/transform_response/v1.ts index 5634818a7425c..8aec2ce2b72e2 100644 --- a/x-pack/platform/plugins/shared/alerting/server/routes/gaps/apis/get_gaps_summary_by_rule_ids/transforms/transform_response/v1.ts +++ b/x-pack/platform/plugins/shared/alerting/server/routes/gaps/apis/get_gaps_summary_by_rule_ids/transforms/transform_response/v1.ts @@ -5,8 +5,8 @@ * 2.0. */ -import { GetGapsSummaryByRuleIdsResponse } from '../../../../../../application/rule/methods/get_gaps_summary_by_rule_ids/types'; -import { GetGapsSummaryByRuleIdsResponseBodyV1 } from '../../../../../../../common/routes/gaps/apis/get_gaps_summary_by_rule_ids'; +import type { GetGapsSummaryByRuleIdsResponse } from '../../../../../../application/rule/methods/get_gaps_summary_by_rule_ids/types'; +import type { GetGapsSummaryByRuleIdsResponseBodyV1 } from '../../../../../../../common/routes/gaps/apis/get_gaps_summary_by_rule_ids'; export const transformResponse = ( response: GetGapsSummaryByRuleIdsResponse diff --git a/x-pack/platform/plugins/shared/alerting/server/routes/gaps/apis/get_rule_ids_with_gaps/get_rule_ids_with_gaps_route.ts b/x-pack/platform/plugins/shared/alerting/server/routes/gaps/apis/get_rule_ids_with_gaps/get_rule_ids_with_gaps_route.ts index ad0f21c1221e4..71172511af0e1 100644 --- a/x-pack/platform/plugins/shared/alerting/server/routes/gaps/apis/get_rule_ids_with_gaps/get_rule_ids_with_gaps_route.ts +++ b/x-pack/platform/plugins/shared/alerting/server/routes/gaps/apis/get_rule_ids_with_gaps/get_rule_ids_with_gaps_route.ts @@ -4,18 +4,16 @@ * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ -import { IRouter } from '@kbn/core/server'; -import { - getRuleIdsWithGapBodySchemaV1, +import type { IRouter } from '@kbn/core/server'; +import type { GetRuleIdsWithGapBodyV1, GetRuleIdsWithGapResponseV1, } from '../../../../../common/routes/gaps/apis/get_rules_with_gaps'; -import { ILicenseState } from '../../../../lib'; +import { getRuleIdsWithGapBodySchemaV1 } from '../../../../../common/routes/gaps/apis/get_rules_with_gaps'; +import type { ILicenseState } from '../../../../lib'; import { verifyAccessAndContext } from '../../../lib'; -import { - AlertingRequestHandlerContext, - INTERNAL_ALERTING_GAPS_GET_RULES_API_PATH, -} from '../../../../types'; +import type { AlertingRequestHandlerContext } from '../../../../types'; +import { INTERNAL_ALERTING_GAPS_GET_RULES_API_PATH } from '../../../../types'; import { transformResponseV1 } from './transforms'; export const getRuleIdsWithGapsRoute = ( diff --git a/x-pack/platform/plugins/shared/alerting/server/routes/gaps/apis/get_rule_ids_with_gaps/transforms/transform_response/v1.ts b/x-pack/platform/plugins/shared/alerting/server/routes/gaps/apis/get_rule_ids_with_gaps/transforms/transform_response/v1.ts index 85df8d1aa9fd1..8dd624112daaa 100644 --- a/x-pack/platform/plugins/shared/alerting/server/routes/gaps/apis/get_rule_ids_with_gaps/transforms/transform_response/v1.ts +++ b/x-pack/platform/plugins/shared/alerting/server/routes/gaps/apis/get_rule_ids_with_gaps/transforms/transform_response/v1.ts @@ -5,8 +5,8 @@ * 2.0. */ -import { GetRuleIdsWithGapsResponse } from '../../../../../../application/rule/methods/get_rule_ids_with_gaps/types'; -import { GetRuleIdsWithGapResponseBodyV1 } from '../../../../../../../common/routes/gaps/apis/get_rules_with_gaps'; +import type { GetRuleIdsWithGapsResponse } from '../../../../../../application/rule/methods/get_rule_ids_with_gaps/types'; +import type { GetRuleIdsWithGapResponseBodyV1 } from '../../../../../../../common/routes/gaps/apis/get_rules_with_gaps'; export const transformResponse = ( response: GetRuleIdsWithGapsResponse diff --git a/x-pack/platform/plugins/shared/alerting/server/routes/get_action_error_log.ts b/x-pack/platform/plugins/shared/alerting/server/routes/get_action_error_log.ts index 39d10ccab4a63..71d0e02ad69f7 100644 --- a/x-pack/platform/plugins/shared/alerting/server/routes/get_action_error_log.ts +++ b/x-pack/platform/plugins/shared/alerting/server/routes/get_action_error_log.ts @@ -5,12 +5,14 @@ * 2.0. */ -import { IRouter } from '@kbn/core/server'; +import type { IRouter } from '@kbn/core/server'; import { schema } from '@kbn/config-schema'; -import { ILicenseState } from '../lib'; -import { GetActionErrorLogByIdParams } from '../rules_client'; -import { RewriteRequestCase, verifyAccessAndContext } from './lib'; -import { AlertingRequestHandlerContext, INTERNAL_BASE_ALERTING_API_PATH } from '../types'; +import type { ILicenseState } from '../lib'; +import type { GetActionErrorLogByIdParams } from '../rules_client'; +import type { RewriteRequestCase } from './lib'; +import { verifyAccessAndContext } from './lib'; +import type { AlertingRequestHandlerContext } from '../types'; +import { INTERNAL_BASE_ALERTING_API_PATH } from '../types'; import { DEFAULT_ALERTING_ROUTE_SECURITY } from './constants'; const paramSchema = schema.object({ diff --git a/x-pack/platform/plugins/shared/alerting/server/routes/get_flapping_settings.test.ts b/x-pack/platform/plugins/shared/alerting/server/routes/get_flapping_settings.test.ts index f35be4a236f67..3acca523ef0a5 100644 --- a/x-pack/platform/plugins/shared/alerting/server/routes/get_flapping_settings.test.ts +++ b/x-pack/platform/plugins/shared/alerting/server/routes/get_flapping_settings.test.ts @@ -8,10 +8,8 @@ import { httpServiceMock } from '@kbn/core/server/mocks'; import { licenseStateMock } from '../lib/license_state.mock'; import { mockHandlerArguments } from './_mock_handler_arguments'; -import { - rulesSettingsClientMock, - RulesSettingsClientMock, -} from '../rules_settings/rules_settings_client.mock'; +import type { RulesSettingsClientMock } from '../rules_settings/rules_settings_client.mock'; +import { rulesSettingsClientMock } from '../rules_settings/rules_settings_client.mock'; import { getFlappingSettingsRoute } from './get_flapping_settings'; let rulesSettingsClient: RulesSettingsClientMock; diff --git a/x-pack/platform/plugins/shared/alerting/server/routes/get_flapping_settings.ts b/x-pack/platform/plugins/shared/alerting/server/routes/get_flapping_settings.ts index c17458c62a162..502cf336e83f7 100644 --- a/x-pack/platform/plugins/shared/alerting/server/routes/get_flapping_settings.ts +++ b/x-pack/platform/plugins/shared/alerting/server/routes/get_flapping_settings.ts @@ -5,11 +5,14 @@ * 2.0. */ -import { IRouter } from '@kbn/core/server'; -import { ILicenseState } from '../lib'; -import { AlertingRequestHandlerContext, INTERNAL_BASE_ALERTING_API_PATH } from '../types'; -import { verifyAccessAndContext, RewriteResponseCase } from './lib'; -import { API_PRIVILEGES, RulesSettingsFlapping } from '../../common'; +import type { IRouter } from '@kbn/core/server'; +import type { ILicenseState } from '../lib'; +import type { AlertingRequestHandlerContext } from '../types'; +import { INTERNAL_BASE_ALERTING_API_PATH } from '../types'; +import type { RewriteResponseCase } from './lib'; +import { verifyAccessAndContext } from './lib'; +import type { RulesSettingsFlapping } from '../../common'; +import { API_PRIVILEGES } from '../../common'; const rewriteBodyRes: RewriteResponseCase = ({ lookBackWindow, diff --git a/x-pack/platform/plugins/shared/alerting/server/routes/get_global_execution_kpi.ts b/x-pack/platform/plugins/shared/alerting/server/routes/get_global_execution_kpi.ts index 2a0c61617f8eb..e25a04d2a6eb9 100644 --- a/x-pack/platform/plugins/shared/alerting/server/routes/get_global_execution_kpi.ts +++ b/x-pack/platform/plugins/shared/alerting/server/routes/get_global_execution_kpi.ts @@ -4,12 +4,14 @@ * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ -import { IRouter } from '@kbn/core/server'; +import type { IRouter } from '@kbn/core/server'; import { schema } from '@kbn/config-schema'; -import { AlertingRequestHandlerContext, INTERNAL_BASE_ALERTING_API_PATH } from '../types'; -import { RewriteRequestCase, verifyAccessAndContext, rewriteNamespaces } from './lib'; -import { GetGlobalExecutionKPIParams } from '../rules_client'; -import { ILicenseState } from '../lib'; +import type { AlertingRequestHandlerContext } from '../types'; +import { INTERNAL_BASE_ALERTING_API_PATH } from '../types'; +import type { RewriteRequestCase } from './lib'; +import { verifyAccessAndContext, rewriteNamespaces } from './lib'; +import type { GetGlobalExecutionKPIParams } from '../rules_client'; +import type { ILicenseState } from '../lib'; import { DEFAULT_ALERTING_ROUTE_SECURITY } from './constants'; const querySchema = schema.object({ diff --git a/x-pack/platform/plugins/shared/alerting/server/routes/get_global_execution_logs.test.ts b/x-pack/platform/plugins/shared/alerting/server/routes/get_global_execution_logs.test.ts index f6e1c3417a42f..2c16d3e2c9e8f 100644 --- a/x-pack/platform/plugins/shared/alerting/server/routes/get_global_execution_logs.test.ts +++ b/x-pack/platform/plugins/shared/alerting/server/routes/get_global_execution_logs.test.ts @@ -10,7 +10,7 @@ import { httpServiceMock } from '@kbn/core/server/mocks'; import { licenseStateMock } from '../lib/license_state.mock'; import { mockHandlerArguments } from './_mock_handler_arguments'; import { rulesClientMock } from '../rules_client.mock'; -import { IExecutionLogResult } from '../../common'; +import type { IExecutionLogResult } from '../../common'; const rulesClient = rulesClientMock.create(); jest.mock('../lib/license_api_access', () => ({ diff --git a/x-pack/platform/plugins/shared/alerting/server/routes/get_global_execution_logs.ts b/x-pack/platform/plugins/shared/alerting/server/routes/get_global_execution_logs.ts index a6457185c4bd8..8bef9151def2b 100644 --- a/x-pack/platform/plugins/shared/alerting/server/routes/get_global_execution_logs.ts +++ b/x-pack/platform/plugins/shared/alerting/server/routes/get_global_execution_logs.ts @@ -5,12 +5,14 @@ * 2.0. */ -import { IRouter } from '@kbn/core/server'; +import type { IRouter } from '@kbn/core/server'; import { schema } from '@kbn/config-schema'; -import { ILicenseState } from '../lib'; -import { GetGlobalExecutionLogParams } from '../rules_client'; -import { RewriteRequestCase, verifyAccessAndContext, rewriteNamespaces } from './lib'; -import { AlertingRequestHandlerContext, INTERNAL_BASE_ALERTING_API_PATH } from '../types'; +import type { ILicenseState } from '../lib'; +import type { GetGlobalExecutionLogParams } from '../rules_client'; +import type { RewriteRequestCase } from './lib'; +import { verifyAccessAndContext, rewriteNamespaces } from './lib'; +import type { AlertingRequestHandlerContext } from '../types'; +import { INTERNAL_BASE_ALERTING_API_PATH } from '../types'; import { DEFAULT_ALERTING_ROUTE_SECURITY } from './constants'; const sortOrderSchema = schema.oneOf([schema.literal('asc'), schema.literal('desc')]); diff --git a/x-pack/platform/plugins/shared/alerting/server/routes/get_rule_alert_summary.test.ts b/x-pack/platform/plugins/shared/alerting/server/routes/get_rule_alert_summary.test.ts index 319de59a01bfd..cf799713deca6 100644 --- a/x-pack/platform/plugins/shared/alerting/server/routes/get_rule_alert_summary.test.ts +++ b/x-pack/platform/plugins/shared/alerting/server/routes/get_rule_alert_summary.test.ts @@ -11,7 +11,7 @@ import { licenseStateMock } from '../lib/license_state.mock'; import { mockHandlerArguments } from './_mock_handler_arguments'; import { SavedObjectsErrorHelpers } from '@kbn/core/server'; import { rulesClientMock } from '../rules_client.mock'; -import { AlertSummary } from '../types'; +import type { AlertSummary } from '../types'; import { RULE_SAVED_OBJECT_TYPE } from '../saved_objects'; const rulesClient = rulesClientMock.create(); diff --git a/x-pack/platform/plugins/shared/alerting/server/routes/get_rule_alert_summary.ts b/x-pack/platform/plugins/shared/alerting/server/routes/get_rule_alert_summary.ts index fa6222ed80cbc..b779da67162be 100644 --- a/x-pack/platform/plugins/shared/alerting/server/routes/get_rule_alert_summary.ts +++ b/x-pack/platform/plugins/shared/alerting/server/routes/get_rule_alert_summary.ts @@ -5,16 +5,14 @@ * 2.0. */ -import { IRouter } from '@kbn/core/server'; +import type { IRouter } from '@kbn/core/server'; import { schema } from '@kbn/config-schema'; -import { ILicenseState } from '../lib'; -import { GetAlertSummaryParams } from '../rules_client'; -import { RewriteRequestCase, RewriteResponseCase, verifyAccessAndContext } from './lib'; -import { - AlertingRequestHandlerContext, - INTERNAL_BASE_ALERTING_API_PATH, - AlertSummary, -} from '../types'; +import type { ILicenseState } from '../lib'; +import type { GetAlertSummaryParams } from '../rules_client'; +import type { RewriteRequestCase, RewriteResponseCase } from './lib'; +import { verifyAccessAndContext } from './lib'; +import type { AlertingRequestHandlerContext, AlertSummary } from '../types'; +import { INTERNAL_BASE_ALERTING_API_PATH } from '../types'; import { DEFAULT_ALERTING_ROUTE_SECURITY } from './constants'; const paramSchema = schema.object({ diff --git a/x-pack/platform/plugins/shared/alerting/server/routes/get_rule_execution_kpi.ts b/x-pack/platform/plugins/shared/alerting/server/routes/get_rule_execution_kpi.ts index 9ade33c563e92..c7dab4eaa9613 100644 --- a/x-pack/platform/plugins/shared/alerting/server/routes/get_rule_execution_kpi.ts +++ b/x-pack/platform/plugins/shared/alerting/server/routes/get_rule_execution_kpi.ts @@ -4,12 +4,14 @@ * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ -import { IRouter } from '@kbn/core/server'; +import type { IRouter } from '@kbn/core/server'; import { schema } from '@kbn/config-schema'; -import { AlertingRequestHandlerContext, INTERNAL_BASE_ALERTING_API_PATH } from '../types'; -import { RewriteRequestCase, verifyAccessAndContext } from './lib'; -import { GetRuleExecutionKPIParams } from '../rules_client'; -import { ILicenseState } from '../lib'; +import type { AlertingRequestHandlerContext } from '../types'; +import { INTERNAL_BASE_ALERTING_API_PATH } from '../types'; +import type { RewriteRequestCase } from './lib'; +import { verifyAccessAndContext } from './lib'; +import type { GetRuleExecutionKPIParams } from '../rules_client'; +import type { ILicenseState } from '../lib'; import { DEFAULT_ALERTING_ROUTE_SECURITY } from './constants'; const paramSchema = schema.object({ diff --git a/x-pack/platform/plugins/shared/alerting/server/routes/get_rule_execution_log.test.ts b/x-pack/platform/plugins/shared/alerting/server/routes/get_rule_execution_log.test.ts index 3b1f950fb45c6..97b8740569938 100644 --- a/x-pack/platform/plugins/shared/alerting/server/routes/get_rule_execution_log.test.ts +++ b/x-pack/platform/plugins/shared/alerting/server/routes/get_rule_execution_log.test.ts @@ -11,7 +11,7 @@ import { licenseStateMock } from '../lib/license_state.mock'; import { mockHandlerArguments } from './_mock_handler_arguments'; import { SavedObjectsErrorHelpers } from '@kbn/core/server'; import { rulesClientMock } from '../rules_client.mock'; -import { IExecutionLogResult } from '../../common'; +import type { IExecutionLogResult } from '../../common'; const rulesClient = rulesClientMock.create(); jest.mock('../lib/license_api_access', () => ({ diff --git a/x-pack/platform/plugins/shared/alerting/server/routes/get_rule_execution_log.ts b/x-pack/platform/plugins/shared/alerting/server/routes/get_rule_execution_log.ts index a81d68f7f4e3d..9c952fc0ea494 100644 --- a/x-pack/platform/plugins/shared/alerting/server/routes/get_rule_execution_log.ts +++ b/x-pack/platform/plugins/shared/alerting/server/routes/get_rule_execution_log.ts @@ -5,12 +5,14 @@ * 2.0. */ -import { IRouter } from '@kbn/core/server'; +import type { IRouter } from '@kbn/core/server'; import { schema } from '@kbn/config-schema'; -import { ILicenseState } from '../lib'; -import { GetExecutionLogByIdParams } from '../rules_client'; -import { RewriteRequestCase, verifyAccessAndContext } from './lib'; -import { AlertingRequestHandlerContext, INTERNAL_BASE_ALERTING_API_PATH } from '../types'; +import type { ILicenseState } from '../lib'; +import type { GetExecutionLogByIdParams } from '../rules_client'; +import type { RewriteRequestCase } from './lib'; +import { verifyAccessAndContext } from './lib'; +import type { AlertingRequestHandlerContext } from '../types'; +import { INTERNAL_BASE_ALERTING_API_PATH } from '../types'; import { DEFAULT_ALERTING_ROUTE_SECURITY } from './constants'; const paramSchema = schema.object({ diff --git a/x-pack/platform/plugins/shared/alerting/server/routes/get_rule_state.ts b/x-pack/platform/plugins/shared/alerting/server/routes/get_rule_state.ts index 347b21faf8934..95a5565856ea9 100644 --- a/x-pack/platform/plugins/shared/alerting/server/routes/get_rule_state.ts +++ b/x-pack/platform/plugins/shared/alerting/server/routes/get_rule_state.ts @@ -5,15 +5,13 @@ * 2.0. */ -import { IRouter } from '@kbn/core/server'; +import type { IRouter } from '@kbn/core/server'; import { schema } from '@kbn/config-schema'; -import { ILicenseState } from '../lib'; -import { RewriteResponseCase, verifyAccessAndContext } from './lib'; -import { - AlertingRequestHandlerContext, - INTERNAL_BASE_ALERTING_API_PATH, - RuleTaskState, -} from '../types'; +import type { ILicenseState } from '../lib'; +import type { RewriteResponseCase } from './lib'; +import { verifyAccessAndContext } from './lib'; +import type { AlertingRequestHandlerContext, RuleTaskState } from '../types'; +import { INTERNAL_BASE_ALERTING_API_PATH } from '../types'; import { DEFAULT_ALERTING_ROUTE_SECURITY } from './constants'; const paramSchema = schema.object({ diff --git a/x-pack/platform/plugins/shared/alerting/server/routes/index.ts b/x-pack/platform/plugins/shared/alerting/server/routes/index.ts index cedd8de9446f6..fcb72c1e7076a 100644 --- a/x-pack/platform/plugins/shared/alerting/server/routes/index.ts +++ b/x-pack/platform/plugins/shared/alerting/server/routes/index.ts @@ -5,13 +5,13 @@ * 2.0. */ -import { DocLinksServiceSetup, IRouter } from '@kbn/core/server'; -import { UsageCounter } from '@kbn/usage-collection-plugin/server'; -import { EncryptedSavedObjectsPluginSetup } from '@kbn/encrypted-saved-objects-plugin/server'; +import type { DocLinksServiceSetup, IRouter } from '@kbn/core/server'; +import type { UsageCounter } from '@kbn/usage-collection-plugin/server'; +import type { EncryptedSavedObjectsPluginSetup } from '@kbn/encrypted-saved-objects-plugin/server'; import type { ConfigSchema } from '@kbn/unified-search-plugin/server/config'; -import { Observable } from 'rxjs'; -import { GetAlertIndicesAlias, ILicenseState } from '../lib'; -import { AlertingRequestHandlerContext } from '../types'; +import type { Observable } from 'rxjs'; +import type { GetAlertIndicesAlias, ILicenseState } from '../lib'; +import type { AlertingRequestHandlerContext } from '../types'; import { createRuleRoute } from './rule/apis/create'; import { getRuleRoute, getInternalRuleRoute } from './rule/apis/get/get_rule_route'; import { updateRuleRoute } from './rule/apis/update/update_rule_route'; diff --git a/x-pack/platform/plugins/shared/alerting/server/routes/lib/count_usage_of_predefined_ids.ts b/x-pack/platform/plugins/shared/alerting/server/routes/lib/count_usage_of_predefined_ids.ts index 8955e321c3fe5..532148b0503ae 100644 --- a/x-pack/platform/plugins/shared/alerting/server/routes/lib/count_usage_of_predefined_ids.ts +++ b/x-pack/platform/plugins/shared/alerting/server/routes/lib/count_usage_of_predefined_ids.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { UsageCounter } from '@kbn/usage-collection-plugin/server'; +import type { UsageCounter } from '@kbn/usage-collection-plugin/server'; export interface CountUsageOfPredefinedIdsOptions { predefinedId?: string; diff --git a/x-pack/platform/plugins/shared/alerting/server/routes/lib/error_handler.ts b/x-pack/platform/plugins/shared/alerting/server/routes/lib/error_handler.ts index 7e8243e7d501c..1f6e7a3554c8a 100644 --- a/x-pack/platform/plugins/shared/alerting/server/routes/lib/error_handler.ts +++ b/x-pack/platform/plugins/shared/alerting/server/routes/lib/error_handler.ts @@ -6,7 +6,7 @@ */ import { i18n } from '@kbn/i18n'; -import { RequestHandlerWrapper } from '@kbn/core/server'; +import type { RequestHandlerWrapper } from '@kbn/core/server'; export const handleDisabledApiKeysError: RequestHandlerWrapper = (handler) => { return async (context, request, response) => { diff --git a/x-pack/platform/plugins/shared/alerting/server/routes/lib/rewrite_actions.ts b/x-pack/platform/plugins/shared/alerting/server/routes/lib/rewrite_actions.ts index 00cd7cbd45c3f..04eab9d77a66b 100644 --- a/x-pack/platform/plugins/shared/alerting/server/routes/lib/rewrite_actions.ts +++ b/x-pack/platform/plugins/shared/alerting/server/routes/lib/rewrite_actions.ts @@ -4,10 +4,10 @@ * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ -import { TypeOf } from '@kbn/config-schema/src/types/object_type'; +import type { TypeOf } from '@kbn/config-schema/src/types/object_type'; import { omit } from 'lodash'; -import { NormalizedAlertAction, NormalizedSystemAction } from '../../rules_client'; -import { actionsSchema, systemActionsSchema } from './actions_schema'; +import type { NormalizedAlertAction, NormalizedSystemAction } from '../../rules_client'; +import type { actionsSchema, systemActionsSchema } from './actions_schema'; export const rewriteActionsReq = ( actions: TypeOf diff --git a/x-pack/platform/plugins/shared/alerting/server/routes/lib/rewrite_maintenance_window.ts b/x-pack/platform/plugins/shared/alerting/server/routes/lib/rewrite_maintenance_window.ts index 54f29f4e34a3b..553605457c139 100644 --- a/x-pack/platform/plugins/shared/alerting/server/routes/lib/rewrite_maintenance_window.ts +++ b/x-pack/platform/plugins/shared/alerting/server/routes/lib/rewrite_maintenance_window.ts @@ -5,8 +5,8 @@ * 2.0. */ -import { RewriteResponseCase } from '.'; -import { MaintenanceWindow } from '../../../common'; +import type { RewriteResponseCase } from '.'; +import type { MaintenanceWindow } from '../../../common'; export const rewriteMaintenanceWindowRes: RewriteResponseCase = ({ expirationDate, diff --git a/x-pack/platform/plugins/shared/alerting/server/routes/lib/rewrite_request_case.ts b/x-pack/platform/plugins/shared/alerting/server/routes/lib/rewrite_request_case.ts index bd11ab9771ad2..74dae01b07769 100644 --- a/x-pack/platform/plugins/shared/alerting/server/routes/lib/rewrite_request_case.ts +++ b/x-pack/platform/plugins/shared/alerting/server/routes/lib/rewrite_request_case.ts @@ -4,7 +4,7 @@ * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ -import { JsonValue } from '@kbn/utility-types'; +import type { JsonValue } from '@kbn/utility-types'; type RenameAlertToRule = K extends `alertTypeId` ? `ruleTypeId` diff --git a/x-pack/platform/plugins/shared/alerting/server/routes/lib/rewrite_rule.test.ts b/x-pack/platform/plugins/shared/alerting/server/routes/lib/rewrite_rule.test.ts index 854d6cc4294a5..82770f59a3c3d 100644 --- a/x-pack/platform/plugins/shared/alerting/server/routes/lib/rewrite_rule.test.ts +++ b/x-pack/platform/plugins/shared/alerting/server/routes/lib/rewrite_rule.test.ts @@ -5,7 +5,7 @@ * 2.0. */ import { rewriteRule } from './rewrite_rule'; -import { RuleTypeParams, SanitizedRule } from '../../types'; +import type { RuleTypeParams, SanitizedRule } from '../../types'; import { isPlainObject } from 'lodash'; const DATE_2020 = new Date('1/1/2020'); diff --git a/x-pack/platform/plugins/shared/alerting/server/routes/lib/rewrite_rule.ts b/x-pack/platform/plugins/shared/alerting/server/routes/lib/rewrite_rule.ts index a95e477d55ae1..4ad7ef6922543 100644 --- a/x-pack/platform/plugins/shared/alerting/server/routes/lib/rewrite_rule.ts +++ b/x-pack/platform/plugins/shared/alerting/server/routes/lib/rewrite_rule.ts @@ -6,7 +6,7 @@ */ import { omit } from 'lodash'; -import { RuleTypeParams, SanitizedRule, RuleLastRun } from '../../types'; +import type { RuleTypeParams, SanitizedRule, RuleLastRun } from '../../types'; export const rewriteRuleLastRun = (lastRun: RuleLastRun) => { const { outcomeMsg, outcomeOrder, alertsCount, ...rest } = lastRun; diff --git a/x-pack/platform/plugins/shared/alerting/server/routes/lib/track_legacy_terminology.ts b/x-pack/platform/plugins/shared/alerting/server/routes/lib/track_legacy_terminology.ts index c0c1fd155b7fd..2e013251c7390 100644 --- a/x-pack/platform/plugins/shared/alerting/server/routes/lib/track_legacy_terminology.ts +++ b/x-pack/platform/plugins/shared/alerting/server/routes/lib/track_legacy_terminology.ts @@ -5,7 +5,7 @@ * 2.0. */ import { flatten } from 'lodash'; -import { UsageCounter } from '@kbn/usage-collection-plugin/server'; +import type { UsageCounter } from '@kbn/usage-collection-plugin/server'; export const LEGACY_TERMS = ['alertTypeId', 'actionTypeId']; diff --git a/x-pack/platform/plugins/shared/alerting/server/routes/lib/verify_access_and_context.ts b/x-pack/platform/plugins/shared/alerting/server/routes/lib/verify_access_and_context.ts index 09930a4b59165..a06430f678ec3 100644 --- a/x-pack/platform/plugins/shared/alerting/server/routes/lib/verify_access_and_context.ts +++ b/x-pack/platform/plugins/shared/alerting/server/routes/lib/verify_access_and_context.ts @@ -5,9 +5,10 @@ * 2.0. */ -import { RequestHandler } from '@kbn/core/server'; -import { ILicenseState, isErrorThatHandlesItsOwnResponse, verifyApiAccess } from '../../lib'; -import { AlertingRequestHandlerContext } from '../../types'; +import type { RequestHandler } from '@kbn/core/server'; +import type { ILicenseState } from '../../lib'; +import { isErrorThatHandlesItsOwnResponse, verifyApiAccess } from '../../lib'; +import type { AlertingRequestHandlerContext } from '../../types'; type AlertingRequestHandlerWrapper = ( licenseState: ILicenseState, diff --git a/x-pack/platform/plugins/shared/alerting/server/routes/maintenance_window/apis/archive/archive_maintenance_window_route.ts b/x-pack/platform/plugins/shared/alerting/server/routes/maintenance_window/apis/archive/archive_maintenance_window_route.ts index 2ab64a90b1afa..6ff3b4da57410 100644 --- a/x-pack/platform/plugins/shared/alerting/server/routes/maintenance_window/apis/archive/archive_maintenance_window_route.ts +++ b/x-pack/platform/plugins/shared/alerting/server/routes/maintenance_window/apis/archive/archive_maintenance_window_route.ts @@ -5,22 +5,22 @@ * 2.0. */ -import { IRouter } from '@kbn/core/server'; -import { ILicenseState } from '../../../../lib'; +import type { IRouter } from '@kbn/core/server'; +import type { ILicenseState } from '../../../../lib'; import { verifyAccessAndContext } from '../../../lib'; -import { - AlertingRequestHandlerContext, - INTERNAL_ALERTING_API_MAINTENANCE_WINDOW_PATH, -} from '../../../../types'; +import type { AlertingRequestHandlerContext } from '../../../../types'; +import { INTERNAL_ALERTING_API_MAINTENANCE_WINDOW_PATH } from '../../../../types'; import { MAINTENANCE_WINDOW_API_PRIVILEGES } from '../../../../../common'; -import { MaintenanceWindow } from '../../../../application/maintenance_window/types'; -import { - archiveBodySchemaV1, - archiveParamsSchemaV1, +import type { MaintenanceWindow } from '../../../../application/maintenance_window/types'; +import type { ArchiveMaintenanceWindowRequestBodyV1, ArchiveMaintenanceWindowRequestParamsV1, ArchiveMaintenanceWindowResponseV1, } from '../../../../../common/routes/maintenance_window/apis/archive'; +import { + archiveBodySchemaV1, + archiveParamsSchemaV1, +} from '../../../../../common/routes/maintenance_window/apis/archive'; import { transformMaintenanceWindowToResponseV1 } from '../../transforms'; export const archiveMaintenanceWindowRoute = ( diff --git a/x-pack/platform/plugins/shared/alerting/server/routes/maintenance_window/apis/bulk_get/bulk_get_maintenance_windows_route.ts b/x-pack/platform/plugins/shared/alerting/server/routes/maintenance_window/apis/bulk_get/bulk_get_maintenance_windows_route.ts index 614a92701bfb6..5ce100713d855 100644 --- a/x-pack/platform/plugins/shared/alerting/server/routes/maintenance_window/apis/bulk_get/bulk_get_maintenance_windows_route.ts +++ b/x-pack/platform/plugins/shared/alerting/server/routes/maintenance_window/apis/bulk_get/bulk_get_maintenance_windows_route.ts @@ -5,20 +5,18 @@ * 2.0. */ -import { IRouter } from '@kbn/core/server'; -import { ILicenseState } from '../../../../lib'; +import type { IRouter } from '@kbn/core/server'; +import type { ILicenseState } from '../../../../lib'; import { verifyAccessAndContext } from '../../../lib'; -import { - AlertingRequestHandlerContext, - INTERNAL_ALERTING_API_MAINTENANCE_WINDOW_PATH, -} from '../../../../types'; +import type { AlertingRequestHandlerContext } from '../../../../types'; +import { INTERNAL_ALERTING_API_MAINTENANCE_WINDOW_PATH } from '../../../../types'; import { MAINTENANCE_WINDOW_API_PRIVILEGES } from '../../../../../common'; -import { BulkGetMaintenanceWindowsResult } from '../../../../application/maintenance_window/methods/bulk_get/types'; -import { - bulkGetBodySchemaV1, +import type { BulkGetMaintenanceWindowsResult } from '../../../../application/maintenance_window/methods/bulk_get/types'; +import type { BulkGetMaintenanceWindowsRequestBodyV1, BulkGetMaintenanceWindowsResponseV1, } from '../../../../../common/routes/maintenance_window/apis/bulk_get'; +import { bulkGetBodySchemaV1 } from '../../../../../common/routes/maintenance_window/apis/bulk_get'; import { transformBulkGetResultToResponseV1 } from './transforms'; export const bulkGetMaintenanceWindowRoute = ( diff --git a/x-pack/platform/plugins/shared/alerting/server/routes/maintenance_window/apis/bulk_get/transforms/transform_bulk_get_response/v1.ts b/x-pack/platform/plugins/shared/alerting/server/routes/maintenance_window/apis/bulk_get/transforms/transform_bulk_get_response/v1.ts index 5e791e0d917e9..22b8ad99f1cbd 100644 --- a/x-pack/platform/plugins/shared/alerting/server/routes/maintenance_window/apis/bulk_get/transforms/transform_bulk_get_response/v1.ts +++ b/x-pack/platform/plugins/shared/alerting/server/routes/maintenance_window/apis/bulk_get/transforms/transform_bulk_get_response/v1.ts @@ -5,8 +5,8 @@ * 2.0. */ -import { BulkGetMaintenanceWindowsResponseBodyV1 } from '../../../../../../../common/routes/maintenance_window/apis/bulk_get'; -import { BulkGetMaintenanceWindowsResult } from '../../../../../../application/maintenance_window/methods/bulk_get/types'; +import type { BulkGetMaintenanceWindowsResponseBodyV1 } from '../../../../../../../common/routes/maintenance_window/apis/bulk_get'; +import type { BulkGetMaintenanceWindowsResult } from '../../../../../../application/maintenance_window/methods/bulk_get/types'; import { transformMaintenanceWindowToResponseV1 } from '../../../../transforms'; export const transformBulkGetResultToResponse = ( diff --git a/x-pack/platform/plugins/shared/alerting/server/routes/maintenance_window/apis/create/create_maintenance_window_route.test.ts b/x-pack/platform/plugins/shared/alerting/server/routes/maintenance_window/apis/create/create_maintenance_window_route.test.ts index b00f4cda86b17..b7435ce420c66 100644 --- a/x-pack/platform/plugins/shared/alerting/server/routes/maintenance_window/apis/create/create_maintenance_window_route.test.ts +++ b/x-pack/platform/plugins/shared/alerting/server/routes/maintenance_window/apis/create/create_maintenance_window_route.test.ts @@ -14,8 +14,8 @@ import { createMaintenanceWindowRoute } from './create_maintenance_window_route' import { getMockMaintenanceWindow } from '../../../../data/maintenance_window/test_helpers'; import { MaintenanceWindowStatus } from '../../../../../common'; -import { MaintenanceWindow } from '../../../../application/maintenance_window/types'; -import { CreateMaintenanceWindowRequestBody } from '../../../../../common/routes/maintenance_window/apis/create'; +import type { MaintenanceWindow } from '../../../../application/maintenance_window/types'; +import type { CreateMaintenanceWindowRequestBody } from '../../../../../common/routes/maintenance_window/apis/create'; import { transformCreateBody } from './transforms'; import { transformMaintenanceWindowToResponse } from '../../transforms'; diff --git a/x-pack/platform/plugins/shared/alerting/server/routes/maintenance_window/apis/create/create_maintenance_window_route.ts b/x-pack/platform/plugins/shared/alerting/server/routes/maintenance_window/apis/create/create_maintenance_window_route.ts index 26dfe1fa176f0..3066c035808f4 100644 --- a/x-pack/platform/plugins/shared/alerting/server/routes/maintenance_window/apis/create/create_maintenance_window_route.ts +++ b/x-pack/platform/plugins/shared/alerting/server/routes/maintenance_window/apis/create/create_maintenance_window_route.ts @@ -5,20 +5,18 @@ * 2.0. */ -import { IRouter } from '@kbn/core/server'; -import { ILicenseState } from '../../../../lib'; +import type { IRouter } from '@kbn/core/server'; +import type { ILicenseState } from '../../../../lib'; import { verifyAccessAndContext } from '../../../lib'; -import { - AlertingRequestHandlerContext, - INTERNAL_ALERTING_API_MAINTENANCE_WINDOW_PATH, -} from '../../../../types'; +import type { AlertingRequestHandlerContext } from '../../../../types'; +import { INTERNAL_ALERTING_API_MAINTENANCE_WINDOW_PATH } from '../../../../types'; import { MAINTENANCE_WINDOW_API_PRIVILEGES } from '../../../../../common'; -import { MaintenanceWindow } from '../../../../application/maintenance_window/types'; -import { - createBodySchemaV1, +import type { MaintenanceWindow } from '../../../../application/maintenance_window/types'; +import type { CreateMaintenanceWindowRequestBodyV1, CreateMaintenanceWindowResponseV1, } from '../../../../../common/routes/maintenance_window/apis/create'; +import { createBodySchemaV1 } from '../../../../../common/routes/maintenance_window/apis/create'; import { transformCreateBodyV1 } from './transforms'; import { transformMaintenanceWindowToResponseV1 } from '../../transforms'; diff --git a/x-pack/platform/plugins/shared/alerting/server/routes/maintenance_window/apis/create/transforms/transform_create_body/v1.ts b/x-pack/platform/plugins/shared/alerting/server/routes/maintenance_window/apis/create/transforms/transform_create_body/v1.ts index 6eaa77fc78624..0b0c35c8048bc 100644 --- a/x-pack/platform/plugins/shared/alerting/server/routes/maintenance_window/apis/create/transforms/transform_create_body/v1.ts +++ b/x-pack/platform/plugins/shared/alerting/server/routes/maintenance_window/apis/create/transforms/transform_create_body/v1.ts @@ -5,8 +5,8 @@ * 2.0. */ -import { CreateMaintenanceWindowRequestBodyV1 } from '../../../../../../../common/routes/maintenance_window/apis/create'; -import { CreateMaintenanceWindowParams } from '../../../../../../application/maintenance_window/methods/create/types'; +import type { CreateMaintenanceWindowRequestBodyV1 } from '../../../../../../../common/routes/maintenance_window/apis/create'; +import type { CreateMaintenanceWindowParams } from '../../../../../../application/maintenance_window/methods/create/types'; export const transformCreateBody = ( createBody: CreateMaintenanceWindowRequestBodyV1 diff --git a/x-pack/platform/plugins/shared/alerting/server/routes/maintenance_window/apis/delete/delete_maintenance_window_route.ts b/x-pack/platform/plugins/shared/alerting/server/routes/maintenance_window/apis/delete/delete_maintenance_window_route.ts index f5d9e28320c3f..1c979cb57f88e 100644 --- a/x-pack/platform/plugins/shared/alerting/server/routes/maintenance_window/apis/delete/delete_maintenance_window_route.ts +++ b/x-pack/platform/plugins/shared/alerting/server/routes/maintenance_window/apis/delete/delete_maintenance_window_route.ts @@ -5,19 +5,15 @@ * 2.0. */ -import { IRouter } from '@kbn/core/server'; -import { ILicenseState } from '../../../../lib'; +import type { IRouter } from '@kbn/core/server'; +import type { ILicenseState } from '../../../../lib'; import { verifyAccessAndContext } from '../../../lib'; -import { - AlertingRequestHandlerContext, - INTERNAL_ALERTING_API_MAINTENANCE_WINDOW_PATH, -} from '../../../../types'; +import type { AlertingRequestHandlerContext } from '../../../../types'; +import { INTERNAL_ALERTING_API_MAINTENANCE_WINDOW_PATH } from '../../../../types'; import { MAINTENANCE_WINDOW_API_PRIVILEGES } from '../../../../../common'; -import { - deleteParamsSchemaV1, - DeleteMaintenanceWindowRequestParamsV1, -} from '../../../../../common/routes/maintenance_window/apis/delete'; +import type { DeleteMaintenanceWindowRequestParamsV1 } from '../../../../../common/routes/maintenance_window/apis/delete'; +import { deleteParamsSchemaV1 } from '../../../../../common/routes/maintenance_window/apis/delete'; export const deleteMaintenanceWindowRoute = ( router: IRouter, diff --git a/x-pack/platform/plugins/shared/alerting/server/routes/maintenance_window/apis/find/find_maintenance_windows_route.ts b/x-pack/platform/plugins/shared/alerting/server/routes/maintenance_window/apis/find/find_maintenance_windows_route.ts index 4b75368365bd7..600b21df77aab 100644 --- a/x-pack/platform/plugins/shared/alerting/server/routes/maintenance_window/apis/find/find_maintenance_windows_route.ts +++ b/x-pack/platform/plugins/shared/alerting/server/routes/maintenance_window/apis/find/find_maintenance_windows_route.ts @@ -5,13 +5,11 @@ * 2.0. */ -import { IRouter } from '@kbn/core/server'; -import { ILicenseState } from '../../../../lib'; +import type { IRouter } from '@kbn/core/server'; +import type { ILicenseState } from '../../../../lib'; import { verifyAccessAndContext } from '../../../lib'; -import { - AlertingRequestHandlerContext, - INTERNAL_ALERTING_API_MAINTENANCE_WINDOW_PATH, -} from '../../../../types'; +import type { AlertingRequestHandlerContext } from '../../../../types'; +import { INTERNAL_ALERTING_API_MAINTENANCE_WINDOW_PATH } from '../../../../types'; import { MAINTENANCE_WINDOW_API_PRIVILEGES } from '../../../../../common'; import type { FindMaintenanceWindowsResult } from '../../../../application/maintenance_window/methods/find/types'; import type { FindMaintenanceWindowsResponseV1 } from '../../../../../common/routes/maintenance_window/apis/find'; diff --git a/x-pack/platform/plugins/shared/alerting/server/routes/maintenance_window/apis/find/transforms/transform_find_maintenance_window_params/v1.ts b/x-pack/platform/plugins/shared/alerting/server/routes/maintenance_window/apis/find/transforms/transform_find_maintenance_window_params/v1.ts index 4445c1a0ff60e..519682318a5f5 100644 --- a/x-pack/platform/plugins/shared/alerting/server/routes/maintenance_window/apis/find/transforms/transform_find_maintenance_window_params/v1.ts +++ b/x-pack/platform/plugins/shared/alerting/server/routes/maintenance_window/apis/find/transforms/transform_find_maintenance_window_params/v1.ts @@ -5,8 +5,8 @@ * 2.0. */ -import { FindMaintenanceWindowsRequestQuery } from '../../../../../../../common/routes/maintenance_window/apis/find'; -import { FindMaintenanceWindowsParams } from '../../../../../../application/maintenance_window/methods/find/types'; +import type { FindMaintenanceWindowsRequestQuery } from '../../../../../../../common/routes/maintenance_window/apis/find'; +import type { FindMaintenanceWindowsParams } from '../../../../../../application/maintenance_window/methods/find/types'; export const transformFindMaintenanceWindowParams = ( params: FindMaintenanceWindowsRequestQuery diff --git a/x-pack/platform/plugins/shared/alerting/server/routes/maintenance_window/apis/finish/finish_maintenance_window_route.ts b/x-pack/platform/plugins/shared/alerting/server/routes/maintenance_window/apis/finish/finish_maintenance_window_route.ts index 40d50dab5e90a..41fec29b423ce 100644 --- a/x-pack/platform/plugins/shared/alerting/server/routes/maintenance_window/apis/finish/finish_maintenance_window_route.ts +++ b/x-pack/platform/plugins/shared/alerting/server/routes/maintenance_window/apis/finish/finish_maintenance_window_route.ts @@ -5,19 +5,17 @@ * 2.0. */ -import { IRouter } from '@kbn/core/server'; -import { ILicenseState } from '../../../../lib'; +import type { IRouter } from '@kbn/core/server'; +import type { ILicenseState } from '../../../../lib'; import { verifyAccessAndContext } from '../../../lib'; -import { - AlertingRequestHandlerContext, - INTERNAL_ALERTING_API_MAINTENANCE_WINDOW_PATH, -} from '../../../../types'; -import { MaintenanceWindow } from '../../../../application/maintenance_window/types'; -import { - finishParamsSchemaV1, +import type { AlertingRequestHandlerContext } from '../../../../types'; +import { INTERNAL_ALERTING_API_MAINTENANCE_WINDOW_PATH } from '../../../../types'; +import type { MaintenanceWindow } from '../../../../application/maintenance_window/types'; +import type { FinishMaintenanceWindowRequestParamsV1, FinishMaintenanceWindowResponseV1, } from '../../../../../common/routes/maintenance_window/apis/finish'; +import { finishParamsSchemaV1 } from '../../../../../common/routes/maintenance_window/apis/finish'; import { MAINTENANCE_WINDOW_API_PRIVILEGES } from '../../../../../common'; import { transformMaintenanceWindowToResponseV1 } from '../../transforms'; diff --git a/x-pack/platform/plugins/shared/alerting/server/routes/maintenance_window/apis/get/get_maintenance_window_route.ts b/x-pack/platform/plugins/shared/alerting/server/routes/maintenance_window/apis/get/get_maintenance_window_route.ts index 90cfd2f9314ef..6008c35ef394d 100644 --- a/x-pack/platform/plugins/shared/alerting/server/routes/maintenance_window/apis/get/get_maintenance_window_route.ts +++ b/x-pack/platform/plugins/shared/alerting/server/routes/maintenance_window/apis/get/get_maintenance_window_route.ts @@ -5,20 +5,18 @@ * 2.0. */ -import { IRouter } from '@kbn/core/server'; -import { ILicenseState } from '../../../../lib'; +import type { IRouter } from '@kbn/core/server'; +import type { ILicenseState } from '../../../../lib'; import { verifyAccessAndContext } from '../../../lib'; -import { - AlertingRequestHandlerContext, - INTERNAL_ALERTING_API_MAINTENANCE_WINDOW_PATH, -} from '../../../../types'; +import type { AlertingRequestHandlerContext } from '../../../../types'; +import { INTERNAL_ALERTING_API_MAINTENANCE_WINDOW_PATH } from '../../../../types'; import { MAINTENANCE_WINDOW_API_PRIVILEGES } from '../../../../../common'; -import { MaintenanceWindow } from '../../../../application/maintenance_window/types'; -import { - getParamsSchemaV1, +import type { MaintenanceWindow } from '../../../../application/maintenance_window/types'; +import type { GetMaintenanceWindowRequestParamsV1, GetMaintenanceWindowResponseV1, } from '../../../../../common/routes/maintenance_window/apis/get'; +import { getParamsSchemaV1 } from '../../../../../common/routes/maintenance_window/apis/get'; import { transformMaintenanceWindowToResponseV1 } from '../../transforms'; export const getMaintenanceWindowRoute = ( diff --git a/x-pack/platform/plugins/shared/alerting/server/routes/maintenance_window/apis/get_active/get_active_maintenance_windows_route.ts b/x-pack/platform/plugins/shared/alerting/server/routes/maintenance_window/apis/get_active/get_active_maintenance_windows_route.ts index d8fde5b5a4e12..d6e4b54871a2f 100644 --- a/x-pack/platform/plugins/shared/alerting/server/routes/maintenance_window/apis/get_active/get_active_maintenance_windows_route.ts +++ b/x-pack/platform/plugins/shared/alerting/server/routes/maintenance_window/apis/get_active/get_active_maintenance_windows_route.ts @@ -5,17 +5,15 @@ * 2.0. */ -import { IRouter } from '@kbn/core/server'; -import { ILicenseState } from '../../../../lib'; +import type { IRouter } from '@kbn/core/server'; +import type { ILicenseState } from '../../../../lib'; import { verifyAccessAndContext } from '../../../lib'; -import { - AlertingRequestHandlerContext, - INTERNAL_ALERTING_API_GET_ACTIVE_MAINTENANCE_WINDOWS_PATH, -} from '../../../../types'; +import type { AlertingRequestHandlerContext } from '../../../../types'; +import { INTERNAL_ALERTING_API_GET_ACTIVE_MAINTENANCE_WINDOWS_PATH } from '../../../../types'; import { MAINTENANCE_WINDOW_API_PRIVILEGES } from '../../../../../common'; -import { MaintenanceWindow } from '../../../../application/maintenance_window/types'; -import { GetActiveMaintenanceWindowsResponseV1 } from '../../../../../common/routes/maintenance_window/apis/get_active'; +import type { MaintenanceWindow } from '../../../../application/maintenance_window/types'; +import type { GetActiveMaintenanceWindowsResponseV1 } from '../../../../../common/routes/maintenance_window/apis/get_active'; import { transformMaintenanceWindowToResponseV1 } from '../../transforms'; export const getActiveMaintenanceWindowsRoute = ( diff --git a/x-pack/platform/plugins/shared/alerting/server/routes/maintenance_window/apis/update/transforms/transform_update_body/v1.ts b/x-pack/platform/plugins/shared/alerting/server/routes/maintenance_window/apis/update/transforms/transform_update_body/v1.ts index 96c4e92d4934e..ca8d9f460e694 100644 --- a/x-pack/platform/plugins/shared/alerting/server/routes/maintenance_window/apis/update/transforms/transform_update_body/v1.ts +++ b/x-pack/platform/plugins/shared/alerting/server/routes/maintenance_window/apis/update/transforms/transform_update_body/v1.ts @@ -5,8 +5,8 @@ * 2.0. */ -import { UpdateMaintenanceWindowRequestBodyV1 } from '../../../../../../../common/routes/maintenance_window/apis/update'; -import { UpdateMaintenanceWindowParams } from '../../../../../../application/maintenance_window/methods/update/types'; +import type { UpdateMaintenanceWindowRequestBodyV1 } from '../../../../../../../common/routes/maintenance_window/apis/update'; +import type { UpdateMaintenanceWindowParams } from '../../../../../../application/maintenance_window/methods/update/types'; export const transformUpdateBody = ( updateBody: UpdateMaintenanceWindowRequestBodyV1 diff --git a/x-pack/platform/plugins/shared/alerting/server/routes/maintenance_window/apis/update/update_maintenance_window_route.test.ts b/x-pack/platform/plugins/shared/alerting/server/routes/maintenance_window/apis/update/update_maintenance_window_route.test.ts index d11a81f4fe73c..26d3c01f81d4f 100644 --- a/x-pack/platform/plugins/shared/alerting/server/routes/maintenance_window/apis/update/update_maintenance_window_route.test.ts +++ b/x-pack/platform/plugins/shared/alerting/server/routes/maintenance_window/apis/update/update_maintenance_window_route.test.ts @@ -14,7 +14,7 @@ import { getMockMaintenanceWindow } from '../../../../data/maintenance_window/te import { MaintenanceWindowStatus } from '../../../../../common'; import { transformUpdateBody } from './transforms'; import { rewritePartialMaintenanceBodyRes } from '../../../lib'; -import { UpdateMaintenanceWindowRequestBody } from '../../../../../common/routes/maintenance_window/apis/update'; +import type { UpdateMaintenanceWindowRequestBody } from '../../../../../common/routes/maintenance_window/apis/update'; const maintenanceWindowClient = maintenanceWindowClientMock.create(); diff --git a/x-pack/platform/plugins/shared/alerting/server/routes/maintenance_window/apis/update/update_maintenance_window_route.ts b/x-pack/platform/plugins/shared/alerting/server/routes/maintenance_window/apis/update/update_maintenance_window_route.ts index 475e584cddf4b..9e3a0f7667a61 100644 --- a/x-pack/platform/plugins/shared/alerting/server/routes/maintenance_window/apis/update/update_maintenance_window_route.ts +++ b/x-pack/platform/plugins/shared/alerting/server/routes/maintenance_window/apis/update/update_maintenance_window_route.ts @@ -5,22 +5,22 @@ * 2.0. */ -import { IRouter } from '@kbn/core/server'; -import { ILicenseState } from '../../../../lib'; +import type { IRouter } from '@kbn/core/server'; +import type { ILicenseState } from '../../../../lib'; import { verifyAccessAndContext } from '../../../lib'; -import { - AlertingRequestHandlerContext, - INTERNAL_ALERTING_API_MAINTENANCE_WINDOW_PATH, -} from '../../../../types'; +import type { AlertingRequestHandlerContext } from '../../../../types'; +import { INTERNAL_ALERTING_API_MAINTENANCE_WINDOW_PATH } from '../../../../types'; import { MAINTENANCE_WINDOW_API_PRIVILEGES } from '../../../../../common'; -import { MaintenanceWindow } from '../../../../application/maintenance_window/types'; -import { - updateBodySchemaV1, - updateParamsSchemaV1, +import type { MaintenanceWindow } from '../../../../application/maintenance_window/types'; +import type { UpdateMaintenanceWindowRequestBodyV1, UpdateMaintenanceWindowRequestParamsV1, UpdateMaintenanceWindowResponseV1, } from '../../../../../common/routes/maintenance_window/apis/update'; +import { + updateBodySchemaV1, + updateParamsSchemaV1, +} from '../../../../../common/routes/maintenance_window/apis/update'; import { transformUpdateBodyV1 } from './transforms'; import { transformMaintenanceWindowToResponseV1 } from '../../transforms'; diff --git a/x-pack/platform/plugins/shared/alerting/server/routes/maintenance_window/transforms/transform_maintenance_window_to_response/v1.ts b/x-pack/platform/plugins/shared/alerting/server/routes/maintenance_window/transforms/transform_maintenance_window_to_response/v1.ts index 2d21576773c29..d1a4b4877d4e5 100644 --- a/x-pack/platform/plugins/shared/alerting/server/routes/maintenance_window/transforms/transform_maintenance_window_to_response/v1.ts +++ b/x-pack/platform/plugins/shared/alerting/server/routes/maintenance_window/transforms/transform_maintenance_window_to_response/v1.ts @@ -5,8 +5,8 @@ * 2.0. */ -import { MaintenanceWindowResponseV1 } from '../../../../../common/routes/maintenance_window/response'; -import { MaintenanceWindow } from '../../../../application/maintenance_window/types'; +import type { MaintenanceWindowResponseV1 } from '../../../../../common/routes/maintenance_window/response'; +import type { MaintenanceWindow } from '../../../../application/maintenance_window/types'; export const transformMaintenanceWindowToResponse = ( maintenanceWindow: MaintenanceWindow diff --git a/x-pack/platform/plugins/shared/alerting/server/routes/rule/apis/aggregate/aggregate_rules_route.ts b/x-pack/platform/plugins/shared/alerting/server/routes/rule/apis/aggregate/aggregate_rules_route.ts index 13cc8fb7d816c..001431b206a87 100644 --- a/x-pack/platform/plugins/shared/alerting/server/routes/rule/apis/aggregate/aggregate_rules_route.ts +++ b/x-pack/platform/plugins/shared/alerting/server/routes/rule/apis/aggregate/aggregate_rules_route.ts @@ -5,22 +5,23 @@ * 2.0. */ -import { IRouter } from '@kbn/core/server'; -import { UsageCounter } from '@kbn/usage-collection-plugin/server'; +import type { IRouter } from '@kbn/core/server'; +import type { UsageCounter } from '@kbn/usage-collection-plugin/server'; import { defaultRuleAggregationFactoryV1 } from '../../../../application/rule/methods/aggregate'; -import { ILicenseState } from '../../../../lib'; +import type { ILicenseState } from '../../../../lib'; import { verifyAccessAndContext } from '../../../lib'; -import { AlertingRequestHandlerContext, INTERNAL_BASE_ALERTING_API_PATH } from '../../../../types'; +import type { AlertingRequestHandlerContext } from '../../../../types'; +import { INTERNAL_BASE_ALERTING_API_PATH } from '../../../../types'; import { trackLegacyTerminology } from '../../../lib/track_legacy_terminology'; -import { - aggregateRulesRequestBodySchemaV1, +import type { AggregateRulesRequestBodyV1, AggregateRulesResponseV1, } from '../../../../../common/routes/rule/apis/aggregate'; +import { aggregateRulesRequestBodySchemaV1 } from '../../../../../common/routes/rule/apis/aggregate'; import { formatDefaultAggregationResult } from './transforms'; import { transformAggregateQueryRequestV1, transformAggregateBodyResponseV1 } from './transforms'; -import { DefaultRuleAggregationResult } from './types'; +import type { DefaultRuleAggregationResult } from './types'; import { DEFAULT_ALERTING_ROUTE_SECURITY } from '../../../constants'; export const aggregateRulesRoute = ( diff --git a/x-pack/platform/plugins/shared/alerting/server/routes/rule/apis/aggregate/transforms/format_default_aggregation_result/index.ts b/x-pack/platform/plugins/shared/alerting/server/routes/rule/apis/aggregate/transforms/format_default_aggregation_result/index.ts index 1f8635e9351e6..def99b1f7ed7c 100644 --- a/x-pack/platform/plugins/shared/alerting/server/routes/rule/apis/aggregate/transforms/format_default_aggregation_result/index.ts +++ b/x-pack/platform/plugins/shared/alerting/server/routes/rule/apis/aggregate/transforms/format_default_aggregation_result/index.ts @@ -5,9 +5,9 @@ * 2.0. */ -import { RuleAggregationFormattedResult } from '../../../../../../application/rule/methods/aggregate/types'; +import type { RuleAggregationFormattedResult } from '../../../../../../application/rule/methods/aggregate/types'; import { RuleExecutionStatusValues, RuleLastRunOutcomeValues } from '../../../../../../../common'; -import { DefaultRuleAggregationResult } from '../../types'; +import type { DefaultRuleAggregationResult } from '../../types'; export const formatDefaultAggregationResult = ( aggregations: DefaultRuleAggregationResult diff --git a/x-pack/platform/plugins/shared/alerting/server/routes/rule/apis/aggregate/transforms/transform_aggregate_body_response/v1.ts b/x-pack/platform/plugins/shared/alerting/server/routes/rule/apis/aggregate/transforms/transform_aggregate_body_response/v1.ts index 87bd99af3a665..edf914a687932 100644 --- a/x-pack/platform/plugins/shared/alerting/server/routes/rule/apis/aggregate/transforms/transform_aggregate_body_response/v1.ts +++ b/x-pack/platform/plugins/shared/alerting/server/routes/rule/apis/aggregate/transforms/transform_aggregate_body_response/v1.ts @@ -5,8 +5,8 @@ * 2.0. */ -import { RuleAggregationFormattedResult } from '../../../../../../application/rule/methods/aggregate/types'; -import { AggregateRulesResponseBodyV1 } from '../../../../../../../common/routes/rule/apis/aggregate'; +import type { RuleAggregationFormattedResult } from '../../../../../../application/rule/methods/aggregate/types'; +import type { AggregateRulesResponseBodyV1 } from '../../../../../../../common/routes/rule/apis/aggregate'; export const transformAggregateBodyResponse = ({ ruleExecutionStatus, diff --git a/x-pack/platform/plugins/shared/alerting/server/routes/rule/apis/aggregate/transforms/transform_aggregate_query_request/v1.ts b/x-pack/platform/plugins/shared/alerting/server/routes/rule/apis/aggregate/transforms/transform_aggregate_query_request/v1.ts index ae13f08d0afa5..53a03f25ab450 100644 --- a/x-pack/platform/plugins/shared/alerting/server/routes/rule/apis/aggregate/transforms/transform_aggregate_query_request/v1.ts +++ b/x-pack/platform/plugins/shared/alerting/server/routes/rule/apis/aggregate/transforms/transform_aggregate_query_request/v1.ts @@ -5,8 +5,8 @@ * 2.0. */ -import { RewriteRequestCase } from '@kbn/actions-plugin/common'; -import { AggregateOptions } from '../../../../../../application/rule/methods/aggregate/types'; +import type { RewriteRequestCase } from '@kbn/actions-plugin/common'; +import type { AggregateOptions } from '../../../../../../application/rule/methods/aggregate/types'; export const transformAggregateQueryRequest: RewriteRequestCase = ({ search, diff --git a/x-pack/platform/plugins/shared/alerting/server/routes/rule/apis/bulk_delete/bulk_delete_rules_route.test.ts b/x-pack/platform/plugins/shared/alerting/server/routes/rule/apis/bulk_delete/bulk_delete_rules_route.test.ts index 90a13ba09a4cf..df715bf03d594 100644 --- a/x-pack/platform/plugins/shared/alerting/server/routes/rule/apis/bulk_delete/bulk_delete_rules_route.test.ts +++ b/x-pack/platform/plugins/shared/alerting/server/routes/rule/apis/bulk_delete/bulk_delete_rules_route.test.ts @@ -13,7 +13,7 @@ import { mockHandlerArguments } from '../../../_mock_handler_arguments'; import { rulesClientMock } from '../../../../rules_client.mock'; import { RuleTypeDisabledError } from '../../../../lib/errors/rule_type_disabled'; import { verifyApiAccess } from '../../../../lib/license_api_access'; -import { RuleAction, RuleSystemAction, SanitizedRule } from '../../../../types'; +import type { RuleAction, RuleSystemAction, SanitizedRule } from '../../../../types'; const rulesClient = rulesClientMock.create(); diff --git a/x-pack/platform/plugins/shared/alerting/server/routes/rule/apis/bulk_delete/bulk_delete_rules_route.ts b/x-pack/platform/plugins/shared/alerting/server/routes/rule/apis/bulk_delete/bulk_delete_rules_route.ts index 8dc14d5d7cba0..570912ee52de0 100644 --- a/x-pack/platform/plugins/shared/alerting/server/routes/rule/apis/bulk_delete/bulk_delete_rules_route.ts +++ b/x-pack/platform/plugins/shared/alerting/server/routes/rule/apis/bulk_delete/bulk_delete_rules_route.ts @@ -5,18 +5,20 @@ * 2.0. */ -import { IRouter } from '@kbn/core/server'; +import type { IRouter } from '@kbn/core/server'; import { verifyAccessAndContext, handleDisabledApiKeysError } from '../../../lib'; -import { ILicenseState, RuleTypeDisabledError } from '../../../../lib'; -import { AlertingRequestHandlerContext, INTERNAL_BASE_ALERTING_API_PATH } from '../../../../types'; -import { - bulkDeleteRulesRequestBodySchemaV1, +import type { ILicenseState } from '../../../../lib'; +import { RuleTypeDisabledError } from '../../../../lib'; +import type { AlertingRequestHandlerContext } from '../../../../types'; +import { INTERNAL_BASE_ALERTING_API_PATH } from '../../../../types'; +import type { BulkDeleteRulesRequestBodyV1, BulkDeleteRulesResponseV1, } from '../../../../../common/routes/rule/apis/bulk_delete'; +import { bulkDeleteRulesRequestBodySchemaV1 } from '../../../../../common/routes/rule/apis/bulk_delete'; import type { RuleParamsV1 } from '../../../../../common/routes/rule/response'; import { transformRuleToRuleResponseV1 } from '../../transforms'; -import { Rule } from '../../../../application/rule/types'; +import type { Rule } from '../../../../application/rule/types'; import { DEFAULT_ALERTING_ROUTE_SECURITY } from '../../../constants'; export const bulkDeleteRulesRoute = ({ diff --git a/x-pack/platform/plugins/shared/alerting/server/routes/rule/apis/bulk_disable/bulk_disable_rules_route.test.ts b/x-pack/platform/plugins/shared/alerting/server/routes/rule/apis/bulk_disable/bulk_disable_rules_route.test.ts index 0dc0793118c23..76a570e020d44 100644 --- a/x-pack/platform/plugins/shared/alerting/server/routes/rule/apis/bulk_disable/bulk_disable_rules_route.test.ts +++ b/x-pack/platform/plugins/shared/alerting/server/routes/rule/apis/bulk_disable/bulk_disable_rules_route.test.ts @@ -14,7 +14,7 @@ import { rulesClientMock } from '../../../../rules_client.mock'; import { RuleTypeDisabledError } from '../../../../lib/errors/rule_type_disabled'; import { verifyApiAccess } from '../../../../lib/license_api_access'; import { actionsClientMock } from '@kbn/actions-plugin/server/mocks'; -import { RuleAction, RuleSystemAction, SanitizedRule } from '../../../../types'; +import type { RuleAction, RuleSystemAction, SanitizedRule } from '../../../../types'; const rulesClient = rulesClientMock.create(); diff --git a/x-pack/platform/plugins/shared/alerting/server/routes/rule/apis/bulk_disable/bulk_disable_rules_route.ts b/x-pack/platform/plugins/shared/alerting/server/routes/rule/apis/bulk_disable/bulk_disable_rules_route.ts index 4a047a120b06b..cd9252404108c 100644 --- a/x-pack/platform/plugins/shared/alerting/server/routes/rule/apis/bulk_disable/bulk_disable_rules_route.ts +++ b/x-pack/platform/plugins/shared/alerting/server/routes/rule/apis/bulk_disable/bulk_disable_rules_route.ts @@ -5,18 +5,20 @@ * 2.0. */ -import { IRouter } from '@kbn/core/server'; -import { ILicenseState, RuleTypeDisabledError } from '../../../../lib'; -import { AlertingRequestHandlerContext, INTERNAL_BASE_ALERTING_API_PATH } from '../../../../types'; +import type { IRouter } from '@kbn/core/server'; +import type { ILicenseState } from '../../../../lib'; +import { RuleTypeDisabledError } from '../../../../lib'; +import type { AlertingRequestHandlerContext } from '../../../../types'; +import { INTERNAL_BASE_ALERTING_API_PATH } from '../../../../types'; import { handleDisabledApiKeysError, verifyAccessAndContext } from '../../../lib'; -import { - bulkDisableRulesRequestBodySchemaV1, +import type { BulkDisableRulesRequestBodyV1, BulkDisableRulesResponseV1, } from '../../../../../common/routes/rule/apis/bulk_disable'; +import { bulkDisableRulesRequestBodySchemaV1 } from '../../../../../common/routes/rule/apis/bulk_disable'; import type { RuleParamsV1 } from '../../../../../common/routes/rule/response'; -import { Rule } from '../../../../application/rule/types'; +import type { Rule } from '../../../../application/rule/types'; import { transformRuleToRuleResponseV1 } from '../../transforms'; import { DEFAULT_ALERTING_ROUTE_SECURITY } from '../../../constants'; diff --git a/x-pack/platform/plugins/shared/alerting/server/routes/rule/apis/bulk_edit/bulk_edit_rules_route.test.ts b/x-pack/platform/plugins/shared/alerting/server/routes/rule/apis/bulk_edit/bulk_edit_rules_route.test.ts index 295299db3a117..2ad62e422f0b3 100644 --- a/x-pack/platform/plugins/shared/alerting/server/routes/rule/apis/bulk_edit/bulk_edit_rules_route.test.ts +++ b/x-pack/platform/plugins/shared/alerting/server/routes/rule/apis/bulk_edit/bulk_edit_rules_route.test.ts @@ -13,7 +13,7 @@ import { verifyApiAccess } from '../../../../lib/license_api_access'; import { RuleTypeDisabledError } from '../../../../lib/errors/rule_type_disabled'; import { mockHandlerArguments } from '../../../_mock_handler_arguments'; import { rulesClientMock } from '../../../../rules_client.mock'; -import { RuleAction, RuleSystemAction, SanitizedRule } from '../../../../types'; +import type { RuleAction, RuleSystemAction, SanitizedRule } from '../../../../types'; import { actionsClientMock } from '@kbn/actions-plugin/server/mocks'; import { omit } from 'lodash'; diff --git a/x-pack/platform/plugins/shared/alerting/server/routes/rule/apis/bulk_edit/bulk_edit_rules_route.ts b/x-pack/platform/plugins/shared/alerting/server/routes/rule/apis/bulk_edit/bulk_edit_rules_route.ts index 27c1730ed695e..a86cfff723823 100644 --- a/x-pack/platform/plugins/shared/alerting/server/routes/rule/apis/bulk_edit/bulk_edit_rules_route.ts +++ b/x-pack/platform/plugins/shared/alerting/server/routes/rule/apis/bulk_edit/bulk_edit_rules_route.ts @@ -5,19 +5,21 @@ * 2.0. */ -import { IRouter } from '@kbn/core/server'; +import type { IRouter } from '@kbn/core/server'; -import { ILicenseState, RuleTypeDisabledError } from '../../../../lib'; -import { AlertingRequestHandlerContext, INTERNAL_BASE_ALERTING_API_PATH } from '../../../../types'; +import type { ILicenseState } from '../../../../lib'; +import { RuleTypeDisabledError } from '../../../../lib'; +import type { AlertingRequestHandlerContext } from '../../../../types'; +import { INTERNAL_BASE_ALERTING_API_PATH } from '../../../../types'; import { handleDisabledApiKeysError, verifyAccessAndContext } from '../../../lib'; -import { - bulkEditRulesRequestBodySchemaV1, +import type { BulkEditRulesRequestBodyV1, BulkEditRulesResponseV1, } from '../../../../../common/routes/rule/apis/bulk_edit'; +import { bulkEditRulesRequestBodySchemaV1 } from '../../../../../common/routes/rule/apis/bulk_edit'; import type { RuleParamsV1 } from '../../../../../common/routes/rule/response'; -import { Rule } from '../../../../application/rule/types'; +import type { Rule } from '../../../../application/rule/types'; import { transformRuleToRuleResponseV1 } from '../../transforms'; import { validateRequiredGroupInDefaultActionsV1 } from '../../validation'; diff --git a/x-pack/platform/plugins/shared/alerting/server/routes/rule/apis/bulk_edit/transforms/transform_operations/v1.ts b/x-pack/platform/plugins/shared/alerting/server/routes/rule/apis/bulk_edit/transforms/transform_operations/v1.ts index 844617ab2700f..138f53bee2d26 100644 --- a/x-pack/platform/plugins/shared/alerting/server/routes/rule/apis/bulk_edit/transforms/transform_operations/v1.ts +++ b/x-pack/platform/plugins/shared/alerting/server/routes/rule/apis/bulk_edit/transforms/transform_operations/v1.ts @@ -5,8 +5,8 @@ * 2.0. */ -import { BulkEditOperation } from '../../../../../../application/rule/methods/bulk_edit'; -import { BulkEditRulesRequestBodyV1 } from '../../../../../../../common/routes/rule/apis/bulk_edit'; +import type { BulkEditOperation } from '../../../../../../application/rule/methods/bulk_edit'; +import type { BulkEditRulesRequestBodyV1 } from '../../../../../../../common/routes/rule/apis/bulk_edit'; export const transformOperations = ({ operations, diff --git a/x-pack/platform/plugins/shared/alerting/server/routes/rule/apis/bulk_enable/bulk_enable_rules_route.test.ts b/x-pack/platform/plugins/shared/alerting/server/routes/rule/apis/bulk_enable/bulk_enable_rules_route.test.ts index 272d91997a9f5..bc7dcb7811622 100644 --- a/x-pack/platform/plugins/shared/alerting/server/routes/rule/apis/bulk_enable/bulk_enable_rules_route.test.ts +++ b/x-pack/platform/plugins/shared/alerting/server/routes/rule/apis/bulk_enable/bulk_enable_rules_route.test.ts @@ -8,14 +8,14 @@ import { httpServiceMock } from '@kbn/core/server/mocks'; import { actionsClientMock } from '@kbn/actions-plugin/server/mocks'; import { bulkEnableRulesRoute } from './bulk_enable_rules_route'; -import { BulkEnableRulesResult } from '../../../../application/rule/methods/bulk_enable'; +import type { BulkEnableRulesResult } from '../../../../application/rule/methods/bulk_enable'; import { licenseStateMock } from '../../../../lib/license_state.mock'; import { mockHandlerArguments } from '../../../_mock_handler_arguments'; import { rulesClientMock } from '../../../../rules_client.mock'; import { RuleTypeDisabledError } from '../../../../lib/errors/rule_type_disabled'; import { verifyApiAccess } from '../../../../lib/license_api_access'; -import { RuleAction, RuleSystemAction } from '../../../../types'; -import { Rule, RuleParams } from '../../../../application/rule/types'; +import type { RuleAction, RuleSystemAction } from '../../../../types'; +import type { Rule, RuleParams } from '../../../../application/rule/types'; const rulesClient = rulesClientMock.create(); diff --git a/x-pack/platform/plugins/shared/alerting/server/routes/rule/apis/bulk_enable/bulk_enable_rules_route.ts b/x-pack/platform/plugins/shared/alerting/server/routes/rule/apis/bulk_enable/bulk_enable_rules_route.ts index fe91eafe82b59..aa16c0e178c02 100644 --- a/x-pack/platform/plugins/shared/alerting/server/routes/rule/apis/bulk_enable/bulk_enable_rules_route.ts +++ b/x-pack/platform/plugins/shared/alerting/server/routes/rule/apis/bulk_enable/bulk_enable_rules_route.ts @@ -5,16 +5,18 @@ * 2.0. */ -import { IRouter } from '@kbn/core/server'; +import type { IRouter } from '@kbn/core/server'; import { verifyAccessAndContext, handleDisabledApiKeysError } from '../../../lib'; -import { ILicenseState, RuleTypeDisabledError } from '../../../../lib'; -import { AlertingRequestHandlerContext, INTERNAL_BASE_ALERTING_API_PATH } from '../../../../types'; -import { - bulkEnableBodySchemaV1, +import type { ILicenseState } from '../../../../lib'; +import { RuleTypeDisabledError } from '../../../../lib'; +import type { AlertingRequestHandlerContext } from '../../../../types'; +import { INTERNAL_BASE_ALERTING_API_PATH } from '../../../../types'; +import type { BulkEnableRulesRequestBodyV1, BulkEnableRulesResponseV1, } from '../../../../../common/routes/rule/apis/bulk_enable'; -import { RuleParamsV1 } from '../../../../../common/routes/rule/response'; +import { bulkEnableBodySchemaV1 } from '../../../../../common/routes/rule/apis/bulk_enable'; +import type { RuleParamsV1 } from '../../../../../common/routes/rule/response'; import { transformBulkEnableResponseV1 } from './transforms'; import { DEFAULT_ALERTING_ROUTE_SECURITY } from '../../../constants'; diff --git a/x-pack/platform/plugins/shared/alerting/server/routes/rule/apis/bulk_enable/transforms/transform_bulk_enable_response/v1.test.ts b/x-pack/platform/plugins/shared/alerting/server/routes/rule/apis/bulk_enable/transforms/transform_bulk_enable_response/v1.test.ts index a4acab93ba387..aa204c39e90ef 100644 --- a/x-pack/platform/plugins/shared/alerting/server/routes/rule/apis/bulk_enable/transforms/transform_bulk_enable_response/v1.test.ts +++ b/x-pack/platform/plugins/shared/alerting/server/routes/rule/apis/bulk_enable/transforms/transform_bulk_enable_response/v1.test.ts @@ -6,7 +6,7 @@ */ import { transformBulkEnableResponse } from './v1'; -import { RuleAction, RuleSystemAction } from '../../../../../../../common'; +import type { RuleAction, RuleSystemAction } from '../../../../../../../common'; describe('transformBulkEnableResponse', () => { const defaultAction: RuleAction = { diff --git a/x-pack/platform/plugins/shared/alerting/server/routes/rule/apis/bulk_enable/transforms/transform_bulk_enable_response/v1.ts b/x-pack/platform/plugins/shared/alerting/server/routes/rule/apis/bulk_enable/transforms/transform_bulk_enable_response/v1.ts index 5d0498f751be1..e88383a86fa93 100644 --- a/x-pack/platform/plugins/shared/alerting/server/routes/rule/apis/bulk_enable/transforms/transform_bulk_enable_response/v1.ts +++ b/x-pack/platform/plugins/shared/alerting/server/routes/rule/apis/bulk_enable/transforms/transform_bulk_enable_response/v1.ts @@ -5,11 +5,11 @@ * 2.0. */ -import { BulkEnableRulesResponseV1 } from '../../../../../../../common/routes/rule/apis/bulk_enable'; -import { RuleParamsV1 } from '../../../../../../../common/routes/rule/response'; -import { BulkEnableRulesResult } from '../../../../../../application/rule/methods/bulk_enable/types'; +import type { BulkEnableRulesResponseV1 } from '../../../../../../../common/routes/rule/apis/bulk_enable'; +import type { RuleParamsV1 } from '../../../../../../../common/routes/rule/response'; +import type { BulkEnableRulesResult } from '../../../../../../application/rule/methods/bulk_enable/types'; import { transformRuleToRuleResponseV1 } from '../../../../transforms'; -import { Rule, RuleParams } from '../../../../../../application/rule/types'; +import type { Rule, RuleParams } from '../../../../../../application/rule/types'; export const transformBulkEnableResponse = ( response: BulkEnableRulesResult diff --git a/x-pack/platform/plugins/shared/alerting/server/routes/rule/apis/bulk_untrack/bulk_untrack_alerts_route.ts b/x-pack/platform/plugins/shared/alerting/server/routes/rule/apis/bulk_untrack/bulk_untrack_alerts_route.ts index 48619a040ebc4..cf022f89f2eb8 100644 --- a/x-pack/platform/plugins/shared/alerting/server/routes/rule/apis/bulk_untrack/bulk_untrack_alerts_route.ts +++ b/x-pack/platform/plugins/shared/alerting/server/routes/rule/apis/bulk_untrack/bulk_untrack_alerts_route.ts @@ -4,15 +4,15 @@ * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ -import { IRouter } from '@kbn/core/server'; -import { - BulkUntrackRequestBodyV1, - bulkUntrackBodySchemaV1, -} from '../../../../../common/routes/rule/apis/bulk_untrack'; +import type { IRouter } from '@kbn/core/server'; +import type { BulkUntrackRequestBodyV1 } from '../../../../../common/routes/rule/apis/bulk_untrack'; +import { bulkUntrackBodySchemaV1 } from '../../../../../common/routes/rule/apis/bulk_untrack'; import { transformBulkUntrackAlertsBodyV1 } from './transforms'; -import { ILicenseState, RuleTypeDisabledError } from '../../../../lib'; +import type { ILicenseState } from '../../../../lib'; +import { RuleTypeDisabledError } from '../../../../lib'; import { verifyAccessAndContext } from '../../../lib'; -import { AlertingRequestHandlerContext, INTERNAL_BASE_ALERTING_API_PATH } from '../../../../types'; +import type { AlertingRequestHandlerContext } from '../../../../types'; +import { INTERNAL_BASE_ALERTING_API_PATH } from '../../../../types'; import { DEFAULT_ALERTING_ROUTE_SECURITY } from '../../../constants'; export const bulkUntrackAlertsRoute = ( diff --git a/x-pack/platform/plugins/shared/alerting/server/routes/rule/apis/bulk_untrack_by_query/bulk_untrack_alerts_by_query_route.ts b/x-pack/platform/plugins/shared/alerting/server/routes/rule/apis/bulk_untrack_by_query/bulk_untrack_alerts_by_query_route.ts index 9f3bdfe959e38..564529dadf2f5 100644 --- a/x-pack/platform/plugins/shared/alerting/server/routes/rule/apis/bulk_untrack_by_query/bulk_untrack_alerts_by_query_route.ts +++ b/x-pack/platform/plugins/shared/alerting/server/routes/rule/apis/bulk_untrack_by_query/bulk_untrack_alerts_by_query_route.ts @@ -5,14 +5,14 @@ * 2.0. */ -import { IRouter } from '@kbn/core/server'; -import { - BulkUntrackByQueryRequestBodyV1, - bulkUntrackByQueryBodySchemaV1, -} from '../../../../../common/routes/rule/apis/bulk_untrack_by_query'; -import { ILicenseState, RuleTypeDisabledError } from '../../../../lib'; +import type { IRouter } from '@kbn/core/server'; +import type { BulkUntrackByQueryRequestBodyV1 } from '../../../../../common/routes/rule/apis/bulk_untrack_by_query'; +import { bulkUntrackByQueryBodySchemaV1 } from '../../../../../common/routes/rule/apis/bulk_untrack_by_query'; +import type { ILicenseState } from '../../../../lib'; +import { RuleTypeDisabledError } from '../../../../lib'; import { verifyAccessAndContext } from '../../../lib'; -import { AlertingRequestHandlerContext, INTERNAL_BASE_ALERTING_API_PATH } from '../../../../types'; +import type { AlertingRequestHandlerContext } from '../../../../types'; +import { INTERNAL_BASE_ALERTING_API_PATH } from '../../../../types'; import { transformBulkUntrackAlertsByQueryBodyV1 } from './transforms'; import { DEFAULT_ALERTING_ROUTE_SECURITY } from '../../../constants'; diff --git a/x-pack/platform/plugins/shared/alerting/server/routes/rule/apis/clone/clone_rule_route.test.ts b/x-pack/platform/plugins/shared/alerting/server/routes/rule/apis/clone/clone_rule_route.test.ts index 13c6a69087635..9529cb2fd5667 100644 --- a/x-pack/platform/plugins/shared/alerting/server/routes/rule/apis/clone/clone_rule_route.test.ts +++ b/x-pack/platform/plugins/shared/alerting/server/routes/rule/apis/clone/clone_rule_route.test.ts @@ -13,7 +13,7 @@ import { mockHandlerArguments } from '../../../_mock_handler_arguments'; import { rulesClientMock } from '../../../../rules_client.mock'; import { RuleTypeDisabledError } from '../../../../lib/errors/rule_type_disabled'; import { cloneRuleRoute } from './clone_rule_route'; -import { RuleAction, RuleSystemAction, SanitizedRule } from '../../../../types'; +import type { RuleAction, RuleSystemAction, SanitizedRule } from '../../../../types'; const rulesClient = rulesClientMock.create(); jest.mock('../../../../lib/license_api_access', () => ({ diff --git a/x-pack/platform/plugins/shared/alerting/server/routes/rule/apis/clone/clone_rule_route.ts b/x-pack/platform/plugins/shared/alerting/server/routes/rule/apis/clone/clone_rule_route.ts index cf483de6a62c5..d34021a04a68e 100644 --- a/x-pack/platform/plugins/shared/alerting/server/routes/rule/apis/clone/clone_rule_route.ts +++ b/x-pack/platform/plugins/shared/alerting/server/routes/rule/apis/clone/clone_rule_route.ts @@ -5,17 +5,19 @@ * 2.0. */ -import { IRouter } from '@kbn/core/server'; -import { ILicenseState, RuleTypeDisabledError } from '../../../../lib'; +import type { IRouter } from '@kbn/core/server'; +import type { ILicenseState } from '../../../../lib'; +import { RuleTypeDisabledError } from '../../../../lib'; import { verifyAccessAndContext, handleDisabledApiKeysError } from '../../../lib'; -import { AlertingRequestHandlerContext, INTERNAL_BASE_ALERTING_API_PATH } from '../../../../types'; -import { - cloneRuleRequestParamsSchemaV1, +import type { AlertingRequestHandlerContext } from '../../../../types'; +import { INTERNAL_BASE_ALERTING_API_PATH } from '../../../../types'; +import type { CloneRuleRequestParamsV1, CloneRuleResponseV1, } from '../../../../../common/routes/rule/apis/clone'; +import { cloneRuleRequestParamsSchemaV1 } from '../../../../../common/routes/rule/apis/clone'; import type { RuleParamsV1 } from '../../../../../common/routes/rule/response'; -import { Rule } from '../../../../application/rule/types'; +import type { Rule } from '../../../../application/rule/types'; import { transformRuleToRuleResponseV1 } from '../../transforms'; import { DEFAULT_ALERTING_ROUTE_SECURITY } from '../../../constants'; diff --git a/x-pack/platform/plugins/shared/alerting/server/routes/rule/apis/create/create_rule_route.test.ts b/x-pack/platform/plugins/shared/alerting/server/routes/rule/apis/create/create_rule_route.test.ts index f778b09854abd..8b0f3f4b53598 100644 --- a/x-pack/platform/plugins/shared/alerting/server/routes/rule/apis/create/create_rule_route.test.ts +++ b/x-pack/platform/plugins/shared/alerting/server/routes/rule/apis/create/create_rule_route.test.ts @@ -14,7 +14,7 @@ import { mockHandlerArguments } from '../../../_mock_handler_arguments'; import type { CreateRuleRequestBodyV1 } from '../../../../../common/routes/rule/apis/create'; import { rulesClientMock } from '../../../../rules_client.mock'; import { RuleTypeDisabledError } from '../../../../lib'; -import { RuleAction, RuleSystemAction, SanitizedRule } from '../../../../types'; +import type { RuleAction, RuleSystemAction, SanitizedRule } from '../../../../types'; import { encryptedSavedObjectsMock } from '@kbn/encrypted-saved-objects-plugin/server/mocks'; import { usageCountersServiceMock } from '@kbn/usage-collection-plugin/server/usage_counters/usage_counters_service.mock'; import { actionsClientMock } from '@kbn/actions-plugin/server/mocks'; diff --git a/x-pack/platform/plugins/shared/alerting/server/routes/rule/apis/create/create_rule_route.ts b/x-pack/platform/plugins/shared/alerting/server/routes/rule/apis/create/create_rule_route.ts index 72b4a4c897f1f..ed97c10d039a1 100644 --- a/x-pack/platform/plugins/shared/alerting/server/routes/rule/apis/create/create_rule_route.ts +++ b/x-pack/platform/plugins/shared/alerting/server/routes/rule/apis/create/create_rule_route.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { RouteOptions } from '../../..'; +import type { RouteOptions } from '../../..'; import type { CreateRuleRequestBodyV1, CreateRuleRequestParamsV1, @@ -15,8 +15,9 @@ import { createBodySchemaV1, createParamsSchemaV1, } from '../../../../../common/routes/rule/apis/create'; -import { RuleParamsV1, ruleResponseSchemaV1 } from '../../../../../common/routes/rule/response'; -import { Rule } from '../../../../application/rule/types'; +import type { RuleParamsV1 } from '../../../../../common/routes/rule/response'; +import { ruleResponseSchemaV1 } from '../../../../../common/routes/rule/response'; +import type { Rule } from '../../../../application/rule/types'; import { RuleTypeDisabledError } from '../../../../lib'; import { BASE_ALERTING_API_PATH } from '../../../../types'; import { DEFAULT_ALERTING_ROUTE_SECURITY } from '../../../constants'; diff --git a/x-pack/platform/plugins/shared/alerting/server/routes/rule/apis/create/transforms/transform_create_body/v1.test.ts b/x-pack/platform/plugins/shared/alerting/server/routes/rule/apis/create/transforms/transform_create_body/v1.test.ts index fed6c30f043d9..e2639e5035a3d 100644 --- a/x-pack/platform/plugins/shared/alerting/server/routes/rule/apis/create/transforms/transform_create_body/v1.test.ts +++ b/x-pack/platform/plugins/shared/alerting/server/routes/rule/apis/create/transforms/transform_create_body/v1.test.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { +import type { CreateRuleAction, CreateRuleRequestBodyV1, } from '../../../../../../../common/routes/rule/apis/create'; diff --git a/x-pack/platform/plugins/shared/alerting/server/routes/rule/apis/delete/delete_rule_route.ts b/x-pack/platform/plugins/shared/alerting/server/routes/rule/apis/delete/delete_rule_route.ts index 9fb4fd05bfb08..d1909054be1a0 100644 --- a/x-pack/platform/plugins/shared/alerting/server/routes/rule/apis/delete/delete_rule_route.ts +++ b/x-pack/platform/plugins/shared/alerting/server/routes/rule/apis/delete/delete_rule_route.ts @@ -5,14 +5,13 @@ * 2.0. */ -import { IRouter } from '@kbn/core/server'; -import { ILicenseState } from '../../../../lib'; +import type { IRouter } from '@kbn/core/server'; +import type { ILicenseState } from '../../../../lib'; import { verifyAccessAndContext } from '../../../lib'; -import { - deleteRuleRequestParamsSchemaV1, - DeleteRuleRequestParamsV1, -} from '../../../../../common/routes/rule/apis/delete'; -import { AlertingRequestHandlerContext, BASE_ALERTING_API_PATH } from '../../../../types'; +import type { DeleteRuleRequestParamsV1 } from '../../../../../common/routes/rule/apis/delete'; +import { deleteRuleRequestParamsSchemaV1 } from '../../../../../common/routes/rule/apis/delete'; +import type { AlertingRequestHandlerContext } from '../../../../types'; +import { BASE_ALERTING_API_PATH } from '../../../../types'; import { DEFAULT_ALERTING_ROUTE_SECURITY } from '../../../constants'; export const deleteRuleRoute = ( diff --git a/x-pack/platform/plugins/shared/alerting/server/routes/rule/apis/disable/disable_rule_route.ts b/x-pack/platform/plugins/shared/alerting/server/routes/rule/apis/disable/disable_rule_route.ts index 38451802d660f..e4c4ffff6edf6 100644 --- a/x-pack/platform/plugins/shared/alerting/server/routes/rule/apis/disable/disable_rule_route.ts +++ b/x-pack/platform/plugins/shared/alerting/server/routes/rule/apis/disable/disable_rule_route.ts @@ -5,15 +5,19 @@ * 2.0. */ -import { IRouter } from '@kbn/core/server'; -import { +import type { IRouter } from '@kbn/core/server'; +import type { DisableRuleRequestBodyV1, DisableRuleRequestParamsV1, +} from '../../../../../common/routes/rule/apis/disable'; +import { disableRuleRequestBodySchemaV1, disableRuleRequestParamsSchemaV1, } from '../../../../../common/routes/rule/apis/disable'; -import { ILicenseState, RuleTypeDisabledError } from '../../../../lib'; -import { AlertingRequestHandlerContext, BASE_ALERTING_API_PATH } from '../../../../types'; +import type { ILicenseState } from '../../../../lib'; +import { RuleTypeDisabledError } from '../../../../lib'; +import type { AlertingRequestHandlerContext } from '../../../../types'; +import { BASE_ALERTING_API_PATH } from '../../../../types'; import { verifyAccessAndContext } from '../../../lib'; import { DEFAULT_ALERTING_ROUTE_SECURITY } from '../../../constants'; diff --git a/x-pack/platform/plugins/shared/alerting/server/routes/rule/apis/enable/enable_rule_route.ts b/x-pack/platform/plugins/shared/alerting/server/routes/rule/apis/enable/enable_rule_route.ts index 1d68c5b922f22..7d034f4b6354a 100644 --- a/x-pack/platform/plugins/shared/alerting/server/routes/rule/apis/enable/enable_rule_route.ts +++ b/x-pack/platform/plugins/shared/alerting/server/routes/rule/apis/enable/enable_rule_route.ts @@ -5,15 +5,15 @@ * 2.0. */ -import { IRouter } from '@kbn/core/server'; -import { ILicenseState, RuleTypeDisabledError } from '../../../../lib'; -import { AlertingRequestHandlerContext, BASE_ALERTING_API_PATH } from '../../../../types'; +import type { IRouter } from '@kbn/core/server'; +import type { ILicenseState } from '../../../../lib'; +import { RuleTypeDisabledError } from '../../../../lib'; +import type { AlertingRequestHandlerContext } from '../../../../types'; +import { BASE_ALERTING_API_PATH } from '../../../../types'; import { verifyAccessAndContext } from '../../../lib'; -import { - EnableRuleRequestParamsV1, - enableRuleRequestParamsSchemaV1, -} from '../../../../../common/routes/rule/apis/enable'; +import type { EnableRuleRequestParamsV1 } from '../../../../../common/routes/rule/apis/enable'; +import { enableRuleRequestParamsSchemaV1 } from '../../../../../common/routes/rule/apis/enable'; import { DEFAULT_ALERTING_ROUTE_SECURITY } from '../../../constants'; export const enableRuleRoute = ( router: IRouter, diff --git a/x-pack/platform/plugins/shared/alerting/server/routes/rule/apis/find/find_internal_rules_route.ts b/x-pack/platform/plugins/shared/alerting/server/routes/rule/apis/find/find_internal_rules_route.ts index 573c6eba399b0..43a68e3dfec2d 100644 --- a/x-pack/platform/plugins/shared/alerting/server/routes/rule/apis/find/find_internal_rules_route.ts +++ b/x-pack/platform/plugins/shared/alerting/server/routes/rule/apis/find/find_internal_rules_route.ts @@ -5,19 +5,17 @@ * 2.0. */ -import { IRouter } from '@kbn/core/server'; -import { UsageCounter } from '@kbn/usage-collection-plugin/server'; +import type { IRouter } from '@kbn/core/server'; +import type { UsageCounter } from '@kbn/usage-collection-plugin/server'; import type { FindRulesInternalRequestBodyV1, FindRulesResponseV1, } from '../../../../../common/routes/rule/apis/find'; import { findRulesInternalRequestBodySchemaV1 } from '../../../../../common/routes/rule/apis/find'; -import { RuleParamsV1 } from '../../../../../common/routes/rule/response'; -import { ILicenseState } from '../../../../lib'; -import { - AlertingRequestHandlerContext, - INTERNAL_ALERTING_API_FIND_RULES_PATH, -} from '../../../../types'; +import type { RuleParamsV1 } from '../../../../../common/routes/rule/response'; +import type { ILicenseState } from '../../../../lib'; +import type { AlertingRequestHandlerContext } from '../../../../types'; +import { INTERNAL_ALERTING_API_FIND_RULES_PATH } from '../../../../types'; import { verifyAccessAndContext } from '../../../lib'; import { trackLegacyTerminology } from '../../../lib/track_legacy_terminology'; import { transformFindRulesInternalBodyV1, transformFindRulesResponseV1 } from './transforms'; diff --git a/x-pack/platform/plugins/shared/alerting/server/routes/rule/apis/find/find_rules_route.ts b/x-pack/platform/plugins/shared/alerting/server/routes/rule/apis/find/find_rules_route.ts index e24e58a63aa7d..2aa7550e7b017 100644 --- a/x-pack/platform/plugins/shared/alerting/server/routes/rule/apis/find/find_rules_route.ts +++ b/x-pack/platform/plugins/shared/alerting/server/routes/rule/apis/find/find_rules_route.ts @@ -5,16 +5,18 @@ * 2.0. */ -import { IRouter } from '@kbn/core/server'; -import { UsageCounter } from '@kbn/usage-collection-plugin/server'; +import type { IRouter } from '@kbn/core/server'; +import type { UsageCounter } from '@kbn/usage-collection-plugin/server'; import type { FindRulesRequestQueryV1, FindRulesResponseV1, } from '../../../../../common/routes/rule/apis/find'; import { findRulesRequestQuerySchemaV1 } from '../../../../../common/routes/rule/apis/find'; -import { RuleParamsV1, ruleResponseSchemaV1 } from '../../../../../common/routes/rule/response'; -import { ILicenseState } from '../../../../lib'; -import { AlertingRequestHandlerContext, BASE_ALERTING_API_PATH } from '../../../../types'; +import type { RuleParamsV1 } from '../../../../../common/routes/rule/response'; +import { ruleResponseSchemaV1 } from '../../../../../common/routes/rule/response'; +import type { ILicenseState } from '../../../../lib'; +import type { AlertingRequestHandlerContext } from '../../../../types'; +import { BASE_ALERTING_API_PATH } from '../../../../types'; import { verifyAccessAndContext } from '../../../lib'; import { trackLegacyTerminology } from '../../../lib/track_legacy_terminology'; import { transformFindRulesBodyV1, transformFindRulesResponseV1 } from './transforms'; diff --git a/x-pack/platform/plugins/shared/alerting/server/routes/rule/apis/find/transforms/transform_find_rules_body/v1.ts b/x-pack/platform/plugins/shared/alerting/server/routes/rule/apis/find/transforms/transform_find_rules_body/v1.ts index 3248c8f45360a..750e24269f4b0 100644 --- a/x-pack/platform/plugins/shared/alerting/server/routes/rule/apis/find/transforms/transform_find_rules_body/v1.ts +++ b/x-pack/platform/plugins/shared/alerting/server/routes/rule/apis/find/transforms/transform_find_rules_body/v1.ts @@ -9,7 +9,7 @@ import type { FindRulesInternalRequestBodyV1, FindRulesRequestQueryV1, } from '../../../../../../../common/routes/rule/apis/find'; -import { FindRulesOptions } from '../../../../../../application/rule/methods/find'; +import type { FindRulesOptions } from '../../../../../../application/rule/methods/find'; export const transformFindRulesBody = (params: FindRulesRequestQueryV1): FindRulesOptions => { const { diff --git a/x-pack/platform/plugins/shared/alerting/server/routes/rule/apis/find/transforms/transform_find_rules_response/v1.ts b/x-pack/platform/plugins/shared/alerting/server/routes/rule/apis/find/transforms/transform_find_rules_response/v1.ts index e80ea1604cde1..80729ae13b6c0 100644 --- a/x-pack/platform/plugins/shared/alerting/server/routes/rule/apis/find/transforms/transform_find_rules_response/v1.ts +++ b/x-pack/platform/plugins/shared/alerting/server/routes/rule/apis/find/transforms/transform_find_rules_response/v1.ts @@ -11,7 +11,7 @@ import type { RuleParamsV1, } from '../../../../../../../common/routes/rule/response'; import type { FindResult } from '../../../../../../application/rule/methods/find'; -import { Rule, RuleParams } from '../../../../../../application/rule/types'; +import type { Rule, RuleParams } from '../../../../../../application/rule/types'; import { transformRuleActionsV1, transformMonitoringV1, diff --git a/x-pack/platform/plugins/shared/alerting/server/routes/rule/apis/get/get_rule_route.test.ts b/x-pack/platform/plugins/shared/alerting/server/routes/rule/apis/get/get_rule_route.test.ts index a9ae97e521ef5..18e0df217612c 100644 --- a/x-pack/platform/plugins/shared/alerting/server/routes/rule/apis/get/get_rule_route.test.ts +++ b/x-pack/platform/plugins/shared/alerting/server/routes/rule/apis/get/get_rule_route.test.ts @@ -12,7 +12,7 @@ import { licenseStateMock } from '../../../../lib/license_state.mock'; import { verifyApiAccess } from '../../../../lib/license_api_access'; import { mockHandlerArguments } from '../../../_mock_handler_arguments'; import { rulesClientMock } from '../../../../rules_client.mock'; -import { RuleAction, RuleSystemAction, SanitizedRule } from '../../../../types'; +import type { RuleAction, RuleSystemAction, SanitizedRule } from '../../../../types'; const rulesClient = rulesClientMock.create(); jest.mock('../../../../lib/license_api_access', () => ({ diff --git a/x-pack/platform/plugins/shared/alerting/server/routes/rule/apis/get/get_rule_route.ts b/x-pack/platform/plugins/shared/alerting/server/routes/rule/apis/get/get_rule_route.ts index 9119eae249db1..143ed354215df 100644 --- a/x-pack/platform/plugins/shared/alerting/server/routes/rule/apis/get/get_rule_route.ts +++ b/x-pack/platform/plugins/shared/alerting/server/routes/rule/apis/get/get_rule_route.ts @@ -5,16 +5,14 @@ * 2.0. */ -import { IRouter, RouteConfigOptions, RouteMethod } from '@kbn/core/server'; -import { ILicenseState } from '../../../../lib'; +import type { IRouter, RouteConfigOptions, RouteMethod } from '@kbn/core/server'; +import type { ILicenseState } from '../../../../lib'; import { verifyAccessAndContext } from '../../../lib'; -import { RuleParamsV1, ruleResponseSchemaV1 } from '../../../../../common/routes/rule/response'; -import { Rule } from '../../../../application/rule/types'; -import { - AlertingRequestHandlerContext, - BASE_ALERTING_API_PATH, - INTERNAL_BASE_ALERTING_API_PATH, -} from '../../../../types'; +import type { RuleParamsV1 } from '../../../../../common/routes/rule/response'; +import { ruleResponseSchemaV1 } from '../../../../../common/routes/rule/response'; +import type { Rule } from '../../../../application/rule/types'; +import type { AlertingRequestHandlerContext } from '../../../../types'; +import { BASE_ALERTING_API_PATH, INTERNAL_BASE_ALERTING_API_PATH } from '../../../../types'; import { transformRuleToRuleResponseV1 } from '../../transforms'; import type { diff --git a/x-pack/platform/plugins/shared/alerting/server/routes/rule/apis/get_schedule_frequency/get_schedule_frequency_route.ts b/x-pack/platform/plugins/shared/alerting/server/routes/rule/apis/get_schedule_frequency/get_schedule_frequency_route.ts index b0831aeee3790..0714dd8ab934d 100644 --- a/x-pack/platform/plugins/shared/alerting/server/routes/rule/apis/get_schedule_frequency/get_schedule_frequency_route.ts +++ b/x-pack/platform/plugins/shared/alerting/server/routes/rule/apis/get_schedule_frequency/get_schedule_frequency_route.ts @@ -5,11 +5,12 @@ * 2.0. */ -import { IRouter } from '@kbn/core/server'; -import { ILicenseState } from '../../../../lib'; +import type { IRouter } from '@kbn/core/server'; +import type { ILicenseState } from '../../../../lib'; import { verifyAccessAndContext } from '../../../lib'; -import { AlertingRequestHandlerContext, INTERNAL_BASE_ALERTING_API_PATH } from '../../../../types'; -import { GetScheduleFrequencyResponseV1 } from '../../../../../common/routes/rule/apis/get_schedule_frequency'; +import type { AlertingRequestHandlerContext } from '../../../../types'; +import { INTERNAL_BASE_ALERTING_API_PATH } from '../../../../types'; +import type { GetScheduleFrequencyResponseV1 } from '../../../../../common/routes/rule/apis/get_schedule_frequency'; import { transformGetScheduleFrequencyResultV1 } from './transforms'; import { DEFAULT_ALERTING_ROUTE_SECURITY } from '../../../constants'; diff --git a/x-pack/platform/plugins/shared/alerting/server/routes/rule/apis/list_types/rule_types.test.ts b/x-pack/platform/plugins/shared/alerting/server/routes/rule/apis/list_types/rule_types.test.ts index d32df997eb2c3..0415074fbbc50 100644 --- a/x-pack/platform/plugins/shared/alerting/server/routes/rule/apis/list_types/rule_types.test.ts +++ b/x-pack/platform/plugins/shared/alerting/server/routes/rule/apis/list_types/rule_types.test.ts @@ -12,8 +12,8 @@ import { verifyApiAccess } from '../../../../lib/license_api_access'; import { mockHandlerArguments } from '../../../_mock_handler_arguments'; import { rulesClientMock } from '../../../../rules_client.mock'; import { RecoveredActionGroup } from '../../../../../common'; -import { RegistryAlertTypeWithAuth } from '../../../../authorization'; -import { AsApiContract } from '../../../lib'; +import type { RegistryAlertTypeWithAuth } from '../../../../authorization'; +import type { AsApiContract } from '../../../lib'; const rulesClient = rulesClientMock.create(); diff --git a/x-pack/platform/plugins/shared/alerting/server/routes/rule/apis/list_types/rule_types.ts b/x-pack/platform/plugins/shared/alerting/server/routes/rule/apis/list_types/rule_types.ts index ddc3bf25467ff..ed494c1f82438 100644 --- a/x-pack/platform/plugins/shared/alerting/server/routes/rule/apis/list_types/rule_types.ts +++ b/x-pack/platform/plugins/shared/alerting/server/routes/rule/apis/list_types/rule_types.ts @@ -5,14 +5,13 @@ * 2.0. */ -import { IRouter } from '@kbn/core/server'; -import { - TypesRulesResponseBodyV1, - typesRulesResponseSchemaV1, -} from '../../../../../common/routes/rule/apis/list_types'; -import { ILicenseState } from '../../../../lib'; +import type { IRouter } from '@kbn/core/server'; +import type { TypesRulesResponseBodyV1 } from '../../../../../common/routes/rule/apis/list_types'; +import { typesRulesResponseSchemaV1 } from '../../../../../common/routes/rule/apis/list_types'; +import type { ILicenseState } from '../../../../lib'; import { verifyAccessAndContext } from '../../../lib'; -import { AlertingRequestHandlerContext, BASE_ALERTING_API_PATH } from '../../../../types'; +import type { AlertingRequestHandlerContext } from '../../../../types'; +import { BASE_ALERTING_API_PATH } from '../../../../types'; import { transformRuleTypesResponseV1 } from './transforms'; import { DEFAULT_ALERTING_ROUTE_SECURITY } from '../../../constants'; diff --git a/x-pack/platform/plugins/shared/alerting/server/routes/rule/apis/list_types/transforms/transform_rule_types_response/v1.ts b/x-pack/platform/plugins/shared/alerting/server/routes/rule/apis/list_types/transforms/transform_rule_types_response/v1.ts index e331fd9133332..2e083ea22c910 100644 --- a/x-pack/platform/plugins/shared/alerting/server/routes/rule/apis/list_types/transforms/transform_rule_types_response/v1.ts +++ b/x-pack/platform/plugins/shared/alerting/server/routes/rule/apis/list_types/transforms/transform_rule_types_response/v1.ts @@ -6,7 +6,7 @@ */ import { isBoolean } from 'lodash/fp'; -import { RegistryAlertTypeWithAuth } from '../../../../../../authorization'; +import type { RegistryAlertTypeWithAuth } from '../../../../../../authorization'; import type { TypesRulesResponseBodyV1 } from '../../../../../../../common/routes/rule/apis/list_types'; export const transformRuleTypesResponse = ( diff --git a/x-pack/platform/plugins/shared/alerting/server/routes/rule/apis/mute_alert/mute_alert.ts b/x-pack/platform/plugins/shared/alerting/server/routes/rule/apis/mute_alert/mute_alert.ts index 8df34e052ae4a..983ec9d2d165c 100644 --- a/x-pack/platform/plugins/shared/alerting/server/routes/rule/apis/mute_alert/mute_alert.ts +++ b/x-pack/platform/plugins/shared/alerting/server/routes/rule/apis/mute_alert/mute_alert.ts @@ -4,15 +4,15 @@ * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ -import { IRouter } from '@kbn/core/server'; +import type { IRouter } from '@kbn/core/server'; import { transformRequestParamsToApplicationV1 } from './transforms'; -import { ILicenseState, RuleTypeDisabledError } from '../../../../lib'; +import type { ILicenseState } from '../../../../lib'; +import { RuleTypeDisabledError } from '../../../../lib'; import { verifyAccessAndContext } from '../../../lib'; -import { AlertingRequestHandlerContext, BASE_ALERTING_API_PATH } from '../../../../types'; -import { - muteAlertParamsSchemaV1, - MuteAlertRequestParamsV1, -} from '../../../../../common/routes/rule/apis/mute_alert'; +import type { AlertingRequestHandlerContext } from '../../../../types'; +import { BASE_ALERTING_API_PATH } from '../../../../types'; +import type { MuteAlertRequestParamsV1 } from '../../../../../common/routes/rule/apis/mute_alert'; +import { muteAlertParamsSchemaV1 } from '../../../../../common/routes/rule/apis/mute_alert'; import { DEFAULT_ALERTING_ROUTE_SECURITY } from '../../../constants'; export const muteAlertRoute = ( diff --git a/x-pack/platform/plugins/shared/alerting/server/routes/rule/apis/mute_alert/transforms/transform_request_params_to_application/v1.ts b/x-pack/platform/plugins/shared/alerting/server/routes/rule/apis/mute_alert/transforms/transform_request_params_to_application/v1.ts index 37966060dba02..9dc55bb9e52f3 100644 --- a/x-pack/platform/plugins/shared/alerting/server/routes/rule/apis/mute_alert/transforms/transform_request_params_to_application/v1.ts +++ b/x-pack/platform/plugins/shared/alerting/server/routes/rule/apis/mute_alert/transforms/transform_request_params_to_application/v1.ts @@ -5,8 +5,8 @@ * 2.0. */ -import { MuteAlertParams } from '../../../../../../application/rule/methods/mute_alert/types'; -import { RewriteRequestCase } from '../../../../../lib'; +import type { MuteAlertParams } from '../../../../../../application/rule/methods/mute_alert/types'; +import type { RewriteRequestCase } from '../../../../../lib'; export const transformRequestParamsToApplication: RewriteRequestCase = ({ rule_id: alertId, diff --git a/x-pack/platform/plugins/shared/alerting/server/routes/rule/apis/mute_all/mute_all_rule.ts b/x-pack/platform/plugins/shared/alerting/server/routes/rule/apis/mute_all/mute_all_rule.ts index d34e589188bb2..dc9d48a5dafe2 100644 --- a/x-pack/platform/plugins/shared/alerting/server/routes/rule/apis/mute_all/mute_all_rule.ts +++ b/x-pack/platform/plugins/shared/alerting/server/routes/rule/apis/mute_all/mute_all_rule.ts @@ -5,16 +5,16 @@ * 2.0. */ -import { IRouter } from '@kbn/core/server'; -import { UsageCounter } from '@kbn/usage-collection-plugin/server'; -import { ILicenseState, RuleTypeDisabledError } from '../../../../lib'; +import type { IRouter } from '@kbn/core/server'; +import type { UsageCounter } from '@kbn/usage-collection-plugin/server'; +import type { ILicenseState } from '../../../../lib'; +import { RuleTypeDisabledError } from '../../../../lib'; import { verifyAccessAndContext } from '../../../lib'; -import { AlertingRequestHandlerContext, BASE_ALERTING_API_PATH } from '../../../../types'; +import type { AlertingRequestHandlerContext } from '../../../../types'; +import { BASE_ALERTING_API_PATH } from '../../../../types'; import { trackDeprecatedRouteUsage } from '../../../../lib/track_deprecated_route_usage'; -import { - muteAllRuleRequestParamsSchemaV1, - MuteAllRuleRequestParamsV1, -} from '../../../../../common/routes/rule/apis/mute_all'; +import type { MuteAllRuleRequestParamsV1 } from '../../../../../common/routes/rule/apis/mute_all'; +import { muteAllRuleRequestParamsSchemaV1 } from '../../../../../common/routes/rule/apis/mute_all'; import { DEFAULT_ALERTING_ROUTE_SECURITY } from '../../../constants'; export const muteAllRuleRoute = ( diff --git a/x-pack/platform/plugins/shared/alerting/server/routes/rule/apis/resolve/resolve_rule_route.test.ts b/x-pack/platform/plugins/shared/alerting/server/routes/rule/apis/resolve/resolve_rule_route.test.ts index 7b7d871007060..417651b7cc113 100644 --- a/x-pack/platform/plugins/shared/alerting/server/routes/rule/apis/resolve/resolve_rule_route.test.ts +++ b/x-pack/platform/plugins/shared/alerting/server/routes/rule/apis/resolve/resolve_rule_route.test.ts @@ -12,8 +12,8 @@ import { licenseStateMock } from '../../../../lib/license_state.mock'; import { verifyApiAccess } from '../../../../lib/license_api_access'; import { mockHandlerArguments } from '../../../_mock_handler_arguments'; import { rulesClientMock } from '../../../../rules_client.mock'; -import { ResolvedRule } from '../../../../application/rule/methods/resolve/types'; -import { ResolvedSanitizedRule, RuleAction, RuleSystemAction } from '../../../../../common'; +import type { ResolvedRule } from '../../../../application/rule/methods/resolve/types'; +import type { ResolvedSanitizedRule, RuleAction, RuleSystemAction } from '../../../../../common'; import { actionsClientMock } from '@kbn/actions-plugin/server/mocks'; const rulesClient = rulesClientMock.create(); diff --git a/x-pack/platform/plugins/shared/alerting/server/routes/rule/apis/resolve/resolve_rule_route.ts b/x-pack/platform/plugins/shared/alerting/server/routes/rule/apis/resolve/resolve_rule_route.ts index bf5eef6add064..187b2d10c0fbb 100644 --- a/x-pack/platform/plugins/shared/alerting/server/routes/rule/apis/resolve/resolve_rule_route.ts +++ b/x-pack/platform/plugins/shared/alerting/server/routes/rule/apis/resolve/resolve_rule_route.ts @@ -5,17 +5,16 @@ * 2.0. */ -import { TypeOf } from '@kbn/config-schema'; -import { IRouter } from '@kbn/core/server'; -import { RuleParamsV1 } from '../../../../../common/routes/rule/response'; -import { ResolvedRule } from '../../../../application/rule/methods/resolve/types'; -import { - resolveParamsSchemaV1, - ResolveRuleResponseV1, -} from '../../../../../common/routes/rule/apis/resolve'; -import { ILicenseState } from '../../../../lib'; +import type { TypeOf } from '@kbn/config-schema'; +import type { IRouter } from '@kbn/core/server'; +import type { RuleParamsV1 } from '../../../../../common/routes/rule/response'; +import type { ResolvedRule } from '../../../../application/rule/methods/resolve/types'; +import type { ResolveRuleResponseV1 } from '../../../../../common/routes/rule/apis/resolve'; +import { resolveParamsSchemaV1 } from '../../../../../common/routes/rule/apis/resolve'; +import type { ILicenseState } from '../../../../lib'; import { verifyAccessAndContext } from '../../../lib'; -import { AlertingRequestHandlerContext, INTERNAL_BASE_ALERTING_API_PATH } from '../../../../types'; +import type { AlertingRequestHandlerContext } from '../../../../types'; +import { INTERNAL_BASE_ALERTING_API_PATH } from '../../../../types'; import { transformResolveResponseV1 } from './transforms'; import { DEFAULT_ALERTING_ROUTE_SECURITY } from '../../../constants'; diff --git a/x-pack/platform/plugins/shared/alerting/server/routes/rule/apis/resolve/transforms/transform_resolve_response/v1.ts b/x-pack/platform/plugins/shared/alerting/server/routes/rule/apis/resolve/transforms/transform_resolve_response/v1.ts index 060f6892403f4..bd40c8535d1b9 100644 --- a/x-pack/platform/plugins/shared/alerting/server/routes/rule/apis/resolve/transforms/transform_resolve_response/v1.ts +++ b/x-pack/platform/plugins/shared/alerting/server/routes/rule/apis/resolve/transforms/transform_resolve_response/v1.ts @@ -5,8 +5,8 @@ * 2.0. */ -import { ResolvedRule } from '../../../../../../application/rule/methods/resolve/types'; -import { RuleParams } from '../../../../../../application/rule/types'; +import type { ResolvedRule } from '../../../../../../application/rule/methods/resolve/types'; +import type { RuleParams } from '../../../../../../application/rule/types'; import { transformRuleToRuleResponseV1 } from '../../../../transforms'; export const transformResolveResponse = ( diff --git a/x-pack/platform/plugins/shared/alerting/server/routes/rule/apis/snooze/snooze_rule_route.ts b/x-pack/platform/plugins/shared/alerting/server/routes/rule/apis/snooze/snooze_rule_route.ts index d7c93e76b7e3e..d659c5f7e1434 100644 --- a/x-pack/platform/plugins/shared/alerting/server/routes/rule/apis/snooze/snooze_rule_route.ts +++ b/x-pack/platform/plugins/shared/alerting/server/routes/rule/apis/snooze/snooze_rule_route.ts @@ -5,15 +5,17 @@ * 2.0. */ -import { TypeOf } from '@kbn/config-schema'; -import { IRouter } from '@kbn/core/server'; +import type { TypeOf } from '@kbn/config-schema'; +import type { IRouter } from '@kbn/core/server'; import { snoozeBodySchema, snoozeParamsSchema, } from '../../../../../common/routes/rule/apis/snooze'; -import { ILicenseState, RuleMutedError } from '../../../../lib'; +import type { ILicenseState } from '../../../../lib'; +import { RuleMutedError } from '../../../../lib'; import { verifyAccessAndContext } from '../../../lib'; -import { AlertingRequestHandlerContext, INTERNAL_ALERTING_SNOOZE_RULE } from '../../../../types'; +import type { AlertingRequestHandlerContext } from '../../../../types'; +import { INTERNAL_ALERTING_SNOOZE_RULE } from '../../../../types'; import { transformSnoozeBodyV1 } from './transforms'; import { DEFAULT_ALERTING_ROUTE_SECURITY } from '../../../constants'; diff --git a/x-pack/platform/plugins/shared/alerting/server/routes/rule/apis/snooze/transforms/transform_snooze_body/v1.ts b/x-pack/platform/plugins/shared/alerting/server/routes/rule/apis/snooze/transforms/transform_snooze_body/v1.ts index ff7c890ef9cbd..3937045725c1e 100644 --- a/x-pack/platform/plugins/shared/alerting/server/routes/rule/apis/snooze/transforms/transform_snooze_body/v1.ts +++ b/x-pack/platform/plugins/shared/alerting/server/routes/rule/apis/snooze/transforms/transform_snooze_body/v1.ts @@ -5,8 +5,8 @@ * 2.0. */ -import { TypeOf } from '@kbn/config-schema'; -import { snoozeBodySchemaV1 } from '../../../../../../../common/routes/rule/apis/snooze'; +import type { TypeOf } from '@kbn/config-schema'; +import type { snoozeBodySchemaV1 } from '../../../../../../../common/routes/rule/apis/snooze'; type SnoozeBodySchema = TypeOf; diff --git a/x-pack/platform/plugins/shared/alerting/server/routes/rule/apis/tags/get_rule_tags.ts b/x-pack/platform/plugins/shared/alerting/server/routes/rule/apis/tags/get_rule_tags.ts index 5cebefb96b9fd..7621ce3e712df 100644 --- a/x-pack/platform/plugins/shared/alerting/server/routes/rule/apis/tags/get_rule_tags.ts +++ b/x-pack/platform/plugins/shared/alerting/server/routes/rule/apis/tags/get_rule_tags.ts @@ -4,15 +4,14 @@ * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ -import { IRouter } from '@kbn/core/server'; +import type { IRouter } from '@kbn/core/server'; import { transformRuleTagsBodyResponseV1 } from './transforms'; import { transformRuleTagsQueryRequestV1 } from './transforms'; -import { - ruleTagsRequestQuerySchemaV1, - RuleTagsRequestQueryV1, -} from '../../../../../common/routes/rule/apis/tags'; -import { AlertingRequestHandlerContext, INTERNAL_BASE_ALERTING_API_PATH } from '../../../../types'; -import { ILicenseState } from '../../../../lib'; +import type { RuleTagsRequestQueryV1 } from '../../../../../common/routes/rule/apis/tags'; +import { ruleTagsRequestQuerySchemaV1 } from '../../../../../common/routes/rule/apis/tags'; +import type { AlertingRequestHandlerContext } from '../../../../types'; +import { INTERNAL_BASE_ALERTING_API_PATH } from '../../../../types'; +import type { ILicenseState } from '../../../../lib'; import { verifyAccessAndContext } from '../../../lib'; import { DEFAULT_ALERTING_ROUTE_SECURITY } from '../../../constants'; diff --git a/x-pack/platform/plugins/shared/alerting/server/routes/rule/apis/tags/transforms/transform_rule_tags_body_response/v1.ts b/x-pack/platform/plugins/shared/alerting/server/routes/rule/apis/tags/transforms/transform_rule_tags_body_response/v1.ts index dc6a1c3e1bade..38cdd9c8e1d73 100644 --- a/x-pack/platform/plugins/shared/alerting/server/routes/rule/apis/tags/transforms/transform_rule_tags_body_response/v1.ts +++ b/x-pack/platform/plugins/shared/alerting/server/routes/rule/apis/tags/transforms/transform_rule_tags_body_response/v1.ts @@ -4,7 +4,7 @@ * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ -import { RewriteResponseCase } from '@kbn/actions-plugin/common'; +import type { RewriteResponseCase } from '@kbn/actions-plugin/common'; import type { RuleTagsFormattedResponse } from '../../../../../../../common/routes/rule/apis/tags'; export const transformRuleTagsBodyResponse: RewriteResponseCase = ({ diff --git a/x-pack/platform/plugins/shared/alerting/server/routes/rule/apis/tags/transforms/transform_rule_tags_query_request/v1.ts b/x-pack/platform/plugins/shared/alerting/server/routes/rule/apis/tags/transforms/transform_rule_tags_query_request/v1.ts index af6291276b8cd..5f08877d7267e 100644 --- a/x-pack/platform/plugins/shared/alerting/server/routes/rule/apis/tags/transforms/transform_rule_tags_query_request/v1.ts +++ b/x-pack/platform/plugins/shared/alerting/server/routes/rule/apis/tags/transforms/transform_rule_tags_query_request/v1.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { RewriteRequestCase } from '@kbn/actions-plugin/common'; +import type { RewriteRequestCase } from '@kbn/actions-plugin/common'; import type { RuleTagsParams } from '../../../../../../application/rule/methods/tags'; export const transformRuleTagsQueryRequest: RewriteRequestCase = ({ diff --git a/x-pack/platform/plugins/shared/alerting/server/routes/rule/apis/unmute_alert/transforms/transform_request_params_to_application/v1.ts b/x-pack/platform/plugins/shared/alerting/server/routes/rule/apis/unmute_alert/transforms/transform_request_params_to_application/v1.ts index 227b57ba67717..bbddf2fd8d52c 100644 --- a/x-pack/platform/plugins/shared/alerting/server/routes/rule/apis/unmute_alert/transforms/transform_request_params_to_application/v1.ts +++ b/x-pack/platform/plugins/shared/alerting/server/routes/rule/apis/unmute_alert/transforms/transform_request_params_to_application/v1.ts @@ -5,9 +5,9 @@ * 2.0. */ -import { UnmuteAlertParams } from '../../../../../../application/rule/methods/unmute_alert/types'; -import { RewriteRequestCase } from '../../../../../lib'; -import { UnmuteAlertRequestParamsV1 } from '../../../../../../../common/routes/rule/apis/unmute_alert'; +import type { UnmuteAlertParams } from '../../../../../../application/rule/methods/unmute_alert/types'; +import type { RewriteRequestCase } from '../../../../../lib'; +import type { UnmuteAlertRequestParamsV1 } from '../../../../../../../common/routes/rule/apis/unmute_alert'; export const transformRequestParamsToApplication: RewriteRequestCase = ({ rule_id: alertId, diff --git a/x-pack/platform/plugins/shared/alerting/server/routes/rule/apis/unmute_alert/unmute_alert_route.ts b/x-pack/platform/plugins/shared/alerting/server/routes/rule/apis/unmute_alert/unmute_alert_route.ts index 0dbd6089e54e4..baeea1a0f338f 100644 --- a/x-pack/platform/plugins/shared/alerting/server/routes/rule/apis/unmute_alert/unmute_alert_route.ts +++ b/x-pack/platform/plugins/shared/alerting/server/routes/rule/apis/unmute_alert/unmute_alert_route.ts @@ -5,13 +5,13 @@ * 2.0. */ -import { IRouter } from '@kbn/core/server'; -import { - UnmuteAlertRequestParamsV1, - unmuteAlertParamsSchemaV1, -} from '../../../../../common/routes/rule/apis/unmute_alert'; -import { ILicenseState, RuleTypeDisabledError } from '../../../../lib'; -import { AlertingRequestHandlerContext, BASE_ALERTING_API_PATH } from '../../../../types'; +import type { IRouter } from '@kbn/core/server'; +import type { UnmuteAlertRequestParamsV1 } from '../../../../../common/routes/rule/apis/unmute_alert'; +import { unmuteAlertParamsSchemaV1 } from '../../../../../common/routes/rule/apis/unmute_alert'; +import type { ILicenseState } from '../../../../lib'; +import { RuleTypeDisabledError } from '../../../../lib'; +import type { AlertingRequestHandlerContext } from '../../../../types'; +import { BASE_ALERTING_API_PATH } from '../../../../types'; import { verifyAccessAndContext } from '../../../lib'; import { transformRequestParamsToApplicationV1 } from './transforms'; import { DEFAULT_ALERTING_ROUTE_SECURITY } from '../../../constants'; diff --git a/x-pack/platform/plugins/shared/alerting/server/routes/rule/apis/unmute_all/unmute_all_rule.ts b/x-pack/platform/plugins/shared/alerting/server/routes/rule/apis/unmute_all/unmute_all_rule.ts index 28bb319009946..54903d954d0ce 100644 --- a/x-pack/platform/plugins/shared/alerting/server/routes/rule/apis/unmute_all/unmute_all_rule.ts +++ b/x-pack/platform/plugins/shared/alerting/server/routes/rule/apis/unmute_all/unmute_all_rule.ts @@ -5,14 +5,14 @@ * 2.0. */ -import { IRouter } from '@kbn/core/server'; -import { ILicenseState, RuleTypeDisabledError } from '../../../../lib'; +import type { IRouter } from '@kbn/core/server'; +import type { ILicenseState } from '../../../../lib'; +import { RuleTypeDisabledError } from '../../../../lib'; import { verifyAccessAndContext } from '../../../lib'; -import { AlertingRequestHandlerContext, BASE_ALERTING_API_PATH } from '../../../../types'; -import { - unmuteAllRuleRequestParamsSchemaV1, - UnmuteAllRuleRequestParamsV1, -} from '../../../../../common/routes/rule/apis/unmute_all'; +import type { AlertingRequestHandlerContext } from '../../../../types'; +import { BASE_ALERTING_API_PATH } from '../../../../types'; +import type { UnmuteAllRuleRequestParamsV1 } from '../../../../../common/routes/rule/apis/unmute_all'; +import { unmuteAllRuleRequestParamsSchemaV1 } from '../../../../../common/routes/rule/apis/unmute_all'; import { DEFAULT_ALERTING_ROUTE_SECURITY } from '../../../constants'; export const unmuteAllRuleRoute = ( diff --git a/x-pack/platform/plugins/shared/alerting/server/routes/rule/apis/unsnooze/unsnooze_rule_route.ts b/x-pack/platform/plugins/shared/alerting/server/routes/rule/apis/unsnooze/unsnooze_rule_route.ts index e0ac5df1d8dc8..1f457feb4c0d9 100644 --- a/x-pack/platform/plugins/shared/alerting/server/routes/rule/apis/unsnooze/unsnooze_rule_route.ts +++ b/x-pack/platform/plugins/shared/alerting/server/routes/rule/apis/unsnooze/unsnooze_rule_route.ts @@ -5,15 +5,17 @@ * 2.0. */ -import { TypeOf } from '@kbn/config-schema'; -import { IRouter } from '@kbn/core/server'; +import type { TypeOf } from '@kbn/config-schema'; +import type { IRouter } from '@kbn/core/server'; import { unsnoozeBodySchema, unsnoozeParamsSchema, } from '../../../../../common/routes/rule/apis/unsnooze'; -import { ILicenseState, RuleMutedError } from '../../../../lib'; +import type { ILicenseState } from '../../../../lib'; +import { RuleMutedError } from '../../../../lib'; import { verifyAccessAndContext } from '../../../lib'; -import { AlertingRequestHandlerContext, INTERNAL_BASE_ALERTING_API_PATH } from '../../../../types'; +import type { AlertingRequestHandlerContext } from '../../../../types'; +import { INTERNAL_BASE_ALERTING_API_PATH } from '../../../../types'; import { transformUnsnoozeBodyV1 } from './transforms'; import { DEFAULT_ALERTING_ROUTE_SECURITY } from '../../../constants'; diff --git a/x-pack/platform/plugins/shared/alerting/server/routes/rule/apis/update/update_rule_route.test.ts b/x-pack/platform/plugins/shared/alerting/server/routes/rule/apis/update/update_rule_route.test.ts index e26e9705fa7f4..a2644438f86b6 100644 --- a/x-pack/platform/plugins/shared/alerting/server/routes/rule/apis/update/update_rule_route.test.ts +++ b/x-pack/platform/plugins/shared/alerting/server/routes/rule/apis/update/update_rule_route.test.ts @@ -13,7 +13,8 @@ import { verifyApiAccess } from '../../../../lib/license_api_access'; import { mockHandlerArguments } from '../../../_mock_handler_arguments'; import { rulesClientMock } from '../../../../rules_client.mock'; import { RuleTypeDisabledError } from '../../../../lib/errors/rule_type_disabled'; -import { RuleNotifyWhen, SanitizedRule } from '../../../../../common'; +import type { SanitizedRule } from '../../../../../common'; +import { RuleNotifyWhen } from '../../../../../common'; const rulesClient = rulesClientMock.create(); jest.mock('../../../../lib/license_api_access', () => ({ diff --git a/x-pack/platform/plugins/shared/alerting/server/routes/rule/apis/update/update_rule_route.ts b/x-pack/platform/plugins/shared/alerting/server/routes/rule/apis/update/update_rule_route.ts index b8181ac9aff3d..663f7aac47988 100644 --- a/x-pack/platform/plugins/shared/alerting/server/routes/rule/apis/update/update_rule_route.ts +++ b/x-pack/platform/plugins/shared/alerting/server/routes/rule/apis/update/update_rule_route.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { IRouter } from '@kbn/core/server'; +import type { IRouter } from '@kbn/core/server'; import type { UpdateRuleRequestBodyV1, UpdateRuleRequestParamsV1, @@ -15,10 +15,13 @@ import { updateBodySchemaV1, updateParamsSchemaV1, } from '../../../../../common/routes/rule/apis/update'; -import { RuleParamsV1, ruleResponseSchemaV1 } from '../../../../../common/routes/rule/response'; -import { Rule } from '../../../../application/rule/types'; -import { ILicenseState, RuleTypeDisabledError } from '../../../../lib'; -import { AlertingRequestHandlerContext, BASE_ALERTING_API_PATH } from '../../../../types'; +import type { RuleParamsV1 } from '../../../../../common/routes/rule/response'; +import { ruleResponseSchemaV1 } from '../../../../../common/routes/rule/response'; +import type { Rule } from '../../../../application/rule/types'; +import type { ILicenseState } from '../../../../lib'; +import { RuleTypeDisabledError } from '../../../../lib'; +import type { AlertingRequestHandlerContext } from '../../../../types'; +import { BASE_ALERTING_API_PATH } from '../../../../types'; import { handleDisabledApiKeysError, verifyAccessAndContext } from '../../../lib'; import { transformRuleToRuleResponseV1 } from '../../transforms'; import { validateRequiredGroupInDefaultActionsV1 } from '../../validation'; diff --git a/x-pack/platform/plugins/shared/alerting/server/routes/rule/apis/update_api_key/update_rule_api_key_route.ts b/x-pack/platform/plugins/shared/alerting/server/routes/rule/apis/update_api_key/update_rule_api_key_route.ts index f306242ebb9ec..335179aaa33ef 100644 --- a/x-pack/platform/plugins/shared/alerting/server/routes/rule/apis/update_api_key/update_rule_api_key_route.ts +++ b/x-pack/platform/plugins/shared/alerting/server/routes/rule/apis/update_api_key/update_rule_api_key_route.ts @@ -5,13 +5,13 @@ * 2.0. */ -import { IRouter } from '@kbn/core/server'; -import { - UpdateApiKeyParamsV1, - updateApiKeyParamsSchemaV1, -} from '../../../../../common/routes/rule/apis/update_api_key'; -import { ILicenseState, RuleTypeDisabledError } from '../../../../lib'; -import { AlertingRequestHandlerContext, BASE_ALERTING_API_PATH } from '../../../../types'; +import type { IRouter } from '@kbn/core/server'; +import type { UpdateApiKeyParamsV1 } from '../../../../../common/routes/rule/apis/update_api_key'; +import { updateApiKeyParamsSchemaV1 } from '../../../../../common/routes/rule/apis/update_api_key'; +import type { ILicenseState } from '../../../../lib'; +import { RuleTypeDisabledError } from '../../../../lib'; +import type { AlertingRequestHandlerContext } from '../../../../types'; +import { BASE_ALERTING_API_PATH } from '../../../../types'; import { verifyAccessAndContext } from '../../../lib'; import { DEFAULT_ALERTING_ROUTE_SECURITY } from '../../../constants'; diff --git a/x-pack/platform/plugins/shared/alerting/server/routes/rule/transforms/transform_rule_to_rule_response/v1.test.ts b/x-pack/platform/plugins/shared/alerting/server/routes/rule/transforms/transform_rule_to_rule_response/v1.test.ts index 2a5b2e77f313e..8a1e011331924 100644 --- a/x-pack/platform/plugins/shared/alerting/server/routes/rule/transforms/transform_rule_to_rule_response/v1.test.ts +++ b/x-pack/platform/plugins/shared/alerting/server/routes/rule/transforms/transform_rule_to_rule_response/v1.test.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { RuleAction, RuleSystemAction } from '../../../../../common'; +import type { RuleAction, RuleSystemAction } from '../../../../../common'; import { transformRuleToRuleResponse } from './v1'; describe('transformRuleToRuleResponse', () => { diff --git a/x-pack/platform/plugins/shared/alerting/server/routes/rule/transforms/transform_rule_to_rule_response/v1.ts b/x-pack/platform/plugins/shared/alerting/server/routes/rule/transforms/transform_rule_to_rule_response/v1.ts index c1ef6af4f36b0..de3e99fe092fc 100644 --- a/x-pack/platform/plugins/shared/alerting/server/routes/rule/transforms/transform_rule_to_rule_response/v1.ts +++ b/x-pack/platform/plugins/shared/alerting/server/routes/rule/transforms/transform_rule_to_rule_response/v1.ts @@ -5,13 +5,13 @@ * 2.0. */ -import { +import type { RuleResponseV1, RuleParamsV1, RuleLastRunV1, MonitoringV1, } from '../../../../../common/routes/rule/response'; -import { Rule, RuleLastRun, RuleParams, Monitoring } from '../../../../application/rule/types'; +import type { Rule, RuleLastRun, RuleParams, Monitoring } from '../../../../application/rule/types'; export const transformRuleLastRun = (lastRun: RuleLastRun): RuleLastRunV1 => { return { diff --git a/x-pack/platform/plugins/shared/alerting/server/routes/rules_settings/apis/get/get_query_delay_settings.test.ts b/x-pack/platform/plugins/shared/alerting/server/routes/rules_settings/apis/get/get_query_delay_settings.test.ts index dd7eaef96b811..538af54706661 100644 --- a/x-pack/platform/plugins/shared/alerting/server/routes/rules_settings/apis/get/get_query_delay_settings.test.ts +++ b/x-pack/platform/plugins/shared/alerting/server/routes/rules_settings/apis/get/get_query_delay_settings.test.ts @@ -8,10 +8,8 @@ import { httpServiceMock } from '@kbn/core/server/mocks'; import { licenseStateMock } from '../../../../lib/license_state.mock'; import { mockHandlerArguments } from '../../../_mock_handler_arguments'; -import { - rulesSettingsClientMock, - RulesSettingsClientMock, -} from '../../../../rules_settings/rules_settings_client.mock'; +import type { RulesSettingsClientMock } from '../../../../rules_settings/rules_settings_client.mock'; +import { rulesSettingsClientMock } from '../../../../rules_settings/rules_settings_client.mock'; import { getQueryDelaySettingsRoute } from './get_query_delay_settings'; let rulesSettingsClient: RulesSettingsClientMock; diff --git a/x-pack/platform/plugins/shared/alerting/server/routes/rules_settings/apis/get/get_query_delay_settings.ts b/x-pack/platform/plugins/shared/alerting/server/routes/rules_settings/apis/get/get_query_delay_settings.ts index 6d88efcbaa812..5609dbe4d8c8c 100644 --- a/x-pack/platform/plugins/shared/alerting/server/routes/rules_settings/apis/get/get_query_delay_settings.ts +++ b/x-pack/platform/plugins/shared/alerting/server/routes/rules_settings/apis/get/get_query_delay_settings.ts @@ -5,13 +5,14 @@ * 2.0. */ -import { IRouter } from '@kbn/core/server'; -import { ILicenseState } from '../../../../lib'; -import { AlertingRequestHandlerContext, INTERNAL_BASE_ALERTING_API_PATH } from '../../../../types'; +import type { IRouter } from '@kbn/core/server'; +import type { ILicenseState } from '../../../../lib'; +import type { AlertingRequestHandlerContext } from '../../../../types'; +import { INTERNAL_BASE_ALERTING_API_PATH } from '../../../../types'; import { verifyAccessAndContext } from '../../../lib'; import { API_PRIVILEGES } from '../../../../../common'; import { transformQueryDelaySettingsToResponseV1 } from '../../transforms'; -import { GetQueryDelaySettingsResponseV1 } from '../../../../../common/routes/rules_settings/apis/get'; +import type { GetQueryDelaySettingsResponseV1 } from '../../../../../common/routes/rules_settings/apis/get'; export const getQueryDelaySettingsRoute = ( router: IRouter, diff --git a/x-pack/platform/plugins/shared/alerting/server/routes/rules_settings/apis/update/update_query_delay_settings.test.ts b/x-pack/platform/plugins/shared/alerting/server/routes/rules_settings/apis/update/update_query_delay_settings.test.ts index 7ac53dee40193..29cf9bb85653c 100644 --- a/x-pack/platform/plugins/shared/alerting/server/routes/rules_settings/apis/update/update_query_delay_settings.test.ts +++ b/x-pack/platform/plugins/shared/alerting/server/routes/rules_settings/apis/update/update_query_delay_settings.test.ts @@ -8,10 +8,8 @@ import { httpServiceMock } from '@kbn/core/server/mocks'; import { licenseStateMock } from '../../../../lib/license_state.mock'; import { mockHandlerArguments } from '../../../_mock_handler_arguments'; -import { - rulesSettingsClientMock, - RulesSettingsClientMock, -} from '../../../../rules_settings/rules_settings_client.mock'; +import type { RulesSettingsClientMock } from '../../../../rules_settings/rules_settings_client.mock'; +import { rulesSettingsClientMock } from '../../../../rules_settings/rules_settings_client.mock'; import { updateQueryDelaySettingsRoute } from './update_query_delay_settings'; let rulesSettingsClient: RulesSettingsClientMock; diff --git a/x-pack/platform/plugins/shared/alerting/server/routes/rules_settings/apis/update/update_query_delay_settings.ts b/x-pack/platform/plugins/shared/alerting/server/routes/rules_settings/apis/update/update_query_delay_settings.ts index e1704ed2f4b45..6d8d7e2b12a65 100644 --- a/x-pack/platform/plugins/shared/alerting/server/routes/rules_settings/apis/update/update_query_delay_settings.ts +++ b/x-pack/platform/plugins/shared/alerting/server/routes/rules_settings/apis/update/update_query_delay_settings.ts @@ -5,16 +5,17 @@ * 2.0. */ -import { IRouter } from '@kbn/core/server'; -import { ILicenseState } from '../../../../lib'; +import type { IRouter } from '@kbn/core/server'; +import type { ILicenseState } from '../../../../lib'; import { verifyAccessAndContext } from '../../../lib'; -import { AlertingRequestHandlerContext, INTERNAL_BASE_ALERTING_API_PATH } from '../../../../types'; +import type { AlertingRequestHandlerContext } from '../../../../types'; +import { INTERNAL_BASE_ALERTING_API_PATH } from '../../../../types'; import { API_PRIVILEGES } from '../../../../../common'; -import { - updateQueryDelaySettingsBodySchemaV1, +import type { UpdateQueryDelaySettingsRequestBodyV1, UpdateQueryDelaySettingsResponseV1, } from '../../../../../common/routes/rules_settings/apis/update'; +import { updateQueryDelaySettingsBodySchemaV1 } from '../../../../../common/routes/rules_settings/apis/update'; import { transformQueryDelaySettingsToResponseV1 } from '../../transforms'; export const updateQueryDelaySettingsRoute = ( diff --git a/x-pack/platform/plugins/shared/alerting/server/routes/rules_settings/transforms/transform_query_delay_settings_to_response/v1.ts b/x-pack/platform/plugins/shared/alerting/server/routes/rules_settings/transforms/transform_query_delay_settings_to_response/v1.ts index 926b702bdbf9c..7528bc29d2387 100644 --- a/x-pack/platform/plugins/shared/alerting/server/routes/rules_settings/transforms/transform_query_delay_settings_to_response/v1.ts +++ b/x-pack/platform/plugins/shared/alerting/server/routes/rules_settings/transforms/transform_query_delay_settings_to_response/v1.ts @@ -5,8 +5,8 @@ * 2.0. */ -import { RulesSettingsQueryDelay } from '../../../../../common'; -import { QueryDelaySettingsResponseV1 } from '../../../../../common/routes/rules_settings/response'; +import type { RulesSettingsQueryDelay } from '../../../../../common'; +import type { QueryDelaySettingsResponseV1 } from '../../../../../common/routes/rules_settings/response'; export const transformQueryDelaySettingsToResponse = ( settings: RulesSettingsQueryDelay diff --git a/x-pack/platform/plugins/shared/alerting/server/routes/run_soon.ts b/x-pack/platform/plugins/shared/alerting/server/routes/run_soon.ts index 9d0024f090cb6..1d6e49b24b7c8 100644 --- a/x-pack/platform/plugins/shared/alerting/server/routes/run_soon.ts +++ b/x-pack/platform/plugins/shared/alerting/server/routes/run_soon.ts @@ -5,11 +5,12 @@ * 2.0. */ -import { IRouter } from '@kbn/core/server'; +import type { IRouter } from '@kbn/core/server'; import { schema } from '@kbn/config-schema'; -import { ILicenseState } from '../lib'; +import type { ILicenseState } from '../lib'; import { verifyAccessAndContext } from './lib'; -import { AlertingRequestHandlerContext, INTERNAL_BASE_ALERTING_API_PATH } from '../types'; +import type { AlertingRequestHandlerContext } from '../types'; +import { INTERNAL_BASE_ALERTING_API_PATH } from '../types'; import { DEFAULT_ALERTING_ROUTE_SECURITY } from './constants'; const paramSchema = schema.object({ diff --git a/x-pack/platform/plugins/shared/alerting/server/routes/suggestions/fields_rules.ts b/x-pack/platform/plugins/shared/alerting/server/routes/suggestions/fields_rules.ts index 4b8ffa8e67e66..9b44982946e60 100644 --- a/x-pack/platform/plugins/shared/alerting/server/routes/suggestions/fields_rules.ts +++ b/x-pack/platform/plugins/shared/alerting/server/routes/suggestions/fields_rules.ts @@ -13,14 +13,14 @@ */ import { i18n } from '@kbn/i18n'; import { schema } from '@kbn/config-schema'; -import { IRouter } from '@kbn/core/server'; -import { UsageCounter } from '@kbn/usage-collection-plugin/server'; +import type { IRouter } from '@kbn/core/server'; +import type { UsageCounter } from '@kbn/usage-collection-plugin/server'; import { ALERTING_CASES_SAVED_OBJECT_INDEX } from '@kbn/core-saved-objects-server/src/saved_objects_index_pattern'; import { IndexPatternsFetcher } from '@kbn/data-plugin/server'; import { verifyAccessAndContext } from '../lib'; -import { ILicenseState } from '../../lib'; -import { AlertingRequestHandlerContext } from '../../types'; +import type { ILicenseState } from '../../lib'; +import type { AlertingRequestHandlerContext } from '../../types'; import { DEFAULT_ALERTING_ROUTE_SECURITY } from '../constants'; export function registerFieldsRoute( diff --git a/x-pack/platform/plugins/shared/alerting/server/routes/suggestions/values_suggestion_alerts.test.ts b/x-pack/platform/plugins/shared/alerting/server/routes/suggestions/values_suggestion_alerts.test.ts index 205e90c5e8425..70fdf49bbc5c9 100644 --- a/x-pack/platform/plugins/shared/alerting/server/routes/suggestions/values_suggestion_alerts.test.ts +++ b/x-pack/platform/plugins/shared/alerting/server/routes/suggestions/values_suggestion_alerts.test.ts @@ -9,7 +9,7 @@ import { httpServerMock, httpServiceMock } from '@kbn/core-http-server-mocks'; import type { ConfigSchema } from '@kbn/unified-search-plugin/server/config'; import { dataPluginMock } from '@kbn/unified-search-plugin/server/mocks'; import { termsAggSuggestions } from '@kbn/unified-search-plugin/server/autocomplete/terms_agg'; -import { Observable } from 'rxjs'; +import type { Observable } from 'rxjs'; import { licenseStateMock } from '../../lib/license_state.mock'; import { rulesClientMock } from '../../rules_client.mock'; import { mockHandlerArguments } from '../_mock_handler_arguments'; diff --git a/x-pack/platform/plugins/shared/alerting/server/routes/suggestions/values_suggestion_alerts.ts b/x-pack/platform/plugins/shared/alerting/server/routes/suggestions/values_suggestion_alerts.ts index d6ef380bfe186..1a038c5cb2466 100644 --- a/x-pack/platform/plugins/shared/alerting/server/routes/suggestions/values_suggestion_alerts.ts +++ b/x-pack/platform/plugins/shared/alerting/server/routes/suggestions/values_suggestion_alerts.ts @@ -6,8 +6,9 @@ */ import { schema } from '@kbn/config-schema'; -import { IRouter } from '@kbn/core/server'; -import { firstValueFrom, Observable } from 'rxjs'; +import type { IRouter } from '@kbn/core/server'; +import type { Observable } from 'rxjs'; +import { firstValueFrom } from 'rxjs'; import { getRequestAbortedSignal } from '@kbn/data-plugin/server'; import { termsAggSuggestions } from '@kbn/unified-search-plugin/server/autocomplete/terms_agg'; import type { ConfigSchema } from '@kbn/unified-search-plugin/server/config'; @@ -17,14 +18,10 @@ import { ALERT_RULE_CONSUMER, ALERT_RULE_TYPE_ID, SPACE_IDS } from '@kbn/rule-da import { verifyAccessAndContext } from '../lib'; import { RuleAuditAction, ruleAuditEvent } from '../../rules_client/common/audit_events'; -import { - AlertingAuthorizationEntity, - AlertingAuthorizationFilterOpts, - AlertingAuthorizationFilterType, - AuthorizedRuleTypes, -} from '../../authorization'; -import { AlertingRequestHandlerContext } from '../../types'; -import { GetAlertIndicesAlias, ILicenseState } from '../../lib'; +import type { AlertingAuthorizationFilterOpts, AuthorizedRuleTypes } from '../../authorization'; +import { AlertingAuthorizationEntity, AlertingAuthorizationFilterType } from '../../authorization'; +import type { AlertingRequestHandlerContext } from '../../types'; +import type { GetAlertIndicesAlias, ILicenseState } from '../../lib'; import { DEFAULT_ALERTING_ROUTE_SECURITY } from '../constants'; const alertingAuthorizationFilterOpts: AlertingAuthorizationFilterOpts = { diff --git a/x-pack/platform/plugins/shared/alerting/server/routes/suggestions/values_suggestion_rules.test.ts b/x-pack/platform/plugins/shared/alerting/server/routes/suggestions/values_suggestion_rules.test.ts index 42211d3a0f6e5..3c4fe19fcb2a4 100644 --- a/x-pack/platform/plugins/shared/alerting/server/routes/suggestions/values_suggestion_rules.test.ts +++ b/x-pack/platform/plugins/shared/alerting/server/routes/suggestions/values_suggestion_rules.test.ts @@ -9,7 +9,7 @@ import { httpServerMock, httpServiceMock } from '@kbn/core-http-server-mocks'; import type { ConfigSchema } from '@kbn/unified-search-plugin/server/config'; import { dataPluginMock } from '@kbn/unified-search-plugin/server/mocks'; import { termsAggSuggestions } from '@kbn/unified-search-plugin/server/autocomplete/terms_agg'; -import { Observable } from 'rxjs'; +import type { Observable } from 'rxjs'; import { licenseStateMock } from '../../lib/license_state.mock'; import { rulesClientMock } from '../../rules_client.mock'; import { mockHandlerArguments } from '../_mock_handler_arguments'; diff --git a/x-pack/platform/plugins/shared/alerting/server/routes/suggestions/values_suggestion_rules.ts b/x-pack/platform/plugins/shared/alerting/server/routes/suggestions/values_suggestion_rules.ts index 8457a5d5bd86f..902646fc586ac 100644 --- a/x-pack/platform/plugins/shared/alerting/server/routes/suggestions/values_suggestion_rules.ts +++ b/x-pack/platform/plugins/shared/alerting/server/routes/suggestions/values_suggestion_rules.ts @@ -6,24 +6,22 @@ */ import { schema } from '@kbn/config-schema'; -import { IRouter } from '@kbn/core/server'; -import { firstValueFrom, Observable } from 'rxjs'; +import type { IRouter } from '@kbn/core/server'; +import type { Observable } from 'rxjs'; +import { firstValueFrom } from 'rxjs'; import { getRequestAbortedSignal } from '@kbn/data-plugin/server'; import { termsAggSuggestions } from '@kbn/unified-search-plugin/server/autocomplete/terms_agg'; import type { ConfigSchema } from '@kbn/unified-search-plugin/server/config'; -import { UsageCounter } from '@kbn/usage-collection-plugin/server'; +import type { UsageCounter } from '@kbn/usage-collection-plugin/server'; import { getKbnServerError, reportServerError } from '@kbn/kibana-utils-plugin/server'; import { ALERTING_CASES_SAVED_OBJECT_INDEX } from '@kbn/core-saved-objects-server/src/saved_objects_index_pattern'; import type { estypes } from '@elastic/elasticsearch'; import { verifyAccessAndContext } from '../lib'; -import { ILicenseState } from '../../lib'; -import { AlertingRequestHandlerContext } from '../../types'; -import { - AlertingAuthorizationEntity, - AlertingAuthorizationFilterOpts, - AlertingAuthorizationFilterType, -} from '../../authorization'; +import type { ILicenseState } from '../../lib'; +import type { AlertingRequestHandlerContext } from '../../types'; +import type { AlertingAuthorizationFilterOpts } from '../../authorization'; +import { AlertingAuthorizationEntity, AlertingAuthorizationFilterType } from '../../authorization'; import { RuleAuditAction, ruleAuditEvent } from '../../rules_client/common/audit_events'; import { DEFAULT_ALERTING_ROUTE_SECURITY } from '../constants'; diff --git a/x-pack/platform/plugins/shared/alerting/server/routes/update_flapping_settings.test.ts b/x-pack/platform/plugins/shared/alerting/server/routes/update_flapping_settings.test.ts index bca8bfdfbddab..a95e2e298cb82 100644 --- a/x-pack/platform/plugins/shared/alerting/server/routes/update_flapping_settings.test.ts +++ b/x-pack/platform/plugins/shared/alerting/server/routes/update_flapping_settings.test.ts @@ -8,10 +8,8 @@ import { httpServiceMock } from '@kbn/core/server/mocks'; import { licenseStateMock } from '../lib/license_state.mock'; import { mockHandlerArguments } from './_mock_handler_arguments'; -import { - rulesSettingsClientMock, - RulesSettingsClientMock, -} from '../rules_settings/rules_settings_client.mock'; +import type { RulesSettingsClientMock } from '../rules_settings/rules_settings_client.mock'; +import { rulesSettingsClientMock } from '../rules_settings/rules_settings_client.mock'; import { updateFlappingSettingsRoute } from './update_flapping_settings'; let rulesSettingsClient: RulesSettingsClientMock; diff --git a/x-pack/platform/plugins/shared/alerting/server/routes/update_flapping_settings.ts b/x-pack/platform/plugins/shared/alerting/server/routes/update_flapping_settings.ts index e878a7664119d..d171472f1df64 100644 --- a/x-pack/platform/plugins/shared/alerting/server/routes/update_flapping_settings.ts +++ b/x-pack/platform/plugins/shared/alerting/server/routes/update_flapping_settings.ts @@ -5,16 +5,15 @@ * 2.0. */ -import { IRouter } from '@kbn/core/server'; +import type { IRouter } from '@kbn/core/server'; import { schema } from '@kbn/config-schema'; -import { ILicenseState } from '../lib'; -import { verifyAccessAndContext, RewriteResponseCase, RewriteRequestCase } from './lib'; -import { AlertingRequestHandlerContext, INTERNAL_BASE_ALERTING_API_PATH } from '../types'; -import { - API_PRIVILEGES, - RulesSettingsFlapping, - RulesSettingsFlappingProperties, -} from '../../common'; +import type { ILicenseState } from '../lib'; +import type { RewriteResponseCase, RewriteRequestCase } from './lib'; +import { verifyAccessAndContext } from './lib'; +import type { AlertingRequestHandlerContext } from '../types'; +import { INTERNAL_BASE_ALERTING_API_PATH } from '../types'; +import type { RulesSettingsFlapping, RulesSettingsFlappingProperties } from '../../common'; +import { API_PRIVILEGES } from '../../common'; const bodySchema = schema.object({ enabled: schema.boolean(), diff --git a/x-pack/platform/plugins/shared/alerting/server/rule_type_registry.mock.ts b/x-pack/platform/plugins/shared/alerting/server/rule_type_registry.mock.ts index 706484fdd92f6..f48b10b2b0de0 100644 --- a/x-pack/platform/plugins/shared/alerting/server/rule_type_registry.mock.ts +++ b/x-pack/platform/plugins/shared/alerting/server/rule_type_registry.mock.ts @@ -6,7 +6,7 @@ */ import type { PublicMethodsOf } from '@kbn/utility-types'; -import { RuleTypeRegistry } from './rule_type_registry'; +import type { RuleTypeRegistry } from './rule_type_registry'; type Schema = PublicMethodsOf; diff --git a/x-pack/platform/plugins/shared/alerting/server/rule_type_registry.test.ts b/x-pack/platform/plugins/shared/alerting/server/rule_type_registry.test.ts index d9d7c1240922c..f9ad1969552b4 100644 --- a/x-pack/platform/plugins/shared/alerting/server/rule_type_registry.test.ts +++ b/x-pack/platform/plugins/shared/alerting/server/rule_type_registry.test.ts @@ -6,18 +6,19 @@ */ import { TaskRunnerFactory } from './task_runner'; -import { RuleTypeRegistry, ConstructorOptions } from './rule_type_registry'; -import { ActionGroup, RuleType } from './types'; +import type { ConstructorOptions } from './rule_type_registry'; +import { RuleTypeRegistry } from './rule_type_registry'; +import type { ActionGroup, RuleType } from './types'; import { taskManagerMock } from '@kbn/task-manager-plugin/server/mocks'; -import { ILicenseState } from './lib/license_state'; +import type { ILicenseState } from './lib/license_state'; import { licenseStateMock } from './lib/license_state.mock'; import { licensingMock } from '@kbn/licensing-plugin/server/mocks'; import { loggingSystemMock } from '@kbn/core/server/mocks'; import { inMemoryMetricsMock } from './monitoring/in_memory_metrics.mock'; import { alertsServiceMock } from './alerts_service/alerts_service.mock'; import { schema } from '@kbn/config-schema'; -import { RecoveredActionGroupId } from '../common'; -import { AlertingConfig } from './config'; +import type { RecoveredActionGroupId } from '../common'; +import type { AlertingConfig } from './config'; const logger = loggingSystemMock.create().get(); let mockedLicenseState: jest.Mocked; diff --git a/x-pack/platform/plugins/shared/alerting/server/rule_type_registry.ts b/x-pack/platform/plugins/shared/alerting/server/rule_type_registry.ts index 40d00acbef598..3afaf7ce2f8e9 100644 --- a/x-pack/platform/plugins/shared/alerting/server/rule_type_registry.ts +++ b/x-pack/platform/plugins/shared/alerting/server/rule_type_registry.ts @@ -10,13 +10,13 @@ import { i18n } from '@kbn/i18n'; import { schema } from '@kbn/config-schema'; import typeDetect from 'type-detect'; import { intersection } from 'lodash'; -import { Logger } from '@kbn/core/server'; -import { LicensingPluginSetup } from '@kbn/licensing-plugin/server'; -import { RunContext, TaskManagerSetupContract } from '@kbn/task-manager-plugin/server'; +import type { Logger } from '@kbn/core/server'; +import type { LicensingPluginSetup } from '@kbn/licensing-plugin/server'; +import type { RunContext, TaskManagerSetupContract } from '@kbn/task-manager-plugin/server'; import { stateSchemaByVersion } from '@kbn/alerting-state-types'; import { TaskCost } from '@kbn/task-manager-plugin/server/task'; -import { TaskRunnerFactory } from './task_runner'; -import { +import type { TaskRunnerFactory } from './task_runner'; +import type { RuleType, RuleTypeParams, RuleTypeState, @@ -24,22 +24,20 @@ import { AlertInstanceContext, IRuleTypeAlerts, } from './types'; +import type { RecoveredActionGroupId, ActionGroup, RuleAlertData } from '../common'; import { RecoveredActionGroup, getBuiltinActionGroups, - RecoveredActionGroupId, - ActionGroup, validateDurationSchema, parseDuration, - RuleAlertData, } from '../common'; -import { ILicenseState } from './lib/license_state'; +import type { ILicenseState } from './lib/license_state'; import { getRuleTypeFeatureUsageName } from './lib/get_rule_type_feature_usage_name'; -import { InMemoryMetrics } from './monitoring'; -import { AlertingRulesConfig } from '.'; -import { AlertsService } from './alerts_service/alerts_service'; +import type { InMemoryMetrics } from './monitoring'; +import type { AlertingRulesConfig } from '.'; +import type { AlertsService } from './alerts_service/alerts_service'; import { getRuleTypeIdValidLegacyConsumers } from './rule_type_registry_deprecated_consumers'; -import { AlertingConfig } from './config'; +import type { AlertingConfig } from './config'; const RULE_TYPES_WITH_CUSTOM_COST: Record = { 'siem.indicatorRule': TaskCost.ExtraLarge, @@ -499,7 +497,7 @@ function augmentActionGroupsWithReserved< const activeActionGroupSeverities = new Set(); actionGroups.forEach((actionGroup) => { - if (!!actionGroup.severity) { + if (actionGroup.severity) { if (activeActionGroupSeverities.has(actionGroup.severity.level)) { throw new Error( i18n.translate( diff --git a/x-pack/platform/plugins/shared/alerting/server/rules_client.mock.ts b/x-pack/platform/plugins/shared/alerting/server/rules_client.mock.ts index 5bf7ed4dee82b..6789eb65de80b 100644 --- a/x-pack/platform/plugins/shared/alerting/server/rules_client.mock.ts +++ b/x-pack/platform/plugins/shared/alerting/server/rules_client.mock.ts @@ -6,7 +6,7 @@ */ import { alertingAuthorizationMock } from './authorization/alerting_authorization.mock'; -import { RulesClientApi } from './types'; +import type { RulesClientApi } from './types'; type Schema = RulesClientApi; export type RulesClientMock = jest.Mocked; diff --git a/x-pack/platform/plugins/shared/alerting/server/rules_client/common/api_key_as_alert_attributes.ts b/x-pack/platform/plugins/shared/alerting/server/rules_client/common/api_key_as_alert_attributes.ts index c1941a8d0fa4b..a18ff3c9ba08d 100644 --- a/x-pack/platform/plugins/shared/alerting/server/rules_client/common/api_key_as_alert_attributes.ts +++ b/x-pack/platform/plugins/shared/alerting/server/rules_client/common/api_key_as_alert_attributes.ts @@ -5,9 +5,9 @@ * 2.0. */ -import { RawRule } from '../../types'; -import { CreateAPIKeyResult } from '../types'; -import { RuleDomain } from '../../application/rule/types'; +import type { RawRule } from '../../types'; +import type { CreateAPIKeyResult } from '../types'; +import type { RuleDomain } from '../../application/rule/types'; /** * @deprecated TODO (http-versioning) make sure this is deprecated diff --git a/x-pack/platform/plugins/shared/alerting/server/rules_client/common/apply_bulk_edit_operation.test.ts b/x-pack/platform/plugins/shared/alerting/server/rules_client/common/apply_bulk_edit_operation.test.ts index d88ff3ef2b024..a00b05b3aacd5 100644 --- a/x-pack/platform/plugins/shared/alerting/server/rules_client/common/apply_bulk_edit_operation.test.ts +++ b/x-pack/platform/plugins/shared/alerting/server/rules_client/common/apply_bulk_edit_operation.test.ts @@ -6,7 +6,7 @@ */ import { applyBulkEditOperation } from './apply_bulk_edit_operation'; -import { Rule } from '../../types'; +import type { Rule } from '../../types'; describe('applyBulkEditOperation', () => { describe('tags operations', () => { diff --git a/x-pack/platform/plugins/shared/alerting/server/rules_client/common/audit_events.ts b/x-pack/platform/plugins/shared/alerting/server/rules_client/common/audit_events.ts index e667e1ae1d7a8..c4446dfdb66ff 100644 --- a/x-pack/platform/plugins/shared/alerting/server/rules_client/common/audit_events.ts +++ b/x-pack/platform/plugins/shared/alerting/server/rules_client/common/audit_events.ts @@ -5,9 +5,9 @@ * 2.0. */ -import { EcsEvent } from '@kbn/core/server'; -import { AuditEvent } from '@kbn/security-plugin/server'; -import { ArrayElement } from '@kbn/utility-types'; +import type { EcsEvent } from '@kbn/core/server'; +import type { AuditEvent } from '@kbn/security-plugin/server'; +import type { ArrayElement } from '@kbn/utility-types'; import { AD_HOC_RUN_SAVED_OBJECT_TYPE } from '../../saved_objects'; export enum RuleAuditAction { diff --git a/x-pack/platform/plugins/shared/alerting/server/rules_client/common/build_kuery_node_filter.ts b/x-pack/platform/plugins/shared/alerting/server/rules_client/common/build_kuery_node_filter.ts index f8d06637b7836..973bb7d2cbd29 100644 --- a/x-pack/platform/plugins/shared/alerting/server/rules_client/common/build_kuery_node_filter.ts +++ b/x-pack/platform/plugins/shared/alerting/server/rules_client/common/build_kuery_node_filter.ts @@ -5,7 +5,8 @@ * 2.0. */ -import { fromKueryExpression, KueryNode } from '@kbn/es-query'; +import type { KueryNode } from '@kbn/es-query'; +import { fromKueryExpression } from '@kbn/es-query'; export const buildKueryNodeFilter = (filter?: string | KueryNode | null): KueryNode | null => { let optionsFilter: KueryNode | string | null = filter ?? null; diff --git a/x-pack/platform/plugins/shared/alerting/server/rules_client/common/constants.ts b/x-pack/platform/plugins/shared/alerting/server/rules_client/common/constants.ts index c89da2bbd6481..321bb2eb18029 100644 --- a/x-pack/platform/plugins/shared/alerting/server/rules_client/common/constants.ts +++ b/x-pack/platform/plugins/shared/alerting/server/rules_client/common/constants.ts @@ -5,10 +5,8 @@ * 2.0. */ -import { - AlertingAuthorizationFilterType, - AlertingAuthorizationFilterOpts, -} from '../../authorization'; +import type { AlertingAuthorizationFilterOpts } from '../../authorization'; +import { AlertingAuthorizationFilterType } from '../../authorization'; export { systemConnectorActionRefPrefix, diff --git a/x-pack/platform/plugins/shared/alerting/server/rules_client/common/filters.ts b/x-pack/platform/plugins/shared/alerting/server/rules_client/common/filters.ts index b0c3ccc5e1ec1..5a8f9fa69f78e 100644 --- a/x-pack/platform/plugins/shared/alerting/server/rules_client/common/filters.ts +++ b/x-pack/platform/plugins/shared/alerting/server/rules_client/common/filters.ts @@ -5,7 +5,8 @@ * 2.0. */ -import { KueryNode, nodeBuilder } from '@kbn/es-query'; +import type { KueryNode } from '@kbn/es-query'; +import { nodeBuilder } from '@kbn/es-query'; import { RULE_SAVED_OBJECT_TYPE } from '../..'; export const NodeBuilderOperators = { diff --git a/x-pack/platform/plugins/shared/alerting/server/rules_client/common/get_and_validate_common_bulk_options.ts b/x-pack/platform/plugins/shared/alerting/server/rules_client/common/get_and_validate_common_bulk_options.ts index e4497cce1e30b..299ea9860c25b 100644 --- a/x-pack/platform/plugins/shared/alerting/server/rules_client/common/get_and_validate_common_bulk_options.ts +++ b/x-pack/platform/plugins/shared/alerting/server/rules_client/common/get_and_validate_common_bulk_options.ts @@ -6,7 +6,7 @@ */ import Boom from '@hapi/boom'; -import { BulkOptions, BulkOptionsFilter, BulkOptionsIds } from '../types'; +import type { BulkOptions, BulkOptionsFilter, BulkOptionsIds } from '../types'; export const getAndValidateCommonBulkOptions = (options: BulkOptions) => { const filter = (options as BulkOptionsFilter).filter; diff --git a/x-pack/platform/plugins/shared/alerting/server/rules_client/common/inject_references.ts b/x-pack/platform/plugins/shared/alerting/server/rules_client/common/inject_references.ts index 867a6d7044c39..9e956c634ade9 100644 --- a/x-pack/platform/plugins/shared/alerting/server/rules_client/common/inject_references.ts +++ b/x-pack/platform/plugins/shared/alerting/server/rules_client/common/inject_references.ts @@ -7,9 +7,9 @@ import Boom from '@hapi/boom'; import { omit } from 'lodash'; -import { SavedObjectReference, SavedObjectAttributes } from '@kbn/core/server'; -import { UntypedNormalizedRuleType } from '../../rule_type_registry'; -import { RawRule, RuleTypeParams } from '../../types'; +import type { SavedObjectReference, SavedObjectAttributes } from '@kbn/core/server'; +import type { UntypedNormalizedRuleType } from '../../rule_type_registry'; +import type { RawRule, RuleTypeParams } from '../../types'; import { preconfiguredConnectorActionRefPrefix, extractedSavedObjectParamReferenceNamePrefix, diff --git a/x-pack/platform/plugins/shared/alerting/server/rules_client/common/mapped_params_utils.ts b/x-pack/platform/plugins/shared/alerting/server/rules_client/common/mapped_params_utils.ts index 3479ca374e596..0f94c06e208c2 100644 --- a/x-pack/platform/plugins/shared/alerting/server/rules_client/common/mapped_params_utils.ts +++ b/x-pack/platform/plugins/shared/alerting/server/rules_client/common/mapped_params_utils.ts @@ -6,14 +6,10 @@ */ import { snakeCase } from 'lodash'; -import { SavedObjectAttribute } from '@kbn/core/server'; -import { RuleTypeParams, MappedParams, MappedParamsProperties } from '../../types'; -import { - iterateFilterKureyNode, - IterateFilterKureyNodeParams, - IterateActionProps, - getFieldNameAttribute, -} from './validate_attributes'; +import type { SavedObjectAttribute } from '@kbn/core/server'; +import type { RuleTypeParams, MappedParams, MappedParamsProperties } from '../../types'; +import type { IterateFilterKureyNodeParams, IterateActionProps } from './validate_attributes'; +import { iterateFilterKureyNode, getFieldNameAttribute } from './validate_attributes'; export const MAPPED_PARAMS_PROPERTIES: Array = [ 'risk_score', diff --git a/x-pack/platform/plugins/shared/alerting/server/rules_client/common/retry_if_bulk_edit_conflicts.test.ts b/x-pack/platform/plugins/shared/alerting/server/rules_client/common/retry_if_bulk_edit_conflicts.test.ts index d099ba8693c3f..6d65443622945 100644 --- a/x-pack/platform/plugins/shared/alerting/server/rules_client/common/retry_if_bulk_edit_conflicts.test.ts +++ b/x-pack/platform/plugins/shared/alerting/server/rules_client/common/retry_if_bulk_edit_conflicts.test.ts @@ -4,12 +4,12 @@ * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ -import { KueryNode } from '@kbn/es-query'; +import type { KueryNode } from '@kbn/es-query'; import { retryIfBulkEditConflicts } from './retry_if_bulk_edit_conflicts'; import { RETRY_IF_CONFLICTS_ATTEMPTS } from './wait_before_next_retry'; import { loggingSystemMock } from '@kbn/core/server/mocks'; -import { BulkEditSkipReason } from '../../../common/bulk_edit'; +import type { BulkEditSkipReason } from '../../../common/bulk_edit'; import { RULE_SAVED_OBJECT_TYPE } from '../../saved_objects'; const mockFilter: KueryNode = { diff --git a/x-pack/platform/plugins/shared/alerting/server/rules_client/common/retry_if_bulk_edit_conflicts.ts b/x-pack/platform/plugins/shared/alerting/server/rules_client/common/retry_if_bulk_edit_conflicts.ts index 20f32e483890d..6f2888e9206b5 100644 --- a/x-pack/platform/plugins/shared/alerting/server/rules_client/common/retry_if_bulk_edit_conflicts.ts +++ b/x-pack/platform/plugins/shared/alerting/server/rules_client/common/retry_if_bulk_edit_conflicts.ts @@ -7,14 +7,18 @@ import pMap from 'p-map'; import { chunk } from 'lodash'; -import { KueryNode } from '@kbn/es-query'; -import { Logger, SavedObjectsBulkUpdateObject, SavedObjectsUpdateResponse } from '@kbn/core/server'; -import { BulkActionSkipResult } from '../../../common/bulk_edit'; +import type { KueryNode } from '@kbn/es-query'; +import type { + Logger, + SavedObjectsBulkUpdateObject, + SavedObjectsUpdateResponse, +} from '@kbn/core/server'; +import type { BulkActionSkipResult } from '../../../common/bulk_edit'; import { convertRuleIdsToKueryNode } from '../../lib'; -import { BulkOperationError } from '../types'; +import type { BulkOperationError } from '../types'; import { waitBeforeNextRetry, RETRY_IF_CONFLICTS_ATTEMPTS } from './wait_before_next_retry'; import { RULE_SAVED_OBJECT_TYPE } from '../../saved_objects'; -import { RawRule } from '../../types'; +import type { RawRule } from '../../types'; // max number of failed SO ids in one retry filter const MaxIdsNumberInRetryFilter = 1000; diff --git a/x-pack/platform/plugins/shared/alerting/server/rules_client/common/retry_if_bulk_operation_conflicts.test.ts b/x-pack/platform/plugins/shared/alerting/server/rules_client/common/retry_if_bulk_operation_conflicts.test.ts index 554363e23e40f..b5c4390e444b2 100644 --- a/x-pack/platform/plugins/shared/alerting/server/rules_client/common/retry_if_bulk_operation_conflicts.test.ts +++ b/x-pack/platform/plugins/shared/alerting/server/rules_client/common/retry_if_bulk_operation_conflicts.test.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { KueryNode } from '@kbn/es-query'; +import type { KueryNode } from '@kbn/es-query'; import { loggingSystemMock } from '@kbn/core/server/mocks'; import { retryIfBulkOperationConflicts } from './retry_if_bulk_operation_conflicts'; diff --git a/x-pack/platform/plugins/shared/alerting/server/rules_client/common/retry_if_bulk_operation_conflicts.ts b/x-pack/platform/plugins/shared/alerting/server/rules_client/common/retry_if_bulk_operation_conflicts.ts index 428f43a0dcfa6..8e36ef10f5fd2 100644 --- a/x-pack/platform/plugins/shared/alerting/server/rules_client/common/retry_if_bulk_operation_conflicts.ts +++ b/x-pack/platform/plugins/shared/alerting/server/rules_client/common/retry_if_bulk_operation_conflicts.ts @@ -7,13 +7,13 @@ import pMap from 'p-map'; import { chunk } from 'lodash'; -import { KueryNode } from '@kbn/es-query'; -import { Logger, SavedObjectsBulkUpdateObject } from '@kbn/core/server'; +import type { KueryNode } from '@kbn/es-query'; +import type { Logger, SavedObjectsBulkUpdateObject } from '@kbn/core/server'; import { withSpan } from '@kbn/apm-utils'; import { convertRuleIdsToKueryNode } from '../../lib'; -import { BulkOperationError } from '../types'; +import type { BulkOperationError } from '../types'; import { waitBeforeNextRetry, RETRY_IF_CONFLICTS_ATTEMPTS } from './wait_before_next_retry'; -import { RawRule } from '../../types'; +import type { RawRule } from '../../types'; const MAX_RULES_IDS_IN_RETRY = 1000; diff --git a/x-pack/platform/plugins/shared/alerting/server/rules_client/common/snooze_utils.ts b/x-pack/platform/plugins/shared/alerting/server/rules_client/common/snooze_utils.ts index 6e8e08bb3827f..9c2d872923065 100644 --- a/x-pack/platform/plugins/shared/alerting/server/rules_client/common/snooze_utils.ts +++ b/x-pack/platform/plugins/shared/alerting/server/rules_client/common/snooze_utils.ts @@ -6,14 +6,14 @@ */ import { i18n } from '@kbn/i18n'; -import { +import type { Rule, RuleDomain, RuleParams, RuleSnoozeSchedule as RuleDomainSnoozeSchedule, } from '../../application/rule/types'; import { getActiveScheduledSnoozes } from '../../lib/is_rule_snoozed'; -import { RawRule } from '../../types'; +import type { RawRule } from '../../types'; export function getSnoozeAttributes(attributes: RawRule, snoozeSchedule: RuleDomainSnoozeSchedule) { // If duration is -1, instead mute all diff --git a/x-pack/platform/plugins/shared/alerting/server/rules_client/common/try_to_remove_tasks.ts b/x-pack/platform/plugins/shared/alerting/server/rules_client/common/try_to_remove_tasks.ts index 962f68bf5d959..230d95c585ae5 100644 --- a/x-pack/platform/plugins/shared/alerting/server/rules_client/common/try_to_remove_tasks.ts +++ b/x-pack/platform/plugins/shared/alerting/server/rules_client/common/try_to_remove_tasks.ts @@ -5,9 +5,9 @@ * 2.0. */ -import { Logger } from '@kbn/core/server'; +import type { Logger } from '@kbn/core/server'; import { withSpan } from '@kbn/apm-utils'; -import { TaskManagerStartContract } from '@kbn/task-manager-plugin/server'; +import type { TaskManagerStartContract } from '@kbn/task-manager-plugin/server'; export const tryToRemoveTasks = async ({ taskIdsToDelete, diff --git a/x-pack/platform/plugins/shared/alerting/server/rules_client/common/validate_attributes.ts b/x-pack/platform/plugins/shared/alerting/server/rules_client/common/validate_attributes.ts index b58cc453d5800..3614c12e3aa23 100644 --- a/x-pack/platform/plugins/shared/alerting/server/rules_client/common/validate_attributes.ts +++ b/x-pack/platform/plugins/shared/alerting/server/rules_client/common/validate_attributes.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { KueryNode } from '@kbn/es-query'; +import type { KueryNode } from '@kbn/es-query'; import { get, isEmpty } from 'lodash'; import { alertMappings } from '../../../common/saved_objects/rules/mappings'; import { RULE_SAVED_OBJECT_TYPE } from '../../saved_objects'; @@ -82,7 +82,7 @@ export const iterateFilterKureyNode = ({ }: IterateFilterKureyNodeParams) => { let localStoreValue = storeValue; let localNestedKeys: string | undefined; - let localFieldName: string = ''; + let localFieldName = ''; if (localStoreValue === undefined) { localStoreValue = astFilter.type === 'function' && astFunctionType.includes(astFilter.function); } diff --git a/x-pack/platform/plugins/shared/alerting/server/rules_client/lib/add_generated_action_values.test.ts b/x-pack/platform/plugins/shared/alerting/server/rules_client/lib/add_generated_action_values.test.ts index 9c6dda227b078..e34972fa1a1b1 100644 --- a/x-pack/platform/plugins/shared/alerting/server/rules_client/lib/add_generated_action_values.test.ts +++ b/x-pack/platform/plugins/shared/alerting/server/rules_client/lib/add_generated_action_values.test.ts @@ -6,8 +6,8 @@ */ import { addGeneratedActionValues } from './add_generated_action_values'; -import { RuleAction, RuleSystemAction } from '../../../common'; -import { ActionsAuthorization } from '@kbn/actions-plugin/server'; +import type { RuleAction, RuleSystemAction } from '../../../common'; +import type { ActionsAuthorization } from '@kbn/actions-plugin/server'; import { actionsAuthorizationMock } from '@kbn/actions-plugin/server/mocks'; import { loggingSystemMock } from '@kbn/core-logging-server-mocks'; import { @@ -17,10 +17,10 @@ import { import { uiSettingsServiceMock } from '@kbn/core-ui-settings-server-mocks'; import { encryptedSavedObjectsMock } from '@kbn/encrypted-saved-objects-plugin/server/mocks'; import { taskManagerMock } from '@kbn/task-manager-plugin/server/mocks'; -import { AlertingAuthorization } from '../../authorization'; +import type { AlertingAuthorization } from '../../authorization'; import { alertingAuthorizationMock } from '../../authorization/alerting_authorization.mock'; import { ruleTypeRegistryMock } from '../../rule_type_registry.mock'; -import { ConstructorOptions } from '../rules_client'; +import type { ConstructorOptions } from '../rules_client'; import { backfillClientMock } from '../../backfill_client/backfill_client.mock'; import { ConnectorAdapterRegistry } from '../../connector_adapters/connector_adapter_registry'; diff --git a/x-pack/platform/plugins/shared/alerting/server/rules_client/lib/add_generated_action_values.ts b/x-pack/platform/plugins/shared/alerting/server/rules_client/lib/add_generated_action_values.ts index 31e97df2d1705..77051c7330d7a 100644 --- a/x-pack/platform/plugins/shared/alerting/server/rules_client/lib/add_generated_action_values.ts +++ b/x-pack/platform/plugins/shared/alerting/server/rules_client/lib/add_generated_action_values.ts @@ -6,9 +6,10 @@ */ import { v4 } from 'uuid'; -import { buildEsQuery, Filter } from '@kbn/es-query'; +import type { Filter } from '@kbn/es-query'; +import { buildEsQuery } from '@kbn/es-query'; import Boom from '@hapi/boom'; -import { +import type { NormalizedAlertAction, NormalizedAlertDefaultActionWithGeneratedValues, NormalizedAlertSystemActionWithGeneratedValues, diff --git a/x-pack/platform/plugins/shared/alerting/server/rules_client/lib/check_authorization_and_get_total.ts b/x-pack/platform/plugins/shared/alerting/server/rules_client/lib/check_authorization_and_get_total.ts index 47987868d3ca8..761de9765d5d8 100644 --- a/x-pack/platform/plugins/shared/alerting/server/rules_client/lib/check_authorization_and_get_total.ts +++ b/x-pack/platform/plugins/shared/alerting/server/rules_client/lib/check_authorization_and_get_total.ts @@ -7,16 +7,17 @@ import pMap from 'p-map'; import Boom from '@hapi/boom'; -import { KueryNode } from '@kbn/es-query'; +import type { KueryNode } from '@kbn/es-query'; import { withSpan } from '@kbn/apm-utils'; -import { RawRule } from '../../types'; -import { WriteOperations, ReadOperations, AlertingAuthorizationEntity } from '../../authorization'; -import { BulkAction, RuleBulkOperationAggregation } from '../types'; +import type { RawRule } from '../../types'; +import type { ReadOperations } from '../../authorization'; +import { WriteOperations, AlertingAuthorizationEntity } from '../../authorization'; +import type { BulkAction, RuleBulkOperationAggregation } from '../types'; import { MAX_RULES_NUMBER_FOR_BULK_OPERATION, RULE_TYPE_CHECKS_CONCURRENCY, } from '../common/constants'; -import { RulesClientContext } from '../types'; +import type { RulesClientContext } from '../types'; import { ruleAuditEvent, RuleAuditAction } from '../common/audit_events'; import { RULE_SAVED_OBJECT_TYPE } from '../../saved_objects'; diff --git a/x-pack/platform/plugins/shared/alerting/server/rules_client/lib/create_new_api_key_set.test.ts b/x-pack/platform/plugins/shared/alerting/server/rules_client/lib/create_new_api_key_set.test.ts index d9800cb35a68e..1016089fd035d 100644 --- a/x-pack/platform/plugins/shared/alerting/server/rules_client/lib/create_new_api_key_set.test.ts +++ b/x-pack/platform/plugins/shared/alerting/server/rules_client/lib/create_new_api_key_set.test.ts @@ -16,12 +16,12 @@ import { ruleTypeRegistryMock } from '../../rule_type_registry.mock'; import { alertingAuthorizationMock } from '../../authorization/alerting_authorization.mock'; import { encryptedSavedObjectsMock } from '@kbn/encrypted-saved-objects-plugin/server/mocks'; import { actionsAuthorizationMock } from '@kbn/actions-plugin/server/mocks'; -import { AlertingAuthorization } from '../../authorization/alerting_authorization'; -import { ActionsAuthorization } from '@kbn/actions-plugin/server'; -import { RawRule } from '../../types'; +import type { AlertingAuthorization } from '../../authorization/alerting_authorization'; +import type { ActionsAuthorization } from '@kbn/actions-plugin/server'; +import type { RawRule } from '../../types'; import { getBeforeSetup, mockedDateString } from '../tests/lib'; import { createNewAPIKeySet } from './create_new_api_key_set'; -import { RulesClientContext } from '../types'; +import type { RulesClientContext } from '../types'; import { backfillClientMock } from '../../backfill_client/backfill_client.mock'; import { ConnectorAdapterRegistry } from '../../connector_adapters/connector_adapter_registry'; diff --git a/x-pack/platform/plugins/shared/alerting/server/rules_client/lib/create_new_api_key_set.ts b/x-pack/platform/plugins/shared/alerting/server/rules_client/lib/create_new_api_key_set.ts index a9d0a7ba9674a..5ba9144e438a1 100644 --- a/x-pack/platform/plugins/shared/alerting/server/rules_client/lib/create_new_api_key_set.ts +++ b/x-pack/platform/plugins/shared/alerting/server/rules_client/lib/create_new_api_key_set.ts @@ -6,9 +6,9 @@ */ import Boom from '@hapi/boom'; -import { RawRule } from '../../types'; +import type { RawRule } from '../../types'; import { generateAPIKeyName, apiKeyAsAlertAttributes } from '../common'; -import { RulesClientContext } from '../types'; +import type { RulesClientContext } from '../types'; export async function createNewAPIKeySet( context: RulesClientContext, diff --git a/x-pack/platform/plugins/shared/alerting/server/rules_client/lib/create_rule_saved_object.ts b/x-pack/platform/plugins/shared/alerting/server/rules_client/lib/create_rule_saved_object.ts index 12a81c742f242..1f17067fa12e2 100644 --- a/x-pack/platform/plugins/shared/alerting/server/rules_client/lib/create_rule_saved_object.ts +++ b/x-pack/platform/plugins/shared/alerting/server/rules_client/lib/create_rule_saved_object.ts @@ -5,13 +5,13 @@ * 2.0. */ -import { SavedObjectReference, SavedObject } from '@kbn/core/server'; +import type { SavedObjectReference, SavedObject } from '@kbn/core/server'; import { withSpan } from '@kbn/apm-utils'; -import { Rule, RuleWithLegacyId, RawRule, RuleTypeParams } from '../../types'; +import type { Rule, RuleWithLegacyId, RawRule, RuleTypeParams } from '../../types'; import { bulkMarkApiKeysForInvalidation } from '../../invalidate_pending_api_keys/bulk_mark_api_keys_for_invalidation'; import { ruleAuditEvent, RuleAuditAction } from '../common/audit_events'; -import { SavedObjectOptions } from '../types'; -import { RulesClientContext } from '../types'; +import type { SavedObjectOptions } from '../types'; +import type { RulesClientContext } from '../types'; import { updateMeta } from './update_meta'; import { scheduleTask } from './schedule_task'; import { getAlertFromRaw } from './get_alert_from_raw'; diff --git a/x-pack/platform/plugins/shared/alerting/server/rules_client/lib/denormalize_actions.ts b/x-pack/platform/plugins/shared/alerting/server/rules_client/lib/denormalize_actions.ts index ed27fe651ea11..906fbc6b0f63f 100644 --- a/x-pack/platform/plugins/shared/alerting/server/rules_client/lib/denormalize_actions.ts +++ b/x-pack/platform/plugins/shared/alerting/server/rules_client/lib/denormalize_actions.ts @@ -4,13 +4,13 @@ * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ -import { SavedObjectReference } from '@kbn/core/server'; -import { ActionsClient } from '@kbn/actions-plugin/server'; +import type { SavedObjectReference } from '@kbn/core/server'; +import type { ActionsClient } from '@kbn/actions-plugin/server'; import { preconfiguredConnectorActionRefPrefix, systemConnectorActionRefPrefix, } from '../common/constants'; -import { DenormalizedAction, NormalizedAlertActionWithGeneratedValues } from '../types'; +import type { DenormalizedAction, NormalizedAlertActionWithGeneratedValues } from '../types'; export async function denormalizeActions( actionsClient: ActionsClient, diff --git a/x-pack/platform/plugins/shared/alerting/server/rules_client/lib/extract_references.ts b/x-pack/platform/plugins/shared/alerting/server/rules_client/lib/extract_references.ts index 6a131e9ee9179..710719ea45298 100644 --- a/x-pack/platform/plugins/shared/alerting/server/rules_client/lib/extract_references.ts +++ b/x-pack/platform/plugins/shared/alerting/server/rules_client/lib/extract_references.ts @@ -5,12 +5,12 @@ * 2.0. */ -import { SavedObjectReference } from '@kbn/core/server'; -import { RuleTypeParams } from '../../types'; -import { UntypedNormalizedRuleType } from '../../rule_type_registry'; -import { DenormalizedAction, NormalizedAlertActionWithGeneratedValues } from '../types'; +import type { SavedObjectReference } from '@kbn/core/server'; +import type { RuleTypeParams } from '../../types'; +import type { UntypedNormalizedRuleType } from '../../rule_type_registry'; +import type { DenormalizedAction, NormalizedAlertActionWithGeneratedValues } from '../types'; import { extractedSavedObjectParamReferenceNamePrefix } from '../common/constants'; -import { RulesClientContext } from '../types'; +import type { RulesClientContext } from '../types'; import { denormalizeActions } from './denormalize_actions'; export async function extractReferences< diff --git a/x-pack/platform/plugins/shared/alerting/server/rules_client/lib/get_alert_from_raw.ts b/x-pack/platform/plugins/shared/alerting/server/rules_client/lib/get_alert_from_raw.ts index ed7155770d7f8..3100f922dbe8c 100644 --- a/x-pack/platform/plugins/shared/alerting/server/rules_client/lib/get_alert_from_raw.ts +++ b/x-pack/platform/plugins/shared/alerting/server/rules_client/lib/get_alert_from_raw.ts @@ -6,8 +6,8 @@ */ import { omit, isEmpty } from 'lodash'; -import { Logger, SavedObjectReference } from '@kbn/core/server'; -import { +import type { Logger, SavedObjectReference } from '@kbn/core/server'; +import type { Rule, PartialRule, RawRule, @@ -22,7 +22,7 @@ import { convertMonitoringFromRawAndVerify, getRuleSnoozeEndTime, } from '../../lib'; -import { UntypedNormalizedRuleType } from '../../rule_type_registry'; +import type { UntypedNormalizedRuleType } from '../../rule_type_registry'; import { getActiveScheduledSnoozes } from '../../lib/is_rule_snoozed'; import { injectReferencesIntoParams } from '../common'; import { diff --git a/x-pack/platform/plugins/shared/alerting/server/rules_client/lib/get_authorization_filter.ts b/x-pack/platform/plugins/shared/alerting/server/rules_client/lib/get_authorization_filter.ts index 591602effc474..7f3ce61bca11d 100644 --- a/x-pack/platform/plugins/shared/alerting/server/rules_client/lib/get_authorization_filter.ts +++ b/x-pack/platform/plugins/shared/alerting/server/rules_client/lib/get_authorization_filter.ts @@ -7,9 +7,9 @@ import { withSpan } from '@kbn/apm-utils'; import { ruleAuditEvent, RuleAuditAction } from '../common/audit_events'; -import { RulesClientContext } from '../types'; +import type { RulesClientContext } from '../types'; import { alertingAuthorizationFilterOpts } from '../common/constants'; -import { BulkAction } from '../types'; +import type { BulkAction } from '../types'; import { AlertingAuthorizationEntity } from '../../authorization/types'; export const getAuthorizationFilter = async ( diff --git a/x-pack/platform/plugins/shared/alerting/server/rules_client/lib/get_rule_saved_object.ts b/x-pack/platform/plugins/shared/alerting/server/rules_client/lib/get_rule_saved_object.ts index 81952cfc938e1..19c0cc265dcce 100644 --- a/x-pack/platform/plugins/shared/alerting/server/rules_client/lib/get_rule_saved_object.ts +++ b/x-pack/platform/plugins/shared/alerting/server/rules_client/lib/get_rule_saved_object.ts @@ -5,13 +5,13 @@ * 2.0. */ -import { SavedObject } from '@kbn/core/server'; +import type { SavedObject } from '@kbn/core/server'; import { withSpan } from '@kbn/apm-utils'; import { ruleAuditEvent, RuleAuditAction } from '../common/audit_events'; -import { RulesClientContext } from '../types'; +import type { RulesClientContext } from '../types'; import { getRuleSo } from '../../data/rule'; import { RULE_SAVED_OBJECT_TYPE } from '../../saved_objects'; -import { RawRule } from '../../types'; +import type { RawRule } from '../../types'; interface GetRuleSavedObjectParams { ruleId: string; diff --git a/x-pack/platform/plugins/shared/alerting/server/rules_client/lib/increment_revision.test.ts b/x-pack/platform/plugins/shared/alerting/server/rules_client/lib/increment_revision.test.ts index 766bbdf267652..3bbe1369e5acb 100644 --- a/x-pack/platform/plugins/shared/alerting/server/rules_client/lib/increment_revision.test.ts +++ b/x-pack/platform/plugins/shared/alerting/server/rules_client/lib/increment_revision.test.ts @@ -7,10 +7,10 @@ import { mockedDateString } from '../tests/lib'; import { incrementRevision } from './increment_revision'; -import { SavedObject } from '@kbn/core/server'; -import { RawRule, RuleTypeParams } from '../../types'; +import type { SavedObject } from '@kbn/core/server'; +import type { RawRule, RuleTypeParams } from '../../types'; import { RULE_SAVED_OBJECT_TYPE } from '../../saved_objects'; -import { UpdateRuleData } from '../../application/rule/methods/update'; +import type { UpdateRuleData } from '../../application/rule/methods/update'; describe('incrementRevision', () => { const currentRule: SavedObject = { diff --git a/x-pack/platform/plugins/shared/alerting/server/rules_client/lib/increment_revision.ts b/x-pack/platform/plugins/shared/alerting/server/rules_client/lib/increment_revision.ts index e26d719d59127..06ec885dfabbc 100644 --- a/x-pack/platform/plugins/shared/alerting/server/rules_client/lib/increment_revision.ts +++ b/x-pack/platform/plugins/shared/alerting/server/rules_client/lib/increment_revision.ts @@ -6,9 +6,9 @@ */ import { get, isEqual } from 'lodash'; -import { RuleTypeParams, RawRule } from '../../types'; +import type { RuleTypeParams, RawRule } from '../../types'; import { fieldsToExcludeFromRevisionUpdates } from '..'; -import { UpdateRuleData } from '../../application/rule/methods/update'; +import type { UpdateRuleData } from '../../application/rule/methods/update'; export function incrementRevision({ originalRule, diff --git a/x-pack/platform/plugins/shared/alerting/server/rules_client/lib/resolve_rule_saved_object.ts b/x-pack/platform/plugins/shared/alerting/server/rules_client/lib/resolve_rule_saved_object.ts index a32f86926c400..fa4da7ace29e3 100644 --- a/x-pack/platform/plugins/shared/alerting/server/rules_client/lib/resolve_rule_saved_object.ts +++ b/x-pack/platform/plugins/shared/alerting/server/rules_client/lib/resolve_rule_saved_object.ts @@ -5,13 +5,13 @@ * 2.0. */ -import { SavedObjectsResolveResponse } from '@kbn/core/server'; +import type { SavedObjectsResolveResponse } from '@kbn/core/server'; import { withSpan } from '@kbn/apm-utils'; import { ruleAuditEvent, RuleAuditAction } from '../common/audit_events'; -import { RulesClientContext } from '../types'; +import type { RulesClientContext } from '../types'; import { resolveRuleSo } from '../../data/rule'; import { RULE_SAVED_OBJECT_TYPE } from '../../saved_objects'; -import { RawRule } from '../../types'; +import type { RawRule } from '../../types'; interface ResolveRuleSavedObjectParams { ruleId: string; diff --git a/x-pack/platform/plugins/shared/alerting/server/rules_client/lib/schedule_task.ts b/x-pack/platform/plugins/shared/alerting/server/rules_client/lib/schedule_task.ts index c868a2d944075..ab19bba0372d9 100644 --- a/x-pack/platform/plugins/shared/alerting/server/rules_client/lib/schedule_task.ts +++ b/x-pack/platform/plugins/shared/alerting/server/rules_client/lib/schedule_task.ts @@ -6,8 +6,8 @@ */ import { withSpan } from '@kbn/apm-utils'; -import { RulesClientContext } from '../types'; -import { ScheduleTaskOptions } from '../types'; +import type { RulesClientContext } from '../types'; +import type { ScheduleTaskOptions } from '../types'; export async function scheduleTask(context: RulesClientContext, opts: ScheduleTaskOptions) { const { id, consumer, ruleTypeId, schedule, throwOnConflict } = opts; diff --git a/x-pack/platform/plugins/shared/alerting/server/rules_client/lib/siem_legacy_actions/format_legacy_actions.test.ts b/x-pack/platform/plugins/shared/alerting/server/rules_client/lib/siem_legacy_actions/format_legacy_actions.test.ts index 8830ce96a6c43..f06cacb146cc0 100644 --- a/x-pack/platform/plugins/shared/alerting/server/rules_client/lib/siem_legacy_actions/format_legacy_actions.test.ts +++ b/x-pack/platform/plugins/shared/alerting/server/rules_client/lib/siem_legacy_actions/format_legacy_actions.test.ts @@ -10,13 +10,10 @@ import type { SavedObjectsFindResult, SavedObjectAttribute } from '@kbn/core/ser import { loggingSystemMock, savedObjectsClientMock } from '@kbn/core/server/mocks'; -import { Rule } from '../../../types'; +import type { Rule } from '../../../types'; -import { - legacyGetBulkRuleActionsSavedObject, - LegacyActionsObj, - formatLegacyActions, -} from './format_legacy_actions'; +import type { LegacyActionsObj } from './format_legacy_actions'; +import { legacyGetBulkRuleActionsSavedObject, formatLegacyActions } from './format_legacy_actions'; import { legacyRuleActionsSavedObjectType } from './types'; describe('legacyGetBulkRuleActionsSavedObject', () => { diff --git a/x-pack/platform/plugins/shared/alerting/server/rules_client/lib/siem_legacy_actions/format_legacy_actions.ts b/x-pack/platform/plugins/shared/alerting/server/rules_client/lib/siem_legacy_actions/format_legacy_actions.ts index 68c6a73b098d6..40da22e9e7aca 100644 --- a/x-pack/platform/plugins/shared/alerting/server/rules_client/lib/siem_legacy_actions/format_legacy_actions.ts +++ b/x-pack/platform/plugins/shared/alerting/server/rules_client/lib/siem_legacy_actions/format_legacy_actions.ts @@ -9,12 +9,13 @@ import { chunk } from 'lodash'; import type { SavedObjectsFindOptionsReference, Logger } from '@kbn/core/server'; import pMap from 'p-map'; import { RULE_SAVED_OBJECT_TYPE } from '../../../saved_objects'; -import { RuleAction, Rule } from '../../../types'; +import type { RuleAction, Rule } from '../../../types'; import type { RuleExecutorServices } from '../../..'; import { injectReferencesIntoActions } from '../../common'; import { transformToNotifyWhen } from './transform_to_notify_when'; import { transformFromLegacyActions } from './transform_legacy_actions'; -import { LegacyIRuleActionsAttributes, legacyRuleActionsSavedObjectType } from './types'; +import type { LegacyIRuleActionsAttributes } from './types'; +import { legacyRuleActionsSavedObjectType } from './types'; import { transformToAlertThrottle } from './transform_to_alert_throttle'; /** diff --git a/x-pack/platform/plugins/shared/alerting/server/rules_client/lib/siem_legacy_actions/migrate_legacy_actions.test.ts b/x-pack/platform/plugins/shared/alerting/server/rules_client/lib/siem_legacy_actions/migrate_legacy_actions.test.ts index 2dc0d79833229..cf2fd9a029ccf 100644 --- a/x-pack/platform/plugins/shared/alerting/server/rules_client/lib/siem_legacy_actions/migrate_legacy_actions.test.ts +++ b/x-pack/platform/plugins/shared/alerting/server/rules_client/lib/siem_legacy_actions/migrate_legacy_actions.test.ts @@ -13,10 +13,10 @@ import { retrieveMigratedLegacyActions } from './retrieve_migrated_legacy_action import { injectReferencesIntoActions } from '../../common'; import { validateActions } from '../validate_actions'; -import { RulesClientContext } from '../..'; -import { RawRuleAction, RawRule } from '../../../types'; +import type { RulesClientContext } from '../..'; +import type { RawRuleAction, RawRule } from '../../../types'; -import { UntypedNormalizedRuleType } from '../../../rule_type_registry'; +import type { UntypedNormalizedRuleType } from '../../../rule_type_registry'; import { RecoveredActionGroup } from '../../../../common'; jest.mock('./retrieve_migrated_legacy_actions', () => ({ diff --git a/x-pack/platform/plugins/shared/alerting/server/rules_client/lib/siem_legacy_actions/migrate_legacy_actions.ts b/x-pack/platform/plugins/shared/alerting/server/rules_client/lib/siem_legacy_actions/migrate_legacy_actions.ts index da14fe60e47fb..1bfca0d9ff417 100644 --- a/x-pack/platform/plugins/shared/alerting/server/rules_client/lib/siem_legacy_actions/migrate_legacy_actions.ts +++ b/x-pack/platform/plugins/shared/alerting/server/rules_client/lib/siem_legacy_actions/migrate_legacy_actions.ts @@ -10,7 +10,7 @@ import { i18n } from '@kbn/i18n'; import { AlertConsumers } from '@kbn/rule-data-utils'; import type { SavedObjectReference } from '@kbn/core/server'; import type { RulesClientContext } from '../..'; -import { RawRuleAction, RawRule } from '../../../types'; +import type { RawRuleAction, RawRule } from '../../../types'; import { validateActions } from '../validate_actions'; import { retrieveMigratedLegacyActions } from './retrieve_migrated_legacy_actions'; import { transformRawActionsToDomainActions } from '../../../application/rule/transforms/transform_raw_actions_to_domain_actions'; diff --git a/x-pack/platform/plugins/shared/alerting/server/rules_client/lib/siem_legacy_actions/retrieve_migrated_legacy_actions.ts b/x-pack/platform/plugins/shared/alerting/server/rules_client/lib/siem_legacy_actions/retrieve_migrated_legacy_actions.ts index d11e679fd1f56..dc69af9bf1110 100644 --- a/x-pack/platform/plugins/shared/alerting/server/rules_client/lib/siem_legacy_actions/retrieve_migrated_legacy_actions.ts +++ b/x-pack/platform/plugins/shared/alerting/server/rules_client/lib/siem_legacy_actions/retrieve_migrated_legacy_actions.ts @@ -8,10 +8,11 @@ import type { SavedObjectReference } from '@kbn/core/server'; import { RULE_SAVED_OBJECT_TYPE } from '../../../saved_objects'; import type { RulesClientContext } from '../..'; -import { RawRuleAction } from '../../../types'; +import type { RawRuleAction } from '../../../types'; import { findRules } from '../../../application/rule/methods/find/find_rules'; import { deleteRule } from '../../../application/rule/methods/delete/delete_rule'; -import { LegacyIRuleActionsAttributes, legacyRuleActionsSavedObjectType } from './types'; +import type { LegacyIRuleActionsAttributes } from './types'; +import { legacyRuleActionsSavedObjectType } from './types'; import { transformFromLegacyActions } from './transform_legacy_actions'; type RetrieveMigratedLegacyActions = ( diff --git a/x-pack/platform/plugins/shared/alerting/server/rules_client/lib/siem_legacy_actions/transform_legacy_actions.test.ts b/x-pack/platform/plugins/shared/alerting/server/rules_client/lib/siem_legacy_actions/transform_legacy_actions.test.ts index f7d9a70a3c53c..d76a145a6d8a2 100644 --- a/x-pack/platform/plugins/shared/alerting/server/rules_client/lib/siem_legacy_actions/transform_legacy_actions.test.ts +++ b/x-pack/platform/plugins/shared/alerting/server/rules_client/lib/siem_legacy_actions/transform_legacy_actions.test.ts @@ -10,7 +10,7 @@ import type { SavedObjectReference } from '@kbn/core/server'; import { transformFromLegacyActions } from './transform_legacy_actions'; import { transformToNotifyWhen } from './transform_to_notify_when'; -import { LegacyIRuleActionsAttributes } from './types'; +import type { LegacyIRuleActionsAttributes } from './types'; jest.mock('./transform_to_notify_when', () => ({ transformToNotifyWhen: jest.fn(), diff --git a/x-pack/platform/plugins/shared/alerting/server/rules_client/lib/siem_legacy_actions/transform_legacy_actions.ts b/x-pack/platform/plugins/shared/alerting/server/rules_client/lib/siem_legacy_actions/transform_legacy_actions.ts index 1218e96a8dfd7..1ad19e9958611 100644 --- a/x-pack/platform/plugins/shared/alerting/server/rules_client/lib/siem_legacy_actions/transform_legacy_actions.ts +++ b/x-pack/platform/plugins/shared/alerting/server/rules_client/lib/siem_legacy_actions/transform_legacy_actions.ts @@ -8,9 +8,9 @@ import { v4 } from 'uuid'; import { isEmpty } from 'lodash/fp'; import type { SavedObjectReference } from '@kbn/core/server'; -import { RawRuleAction } from '../../../types'; +import type { RawRuleAction } from '../../../types'; import { transformToNotifyWhen } from './transform_to_notify_when'; -import { LegacyIRuleActionsAttributes } from './types'; +import type { LegacyIRuleActionsAttributes } from './types'; import { transformToAlertThrottle } from './transform_to_alert_throttle'; /** diff --git a/x-pack/platform/plugins/shared/alerting/server/rules_client/lib/siem_legacy_actions/transform_to_notify_when.ts b/x-pack/platform/plugins/shared/alerting/server/rules_client/lib/siem_legacy_actions/transform_to_notify_when.ts index 76c43617adc22..3f21909a90a02 100644 --- a/x-pack/platform/plugins/shared/alerting/server/rules_client/lib/siem_legacy_actions/transform_to_notify_when.ts +++ b/x-pack/platform/plugins/shared/alerting/server/rules_client/lib/siem_legacy_actions/transform_to_notify_when.ts @@ -4,7 +4,7 @@ * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ -import { RuleNotifyWhenType } from '../../../../common'; +import type { RuleNotifyWhenType } from '../../../../common'; /** * Given a throttle from a "security_solution" rule this will transform it into an "alerting" notifyWhen diff --git a/x-pack/platform/plugins/shared/alerting/server/rules_client/lib/siem_legacy_actions/types.ts b/x-pack/platform/plugins/shared/alerting/server/rules_client/lib/siem_legacy_actions/types.ts index 487f18807d35b..d696239c8c0ea 100644 --- a/x-pack/platform/plugins/shared/alerting/server/rules_client/lib/siem_legacy_actions/types.ts +++ b/x-pack/platform/plugins/shared/alerting/server/rules_client/lib/siem_legacy_actions/types.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { RuleActionParams } from '../../../types'; +import type { RuleActionParams } from '../../../types'; import type { RuleTypeParams } from '../../..'; import type { Rule } from '../../../../common'; diff --git a/x-pack/platform/plugins/shared/alerting/server/rules_client/lib/untrack_rule_alerts.ts b/x-pack/platform/plugins/shared/alerting/server/rules_client/lib/untrack_rule_alerts.ts index 0e2063a3738ad..de4ef0c156ec2 100644 --- a/x-pack/platform/plugins/shared/alerting/server/rules_client/lib/untrack_rule_alerts.ts +++ b/x-pack/platform/plugins/shared/alerting/server/rules_client/lib/untrack_rule_alerts.ts @@ -8,12 +8,12 @@ import { mapValues } from 'lodash'; import { SAVED_OBJECT_REL_PRIMARY } from '@kbn/event-log-plugin/server'; import { withSpan } from '@kbn/apm-utils'; -import { SanitizedRule, RawAlertInstance as RawAlert, RawRule } from '../../types'; +import type { SanitizedRule, RawAlertInstance as RawAlert, RawRule } from '../../types'; import { taskInstanceToAlertTaskInstance } from '../../task_runner/alert_task_instance'; import { Alert } from '../../alert'; import { EVENT_LOG_ACTIONS } from '../../plugin'; import { createAlertEventLogRecordObject } from '../../lib/create_alert_event_log_record_object'; -import { RulesClientContext } from '../types'; +import type { RulesClientContext } from '../types'; import { RULE_SAVED_OBJECT_TYPE } from '../../saved_objects'; export const untrackRuleAlerts = async ( diff --git a/x-pack/platform/plugins/shared/alerting/server/rules_client/lib/update_meta.ts b/x-pack/platform/plugins/shared/alerting/server/rules_client/lib/update_meta.ts index 1f87dd0e2d6ee..be5a096ec69ef 100644 --- a/x-pack/platform/plugins/shared/alerting/server/rules_client/lib/update_meta.ts +++ b/x-pack/platform/plugins/shared/alerting/server/rules_client/lib/update_meta.ts @@ -5,8 +5,8 @@ * 2.0. */ -import { RawRule } from '../../types'; -import { RulesClientContext } from '../types'; +import type { RawRule } from '../../types'; +import type { RulesClientContext } from '../types'; /** * @deprecated Use updateMetaAttributes instead diff --git a/x-pack/platform/plugins/shared/alerting/server/rules_client/lib/update_meta_attributes.ts b/x-pack/platform/plugins/shared/alerting/server/rules_client/lib/update_meta_attributes.ts index f3c5ed48839ce..7f117ed9c20ed 100644 --- a/x-pack/platform/plugins/shared/alerting/server/rules_client/lib/update_meta_attributes.ts +++ b/x-pack/platform/plugins/shared/alerting/server/rules_client/lib/update_meta_attributes.ts @@ -5,8 +5,8 @@ * 2.0. */ -import { RawRule } from '../../types'; -import { RulesClientContext } from '../types'; +import type { RawRule } from '../../types'; +import type { RulesClientContext } from '../types'; export function updateMetaAttributes>( context: RulesClientContext, diff --git a/x-pack/platform/plugins/shared/alerting/server/rules_client/lib/validate_actions.test.ts b/x-pack/platform/plugins/shared/alerting/server/rules_client/lib/validate_actions.test.ts index 717ca3a8444a4..1e52d927cf484 100644 --- a/x-pack/platform/plugins/shared/alerting/server/rules_client/lib/validate_actions.test.ts +++ b/x-pack/platform/plugins/shared/alerting/server/rules_client/lib/validate_actions.test.ts @@ -5,10 +5,12 @@ * 2.0. */ -import { validateActions, ValidateActionsData } from './validate_actions'; -import { UntypedNormalizedRuleType } from '../../rule_type_registry'; -import { AlertsFilter, RecoveredActionGroup, RuleAction, RuleNotifyWhen } from '../../../common'; -import { NormalizedAlertAction, NormalizedSystemAction, RulesClientContext } from '..'; +import type { ValidateActionsData } from './validate_actions'; +import { validateActions } from './validate_actions'; +import type { UntypedNormalizedRuleType } from '../../rule_type_registry'; +import type { AlertsFilter, RuleAction } from '../../../common'; +import { RecoveredActionGroup, RuleNotifyWhen } from '../../../common'; +import type { NormalizedAlertAction, NormalizedSystemAction, RulesClientContext } from '..'; describe('validateActions', () => { const loggerErrorMock = jest.fn(); diff --git a/x-pack/platform/plugins/shared/alerting/server/rules_client/lib/validate_actions.ts b/x-pack/platform/plugins/shared/alerting/server/rules_client/lib/validate_actions.ts index 903ac43cdd8ec..8790d54846fe4 100644 --- a/x-pack/platform/plugins/shared/alerting/server/rules_client/lib/validate_actions.ts +++ b/x-pack/platform/plugins/shared/alerting/server/rules_client/lib/validate_actions.ts @@ -9,10 +9,11 @@ import Boom from '@hapi/boom'; import { map } from 'lodash'; import { i18n } from '@kbn/i18n'; import { validateHours } from '../../routes/lib/validate_hours'; -import { RawRule, RuleNotifyWhen } from '../../types'; -import { UntypedNormalizedRuleType } from '../../rule_type_registry'; -import { NormalizedAlertAction, NormalizedSystemAction } from '../types'; -import { RulesClientContext } from '../types'; +import type { RawRule } from '../../types'; +import { RuleNotifyWhen } from '../../types'; +import type { UntypedNormalizedRuleType } from '../../rule_type_registry'; +import type { NormalizedAlertAction, NormalizedSystemAction } from '../types'; +import type { RulesClientContext } from '../types'; import { parseDuration } from '../../lib'; export type ValidateActionsData = Pick & { diff --git a/x-pack/platform/plugins/shared/alerting/server/rules_client/methods/get_action_error_log.ts b/x-pack/platform/plugins/shared/alerting/server/rules_client/methods/get_action_error_log.ts index d2b8797ed1480..3b7f85e61eeaf 100644 --- a/x-pack/platform/plugins/shared/alerting/server/rules_client/methods/get_action_error_log.ts +++ b/x-pack/platform/plugins/shared/alerting/server/rules_client/methods/get_action_error_log.ts @@ -5,9 +5,9 @@ * 2.0. */ -import { KueryNode } from '@kbn/es-query'; -import type { estypes } from '@elastic/elasticsearch'; -import { SanitizedRuleWithLegacyId } from '../../types'; +import type { KueryNode } from '@kbn/es-query'; +import type * as estypes from '@elastic/elasticsearch/lib/api/types'; +import type { SanitizedRuleWithLegacyId } from '../../types'; import { convertEsSortToEventLogSort } from '../../lib'; import { ReadOperations, @@ -15,10 +15,10 @@ import { AlertingAuthorizationFilterType, } from '../../authorization'; import { ruleAuditEvent, RuleAuditAction } from '../common/audit_events'; -import { IExecutionErrorsResult } from '../../../common'; +import type { IExecutionErrorsResult } from '../../../common'; import { formatExecutionErrorsResult } from '../../lib/format_execution_log_errors'; import { parseDate } from '../common'; -import { RulesClientContext } from '../types'; +import type { RulesClientContext } from '../types'; import { getRule } from '../../application/rule/methods/get/get_rule'; import { RULE_SAVED_OBJECT_TYPE } from '../../saved_objects'; diff --git a/x-pack/platform/plugins/shared/alerting/server/rules_client/methods/get_alert_state.ts b/x-pack/platform/plugins/shared/alerting/server/rules_client/methods/get_alert_state.ts index d9121fef0be4c..eaf0ac661651b 100644 --- a/x-pack/platform/plugins/shared/alerting/server/rules_client/methods/get_alert_state.ts +++ b/x-pack/platform/plugins/shared/alerting/server/rules_client/methods/get_alert_state.ts @@ -6,10 +6,10 @@ */ import { SavedObjectsErrorHelpers } from '@kbn/core-saved-objects-server'; -import { RuleTaskState } from '../../types'; +import type { RuleTaskState } from '../../types'; import { taskInstanceToAlertTaskInstance } from '../../task_runner/alert_task_instance'; import { ReadOperations, AlertingAuthorizationEntity } from '../../authorization'; -import { RulesClientContext } from '../types'; +import type { RulesClientContext } from '../types'; import { getRule } from '../../application/rule/methods/get/get_rule'; export interface GetAlertStateParams { diff --git a/x-pack/platform/plugins/shared/alerting/server/rules_client/methods/get_alert_summary.ts b/x-pack/platform/plugins/shared/alerting/server/rules_client/methods/get_alert_summary.ts index 27af513ae663c..579e5a5710494 100644 --- a/x-pack/platform/plugins/shared/alerting/server/rules_client/methods/get_alert_summary.ts +++ b/x-pack/platform/plugins/shared/alerting/server/rules_client/methods/get_alert_summary.ts @@ -5,13 +5,13 @@ * 2.0. */ -import { IEvent } from '@kbn/event-log-plugin/server'; -import { AlertSummary, SanitizedRuleWithLegacyId } from '../../types'; +import type { IEvent } from '@kbn/event-log-plugin/server'; +import type { AlertSummary, SanitizedRuleWithLegacyId } from '../../types'; import { ReadOperations, AlertingAuthorizationEntity } from '../../authorization'; import { alertSummaryFromEventLog } from '../../lib/alert_summary_from_event_log'; import { parseDuration } from '../../../common/parse_duration'; import { parseDate } from '../common'; -import { RulesClientContext } from '../types'; +import type { RulesClientContext } from '../types'; import { getRule } from '../../application/rule/methods/get/get_rule'; import { RULE_SAVED_OBJECT_TYPE } from '../../saved_objects'; diff --git a/x-pack/platform/plugins/shared/alerting/server/rules_client/methods/get_execution_kpi.ts b/x-pack/platform/plugins/shared/alerting/server/rules_client/methods/get_execution_kpi.ts index 4441cc69a5f72..19de2c1053d20 100644 --- a/x-pack/platform/plugins/shared/alerting/server/rules_client/methods/get_execution_kpi.ts +++ b/x-pack/platform/plugins/shared/alerting/server/rules_client/methods/get_execution_kpi.ts @@ -5,8 +5,8 @@ * 2.0. */ -import { KueryNode } from '@kbn/es-query'; -import { SanitizedRuleWithLegacyId } from '../../types'; +import type { KueryNode } from '@kbn/es-query'; +import type { SanitizedRuleWithLegacyId } from '../../types'; import { ReadOperations, AlertingAuthorizationEntity, @@ -17,7 +17,7 @@ import { formatExecutionKPIResult, getExecutionKPIAggregation, } from '../../lib/get_execution_log_aggregation'; -import { RulesClientContext } from '../types'; +import type { RulesClientContext } from '../types'; import { parseDate } from '../common'; import { getRule } from '../../application/rule/methods/get/get_rule'; import { RULE_SAVED_OBJECT_TYPE } from '../../saved_objects'; diff --git a/x-pack/platform/plugins/shared/alerting/server/rules_client/methods/get_execution_log.ts b/x-pack/platform/plugins/shared/alerting/server/rules_client/methods/get_execution_log.ts index c047a8a525c81..5f6429da2b2f3 100644 --- a/x-pack/platform/plugins/shared/alerting/server/rules_client/methods/get_execution_log.ts +++ b/x-pack/platform/plugins/shared/alerting/server/rules_client/methods/get_execution_log.ts @@ -5,9 +5,9 @@ * 2.0. */ -import type { estypes } from '@elastic/elasticsearch'; -import { KueryNode } from '@kbn/es-query'; -import { SanitizedRuleWithLegacyId } from '../../types'; +import type * as estypes from '@elastic/elasticsearch/lib/api/types'; +import type { KueryNode } from '@kbn/es-query'; +import type { SanitizedRuleWithLegacyId } from '../../types'; import { ReadOperations, AlertingAuthorizationEntity, @@ -18,9 +18,9 @@ import { formatExecutionLogResult, getExecutionLogAggregation, } from '../../lib/get_execution_log_aggregation'; -import { IExecutionLogResult } from '../../../common'; +import type { IExecutionLogResult } from '../../../common'; import { parseDate } from '../common'; -import { RulesClientContext } from '../types'; +import type { RulesClientContext } from '../types'; import { getRule } from '../../application/rule/methods/get/get_rule'; import { RULE_SAVED_OBJECT_TYPE } from '../../saved_objects'; diff --git a/x-pack/platform/plugins/shared/alerting/server/rules_client/methods/run_soon.ts b/x-pack/platform/plugins/shared/alerting/server/rules_client/methods/run_soon.ts index 9a7907178fc83..7f4d655fe51d9 100644 --- a/x-pack/platform/plugins/shared/alerting/server/rules_client/methods/run_soon.ts +++ b/x-pack/platform/plugins/shared/alerting/server/rules_client/methods/run_soon.ts @@ -6,11 +6,12 @@ */ import { i18n } from '@kbn/i18n'; -import { ConcreteTaskInstance, TaskStatus } from '@kbn/task-manager-plugin/server'; -import { Rule } from '../../types'; +import type { ConcreteTaskInstance } from '@kbn/task-manager-plugin/server'; +import { TaskStatus } from '@kbn/task-manager-plugin/server'; +import type { Rule } from '../../types'; import { WriteOperations, AlertingAuthorizationEntity } from '../../authorization'; import { ruleAuditEvent, RuleAuditAction } from '../common/audit_events'; -import { RulesClientContext } from '../types'; +import type { RulesClientContext } from '../types'; import { RULE_SAVED_OBJECT_TYPE } from '../../saved_objects'; export async function runSoon(context: RulesClientContext, { id }: { id: string }) { diff --git a/x-pack/platform/plugins/shared/alerting/server/rules_client/rules_client.mock.ts b/x-pack/platform/plugins/shared/alerting/server/rules_client/rules_client.mock.ts index f8e2beba7ee67..0d847e43205c2 100644 --- a/x-pack/platform/plugins/shared/alerting/server/rules_client/rules_client.mock.ts +++ b/x-pack/platform/plugins/shared/alerting/server/rules_client/rules_client.mock.ts @@ -5,10 +5,10 @@ * 2.0. */ -import { ActionsAuthorization } from '@kbn/actions-plugin/server'; +import type { ActionsAuthorization } from '@kbn/actions-plugin/server'; import { loggingSystemMock } from '@kbn/core-logging-server-mocks'; import { uiSettingsServiceMock } from '@kbn/core-ui-settings-server-mocks'; -import { AlertingAuthorization } from '../authorization'; +import type { AlertingAuthorization } from '../authorization'; import { ConnectorAdapterRegistry } from '../connector_adapters/connector_adapter_registry'; import type { ConstructorOptions } from './rules_client'; import { actionsAuthorizationMock } from '@kbn/actions-plugin/server/mocks'; diff --git a/x-pack/platform/plugins/shared/alerting/server/rules_client/rules_client.ts b/x-pack/platform/plugins/shared/alerting/server/rules_client/rules_client.ts index 65d6a118b8561..609ea4bf40a3a 100644 --- a/x-pack/platform/plugins/shared/alerting/server/rules_client/rules_client.ts +++ b/x-pack/platform/plugins/shared/alerting/server/rules_client/rules_client.ts @@ -5,55 +5,57 @@ * 2.0. */ -import { UnmuteAlertParams } from '../application/rule/methods/unmute_alert/types'; -import { getRuleTags, RuleTagsParams } from '../application/rule/methods/tags'; -import { MuteAlertParams } from '../application/rule/methods/mute_alert/types'; -import { SanitizedRule, RuleTypeParams } from '../types'; +import type { UnmuteAlertParams } from '../application/rule/methods/unmute_alert/types'; +import type { RuleTagsParams } from '../application/rule/methods/tags'; +import { getRuleTags } from '../application/rule/methods/tags'; +import type { MuteAlertParams } from '../application/rule/methods/mute_alert/types'; +import type { SanitizedRule, RuleTypeParams } from '../types'; import { parseDuration } from '../../common/parse_duration'; -import { RulesClientContext } from './types'; -import { cloneRule, CloneRuleParams } from '../application/rule/methods/clone'; -import { createRule, CreateRuleParams } from '../application/rule/methods/create'; -import { updateRule, UpdateRuleParams } from '../application/rule/methods/update'; -import { snoozeRule, SnoozeRuleOptions } from '../application/rule/methods/snooze'; -import { unsnoozeRule, UnsnoozeParams } from '../application/rule/methods/unsnooze'; -import { getRule, GetRuleParams } from '../application/rule/methods/get'; -import { resolveRule, ResolveParams } from '../application/rule/methods/resolve'; -import { getAlertState, GetAlertStateParams } from './methods/get_alert_state'; -import { getAlertSummary, GetAlertSummaryParams } from './methods/get_alert_summary'; -import { +import type { RulesClientContext } from './types'; +import type { CloneRuleParams } from '../application/rule/methods/clone'; +import { cloneRule } from '../application/rule/methods/clone'; +import type { CreateRuleParams } from '../application/rule/methods/create'; +import { createRule } from '../application/rule/methods/create'; +import type { UpdateRuleParams } from '../application/rule/methods/update'; +import { updateRule } from '../application/rule/methods/update'; +import type { SnoozeRuleOptions } from '../application/rule/methods/snooze'; +import { snoozeRule } from '../application/rule/methods/snooze'; +import type { UnsnoozeParams } from '../application/rule/methods/unsnooze'; +import { unsnoozeRule } from '../application/rule/methods/unsnooze'; +import type { GetRuleParams } from '../application/rule/methods/get'; +import { getRule } from '../application/rule/methods/get'; +import type { ResolveParams } from '../application/rule/methods/resolve'; +import { resolveRule } from '../application/rule/methods/resolve'; +import type { GetAlertStateParams } from './methods/get_alert_state'; +import { getAlertState } from './methods/get_alert_state'; +import type { GetAlertSummaryParams } from './methods/get_alert_summary'; +import { getAlertSummary } from './methods/get_alert_summary'; +import type { GetExecutionLogByIdParams, - getExecutionLogForRule, GetGlobalExecutionLogParams, - getGlobalExecutionLogWithAuth, } from './methods/get_execution_log'; -import { - getActionErrorLog, - GetActionErrorLogByIdParams, - getActionErrorLogWithAuth, -} from './methods/get_action_error_log'; -import { +import { getExecutionLogForRule, getGlobalExecutionLogWithAuth } from './methods/get_execution_log'; +import type { GetActionErrorLogByIdParams } from './methods/get_action_error_log'; +import { getActionErrorLog, getActionErrorLogWithAuth } from './methods/get_action_error_log'; +import type { GetGlobalExecutionKPIParams, - getGlobalExecutionKpiWithAuth, - getRuleExecutionKPI, GetRuleExecutionKPIParams, } from './methods/get_execution_kpi'; -import { findRules, FindRulesParams } from '../application/rule/methods/find'; -import { AggregateParams } from '../application/rule/methods/aggregate/types'; +import { getGlobalExecutionKpiWithAuth, getRuleExecutionKPI } from './methods/get_execution_kpi'; +import type { FindRulesParams } from '../application/rule/methods/find'; +import { findRules } from '../application/rule/methods/find'; +import type { AggregateParams } from '../application/rule/methods/aggregate/types'; import { aggregateRules } from '../application/rule/methods/aggregate'; -import { deleteRule, DeleteRuleParams } from '../application/rule/methods/delete'; -import { - bulkDeleteRules, - BulkDeleteRulesRequestBody, -} from '../application/rule/methods/bulk_delete'; -import { - bulkDisableRules, - BulkDisableRulesRequestBody, -} from '../application/rule/methods/bulk_disable'; -import { - bulkEditRules, - BulkEditOptions, -} from '../application/rule/methods/bulk_edit/bulk_edit_rules'; -import { bulkEnableRules, BulkEnableRulesParams } from '../application/rule/methods/bulk_enable'; +import type { DeleteRuleParams } from '../application/rule/methods/delete'; +import { deleteRule } from '../application/rule/methods/delete'; +import type { BulkDeleteRulesRequestBody } from '../application/rule/methods/bulk_delete'; +import { bulkDeleteRules } from '../application/rule/methods/bulk_delete'; +import type { BulkDisableRulesRequestBody } from '../application/rule/methods/bulk_disable'; +import { bulkDisableRules } from '../application/rule/methods/bulk_disable'; +import type { BulkEditOptions } from '../application/rule/methods/bulk_edit/bulk_edit_rules'; +import { bulkEditRules } from '../application/rule/methods/bulk_edit/bulk_edit_rules'; +import type { BulkEnableRulesParams } from '../application/rule/methods/bulk_enable'; +import { bulkEnableRules } from '../application/rule/methods/bulk_enable'; import { enableRule } from '../application/rule/methods/enable_rule/enable_rule'; import { updateRuleApiKey } from '../application/rule/methods/update_api_key/update_rule_api_key'; import { disableRule } from '../application/rule/methods/disable/disable_rule'; @@ -64,27 +66,25 @@ import { unmuteInstance } from '../application/rule/methods/unmute_alert/unmute_ import { runSoon } from './methods/run_soon'; import { listRuleTypes } from '../application/rule/methods/rule_types/rule_types'; import { getScheduleFrequency } from '../application/rule/methods/get_schedule_frequency/get_schedule_frequency'; -import { - bulkUntrackAlerts, - BulkUntrackBody, -} from '../application/rule/methods/bulk_untrack/bulk_untrack_alerts'; -import { ScheduleBackfillParams } from '../application/backfill/methods/schedule/types'; +import type { BulkUntrackBody } from '../application/rule/methods/bulk_untrack/bulk_untrack_alerts'; +import { bulkUntrackAlerts } from '../application/rule/methods/bulk_untrack/bulk_untrack_alerts'; +import type { ScheduleBackfillParams } from '../application/backfill/methods/schedule/types'; import { scheduleBackfill } from '../application/backfill/methods/schedule'; import { getBackfill } from '../application/backfill/methods/get'; import { findBackfill } from '../application/backfill/methods/find'; import { deleteBackfill } from '../application/backfill/methods/delete'; -import { FindBackfillParams } from '../application/backfill/methods/find/types'; -import { DisableRuleParams } from '../application/rule/methods/disable'; -import { EnableRuleParams } from '../application/rule/methods/enable_rule'; +import type { FindBackfillParams } from '../application/backfill/methods/find/types'; +import type { DisableRuleParams } from '../application/rule/methods/disable'; +import type { EnableRuleParams } from '../application/rule/methods/enable_rule'; import { findGaps } from '../application/rule/methods/find_gaps'; import { fillGapById } from '../application/rule/methods/fill_gap_by_id'; -import { FillGapByIdParams } from '../application/rule/methods/fill_gap_by_id/types'; -import { GetRuleIdsWithGapsParams } from '../application/rule/methods/get_rule_ids_with_gaps/types'; +import type { FillGapByIdParams } from '../application/rule/methods/fill_gap_by_id/types'; +import type { GetRuleIdsWithGapsParams } from '../application/rule/methods/get_rule_ids_with_gaps/types'; import { getRuleIdsWithGaps } from '../application/rule/methods/get_rule_ids_with_gaps'; import { getGapsSummaryByRuleIds } from '../application/rule/methods/get_gaps_summary_by_rule_ids'; -import { GetGapsSummaryByRuleIdsParams } from '../application/rule/methods/get_gaps_summary_by_rule_ids/types'; -import { FindGapsParams } from '../lib/rule_gaps/types'; +import type { GetGapsSummaryByRuleIdsParams } from '../application/rule/methods/get_gaps_summary_by_rule_ids/types'; +import type { FindGapsParams } from '../lib/rule_gaps/types'; export type ConstructorOptions = Omit< RulesClientContext, diff --git a/x-pack/platform/plugins/shared/alerting/server/rules_client/tests/get_action_error_log.test.ts b/x-pack/platform/plugins/shared/alerting/server/rules_client/tests/get_action_error_log.test.ts index 0734a5ff7b5b5..edf593a0f25fc 100644 --- a/x-pack/platform/plugins/shared/alerting/server/rules_client/tests/get_action_error_log.test.ts +++ b/x-pack/platform/plugins/shared/alerting/server/rules_client/tests/get_action_error_log.test.ts @@ -5,8 +5,9 @@ * 2.0. */ -import { RulesClient, ConstructorOptions } from '../rules_client'; -import { GetActionErrorLogByIdParams } from '../methods/get_action_error_log'; +import type { ConstructorOptions } from '../rules_client'; +import { RulesClient } from '../rules_client'; +import type { GetActionErrorLogByIdParams } from '../methods/get_action_error_log'; import { savedObjectsClientMock, loggingSystemMock, @@ -19,11 +20,11 @@ import { ruleTypeRegistryMock } from '../../rule_type_registry.mock'; import { alertingAuthorizationMock } from '../../authorization/alerting_authorization.mock'; import { encryptedSavedObjectsMock } from '@kbn/encrypted-saved-objects-plugin/server/mocks'; import { actionsAuthorizationMock } from '@kbn/actions-plugin/server/mocks'; -import { AlertingAuthorization } from '../../authorization/alerting_authorization'; -import { ActionsAuthorization } from '@kbn/actions-plugin/server'; +import type { AlertingAuthorization } from '../../authorization/alerting_authorization'; +import type { ActionsAuthorization } from '@kbn/actions-plugin/server'; import { eventLogClientMock } from '@kbn/event-log-plugin/server/mocks'; -import { SavedObject } from '@kbn/core/server'; -import { RawRule } from '../../types'; +import type { SavedObject } from '@kbn/core/server'; +import type { RawRule } from '../../types'; import { auditLoggerMock } from '@kbn/security-plugin/server/audit/mocks'; import { getBeforeSetup, mockedDateString, setGlobalDate } from './lib'; import { ConnectorAdapterRegistry } from '../../connector_adapters/connector_adapter_registry'; diff --git a/x-pack/platform/plugins/shared/alerting/server/rules_client/tests/get_alert_state.test.ts b/x-pack/platform/plugins/shared/alerting/server/rules_client/tests/get_alert_state.test.ts index c1a1824066efe..bdac7b07dd1af 100644 --- a/x-pack/platform/plugins/shared/alerting/server/rules_client/tests/get_alert_state.test.ts +++ b/x-pack/platform/plugins/shared/alerting/server/rules_client/tests/get_alert_state.test.ts @@ -5,7 +5,8 @@ * 2.0. */ -import { RulesClient, ConstructorOptions } from '../rules_client'; +import type { ConstructorOptions } from '../rules_client'; +import { RulesClient } from '../rules_client'; import { savedObjectsClientMock, loggingSystemMock, @@ -18,8 +19,8 @@ import { alertingAuthorizationMock } from '../../authorization/alerting_authoriz import { TaskStatus } from '@kbn/task-manager-plugin/server'; import { encryptedSavedObjectsMock } from '@kbn/encrypted-saved-objects-plugin/server/mocks'; import { actionsAuthorizationMock } from '@kbn/actions-plugin/server/mocks'; -import { AlertingAuthorization } from '../../authorization/alerting_authorization'; -import { ActionsAuthorization } from '@kbn/actions-plugin/server'; +import type { AlertingAuthorization } from '../../authorization/alerting_authorization'; +import type { ActionsAuthorization } from '@kbn/actions-plugin/server'; import { getBeforeSetup } from './lib'; import { ConnectorAdapterRegistry } from '../../connector_adapters/connector_adapter_registry'; import { RULE_SAVED_OBJECT_TYPE } from '../../saved_objects'; diff --git a/x-pack/platform/plugins/shared/alerting/server/rules_client/tests/get_alert_summary.test.ts b/x-pack/platform/plugins/shared/alerting/server/rules_client/tests/get_alert_summary.test.ts index 79e87205380d4..6dde6596488cd 100644 --- a/x-pack/platform/plugins/shared/alerting/server/rules_client/tests/get_alert_summary.test.ts +++ b/x-pack/platform/plugins/shared/alerting/server/rules_client/tests/get_alert_summary.test.ts @@ -6,7 +6,8 @@ */ import { omit, mean } from 'lodash'; -import { RulesClient, ConstructorOptions } from '../rules_client'; +import type { ConstructorOptions } from '../rules_client'; +import { RulesClient } from '../rules_client'; import { savedObjectsClientMock, loggingSystemMock, @@ -18,13 +19,13 @@ import { ruleTypeRegistryMock } from '../../rule_type_registry.mock'; import { alertingAuthorizationMock } from '../../authorization/alerting_authorization.mock'; import { encryptedSavedObjectsMock } from '@kbn/encrypted-saved-objects-plugin/server/mocks'; import { actionsAuthorizationMock } from '@kbn/actions-plugin/server/mocks'; -import { AlertingAuthorization } from '../../authorization/alerting_authorization'; -import { ActionsAuthorization } from '@kbn/actions-plugin/server'; +import type { AlertingAuthorization } from '../../authorization/alerting_authorization'; +import type { ActionsAuthorization } from '@kbn/actions-plugin/server'; import { eventLogClientMock } from '@kbn/event-log-plugin/server/mocks'; -import { QueryEventsBySavedObjectResult } from '@kbn/event-log-plugin/server'; -import { SavedObject } from '@kbn/core/server'; +import type { QueryEventsBySavedObjectResult } from '@kbn/event-log-plugin/server'; +import type { SavedObject } from '@kbn/core/server'; import { EventsFactory } from '../../lib/alert_summary_from_event_log.test'; -import { RawRule } from '../../types'; +import type { RawRule } from '../../types'; import { getBeforeSetup, mockedDateString, setGlobalDate } from './lib'; import { ConnectorAdapterRegistry } from '../../connector_adapters/connector_adapter_registry'; import { RULE_SAVED_OBJECT_TYPE } from '../../saved_objects'; diff --git a/x-pack/platform/plugins/shared/alerting/server/rules_client/tests/get_execution_log.test.ts b/x-pack/platform/plugins/shared/alerting/server/rules_client/tests/get_execution_log.test.ts index b5c1f6aa7b365..dc6b3ca18f5fc 100644 --- a/x-pack/platform/plugins/shared/alerting/server/rules_client/tests/get_execution_log.test.ts +++ b/x-pack/platform/plugins/shared/alerting/server/rules_client/tests/get_execution_log.test.ts @@ -5,8 +5,9 @@ * 2.0. */ -import type { estypes } from '@elastic/elasticsearch'; -import { RulesClient, ConstructorOptions } from '../rules_client'; +import type * as estypes from '@elastic/elasticsearch/lib/api/types'; +import type { ConstructorOptions } from '../rules_client'; +import { RulesClient } from '../rules_client'; import { savedObjectsClientMock, loggingSystemMock, @@ -18,11 +19,11 @@ import { ruleTypeRegistryMock } from '../../rule_type_registry.mock'; import { alertingAuthorizationMock } from '../../authorization/alerting_authorization.mock'; import { encryptedSavedObjectsMock } from '@kbn/encrypted-saved-objects-plugin/server/mocks'; import { actionsAuthorizationMock } from '@kbn/actions-plugin/server/mocks'; -import { AlertingAuthorization } from '../../authorization/alerting_authorization'; -import { ActionsAuthorization } from '@kbn/actions-plugin/server'; +import type { AlertingAuthorization } from '../../authorization/alerting_authorization'; +import type { ActionsAuthorization } from '@kbn/actions-plugin/server'; import { eventLogClientMock } from '@kbn/event-log-plugin/server/mocks'; -import { SavedObject } from '@kbn/core/server'; -import { RawRule } from '../../types'; +import type { SavedObject } from '@kbn/core/server'; +import type { RawRule } from '../../types'; import { auditLoggerMock } from '@kbn/security-plugin/server/audit/mocks'; import { getBeforeSetup, mockedDateString, setGlobalDate } from './lib'; import { getExecutionLogAggregation } from '../../lib/get_execution_log_aggregation'; diff --git a/x-pack/platform/plugins/shared/alerting/server/rules_client/tests/lib.ts b/x-pack/platform/plugins/shared/alerting/server/rules_client/tests/lib.ts index 2a97b7deab05c..14ab90d407c3e 100644 --- a/x-pack/platform/plugins/shared/alerting/server/rules_client/tests/lib.ts +++ b/x-pack/platform/plugins/shared/alerting/server/rules_client/tests/lib.ts @@ -5,14 +5,14 @@ * 2.0. */ -import { taskManagerMock } from '@kbn/task-manager-plugin/server/mocks'; -import { IEventLogClient } from '@kbn/event-log-plugin/server'; +import type { taskManagerMock } from '@kbn/task-manager-plugin/server/mocks'; +import type { IEventLogClient } from '@kbn/event-log-plugin/server'; import { actionsClientMock } from '@kbn/actions-plugin/server/mocks'; import { eventLogClientMock } from '@kbn/event-log-plugin/server/mocks'; import { TaskStatus } from '@kbn/task-manager-plugin/server'; import { uiSettingsServiceMock } from '@kbn/core-ui-settings-server-mocks'; -import { ConstructorOptions } from '../rules_client'; -import { RuleTypeRegistry } from '../../rule_type_registry'; +import type { ConstructorOptions } from '../rules_client'; +import type { RuleTypeRegistry } from '../../rule_type_registry'; import { RecoveredActionGroup } from '../../../common'; import { RULE_SAVED_OBJECT_TYPE } from '../../saved_objects'; diff --git a/x-pack/platform/plugins/shared/alerting/server/rules_client/tests/list_rule_types.test.ts b/x-pack/platform/plugins/shared/alerting/server/rules_client/tests/list_rule_types.test.ts index 7205decb32bb5..bf9a000bf24b7 100644 --- a/x-pack/platform/plugins/shared/alerting/server/rules_client/tests/list_rule_types.test.ts +++ b/x-pack/platform/plugins/shared/alerting/server/rules_client/tests/list_rule_types.test.ts @@ -5,7 +5,8 @@ * 2.0. */ -import { RulesClient, ConstructorOptions } from '../rules_client'; +import type { ConstructorOptions } from '../rules_client'; +import { RulesClient } from '../rules_client'; import { savedObjectsClientMock, loggingSystemMock, @@ -17,11 +18,11 @@ import { ruleTypeRegistryMock } from '../../rule_type_registry.mock'; import { alertingAuthorizationMock } from '../../authorization/alerting_authorization.mock'; import { encryptedSavedObjectsMock } from '@kbn/encrypted-saved-objects-plugin/server/mocks'; import { actionsAuthorizationMock } from '@kbn/actions-plugin/server/mocks'; -import { AlertingAuthorization } from '../../authorization/alerting_authorization'; -import { ActionsAuthorization } from '@kbn/actions-plugin/server'; +import type { AlertingAuthorization } from '../../authorization/alerting_authorization'; +import type { ActionsAuthorization } from '@kbn/actions-plugin/server'; import { getBeforeSetup } from './lib'; import { RecoveredActionGroup } from '../../../common'; -import { RegistryRuleType } from '../../rule_type_registry'; +import type { RegistryRuleType } from '../../rule_type_registry'; import { backfillClientMock } from '../../backfill_client/backfill_client.mock'; import { ConnectorAdapterRegistry } from '../../connector_adapters/connector_adapter_registry'; diff --git a/x-pack/platform/plugins/shared/alerting/server/rules_client/tests/mute_all.test.ts b/x-pack/platform/plugins/shared/alerting/server/rules_client/tests/mute_all.test.ts index c79df2a4986c8..c02bf3913c650 100644 --- a/x-pack/platform/plugins/shared/alerting/server/rules_client/tests/mute_all.test.ts +++ b/x-pack/platform/plugins/shared/alerting/server/rules_client/tests/mute_all.test.ts @@ -5,7 +5,8 @@ * 2.0. */ -import { RulesClient, ConstructorOptions } from '../rules_client'; +import type { ConstructorOptions } from '../rules_client'; +import { RulesClient } from '../rules_client'; import { savedObjectsClientMock, loggingSystemMock, @@ -17,8 +18,8 @@ import { ruleTypeRegistryMock } from '../../rule_type_registry.mock'; import { alertingAuthorizationMock } from '../../authorization/alerting_authorization.mock'; import { encryptedSavedObjectsMock } from '@kbn/encrypted-saved-objects-plugin/server/mocks'; import { actionsAuthorizationMock } from '@kbn/actions-plugin/server/mocks'; -import { AlertingAuthorization } from '../../authorization/alerting_authorization'; -import { ActionsAuthorization } from '@kbn/actions-plugin/server'; +import type { AlertingAuthorization } from '../../authorization/alerting_authorization'; +import type { ActionsAuthorization } from '@kbn/actions-plugin/server'; import { auditLoggerMock } from '@kbn/security-plugin/server/audit/mocks'; import { getBeforeSetup, setGlobalDate } from './lib'; import { ConnectorAdapterRegistry } from '../../connector_adapters/connector_adapter_registry'; diff --git a/x-pack/platform/plugins/shared/alerting/server/rules_client/tests/mute_instance.test.ts b/x-pack/platform/plugins/shared/alerting/server/rules_client/tests/mute_instance.test.ts index 1ae6f38a400d4..b736c067c50f4 100644 --- a/x-pack/platform/plugins/shared/alerting/server/rules_client/tests/mute_instance.test.ts +++ b/x-pack/platform/plugins/shared/alerting/server/rules_client/tests/mute_instance.test.ts @@ -5,7 +5,8 @@ * 2.0. */ -import { RulesClient, ConstructorOptions } from '../rules_client'; +import type { ConstructorOptions } from '../rules_client'; +import { RulesClient } from '../rules_client'; import { savedObjectsClientMock, loggingSystemMock, @@ -17,8 +18,8 @@ import { ruleTypeRegistryMock } from '../../rule_type_registry.mock'; import { alertingAuthorizationMock } from '../../authorization/alerting_authorization.mock'; import { encryptedSavedObjectsMock } from '@kbn/encrypted-saved-objects-plugin/server/mocks'; import { actionsAuthorizationMock } from '@kbn/actions-plugin/server/mocks'; -import { AlertingAuthorization } from '../../authorization/alerting_authorization'; -import { ActionsAuthorization } from '@kbn/actions-plugin/server'; +import type { AlertingAuthorization } from '../../authorization/alerting_authorization'; +import type { ActionsAuthorization } from '@kbn/actions-plugin/server'; import { auditLoggerMock } from '@kbn/security-plugin/server/audit/mocks'; import { getBeforeSetup, setGlobalDate } from './lib'; import { ConnectorAdapterRegistry } from '../../connector_adapters/connector_adapter_registry'; diff --git a/x-pack/platform/plugins/shared/alerting/server/rules_client/tests/resolve.test.ts b/x-pack/platform/plugins/shared/alerting/server/rules_client/tests/resolve.test.ts index b69878fc5ae99..97159059dcd90 100644 --- a/x-pack/platform/plugins/shared/alerting/server/rules_client/tests/resolve.test.ts +++ b/x-pack/platform/plugins/shared/alerting/server/rules_client/tests/resolve.test.ts @@ -6,7 +6,8 @@ */ import { AlertConsumers } from '@kbn/rule-data-utils'; -import { RulesClient, ConstructorOptions } from '../rules_client'; +import type { ConstructorOptions } from '../rules_client'; +import { RulesClient } from '../rules_client'; import { savedObjectsClientMock, loggingSystemMock, @@ -18,8 +19,8 @@ import { ruleTypeRegistryMock } from '../../rule_type_registry.mock'; import { alertingAuthorizationMock } from '../../authorization/alerting_authorization.mock'; import { encryptedSavedObjectsMock } from '@kbn/encrypted-saved-objects-plugin/server/mocks'; import { actionsAuthorizationMock } from '@kbn/actions-plugin/server/mocks'; -import { AlertingAuthorization } from '../../authorization/alerting_authorization'; -import { ActionsAuthorization } from '@kbn/actions-plugin/server'; +import type { AlertingAuthorization } from '../../authorization/alerting_authorization'; +import type { ActionsAuthorization } from '@kbn/actions-plugin/server'; import { auditLoggerMock } from '@kbn/security-plugin/server/audit/mocks'; import { getBeforeSetup, setGlobalDate } from './lib'; import { RecoveredActionGroup } from '../../../common'; diff --git a/x-pack/platform/plugins/shared/alerting/server/rules_client/tests/run_soon.test.ts b/x-pack/platform/plugins/shared/alerting/server/rules_client/tests/run_soon.test.ts index bc77cc424df8e..aab017e64389e 100644 --- a/x-pack/platform/plugins/shared/alerting/server/rules_client/tests/run_soon.test.ts +++ b/x-pack/platform/plugins/shared/alerting/server/rules_client/tests/run_soon.test.ts @@ -5,7 +5,8 @@ * 2.0. */ -import { RulesClient, ConstructorOptions } from '../rules_client'; +import type { ConstructorOptions } from '../rules_client'; +import { RulesClient } from '../rules_client'; import { savedObjectsClientMock, loggingSystemMock, @@ -17,8 +18,8 @@ import { ruleTypeRegistryMock } from '../../rule_type_registry.mock'; import { alertingAuthorizationMock } from '../../authorization/alerting_authorization.mock'; import { encryptedSavedObjectsMock } from '@kbn/encrypted-saved-objects-plugin/server/mocks'; import { actionsAuthorizationMock } from '@kbn/actions-plugin/server/mocks'; -import { AlertingAuthorization } from '../../authorization/alerting_authorization'; -import { ActionsAuthorization } from '@kbn/actions-plugin/server'; +import type { AlertingAuthorization } from '../../authorization/alerting_authorization'; +import type { ActionsAuthorization } from '@kbn/actions-plugin/server'; import { TaskStatus } from '@kbn/task-manager-plugin/server'; import { auditLoggerMock } from '@kbn/security-plugin/server/audit/mocks'; import { getBeforeSetup, setGlobalDate } from './lib'; diff --git a/x-pack/platform/plugins/shared/alerting/server/rules_client/tests/unmute_all.test.ts b/x-pack/platform/plugins/shared/alerting/server/rules_client/tests/unmute_all.test.ts index d4cdb4b1b851b..f2000b0021f98 100644 --- a/x-pack/platform/plugins/shared/alerting/server/rules_client/tests/unmute_all.test.ts +++ b/x-pack/platform/plugins/shared/alerting/server/rules_client/tests/unmute_all.test.ts @@ -5,7 +5,8 @@ * 2.0. */ -import { RulesClient, ConstructorOptions } from '../rules_client'; +import type { ConstructorOptions } from '../rules_client'; +import { RulesClient } from '../rules_client'; import { savedObjectsClientMock, loggingSystemMock, @@ -17,8 +18,8 @@ import { ruleTypeRegistryMock } from '../../rule_type_registry.mock'; import { alertingAuthorizationMock } from '../../authorization/alerting_authorization.mock'; import { encryptedSavedObjectsMock } from '@kbn/encrypted-saved-objects-plugin/server/mocks'; import { actionsAuthorizationMock } from '@kbn/actions-plugin/server/mocks'; -import { AlertingAuthorization } from '../../authorization/alerting_authorization'; -import { ActionsAuthorization } from '@kbn/actions-plugin/server'; +import type { AlertingAuthorization } from '../../authorization/alerting_authorization'; +import type { ActionsAuthorization } from '@kbn/actions-plugin/server'; import { auditLoggerMock } from '@kbn/security-plugin/server/audit/mocks'; import { getBeforeSetup, setGlobalDate } from './lib'; import { ConnectorAdapterRegistry } from '../../connector_adapters/connector_adapter_registry'; diff --git a/x-pack/platform/plugins/shared/alerting/server/rules_client/types.ts b/x-pack/platform/plugins/shared/alerting/server/rules_client/types.ts index afcb4e1037a6c..43d80ca674130 100644 --- a/x-pack/platform/plugins/shared/alerting/server/rules_client/types.ts +++ b/x-pack/platform/plugins/shared/alerting/server/rules_client/types.ts @@ -5,25 +5,25 @@ * 2.0. */ -import { KueryNode } from '@kbn/es-query'; -import { +import type { KueryNode } from '@kbn/es-query'; +import type { Logger, SavedObjectsClientContract, PluginInitializerContext, ISavedObjectsRepository, UiSettingsServiceStart, } from '@kbn/core/server'; -import { ActionsClient, ActionsAuthorization } from '@kbn/actions-plugin/server'; -import { +import type { ActionsClient, ActionsAuthorization } from '@kbn/actions-plugin/server'; +import type { GrantAPIKeyResult as SecurityPluginGrantAPIKeyResult, InvalidateAPIKeyResult as SecurityPluginInvalidateAPIKeyResult, } from '@kbn/security-plugin/server'; -import { EncryptedSavedObjectsClient } from '@kbn/encrypted-saved-objects-plugin/server'; -import { TaskManagerStartContract } from '@kbn/task-manager-plugin/server'; -import { IEventLogClient, IEventLogger } from '@kbn/event-log-plugin/server'; -import { AuditLogger } from '@kbn/security-plugin/server'; -import { DistributiveOmit } from '@elastic/eui'; -import { +import type { EncryptedSavedObjectsClient } from '@kbn/encrypted-saved-objects-plugin/server'; +import type { TaskManagerStartContract } from '@kbn/task-manager-plugin/server'; +import type { IEventLogClient, IEventLogger } from '@kbn/event-log-plugin/server'; +import type { AuditLogger } from '@kbn/security-plugin/server'; +import type { DistributiveOmit } from '@elastic/eui'; +import type { RuleTypeRegistry, IntervalSchedule, SanitizedRule, @@ -32,12 +32,12 @@ import { RuleSystemAction, RuleAction, } from '../types'; -import { AlertingAuthorization } from '../authorization'; -import { AlertingRulesConfig } from '../config'; -import { ConnectorAdapterRegistry } from '../connector_adapters/connector_adapter_registry'; -import { GetAlertIndicesAlias } from '../lib'; -import { AlertsService } from '../alerts_service'; -import { BackfillClient } from '../backfill_client/backfill_client'; +import type { AlertingAuthorization } from '../authorization'; +import type { AlertingRulesConfig } from '../config'; +import type { ConnectorAdapterRegistry } from '../connector_adapters/connector_adapter_registry'; +import type { GetAlertIndicesAlias } from '../lib'; +import type { AlertsService } from '../alerts_service'; +import type { BackfillClient } from '../backfill_client/backfill_client'; export type { BulkEditOperation, diff --git a/x-pack/platform/plugins/shared/alerting/server/rules_client_conflict_retries.test.ts b/x-pack/platform/plugins/shared/alerting/server/rules_client_conflict_retries.test.ts index 6bf8d7a5b9fb3..25055b6903af2 100644 --- a/x-pack/platform/plugins/shared/alerting/server/rules_client_conflict_retries.test.ts +++ b/x-pack/platform/plugins/shared/alerting/server/rules_client_conflict_retries.test.ts @@ -7,7 +7,8 @@ import { cloneDeep } from 'lodash'; -import { RulesClient, ConstructorOptions } from './rules_client'; +import type { ConstructorOptions } from './rules_client'; +import { RulesClient } from './rules_client'; import { savedObjectsClientMock, loggingSystemMock, @@ -19,8 +20,8 @@ import { ruleTypeRegistryMock } from './rule_type_registry.mock'; import { alertingAuthorizationMock } from './authorization/alerting_authorization.mock'; import { encryptedSavedObjectsMock } from '@kbn/encrypted-saved-objects-plugin/server/mocks'; import { actionsClientMock, actionsAuthorizationMock } from '@kbn/actions-plugin/server/mocks'; -import { AlertingAuthorization } from './authorization/alerting_authorization'; -import { ActionsAuthorization } from '@kbn/actions-plugin/server'; +import type { AlertingAuthorization } from './authorization/alerting_authorization'; +import type { ActionsAuthorization } from '@kbn/actions-plugin/server'; import { SavedObjectsErrorHelpers } from '@kbn/core/server'; import { RetryForConflictsAttempts } from './lib/retry_if_conflicts'; import { TaskStatus } from '@kbn/task-manager-plugin/server/task'; @@ -223,11 +224,7 @@ async function unmuteInstance(success: boolean) { } // tests to run when the method is expected to succeed -function expectSuccess( - success: boolean, - count: number = 2, - method: 'update' | 'create' = 'update' -) { +function expectSuccess(success: boolean, count = 2, method: 'update' | 'create' = 'update') { expect(success).toBe(true); expect(unsecuredSavedObjectsClient[method]).toHaveBeenCalledTimes(count); // message content checked in the update test diff --git a/x-pack/platform/plugins/shared/alerting/server/rules_client_factory.test.ts b/x-pack/platform/plugins/shared/alerting/server/rules_client_factory.test.ts index 9af5962915d72..e0b78d2c27d58 100644 --- a/x-pack/platform/plugins/shared/alerting/server/rules_client_factory.test.ts +++ b/x-pack/platform/plugins/shared/alerting/server/rules_client_factory.test.ts @@ -5,7 +5,8 @@ * 2.0. */ -import { RulesClientFactory, RulesClientFactoryOpts } from './rules_client_factory'; +import type { RulesClientFactoryOpts } from './rules_client_factory'; +import { RulesClientFactory } from './rules_client_factory'; import { ruleTypeRegistryMock } from './rule_type_registry.mock'; import { taskManagerMock } from '@kbn/task-manager-plugin/server/mocks'; import { @@ -17,15 +18,15 @@ import { securityServiceMock, } from '@kbn/core/server/mocks'; import { encryptedSavedObjectsMock } from '@kbn/encrypted-saved-objects-plugin/server/mocks'; -import { AuthenticatedUser } from '@kbn/security-plugin/common'; +import type { AuthenticatedUser } from '@kbn/security-plugin/common'; import { securityMock } from '@kbn/security-plugin/server/mocks'; -import { PluginStartContract as ActionsStartContract } from '@kbn/actions-plugin/server'; +import type { PluginStartContract as ActionsStartContract } from '@kbn/actions-plugin/server'; import { actionsMock, actionsAuthorizationMock } from '@kbn/actions-plugin/server/mocks'; import { eventLogMock } from '@kbn/event-log-plugin/server/mocks'; import { alertingAuthorizationMock } from './authorization/alerting_authorization.mock'; import { alertingAuthorizationClientFactoryMock } from './alerting_authorization_client_factory.mock'; -import { AlertingAuthorization } from './authorization'; -import { AlertingAuthorizationClientFactory } from './alerting_authorization_client_factory'; +import type { AlertingAuthorization } from './authorization'; +import type { AlertingAuthorizationClientFactory } from './alerting_authorization_client_factory'; import { SECURITY_EXTENSION_ID } from '@kbn/core-saved-objects-server'; import { mockRouter } from '@kbn/core-http-router-server-mocks'; import { diff --git a/x-pack/platform/plugins/shared/alerting/server/rules_client_factory.ts b/x-pack/platform/plugins/shared/alerting/server/rules_client_factory.ts index f56b0840317bb..cece5130858ec 100644 --- a/x-pack/platform/plugins/shared/alerting/server/rules_client_factory.ts +++ b/x-pack/platform/plugins/shared/alerting/server/rules_client_factory.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { +import type { KibanaRequest, Logger, SavedObjectsServiceStart, @@ -13,29 +13,26 @@ import { ISavedObjectsRepository, CoreStart, } from '@kbn/core/server'; -import { PluginStartContract as ActionsPluginStartContract } from '@kbn/actions-plugin/server'; -import { - HTTPAuthorizationHeader, - SecurityPluginSetup, - SecurityPluginStart, -} from '@kbn/security-plugin/server'; -import { EncryptedSavedObjectsClient } from '@kbn/encrypted-saved-objects-plugin/server'; -import { TaskManagerStartContract } from '@kbn/task-manager-plugin/server'; -import { IEventLogClientService, IEventLogger } from '@kbn/event-log-plugin/server'; +import type { PluginStartContract as ActionsPluginStartContract } from '@kbn/actions-plugin/server'; +import type { SecurityPluginSetup, SecurityPluginStart } from '@kbn/security-plugin/server'; +import { HTTPAuthorizationHeader } from '@kbn/security-plugin/server'; +import type { EncryptedSavedObjectsClient } from '@kbn/encrypted-saved-objects-plugin/server'; +import type { TaskManagerStartContract } from '@kbn/task-manager-plugin/server'; +import type { IEventLogClientService, IEventLogger } from '@kbn/event-log-plugin/server'; import { SECURITY_EXTENSION_ID } from '@kbn/core-saved-objects-server'; -import { RuleTypeRegistry, SpaceIdToNamespaceFunction } from './types'; +import type { RuleTypeRegistry, SpaceIdToNamespaceFunction } from './types'; import { RulesClient } from './rules_client'; -import { AlertingAuthorizationClientFactory } from './alerting_authorization_client_factory'; -import { AlertingRulesConfig } from './config'; -import { GetAlertIndicesAlias } from './lib'; -import { AlertsService } from './alerts_service/alerts_service'; -import { BackfillClient } from './backfill_client/backfill_client'; +import type { AlertingAuthorizationClientFactory } from './alerting_authorization_client_factory'; +import type { AlertingRulesConfig } from './config'; +import type { GetAlertIndicesAlias } from './lib'; +import type { AlertsService } from './alerts_service/alerts_service'; +import type { BackfillClient } from './backfill_client/backfill_client'; import { AD_HOC_RUN_SAVED_OBJECT_TYPE, API_KEY_PENDING_INVALIDATION_TYPE, RULE_SAVED_OBJECT_TYPE, } from './saved_objects'; -import { ConnectorAdapterRegistry } from './connector_adapters/connector_adapter_registry'; +import type { ConnectorAdapterRegistry } from './connector_adapters/connector_adapter_registry'; export interface RulesClientFactoryOpts { logger: Logger; taskManager: TaskManagerStartContract; diff --git a/x-pack/platform/plugins/shared/alerting/server/rules_settings/flapping/rules_settings_flapping_client.test.ts b/x-pack/platform/plugins/shared/alerting/server/rules_settings/flapping/rules_settings_flapping_client.test.ts index 213d1a94a38eb..4175fc2ecb420 100644 --- a/x-pack/platform/plugins/shared/alerting/server/rules_settings/flapping/rules_settings_flapping_client.test.ts +++ b/x-pack/platform/plugins/shared/alerting/server/rules_settings/flapping/rules_settings_flapping_client.test.ts @@ -5,17 +5,15 @@ * 2.0. */ -import { - RulesSettingsFlappingClient, - RulesSettingsFlappingClientConstructorOptions, -} from './rules_settings_flapping_client'; +import type { RulesSettingsFlappingClientConstructorOptions } from './rules_settings_flapping_client'; +import { RulesSettingsFlappingClient } from './rules_settings_flapping_client'; import { savedObjectsClientMock, loggingSystemMock } from '@kbn/core/server/mocks'; +import type { RulesSettings } from '../../../common'; import { RULES_SETTINGS_FEATURE_ID, RULES_SETTINGS_SAVED_OBJECT_TYPE, RULES_SETTINGS_FLAPPING_SAVED_OBJECT_ID, DEFAULT_FLAPPING_SETTINGS, - RulesSettings, } from '../../../common'; import { SavedObjectsErrorHelpers } from '@kbn/core-saved-objects-server'; diff --git a/x-pack/platform/plugins/shared/alerting/server/rules_settings/flapping/rules_settings_flapping_client.ts b/x-pack/platform/plugins/shared/alerting/server/rules_settings/flapping/rules_settings_flapping_client.ts index b9cfbe550af79..3f78bfa6f51b0 100644 --- a/x-pack/platform/plugins/shared/alerting/server/rules_settings/flapping/rules_settings_flapping_client.ts +++ b/x-pack/platform/plugins/shared/alerting/server/rules_settings/flapping/rules_settings_flapping_client.ts @@ -6,23 +6,21 @@ */ import Boom from '@hapi/boom'; -import { - Logger, - SavedObjectsClientContract, - SavedObject, - SavedObjectsErrorHelpers, -} from '@kbn/core/server'; +import type { Logger, SavedObjectsClientContract, SavedObject } from '@kbn/core/server'; +import { SavedObjectsErrorHelpers } from '@kbn/core/server'; import { MAX_LOOK_BACK_WINDOW, MAX_STATUS_CHANGE_THRESHOLD, MIN_LOOK_BACK_WINDOW, MIN_STATUS_CHANGE_THRESHOLD, } from '@kbn/alerting-types/flapping/latest'; -import { +import type { RulesSettings, RulesSettingsFlapping, RulesSettingsFlappingProperties, RulesSettingsModificationMetadata, +} from '../../../common'; +import { RULES_SETTINGS_SAVED_OBJECT_TYPE, RULES_SETTINGS_FLAPPING_SAVED_OBJECT_ID, DEFAULT_FLAPPING_SETTINGS, diff --git a/x-pack/platform/plugins/shared/alerting/server/rules_settings/query_delay/rules_settings_query_delay_client.test.ts b/x-pack/platform/plugins/shared/alerting/server/rules_settings/query_delay/rules_settings_query_delay_client.test.ts index 84d707d388a44..65194eab600ed 100644 --- a/x-pack/platform/plugins/shared/alerting/server/rules_settings/query_delay/rules_settings_query_delay_client.test.ts +++ b/x-pack/platform/plugins/shared/alerting/server/rules_settings/query_delay/rules_settings_query_delay_client.test.ts @@ -7,17 +7,15 @@ import { SavedObjectsErrorHelpers } from '@kbn/core-saved-objects-server'; import { savedObjectsClientMock, loggingSystemMock } from '@kbn/core/server/mocks'; +import type { RulesSettings } from '../../../common'; import { RULES_SETTINGS_FEATURE_ID, RULES_SETTINGS_SAVED_OBJECT_TYPE, RULES_SETTINGS_QUERY_DELAY_SAVED_OBJECT_ID, - RulesSettings, DEFAULT_QUERY_DELAY_SETTINGS, } from '../../../common'; -import { - RulesSettingsQueryDelayClient, - RulesSettingsQueryDelayClientConstructorOptions, -} from './rules_settings_query_delay_client'; +import type { RulesSettingsQueryDelayClientConstructorOptions } from './rules_settings_query_delay_client'; +import { RulesSettingsQueryDelayClient } from './rules_settings_query_delay_client'; const mockDateString = '2019-02-12T21:01:22.479Z'; diff --git a/x-pack/platform/plugins/shared/alerting/server/rules_settings/query_delay/rules_settings_query_delay_client.ts b/x-pack/platform/plugins/shared/alerting/server/rules_settings/query_delay/rules_settings_query_delay_client.ts index c8dc863a02920..7ffee39284d46 100644 --- a/x-pack/platform/plugins/shared/alerting/server/rules_settings/query_delay/rules_settings_query_delay_client.ts +++ b/x-pack/platform/plugins/shared/alerting/server/rules_settings/query_delay/rules_settings_query_delay_client.ts @@ -6,21 +6,19 @@ */ import Boom from '@hapi/boom'; -import { - Logger, - SavedObjectsClientContract, - SavedObject, - SavedObjectsErrorHelpers, -} from '@kbn/core/server'; -import { +import type { Logger, SavedObjectsClientContract, SavedObject } from '@kbn/core/server'; +import { SavedObjectsErrorHelpers } from '@kbn/core/server'; +import type { RulesSettings, RulesSettingsModificationMetadata, + RulesSettingsQueryDelayProperties, + RulesSettingsQueryDelay, +} from '../../../common'; +import { RULES_SETTINGS_SAVED_OBJECT_TYPE, RULES_SETTINGS_QUERY_DELAY_SAVED_OBJECT_ID, - RulesSettingsQueryDelayProperties, MIN_QUERY_DELAY, MAX_QUERY_DELAY, - RulesSettingsQueryDelay, DEFAULT_SERVERLESS_QUERY_DELAY_SETTINGS, DEFAULT_QUERY_DELAY_SETTINGS, } from '../../../common'; diff --git a/x-pack/platform/plugins/shared/alerting/server/rules_settings/rules_settings_client.mock.ts b/x-pack/platform/plugins/shared/alerting/server/rules_settings/rules_settings_client.mock.ts index 3b75ed1900448..9ea763a591e16 100644 --- a/x-pack/platform/plugins/shared/alerting/server/rules_settings/rules_settings_client.mock.ts +++ b/x-pack/platform/plugins/shared/alerting/server/rules_settings/rules_settings_client.mock.ts @@ -5,14 +5,13 @@ * 2.0. */ -import { +import type { RulesSettingsClientApi, RulesSettingsFlappingClientApi, RulesSettingsQueryDelayClientApi, - DEFAULT_FLAPPING_SETTINGS, - DEFAULT_QUERY_DELAY_SETTINGS, RulesSettingsFlappingProperties, } from '../types'; +import { DEFAULT_FLAPPING_SETTINGS, DEFAULT_QUERY_DELAY_SETTINGS } from '../types'; export type RulesSettingsClientMock = jest.Mocked; export type RulesSettingsFlappingClientMock = jest.Mocked; diff --git a/x-pack/platform/plugins/shared/alerting/server/rules_settings/rules_settings_client.test.ts b/x-pack/platform/plugins/shared/alerting/server/rules_settings/rules_settings_client.test.ts index 314e28cd6f245..ae0e21e6e9751 100644 --- a/x-pack/platform/plugins/shared/alerting/server/rules_settings/rules_settings_client.test.ts +++ b/x-pack/platform/plugins/shared/alerting/server/rules_settings/rules_settings_client.test.ts @@ -5,10 +5,8 @@ * 2.0. */ -import { - RulesSettingsClient, - RulesSettingsClientConstructorOptions, -} from './rules_settings_client'; +import type { RulesSettingsClientConstructorOptions } from './rules_settings_client'; +import { RulesSettingsClient } from './rules_settings_client'; import { RulesSettingsFlappingClient } from './flapping/rules_settings_flapping_client'; import { savedObjectsClientMock, loggingSystemMock } from '@kbn/core/server/mocks'; import { RulesSettingsQueryDelayClient } from './query_delay/rules_settings_query_delay_client'; diff --git a/x-pack/platform/plugins/shared/alerting/server/rules_settings/rules_settings_client.ts b/x-pack/platform/plugins/shared/alerting/server/rules_settings/rules_settings_client.ts index 50e7650f42ff5..971a558e508eb 100644 --- a/x-pack/platform/plugins/shared/alerting/server/rules_settings/rules_settings_client.ts +++ b/x-pack/platform/plugins/shared/alerting/server/rules_settings/rules_settings_client.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { Logger, SavedObjectsClientContract } from '@kbn/core/server'; +import type { Logger, SavedObjectsClientContract } from '@kbn/core/server'; import { RulesSettingsFlappingClient } from './flapping/rules_settings_flapping_client'; import { RulesSettingsQueryDelayClient } from './query_delay/rules_settings_query_delay_client'; diff --git a/x-pack/platform/plugins/shared/alerting/server/rules_settings/rules_settings_client_factory.test.ts b/x-pack/platform/plugins/shared/alerting/server/rules_settings/rules_settings_client_factory.test.ts index 8942fb31acd32..a7977c266a27b 100644 --- a/x-pack/platform/plugins/shared/alerting/server/rules_settings/rules_settings_client_factory.test.ts +++ b/x-pack/platform/plugins/shared/alerting/server/rules_settings/rules_settings_client_factory.test.ts @@ -6,17 +6,15 @@ */ import { mockRouter } from '@kbn/core-http-router-server-mocks'; -import { - RulesSettingsClientFactory, - RulesSettingsClientFactoryOpts, -} from './rules_settings_client_factory'; +import type { RulesSettingsClientFactoryOpts } from './rules_settings_client_factory'; +import { RulesSettingsClientFactory } from './rules_settings_client_factory'; import { savedObjectsClientMock, savedObjectsServiceMock, loggingSystemMock, securityServiceMock, } from '@kbn/core/server/mocks'; -import { AuthenticatedUser } from '@kbn/security-plugin/common'; +import type { AuthenticatedUser } from '@kbn/security-plugin/common'; import { SECURITY_EXTENSION_ID } from '@kbn/core-saved-objects-server'; import { RULES_SETTINGS_SAVED_OBJECT_TYPE } from '../../common'; diff --git a/x-pack/platform/plugins/shared/alerting/server/rules_settings/rules_settings_client_factory.ts b/x-pack/platform/plugins/shared/alerting/server/rules_settings/rules_settings_client_factory.ts index a55529f995783..6a0f0fea83d60 100644 --- a/x-pack/platform/plugins/shared/alerting/server/rules_settings/rules_settings_client_factory.ts +++ b/x-pack/platform/plugins/shared/alerting/server/rules_settings/rules_settings_client_factory.ts @@ -5,13 +5,13 @@ * 2.0. */ -import { +import type { KibanaRequest, Logger, SavedObjectsServiceStart, - SECURITY_EXTENSION_ID, SecurityServiceStart, } from '@kbn/core/server'; +import { SECURITY_EXTENSION_ID } from '@kbn/core/server'; import { RulesSettingsClient } from './rules_settings_client'; import { RULES_SETTINGS_SAVED_OBJECT_TYPE } from '../../common'; diff --git a/x-pack/platform/plugins/shared/alerting/server/rules_settings/rules_settings_feature.ts b/x-pack/platform/plugins/shared/alerting/server/rules_settings/rules_settings_feature.ts index 57a4e333c0b56..576d409dd733c 100644 --- a/x-pack/platform/plugins/shared/alerting/server/rules_settings/rules_settings_feature.ts +++ b/x-pack/platform/plugins/shared/alerting/server/rules_settings/rules_settings_feature.ts @@ -6,7 +6,7 @@ */ import { i18n } from '@kbn/i18n'; -import { KibanaFeatureConfig } from '@kbn/features-plugin/common'; +import type { KibanaFeatureConfig } from '@kbn/features-plugin/common'; import { DEFAULT_APP_CATEGORIES } from '@kbn/core/server'; import { KibanaFeatureScope } from '@kbn/features-plugin/common'; import { diff --git a/x-pack/platform/plugins/shared/alerting/server/rules_settings/rules_settings_service.test.ts b/x-pack/platform/plugins/shared/alerting/server/rules_settings/rules_settings_service.test.ts index 7a42b2d9b92cc..6ec6d595f08e6 100644 --- a/x-pack/platform/plugins/shared/alerting/server/rules_settings/rules_settings_service.test.ts +++ b/x-pack/platform/plugins/shared/alerting/server/rules_settings/rules_settings_service.test.ts @@ -7,7 +7,7 @@ import sinon from 'sinon'; import { loggingSystemMock } from '@kbn/core/server/mocks'; -import { KibanaRequest } from '@kbn/core/server'; +import type { KibanaRequest } from '@kbn/core/server'; import { rulesSettingsClientMock } from './rules_settings_client.mock'; import { RulesSettingsService } from './rules_settings_service'; import { DEFAULT_QUERY_DELAY_SETTINGS, DEFAULT_SERVERLESS_QUERY_DELAY_SETTINGS } from '../types'; diff --git a/x-pack/platform/plugins/shared/alerting/server/rules_settings/rules_settings_service.ts b/x-pack/platform/plugins/shared/alerting/server/rules_settings/rules_settings_service.ts index 2dd264e5d9a69..d7a16ea74d724 100644 --- a/x-pack/platform/plugins/shared/alerting/server/rules_settings/rules_settings_service.ts +++ b/x-pack/platform/plugins/shared/alerting/server/rules_settings/rules_settings_service.ts @@ -5,14 +5,16 @@ * 2.0. */ -import { KibanaRequest, Logger } from '@kbn/core/server'; +import type { KibanaRequest, Logger } from '@kbn/core/server'; +import type { + RulesSettingsClientApi, + RulesSettingsFlappingProperties, + RulesSettingsQueryDelayProperties, +} from '../types'; import { DEFAULT_FLAPPING_SETTINGS, DEFAULT_QUERY_DELAY_SETTINGS, DEFAULT_SERVERLESS_QUERY_DELAY_SETTINGS, - RulesSettingsClientApi, - RulesSettingsFlappingProperties, - RulesSettingsQueryDelayProperties, } from '../types'; import { withAlertingSpan } from '../task_runner/lib'; diff --git a/x-pack/platform/plugins/shared/alerting/server/saved_objects/geo_containment/migrations.ts b/x-pack/platform/plugins/shared/alerting/server/saved_objects/geo_containment/migrations.ts index 7ad94643f47cf..d8d8f4399b08d 100644 --- a/x-pack/platform/plugins/shared/alerting/server/saved_objects/geo_containment/migrations.ts +++ b/x-pack/platform/plugins/shared/alerting/server/saved_objects/geo_containment/migrations.ts @@ -5,14 +5,14 @@ * 2.0. */ -import { +import type { SavedObjectAttributes, SavedObjectReference, SavedObjectUnsanitizedDoc, } from '@kbn/core/server'; -import { Query } from '@kbn/data-plugin/common/query'; -import { RuleTypeParams } from '../..'; -import { RawRule } from '../../types'; +import type { Query } from '@kbn/data-plugin/common/query'; +import type { RuleTypeParams } from '../..'; +import type { RawRule } from '../../types'; // These definitions are dupes of the SO-types in stack_alerts/geo_containment // There are not exported to avoid deep imports from stack_alerts plugins into here diff --git a/x-pack/platform/plugins/shared/alerting/server/saved_objects/get_import_warnings.test.ts b/x-pack/platform/plugins/shared/alerting/server/saved_objects/get_import_warnings.test.ts index 85c35693b2b6a..f64e7dcd3df14 100644 --- a/x-pack/platform/plugins/shared/alerting/server/saved_objects/get_import_warnings.test.ts +++ b/x-pack/platform/plugins/shared/alerting/server/saved_objects/get_import_warnings.test.ts @@ -5,9 +5,9 @@ * 2.0. */ -import { SavedObject } from '@kbn/core/server'; +import type { SavedObject } from '@kbn/core/server'; import { RULE_SAVED_OBJECT_TYPE } from '.'; -import { RawRule } from '../types'; +import type { RawRule } from '../types'; import { getImportWarnings } from './get_import_warnings'; describe('getImportWarnings', () => { diff --git a/x-pack/platform/plugins/shared/alerting/server/saved_objects/get_import_warnings.ts b/x-pack/platform/plugins/shared/alerting/server/saved_objects/get_import_warnings.ts index 6bd7feacb635d..d59dc4cd67fae 100644 --- a/x-pack/platform/plugins/shared/alerting/server/saved_objects/get_import_warnings.ts +++ b/x-pack/platform/plugins/shared/alerting/server/saved_objects/get_import_warnings.ts @@ -6,7 +6,7 @@ */ import { i18n } from '@kbn/i18n'; -import { SavedObject, SavedObjectsImportWarning } from '@kbn/core/server'; +import type { SavedObject, SavedObjectsImportWarning } from '@kbn/core/server'; export function getImportWarnings( rulesSavedObjects: Array> diff --git a/x-pack/platform/plugins/shared/alerting/server/saved_objects/index.ts b/x-pack/platform/plugins/shared/alerting/server/saved_objects/index.ts index 8f11020ee6285..4bf7fc09dd040 100644 --- a/x-pack/platform/plugins/shared/alerting/server/saved_objects/index.ts +++ b/x-pack/platform/plugins/shared/alerting/server/saved_objects/index.ts @@ -11,18 +11,18 @@ import type { SavedObjectsExportTransformContext, SavedObjectsServiceSetup, } from '@kbn/core/server'; -import { EncryptedSavedObjectsPluginSetup } from '@kbn/encrypted-saved-objects-plugin/server'; -import { MigrateFunctionsObject } from '@kbn/kibana-utils-plugin/common'; +import type { EncryptedSavedObjectsPluginSetup } from '@kbn/encrypted-saved-objects-plugin/server'; +import type { MigrateFunctionsObject } from '@kbn/kibana-utils-plugin/common'; import { ALERTING_CASES_SAVED_OBJECT_INDEX } from '@kbn/core-saved-objects-server'; import { alertMappings } from '../../common/saved_objects/rules/mappings'; import { rulesSettingsMappings } from './rules_settings_mappings'; import { maintenanceWindowMappings } from './maintenance_window_mapping'; import { getMigrations } from './migrations'; import { transformRulesForExport } from './transform_rule_for_export'; -import { RawRule } from '../types'; +import type { RawRule } from '../types'; import { getImportWarnings } from './get_import_warnings'; import { isRuleExportable } from './is_rule_exportable'; -import { RuleTypeRegistry } from '../rule_type_registry'; +import type { RuleTypeRegistry } from '../rule_type_registry'; export { partiallyUpdateRule, partiallyUpdateRuleWithEs } from './partially_update_rule'; import { RULES_SETTINGS_SAVED_OBJECT_TYPE, @@ -123,13 +123,10 @@ export function setupSavedObjects( warnings: getImportWarnings(ruleSavedObjects), }; }, - onExport( - context: SavedObjectsExportTransformContext, - objects: Array> - ) { + onExport(context: SavedObjectsExportTransformContext, objects: Array>) { return transformRulesForExport(objects); }, - isExportable(ruleSavedObject: SavedObject) { + isExportable(ruleSavedObject: SavedObject) { return isRuleExportable(ruleSavedObject, ruleTypeRegistry, logger); }, }, diff --git a/x-pack/platform/plugins/shared/alerting/server/saved_objects/is_rule_exportable.test.ts b/x-pack/platform/plugins/shared/alerting/server/saved_objects/is_rule_exportable.test.ts index 27145ecfe072f..ba5e11c9287b7 100644 --- a/x-pack/platform/plugins/shared/alerting/server/saved_objects/is_rule_exportable.test.ts +++ b/x-pack/platform/plugins/shared/alerting/server/saved_objects/is_rule_exportable.test.ts @@ -5,17 +5,19 @@ * 2.0. */ -import { MockedLogger, loggerMock } from '@kbn/logging-mocks'; +import type { MockedLogger } from '@kbn/logging-mocks'; +import { loggerMock } from '@kbn/logging-mocks'; import { TaskRunnerFactory } from '../task_runner'; -import { RuleTypeRegistry, ConstructorOptions } from '../rule_type_registry'; +import type { ConstructorOptions } from '../rule_type_registry'; +import { RuleTypeRegistry } from '../rule_type_registry'; import { taskManagerMock } from '@kbn/task-manager-plugin/server/mocks'; -import { ILicenseState } from '../lib/license_state'; +import type { ILicenseState } from '../lib/license_state'; import { licenseStateMock } from '../lib/license_state.mock'; import { licensingMock } from '@kbn/licensing-plugin/server/mocks'; import { isRuleExportable } from './is_rule_exportable'; import { inMemoryMetricsMock } from '../monitoring/in_memory_metrics.mock'; import { loggingSystemMock } from '@kbn/core/server/mocks'; -import { AlertingConfig } from '../config'; +import type { AlertingConfig } from '../config'; import { RULE_SAVED_OBJECT_TYPE } from '.'; let ruleTypeRegistryParams: ConstructorOptions; diff --git a/x-pack/platform/plugins/shared/alerting/server/saved_objects/is_rule_exportable.ts b/x-pack/platform/plugins/shared/alerting/server/saved_objects/is_rule_exportable.ts index 34339a1fdb388..91e304174c9b7 100644 --- a/x-pack/platform/plugins/shared/alerting/server/saved_objects/is_rule_exportable.ts +++ b/x-pack/platform/plugins/shared/alerting/server/saved_objects/is_rule_exportable.ts @@ -5,9 +5,9 @@ * 2.0. */ -import { Logger, SavedObject } from '@kbn/core/server'; -import { RawRule } from '../types'; -import { RuleTypeRegistry } from '../rule_type_registry'; +import type { Logger, SavedObject } from '@kbn/core/server'; +import type { RawRule } from '../types'; +import type { RuleTypeRegistry } from '../rule_type_registry'; export function isRuleExportable( rule: SavedObject, diff --git a/x-pack/platform/plugins/shared/alerting/server/saved_objects/maintenance_window_mapping.ts b/x-pack/platform/plugins/shared/alerting/server/saved_objects/maintenance_window_mapping.ts index 85759143c39d2..a9f1f0d833a66 100644 --- a/x-pack/platform/plugins/shared/alerting/server/saved_objects/maintenance_window_mapping.ts +++ b/x-pack/platform/plugins/shared/alerting/server/saved_objects/maintenance_window_mapping.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { SavedObjectsTypeMappingDefinition } from '@kbn/core/server'; +import type { SavedObjectsTypeMappingDefinition } from '@kbn/core/server'; export const maintenanceWindowMappings: SavedObjectsTypeMappingDefinition = { dynamic: false, diff --git a/x-pack/platform/plugins/shared/alerting/server/saved_objects/migrations/7.10/index.ts b/x-pack/platform/plugins/shared/alerting/server/saved_objects/migrations/7.10/index.ts index b432ff01618df..984a80c2332c2 100644 --- a/x-pack/platform/plugins/shared/alerting/server/saved_objects/migrations/7.10/index.ts +++ b/x-pack/platform/plugins/shared/alerting/server/saved_objects/migrations/7.10/index.ts @@ -5,9 +5,9 @@ * 2.0. */ -import { SavedObjectUnsanitizedDoc } from '@kbn/core-saved-objects-server'; -import { EncryptedSavedObjectsPluginSetup } from '@kbn/encrypted-saved-objects-plugin/server'; -import { RawRule, RawRuleExecutionStatus } from '../../../types'; +import type { SavedObjectUnsanitizedDoc } from '@kbn/core-saved-objects-server'; +import type { EncryptedSavedObjectsPluginSetup } from '@kbn/encrypted-saved-objects-plugin/server'; +import type { RawRule, RawRuleExecutionStatus } from '../../../types'; import { LEGACY_LAST_MODIFIED_VERSION, SIEM_APP_ID, SIEM_SERVER_APP_ID } from '../constants'; import { createEsoMigration, pipeMigrations } from '../utils'; diff --git a/x-pack/platform/plugins/shared/alerting/server/saved_objects/migrations/7.11/index.ts b/x-pack/platform/plugins/shared/alerting/server/saved_objects/migrations/7.11/index.ts index 29d86b2b2d860..287230971935d 100644 --- a/x-pack/platform/plugins/shared/alerting/server/saved_objects/migrations/7.11/index.ts +++ b/x-pack/platform/plugins/shared/alerting/server/saved_objects/migrations/7.11/index.ts @@ -5,10 +5,10 @@ * 2.0. */ -import { SavedObjectAttributes } from '@kbn/core-saved-objects-server'; -import { SavedObjectUnsanitizedDoc } from '@kbn/core-saved-objects-server'; -import { EncryptedSavedObjectsPluginSetup } from '@kbn/encrypted-saved-objects-plugin/server'; -import { RawRule, RawRuleAction } from '../../../types'; +import type { SavedObjectAttributes } from '@kbn/core-saved-objects-server'; +import type { SavedObjectUnsanitizedDoc } from '@kbn/core-saved-objects-server'; +import type { EncryptedSavedObjectsPluginSetup } from '@kbn/encrypted-saved-objects-plugin/server'; +import type { RawRule, RawRuleAction } from '../../../types'; import { createEsoMigration, pipeMigrations } from '../utils'; const SUPPORT_INCIDENTS_ACTION_TYPES = ['.servicenow', '.jira', '.resilient']; diff --git a/x-pack/platform/plugins/shared/alerting/server/saved_objects/migrations/7.13/index.ts b/x-pack/platform/plugins/shared/alerting/server/saved_objects/migrations/7.13/index.ts index 75848e1a304c4..ace8e075a8090 100644 --- a/x-pack/platform/plugins/shared/alerting/server/saved_objects/migrations/7.13/index.ts +++ b/x-pack/platform/plugins/shared/alerting/server/saved_objects/migrations/7.13/index.ts @@ -5,10 +5,10 @@ * 2.0. */ -import { SavedObjectAttribute } from '@kbn/core-saved-objects-server'; -import { SavedObjectUnsanitizedDoc } from '@kbn/core-saved-objects-server'; -import { EncryptedSavedObjectsPluginSetup } from '@kbn/encrypted-saved-objects-plugin/server'; -import { RawRule } from '../../../types'; +import type { SavedObjectAttribute } from '@kbn/core-saved-objects-server'; +import type { SavedObjectUnsanitizedDoc } from '@kbn/core-saved-objects-server'; +import type { EncryptedSavedObjectsPluginSetup } from '@kbn/encrypted-saved-objects-plugin/server'; +import type { RawRule } from '../../../types'; import { createEsoMigration, isSiemSignalsRuleType, pipeMigrations } from '../utils'; function convertNullToUndefined(attribute: SavedObjectAttribute) { diff --git a/x-pack/platform/plugins/shared/alerting/server/saved_objects/migrations/7.14/index.ts b/x-pack/platform/plugins/shared/alerting/server/saved_objects/migrations/7.14/index.ts index 8a4aa555127ce..f95ddb7650f40 100644 --- a/x-pack/platform/plugins/shared/alerting/server/saved_objects/migrations/7.14/index.ts +++ b/x-pack/platform/plugins/shared/alerting/server/saved_objects/migrations/7.14/index.ts @@ -5,9 +5,9 @@ * 2.0. */ -import { SavedObjectUnsanitizedDoc } from '@kbn/core-saved-objects-server'; -import { EncryptedSavedObjectsPluginSetup } from '@kbn/encrypted-saved-objects-plugin/server'; -import { RawRule } from '../../../types'; +import type { SavedObjectUnsanitizedDoc } from '@kbn/core-saved-objects-server'; +import type { EncryptedSavedObjectsPluginSetup } from '@kbn/encrypted-saved-objects-plugin/server'; +import type { RawRule } from '../../../types'; import { createEsoMigration, isSiemSignalsRuleType, pipeMigrations } from '../utils'; /** diff --git a/x-pack/platform/plugins/shared/alerting/server/saved_objects/migrations/7.15/index.ts b/x-pack/platform/plugins/shared/alerting/server/saved_objects/migrations/7.15/index.ts index e972f7e754f0f..b1ba8a695030f 100644 --- a/x-pack/platform/plugins/shared/alerting/server/saved_objects/migrations/7.15/index.ts +++ b/x-pack/platform/plugins/shared/alerting/server/saved_objects/migrations/7.15/index.ts @@ -5,15 +5,15 @@ * 2.0. */ -import { +import type { SavedObjectAttribute, SavedObjectAttributes, SavedObjectReference, } from '@kbn/core-saved-objects-server'; -import { SavedObjectUnsanitizedDoc } from '@kbn/core-saved-objects-server'; -import { EncryptedSavedObjectsPluginSetup } from '@kbn/encrypted-saved-objects-plugin/server'; +import type { SavedObjectUnsanitizedDoc } from '@kbn/core-saved-objects-server'; +import type { EncryptedSavedObjectsPluginSetup } from '@kbn/encrypted-saved-objects-plugin/server'; import { isString } from 'lodash/fp'; -import { RawRule } from '../../../types'; +import type { RawRule } from '../../../types'; import { createEsoMigration, isSiemSignalsRuleType, pipeMigrations } from '../utils'; /** diff --git a/x-pack/platform/plugins/shared/alerting/server/saved_objects/migrations/7.16/index.ts b/x-pack/platform/plugins/shared/alerting/server/saved_objects/migrations/7.16/index.ts index 992fe8bfa17a9..d3f5181d0cf43 100644 --- a/x-pack/platform/plugins/shared/alerting/server/saved_objects/migrations/7.16/index.ts +++ b/x-pack/platform/plugins/shared/alerting/server/saved_objects/migrations/7.16/index.ts @@ -5,12 +5,12 @@ * 2.0. */ -import { SavedObjectReference } from '@kbn/core-saved-objects-server'; -import { SavedObjectUnsanitizedDoc } from '@kbn/core-saved-objects-server'; -import { EncryptedSavedObjectsPluginSetup } from '@kbn/encrypted-saved-objects-plugin/server'; +import type { SavedObjectReference } from '@kbn/core-saved-objects-server'; +import type { SavedObjectUnsanitizedDoc } from '@kbn/core-saved-objects-server'; +import type { EncryptedSavedObjectsPluginSetup } from '@kbn/encrypted-saved-objects-plugin/server'; import { isString } from 'lodash/fp'; import { RULE_SAVED_OBJECT_TYPE } from '../..'; -import { RawRule, RawRuleAction } from '../../../types'; +import type { RawRule, RawRuleAction } from '../../../types'; import { extractRefsFromGeoContainmentAlert } from '../../geo_containment/migrations'; import { createEsoMigration, isSecuritySolutionLegacyNotification, pipeMigrations } from '../utils'; diff --git a/x-pack/platform/plugins/shared/alerting/server/saved_objects/migrations/8.0/index.ts b/x-pack/platform/plugins/shared/alerting/server/saved_objects/migrations/8.0/index.ts index 5d8efd4585af7..7bd612702044b 100644 --- a/x-pack/platform/plugins/shared/alerting/server/saved_objects/migrations/8.0/index.ts +++ b/x-pack/platform/plugins/shared/alerting/server/saved_objects/migrations/8.0/index.ts @@ -5,10 +5,10 @@ * 2.0. */ -import { SavedObjectUnsanitizedDoc } from '@kbn/core-saved-objects-server'; -import { EncryptedSavedObjectsPluginSetup } from '@kbn/encrypted-saved-objects-plugin/server'; +import type { SavedObjectUnsanitizedDoc } from '@kbn/core-saved-objects-server'; +import type { EncryptedSavedObjectsPluginSetup } from '@kbn/encrypted-saved-objects-plugin/server'; import { isRuleType, ruleTypeMappings } from '@kbn/securitysolution-rules'; -import { RawRule } from '../../../types'; +import type { RawRule } from '../../../types'; import { FILEBEAT_7X_INDICATOR_PATH } from '../constants'; import { createEsoMigration, diff --git a/x-pack/platform/plugins/shared/alerting/server/saved_objects/migrations/8.2/index.ts b/x-pack/platform/plugins/shared/alerting/server/saved_objects/migrations/8.2/index.ts index 9a8967c9556ab..7e817eb8736b9 100644 --- a/x-pack/platform/plugins/shared/alerting/server/saved_objects/migrations/8.2/index.ts +++ b/x-pack/platform/plugins/shared/alerting/server/saved_objects/migrations/8.2/index.ts @@ -5,10 +5,10 @@ * 2.0. */ -import { SavedObjectUnsanitizedDoc } from '@kbn/core-saved-objects-server'; -import { EncryptedSavedObjectsPluginSetup } from '@kbn/encrypted-saved-objects-plugin/server'; +import type { SavedObjectUnsanitizedDoc } from '@kbn/core-saved-objects-server'; +import type { EncryptedSavedObjectsPluginSetup } from '@kbn/encrypted-saved-objects-plugin/server'; import { getMappedParams } from '../../../rules_client/common'; -import { RawRule } from '../../../types'; +import type { RawRule } from '../../../types'; import { createEsoMigration, pipeMigrations } from '../utils'; function addMappedParams( diff --git a/x-pack/platform/plugins/shared/alerting/server/saved_objects/migrations/8.3/index.ts b/x-pack/platform/plugins/shared/alerting/server/saved_objects/migrations/8.3/index.ts index ba083773e5a9a..24ab5300b242f 100644 --- a/x-pack/platform/plugins/shared/alerting/server/saved_objects/migrations/8.3/index.ts +++ b/x-pack/platform/plugins/shared/alerting/server/saved_objects/migrations/8.3/index.ts @@ -5,11 +5,11 @@ * 2.0. */ -import { SavedObjectUnsanitizedDoc } from '@kbn/core-saved-objects-server'; -import { EncryptedSavedObjectsPluginSetup } from '@kbn/encrypted-saved-objects-plugin/server'; +import type { SavedObjectUnsanitizedDoc } from '@kbn/core-saved-objects-server'; +import type { EncryptedSavedObjectsPluginSetup } from '@kbn/encrypted-saved-objects-plugin/server'; import { omit } from 'lodash'; import moment from 'moment-timezone'; -import { RawRule } from '../../../types'; +import type { RawRule } from '../../../types'; import { createEsoMigration, isDetectionEngineAADRuleType, diff --git a/x-pack/platform/plugins/shared/alerting/server/saved_objects/migrations/8.4/index.ts b/x-pack/platform/plugins/shared/alerting/server/saved_objects/migrations/8.4/index.ts index 3a02425a7c194..10eab7bc27df6 100644 --- a/x-pack/platform/plugins/shared/alerting/server/saved_objects/migrations/8.4/index.ts +++ b/x-pack/platform/plugins/shared/alerting/server/saved_objects/migrations/8.4/index.ts @@ -5,10 +5,10 @@ * 2.0. */ -import { SavedObjectUnsanitizedDoc } from '@kbn/core-saved-objects-server'; -import { EncryptedSavedObjectsPluginSetup } from '@kbn/encrypted-saved-objects-plugin/server'; +import type { SavedObjectUnsanitizedDoc } from '@kbn/core-saved-objects-server'; +import type { EncryptedSavedObjectsPluginSetup } from '@kbn/encrypted-saved-objects-plugin/server'; import { omit } from 'lodash'; -import { RawRule } from '../../../types'; +import type { RawRule } from '../../../types'; import { createEsoMigration, pipeMigrations } from '../utils'; function removeIsSnoozedUntil( diff --git a/x-pack/platform/plugins/shared/alerting/server/saved_objects/migrations/8.5/index.ts b/x-pack/platform/plugins/shared/alerting/server/saved_objects/migrations/8.5/index.ts index a40bcafd0bf35..b317c5e161e30 100644 --- a/x-pack/platform/plugins/shared/alerting/server/saved_objects/migrations/8.5/index.ts +++ b/x-pack/platform/plugins/shared/alerting/server/saved_objects/migrations/8.5/index.ts @@ -5,16 +5,16 @@ * 2.0. */ -import { +import type { SavedObjectMigrationContext, SavedObjectUnsanitizedDoc, } from '@kbn/core-saved-objects-server'; -import { EncryptedSavedObjectsPluginSetup } from '@kbn/encrypted-saved-objects-plugin/server'; +import type { EncryptedSavedObjectsPluginSetup } from '@kbn/encrypted-saved-objects-plugin/server'; import { isSerializedSearchSource } from '@kbn/data-plugin/common'; import { pick } from 'lodash'; -import { RawRule } from '../../../types'; +import type { RawRule } from '../../../types'; import { createEsoMigration, isEsQueryRuleType, pipeMigrations } from '../utils'; -import { AlertLogMeta } from '../types'; +import type { AlertLogMeta } from '../types'; function stripOutRuntimeFieldsInOldESQuery( doc: SavedObjectUnsanitizedDoc, diff --git a/x-pack/platform/plugins/shared/alerting/server/saved_objects/migrations/8.6/index.ts b/x-pack/platform/plugins/shared/alerting/server/saved_objects/migrations/8.6/index.ts index b3d362fc4dd77..3a119d2d1c35b 100644 --- a/x-pack/platform/plugins/shared/alerting/server/saved_objects/migrations/8.6/index.ts +++ b/x-pack/platform/plugins/shared/alerting/server/saved_objects/migrations/8.6/index.ts @@ -5,10 +5,11 @@ * 2.0. */ -import { SavedObjectUnsanitizedDoc } from '@kbn/core-saved-objects-server'; -import { EncryptedSavedObjectsPluginSetup } from '@kbn/encrypted-saved-objects-plugin/server'; +import type { SavedObjectUnsanitizedDoc } from '@kbn/core-saved-objects-server'; +import type { EncryptedSavedObjectsPluginSetup } from '@kbn/encrypted-saved-objects-plugin/server'; import { createEsoMigration, pipeMigrations } from '../utils'; -import { RawRule, RuleLastRunOutcomeValues } from '../../../types'; +import type { RawRule } from '../../../types'; +import { RuleLastRunOutcomeValues } from '../../../types'; import { getDefaultMonitoring } from '../../../lib/monitoring'; const succeededStatus = ['ok', 'active', 'succeeded']; diff --git a/x-pack/platform/plugins/shared/alerting/server/saved_objects/migrations/8.7/index.ts b/x-pack/platform/plugins/shared/alerting/server/saved_objects/migrations/8.7/index.ts index 1b49f606cb6b5..2f7e59ddc9d41 100644 --- a/x-pack/platform/plugins/shared/alerting/server/saved_objects/migrations/8.7/index.ts +++ b/x-pack/platform/plugins/shared/alerting/server/saved_objects/migrations/8.7/index.ts @@ -5,8 +5,8 @@ * 2.0. */ -import { SavedObjectUnsanitizedDoc } from '@kbn/core-saved-objects-server'; -import { EncryptedSavedObjectsPluginSetup } from '@kbn/encrypted-saved-objects-plugin/server'; +import type { SavedObjectUnsanitizedDoc } from '@kbn/core-saved-objects-server'; +import type { EncryptedSavedObjectsPluginSetup } from '@kbn/encrypted-saved-objects-plugin/server'; import { extractedSavedObjectParamReferenceNamePrefix } from '../../../rules_client/common/constants'; import { createEsoMigration, @@ -14,7 +14,8 @@ import { isLogThresholdRuleType, pipeMigrations, } from '../utils'; -import { RawRule, RuleLastRunOutcomeOrderMap } from '../../../types'; +import type { RawRule } from '../../../types'; +import { RuleLastRunOutcomeOrderMap } from '../../../types'; function addGroupByToEsQueryRule( doc: SavedObjectUnsanitizedDoc diff --git a/x-pack/platform/plugins/shared/alerting/server/saved_objects/migrations/8.8/index.ts b/x-pack/platform/plugins/shared/alerting/server/saved_objects/migrations/8.8/index.ts index 24629a3a146bd..cc08202ced852 100644 --- a/x-pack/platform/plugins/shared/alerting/server/saved_objects/migrations/8.8/index.ts +++ b/x-pack/platform/plugins/shared/alerting/server/saved_objects/migrations/8.8/index.ts @@ -5,11 +5,11 @@ * 2.0. */ -import { SavedObjectUnsanitizedDoc } from '@kbn/core-saved-objects-server'; -import { EncryptedSavedObjectsPluginSetup } from '@kbn/encrypted-saved-objects-plugin/server'; +import type { SavedObjectUnsanitizedDoc } from '@kbn/core-saved-objects-server'; +import type { EncryptedSavedObjectsPluginSetup } from '@kbn/encrypted-saved-objects-plugin/server'; import { v4 as uuidv4 } from 'uuid'; import { createEsoMigration, isDetectionEngineAADRuleType, pipeMigrations } from '../utils'; -import { RawRule } from '../../../types'; +import type { RawRule } from '../../../types'; import { transformToAlertThrottle } from '../../../rules_client/lib/siem_legacy_actions/transform_to_alert_throttle'; import { transformToNotifyWhen } from '../../../rules_client/lib/siem_legacy_actions/transform_to_notify_when'; diff --git a/x-pack/platform/plugins/shared/alerting/server/saved_objects/migrations/index.test.ts b/x-pack/platform/plugins/shared/alerting/server/saved_objects/migrations/index.test.ts index 566911f00171d..69fda1506089d 100644 --- a/x-pack/platform/plugins/shared/alerting/server/saved_objects/migrations/index.test.ts +++ b/x-pack/platform/plugins/shared/alerting/server/saved_objects/migrations/index.test.ts @@ -8,12 +8,13 @@ import sinon from 'sinon'; import { v4 as uuidv4 } from 'uuid'; import { getMigrations } from '.'; -import { RawRule, RawRuleAction } from '../../types'; -import { SavedObjectMigrationContext, SavedObjectUnsanitizedDoc } from '@kbn/core/server'; +import type { RawRule, RawRuleAction } from '../../types'; +import type { SavedObjectMigrationContext, SavedObjectUnsanitizedDoc } from '@kbn/core/server'; import { encryptedSavedObjectsMock } from '@kbn/encrypted-saved-objects-plugin/server/mocks'; import { migrationMocks } from '@kbn/core/server/mocks'; import { SavedObjectsUtils } from '@kbn/core-saved-objects-utils-server'; -import { RuleType, ruleTypeMappings } from '@kbn/securitysolution-rules'; +import type { RuleType } from '@kbn/securitysolution-rules'; +import { ruleTypeMappings } from '@kbn/securitysolution-rules'; import { isAnyActionSupportIncidents } from './7.11'; import { RULE_SAVED_OBJECT_TYPE } from '..'; @@ -3173,7 +3174,7 @@ function getUpdatedAt(): string { function getMockData( overwrites: Record = {}, - withSavedObjectUpdatedAt: boolean = false + withSavedObjectUpdatedAt = false ): SavedObjectUnsanitizedDoc> { return { attributes: { diff --git a/x-pack/platform/plugins/shared/alerting/server/saved_objects/migrations/index.ts b/x-pack/platform/plugins/shared/alerting/server/saved_objects/migrations/index.ts index 613feffa062d1..d2c7107412b52 100644 --- a/x-pack/platform/plugins/shared/alerting/server/saved_objects/migrations/index.ts +++ b/x-pack/platform/plugins/shared/alerting/server/saved_objects/migrations/index.ts @@ -6,18 +6,19 @@ */ import { gte } from 'semver'; -import { +import type { SavedObjectMigrationMap, SavedObjectUnsanitizedDoc, SavedObjectMigrationFn, SavedObjectMigrationContext, } from '@kbn/core/server'; -import { EncryptedSavedObjectsPluginSetup } from '@kbn/encrypted-saved-objects-plugin/server'; -import { MigrateFunctionsObject, MigrateFunction } from '@kbn/kibana-utils-plugin/common'; +import type { EncryptedSavedObjectsPluginSetup } from '@kbn/encrypted-saved-objects-plugin/server'; +import type { MigrateFunctionsObject, MigrateFunction } from '@kbn/kibana-utils-plugin/common'; import { mergeSavedObjectMigrationMaps } from '@kbn/core/server'; -import { isSerializedSearchSource, SerializedSearchSourceFields } from '@kbn/data-plugin/common'; -import { Serializable } from '@kbn/utility-types'; -import { RawRule } from '../../types'; +import type { SerializedSearchSourceFields } from '@kbn/data-plugin/common'; +import { isSerializedSearchSource } from '@kbn/data-plugin/common'; +import type { Serializable } from '@kbn/utility-types'; +import type { RawRule } from '../../types'; import { getMigrations7100 } from './7.10'; import { getMigrations7110, getMigrations7112 } from './7.11'; import { getMigrations7130 } from './7.13'; @@ -32,7 +33,7 @@ import { getMigrations850 } from './8.5'; import { getMigrations860 } from './8.6'; import { getMigrations870 } from './8.7'; import { getMigrations880 } from './8.8'; -import { AlertLogMeta, AlertMigration } from './types'; +import type { AlertLogMeta, AlertMigration } from './types'; import { MINIMUM_SS_MIGRATION_VERSION } from './constants'; import { createEsoMigration, isEsQueryRuleType, pipeMigrations } from './utils'; diff --git a/x-pack/platform/plugins/shared/alerting/server/saved_objects/migrations/types.ts b/x-pack/platform/plugins/shared/alerting/server/saved_objects/migrations/types.ts index 6d657e168187e..1bb6e6244e31c 100644 --- a/x-pack/platform/plugins/shared/alerting/server/saved_objects/migrations/types.ts +++ b/x-pack/platform/plugins/shared/alerting/server/saved_objects/migrations/types.ts @@ -5,8 +5,12 @@ * 2.0. */ -import { LogMeta, SavedObjectMigrationContext, SavedObjectUnsanitizedDoc } from '@kbn/core/server'; -import { RawRule } from '../../types'; +import type { + LogMeta, + SavedObjectMigrationContext, + SavedObjectUnsanitizedDoc, +} from '@kbn/core/server'; +import type { RawRule } from '../../types'; export interface AlertLogMeta extends LogMeta { migrations: { alertDocument: SavedObjectUnsanitizedDoc }; diff --git a/x-pack/platform/plugins/shared/alerting/server/saved_objects/migrations/utils.ts b/x-pack/platform/plugins/shared/alerting/server/saved_objects/migrations/utils.ts index e21868b9631f0..e6b9d8a9b2895 100644 --- a/x-pack/platform/plugins/shared/alerting/server/saved_objects/migrations/utils.ts +++ b/x-pack/platform/plugins/shared/alerting/server/saved_objects/migrations/utils.ts @@ -6,14 +6,14 @@ */ import { ruleTypeMappings } from '@kbn/securitysolution-rules'; -import { +import type { SavedObjectMigrationContext, SavedObjectUnsanitizedDoc, } from '@kbn/core-saved-objects-server'; -import { EncryptedSavedObjectsPluginSetup } from '@kbn/encrypted-saved-objects-plugin/server'; +import type { EncryptedSavedObjectsPluginSetup } from '@kbn/encrypted-saved-objects-plugin/server'; import type { IsMigrationNeededPredicate } from '@kbn/encrypted-saved-objects-plugin/server'; -import { RawRule } from '../../types'; +import type { RawRule } from '../../types'; type AlertMigration = ( doc: SavedObjectUnsanitizedDoc, diff --git a/x-pack/platform/plugins/shared/alerting/server/saved_objects/model_versions/ad_hoc_run_params_model_versions.ts b/x-pack/platform/plugins/shared/alerting/server/saved_objects/model_versions/ad_hoc_run_params_model_versions.ts index 91a8418a42a37..e82f665e6854b 100644 --- a/x-pack/platform/plugins/shared/alerting/server/saved_objects/model_versions/ad_hoc_run_params_model_versions.ts +++ b/x-pack/platform/plugins/shared/alerting/server/saved_objects/model_versions/ad_hoc_run_params_model_versions.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { SavedObjectsModelVersionMap } from '@kbn/core-saved-objects-server'; +import type { SavedObjectsModelVersionMap } from '@kbn/core-saved-objects-server'; import { rawAdHocRunParamsSchemaV1, rawAdHocRunParamsSchemaV2, diff --git a/x-pack/platform/plugins/shared/alerting/server/saved_objects/model_versions/api_key_pending_invalidation_model_versions.ts b/x-pack/platform/plugins/shared/alerting/server/saved_objects/model_versions/api_key_pending_invalidation_model_versions.ts index 0d6456a9b155a..e08fe9c16e384 100644 --- a/x-pack/platform/plugins/shared/alerting/server/saved_objects/model_versions/api_key_pending_invalidation_model_versions.ts +++ b/x-pack/platform/plugins/shared/alerting/server/saved_objects/model_versions/api_key_pending_invalidation_model_versions.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { SavedObjectsModelVersionMap } from '@kbn/core-saved-objects-server'; +import type { SavedObjectsModelVersionMap } from '@kbn/core-saved-objects-server'; import { rawApiKeyPendingInvalidationSchemaV1 } from '../schemas/raw_api_key_pending_invalidation'; export const apiKeyPendingInvalidationModelVersions: SavedObjectsModelVersionMap = { diff --git a/x-pack/platform/plugins/shared/alerting/server/saved_objects/model_versions/maintenance_window_model_versions.ts b/x-pack/platform/plugins/shared/alerting/server/saved_objects/model_versions/maintenance_window_model_versions.ts index f7ea00e62880e..95708ebf8f133 100644 --- a/x-pack/platform/plugins/shared/alerting/server/saved_objects/model_versions/maintenance_window_model_versions.ts +++ b/x-pack/platform/plugins/shared/alerting/server/saved_objects/model_versions/maintenance_window_model_versions.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { SavedObjectsModelVersionMap } from '@kbn/core-saved-objects-server'; +import type { SavedObjectsModelVersionMap } from '@kbn/core-saved-objects-server'; import { rawMaintenanceWindowSchemaV1 } from '../schemas/raw_maintenance_window'; export const maintenanceWindowModelVersions: SavedObjectsModelVersionMap = { diff --git a/x-pack/platform/plugins/shared/alerting/server/saved_objects/model_versions/rule_model_versions.ts b/x-pack/platform/plugins/shared/alerting/server/saved_objects/model_versions/rule_model_versions.ts index ab976cb49ad9e..1d1ce3f6ad828 100644 --- a/x-pack/platform/plugins/shared/alerting/server/saved_objects/model_versions/rule_model_versions.ts +++ b/x-pack/platform/plugins/shared/alerting/server/saved_objects/model_versions/rule_model_versions.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { SavedObjectsModelVersionMap } from '@kbn/core-saved-objects-server'; +import type { SavedObjectsModelVersionMap } from '@kbn/core-saved-objects-server'; import { rawRuleSchemaV1, rawRuleSchemaV2, diff --git a/x-pack/platform/plugins/shared/alerting/server/saved_objects/model_versions/rules_settings_model_versions.ts b/x-pack/platform/plugins/shared/alerting/server/saved_objects/model_versions/rules_settings_model_versions.ts index 323238c43c01c..e2a17bde76295 100644 --- a/x-pack/platform/plugins/shared/alerting/server/saved_objects/model_versions/rules_settings_model_versions.ts +++ b/x-pack/platform/plugins/shared/alerting/server/saved_objects/model_versions/rules_settings_model_versions.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { SavedObjectsModelVersionMap } from '@kbn/core-saved-objects-server'; +import type { SavedObjectsModelVersionMap } from '@kbn/core-saved-objects-server'; import { rawRulesSettingsSchemaV1 } from '../schemas/raw_rules_settings'; export const rulesSettingsModelVersions: SavedObjectsModelVersionMap = { diff --git a/x-pack/platform/plugins/shared/alerting/server/saved_objects/partially_update_rule.test.ts b/x-pack/platform/plugins/shared/alerting/server/saved_objects/partially_update_rule.test.ts index 444fa322012b1..0dfce671d8eb5 100644 --- a/x-pack/platform/plugins/shared/alerting/server/saved_objects/partially_update_rule.test.ts +++ b/x-pack/platform/plugins/shared/alerting/server/saved_objects/partially_update_rule.test.ts @@ -5,22 +5,15 @@ * 2.0. */ -import { - SavedObjectsClientContract, - ISavedObjectsRepository, - SavedObjectsErrorHelpers, -} from '@kbn/core/server'; -import { - PartiallyUpdateableRuleAttributes, - partiallyUpdateRule, - partiallyUpdateRuleWithEs, -} from './partially_update_rule'; +import type { SavedObjectsClientContract, ISavedObjectsRepository } from '@kbn/core/server'; +import { SavedObjectsErrorHelpers } from '@kbn/core/server'; +import type { PartiallyUpdateableRuleAttributes } from './partially_update_rule'; +import { partiallyUpdateRule, partiallyUpdateRuleWithEs } from './partially_update_rule'; import { elasticsearchServiceMock, savedObjectsClientMock } from '@kbn/core/server/mocks'; import { RULE_SAVED_OBJECT_TYPE } from '.'; import { ALERTING_CASES_SAVED_OBJECT_INDEX } from '@kbn/core-saved-objects-server'; import type { estypes } from '@elastic/elasticsearch'; -import { RuleExecutionStatuses } from '@kbn/alerting-types'; - +import type { RuleExecutionStatuses } from '@kbn/alerting-types'; const MockSavedObjectsClientContract = savedObjectsClientMock.create(); const MockISavedObjectsRepository = MockSavedObjectsClientContract as unknown as jest.Mocked; diff --git a/x-pack/platform/plugins/shared/alerting/server/saved_objects/partially_update_rule.ts b/x-pack/platform/plugins/shared/alerting/server/saved_objects/partially_update_rule.ts index 4ef0779707536..a52ec70c74755 100644 --- a/x-pack/platform/plugins/shared/alerting/server/saved_objects/partially_update_rule.ts +++ b/x-pack/platform/plugins/shared/alerting/server/saved_objects/partially_update_rule.ts @@ -6,22 +6,18 @@ */ import { omit, pick } from 'lodash'; -import { +import type { ElasticsearchClient, SavedObjectsClient, - SavedObjectsErrorHelpers, SavedObjectsUpdateOptions, } from '@kbn/core/server'; +import { SavedObjectsErrorHelpers } from '@kbn/core/server'; import { decodeRequestVersion } from '@kbn/core-saved-objects-base-server-internal'; import { ALERTING_CASES_SAVED_OBJECT_INDEX } from '@kbn/core-saved-objects-server'; -import { RawRule } from '../types'; +import type { RawRule } from '../types'; -import { - RuleAttributesToEncrypt, - RuleAttributesIncludedInAAD, - RuleAttributesNotPartiallyUpdatable, - RULE_SAVED_OBJECT_TYPE, -} from '.'; +import type { RuleAttributesNotPartiallyUpdatable } from '.'; +import { RuleAttributesToEncrypt, RuleAttributesIncludedInAAD, RULE_SAVED_OBJECT_TYPE } from '.'; export type PartiallyUpdateableRuleAttributes = Partial< Omit diff --git a/x-pack/platform/plugins/shared/alerting/server/saved_objects/rrule_mappings_field.ts b/x-pack/platform/plugins/shared/alerting/server/saved_objects/rrule_mappings_field.ts index 5e9d7414a432d..20624fdf42773 100644 --- a/x-pack/platform/plugins/shared/alerting/server/saved_objects/rrule_mappings_field.ts +++ b/x-pack/platform/plugins/shared/alerting/server/saved_objects/rrule_mappings_field.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { SavedObjectsFieldMapping } from '@kbn/core/server'; +import type { SavedObjectsFieldMapping } from '@kbn/core/server'; export const rRuleMappingsField: SavedObjectsFieldMapping = { type: 'nested', diff --git a/x-pack/platform/plugins/shared/alerting/server/saved_objects/rules_settings_mappings.ts b/x-pack/platform/plugins/shared/alerting/server/saved_objects/rules_settings_mappings.ts index 3f363a39e35fa..1b8a7519a25d1 100644 --- a/x-pack/platform/plugins/shared/alerting/server/saved_objects/rules_settings_mappings.ts +++ b/x-pack/platform/plugins/shared/alerting/server/saved_objects/rules_settings_mappings.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { SavedObjectsTypeMappingDefinition } from '@kbn/core/server'; +import type { SavedObjectsTypeMappingDefinition } from '@kbn/core/server'; export const rulesSettingsMappings: SavedObjectsTypeMappingDefinition = { dynamic: false, diff --git a/x-pack/platform/plugins/shared/alerting/server/saved_objects/schemas/raw_ad_hoc_run_params/latest.ts b/x-pack/platform/plugins/shared/alerting/server/saved_objects/schemas/raw_ad_hoc_run_params/latest.ts index 03c55b706231d..eed02833d654c 100644 --- a/x-pack/platform/plugins/shared/alerting/server/saved_objects/schemas/raw_ad_hoc_run_params/latest.ts +++ b/x-pack/platform/plugins/shared/alerting/server/saved_objects/schemas/raw_ad_hoc_run_params/latest.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { TypeOf } from '@kbn/config-schema'; -import { rawAdHocRunParamsSchema } from './v2'; +import type { TypeOf } from '@kbn/config-schema'; +import type { rawAdHocRunParamsSchema } from './v2'; export type RawAdHocRunParams = TypeOf; diff --git a/x-pack/platform/plugins/shared/alerting/server/saved_objects/schemas/raw_rule/latest.ts b/x-pack/platform/plugins/shared/alerting/server/saved_objects/schemas/raw_rule/latest.ts index 843ac3d0bd02a..35d60b9c39ffb 100644 --- a/x-pack/platform/plugins/shared/alerting/server/saved_objects/schemas/raw_rule/latest.ts +++ b/x-pack/platform/plugins/shared/alerting/server/saved_objects/schemas/raw_rule/latest.ts @@ -4,16 +4,16 @@ * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ -import { TypeOf } from '@kbn/config-schema'; +import type { TypeOf } from '@kbn/config-schema'; -import { +import type { rawRuleExecutionStatusSchema, rawRuleActionSchema, rawRuleAlertsFilterSchema, rawRuleLastRunSchema, } from './v3'; -import { rawRuleMonitoringSchema, rawRuleSchema } from './v4'; +import type { rawRuleMonitoringSchema, rawRuleSchema } from './v4'; type Mutable = { -readonly [P in keyof T]: T[P] extends object ? Mutable : T[P] }; diff --git a/x-pack/platform/plugins/shared/alerting/server/saved_objects/transform_rule_for_export.ts b/x-pack/platform/plugins/shared/alerting/server/saved_objects/transform_rule_for_export.ts index 9e1c78cbe04cf..73ad71fb013c9 100644 --- a/x-pack/platform/plugins/shared/alerting/server/saved_objects/transform_rule_for_export.ts +++ b/x-pack/platform/plugins/shared/alerting/server/saved_objects/transform_rule_for_export.ts @@ -5,9 +5,9 @@ * 2.0. */ -import { SavedObject } from '@kbn/core/server'; +import type { SavedObject } from '@kbn/core/server'; import { getRuleExecutionStatusPendingAttributes } from '../lib/rule_execution_status'; -import { RawRule } from '../types'; +import type { RawRule } from '../types'; export function transformRulesForExport(rules: SavedObject[]): Array> { const exportDate = new Date().toISOString(); diff --git a/x-pack/platform/plugins/shared/alerting/server/task_runner/action_scheduler/action_scheduler.test.ts b/x-pack/platform/plugins/shared/alerting/server/task_runner/action_scheduler/action_scheduler.test.ts index 9812fae074f41..8673f537d1c13 100644 --- a/x-pack/platform/plugins/shared/alerting/server/task_runner/action_scheduler/action_scheduler.test.ts +++ b/x-pack/platform/plugins/shared/alerting/server/task_runner/action_scheduler/action_scheduler.test.ts @@ -14,15 +14,13 @@ import { } from '@kbn/actions-plugin/server/mocks'; import { ActionsCompletion } from '@kbn/alerting-state-types'; import { ALERT_UUID } from '@kbn/rule-data-utils'; -import { InjectActionParamsOpts, injectActionParams } from '../inject_action_params'; -import { RuleTypeParams, SanitizedRule, GetViewInAppRelativeUrlFnOpts } from '../../types'; +import type { InjectActionParamsOpts } from '../inject_action_params'; +import { injectActionParams } from '../inject_action_params'; +import type { RuleTypeParams, SanitizedRule, GetViewInAppRelativeUrlFnOpts } from '../../types'; import { RuleRunMetricsStore } from '../../lib/rule_run_metrics_store'; import { alertingEventLoggerMock } from '../../lib/alerting_event_logger/alerting_event_logger.mock'; -import { - ConcreteTaskInstance, - TaskErrorSource, - TaskPriority, -} from '@kbn/task-manager-plugin/server'; +import type { ConcreteTaskInstance } from '@kbn/task-manager-plugin/server'; +import { TaskErrorSource, TaskPriority } from '@kbn/task-manager-plugin/server'; import { RuleNotifyWhen } from '../../../common'; import { asSavedObjectExecutionSource } from '@kbn/actions-plugin/server'; import sinon from 'sinon'; diff --git a/x-pack/platform/plugins/shared/alerting/server/task_runner/action_scheduler/action_scheduler.ts b/x-pack/platform/plugins/shared/alerting/server/task_runner/action_scheduler/action_scheduler.ts index 639023148d211..d58beec2f121c 100644 --- a/x-pack/platform/plugins/shared/alerting/server/task_runner/action_scheduler/action_scheduler.ts +++ b/x-pack/platform/plugins/shared/alerting/server/task_runner/action_scheduler/action_scheduler.ts @@ -6,16 +6,14 @@ */ import { createTaskRunError, TaskErrorSource } from '@kbn/task-manager-plugin/server'; -import { - ExecutionResponseItem, - ExecutionResponseType, -} from '@kbn/actions-plugin/server/create_execute_function'; +import type { ExecutionResponseItem } from '@kbn/actions-plugin/server/create_execute_function'; +import { ExecutionResponseType } from '@kbn/actions-plugin/server/create_execute_function'; import { ActionsCompletion } from '@kbn/alerting-state-types'; import { chunk } from 'lodash'; -import { ThrottledActions } from '../../types'; -import { ActionSchedulerOptions, ActionsToSchedule, IActionScheduler } from './types'; -import { Alert } from '../../alert'; -import { +import type { ThrottledActions } from '../../types'; +import type { ActionSchedulerOptions, ActionsToSchedule, IActionScheduler } from './types'; +import type { Alert } from '../../alert'; +import type { AlertInstanceContext, AlertInstanceState, RuleTypeParams, @@ -119,7 +117,7 @@ export class ActionScheduler< } const actionsToNotLog: string[] = []; - if (!!bulkScheduleResponse.length) { + if (bulkScheduleResponse.length) { for (const r of bulkScheduleResponse) { if (r.response === ExecutionResponseType.QUEUED_ACTIONS_LIMIT_ERROR) { this.context.ruleRunMetricsStore.setHasReachedQueuedActionsLimit(true); @@ -150,7 +148,7 @@ export class ActionScheduler< (result) => result.actionToLog.uuid && !actionsToNotLog.includes(result.actionToLog.uuid) ); - if (!!actionsToLog.length) { + if (actionsToLog.length) { for (const action of actionsToLog) { this.context.alertingEventLogger.logAction(action.actionToLog); } diff --git a/x-pack/platform/plugins/shared/alerting/server/task_runner/action_scheduler/lib/build_rule_url.ts b/x-pack/platform/plugins/shared/alerting/server/task_runner/action_scheduler/lib/build_rule_url.ts index 3f828709ee940..aad63380028ac 100644 --- a/x-pack/platform/plugins/shared/alerting/server/task_runner/action_scheduler/lib/build_rule_url.ts +++ b/x-pack/platform/plugins/shared/alerting/server/task_runner/action_scheduler/lib/build_rule_url.ts @@ -5,11 +5,11 @@ * 2.0. */ -import { Logger } from '@kbn/logging'; -import { RuleTypeParams } from '@kbn/alerting-types'; +import type { Logger } from '@kbn/logging'; +import type { RuleTypeParams } from '@kbn/alerting-types'; import { getRuleDetailsRoute, triggersActionsRoute } from '@kbn/rule-data-utils'; -import { GetViewInAppRelativeUrlFn } from '../../../types'; -import { ActionSchedulerRule } from '../types'; +import type { GetViewInAppRelativeUrlFn } from '../../../types'; +import type { ActionSchedulerRule } from '../types'; interface BuildRuleUrlOpts { end?: number; diff --git a/x-pack/platform/plugins/shared/alerting/server/task_runner/action_scheduler/lib/format_action_to_enqueue.ts b/x-pack/platform/plugins/shared/alerting/server/task_runner/action_scheduler/lib/format_action_to_enqueue.ts index 763d653688085..e7dc7f9bd9603 100644 --- a/x-pack/platform/plugins/shared/alerting/server/task_runner/action_scheduler/lib/format_action_to_enqueue.ts +++ b/x-pack/platform/plugins/shared/alerting/server/task_runner/action_scheduler/lib/format_action_to_enqueue.ts @@ -5,9 +5,9 @@ * 2.0. */ -import { RuleAction, RuleSystemAction } from '@kbn/alerting-types'; +import type { RuleAction, RuleSystemAction } from '@kbn/alerting-types'; import { asSavedObjectExecutionSource } from '@kbn/actions-plugin/server'; -import { TaskPriority } from '@kbn/task-manager-plugin/server'; +import type { TaskPriority } from '@kbn/task-manager-plugin/server'; import { RULE_SAVED_OBJECT_TYPE } from '../../..'; interface FormatActionToEnqueueOpts { diff --git a/x-pack/platform/plugins/shared/alerting/server/task_runner/action_scheduler/lib/get_summarized_alerts.ts b/x-pack/platform/plugins/shared/alerting/server/task_runner/action_scheduler/lib/get_summarized_alerts.ts index 56d9c08c8b98f..9832952692005 100644 --- a/x-pack/platform/plugins/shared/alerting/server/task_runner/action_scheduler/lib/get_summarized_alerts.ts +++ b/x-pack/platform/plugins/shared/alerting/server/task_runner/action_scheduler/lib/get_summarized_alerts.ts @@ -7,8 +7,8 @@ import { ALERT_UUID } from '@kbn/rule-data-utils'; import { createTaskRunError, TaskErrorSource } from '@kbn/task-manager-plugin/server'; -import { GetSummarizedAlertsParams, IAlertsClient } from '../../../alerts_client/types'; -import { +import type { GetSummarizedAlertsParams, IAlertsClient } from '../../../alerts_client/types'; +import type { AlertInstanceContext, AlertInstanceState, CombinedSummarizedAlerts, diff --git a/x-pack/platform/plugins/shared/alerting/server/task_runner/action_scheduler/lib/rule_action_helper.test.ts b/x-pack/platform/plugins/shared/alerting/server/task_runner/action_scheduler/lib/rule_action_helper.test.ts index 1adb68a951351..07b3b39985e7f 100644 --- a/x-pack/platform/plugins/shared/alerting/server/task_runner/action_scheduler/lib/rule_action_helper.test.ts +++ b/x-pack/platform/plugins/shared/alerting/server/task_runner/action_scheduler/lib/rule_action_helper.test.ts @@ -5,9 +5,9 @@ * 2.0. */ -import { Logger } from '@kbn/logging'; +import type { Logger } from '@kbn/logging'; import { loggingSystemMock } from '@kbn/core/server/mocks'; -import { RuleAction } from '../../../types'; +import type { RuleAction } from '../../../types'; import { generateActionHash, getSummaryActionsFromTaskState, diff --git a/x-pack/platform/plugins/shared/alerting/server/task_runner/action_scheduler/lib/rule_action_helper.ts b/x-pack/platform/plugins/shared/alerting/server/task_runner/action_scheduler/lib/rule_action_helper.ts index c3ef79b3086d8..672d5ca7042ad 100644 --- a/x-pack/platform/plugins/shared/alerting/server/task_runner/action_scheduler/lib/rule_action_helper.ts +++ b/x-pack/platform/plugins/shared/alerting/server/task_runner/action_scheduler/lib/rule_action_helper.ts @@ -5,14 +5,9 @@ * 2.0. */ -import { Logger } from '@kbn/logging'; -import { - IntervalSchedule, - parseDuration, - RuleAction, - RuleNotifyWhenTypeValues, - ThrottledActions, -} from '../../../../common'; +import type { Logger } from '@kbn/logging'; +import type { IntervalSchedule, RuleAction, ThrottledActions } from '../../../../common'; +import { parseDuration, RuleNotifyWhenTypeValues } from '../../../../common'; export const isSummaryAction = (action?: RuleAction) => { return action?.frequency?.summary ?? false; diff --git a/x-pack/platform/plugins/shared/alerting/server/task_runner/action_scheduler/lib/should_schedule_action.ts b/x-pack/platform/plugins/shared/alerting/server/task_runner/action_scheduler/lib/should_schedule_action.ts index 99fa3c42ad3df..e27963109f444 100644 --- a/x-pack/platform/plugins/shared/alerting/server/task_runner/action_scheduler/lib/should_schedule_action.ts +++ b/x-pack/platform/plugins/shared/alerting/server/task_runner/action_scheduler/lib/should_schedule_action.ts @@ -5,11 +5,11 @@ * 2.0. */ -import { Logger } from '@kbn/logging'; +import type { Logger } from '@kbn/logging'; import { ActionsCompletion } from '@kbn/alerting-state-types'; -import { RuleAction, RuleSystemAction } from '@kbn/alerting-types'; -import { RuleRunMetricsStore } from '../../../lib/rule_run_metrics_store'; -import { ActionsConfigMap } from '../../../lib/get_actions_config_map'; +import type { RuleAction, RuleSystemAction } from '@kbn/alerting-types'; +import type { RuleRunMetricsStore } from '../../../lib/rule_run_metrics_store'; +import type { ActionsConfigMap } from '../../../lib/get_actions_config_map'; interface ShouldScheduleActionOpts { action: RuleAction | RuleSystemAction; diff --git a/x-pack/platform/plugins/shared/alerting/server/task_runner/action_scheduler/schedulers/per_alert_action_scheduler.test.ts b/x-pack/platform/plugins/shared/alerting/server/task_runner/action_scheduler/schedulers/per_alert_action_scheduler.test.ts index cc325a2e69a42..820138717afa1 100644 --- a/x-pack/platform/plugins/shared/alerting/server/task_runner/action_scheduler/schedulers/per_alert_action_scheduler.test.ts +++ b/x-pack/platform/plugins/shared/alerting/server/task_runner/action_scheduler/schedulers/per_alert_action_scheduler.test.ts @@ -14,14 +14,11 @@ import { RuleRunMetricsStore } from '../../../lib/rule_run_metrics_store'; import { mockAAD } from '../../fixtures'; import { PerAlertActionScheduler } from './per_alert_action_scheduler'; import { getRule, getRuleType, getDefaultSchedulerContext, generateAlert } from '../test_fixtures'; -import { SanitizedRuleAction } from '@kbn/alerting-types'; +import type { SanitizedRuleAction } from '@kbn/alerting-types'; import { ALERT_UUID } from '@kbn/rule-data-utils'; import { Alert } from '../../../alert'; -import { - ActionsCompletion, - AlertInstanceContext, - AlertInstanceState, -} from '@kbn/alerting-state-types'; +import type { AlertInstanceContext, AlertInstanceState } from '@kbn/alerting-state-types'; +import { ActionsCompletion } from '@kbn/alerting-state-types'; import { TaskPriority } from '@kbn/task-manager-plugin/server'; const alertingEventLogger = alertingEventLoggerMock.create(); diff --git a/x-pack/platform/plugins/shared/alerting/server/task_runner/action_scheduler/schedulers/per_alert_action_scheduler.ts b/x-pack/platform/plugins/shared/alerting/server/task_runner/action_scheduler/schedulers/per_alert_action_scheduler.ts index 47e31d012cfa7..40a88598287fa 100644 --- a/x-pack/platform/plugins/shared/alerting/server/task_runner/action_scheduler/schedulers/per_alert_action_scheduler.ts +++ b/x-pack/platform/plugins/shared/alerting/server/task_runner/action_scheduler/schedulers/per_alert_action_scheduler.ts @@ -5,13 +5,15 @@ * 2.0. */ -import { AlertInstanceState, AlertInstanceContext } from '@kbn/alerting-state-types'; -import { RuleAction, RuleNotifyWhen, RuleTypeParams } from '@kbn/alerting-types'; +import type { AlertInstanceState, AlertInstanceContext } from '@kbn/alerting-state-types'; +import type { RuleAction, RuleTypeParams } from '@kbn/alerting-types'; +import { RuleNotifyWhen } from '@kbn/alerting-types'; import { compact } from 'lodash'; -import { RuleTypeState, RuleAlertData, parseDuration } from '../../../../common'; -import { GetSummarizedAlertsParams } from '../../../alerts_client/types'; -import { AlertHit } from '../../../types'; -import { Alert } from '../../../alert'; +import type { RuleTypeState, RuleAlertData } from '../../../../common'; +import { parseDuration } from '../../../../common'; +import type { GetSummarizedAlertsParams } from '../../../alerts_client/types'; +import type { AlertHit } from '../../../types'; +import type { Alert } from '../../../alert'; import { buildRuleUrl, formatActionToEnqueue, @@ -22,7 +24,7 @@ import { logNumberOfFilteredAlerts, shouldScheduleAction, } from '../lib'; -import { +import type { ActionSchedulerOptions, ActionsToSchedule, AddSummarizedAlertsOpts, @@ -32,7 +34,8 @@ import { IsExecutableActiveAlertOpts, IsExecutableAlertOpts, } from '../types'; -import { TransformActionParamsOptions, transformActionParams } from '../../transform_action_params'; +import type { TransformActionParamsOptions } from '../../transform_action_params'; +import { transformActionParams } from '../../transform_action_params'; import { injectActionParams } from '../../inject_action_params'; enum Reasons { diff --git a/x-pack/platform/plugins/shared/alerting/server/task_runner/action_scheduler/schedulers/summary_action_scheduler.test.ts b/x-pack/platform/plugins/shared/alerting/server/task_runner/action_scheduler/schedulers/summary_action_scheduler.test.ts index 04088e28ee167..d48b4f8e34965 100644 --- a/x-pack/platform/plugins/shared/alerting/server/task_runner/action_scheduler/schedulers/summary_action_scheduler.test.ts +++ b/x-pack/platform/plugins/shared/alerting/server/task_runner/action_scheduler/schedulers/summary_action_scheduler.test.ts @@ -20,13 +20,13 @@ import { generateAlert, generateRecoveredAlert, } from '../test_fixtures'; -import { RuleAction } from '@kbn/alerting-types'; +import type { RuleAction } from '@kbn/alerting-types'; import { ALERT_UUID } from '@kbn/rule-data-utils'; import { getErrorSource, TaskErrorSource, } from '@kbn/task-manager-plugin/server/task_running/errors'; -import { CombinedSummarizedAlerts } from '../../../types'; +import type { CombinedSummarizedAlerts } from '../../../types'; import { ActionsCompletion } from '@kbn/alerting-state-types'; import { TaskPriority } from '@kbn/task-manager-plugin/server'; diff --git a/x-pack/platform/plugins/shared/alerting/server/task_runner/action_scheduler/schedulers/summary_action_scheduler.ts b/x-pack/platform/plugins/shared/alerting/server/task_runner/action_scheduler/schedulers/summary_action_scheduler.ts index 47b7e88e925c8..79e0bdddfdc37 100644 --- a/x-pack/platform/plugins/shared/alerting/server/task_runner/action_scheduler/schedulers/summary_action_scheduler.ts +++ b/x-pack/platform/plugins/shared/alerting/server/task_runner/action_scheduler/schedulers/summary_action_scheduler.ts @@ -5,12 +5,13 @@ * 2.0. */ -import { AlertInstanceState, AlertInstanceContext } from '@kbn/alerting-state-types'; -import { RuleAction, RuleTypeParams } from '@kbn/alerting-types'; +import type { AlertInstanceState, AlertInstanceContext } from '@kbn/alerting-state-types'; +import type { RuleAction, RuleTypeParams } from '@kbn/alerting-types'; import { compact } from 'lodash'; -import { CombinedSummarizedAlerts } from '../../../types'; -import { RuleTypeState, RuleAlertData, parseDuration } from '../../../../common'; -import { GetSummarizedAlertsParams } from '../../../alerts_client/types'; +import type { CombinedSummarizedAlerts } from '../../../types'; +import type { RuleTypeState, RuleAlertData } from '../../../../common'; +import { parseDuration } from '../../../../common'; +import type { GetSummarizedAlertsParams } from '../../../alerts_client/types'; import { buildRuleUrl, formatActionToEnqueue, @@ -22,7 +23,7 @@ import { logNumberOfFilteredAlerts, shouldScheduleAction, } from '../lib'; -import { +import type { ActionSchedulerOptions, ActionsToSchedule, GetActionsToScheduleOpts, diff --git a/x-pack/platform/plugins/shared/alerting/server/task_runner/action_scheduler/schedulers/system_action_scheduler.test.ts b/x-pack/platform/plugins/shared/alerting/server/task_runner/action_scheduler/schedulers/system_action_scheduler.test.ts index 153af5f2051e9..9b13d3a1c868b 100644 --- a/x-pack/platform/plugins/shared/alerting/server/task_runner/action_scheduler/schedulers/system_action_scheduler.test.ts +++ b/x-pack/platform/plugins/shared/alerting/server/task_runner/action_scheduler/schedulers/system_action_scheduler.test.ts @@ -12,12 +12,9 @@ import { alertsClientMock } from '../../../alerts_client/alerts_client.mock'; import { alertingEventLoggerMock } from '../../../lib/alerting_event_logger/alerting_event_logger.mock'; import { RuleRunMetricsStore } from '../../../lib/rule_run_metrics_store'; import { mockAAD } from '../../fixtures'; -import { Alert } from '../../../alert'; -import { - ActionsCompletion, - AlertInstanceContext, - AlertInstanceState, -} from '@kbn/alerting-state-types'; +import type { Alert } from '../../../alert'; +import type { AlertInstanceContext, AlertInstanceState } from '@kbn/alerting-state-types'; +import { ActionsCompletion } from '@kbn/alerting-state-types'; import { getRule, getRuleType, getDefaultSchedulerContext, generateAlert } from '../test_fixtures'; import { SystemActionScheduler } from './system_action_scheduler'; import { ALERT_UUID } from '@kbn/rule-data-utils'; @@ -25,7 +22,7 @@ import { getErrorSource, TaskErrorSource, } from '@kbn/task-manager-plugin/server/task_running/errors'; -import { CombinedSummarizedAlerts } from '../../../types'; +import type { CombinedSummarizedAlerts } from '../../../types'; import { schema } from '@kbn/config-schema'; import { TaskPriority } from '@kbn/task-manager-plugin/server'; diff --git a/x-pack/platform/plugins/shared/alerting/server/task_runner/action_scheduler/schedulers/system_action_scheduler.ts b/x-pack/platform/plugins/shared/alerting/server/task_runner/action_scheduler/schedulers/system_action_scheduler.ts index 01be6e4202ec8..1c6c99caf8bfe 100644 --- a/x-pack/platform/plugins/shared/alerting/server/task_runner/action_scheduler/schedulers/system_action_scheduler.ts +++ b/x-pack/platform/plugins/shared/alerting/server/task_runner/action_scheduler/schedulers/system_action_scheduler.ts @@ -5,18 +5,18 @@ * 2.0. */ -import { AlertInstanceState, AlertInstanceContext } from '@kbn/alerting-state-types'; -import { RuleSystemAction, RuleTypeParams } from '@kbn/alerting-types'; -import { CombinedSummarizedAlerts } from '../../../types'; -import { RuleTypeState, RuleAlertData } from '../../../../common'; -import { GetSummarizedAlertsParams } from '../../../alerts_client/types'; +import type { AlertInstanceState, AlertInstanceContext } from '@kbn/alerting-state-types'; +import type { RuleSystemAction, RuleTypeParams } from '@kbn/alerting-types'; +import type { CombinedSummarizedAlerts } from '../../../types'; +import type { RuleTypeState, RuleAlertData } from '../../../../common'; +import type { GetSummarizedAlertsParams } from '../../../alerts_client/types'; import { buildRuleUrl, formatActionToEnqueue, getSummarizedAlerts, shouldScheduleAction, } from '../lib'; -import { +import type { ActionSchedulerOptions, ActionsToSchedule, GetActionsToScheduleOpts, diff --git a/x-pack/platform/plugins/shared/alerting/server/task_runner/action_scheduler/test_fixtures.ts b/x-pack/platform/plugins/shared/alerting/server/task_runner/action_scheduler/test_fixtures.ts index 07c34c83cba3f..bb4212c2fc107 100644 --- a/x-pack/platform/plugins/shared/alerting/server/task_runner/action_scheduler/test_fixtures.ts +++ b/x-pack/platform/plugins/shared/alerting/server/task_runner/action_scheduler/test_fixtures.ts @@ -6,22 +6,22 @@ */ import type { Logger } from '@kbn/core/server'; -import { +import type { AlertInstanceState, AlertInstanceContext, ThrottledActions, } from '@kbn/alerting-state-types'; -import { RuleTypeParams, SanitizedRule } from '@kbn/alerting-types'; +import type { RuleTypeParams, SanitizedRule } from '@kbn/alerting-types'; import { schema } from '@kbn/config-schema'; -import { KibanaRequest } from '@kbn/core-http-server'; -import { ConcreteTaskInstance } from '@kbn/task-manager-plugin/server'; -import { ActionsClient, PluginStartContract } from '@kbn/actions-plugin/server'; -import { PublicMethodsOf } from '@kbn/utility-types'; -import { RuleAlertData, RuleTypeState } from '../../../common'; +import type { KibanaRequest } from '@kbn/core-http-server'; +import type { ConcreteTaskInstance } from '@kbn/task-manager-plugin/server'; +import type { ActionsClient, PluginStartContract } from '@kbn/actions-plugin/server'; +import type { PublicMethodsOf } from '@kbn/utility-types'; +import type { RuleAlertData, RuleTypeState } from '../../../common'; import { ConnectorAdapterRegistry } from '../../connector_adapters/connector_adapter_registry'; -import { NormalizedRuleType } from '../../rule_type_registry'; -import { TaskRunnerContext } from '../types'; -import { AlertingEventLogger } from '../../lib/alerting_event_logger/alerting_event_logger'; +import type { NormalizedRuleType } from '../../rule_type_registry'; +import type { TaskRunnerContext } from '../types'; +import type { AlertingEventLogger } from '../../lib/alerting_event_logger/alerting_event_logger'; import { Alert } from '../../alert'; const apiKey = Buffer.from('123:abc').toString('base64'); diff --git a/x-pack/platform/plugins/shared/alerting/server/task_runner/action_scheduler/types.ts b/x-pack/platform/plugins/shared/alerting/server/task_runner/action_scheduler/types.ts index 749664540dcfa..e1f46a1a9cc6a 100644 --- a/x-pack/platform/plugins/shared/alerting/server/task_runner/action_scheduler/types.ts +++ b/x-pack/platform/plugins/shared/alerting/server/task_runner/action_scheduler/types.ts @@ -6,13 +6,13 @@ */ import type { Logger } from '@kbn/core/server'; -import { PublicMethodsOf } from '@kbn/utility-types'; -import { ActionsClient } from '@kbn/actions-plugin/server/actions_client'; -import { ExecuteOptions as EnqueueExecutionOptions } from '@kbn/actions-plugin/server/create_execute_function'; -import { TaskPriority } from '@kbn/task-manager-plugin/server'; -import { IAlertsClient } from '../../alerts_client/types'; -import { Alert } from '../../alert'; -import { +import type { PublicMethodsOf } from '@kbn/utility-types'; +import type { ActionsClient } from '@kbn/actions-plugin/server/actions_client'; +import type { ExecuteOptions as EnqueueExecutionOptions } from '@kbn/actions-plugin/server/create_execute_function'; +import type { TaskPriority } from '@kbn/task-manager-plugin/server'; +import type { IAlertsClient } from '../../alerts_client/types'; +import type { Alert } from '../../alert'; +import type { AlertInstanceContext, AlertInstanceState, RuleTypeParams, @@ -23,14 +23,14 @@ import { RuleSystemAction, ThrottledActions, } from '../../../common'; -import { NormalizedRuleType } from '../../rule_type_registry'; -import { CombinedSummarizedAlerts, RawRule } from '../../types'; -import { RuleRunMetricsStore } from '../../lib/rule_run_metrics_store'; -import { +import type { NormalizedRuleType } from '../../rule_type_registry'; +import type { CombinedSummarizedAlerts, RawRule } from '../../types'; +import type { RuleRunMetricsStore } from '../../lib/rule_run_metrics_store'; +import type { ActionOpts, AlertingEventLogger, } from '../../lib/alerting_event_logger/alerting_event_logger'; -import { RuleTaskInstance, TaskRunnerContext } from '../types'; +import type { RuleTaskInstance, TaskRunnerContext } from '../types'; export type ActionSchedulerRule = Omit< SanitizedRule, diff --git a/x-pack/platform/plugins/shared/alerting/server/task_runner/ad_hoc_task_runner.test.ts b/x-pack/platform/plugins/shared/alerting/server/task_runner/ad_hoc_task_runner.test.ts index 20046c059fabb..794f877b67430 100644 --- a/x-pack/platform/plugins/shared/alerting/server/task_runner/ad_hoc_task_runner.test.ts +++ b/x-pack/platform/plugins/shared/alerting/server/task_runner/ad_hoc_task_runner.test.ts @@ -6,9 +6,9 @@ */ import sinon from 'sinon'; -import { PluginStartContract as ActionsPluginStart } from '@kbn/actions-plugin/server'; +import type { PluginStartContract as ActionsPluginStart } from '@kbn/actions-plugin/server'; import { actionsClientMock, actionsMock } from '@kbn/actions-plugin/server/mocks'; -import { SavedObject } from '@kbn/core/server'; +import type { SavedObject } from '@kbn/core/server'; import { elasticsearchServiceMock, executionContextServiceMock, @@ -20,41 +20,42 @@ import { } from '@kbn/core/server/mocks'; import { dataPluginMock } from '@kbn/data-plugin/server/mocks'; import { dataViewPluginMocks } from '@kbn/data-views-plugin/public/mocks'; -import { DataViewsServerPluginStart } from '@kbn/data-views-plugin/server'; +import type { DataViewsServerPluginStart } from '@kbn/data-views-plugin/server'; import { encryptedSavedObjectsMock } from '@kbn/encrypted-saved-objects-plugin/server/mocks'; -import { IEventLogger } from '@kbn/event-log-plugin/server'; +import type { IEventLogger } from '@kbn/event-log-plugin/server'; import { eventLogClientMock, eventLoggerMock } from '@kbn/event-log-plugin/server/mocks'; -import { SharePluginStart } from '@kbn/share-plugin/server'; -import { ConcreteTaskInstance, TaskPriority, TaskStatus } from '@kbn/task-manager-plugin/server'; +import type { SharePluginStart } from '@kbn/share-plugin/server'; +import type { ConcreteTaskInstance } from '@kbn/task-manager-plugin/server'; +import { TaskPriority, TaskStatus } from '@kbn/task-manager-plugin/server'; import { usageCountersServiceMock } from '@kbn/usage-collection-plugin/server/usage_counters/usage_counters_service.mock'; import { AdHocTaskRunner } from './ad_hoc_task_runner'; -import { TaskRunnerContext } from './types'; +import type { TaskRunnerContext } from './types'; import { backfillClientMock } from '../backfill_client/backfill_client.mock'; import { ruleTypeRegistryMock } from '../rule_type_registry.mock'; +import type { ContextOpts } from '../lib/alerting_event_logger/alerting_event_logger'; import { AlertingEventLogger, executionType, - ContextOpts, } from '../lib/alerting_event_logger/alerting_event_logger'; -import { AdHocRunSchedule, AdHocRunSO } from '../data/ad_hoc_run/types'; +import type { AdHocRunSchedule, AdHocRunSO } from '../data/ad_hoc_run/types'; import { AD_HOC_RUN_SAVED_OBJECT_TYPE, RULE_SAVED_OBJECT_TYPE } from '../saved_objects'; import { adHocRunStatus } from '../../common/constants'; import { DATE_1970, generateEnqueueFunctionInput, mockAAD, ruleType } from './fixtures'; import { alertingEventLoggerMock } from '../lib/alerting_event_logger/alerting_event_logger.mock'; import { alertsMock } from '../mocks'; -import { UntypedNormalizedRuleType } from '../rule_type_registry'; +import type { UntypedNormalizedRuleType } from '../rule_type_registry'; import { AlertsService } from '../alerts_service'; import { of, ReplaySubject } from 'rxjs'; import { getDataStreamAdapter } from '../alerts_service/lib/data_stream_adapter'; -import { +import type { AlertInstanceContext, AlertInstanceState, - DEFAULT_FLAPPING_SETTINGS, RuleAlertData, RuleExecutorOptions, RuleTypeParams, RuleTypeState, } from '../types'; +import { DEFAULT_FLAPPING_SETTINGS } from '../types'; import { TIMESTAMP, EVENT_ACTION, diff --git a/x-pack/platform/plugins/shared/alerting/server/task_runner/ad_hoc_task_runner.ts b/x-pack/platform/plugins/shared/alerting/server/task_runner/ad_hoc_task_runner.ts index 6478264af463f..1bb1fa5239e55 100644 --- a/x-pack/platform/plugins/shared/alerting/server/task_runner/ad_hoc_task_runner.ts +++ b/x-pack/platform/plugins/shared/alerting/server/task_runner/ad_hoc_task_runner.ts @@ -7,35 +7,33 @@ import apm from 'elastic-apm-node'; import { v4 as uuidv4 } from 'uuid'; -import { - ISavedObjectsRepository, - KibanaRequest, - Logger, - SavedObject, - SavedObjectsErrorHelpers, -} from '@kbn/core/server'; -import { - ConcreteTaskInstance, - createTaskRunError, - TaskErrorSource, -} from '@kbn/task-manager-plugin/server'; +import type { ISavedObjectsRepository, KibanaRequest, Logger, SavedObject } from '@kbn/core/server'; +import { SavedObjectsErrorHelpers } from '@kbn/core/server'; +import type { ConcreteTaskInstance } from '@kbn/task-manager-plugin/server'; +import { createTaskRunError, TaskErrorSource } from '@kbn/task-manager-plugin/server'; import { nanosToMillis } from '@kbn/event-log-plugin/common'; -import { CancellableTask, RunResult, TaskPriority } from '@kbn/task-manager-plugin/server/task'; -import { AdHocRunStatus, adHocRunStatus } from '../../common/constants'; -import { RuleRunnerErrorStackTraceLog, RuleTaskStateAndMetrics, TaskRunnerContext } from './types'; +import type { CancellableTask, RunResult } from '@kbn/task-manager-plugin/server/task'; +import { TaskPriority } from '@kbn/task-manager-plugin/server/task'; +import type { AdHocRunStatus } from '../../common/constants'; +import { adHocRunStatus } from '../../common/constants'; +import type { + RuleRunnerErrorStackTraceLog, + RuleTaskStateAndMetrics, + TaskRunnerContext, +} from './types'; import { getExecutorServices } from './get_executor_services'; import { ErrorWithReason, validateRuleTypeParams } from '../lib'; -import { +import type { AlertInstanceContext, AlertInstanceState, RuleAlertData, - RuleExecutionStatusErrorReasons, RuleTypeParams, RuleTypeRegistry, RuleTypeState, } from '../types'; +import { RuleExecutionStatusErrorReasons } from '../types'; import { TaskRunnerTimer, TaskRunnerTimerSpan } from './task_runner_timer'; -import { AdHocRun, AdHocRunSO, AdHocRunSchedule } from '../data/ad_hoc_run/types'; +import type { AdHocRun, AdHocRunSO, AdHocRunSchedule } from '../data/ad_hoc_run/types'; import { AD_HOC_RUN_SAVED_OBJECT_TYPE } from '../saved_objects'; import { RuleMonitoringService } from '../monitoring/rule_monitoring_service'; import { AdHocTaskRunningHandler } from './ad_hoc_task_running_handler'; @@ -44,14 +42,16 @@ import { RuleResultService } from '../monitoring/rule_result_service'; import { RuleTypeRunner } from './rule_type_runner'; import { initializeAlertsClient } from '../alerts_client'; import { partiallyUpdateAdHocRun, processRunResults } from './lib'; -import { UntypedNormalizedRuleType } from '../rule_type_registry'; +import type { UntypedNormalizedRuleType } from '../rule_type_registry'; import { AlertingEventLogger, executionType, } from '../lib/alerting_event_logger/alerting_event_logger'; -import { RuleRunMetrics, RuleRunMetricsStore } from '../lib/rule_run_metrics_store'; +import type { RuleRunMetrics } from '../lib/rule_run_metrics_store'; +import { RuleRunMetricsStore } from '../lib/rule_run_metrics_store'; import { getEsErrorMessage } from '../lib/errors'; -import { Result, isOk, asOk, asErr } from '../lib/result_type'; +import type { Result } from '../lib/result_type'; +import { isOk, asOk, asErr } from '../lib/result_type'; import { updateGaps } from '../lib/rule_gaps/update/update_gaps'; import { ActionScheduler } from './action_scheduler'; import { transformAdHocRunToAdHocRunData } from '../application/backfill/transforms/transform_ad_hoc_run_to_backfill_result'; @@ -79,12 +79,12 @@ export class AdHocTaskRunner implements CancellableTask { private adHocRunSchedule: AdHocRunSchedule[] = []; private adHocRange: { start: string; end: string | undefined } | null = null; private alertingEventLogger: AlertingEventLogger; - private cancelled: boolean = false; + private cancelled = false; private logger: Logger; - private ruleId: string = ''; + private ruleId = ''; private ruleMonitoring: RuleMonitoringService; private ruleResult: RuleResultService; - private ruleTypeId: string = ''; + private ruleTypeId = ''; private ruleTypeRunner: RuleTypeRunner< RuleTypeParams, RuleTypeParams, @@ -96,9 +96,9 @@ export class AdHocTaskRunner implements CancellableTask { RuleAlertData >; private runDate = new Date(); - private scheduleToRunIndex: number = -1; + private scheduleToRunIndex = -1; private searchAbortController: AbortController; - private shouldDeleteTask: boolean = false; + private shouldDeleteTask = false; private stackTraceLog: RuleRunnerErrorStackTraceLog | null = null; private taskRunning: AdHocTaskRunningHandler; private timer: TaskRunnerTimer; diff --git a/x-pack/platform/plugins/shared/alerting/server/task_runner/ad_hoc_task_running_handler.test.ts b/x-pack/platform/plugins/shared/alerting/server/task_runner/ad_hoc_task_running_handler.test.ts index 62e64e02cbecd..0812c1de2a3fa 100644 --- a/x-pack/platform/plugins/shared/alerting/server/task_runner/ad_hoc_task_running_handler.test.ts +++ b/x-pack/platform/plugins/shared/alerting/server/task_runner/ad_hoc_task_running_handler.test.ts @@ -4,7 +4,7 @@ * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ -import { ISavedObjectsRepository, Logger } from '@kbn/core/server'; +import type { ISavedObjectsRepository, Logger } from '@kbn/core/server'; import { partiallyUpdateAdHocRun } from './lib'; import { AdHocTaskRunningHandler } from './ad_hoc_task_running_handler'; diff --git a/x-pack/platform/plugins/shared/alerting/server/task_runner/ad_hoc_task_running_handler.ts b/x-pack/platform/plugins/shared/alerting/server/task_runner/ad_hoc_task_running_handler.ts index 1ef4279a328aa..2c8eb20c10c83 100644 --- a/x-pack/platform/plugins/shared/alerting/server/task_runner/ad_hoc_task_running_handler.ts +++ b/x-pack/platform/plugins/shared/alerting/server/task_runner/ad_hoc_task_running_handler.ts @@ -5,9 +5,9 @@ * 2.0. */ -import { ISavedObjectsRepository, Logger } from '@kbn/core/server'; +import type { ISavedObjectsRepository, Logger } from '@kbn/core/server'; import { adHocRunStatus } from '../../common/constants'; -import { AdHocRunSchedule } from '../data/ad_hoc_run/types'; +import type { AdHocRunSchedule } from '../data/ad_hoc_run/types'; import { partiallyUpdateAdHocRun } from './lib'; const TIME_TO_WAIT = 2000; diff --git a/x-pack/platform/plugins/shared/alerting/server/task_runner/alert_task_instance.test.ts b/x-pack/platform/plugins/shared/alerting/server/task_runner/alert_task_instance.test.ts index 93bb08a55c7d0..f11f57a87579b 100644 --- a/x-pack/platform/plugins/shared/alerting/server/task_runner/alert_task_instance.test.ts +++ b/x-pack/platform/plugins/shared/alerting/server/task_runner/alert_task_instance.test.ts @@ -5,10 +5,12 @@ * 2.0. */ -import { ConcreteTaskInstance, TaskStatus } from '@kbn/task-manager-plugin/server'; -import { AlertTaskInstance, taskInstanceToAlertTaskInstance } from './alert_task_instance'; +import type { ConcreteTaskInstance } from '@kbn/task-manager-plugin/server'; +import { TaskStatus } from '@kbn/task-manager-plugin/server'; +import type { AlertTaskInstance } from './alert_task_instance'; +import { taskInstanceToAlertTaskInstance } from './alert_task_instance'; import { v4 as uuidv4 } from 'uuid'; -import { SanitizedRule } from '../types'; +import type { SanitizedRule } from '../types'; const alert: SanitizedRule<{ bar: boolean; diff --git a/x-pack/platform/plugins/shared/alerting/server/task_runner/alert_task_instance.ts b/x-pack/platform/plugins/shared/alerting/server/task_runner/alert_task_instance.ts index adcf228dde783..986e793c169cd 100644 --- a/x-pack/platform/plugins/shared/alerting/server/task_runner/alert_task_instance.ts +++ b/x-pack/platform/plugins/shared/alerting/server/task_runner/alert_task_instance.ts @@ -8,9 +8,9 @@ import * as t from 'io-ts'; import { pipe } from 'fp-ts/lib/pipeable'; import { fold } from 'fp-ts/lib/Either'; -import { ConcreteTaskInstance } from '@kbn/task-manager-plugin/server'; +import type { ConcreteTaskInstance } from '@kbn/task-manager-plugin/server'; import { ruleParamsSchema } from '@kbn/alerting-state-types'; -import { SanitizedRule, RuleTaskState, RuleTaskParams, RuleTypeParams } from '../../common'; +import type { SanitizedRule, RuleTaskState, RuleTaskParams, RuleTypeParams } from '../../common'; export interface AlertTaskInstance extends ConcreteTaskInstance { state: RuleTaskState; diff --git a/x-pack/platform/plugins/shared/alerting/server/task_runner/fixtures.ts b/x-pack/platform/plugins/shared/alerting/server/task_runner/fixtures.ts index 84f9251090117..bb33de2e54a6e 100644 --- a/x-pack/platform/plugins/shared/alerting/server/task_runner/fixtures.ts +++ b/x-pack/platform/plugins/shared/alerting/server/task_runner/fixtures.ts @@ -5,23 +5,23 @@ * 2.0. */ -import { TaskPriority, TaskStatus } from '@kbn/task-manager-plugin/server'; -import { SavedObject } from '@kbn/core/server'; +import type { TaskPriority } from '@kbn/task-manager-plugin/server'; +import { TaskStatus } from '@kbn/task-manager-plugin/server'; +import type { SavedObject } from '@kbn/core/server'; import { ALERTING_CASES_SAVED_OBJECT_INDEX } from '@kbn/core-saved-objects-server'; -import { +import type { Rule, RuleTypeParams, - RecoveredActionGroup, RuleMonitoring, - RuleLastRunOutcomeOrderMap, RuleLastRunOutcomes, SanitizedRule, SanitizedRuleAction, } from '../../common'; +import { RecoveredActionGroup, RuleLastRunOutcomeOrderMap } from '../../common'; import { getDefaultMonitoring } from '../lib/monitoring'; -import { UntypedNormalizedRuleType } from '../rule_type_registry'; +import type { UntypedNormalizedRuleType } from '../rule_type_registry'; import { EVENT_LOG_ACTIONS } from '../plugin'; -import { AlertHit, RawRule } from '../types'; +import type { AlertHit, RawRule } from '../types'; import { RULE_SAVED_OBJECT_TYPE } from '../saved_objects'; interface GeneratorParams { @@ -327,7 +327,7 @@ export const generateAlertOpts = ({ maintenanceWindowIds, }: GeneratorParams = {}) => { id = id ?? '1'; - let message: string = ''; + let message = ''; switch (action) { case EVENT_LOG_ACTIONS.newInstance: message = `test:1: 'rule-name' created new alert: '${id}'`; diff --git a/x-pack/platform/plugins/shared/alerting/server/task_runner/get_executor_services.ts b/x-pack/platform/plugins/shared/alerting/server/task_runner/get_executor_services.ts index 08bf3297fef06..86ff494b8206f 100644 --- a/x-pack/platform/plugins/shared/alerting/server/task_runner/get_executor_services.ts +++ b/x-pack/platform/plugins/shared/alerting/server/task_runner/get_executor_services.ts @@ -5,28 +5,24 @@ * 2.0. */ -import { +import type { IUiSettingsClient, KibanaRequest, Logger, SavedObjectsClientContract, } from '@kbn/core/server'; -import { DataViewsContract } from '@kbn/data-views-plugin/common'; +import type { DataViewsContract } from '@kbn/data-views-plugin/common'; import { RULE_SAVED_OBJECT_TYPE } from '..'; import { getEsRequestTimeout } from '../lib'; -import { - createWrappedScopedClusterClientFactory, - WrappedScopedClusterClient, -} from '../lib/wrap_scoped_cluster_client'; -import { - WrappedSearchSourceClient, - wrapSearchSourceClient, -} from '../lib/wrap_search_source_client'; -import { RuleMonitoringService } from '../monitoring/rule_monitoring_service'; -import { RuleResultService } from '../monitoring/rule_result_service'; -import { PublicRuleMonitoringService, PublicRuleResultService } from '../types'; +import type { WrappedScopedClusterClient } from '../lib/wrap_scoped_cluster_client'; +import { createWrappedScopedClusterClientFactory } from '../lib/wrap_scoped_cluster_client'; +import type { WrappedSearchSourceClient } from '../lib/wrap_search_source_client'; +import { wrapSearchSourceClient } from '../lib/wrap_search_source_client'; +import type { RuleMonitoringService } from '../monitoring/rule_monitoring_service'; +import type { RuleResultService } from '../monitoring/rule_result_service'; +import type { PublicRuleMonitoringService, PublicRuleResultService } from '../types'; import { withAlertingSpan } from './lib'; -import { TaskRunnerContext } from './types'; +import type { TaskRunnerContext } from './types'; interface GetExecutorServicesOpts { context: TaskRunnerContext; diff --git a/x-pack/platform/plugins/shared/alerting/server/task_runner/inject_action_params.ts b/x-pack/platform/plugins/shared/alerting/server/task_runner/inject_action_params.ts index 421796c08bbff..73d07f50f9243 100644 --- a/x-pack/platform/plugins/shared/alerting/server/task_runner/inject_action_params.ts +++ b/x-pack/platform/plugins/shared/alerting/server/task_runner/inject_action_params.ts @@ -6,8 +6,8 @@ */ import { i18n } from '@kbn/i18n'; -import { RuleActionParams } from '../types'; -import { RuleUrl } from './action_scheduler'; +import type { RuleActionParams } from '../types'; +import type { RuleUrl } from './action_scheduler'; export interface InjectActionParamsOpts { actionTypeId: string; diff --git a/x-pack/platform/plugins/shared/alerting/server/task_runner/lib/clear_expired_snoozes.test.ts b/x-pack/platform/plugins/shared/alerting/server/task_runner/lib/clear_expired_snoozes.test.ts index 756af0349fb6a..59c52e0abf4f7 100644 --- a/x-pack/platform/plugins/shared/alerting/server/task_runner/lib/clear_expired_snoozes.test.ts +++ b/x-pack/platform/plugins/shared/alerting/server/task_runner/lib/clear_expired_snoozes.test.ts @@ -7,9 +7,9 @@ import moment from 'moment'; import sinon from 'sinon'; -import { Logger } from '@kbn/core/server'; +import type { Logger } from '@kbn/core/server'; import { elasticsearchServiceMock, loggingSystemMock } from '@kbn/core/server/mocks'; -import { RuleSnooze } from '../../types'; +import type { RuleSnooze } from '../../types'; import { RULE_SAVED_OBJECT_TYPE } from '../../saved_objects'; import { clearExpiredSnoozes } from './clear_expired_snoozes'; import { ALERTING_CASES_SAVED_OBJECT_INDEX } from '@kbn/core-saved-objects-server'; diff --git a/x-pack/platform/plugins/shared/alerting/server/task_runner/lib/clear_expired_snoozes.ts b/x-pack/platform/plugins/shared/alerting/server/task_runner/lib/clear_expired_snoozes.ts index 3850f99fde005..4bd9fd895f372 100644 --- a/x-pack/platform/plugins/shared/alerting/server/task_runner/lib/clear_expired_snoozes.ts +++ b/x-pack/platform/plugins/shared/alerting/server/task_runner/lib/clear_expired_snoozes.ts @@ -5,8 +5,8 @@ * 2.0. */ -import { RuleTypeParams, SanitizedRule } from '@kbn/alerting-types'; -import { ElasticsearchClient, Logger } from '@kbn/core/server'; +import type { RuleTypeParams, SanitizedRule } from '@kbn/alerting-types'; +import type { ElasticsearchClient, Logger } from '@kbn/core/server'; import { isSnoozeExpired } from '../../lib'; import { partiallyUpdateRuleWithEs } from '../../saved_objects'; diff --git a/x-pack/platform/plugins/shared/alerting/server/task_runner/lib/partially_update_ad_hoc_run.test.ts b/x-pack/platform/plugins/shared/alerting/server/task_runner/lib/partially_update_ad_hoc_run.test.ts index 4e6e772693442..ed5e905a90b22 100644 --- a/x-pack/platform/plugins/shared/alerting/server/task_runner/lib/partially_update_ad_hoc_run.test.ts +++ b/x-pack/platform/plugins/shared/alerting/server/task_runner/lib/partially_update_ad_hoc_run.test.ts @@ -5,15 +5,10 @@ * 2.0. */ -import { - SavedObjectsClientContract, - ISavedObjectsRepository, - SavedObjectsErrorHelpers, -} from '@kbn/core/server'; -import { - PartiallyUpdateableAdHocRunAttributes, - partiallyUpdateAdHocRun, -} from './partially_update_ad_hoc_run'; +import type { SavedObjectsClientContract, ISavedObjectsRepository } from '@kbn/core/server'; +import { SavedObjectsErrorHelpers } from '@kbn/core/server'; +import type { PartiallyUpdateableAdHocRunAttributes } from './partially_update_ad_hoc_run'; +import { partiallyUpdateAdHocRun } from './partially_update_ad_hoc_run'; import { savedObjectsClientMock } from '@kbn/core/server/mocks'; import { AD_HOC_RUN_SAVED_OBJECT_TYPE } from '../../saved_objects'; import { adHocRunStatus } from '../../../common/constants'; diff --git a/x-pack/platform/plugins/shared/alerting/server/task_runner/lib/partially_update_ad_hoc_run.ts b/x-pack/platform/plugins/shared/alerting/server/task_runner/lib/partially_update_ad_hoc_run.ts index dad89a829c531..bcf9b31205677 100644 --- a/x-pack/platform/plugins/shared/alerting/server/task_runner/lib/partially_update_ad_hoc_run.ts +++ b/x-pack/platform/plugins/shared/alerting/server/task_runner/lib/partially_update_ad_hoc_run.ts @@ -5,15 +5,12 @@ * 2.0. */ -import { - SavedObjectsClient, - SavedObjectsErrorHelpers, - SavedObjectsUpdateOptions, -} from '@kbn/core/server'; +import type { SavedObjectsClient, SavedObjectsUpdateOptions } from '@kbn/core/server'; +import { SavedObjectsErrorHelpers } from '@kbn/core/server'; import { omit, pick } from 'lodash'; -import { AdHocRunSO } from '../../data/ad_hoc_run/types'; +import type { AdHocRunSO } from '../../data/ad_hoc_run/types'; +import type { AdHocRunAttributesNotPartiallyUpdatable } from '../../saved_objects'; import { - AdHocRunAttributesNotPartiallyUpdatable, AdHocRunAttributesToEncrypt, AdHocRunAttributesIncludedInAAD, AD_HOC_RUN_SAVED_OBJECT_TYPE, diff --git a/x-pack/platform/plugins/shared/alerting/server/task_runner/lib/process_run_result.ts b/x-pack/platform/plugins/shared/alerting/server/task_runner/lib/process_run_result.ts index b1d898b1ec074..1e7ca47bc1bb1 100644 --- a/x-pack/platform/plugins/shared/alerting/server/task_runner/lib/process_run_result.ts +++ b/x-pack/platform/plugins/shared/alerting/server/task_runner/lib/process_run_result.ts @@ -5,20 +5,22 @@ * 2.0. */ -import { Logger } from '@kbn/core/server'; -import { Outcome } from 'elastic-apm-node'; -import { RuleExecutionStatus, RuleLastRun } from '../../../common'; -import { ElasticsearchError } from '../../lib'; -import { ILastRun, lastRunFromError, lastRunFromState } from '../../lib/last_run_status'; -import { map, Result } from '../../lib/result_type'; +import type { Logger } from '@kbn/core/server'; +import type { Outcome } from 'elastic-apm-node'; +import type { RuleExecutionStatus, RuleLastRun } from '../../../common'; +import type { ElasticsearchError } from '../../lib'; +import type { ILastRun } from '../../lib/last_run_status'; +import { lastRunFromError, lastRunFromState } from '../../lib/last_run_status'; +import type { Result } from '../../lib/result_type'; +import { map } from '../../lib/result_type'; +import type { IExecutionStatusAndMetrics } from '../../lib/rule_execution_status'; import { executionStatusFromError, executionStatusFromState, - IExecutionStatusAndMetrics, } from '../../lib/rule_execution_status'; -import { RuleRunMetrics } from '../../lib/rule_run_metrics_store'; -import { RuleResultService } from '../../monitoring/rule_result_service'; -import { RuleTaskStateAndMetrics } from '../types'; +import type { RuleRunMetrics } from '../../lib/rule_run_metrics_store'; +import type { RuleResultService } from '../../monitoring/rule_result_service'; +import type { RuleTaskStateAndMetrics } from '../types'; interface ProcessRuleRunOpts { logger?: Logger; diff --git a/x-pack/platform/plugins/shared/alerting/server/task_runner/lib/task_runner_logger.test.ts b/x-pack/platform/plugins/shared/alerting/server/task_runner/lib/task_runner_logger.test.ts index 96a75d53cb402..6ec423298bab0 100644 --- a/x-pack/platform/plugins/shared/alerting/server/task_runner/lib/task_runner_logger.test.ts +++ b/x-pack/platform/plugins/shared/alerting/server/task_runner/lib/task_runner_logger.test.ts @@ -6,7 +6,8 @@ */ import { loggingSystemMock } from '@kbn/core/server/mocks'; -import { LogLevel, LogRecord } from '@kbn/logging'; +import type { LogRecord } from '@kbn/logging'; +import { LogLevel } from '@kbn/logging'; import { createTaskRunnerLogger } from './task_runner_logger'; describe('createTaskRunnerLogger', () => { diff --git a/x-pack/platform/plugins/shared/alerting/server/task_runner/lib/task_runner_logger.ts b/x-pack/platform/plugins/shared/alerting/server/task_runner/lib/task_runner_logger.ts index c99b4ac88b86b..e5f251981b748 100644 --- a/x-pack/platform/plugins/shared/alerting/server/task_runner/lib/task_runner_logger.ts +++ b/x-pack/platform/plugins/shared/alerting/server/task_runner/lib/task_runner_logger.ts @@ -6,7 +6,7 @@ */ import type { Logger, LogMeta } from '@kbn/core/server'; -import { LogLevelId, LogMessageSource, LogRecord } from '@kbn/logging'; +import type { LogLevelId, LogMessageSource, LogRecord } from '@kbn/logging'; interface TaskRunnerLoggerOpts { logger: Logger; diff --git a/x-pack/platform/plugins/shared/alerting/server/task_runner/log_alerts.test.ts b/x-pack/platform/plugins/shared/alerting/server/task_runner/log_alerts.test.ts index aabd657289e75..c9b03a203e606 100644 --- a/x-pack/platform/plugins/shared/alerting/server/task_runner/log_alerts.test.ts +++ b/x-pack/platform/plugins/shared/alerting/server/task_runner/log_alerts.test.ts @@ -16,7 +16,7 @@ import { loggingSystemMock } from '@kbn/core-logging-server-mocks'; import { Alert } from '../alert'; import { alertingEventLoggerMock } from '../lib/alerting_event_logger/alerting_event_logger.mock'; import { RuleRunMetricsStore } from '../lib/rule_run_metrics_store'; -import { DefaultActionGroupId } from '../types'; +import type { DefaultActionGroupId } from '../types'; import { logAlerts } from './log_alerts'; const logger: ReturnType = loggingSystemMock.createLogger(); diff --git a/x-pack/platform/plugins/shared/alerting/server/task_runner/log_alerts.ts b/x-pack/platform/plugins/shared/alerting/server/task_runner/log_alerts.ts index a83f8ebb74ac4..9b814b6d9f992 100644 --- a/x-pack/platform/plugins/shared/alerting/server/task_runner/log_alerts.ts +++ b/x-pack/platform/plugins/shared/alerting/server/task_runner/log_alerts.ts @@ -6,12 +6,12 @@ */ import apm from 'elastic-apm-node'; -import { Logger } from '@kbn/core/server'; -import { Alert } from '../alert'; +import type { Logger } from '@kbn/core/server'; +import type { Alert } from '../alert'; import { EVENT_LOG_ACTIONS } from '../plugin'; -import { AlertInstanceContext, AlertInstanceState } from '../types'; -import { AlertingEventLogger } from '../lib/alerting_event_logger/alerting_event_logger'; -import { RuleRunMetricsStore } from '../lib/rule_run_metrics_store'; +import type { AlertInstanceContext, AlertInstanceState } from '../types'; +import type { AlertingEventLogger } from '../lib/alerting_event_logger/alerting_event_logger'; +import type { RuleRunMetricsStore } from '../lib/rule_run_metrics_store'; export interface LogAlertsParams< State extends AlertInstanceState, diff --git a/x-pack/platform/plugins/shared/alerting/server/task_runner/maintenance_windows/get_maintenance_windows.test.ts b/x-pack/platform/plugins/shared/alerting/server/task_runner/maintenance_windows/get_maintenance_windows.test.ts index 9f44194dbb951..b8763c351764d 100644 --- a/x-pack/platform/plugins/shared/alerting/server/task_runner/maintenance_windows/get_maintenance_windows.test.ts +++ b/x-pack/platform/plugins/shared/alerting/server/task_runner/maintenance_windows/get_maintenance_windows.test.ts @@ -10,7 +10,7 @@ import { maintenanceWindowCategoryIdTypes } from '../../application/maintenance_ import { getMockMaintenanceWindow } from '../../data/maintenance_window/test_helpers'; import { maintenanceWindowClientMock } from '../../maintenance_window_client.mock'; import { MaintenanceWindowStatus } from '../../types'; -import { MaintenanceWindow } from '../../application/maintenance_window/types'; +import type { MaintenanceWindow } from '../../application/maintenance_window/types'; import { mockedRawRuleSO, mockedRule } from '../fixtures'; import { filterMaintenanceWindows, @@ -18,9 +18,9 @@ import { getMaintenanceWindows, } from './get_maintenance_windows'; import { getFakeKibanaRequest } from '../rule_loader'; -import { TaskRunnerContext } from '../types'; +import type { TaskRunnerContext } from '../types'; import { FilterStateStore } from '@kbn/es-query'; -import { KibanaRequest } from '@kbn/core-http-server'; +import type { KibanaRequest } from '@kbn/core-http-server'; const logger = loggingSystemMock.create().get(); const mockBasePathService = { set: jest.fn() }; diff --git a/x-pack/platform/plugins/shared/alerting/server/task_runner/maintenance_windows/get_maintenance_windows.ts b/x-pack/platform/plugins/shared/alerting/server/task_runner/maintenance_windows/get_maintenance_windows.ts index ffc880f5475ae..279d883f79a0c 100644 --- a/x-pack/platform/plugins/shared/alerting/server/task_runner/maintenance_windows/get_maintenance_windows.ts +++ b/x-pack/platform/plugins/shared/alerting/server/task_runner/maintenance_windows/get_maintenance_windows.ts @@ -5,9 +5,9 @@ * 2.0. */ -import { KibanaRequest, Logger } from '@kbn/core/server'; -import { MaintenanceWindow } from '../../application/maintenance_window/types'; -import { MaintenanceWindowClientApi } from '../../types'; +import type { KibanaRequest, Logger } from '@kbn/core/server'; +import type { MaintenanceWindow } from '../../application/maintenance_window/types'; +import type { MaintenanceWindowClientApi } from '../../types'; import { withAlertingSpan } from '../lib'; interface GetMaintenanceWindowsOpts { diff --git a/x-pack/platform/plugins/shared/alerting/server/task_runner/maintenance_windows/maintenance_windows_service.test.ts b/x-pack/platform/plugins/shared/alerting/server/task_runner/maintenance_windows/maintenance_windows_service.test.ts index e768eb8ec6efe..5453d91f8c09b 100644 --- a/x-pack/platform/plugins/shared/alerting/server/task_runner/maintenance_windows/maintenance_windows_service.test.ts +++ b/x-pack/platform/plugins/shared/alerting/server/task_runner/maintenance_windows/maintenance_windows_service.test.ts @@ -6,14 +6,14 @@ */ import sinon from 'sinon'; -import { KibanaRequest } from '@kbn/core/server'; +import type { KibanaRequest } from '@kbn/core/server'; import { loggingSystemMock } from '@kbn/core/server/mocks'; import { alertingEventLoggerMock } from '../../lib/alerting_event_logger/alerting_event_logger.mock'; import { MaintenanceWindowsService } from './maintenance_windows_service'; import { maintenanceWindowClientMock } from '../../maintenance_window_client.mock'; import { getMockMaintenanceWindow } from '../../data/maintenance_window/test_helpers'; import { MaintenanceWindowStatus } from '../../../common'; -import { MaintenanceWindowCategoryIds } from '../../../common/routes/maintenance_window/shared'; +import type { MaintenanceWindowCategoryIds } from '../../../common/routes/maintenance_window/shared'; import { FilterStateStore } from '@kbn/es-query'; const alertingEventLogger = alertingEventLoggerMock.create(); diff --git a/x-pack/platform/plugins/shared/alerting/server/task_runner/maintenance_windows/maintenance_windows_service.ts b/x-pack/platform/plugins/shared/alerting/server/task_runner/maintenance_windows/maintenance_windows_service.ts index 4f1b62a61f88f..c8bfa96ad2818 100644 --- a/x-pack/platform/plugins/shared/alerting/server/task_runner/maintenance_windows/maintenance_windows_service.ts +++ b/x-pack/platform/plugins/shared/alerting/server/task_runner/maintenance_windows/maintenance_windows_service.ts @@ -5,11 +5,11 @@ * 2.0. */ -import { KibanaRequest, Logger } from '@kbn/core/server'; -import { MaintenanceWindow } from '../../application/maintenance_window/types'; +import type { KibanaRequest, Logger } from '@kbn/core/server'; +import type { MaintenanceWindow } from '../../application/maintenance_window/types'; import { filterMaintenanceWindowsIds } from './get_maintenance_windows'; -import { MaintenanceWindowClientApi } from '../../types'; -import { AlertingEventLogger } from '../../lib/alerting_event_logger/alerting_event_logger'; +import type { MaintenanceWindowClientApi } from '../../types'; +import type { AlertingEventLogger } from '../../lib/alerting_event_logger/alerting_event_logger'; import { withAlertingSpan } from '../lib'; export const DEFAULT_CACHE_INTERVAL_MS = 60000; // 1 minute cache diff --git a/x-pack/platform/plugins/shared/alerting/server/task_runner/rule_loader.test.ts b/x-pack/platform/plugins/shared/alerting/server/task_runner/rule_loader.test.ts index c5e833dee1058..d9430b42d9c5a 100644 --- a/x-pack/platform/plugins/shared/alerting/server/task_runner/rule_loader.test.ts +++ b/x-pack/platform/plugins/shared/alerting/server/task_runner/rule_loader.test.ts @@ -17,9 +17,9 @@ import { getFakeKibanaRequest, validateRuleAndCreateFakeRequest, } from './rule_loader'; -import { TaskRunnerContext } from './types'; +import type { TaskRunnerContext } from './types'; import { ruleTypeRegistryMock } from '../rule_type_registry.mock'; -import { Rule } from '../types'; +import type { Rule } from '../types'; import { MONITORING_HISTORY_LIMIT, RuleExecutionStatusErrorReasons } from '../../common'; import { getReasonFromError } from '../lib/error_with_reason'; import { mockedRawRuleSO, mockedRule } from './fixtures'; @@ -54,7 +54,7 @@ describe('rule_loader', () => { bar: schema.boolean(), }); - const getDefaultValidateRuleParams = (ruleEnabled: boolean = true) => ({ + const getDefaultValidateRuleParams = (ruleEnabled = true) => ({ logger: mockLogger, paramValidator, ruleId, diff --git a/x-pack/platform/plugins/shared/alerting/server/task_runner/rule_loader.ts b/x-pack/platform/plugins/shared/alerting/server/task_runner/rule_loader.ts index b917ba334b93b..d959c693ae652 100644 --- a/x-pack/platform/plugins/shared/alerting/server/task_runner/rule_loader.ts +++ b/x-pack/platform/plugins/shared/alerting/server/task_runner/rule_loader.ts @@ -12,15 +12,12 @@ import { kibanaRequestFactory } from '@kbn/core-http-server-utils'; import type { SavedObject, SavedObjectReference } from '@kbn/core-saved-objects-api-server'; import type { Logger } from '@kbn/logging'; import { SavedObjectsErrorHelpers } from '@kbn/core-saved-objects-server'; -import { RunRuleParams, TaskRunnerContext } from './types'; +import type { RunRuleParams, TaskRunnerContext } from './types'; import { ErrorWithReason, validateRuleTypeParams } from '../lib'; -import { - RuleExecutionStatusErrorReasons, - RawRule, - RuleTypeRegistry, - RuleTypeParamsValidator, -} from '../types'; -import { MONITORING_HISTORY_LIMIT, RuleTypeParams } from '../../common'; +import type { RawRule, RuleTypeRegistry, RuleTypeParamsValidator } from '../types'; +import { RuleExecutionStatusErrorReasons } from '../types'; +import type { RuleTypeParams } from '../../common'; +import { MONITORING_HISTORY_LIMIT } from '../../common'; import { RULE_SAVED_OBJECT_TYPE } from '../saved_objects'; import { getAlertFromRaw } from '../rules_client/lib'; diff --git a/x-pack/platform/plugins/shared/alerting/server/task_runner/rule_running_handler.test.ts b/x-pack/platform/plugins/shared/alerting/server/task_runner/rule_running_handler.test.ts index 08c1e0c7292ee..76a6523217796 100644 --- a/x-pack/platform/plugins/shared/alerting/server/task_runner/rule_running_handler.test.ts +++ b/x-pack/platform/plugins/shared/alerting/server/task_runner/rule_running_handler.test.ts @@ -4,7 +4,7 @@ * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ -import { ISavedObjectsRepository, Logger } from '@kbn/core/server'; +import type { ISavedObjectsRepository, Logger } from '@kbn/core/server'; import { partiallyUpdateRule } from '../saved_objects/partially_update_rule'; import { RuleRunningHandler } from './rule_running_handler'; diff --git a/x-pack/platform/plugins/shared/alerting/server/task_runner/rule_running_handler.ts b/x-pack/platform/plugins/shared/alerting/server/task_runner/rule_running_handler.ts index 3794937343f26..b69c61b8890cc 100644 --- a/x-pack/platform/plugins/shared/alerting/server/task_runner/rule_running_handler.ts +++ b/x-pack/platform/plugins/shared/alerting/server/task_runner/rule_running_handler.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { ISavedObjectsRepository, Logger } from '@kbn/core/server'; +import type { ISavedObjectsRepository, Logger } from '@kbn/core/server'; import { partiallyUpdateRule } from '../saved_objects/partially_update_rule'; const TIME_TO_WAIT = 2000; @@ -16,7 +16,7 @@ export class RuleRunningHandler { private ruleTypeId: string; private runningTimeoutId?: NodeJS.Timeout; - private isUpdating: boolean = false; + private isUpdating = false; private runningPromise?: Promise; constructor(client: ISavedObjectsRepository, logger: Logger, ruleTypeId: string) { diff --git a/x-pack/platform/plugins/shared/alerting/server/task_runner/rule_type_runner.test.ts b/x-pack/platform/plugins/shared/alerting/server/task_runner/rule_type_runner.test.ts index a698dc0f7f15b..635e94ec62e06 100644 --- a/x-pack/platform/plugins/shared/alerting/server/task_runner/rule_type_runner.test.ts +++ b/x-pack/platform/plugins/shared/alerting/server/task_runner/rule_type_runner.test.ts @@ -10,27 +10,24 @@ import { loggingSystemMock } from '@kbn/core-logging-server-mocks'; import { DATE_1970, mockTaskInstance, RULE_ID, RULE_NAME, RULE_TYPE_ID } from './fixtures'; import { alertingEventLoggerMock } from '../lib/alerting_event_logger/alerting_event_logger.mock'; import { ruleRunMetricsStoreMock } from '../lib/rule_run_metrics_store.mock'; -import { RuleTypeRunner, RuleData } from './rule_type_runner'; +import type { RuleData } from './rule_type_runner'; +import { RuleTypeRunner } from './rule_type_runner'; import { TaskRunnerTimer } from './task_runner_timer'; import { DEFAULT_FLAPPING_SETTINGS, RecoveredActionGroup } from '../types'; -import { TaskRunnerContext } from './types'; +import type { TaskRunnerContext } from './types'; import { executionContextServiceMock } from '@kbn/core-execution-context-server-mocks'; -import { SharePluginStart } from '@kbn/share-plugin/server'; +import type { SharePluginStart } from '@kbn/share-plugin/server'; import { alertsClientMock } from '../alerts_client/alerts_client.mock'; import { dataViewPluginMocks } from '@kbn/data-views-plugin/public/mocks'; import { publicRuleMonitoringServiceMock } from '../monitoring/rule_monitoring_service.mock'; import { publicRuleResultServiceMock } from '../monitoring/rule_result_service.mock'; import { wrappedScopedClusterClientMock } from '../lib/wrap_scoped_cluster_client.mock'; -import { NormalizedRuleType } from '../rule_type_registry'; -import { - ConcreteTaskInstance, - createTaskRunError, - TaskErrorSource, - TaskStatus, -} from '@kbn/task-manager-plugin/server'; +import type { NormalizedRuleType } from '../rule_type_registry'; +import type { ConcreteTaskInstance } from '@kbn/task-manager-plugin/server'; +import { createTaskRunError, TaskErrorSource, TaskStatus } from '@kbn/task-manager-plugin/server'; import { getErrorSource } from '@kbn/task-manager-plugin/server/task_running'; import { maintenanceWindowsServiceMock } from './maintenance_windows/maintenance_windows_service.mock'; -import { KibanaRequest } from '@kbn/core/server'; +import type { KibanaRequest } from '@kbn/core/server'; const alertingEventLogger = alertingEventLoggerMock.create(); const alertsClient = alertsClientMock.create(); diff --git a/x-pack/platform/plugins/shared/alerting/server/task_runner/rule_type_runner.ts b/x-pack/platform/plugins/shared/alerting/server/task_runner/rule_type_runner.ts index dd18c580459d1..759fb0d7749cd 100644 --- a/x-pack/platform/plugins/shared/alerting/server/task_runner/rule_type_runner.ts +++ b/x-pack/platform/plugins/shared/alerting/server/task_runner/rule_type_runner.ts @@ -5,32 +5,32 @@ * 2.0. */ -import { AlertInstanceContext, AlertInstanceState, RuleTaskState } from '@kbn/alerting-state-types'; +import type { + AlertInstanceContext, + AlertInstanceState, + RuleTaskState, +} from '@kbn/alerting-state-types'; import { DEFAULT_NAMESPACE_STRING } from '@kbn/core-saved-objects-utils-server'; -import { Logger } from '@kbn/core/server'; -import { - ConcreteTaskInstance, - createTaskRunError, - TaskErrorSource, -} from '@kbn/task-manager-plugin/server'; +import type { Logger } from '@kbn/core/server'; +import type { ConcreteTaskInstance } from '@kbn/task-manager-plugin/server'; +import { createTaskRunError, TaskErrorSource } from '@kbn/task-manager-plugin/server'; import { getErrorSource } from '@kbn/task-manager-plugin/server/task_running'; -import { IAlertsClient } from '../alerts_client/types'; +import type { IAlertsClient } from '../alerts_client/types'; import { ErrorWithReason } from '../lib'; import { getTimeRange } from '../lib/get_time_range'; -import { NormalizedRuleType } from '../rule_type_registry'; -import { - DEFAULT_FLAPPING_SETTINGS, - RuleAlertData, - RuleExecutionStatusErrorReasons, - RuleTypeParams, - RuleTypeState, - SanitizedRule, -} from '../types'; -import { ExecutorServices } from './get_executor_services'; -import { TaskRunnerTimer, TaskRunnerTimerSpan } from './task_runner_timer'; -import { RuleRunnerErrorStackTraceLog, RuleTypeRunnerContext, TaskRunnerContext } from './types'; +import type { NormalizedRuleType } from '../rule_type_registry'; +import type { RuleAlertData, RuleTypeParams, RuleTypeState, SanitizedRule } from '../types'; +import { DEFAULT_FLAPPING_SETTINGS, RuleExecutionStatusErrorReasons } from '../types'; +import type { ExecutorServices } from './get_executor_services'; +import type { TaskRunnerTimer } from './task_runner_timer'; +import { TaskRunnerTimerSpan } from './task_runner_timer'; +import type { + RuleRunnerErrorStackTraceLog, + RuleTypeRunnerContext, + TaskRunnerContext, +} from './types'; import { withAlertingSpan } from './lib'; -import { WrappedSearchSourceClient } from '../lib/wrap_search_source_client'; +import type { WrappedSearchSourceClient } from '../lib/wrap_search_source_client'; interface ConstructorOpts< Params extends RuleTypeParams, @@ -120,7 +120,7 @@ export class RuleTypeRunner< RecoveryActionGroupId extends string, AlertData extends RuleAlertData > { - private cancelled: boolean = false; + private cancelled = false; constructor( private readonly options: ConstructorOpts< diff --git a/x-pack/platform/plugins/shared/alerting/server/task_runner/task_runner.test.ts b/x-pack/platform/plugins/shared/alerting/server/task_runner/task_runner.test.ts index d92633fe5d64a..cf9285c008198 100644 --- a/x-pack/platform/plugins/shared/alerting/server/task_runner/task_runner.test.ts +++ b/x-pack/platform/plugins/shared/alerting/server/task_runner/task_runner.test.ts @@ -7,26 +7,28 @@ import sinon from 'sinon'; import { usageCountersServiceMock } from '@kbn/usage-collection-plugin/server/usage_counters/usage_counters_service.mock'; -import { +import type { RuleExecutorOptions, RuleTypeParams, RuleTypeState, AlertInstanceState, AlertInstanceContext, - RuleExecutionStatusWarningReasons, Rule, RuleAction, RuleAlertData, +} from '../types'; +import { + RuleExecutionStatusWarningReasons, DEFAULT_FLAPPING_SETTINGS, DEFAULT_QUERY_DELAY_SETTINGS, } from '../types'; +import type { ConcreteTaskInstance } from '@kbn/task-manager-plugin/server'; import { - ConcreteTaskInstance, createTaskRunError, isUnrecoverableError, TaskErrorSource, } from '@kbn/task-manager-plugin/server'; -import { TaskRunnerContext } from './types'; +import type { TaskRunnerContext } from './types'; import { TaskRunner } from './task_runner'; import { encryptedSavedObjectsMock } from '@kbn/encrypted-saved-objects-plugin/server/mocks'; import { @@ -38,11 +40,11 @@ import { elasticsearchServiceMock, uiSettingsServiceMock, } from '@kbn/core/server/mocks'; -import { PluginStartContract as ActionsPluginStart } from '@kbn/actions-plugin/server'; +import type { PluginStartContract as ActionsPluginStart } from '@kbn/actions-plugin/server'; import { actionsMock, actionsClientMock } from '@kbn/actions-plugin/server/mocks'; import { alertsMock } from '../mocks'; import { eventLoggerMock } from '@kbn/event-log-plugin/server/event_logger.mock'; -import { IEventLogger } from '@kbn/event-log-plugin/server'; +import type { IEventLogger } from '@kbn/event-log-plugin/server'; import { SavedObjectsErrorHelpers } from '@kbn/core/server'; import { omit } from 'lodash'; import { ruleTypeRegistryMock } from '../rule_type_registry.mock'; @@ -74,15 +76,13 @@ import { EVENT_LOG_ACTIONS } from '../plugin'; import { IN_MEMORY_METRICS } from '../monitoring'; import { translations } from '../constants/translations'; import { dataPluginMock } from '@kbn/data-plugin/server/mocks'; -import { - AlertingEventLogger, - ContextOpts, -} from '../lib/alerting_event_logger/alerting_event_logger'; +import type { ContextOpts } from '../lib/alerting_event_logger/alerting_event_logger'; +import { AlertingEventLogger } from '../lib/alerting_event_logger/alerting_event_logger'; import { getAlertFromRaw } from '../rules_client/lib/get_alert_from_raw'; import { alertingEventLoggerMock } from '../lib/alerting_event_logger/alerting_event_logger.mock'; -import { SharePluginStart } from '@kbn/share-plugin/server'; +import type { SharePluginStart } from '@kbn/share-plugin/server'; import { dataViewPluginMocks } from '@kbn/data-views-plugin/public/mocks'; -import { DataViewsServerPluginStart } from '@kbn/data-views-plugin/server'; +import type { DataViewsServerPluginStart } from '@kbn/data-views-plugin/server'; import { alertsServiceMock } from '../alerts_service/alerts_service.mock'; import { ConnectorAdapterRegistry } from '../connector_adapters/connector_adapter_registry'; import { getMockMaintenanceWindow } from '../data/maintenance_window/test_helpers'; @@ -93,11 +93,11 @@ import { RuleResultService } from '../monitoring/rule_result_service'; import { RuleMonitoringService } from '../monitoring/rule_monitoring_service'; import { ruleResultServiceMock } from '../monitoring/rule_result_service.mock'; import { backfillClientMock } from '../backfill_client/backfill_client.mock'; -import { UntypedNormalizedRuleType } from '../rule_type_registry'; +import type { UntypedNormalizedRuleType } from '../rule_type_registry'; import * as getExecutorServicesModule from './get_executor_services'; import { rulesSettingsServiceMock } from '../rules_settings/rules_settings_service.mock'; import { maintenanceWindowsServiceMock } from './maintenance_windows/maintenance_windows_service.mock'; -import { MaintenanceWindow } from '../application/maintenance_window/types'; +import type { MaintenanceWindow } from '../application/maintenance_window/types'; import { ErrorWithType } from '../lib/error_with_type'; import { eventLogClientMock } from '@kbn/event-log-plugin/server/mocks'; diff --git a/x-pack/platform/plugins/shared/alerting/server/task_runner/task_runner.ts b/x-pack/platform/plugins/shared/alerting/server/task_runner/task_runner.ts index e7daf3d74e3d9..e162603ae132c 100644 --- a/x-pack/platform/plugins/shared/alerting/server/task_runner/task_runner.ts +++ b/x-pack/platform/plugins/shared/alerting/server/task_runner/task_runner.ts @@ -7,11 +7,11 @@ import apm from 'elastic-apm-node'; import { omit } from 'lodash'; -import { UsageCounter } from '@kbn/usage-collection-plugin/server'; +import type { UsageCounter } from '@kbn/usage-collection-plugin/server'; import { v4 as uuidv4 } from 'uuid'; -import { ISavedObjectsRepository, Logger } from '@kbn/core/server'; +import type { ISavedObjectsRepository, Logger } from '@kbn/core/server'; +import type { ConcreteTaskInstance } from '@kbn/task-manager-plugin/server'; import { - ConcreteTaskInstance, createTaskRunError, TaskErrorSource, throwUnrecoverableError, @@ -19,7 +19,7 @@ import { import { nanosToMillis } from '@kbn/event-log-plugin/server'; import { getErrorSource, isUserError } from '@kbn/task-manager-plugin/server/task_running'; import { ActionScheduler, type RunResult } from './action_scheduler'; -import { +import type { RuleRunnerErrorStackTraceLog, RuleTaskInstance, RuleTaskRunResult, @@ -28,34 +28,36 @@ import { TaskRunnerContext, } from './types'; import { getExecutorServices } from './get_executor_services'; -import { ElasticsearchError, getNextRun, isRuleSnoozed, ruleExecutionStatusToRaw } from '../lib'; -import { +import type { ElasticsearchError } from '../lib'; +import { getNextRun, isRuleSnoozed, ruleExecutionStatusToRaw } from '../lib'; +import type { IntervalSchedule, RawRuleExecutionStatus, RawRuleLastRun, RawRuleMonitoring, RuleExecutionStatus, - RuleExecutionStatusErrorReasons, RuleTaskState, RuleTypeRegistry, } from '../types'; -import { asErr, asOk, isErr, isOk, map, resolveErr, Result } from '../lib/result_type'; +import { RuleExecutionStatusErrorReasons } from '../types'; +import type { Result } from '../lib/result_type'; +import { asErr, asOk, isErr, isOk, map, resolveErr } from '../lib/result_type'; import { taskInstanceToAlertTaskInstance } from './alert_task_instance'; import { isAlertSavedObjectNotFoundError, isEsUnavailableError } from '../lib/is_alerting_error'; import { partiallyUpdateRuleWithEs, RULE_SAVED_OBJECT_TYPE } from '../saved_objects'; -import { +import type { AlertInstanceContext, AlertInstanceState, - parseDuration, RawAlertInstance, RuleAlertData, - RuleLastRunOutcomeOrderMap, RuleTypeParams, RuleTypeState, } from '../../common'; -import { NormalizedRuleType, UntypedNormalizedRuleType } from '../rule_type_registry'; +import { parseDuration, RuleLastRunOutcomeOrderMap } from '../../common'; +import type { NormalizedRuleType, UntypedNormalizedRuleType } from '../rule_type_registry'; import { getEsErrorMessage } from '../lib/errors'; -import { IN_MEMORY_METRICS, InMemoryMetrics } from '../monitoring'; +import type { InMemoryMetrics } from '../monitoring'; +import { IN_MEMORY_METRICS } from '../monitoring'; import { RuleRunMetricsStore } from '../lib/rule_run_metrics_store'; import { AlertingEventLogger } from '../lib/alerting_event_logger/alerting_event_logger'; import { getDecryptedRule, validateRuleAndCreateFakeRequest } from './rule_loader'; diff --git a/x-pack/platform/plugins/shared/alerting/server/task_runner/task_runner_alerts_client.test.ts b/x-pack/platform/plugins/shared/alerting/server/task_runner/task_runner_alerts_client.test.ts index c3a8f7bc4103d..c6d02334419a9 100644 --- a/x-pack/platform/plugins/shared/alerting/server/task_runner/task_runner_alerts_client.test.ts +++ b/x-pack/platform/plugins/shared/alerting/server/task_runner/task_runner_alerts_client.test.ts @@ -7,7 +7,7 @@ import sinon from 'sinon'; import { usageCountersServiceMock } from '@kbn/usage-collection-plugin/server/usage_counters/usage_counters_service.mock'; -import { +import type { RuleExecutorOptions, RuleTypeParams, RuleTypeState, @@ -16,12 +16,14 @@ import { Rule, RuleAlertData, RawRule, +} from '../types'; +import { MaintenanceWindowStatus, DEFAULT_FLAPPING_SETTINGS, DEFAULT_QUERY_DELAY_SETTINGS, } from '../types'; -import { ConcreteTaskInstance } from '@kbn/task-manager-plugin/server'; -import { TaskRunnerContext } from './types'; +import type { ConcreteTaskInstance } from '@kbn/task-manager-plugin/server'; +import type { TaskRunnerContext } from './types'; import { TaskRunner } from './task_runner'; import { encryptedSavedObjectsMock } from '@kbn/encrypted-saved-objects-plugin/server/mocks'; import { @@ -33,11 +35,11 @@ import { elasticsearchServiceMock, uiSettingsServiceMock, } from '@kbn/core/server/mocks'; -import { PluginStartContract as ActionsPluginStart } from '@kbn/actions-plugin/server'; +import type { PluginStartContract as ActionsPluginStart } from '@kbn/actions-plugin/server'; import { actionsMock, actionsClientMock } from '@kbn/actions-plugin/server/mocks'; import { alertsMock } from '../mocks'; import { eventLoggerMock } from '@kbn/event-log-plugin/server/event_logger.mock'; -import { IEventLogger } from '@kbn/event-log-plugin/server'; +import type { IEventLogger } from '@kbn/event-log-plugin/server'; import { ruleTypeRegistryMock } from '../rule_type_registry.mock'; import { inMemoryMetricsMock } from '../monitoring/in_memory_metrics.mock'; import { @@ -57,11 +59,11 @@ import { getAlertFromRaw } from '../rules_client/lib/get_alert_from_raw'; import { dataPluginMock } from '@kbn/data-plugin/server/mocks'; import { AlertingEventLogger } from '../lib/alerting_event_logger/alerting_event_logger'; import { alertingEventLoggerMock } from '../lib/alerting_event_logger/alerting_event_logger.mock'; -import { SharePluginStart } from '@kbn/share-plugin/server'; +import type { SharePluginStart } from '@kbn/share-plugin/server'; import { dataViewPluginMocks } from '@kbn/data-views-plugin/public/mocks'; -import { DataViewsServerPluginStart } from '@kbn/data-views-plugin/server'; +import type { DataViewsServerPluginStart } from '@kbn/data-views-plugin/server'; import { alertsServiceMock } from '../alerts_service/alerts_service.mock'; -import { UntypedNormalizedRuleType } from '../rule_type_registry'; +import type { UntypedNormalizedRuleType } from '../rule_type_registry'; import { alertsClientMock } from '../alerts_client/alerts_client.mock'; import * as LegacyAlertsClientModule from '../alerts_client/legacy_alerts_client'; import * as RuleRunMetricsStoreModule from '../lib/rule_run_metrics_store'; @@ -69,7 +71,7 @@ import { legacyAlertsClientMock } from '../alerts_client/legacy_alerts_client.mo import { ruleRunMetricsStoreMock } from '../lib/rule_run_metrics_store.mock'; import { AlertsService } from '../alerts_service'; import { ReplaySubject, Subject } from 'rxjs'; -import { IAlertsClient } from '../alerts_client/types'; +import type { IAlertsClient } from '../alerts_client/types'; import { getDataStreamAdapter } from '../alerts_service/lib/data_stream_adapter'; import { TIMESTAMP, @@ -107,7 +109,7 @@ import { import { backfillClientMock } from '../backfill_client/backfill_client.mock'; import { ConnectorAdapterRegistry } from '../connector_adapters/connector_adapter_registry'; import { createTaskRunnerLogger } from './lib'; -import { SavedObject } from '@kbn/core/server'; +import type { SavedObject } from '@kbn/core/server'; import { maintenanceWindowsServiceMock } from './maintenance_windows/maintenance_windows_service.mock'; import { getMockMaintenanceWindow } from '../data/maintenance_window/test_helpers'; import { rulesSettingsServiceMock } from '../rules_settings/rules_settings_service.mock'; diff --git a/x-pack/platform/plugins/shared/alerting/server/task_runner/task_runner_cancel.test.ts b/x-pack/platform/plugins/shared/alerting/server/task_runner/task_runner_cancel.test.ts index 54e30e03d3198..e8575577d69e4 100644 --- a/x-pack/platform/plugins/shared/alerting/server/task_runner/task_runner_cancel.test.ts +++ b/x-pack/platform/plugins/shared/alerting/server/task_runner/task_runner_cancel.test.ts @@ -7,7 +7,7 @@ import sinon from 'sinon'; import { usageCountersServiceMock } from '@kbn/usage-collection-plugin/server/usage_counters/usage_counters_service.mock'; -import { +import type { RuleExecutorOptions, RuleTypeParams, RuleTypeState, @@ -15,10 +15,9 @@ import { AlertInstanceContext, Rule, RuleAlertData, - DEFAULT_FLAPPING_SETTINGS, - DEFAULT_QUERY_DELAY_SETTINGS, } from '../types'; -import { ConcreteTaskInstance } from '@kbn/task-manager-plugin/server'; +import { DEFAULT_FLAPPING_SETTINGS, DEFAULT_QUERY_DELAY_SETTINGS } from '../types'; +import type { ConcreteTaskInstance } from '@kbn/task-manager-plugin/server'; import { TaskRunner } from './task_runner'; import { encryptedSavedObjectsMock } from '@kbn/encrypted-saved-objects-plugin/server/mocks'; import { @@ -30,19 +29,17 @@ import { elasticsearchServiceMock, uiSettingsServiceMock, } from '@kbn/core/server/mocks'; -import { PluginStartContract as ActionsPluginStart } from '@kbn/actions-plugin/server'; +import type { PluginStartContract as ActionsPluginStart } from '@kbn/actions-plugin/server'; import { actionsMock, actionsClientMock } from '@kbn/actions-plugin/server/mocks'; import { alertsMock } from '../mocks'; import { eventLoggerMock } from '@kbn/event-log-plugin/server/event_logger.mock'; -import { IEventLogger } from '@kbn/event-log-plugin/server'; +import type { IEventLogger } from '@kbn/event-log-plugin/server'; import { ruleTypeRegistryMock } from '../rule_type_registry.mock'; import { dataPluginMock } from '@kbn/data-plugin/server/mocks'; import { inMemoryMetricsMock } from '../monitoring/in_memory_metrics.mock'; import { getAlertFromRaw } from '../rules_client/lib/get_alert_from_raw'; -import { - AlertingEventLogger, - ContextOpts, -} from '../lib/alerting_event_logger/alerting_event_logger'; +import type { ContextOpts } from '../lib/alerting_event_logger/alerting_event_logger'; +import { AlertingEventLogger } from '../lib/alerting_event_logger/alerting_event_logger'; import { alertingEventLoggerMock } from '../lib/alerting_event_logger/alerting_event_logger.mock'; import { mockTaskInstance, @@ -54,15 +51,15 @@ import { mockedRawRuleSO, } from './fixtures'; import { EVENT_LOG_ACTIONS } from '../plugin'; -import { SharePluginStart } from '@kbn/share-plugin/server'; -import { DataViewsServerPluginStart } from '@kbn/data-views-plugin/server'; +import type { SharePluginStart } from '@kbn/share-plugin/server'; +import type { DataViewsServerPluginStart } from '@kbn/data-views-plugin/server'; import { dataViewPluginMocks } from '@kbn/data-views-plugin/public/mocks'; import { alertsServiceMock } from '../alerts_service/alerts_service.mock'; import { ConnectorAdapterRegistry } from '../connector_adapters/connector_adapter_registry'; import { RULE_SAVED_OBJECT_TYPE } from '../saved_objects'; -import { TaskRunnerContext } from './types'; +import type { TaskRunnerContext } from './types'; import { backfillClientMock } from '../backfill_client/backfill_client.mock'; -import { UntypedNormalizedRuleType } from '../rule_type_registry'; +import type { UntypedNormalizedRuleType } from '../rule_type_registry'; import { rulesSettingsServiceMock } from '../rules_settings/rules_settings_service.mock'; import { ALERTING_CASES_SAVED_OBJECT_INDEX } from '@kbn/core-saved-objects-server'; import { maintenanceWindowsServiceMock } from './maintenance_windows/maintenance_windows_service.mock'; diff --git a/x-pack/platform/plugins/shared/alerting/server/task_runner/task_runner_factory.test.ts b/x-pack/platform/plugins/shared/alerting/server/task_runner/task_runner_factory.test.ts index 3c42db4dfea62..37f012ae4c05b 100644 --- a/x-pack/platform/plugins/shared/alerting/server/task_runner/task_runner_factory.test.ts +++ b/x-pack/platform/plugins/shared/alerting/server/task_runner/task_runner_factory.test.ts @@ -7,7 +7,8 @@ import sinon from 'sinon'; import { usageCountersServiceMock } from '@kbn/usage-collection-plugin/server/usage_counters/usage_counters_service.mock'; -import { ConcreteTaskInstance, TaskStatus } from '@kbn/task-manager-plugin/server'; +import type { ConcreteTaskInstance } from '@kbn/task-manager-plugin/server'; +import { TaskStatus } from '@kbn/task-manager-plugin/server'; import { TaskRunnerFactory } from './task_runner_factory'; import { encryptedSavedObjectsMock } from '@kbn/encrypted-saved-objects-plugin/server/mocks'; import { @@ -19,18 +20,18 @@ import { } from '@kbn/core/server/mocks'; import { actionsMock } from '@kbn/actions-plugin/server/mocks'; import { eventLoggerMock } from '@kbn/event-log-plugin/server/event_logger.mock'; -import { UntypedNormalizedRuleType } from '../rule_type_registry'; +import type { UntypedNormalizedRuleType } from '../rule_type_registry'; import { ruleTypeRegistryMock } from '../rule_type_registry.mock'; import { executionContextServiceMock } from '@kbn/core/server/mocks'; import { dataPluginMock } from '@kbn/data-plugin/server/mocks'; import { inMemoryMetricsMock } from '../monitoring/in_memory_metrics.mock'; -import { SharePluginStart } from '@kbn/share-plugin/server'; -import { DataViewsServerPluginStart } from '@kbn/data-views-plugin/server'; +import type { SharePluginStart } from '@kbn/share-plugin/server'; +import type { DataViewsServerPluginStart } from '@kbn/data-views-plugin/server'; import { dataViewPluginMocks } from '@kbn/data-views-plugin/public/mocks'; import { alertsServiceMock } from '../alerts_service/alerts_service.mock'; import { schema } from '@kbn/config-schema'; import { ConnectorAdapterRegistry } from '../connector_adapters/connector_adapter_registry'; -import { TaskRunnerContext } from './types'; +import type { TaskRunnerContext } from './types'; import { backfillClientMock } from '../backfill_client/backfill_client.mock'; import { rulesSettingsServiceMock } from '../rules_settings/rules_settings_service.mock'; import { maintenanceWindowsServiceMock } from './maintenance_windows/maintenance_windows_service.mock'; diff --git a/x-pack/platform/plugins/shared/alerting/server/task_runner/task_runner_factory.ts b/x-pack/platform/plugins/shared/alerting/server/task_runner/task_runner_factory.ts index 1b91cce30edb9..728cb62bc7ff4 100644 --- a/x-pack/platform/plugins/shared/alerting/server/task_runner/task_runner_factory.ts +++ b/x-pack/platform/plugins/shared/alerting/server/task_runner/task_runner_factory.ts @@ -5,8 +5,8 @@ * 2.0. */ -import { RunContext } from '@kbn/task-manager-plugin/server'; -import { +import type { RunContext } from '@kbn/task-manager-plugin/server'; +import type { RuleAlertData, RuleTypeParams, RuleTypeState, @@ -14,9 +14,9 @@ import { AlertInstanceContext, } from '../types'; import { TaskRunner } from './task_runner'; -import { NormalizedRuleType } from '../rule_type_registry'; -import { InMemoryMetrics } from '../monitoring'; -import { TaskRunnerContext } from './types'; +import type { NormalizedRuleType } from '../rule_type_registry'; +import type { InMemoryMetrics } from '../monitoring'; +import type { TaskRunnerContext } from './types'; import { AD_HOC_RUN_SAVED_OBJECT_TYPE, RULE_SAVED_OBJECT_TYPE } from '../saved_objects'; import { AdHocTaskRunner } from './ad_hoc_task_runner'; diff --git a/x-pack/platform/plugins/shared/alerting/server/task_runner/task_runner_timer.test.ts b/x-pack/platform/plugins/shared/alerting/server/task_runner/task_runner_timer.test.ts index 3cabaa1fe0450..d1a3c9134101b 100644 --- a/x-pack/platform/plugins/shared/alerting/server/task_runner/task_runner_timer.test.ts +++ b/x-pack/platform/plugins/shared/alerting/server/task_runner/task_runner_timer.test.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { Logger } from '@kbn/core/server'; +import type { Logger } from '@kbn/core/server'; import { loggingSystemMock } from '@kbn/core/server/mocks'; import { TaskRunnerTimer, TaskRunnerTimerSpan } from './task_runner_timer'; diff --git a/x-pack/platform/plugins/shared/alerting/server/task_runner/task_runner_timer.ts b/x-pack/platform/plugins/shared/alerting/server/task_runner/task_runner_timer.ts index bcf07834acb66..146d4eabf4252 100644 --- a/x-pack/platform/plugins/shared/alerting/server/task_runner/task_runner_timer.ts +++ b/x-pack/platform/plugins/shared/alerting/server/task_runner/task_runner_timer.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { Logger } from '@kbn/core/server'; +import type { Logger } from '@kbn/core/server'; export enum TaskRunnerTimerSpan { StartTaskRun = 'claim_to_start_duration_ms', diff --git a/x-pack/platform/plugins/shared/alerting/server/task_runner/transform_action_params.test.ts b/x-pack/platform/plugins/shared/alerting/server/task_runner/transform_action_params.test.ts index c343411d494b7..85830faf72f72 100644 --- a/x-pack/platform/plugins/shared/alerting/server/task_runner/transform_action_params.test.ts +++ b/x-pack/platform/plugins/shared/alerting/server/task_runner/transform_action_params.test.ts @@ -10,7 +10,7 @@ import { actionsMock, renderActionParameterTemplatesDefault, } from '@kbn/actions-plugin/server/mocks'; -import { SanitizedRule } from '../types'; +import type { SanitizedRule } from '../types'; import { mockAAD } from './fixtures'; const actionsPlugin = actionsMock.createStart(); diff --git a/x-pack/platform/plugins/shared/alerting/server/task_runner/transform_action_params.ts b/x-pack/platform/plugins/shared/alerting/server/task_runner/transform_action_params.ts index 0b23910be3f3d..9a52f1edc2332 100644 --- a/x-pack/platform/plugins/shared/alerting/server/task_runner/transform_action_params.ts +++ b/x-pack/platform/plugins/shared/alerting/server/task_runner/transform_action_params.ts @@ -5,17 +5,17 @@ * 2.0. */ -import { PluginStartContract as ActionsPluginStartContract } from '@kbn/actions-plugin/server'; -import { ActionContextVariables, SummaryActionContextVariables } from '@kbn/alerting-types'; -import { AADAlert } from '@kbn/alerts-as-data-utils'; +import type { PluginStartContract as ActionsPluginStartContract } from '@kbn/actions-plugin/server'; +import type { ActionContextVariables, SummaryActionContextVariables } from '@kbn/alerting-types'; +import type { AADAlert } from '@kbn/alerts-as-data-utils'; import { mapKeys, snakeCase } from 'lodash/fp'; -import { +import type { RuleActionParams, AlertInstanceState, AlertInstanceContext, RuleTypeParams, } from '../types'; -import { ActionSchedulerRule } from './action_scheduler/types'; +import type { ActionSchedulerRule } from './action_scheduler/types'; export interface TransformActionParamsOptions { actionsPlugin: ActionsPluginStartContract; diff --git a/x-pack/platform/plugins/shared/alerting/server/task_runner/types.ts b/x-pack/platform/plugins/shared/alerting/server/task_runner/types.ts index 872ca2e2ea153..bb934f2e7b518 100644 --- a/x-pack/platform/plugins/shared/alerting/server/task_runner/types.ts +++ b/x-pack/platform/plugins/shared/alerting/server/task_runner/types.ts @@ -14,20 +14,20 @@ import type { ElasticsearchServiceStart, UiSettingsServiceStart, } from '@kbn/core/server'; -import { ConcreteTaskInstance, DecoratedError } from '@kbn/task-manager-plugin/server'; -import { PublicMethodsOf } from '@kbn/utility-types'; -import { PluginStartContract as ActionsPluginStartContract } from '@kbn/actions-plugin/server'; -import { ActionsClient } from '@kbn/actions-plugin/server/actions_client'; -import { PluginStart as DataPluginStart } from '@kbn/data-plugin/server'; -import { PluginStart as DataViewsPluginStart } from '@kbn/data-views-plugin/server'; -import { EncryptedSavedObjectsClient } from '@kbn/encrypted-saved-objects-plugin/server'; -import { IEventLogClient, IEventLogger } from '@kbn/event-log-plugin/server'; -import { SharePluginStart } from '@kbn/share-plugin/server'; -import { UsageCounter } from '@kbn/usage-collection-plugin/server'; -import { IAlertsClient } from '../alerts_client/types'; -import { Alert } from '../alert'; -import { AlertsService } from '../alerts_service/alerts_service'; -import { +import type { ConcreteTaskInstance, DecoratedError } from '@kbn/task-manager-plugin/server'; +import type { PublicMethodsOf } from '@kbn/utility-types'; +import type { PluginStartContract as ActionsPluginStartContract } from '@kbn/actions-plugin/server'; +import type { ActionsClient } from '@kbn/actions-plugin/server/actions_client'; +import type { PluginStart as DataPluginStart } from '@kbn/data-plugin/server'; +import type { PluginStart as DataViewsPluginStart } from '@kbn/data-views-plugin/server'; +import type { EncryptedSavedObjectsClient } from '@kbn/encrypted-saved-objects-plugin/server'; +import type { IEventLogClient, IEventLogger } from '@kbn/event-log-plugin/server'; +import type { SharePluginStart } from '@kbn/share-plugin/server'; +import type { UsageCounter } from '@kbn/usage-collection-plugin/server'; +import type { IAlertsClient } from '../alerts_client/types'; +import type { Alert } from '../alert'; +import type { AlertsService } from '../alerts_service/alerts_service'; +import type { AlertInstanceContext, AlertInstanceState, RuleTypeParams, @@ -41,21 +41,21 @@ import { RuleSystemAction, RulesSettingsFlappingProperties, } from '../../common'; -import { ActionsConfigMap } from '../lib/get_actions_config_map'; -import { NormalizedRuleType } from '../rule_type_registry'; -import { +import type { ActionsConfigMap } from '../lib/get_actions_config_map'; +import type { NormalizedRuleType } from '../rule_type_registry'; +import type { CombinedSummarizedAlerts, RawRule, RuleTypeRegistry, SpaceIdToNamespaceFunction, } from '../types'; -import { RuleRunMetrics, RuleRunMetricsStore } from '../lib/rule_run_metrics_store'; -import { AlertingEventLogger } from '../lib/alerting_event_logger/alerting_event_logger'; -import { BackfillClient } from '../backfill_client/backfill_client'; -import { ElasticsearchError } from '../lib'; -import { ConnectorAdapterRegistry } from '../connector_adapters/connector_adapter_registry'; -import { RulesSettingsService } from '../rules_settings'; -import { MaintenanceWindowsService } from './maintenance_windows'; +import type { RuleRunMetrics, RuleRunMetricsStore } from '../lib/rule_run_metrics_store'; +import type { AlertingEventLogger } from '../lib/alerting_event_logger/alerting_event_logger'; +import type { BackfillClient } from '../backfill_client/backfill_client'; +import type { ElasticsearchError } from '../lib'; +import type { ConnectorAdapterRegistry } from '../connector_adapters/connector_adapter_registry'; +import type { RulesSettingsService } from '../rules_settings'; +import type { MaintenanceWindowsService } from './maintenance_windows'; export interface RuleTaskRunResult { state: RuleTaskState; diff --git a/x-pack/platform/plugins/shared/alerting/server/test_utils/index.ts b/x-pack/platform/plugins/shared/alerting/server/test_utils/index.ts index c8b0c98eb7f4a..d9ced2e8aec0a 100644 --- a/x-pack/platform/plugins/shared/alerting/server/test_utils/index.ts +++ b/x-pack/platform/plugins/shared/alerting/server/test_utils/index.ts @@ -5,8 +5,8 @@ * 2.0. */ -import { RawAlertInstance } from '../../common'; -import { AlertingConfig } from '../config'; +import type { RawAlertInstance } from '../../common'; +import type { AlertingConfig } from '../config'; interface Resolvable { resolve: (arg: T) => void; diff --git a/x-pack/platform/plugins/shared/alerting/server/types.ts b/x-pack/platform/plugins/shared/alerting/server/types.ts index f0db7c3f4ed43..9801553b9aa3b 100644 --- a/x-pack/platform/plugins/shared/alerting/server/types.ts +++ b/x-pack/platform/plugins/shared/alerting/server/types.ts @@ -11,11 +11,11 @@ import type { SavedObjectReference, IUiSettingsClient, } from '@kbn/core/server'; -import { z } from '@kbn/zod'; -import { DataViewsContract } from '@kbn/data-views-plugin/common'; -import { ISearchStartSearchSource } from '@kbn/data-plugin/common'; -import { LicenseType } from '@kbn/licensing-plugin/server'; -import { +import type { z } from '@kbn/zod'; +import type { DataViewsContract } from '@kbn/data-views-plugin/common'; +import type { ISearchStartSearchSource } from '@kbn/data-plugin/common'; +import type { LicenseType } from '@kbn/licensing-plugin/server'; +import type { IScopedClusterClient, SavedObjectAttributes, SavedObjectsClientContract, @@ -23,22 +23,22 @@ import { } from '@kbn/core/server'; import type { ObjectType } from '@kbn/config-schema'; import type { PublicMethodsOf } from '@kbn/utility-types'; -import { SharePluginStart } from '@kbn/share-plugin/server'; +import type { SharePluginStart } from '@kbn/share-plugin/server'; import type { DefaultAlert, FieldMap } from '@kbn/alerts-as-data-utils'; -import { Alert } from '@kbn/alerts-as-data-utils'; -import { ActionsApiRequestHandlerContext } from '@kbn/actions-plugin/server'; -import { AlertsHealth } from '@kbn/alerting-types'; -import { RuleTypeRegistry as OrigruleTypeRegistry } from './rule_type_registry'; -import { AlertingServerSetup, AlertingServerStart } from './plugin'; -import { RulesClient } from './rules_client'; -import { +import type { Alert } from '@kbn/alerts-as-data-utils'; +import type { ActionsApiRequestHandlerContext } from '@kbn/actions-plugin/server'; +import type { AlertsHealth } from '@kbn/alerting-types'; +import type { RuleTypeRegistry as OrigruleTypeRegistry } from './rule_type_registry'; +import type { AlertingServerSetup, AlertingServerStart } from './plugin'; +import type { RulesClient } from './rules_client'; +import type { RulesSettingsClient, RulesSettingsFlappingClient, RulesSettingsQueryDelayClient, } from './rules_settings'; -import { MaintenanceWindowClient } from './maintenance_window_client'; +import type { MaintenanceWindowClient } from './maintenance_window_client'; export * from '../common'; -import { +import type { Rule, RuleTypeParams, RuleTypeState, @@ -51,10 +51,10 @@ import { SanitizedRule, RuleAlertData, } from '../common'; -import { PublicAlertFactory } from './alert/create_alert_factory'; -import { RulesSettingsFlappingProperties } from '../common/rules_settings'; -import { PublicAlertsClient } from './alerts_client/types'; -import { GetTimeRangeResult } from './lib/get_time_range'; +import type { PublicAlertFactory } from './alert/create_alert_factory'; +import type { RulesSettingsFlappingProperties } from '../common/rules_settings'; +import type { PublicAlertsClient } from './alerts_client/types'; +import type { GetTimeRangeResult } from './lib/get_time_range'; export type WithoutQueryAndParams = Pick>; export type SpaceIdToNamespaceFunction = (spaceId?: string) => string | undefined; export type { RuleTypeParams }; diff --git a/x-pack/platform/plugins/shared/alerting/server/usage/alerting_usage_collector.test.ts b/x-pack/platform/plugins/shared/alerting/server/usage/alerting_usage_collector.test.ts index b13e678ce4402..b7dd55207447f 100644 --- a/x-pack/platform/plugins/shared/alerting/server/usage/alerting_usage_collector.test.ts +++ b/x-pack/platform/plugins/shared/alerting/server/usage/alerting_usage_collector.test.ts @@ -5,10 +5,13 @@ * 2.0. */ -import { UsageCollectionSetup } from '@kbn/usage-collection-plugin/server'; +import type { UsageCollectionSetup } from '@kbn/usage-collection-plugin/server'; import { registerAlertingUsageCollector } from './alerting_usage_collector'; import { taskManagerMock } from '@kbn/task-manager-plugin/server/mocks'; -import { ConcreteTaskInstance, TaskManagerStartContract } from '@kbn/task-manager-plugin/server'; +import type { + ConcreteTaskInstance, + TaskManagerStartContract, +} from '@kbn/task-manager-plugin/server'; const taskManagerStart = taskManagerMock.createStart(); beforeEach(() => jest.resetAllMocks()); diff --git a/x-pack/platform/plugins/shared/alerting/server/usage/alerting_usage_collector.ts b/x-pack/platform/plugins/shared/alerting/server/usage/alerting_usage_collector.ts index 18c33051e4740..19b805b8bb763 100644 --- a/x-pack/platform/plugins/shared/alerting/server/usage/alerting_usage_collector.ts +++ b/x-pack/platform/plugins/shared/alerting/server/usage/alerting_usage_collector.ts @@ -5,10 +5,10 @@ * 2.0. */ -import { MakeSchemaFrom, UsageCollectionSetup } from '@kbn/usage-collection-plugin/server'; +import type { MakeSchemaFrom, UsageCollectionSetup } from '@kbn/usage-collection-plugin/server'; import { get } from 'lodash'; -import { TaskManagerStartContract } from '@kbn/task-manager-plugin/server'; -import { AlertingUsage } from './types'; +import type { TaskManagerStartContract } from '@kbn/task-manager-plugin/server'; +import type { AlertingUsage } from './types'; const byTypeSchema: MakeSchemaFrom['count_by_type'] = { // TODO: Find out an automated way to populate the keys or reformat these into an array (and change the Remote Telemetry indexer accordingly) diff --git a/x-pack/platform/plugins/shared/alerting/server/usage/lib/get_telemetry_from_alerts.test.ts b/x-pack/platform/plugins/shared/alerting/server/usage/lib/get_telemetry_from_alerts.test.ts index 36489e7b73747..447b8a6b74aec 100644 --- a/x-pack/platform/plugins/shared/alerting/server/usage/lib/get_telemetry_from_alerts.test.ts +++ b/x-pack/platform/plugins/shared/alerting/server/usage/lib/get_telemetry_from_alerts.test.ts @@ -6,7 +6,8 @@ */ import { elasticsearchServiceMock, loggingSystemMock } from '@kbn/core/server/mocks'; -import { MockedLogger, loggerMock } from '@kbn/logging-mocks'; +import type { MockedLogger } from '@kbn/logging-mocks'; +import { loggerMock } from '@kbn/logging-mocks'; import { getTotalAlertsCountAggregations } from './get_telemetry_from_alerts'; import { errors } from '@elastic/elasticsearch'; diff --git a/x-pack/platform/plugins/shared/alerting/server/usage/lib/get_telemetry_from_alerts.ts b/x-pack/platform/plugins/shared/alerting/server/usage/lib/get_telemetry_from_alerts.ts index 494bcf1d6abc1..c98f13fdc698f 100644 --- a/x-pack/platform/plugins/shared/alerting/server/usage/lib/get_telemetry_from_alerts.ts +++ b/x-pack/platform/plugins/shared/alerting/server/usage/lib/get_telemetry_from_alerts.ts @@ -9,11 +9,11 @@ import type { AggregationsTermsAggregateBase, AggregationsStringTermsBucketKeys, } from '@elastic/elasticsearch/lib/api/types'; -import { ElasticsearchClient, Logger } from '@kbn/core/server'; +import type { ElasticsearchClient, Logger } from '@kbn/core/server'; import { NUM_ALERTING_RULE_TYPES } from '../alerting_usage_collector'; import { parseSimpleRuleTypeBucket } from './parse_simple_rule_type_bucket'; -import { AlertingUsage } from '../types'; +import type { AlertingUsage } from '../types'; import { parseAndLogError } from './parse_and_log_error'; interface Opts { diff --git a/x-pack/platform/plugins/shared/alerting/server/usage/lib/get_telemetry_from_event_log.test.ts b/x-pack/platform/plugins/shared/alerting/server/usage/lib/get_telemetry_from_event_log.test.ts index 4c445cf595891..d4c0d400c0585 100644 --- a/x-pack/platform/plugins/shared/alerting/server/usage/lib/get_telemetry_from_event_log.test.ts +++ b/x-pack/platform/plugins/shared/alerting/server/usage/lib/get_telemetry_from_event_log.test.ts @@ -6,7 +6,8 @@ */ import { elasticsearchServiceMock, loggingSystemMock } from '@kbn/core/server/mocks'; -import { MockedLogger, loggerMock } from '@kbn/logging-mocks'; +import type { MockedLogger } from '@kbn/logging-mocks'; +import { loggerMock } from '@kbn/logging-mocks'; import { errors } from '@elastic/elasticsearch'; import { getExecutionsPerDayCount, diff --git a/x-pack/platform/plugins/shared/alerting/server/usage/lib/get_telemetry_from_event_log.ts b/x-pack/platform/plugins/shared/alerting/server/usage/lib/get_telemetry_from_event_log.ts index 7862ee91c8f72..e99f032796194 100644 --- a/x-pack/platform/plugins/shared/alerting/server/usage/lib/get_telemetry_from_event_log.ts +++ b/x-pack/platform/plugins/shared/alerting/server/usage/lib/get_telemetry_from_event_log.ts @@ -15,7 +15,7 @@ import type { AggregationsStringTermsBucketKeys, AggregationsBuckets, } from '@elastic/elasticsearch/lib/api/types'; -import { ElasticsearchClient, Logger } from '@kbn/core/server'; +import type { ElasticsearchClient, Logger } from '@kbn/core/server'; import { NUM_ALERTING_RULE_TYPES, NUM_ALERTING_EXECUTION_FAILURE_REASON_TYPES, @@ -566,8 +566,8 @@ export function parseExecutionCountAggregationResults(results: { function getProviderAndActionFilterForTimeRange( action: string, - provider: string = 'alerting', - range: string = '1d' + provider = 'alerting', + range = '1d' ) { return { bool: { diff --git a/x-pack/platform/plugins/shared/alerting/server/usage/lib/get_telemetry_from_kibana.test.ts b/x-pack/platform/plugins/shared/alerting/server/usage/lib/get_telemetry_from_kibana.test.ts index 5e53b7e83aa0a..035d40e2e0f5b 100644 --- a/x-pack/platform/plugins/shared/alerting/server/usage/lib/get_telemetry_from_kibana.test.ts +++ b/x-pack/platform/plugins/shared/alerting/server/usage/lib/get_telemetry_from_kibana.test.ts @@ -7,7 +7,8 @@ import { errors } from '@elastic/elasticsearch'; import { elasticsearchServiceMock, loggingSystemMock } from '@kbn/core/server/mocks'; -import { MockedLogger, loggerMock } from '@kbn/logging-mocks'; +import type { MockedLogger } from '@kbn/logging-mocks'; +import { loggerMock } from '@kbn/logging-mocks'; import { getTotalCountAggregations, getTotalCountInUse, @@ -15,7 +16,7 @@ import { } from './get_telemetry_from_kibana'; import { savedObjectsClientMock } from '@kbn/core/server/mocks'; import { MAINTENANCE_WINDOW_SAVED_OBJECT_TYPE } from '../../../common'; -import { ISavedObjectsRepository } from '@kbn/core/server'; +import type { ISavedObjectsRepository } from '@kbn/core/server'; const elasticsearch = elasticsearchServiceMock.createStart(); const esClient = elasticsearch.client.asInternalUser; diff --git a/x-pack/platform/plugins/shared/alerting/server/usage/lib/get_telemetry_from_kibana.ts b/x-pack/platform/plugins/shared/alerting/server/usage/lib/get_telemetry_from_kibana.ts index 2f285e17e9cb2..28742bef62df3 100644 --- a/x-pack/platform/plugins/shared/alerting/server/usage/lib/get_telemetry_from_kibana.ts +++ b/x-pack/platform/plugins/shared/alerting/server/usage/lib/get_telemetry_from_kibana.ts @@ -11,20 +11,18 @@ import type { AggregationsTermsAggregateBase, AggregationsStringTermsBucketKeys, } from '@elastic/elasticsearch/lib/api/types'; -import { ElasticsearchClient, Logger, ISavedObjectsRepository } from '@kbn/core/server'; +import type { ElasticsearchClient, Logger, ISavedObjectsRepository } from '@kbn/core/server'; -import { - ConnectorsByConsumersBucket, - groupConnectorsByConsumers, -} from './group_connectors_by_consumers'; +import type { ConnectorsByConsumersBucket } from './group_connectors_by_consumers'; +import { groupConnectorsByConsumers } from './group_connectors_by_consumers'; import { groupRulesByNotifyWhen } from './group_rules_by_notify_when'; import { groupRulesByStatus } from './group_rules_by_status'; -import { AlertingUsage } from '../types'; +import type { AlertingUsage } from '../types'; import { NUM_ALERTING_RULE_TYPES } from '../alerting_usage_collector'; import { parseSimpleRuleTypeBucket } from './parse_simple_rule_type_bucket'; import { groupRulesBySearchType } from './group_rules_by_search_type'; import { MAINTENANCE_WINDOW_SAVED_OBJECT_TYPE } from '../../../common'; -import { MaintenanceWindowAttributes } from '../../data/maintenance_window/types'; +import type { MaintenanceWindowAttributes } from '../../data/maintenance_window/types'; import { parseAndLogError } from './parse_and_log_error'; interface Opts { diff --git a/x-pack/platform/plugins/shared/alerting/server/usage/lib/get_telemetry_from_task_manager.test.ts b/x-pack/platform/plugins/shared/alerting/server/usage/lib/get_telemetry_from_task_manager.test.ts index a084788630d0d..4db586f84558b 100644 --- a/x-pack/platform/plugins/shared/alerting/server/usage/lib/get_telemetry_from_task_manager.test.ts +++ b/x-pack/platform/plugins/shared/alerting/server/usage/lib/get_telemetry_from_task_manager.test.ts @@ -7,7 +7,8 @@ import { errors } from '@elastic/elasticsearch'; import { elasticsearchServiceMock, loggingSystemMock } from '@kbn/core/server/mocks'; -import { MockedLogger, loggerMock } from '@kbn/logging-mocks'; +import type { MockedLogger } from '@kbn/logging-mocks'; +import { loggerMock } from '@kbn/logging-mocks'; import { getFailedAndUnrecognizedTasksPerDay, parseBucket, diff --git a/x-pack/platform/plugins/shared/alerting/server/usage/lib/get_telemetry_from_task_manager.ts b/x-pack/platform/plugins/shared/alerting/server/usage/lib/get_telemetry_from_task_manager.ts index adddb7cd7ee2d..8df5f7ad6d15b 100644 --- a/x-pack/platform/plugins/shared/alerting/server/usage/lib/get_telemetry_from_task_manager.ts +++ b/x-pack/platform/plugins/shared/alerting/server/usage/lib/get_telemetry_from_task_manager.ts @@ -11,7 +11,7 @@ import type { AggregationsStringTermsBucketKeys, AggregationsBuckets, } from '@elastic/elasticsearch/lib/api/types'; -import { ElasticsearchClient, Logger } from '@kbn/core/server'; +import type { ElasticsearchClient, Logger } from '@kbn/core/server'; import { replaceDotSymbols } from './replace_dots_with_underscores'; import { NUM_ALERTING_RULE_TYPES } from '../alerting_usage_collector'; import { parseAndLogError } from './parse_and_log_error'; diff --git a/x-pack/platform/plugins/shared/alerting/server/usage/lib/group_connectors_by_consumers.ts b/x-pack/platform/plugins/shared/alerting/server/usage/lib/group_connectors_by_consumers.ts index 21c7a9b4737d4..bb0d7855bf4f5 100644 --- a/x-pack/platform/plugins/shared/alerting/server/usage/lib/group_connectors_by_consumers.ts +++ b/x-pack/platform/plugins/shared/alerting/server/usage/lib/group_connectors_by_consumers.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { AggregationsBuckets } from '@elastic/elasticsearch/lib/api/types'; +import type { AggregationsBuckets } from '@elastic/elasticsearch/lib/api/types'; import { replaceDotSymbols } from './replace_dots_with_underscores'; export interface ConnectorsByConsumersBucket { diff --git a/x-pack/platform/plugins/shared/alerting/server/usage/lib/group_rules_by_notify_when.ts b/x-pack/platform/plugins/shared/alerting/server/usage/lib/group_rules_by_notify_when.ts index 3adc9c73f9a72..3ce8e072d1f40 100644 --- a/x-pack/platform/plugins/shared/alerting/server/usage/lib/group_rules_by_notify_when.ts +++ b/x-pack/platform/plugins/shared/alerting/server/usage/lib/group_rules_by_notify_when.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { AlertingUsage } from '../types'; +import type { AlertingUsage } from '../types'; export function groupRulesByNotifyWhen( rulesByNotifyWhen: Record diff --git a/x-pack/platform/plugins/shared/alerting/server/usage/lib/group_rules_by_search_type.ts b/x-pack/platform/plugins/shared/alerting/server/usage/lib/group_rules_by_search_type.ts index b97ac049c2374..e1cb542486d20 100644 --- a/x-pack/platform/plugins/shared/alerting/server/usage/lib/group_rules_by_search_type.ts +++ b/x-pack/platform/plugins/shared/alerting/server/usage/lib/group_rules_by_search_type.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { AlertingUsage } from '../types'; +import type { AlertingUsage } from '../types'; export function groupRulesBySearchType( rulesBySearchType: Record diff --git a/x-pack/platform/plugins/shared/alerting/server/usage/lib/group_rules_by_status.ts b/x-pack/platform/plugins/shared/alerting/server/usage/lib/group_rules_by_status.ts index a4b114b0cb85f..7996e0254903f 100644 --- a/x-pack/platform/plugins/shared/alerting/server/usage/lib/group_rules_by_status.ts +++ b/x-pack/platform/plugins/shared/alerting/server/usage/lib/group_rules_by_status.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { AlertingUsage } from '../types'; +import type { AlertingUsage } from '../types'; export function groupRulesByStatus( rulesByStatus: Record diff --git a/x-pack/platform/plugins/shared/alerting/server/usage/lib/parse_and_log_error.ts b/x-pack/platform/plugins/shared/alerting/server/usage/lib/parse_and_log_error.ts index 2f7eaccbd7cb7..e2e06d2a9d436 100644 --- a/x-pack/platform/plugins/shared/alerting/server/usage/lib/parse_and_log_error.ts +++ b/x-pack/platform/plugins/shared/alerting/server/usage/lib/parse_and_log_error.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { Logger } from '@kbn/core/server'; +import type { Logger } from '@kbn/core/server'; export function parseAndLogError(err: Error, errType: string, logger: Logger): string { const errorMessage = err && err.message ? err.message : err.toString(); diff --git a/x-pack/platform/plugins/shared/alerting/server/usage/lib/parse_simple_rule_type_bucket.ts b/x-pack/platform/plugins/shared/alerting/server/usage/lib/parse_simple_rule_type_bucket.ts index 8af7fc6d5e15b..f57d96734238b 100644 --- a/x-pack/platform/plugins/shared/alerting/server/usage/lib/parse_simple_rule_type_bucket.ts +++ b/x-pack/platform/plugins/shared/alerting/server/usage/lib/parse_simple_rule_type_bucket.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { +import type { AggregationsBuckets, AggregationsStringTermsBucketKeys, } from '@elastic/elasticsearch/lib/api/types'; diff --git a/x-pack/platform/plugins/shared/alerting/server/usage/task.ts b/x-pack/platform/plugins/shared/alerting/server/usage/task.ts index 9767574cab0a0..0be49ffd48356 100644 --- a/x-pack/platform/plugins/shared/alerting/server/usage/task.ts +++ b/x-pack/platform/plugins/shared/alerting/server/usage/task.ts @@ -5,8 +5,8 @@ * 2.0. */ -import { Logger, CoreSetup } from '@kbn/core/server'; -import { +import type { Logger, CoreSetup } from '@kbn/core/server'; +import type { RunContext, TaskManagerSetupContract, TaskManagerStartContract, diff --git a/x-pack/platform/plugins/shared/alerting/server/usage/task_state.ts b/x-pack/platform/plugins/shared/alerting/server/usage/task_state.ts index 3b33e540914ce..ee4e0377f1ec4 100644 --- a/x-pack/platform/plugins/shared/alerting/server/usage/task_state.ts +++ b/x-pack/platform/plugins/shared/alerting/server/usage/task_state.ts @@ -5,7 +5,8 @@ * 2.0. */ -import { schema, TypeOf } from '@kbn/config-schema'; +import type { TypeOf } from '@kbn/config-schema'; +import { schema } from '@kbn/config-schema'; /** * WARNING: Do not modify the existing versioned schema(s) below, instead define a new version (ex: 2, 3, 4).