[ResponseOps] consistent-type-imports linting rule for RO packages/plugins - PR1 (#212348)

- Enabled @typescript-eslint/consistent-type-imports eslint rule for
ResponseOps packages and plugins:
- this rule ensures that imports used only for type declarations are
consistently written using `import type ` syntax
   
- fixed eslint errors for:
    - `src/platform/packages/shared/response-ops`
    - `x-pack/platform/plugins/shared/alerting`

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
This commit is contained in:
Georgiana-Andreea Onoleață 2025-03-11 14:56:45 +02:00 committed by GitHub
parent 914533f4d3
commit ec3b18662a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
868 changed files with 2848 additions and 2766 deletions

View file

@ -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
*/

View file

@ -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';

View file

@ -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 {

View file

@ -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 {

View file

@ -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<ResponseErrorBody>;

View file

@ -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`

View file

@ -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 = {

View file

@ -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';

View file

@ -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 = [

View file

@ -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';

View file

@ -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';

View file

@ -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;

View file

@ -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';

View file

@ -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]

View file

@ -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;

View file

@ -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';

View file

@ -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();

View file

@ -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<AdditionalContext>['bulkActionsStore'];

View file

@ -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';

View file

@ -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 }]));

View file

@ -20,7 +20,7 @@ import type {
RefAttributes,
SetStateAction,
} from 'react';
import {
import type {
AlertConsumers,
ALERT_CASE_IDS,
ALERT_STATUS,

View file

@ -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

View file

@ -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<IStorage> => {

View file

@ -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

View file

@ -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;
/**

View file

@ -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();

View file

@ -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';

View file

@ -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) {

View file

@ -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<Params extends RuleTypeParams = RuleTypeParams> {
name: Rule<Params>['name'];

View file

@ -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';

View file

@ -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<UiConfig> => {
return http.get<UiConfig>(`${BASE_TRIGGERS_ACTIONS_UI_API_PATH}/_config`);

View file

@ -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,

View file

@ -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<RuleTypeParams> = {
params: {

View file

@ -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) {

View file

@ -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();

View file

@ -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<keyof UpdateRuleBody> = [
'name',

View file

@ -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;

View file

@ -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;

View file

@ -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;

View file

@ -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;

View file

@ -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,

View file

@ -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 '..';

View file

@ -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';

View file

@ -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,

View file

@ -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 =

View file

@ -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: (

View file

@ -8,7 +8,7 @@
*/
import { countBy } from 'lodash';
import {
import type {
RuleTypeIndexWithDescriptions,
RuleTypeCountsByProducer,
RuleTypeWithDescription,

View file

@ -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,

View file

@ -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,

View file

@ -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<{

View file

@ -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 = ({

View file

@ -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', () => {

View file

@ -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';

View file

@ -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)) {

View file

@ -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', () => {

View file

@ -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',

View file

@ -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', () => {

View file

@ -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,

View file

@ -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 = {

View file

@ -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,

View file

@ -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', () => {

View file

@ -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:

View file

@ -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 {

View file

@ -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

View file

@ -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({

View file

@ -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({

View file

@ -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 {

View file

@ -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 }),

View file

@ -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';

View file

@ -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';

View file

@ -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(

View file

@ -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(
{

View file

@ -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 {

View file

@ -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({

View file

@ -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()),

View file

@ -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()),

View file

@ -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()),

View file

@ -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()),

View file

@ -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.' },

View file

@ -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';

View file

@ -5,7 +5,7 @@
* 2.0.
*/
import { Rule } from './rule';
import type { Rule } from './rule';
export type BulkEditSkipReason = 'RULE_NOT_MODIFIED';

View file

@ -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',

View file

@ -6,6 +6,6 @@
*/
import type { TypeOf } from '@kbn/config-schema';
import { deleteParamsSchemaV1 } from '..';
import type { deleteParamsSchemaV1 } from '..';
export type DeleteBackfillRequestParams = TypeOf<typeof deleteParamsSchemaV1>;

View file

@ -6,7 +6,7 @@
*/
import type { TypeOf } from '@kbn/config-schema';
import { findQuerySchemaV1, findResponseSchemaV1 } from '..';
import type { findQuerySchemaV1, findResponseSchemaV1 } from '..';
export type FindBackfillRequestQuery = TypeOf<typeof findQuerySchemaV1>;
export type FindBackfillResponseBody = TypeOf<typeof findResponseSchemaV1>;

View file

@ -6,7 +6,7 @@
*/
import type { TypeOf } from '@kbn/config-schema';
import { getParamsSchemaV1, getResponseSchemaV1 } from '..';
import type { getParamsSchemaV1, getResponseSchemaV1 } from '..';
export type GetBackfillRequestParams = TypeOf<typeof getParamsSchemaV1>;
export type GetBackfillResponseBody = TypeOf<typeof getResponseSchemaV1>;

View file

@ -6,7 +6,7 @@
*/
import type { TypeOf } from '@kbn/config-schema';
import { scheduleBodySchemaV1, scheduleResponseSchemaV1 } from '..';
import type { scheduleBodySchemaV1, scheduleResponseSchemaV1 } from '..';
export type ScheduleBackfillRequestBody = TypeOf<typeof scheduleBodySchemaV1>;
export type ScheduleBackfillResponseBody = TypeOf<typeof scheduleResponseSchemaV1>;

View file

@ -6,7 +6,7 @@
*/
import type { TypeOf } from '@kbn/config-schema';
import { backfillResponseSchemaV1, errorResponseSchemaV1 } from '..';
import type { backfillResponseSchemaV1, errorResponseSchemaV1 } from '..';
export type BackfillResponse = TypeOf<typeof backfillResponseSchemaV1>;
export type ErrorResponse = TypeOf<typeof errorResponseSchemaV1>;

View file

@ -7,7 +7,7 @@
import type { TypeOf } from '@kbn/config-schema';
import { healthFrameworkResponseBodySchemaV1, healthFrameworkResponseSchemaV1 } from '..';
import type { healthFrameworkResponseBodySchemaV1, healthFrameworkResponseSchemaV1 } from '..';
export type HealthFrameworkResponseBody = TypeOf<typeof healthFrameworkResponseBodySchemaV1>;
export type HealthFrameworkResponse = TypeOf<typeof healthFrameworkResponseSchemaV1>;

View file

@ -6,6 +6,6 @@
*/
import type { TypeOf } from '@kbn/config-schema';
import { fillGapByIdQuerySchemaV1 } from '..';
import type { fillGapByIdQuerySchemaV1 } from '..';
export type FillGapByIdQuery = TypeOf<typeof fillGapByIdQuerySchemaV1>;

View file

@ -6,7 +6,7 @@
*/
import type { TypeOf } from '@kbn/config-schema';
import { findGapsBodySchemaV1, findGapsResponseSchemaV1 } from '..';
import type { findGapsBodySchemaV1, findGapsResponseSchemaV1 } from '..';
export type FindGapsRequestBody = TypeOf<typeof findGapsBodySchemaV1>;
export type FindGapsResponseBody = TypeOf<typeof findGapsResponseSchemaV1>;

View file

@ -6,7 +6,7 @@
*/
import type { TypeOf } from '@kbn/config-schema';
import { getGapsSummaryByRuleIdsBodySchema, getGapsSummaryByRuleIdsResponseSchema } from '..';
import type { getGapsSummaryByRuleIdsBodySchema, getGapsSummaryByRuleIdsResponseSchema } from '..';
export type GetGapsSummaryByRuleIdsBody = TypeOf<typeof getGapsSummaryByRuleIdsBodySchema>;
export type GetGapsSummaryByRuleIdsResponseBody = TypeOf<

View file

@ -6,7 +6,7 @@
*/
import type { TypeOf } from '@kbn/config-schema';
import { getRuleIdsWithGapBodySchemaV1, getRuleIdsWithGapResponseSchemaV1 } from '..';
import type { getRuleIdsWithGapBodySchemaV1, getRuleIdsWithGapResponseSchemaV1 } from '..';
export type GetRuleIdsWithGapBody = TypeOf<typeof getRuleIdsWithGapBodySchemaV1>;
export type GetRuleIdsWithGapResponseBody = TypeOf<typeof getRuleIdsWithGapResponseSchemaV1>;

View file

@ -6,7 +6,7 @@
*/
import type { TypeOf } from '@kbn/config-schema';
import { gapsResponseSchemaV1, errorResponseSchemaV1 } from '..';
import type { gapsResponseSchemaV1, errorResponseSchemaV1 } from '..';
export type GapsResponse = TypeOf<typeof gapsResponseSchemaV1>;
export type ErrorResponse = TypeOf<typeof errorResponseSchemaV1>;

View file

@ -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<typeof archiveBodySchemaV1>;
export type ArchiveMaintenanceWindowRequestParams = TypeOf<typeof archiveParamsSchemaV1>;

View file

@ -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<typeof bulkGetBodySchemaV1>;

View file

@ -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<typeof createBodySchemaV1>;

View file

@ -6,6 +6,6 @@
*/
import type { TypeOf } from '@kbn/config-schema';
import { deleteParamsSchemaV1 } from '..';
import type { deleteParamsSchemaV1 } from '..';
export type DeleteMaintenanceWindowRequestParams = TypeOf<typeof deleteParamsSchemaV1>;

View file

@ -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 '..';

View file

@ -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<typeof finishParamsSchemaV1>;

View file

@ -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<typeof getParamsSchemaV1>;

Some files were not shown because too many files have changed in this diff Show more