mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 17:28:26 -04:00
[8.x] [ResponseOps]consistent-type-imports linting rule for RO packages/plugins - PR3 (#212498) (#216311)
# Backport This will backport the following commits from `main` to `8.x`: - [[ResponseOps]consistent-type-imports linting rule for RO packages/plugins - PR3 (#212498)](https://github.com/elastic/kibana/pull/212498) <!--- Backport version: 9.6.6 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sorenlouv/backport) <!--BACKPORT [{"author":{"name":"Georgiana-Andreea Onoleață","email":"georgiana.onoleata@elastic.co"},"sourceCommit":{"committedDate":"2025-03-28T13:56:46Z","message":"[ResponseOps]consistent-type-imports linting rule for RO packages/plugins - PR3 (#212498)\n\n- Enabled @typescript-eslint/consistent-type-imports eslint rule for\nResponseOps packages and plugins:\n- this rule ensures that imports used only for type declarations are\nconsistently written using import type syntax\n \n- fixed type imports in:\n - x-pack/platform/plugins/shared/event_log\n - x-pack/platform/plugins/shared/rule_registry\n - x-pack/platform/plugins/shared/task_manager\n - x-pack/solutions/observability/packages/kbn-alerts-grouping\n - src/platform/packages/shared/kbn-alerts-ui-shared\n - src/platform/packages/shared/kbn-alerting-types\n - src/platform/packages/shared/kbn-cases-components\n - src/platform/packages/shared/kbn-actions-types\n - src/platform/packages/shared/kbn-alerts-as-data-utils\n - src/platform/packages/shared/kbn-grouping\n - src/platform/packages/shared/kbn-rrule\n - src/platform/packages/shared/kbn-rule-data-utils\n - src/platform/packages/shared/kbn-triggers-actions-ui-types\n - x-pack/platform/packages/shared/kbn-alerting-comparators\n\n---------\n\nCo-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>","sha":"5a6c01ff82cbc5038df5d20f65918d6b1aba27c6","branchLabelMapping":{"^v9.1.0$":"main","^v8.19.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","Team:ResponseOps","backport:version","v9.1.0","v8.19.0"],"title":"[ResponseOps]consistent-type-imports linting rule for RO packages/plugins - PR3 ","number":212498,"url":"https://github.com/elastic/kibana/pull/212498","mergeCommit":{"message":"[ResponseOps]consistent-type-imports linting rule for RO packages/plugins - PR3 (#212498)\n\n- Enabled @typescript-eslint/consistent-type-imports eslint rule for\nResponseOps packages and plugins:\n- this rule ensures that imports used only for type declarations are\nconsistently written using import type syntax\n \n- fixed type imports in:\n - x-pack/platform/plugins/shared/event_log\n - x-pack/platform/plugins/shared/rule_registry\n - x-pack/platform/plugins/shared/task_manager\n - x-pack/solutions/observability/packages/kbn-alerts-grouping\n - src/platform/packages/shared/kbn-alerts-ui-shared\n - src/platform/packages/shared/kbn-alerting-types\n - src/platform/packages/shared/kbn-cases-components\n - src/platform/packages/shared/kbn-actions-types\n - src/platform/packages/shared/kbn-alerts-as-data-utils\n - src/platform/packages/shared/kbn-grouping\n - src/platform/packages/shared/kbn-rrule\n - src/platform/packages/shared/kbn-rule-data-utils\n - src/platform/packages/shared/kbn-triggers-actions-ui-types\n - x-pack/platform/packages/shared/kbn-alerting-comparators\n\n---------\n\nCo-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>","sha":"5a6c01ff82cbc5038df5d20f65918d6b1aba27c6"}},"sourceBranch":"main","suggestedTargetBranches":["8.x"],"targetPullRequestStates":[{"branch":"main","label":"v9.1.0","branchLabelMappingKey":"^v9.1.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/212498","number":212498,"mergeCommit":{"message":"[ResponseOps]consistent-type-imports linting rule for RO packages/plugins - PR3 (#212498)\n\n- Enabled @typescript-eslint/consistent-type-imports eslint rule for\nResponseOps packages and plugins:\n- this rule ensures that imports used only for type declarations are\nconsistently written using import type syntax\n \n- fixed type imports in:\n - x-pack/platform/plugins/shared/event_log\n - x-pack/platform/plugins/shared/rule_registry\n - x-pack/platform/plugins/shared/task_manager\n - x-pack/solutions/observability/packages/kbn-alerts-grouping\n - src/platform/packages/shared/kbn-alerts-ui-shared\n - src/platform/packages/shared/kbn-alerting-types\n - src/platform/packages/shared/kbn-cases-components\n - src/platform/packages/shared/kbn-actions-types\n - src/platform/packages/shared/kbn-alerts-as-data-utils\n - src/platform/packages/shared/kbn-grouping\n - src/platform/packages/shared/kbn-rrule\n - src/platform/packages/shared/kbn-rule-data-utils\n - src/platform/packages/shared/kbn-triggers-actions-ui-types\n - x-pack/platform/packages/shared/kbn-alerting-comparators\n\n---------\n\nCo-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>","sha":"5a6c01ff82cbc5038df5d20f65918d6b1aba27c6"}},{"branch":"8.x","label":"v8.19.0","branchLabelMappingKey":"^v8.19.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}] BACKPORT--> --------- Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
This commit is contained in:
parent
95a3a772dc
commit
3e9c688cba
320 changed files with 1128 additions and 1064 deletions
16
.eslintrc.js
16
.eslintrc.js
|
@ -1637,11 +1637,9 @@ module.exports = {
|
|||
'@typescript-eslint/no-explicit-any': 'error',
|
||||
},
|
||||
},
|
||||
|
||||
/**
|
||||
* ResponseOps overrides
|
||||
*/
|
||||
|
||||
{
|
||||
files: [
|
||||
'src/platform/packages/shared/response-ops/**/*.{ts, tsx}',
|
||||
|
@ -1650,6 +1648,20 @@ module.exports = {
|
|||
'x-pack/platform/plugins/shared/stack_alerts/**/*.{ts, tsx}',
|
||||
'x-pack/platform/plugins/shared/stack_connectors/**/*.{ts, tsx}',
|
||||
'x-pack/platform/plugins/shared/triggers_actions_ui/**/*.{ts, tsx}',
|
||||
'x-pack/platform/plugins/shared/event_log/**/*.{ts, tsx}',
|
||||
'x-pack/platform/plugins/shared/rule_registry/**/*.{ts, tsx}',
|
||||
'x-pack/platform/plugins/shared/task_manager/**/*.{ts, tsx}',
|
||||
'x-pack/solutions/observability/packages/kbn-alerts-grouping/**/*.{ts, tsx}',
|
||||
'src/platform/packages/shared/kbn-alerts-ui-shared/**/*.{ts, tsx}',
|
||||
'src/platform/packages/shared/kbn-alerting-types/**/*.{ts, tsx}',
|
||||
'src/platform/packages/shared/kbn-cases-components/**/*.{ts, tsx}',
|
||||
'src/platform/packages/shared/kbn-actions-types/**/*.{ts, tsx}',
|
||||
'src/platform/packages/shared/kbn-alerts-as-data-utils/**/*.{ts, tsx}',
|
||||
'src/platform/packages/shared/kbn-grouping/**/*.{ts, tsx}',
|
||||
'src/platform/packages/shared/kbn-rrule/**/*.{ts, tsx}',
|
||||
'src/platform/packages/shared/kbn-rule-data-utils/**/*.{ts, tsx}',
|
||||
'src/platform/packages/shared/kbn-triggers-actions-ui-types/**/*.{ts, tsx}',
|
||||
'x-pack/platform/packages/shared/kbn-alerting-comparators/**/*.{ts, tsx}',
|
||||
'x-pack/platform/plugins/shared/embeddable_alerts_table/**/*.{ts,tsx}',
|
||||
'x-pack/test/alerting_api_integration/**/*.{ts, tsx}',
|
||||
'x-pack/test/cases_api_integration/**/*.{ts, tsx}',
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
* License v3.0 only", or the "Server Side Public License, v 1".
|
||||
*/
|
||||
|
||||
import { SerializedFieldFormat } from '@kbn/field-formats-plugin/common';
|
||||
import type { SerializedFieldFormat } from '@kbn/field-formats-plugin/common';
|
||||
import type { IFieldSubType } from '@kbn/es-query';
|
||||
import type { RuntimeField } from '@kbn/data-views-plugin/common';
|
||||
|
||||
|
|
|
@ -7,8 +7,8 @@
|
|||
* License v3.0 only", or the "Server Side Public License, v 1".
|
||||
*/
|
||||
|
||||
import { TechnicalRuleDataFieldName } from '@kbn/rule-data-utils';
|
||||
import { JsonValue } from '@kbn/utility-types';
|
||||
import type { TechnicalRuleDataFieldName } from '@kbn/rule-data-utils';
|
||||
import type { JsonValue } from '@kbn/utility-types';
|
||||
|
||||
export interface MetaAlertFields {
|
||||
_id: string;
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
*/
|
||||
|
||||
import { i18n } from '@kbn/i18n';
|
||||
import { ActionGroup } from './action_group_types';
|
||||
import type { ActionGroup } from './action_group_types';
|
||||
|
||||
export const RecoveredActionGroup: Readonly<ActionGroup<'recovered'>> = Object.freeze({
|
||||
id: 'recovered',
|
||||
|
|
|
@ -9,8 +9,8 @@
|
|||
|
||||
import type { LicenseType } from '@kbn/licensing-plugin/common/types';
|
||||
import type { RecoveredActionGroupId, DefaultActionGroupId } from './builtin_action_groups_types';
|
||||
import { ActionGroup } from './action_group_types';
|
||||
import { ActionVariable } from './action_variable';
|
||||
import type { ActionGroup } from './action_group_types';
|
||||
import type { ActionVariable } from './action_variable';
|
||||
|
||||
interface ConsumerPrivileges {
|
||||
read: boolean;
|
||||
|
|
|
@ -51,7 +51,7 @@ import {
|
|||
TAGS,
|
||||
ALERT_INTENDED_TIMESTAMP,
|
||||
} from '@kbn/rule-data-utils';
|
||||
import { MultiField } from './types';
|
||||
import type { MultiField } from './types';
|
||||
|
||||
export const alertFieldMap = {
|
||||
[ALERT_ACTION_GROUP]: {
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
*/
|
||||
|
||||
import { EcsFlat } from '@elastic/ecs';
|
||||
import { EcsMetadata, FieldMap } from './types';
|
||||
import type { EcsMetadata, FieldMap } from './types';
|
||||
|
||||
const EXCLUDED_TYPES = ['constant_keyword'];
|
||||
|
||||
|
|
|
@ -11,8 +11,9 @@ import fs from 'fs';
|
|||
import path from 'path';
|
||||
import { set } from '@kbn/safer-lodash-set';
|
||||
import { get } from 'lodash';
|
||||
import { FieldMap } from '../..';
|
||||
import { createLineWriter, LineWriter } from './lib/line_writer';
|
||||
import type { FieldMap } from '../..';
|
||||
import type { LineWriter } from './lib/line_writer';
|
||||
import { createLineWriter } from './lib/line_writer';
|
||||
|
||||
const PLUGIN_DIR = path.resolve(path.join(__dirname, '..'));
|
||||
|
||||
|
@ -266,7 +267,7 @@ const SchemaFileTemplate = `
|
|||
// this file was generated, and should not be edited by hand
|
||||
// ---------------------------------- WARNING ----------------------------------
|
||||
import * as rt from 'io-ts';
|
||||
import { Either } from 'fp-ts/lib/Either';
|
||||
import type { Either } from 'fp-ts/lib/Either';
|
||||
%%IMPORTS%%
|
||||
const ISO_DATE_PATTERN = /^d{4}-d{2}-d{2}Td{2}:d{2}:d{2}.d{3}Z$/;
|
||||
export const IsoDateString = new rt.Type<string, string, unknown>(
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
// this file was generated, and should not be edited by hand
|
||||
// ---------------------------------- WARNING ----------------------------------
|
||||
import * as rt from 'io-ts';
|
||||
import { Either } from 'fp-ts/lib/Either';
|
||||
import type { Either } from 'fp-ts/lib/Either';
|
||||
|
||||
const ISO_DATE_PATTERN = /^d{4}-d{2}-d{2}Td{2}:d{2}:d{2}.d{3}Z$/;
|
||||
export const IsoDateString = new rt.Type<string, string, unknown>(
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
// this file was generated, and should not be edited by hand
|
||||
// ---------------------------------- WARNING ----------------------------------
|
||||
import * as rt from 'io-ts';
|
||||
import { Either } from 'fp-ts/lib/Either';
|
||||
import type { Either } from 'fp-ts/lib/Either';
|
||||
import { AlertSchema } from './alert_schema';
|
||||
const ISO_DATE_PATTERN = /^d{4}-d{2}-d{2}Td{2}:d{2}:d{2}.d{3}Z$/;
|
||||
export const IsoDateString = new rt.Type<string, string, unknown>(
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
// this file was generated, and should not be edited by hand
|
||||
// ---------------------------------- WARNING ----------------------------------
|
||||
import * as rt from 'io-ts';
|
||||
import { Either } from 'fp-ts/lib/Either';
|
||||
import type { Either } from 'fp-ts/lib/Either';
|
||||
|
||||
const ISO_DATE_PATTERN = /^d{4}-d{2}-d{2}Td{2}:d{2}:d{2}.d{3}Z$/;
|
||||
export const IsoDateString = new rt.Type<string, string, unknown>(
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
// this file was generated, and should not be edited by hand
|
||||
// ---------------------------------- WARNING ----------------------------------
|
||||
import * as rt from 'io-ts';
|
||||
import { Either } from 'fp-ts/lib/Either';
|
||||
import type { Either } from 'fp-ts/lib/Either';
|
||||
|
||||
const ISO_DATE_PATTERN = /^d{4}-d{2}-d{2}Td{2}:d{2}:d{2}.d{3}Z$/;
|
||||
export const IsoDateString = new rt.Type<string, string, unknown>(
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
// this file was generated, and should not be edited by hand
|
||||
// ---------------------------------- WARNING ----------------------------------
|
||||
import * as rt from 'io-ts';
|
||||
import { Either } from 'fp-ts/lib/Either';
|
||||
import type { Either } from 'fp-ts/lib/Either';
|
||||
import { AlertSchema } from './alert_schema';
|
||||
const ISO_DATE_PATTERN = /^d{4}-d{2}-d{2}Td{2}:d{2}:d{2}.d{3}Z$/;
|
||||
export const IsoDateString = new rt.Type<string, string, unknown>(
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
// this file was generated, and should not be edited by hand
|
||||
// ---------------------------------- WARNING ----------------------------------
|
||||
import * as rt from 'io-ts';
|
||||
import { Either } from 'fp-ts/lib/Either';
|
||||
import type { Either } from 'fp-ts/lib/Either';
|
||||
import { AlertSchema } from './alert_schema';
|
||||
const ISO_DATE_PATTERN = /^d{4}-d{2}-d{2}Td{2}:d{2}:d{2}.d{3}Z$/;
|
||||
export const IsoDateString = new rt.Type<string, string, unknown>(
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
// this file was generated, and should not be edited by hand
|
||||
// ---------------------------------- WARNING ----------------------------------
|
||||
import * as rt from 'io-ts';
|
||||
import { Either } from 'fp-ts/lib/Either';
|
||||
import type { Either } from 'fp-ts/lib/Either';
|
||||
import { AlertSchema } from './alert_schema';
|
||||
import { LegacyAlertSchema } from './legacy_alert_schema';
|
||||
const ISO_DATE_PATTERN = /^d{4}-d{2}-d{2}Td{2}:d{2}:d{2}.d{3}Z$/;
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
// this file was generated, and should not be edited by hand
|
||||
// ---------------------------------- WARNING ----------------------------------
|
||||
import * as rt from 'io-ts';
|
||||
import { Either } from 'fp-ts/lib/Either';
|
||||
import type { Either } from 'fp-ts/lib/Either';
|
||||
import { AlertSchema } from './alert_schema';
|
||||
import { EcsSchema } from './ecs_schema';
|
||||
import { LegacyAlertSchema } from './legacy_alert_schema';
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
// this file was generated, and should not be edited by hand
|
||||
// ---------------------------------- WARNING ----------------------------------
|
||||
import * as rt from 'io-ts';
|
||||
import { Either } from 'fp-ts/lib/Either';
|
||||
import type { Either } from 'fp-ts/lib/Either';
|
||||
import { AlertSchema } from './alert_schema';
|
||||
import { EcsSchema } from './ecs_schema';
|
||||
import { LegacyAlertSchema } from './legacy_alert_schema';
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
// this file was generated, and should not be edited by hand
|
||||
// ---------------------------------- WARNING ----------------------------------
|
||||
import * as rt from 'io-ts';
|
||||
import { Either } from 'fp-ts/lib/Either';
|
||||
import type { Either } from 'fp-ts/lib/Either';
|
||||
import { AlertSchema } from './alert_schema';
|
||||
import { EcsSchema } from './ecs_schema';
|
||||
import { LegacyAlertSchema } from './legacy_alert_schema';
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
// this file was generated, and should not be edited by hand
|
||||
// ---------------------------------- WARNING ----------------------------------
|
||||
import * as rt from 'io-ts';
|
||||
import { Either } from 'fp-ts/lib/Either';
|
||||
import type { Either } from 'fp-ts/lib/Either';
|
||||
import { AlertSchema } from './alert_schema';
|
||||
import { EcsSchema } from './ecs_schema';
|
||||
const ISO_DATE_PATTERN = /^d{4}-d{2}-d{2}Td{2}:d{2}:d{2}.d{3}Z$/;
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
// this file was generated, and should not be edited by hand
|
||||
// ---------------------------------- WARNING ----------------------------------
|
||||
import * as rt from 'io-ts';
|
||||
import { Either } from 'fp-ts/lib/Either';
|
||||
import type { Either } from 'fp-ts/lib/Either';
|
||||
import { AlertSchema } from './alert_schema';
|
||||
import { LegacyAlertSchema } from './legacy_alert_schema';
|
||||
const ISO_DATE_PATTERN = /^d{4}-d{2}-d{2}Td{2}:d{2}:d{2}.d{3}Z$/;
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
// this file was generated, and should not be edited by hand
|
||||
// ---------------------------------- WARNING ----------------------------------
|
||||
import * as rt from 'io-ts';
|
||||
import { Either } from 'fp-ts/lib/Either';
|
||||
import type { Either } from 'fp-ts/lib/Either';
|
||||
import { AlertSchema } from './alert_schema';
|
||||
import { EcsSchema } from './ecs_schema';
|
||||
import { LegacyAlertSchema } from './legacy_alert_schema';
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
// this file was generated, and should not be edited by hand
|
||||
// ---------------------------------- WARNING ----------------------------------
|
||||
import * as rt from 'io-ts';
|
||||
import { Either } from 'fp-ts/lib/Either';
|
||||
import type { Either } from 'fp-ts/lib/Either';
|
||||
import { AlertSchema } from './alert_schema';
|
||||
import { EcsSchema } from './ecs_schema';
|
||||
const ISO_DATE_PATTERN = /^d{4}-d{2}-d{2}Td{2}:d{2}:d{2}.d{3}Z$/;
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
// this file was generated, and should not be edited by hand
|
||||
// ---------------------------------- WARNING ----------------------------------
|
||||
import * as rt from 'io-ts';
|
||||
import { Either } from 'fp-ts/lib/Either';
|
||||
import type { Either } from 'fp-ts/lib/Either';
|
||||
import { AlertSchema } from './alert_schema';
|
||||
const ISO_DATE_PATTERN = /^d{4}-d{2}-d{2}Td{2}:d{2}:d{2}.d{3}Z$/;
|
||||
export const IsoDateString = new rt.Type<string, string, unknown>(
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
* License v3.0 only", or the "Server Side Public License, v 1".
|
||||
*/
|
||||
|
||||
import {
|
||||
import type {
|
||||
ActionContextVariablesFlatten,
|
||||
ActionVariable,
|
||||
SummaryActionContextVariablesFlatten,
|
||||
|
|
|
@ -8,8 +8,11 @@
|
|||
*/
|
||||
|
||||
import { partition } from 'lodash';
|
||||
import { ActionVariable } from '@kbn/alerting-types';
|
||||
import { ActionGroupWithMessageVariables, ActionVariables } from '@kbn/triggers-actions-ui-types';
|
||||
import type { ActionVariable } from '@kbn/alerting-types';
|
||||
import type {
|
||||
ActionGroupWithMessageVariables,
|
||||
ActionVariables,
|
||||
} from '@kbn/triggers-actions-ui-types';
|
||||
import { transformActionVariables } from './transforms';
|
||||
|
||||
export const getAvailableActionVariables = (
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
* License v3.0 only", or the "Server Side Public License, v 1".
|
||||
*/
|
||||
|
||||
import { ActionVariables, RuleType } from '@kbn/triggers-actions-ui-types';
|
||||
import type { ActionVariables, RuleType } from '@kbn/triggers-actions-ui-types';
|
||||
import { transformActionVariables } from './transforms';
|
||||
import { ALERTING_FEATURE_ID } from '../common/constants';
|
||||
|
||||
|
|
|
@ -7,10 +7,9 @@
|
|||
* 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 type { ActionVariables, OmitMessageVariablesType } from '@kbn/triggers-actions-ui-types';
|
||||
import {
|
||||
ActionVariables,
|
||||
OmitMessageVariablesType,
|
||||
REQUIRED_ACTION_VARIABLES,
|
||||
CONTEXT_ACTION_VARIABLES,
|
||||
} from '@kbn/triggers-actions-ui-types';
|
||||
|
|
|
@ -8,9 +8,9 @@
|
|||
*/
|
||||
|
||||
import { ALERT_RULE_NAME, ALERT_STATUS } from '@kbn/rule-data-utils';
|
||||
import { OptionsListControlState } from '@kbn/controls-plugin/public';
|
||||
import type { OptionsListControlState } from '@kbn/controls-plugin/public';
|
||||
import { i18n } from '@kbn/i18n';
|
||||
import { FilterControlConfig } from './types';
|
||||
import type { FilterControlConfig } from './types';
|
||||
|
||||
export const DEFAULT_CONTROLS: FilterControlConfig[] = [
|
||||
{
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
* License v3.0 only", or the "Server Side Public License, v 1".
|
||||
*/
|
||||
|
||||
import { ControlGroupRuntimeState } from '@kbn/controls-plugin/public';
|
||||
import type { ControlGroupRuntimeState } from '@kbn/controls-plugin/public';
|
||||
import type { Storage } from '@kbn/kibana-utils-plugin/public';
|
||||
import { useEffect, useRef, useState } from 'react';
|
||||
import type { Dispatch, SetStateAction } from 'react';
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
* License v3.0 only", or the "Server Side Public License, v 1".
|
||||
*/
|
||||
|
||||
import { ViewMode } from '@kbn/presentation-publishing';
|
||||
import type { ViewMode } from '@kbn/presentation-publishing';
|
||||
import { useCallback, useEffect, useState } from 'react';
|
||||
|
||||
interface UseViewEditModeArgs {
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
*/
|
||||
|
||||
import type { ControlGroupRuntimeState } from '@kbn/controls-plugin/public';
|
||||
import { Filter } from '@kbn/es-query';
|
||||
import type { Filter } from '@kbn/es-query';
|
||||
import { BehaviorSubject } from 'rxjs';
|
||||
|
||||
export const controlGroupFilterOutputMock$ = new BehaviorSubject<Filter[] | undefined>([]);
|
||||
|
|
|
@ -7,8 +7,11 @@
|
|||
* License v3.0 only", or the "Server Side Public License, v 1".
|
||||
*/
|
||||
|
||||
import { ControlGroupRuntimeState, OptionsListControlState } from '@kbn/controls-plugin/public';
|
||||
import { Filter } from '@kbn/es-query';
|
||||
import type {
|
||||
ControlGroupRuntimeState,
|
||||
OptionsListControlState,
|
||||
} from '@kbn/controls-plugin/public';
|
||||
import type { Filter } from '@kbn/es-query';
|
||||
import { ALERT_DURATION, ALERT_RULE_NAME, ALERT_START, ALERT_STATUS } from '@kbn/rule-data-utils';
|
||||
|
||||
export interface ControlGroupOutput {
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
import type { Filter } from '@kbn/es-query';
|
||||
import type { ToastsStart, HttpStart } from '@kbn/core/public';
|
||||
import type { UnifiedSearchPublicPluginStart } from '@kbn/unified-search-plugin/public';
|
||||
import { DataPublicPluginStart } from '@kbn/data-plugin/public';
|
||||
import type { DataPublicPluginStart } from '@kbn/data-plugin/public';
|
||||
|
||||
export type QueryLanguageType = 'lucene' | 'kuery';
|
||||
|
||||
|
|
|
@ -7,8 +7,8 @@
|
|||
* License v3.0 only", or the "Server Side Public License, v 1".
|
||||
*/
|
||||
|
||||
import { ActionType } from '@kbn/actions-types';
|
||||
import { PreConfiguredActionConnector } from '../common/types';
|
||||
import type { ActionType } from '@kbn/actions-types';
|
||||
import type { PreConfiguredActionConnector } from '../common/types';
|
||||
import {
|
||||
checkActionFormActionTypeEnabled,
|
||||
checkActionTypeEnabled,
|
||||
|
|
|
@ -7,8 +7,8 @@
|
|||
* License v3.0 only", or the "Server Side Public License, v 1".
|
||||
*/
|
||||
|
||||
import { ActionType } from '@kbn/actions-types';
|
||||
import { ActionConnector } from '../common/types';
|
||||
import type { ActionType } from '@kbn/actions-types';
|
||||
import type { ActionConnector } from '../common/types';
|
||||
import './check_action_type_enabled.scss';
|
||||
import { configurationCheckResult, getLicenseCheckResult } from './get_license_check_result';
|
||||
|
||||
|
|
|
@ -7,9 +7,9 @@
|
|||
* License v3.0 only", or the "Server Side Public License, v 1".
|
||||
*/
|
||||
|
||||
import { HttpSetup } from '@kbn/core/public';
|
||||
import { AsApiContract } from '@kbn/actions-types';
|
||||
import { AlertingFrameworkHealth, AlertsHealth } from '@kbn/alerting-types';
|
||||
import type { HttpSetup } from '@kbn/core/public';
|
||||
import type { AsApiContract } from '@kbn/actions-types';
|
||||
import type { AlertingFrameworkHealth, AlertsHealth } from '@kbn/alerting-types';
|
||||
import { BASE_ALERTING_API_PATH } from '../../constants';
|
||||
import { transformAlertingFrameworkHealthResponse, transformAlertsHealthResponse } from '.';
|
||||
|
||||
|
|
|
@ -7,8 +7,8 @@
|
|||
* License v3.0 only", or the "Server Side Public License, v 1".
|
||||
*/
|
||||
|
||||
import { AsApiContract, RewriteRequestCase } from '@kbn/actions-types';
|
||||
import { AlertingFrameworkHealth, AlertsHealth } from '@kbn/alerting-types';
|
||||
import type { AsApiContract, RewriteRequestCase } from '@kbn/actions-types';
|
||||
import type { AlertingFrameworkHealth, AlertsHealth } from '@kbn/alerting-types';
|
||||
|
||||
export const transformAlertsHealthResponse: RewriteRequestCase<AlertsHealth> = ({
|
||||
decryption_health: decryptionHealth,
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
* License v3.0 only", or the "Server Side Public License, v 1".
|
||||
*/
|
||||
|
||||
import { HttpSetup } from '@kbn/core-http-browser';
|
||||
import type { HttpSetup } from '@kbn/core-http-browser';
|
||||
|
||||
export interface FetchAlertsFieldsParams {
|
||||
// Dependencies
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
*/
|
||||
|
||||
import { BASE_RAC_ALERTS_API_PATH } from '../../constants';
|
||||
import { FetchAlertsIndexNamesParams } from './types';
|
||||
import type { FetchAlertsIndexNamesParams } from './types';
|
||||
|
||||
export const fetchAlertsIndexNames = async ({ http, ruleTypeIds }: FetchAlertsIndexNamesParams) => {
|
||||
const { index_name: indexNames = [] } = await http.get<{ index_name: string[] }>(
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
* License v3.0 only", or the "Server Side Public License, v 1".
|
||||
*/
|
||||
|
||||
import { HttpSetup } from '@kbn/core-http-browser';
|
||||
import type { HttpSetup } from '@kbn/core-http-browser';
|
||||
|
||||
export interface FetchAlertsIndexNamesParams {
|
||||
// Dependencies
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
|
||||
import { httpServiceMock } from '@kbn/core/public/mocks';
|
||||
import { fetchConnectorTypes } from './fetch_connector_types';
|
||||
import { ActionType } from '@kbn/actions-types';
|
||||
import type { ActionType } from '@kbn/actions-types';
|
||||
|
||||
const http = httpServiceMock.createStartContract();
|
||||
|
||||
|
|
|
@ -7,8 +7,8 @@
|
|||
* License v3.0 only", or the "Server Side Public License, v 1".
|
||||
*/
|
||||
|
||||
import { HttpSetup } from '@kbn/core/public';
|
||||
import { ActionType } from '@kbn/actions-types';
|
||||
import type { HttpSetup } from '@kbn/core/public';
|
||||
import type { ActionType } from '@kbn/actions-types';
|
||||
import { BASE_ACTION_API_PATH, INTERNAL_BASE_ACTION_API_PATH } from '../../constants';
|
||||
import { transformConnectorTypesResponse } from './transform_connector_types_response';
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
* License v3.0 only", or the "Server Side Public License, v 1".
|
||||
*/
|
||||
|
||||
import { AsApiContract, RewriteRequestCase, ActionType } from '@kbn/actions-types';
|
||||
import type { AsApiContract, RewriteRequestCase, ActionType } from '@kbn/actions-types';
|
||||
|
||||
const transformConnectorType: RewriteRequestCase<ActionType> = ({
|
||||
enabled_in_config: enabledInConfig,
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
*/
|
||||
|
||||
import { httpServiceMock } from '@kbn/core/public/mocks';
|
||||
import { ActionConnectorProps } from '../../types';
|
||||
import type { ActionConnectorProps } from '../../types';
|
||||
import { fetchConnectors } from './fetch_connectors';
|
||||
|
||||
const http = httpServiceMock.createStartContract();
|
||||
|
|
|
@ -7,8 +7,8 @@
|
|||
* License v3.0 only", or the "Server Side Public License, v 1".
|
||||
*/
|
||||
|
||||
import { HttpSetup } from '@kbn/core/public';
|
||||
import { ActionConnector } from '../../types';
|
||||
import type { HttpSetup } from '@kbn/core/public';
|
||||
import type { ActionConnector } from '../../types';
|
||||
import { transformConnectorResponse } from './transform_connectors_response';
|
||||
import { BASE_ACTION_API_PATH, INTERNAL_BASE_ACTION_API_PATH } from '../../constants';
|
||||
|
||||
|
|
|
@ -7,8 +7,8 @@
|
|||
* License v3.0 only", or the "Server Side Public License, v 1".
|
||||
*/
|
||||
|
||||
import { AsApiContract, RewriteRequestCase } from '@kbn/actions-types';
|
||||
import { ActionConnectorProps } from '../../types';
|
||||
import type { AsApiContract, RewriteRequestCase } from '@kbn/actions-types';
|
||||
import type { ActionConnectorProps } from '../../types';
|
||||
|
||||
export const transformConnectorResponse = (
|
||||
results: Array<
|
||||
|
|
|
@ -7,9 +7,9 @@
|
|||
* License v3.0 only", or the "Server Side Public License, v 1".
|
||||
*/
|
||||
|
||||
import { HttpSetup } from '@kbn/core/public';
|
||||
import { AsApiContract } from '@kbn/actions-types';
|
||||
import { RulesSettingsFlapping } from '@kbn/alerting-types';
|
||||
import type { HttpSetup } from '@kbn/core/public';
|
||||
import type { AsApiContract } from '@kbn/actions-types';
|
||||
import type { RulesSettingsFlapping } from '@kbn/alerting-types';
|
||||
import { INTERNAL_BASE_ALERTING_API_PATH } from '../../constants';
|
||||
import { transformFlappingSettingsResponse } from './transform_flapping_settings_response';
|
||||
|
||||
|
|
|
@ -7,8 +7,8 @@
|
|||
* License v3.0 only", or the "Server Side Public License, v 1".
|
||||
*/
|
||||
|
||||
import { AsApiContract } from '@kbn/actions-types';
|
||||
import { RulesSettingsFlapping } from '@kbn/alerting-types';
|
||||
import type { AsApiContract } from '@kbn/actions-types';
|
||||
import type { RulesSettingsFlapping } from '@kbn/alerting-types';
|
||||
|
||||
export const transformFlappingSettingsResponse = ({
|
||||
look_back_window: lookBackWindow,
|
||||
|
|
|
@ -12,7 +12,7 @@ import {
|
|||
fetchRuleTypeAadTemplateFields,
|
||||
getDescription,
|
||||
} from './fetch_rule_type_aad_template_fields';
|
||||
import { EcsMetadata } from '@kbn/alerts-as-data-utils/src/field_maps/types';
|
||||
import type { EcsMetadata } from '@kbn/alerts-as-data-utils/src/field_maps/types';
|
||||
|
||||
const http = httpServiceMock.createStartContract();
|
||||
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
import { isEmpty } from 'lodash';
|
||||
import type { EcsMetadata } from '@kbn/alerts-as-data-utils/src/field_maps/types';
|
||||
import type { HttpStart } from '@kbn/core-http-browser';
|
||||
import { DataViewField } from '@kbn/data-views-plugin/common';
|
||||
import type { DataViewField } from '@kbn/data-views-plugin/common';
|
||||
import { BASE_RAC_ALERTS_API_PATH, EMPTY_AAD_FIELDS } from '../../constants';
|
||||
|
||||
export const getDescription = (fieldName: string, ecsFlat: Record<string, EcsMetadata>) => {
|
||||
|
|
|
@ -8,6 +8,6 @@
|
|||
*/
|
||||
|
||||
import { createContext } from 'react';
|
||||
import { QueryClient } from '@tanstack/react-query';
|
||||
import type { QueryClient } from '@tanstack/react-query';
|
||||
|
||||
export const AlertsQueryContext = createContext<QueryClient | undefined>(undefined);
|
||||
|
|
|
@ -9,13 +9,13 @@
|
|||
|
||||
import { useEffect, useMemo } from 'react';
|
||||
import { i18n } from '@kbn/i18n';
|
||||
import { DataView, DataViewsContract, FieldSpec } from '@kbn/data-views-plugin/common';
|
||||
import type { DataView, DataViewsContract, FieldSpec } from '@kbn/data-views-plugin/common';
|
||||
import { isSiemRuleType } from '@kbn/rule-data-utils';
|
||||
import type { ToastsStart, HttpStart } from '@kbn/core/public';
|
||||
|
||||
import { DataViewBase } from '@kbn/es-query';
|
||||
import type { DataViewBase } from '@kbn/es-query';
|
||||
import type { FieldDescriptor } from '@kbn/data-views-plugin/server';
|
||||
import { BrowserFields } from '@kbn/alerting-types';
|
||||
import type { BrowserFields } from '@kbn/alerting-types';
|
||||
import { useVirtualDataViewQuery } from './use_virtual_data_view_query';
|
||||
import { useFetchAlertsFieldsQuery } from './use_fetch_alerts_fields_query';
|
||||
import { useFetchAlertsIndexNamesQuery } from './use_fetch_alerts_index_names_query';
|
||||
|
|
|
@ -10,7 +10,8 @@
|
|||
import { isSiemRuleType } from '@kbn/rule-data-utils';
|
||||
import { useQuery } from '@tanstack/react-query';
|
||||
import type { QueryOptionsOverrides } from '../types/tanstack_query_utility_types';
|
||||
import { fetchAlertsFields, FetchAlertsFieldsParams } from '../apis/fetch_alerts_fields';
|
||||
import type { FetchAlertsFieldsParams } from '../apis/fetch_alerts_fields';
|
||||
import { fetchAlertsFields } from '../apis/fetch_alerts_fields';
|
||||
|
||||
export type UseFetchAlertsFieldsQueryParams = FetchAlertsFieldsParams;
|
||||
|
||||
|
|
|
@ -8,10 +8,8 @@
|
|||
*/
|
||||
|
||||
import { useQuery } from '@tanstack/react-query';
|
||||
import {
|
||||
fetchAlertsIndexNames,
|
||||
FetchAlertsIndexNamesParams,
|
||||
} from '../apis/fetch_alerts_index_names';
|
||||
import type { FetchAlertsIndexNamesParams } from '../apis/fetch_alerts_index_names';
|
||||
import { fetchAlertsIndexNames } from '../apis/fetch_alerts_index_names';
|
||||
import type { QueryOptionsOverrides } from '../types/tanstack_query_utility_types';
|
||||
|
||||
export type UseFetchAlertsIndexNamesQueryParams = FetchAlertsIndexNamesParams;
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
|
||||
import { useQuery } from '@tanstack/react-query';
|
||||
import type { HttpStart } from '@kbn/core-http-browser';
|
||||
import { RulesSettingsFlapping } from '@kbn/alerting-types/rule_settings';
|
||||
import type { RulesSettingsFlapping } from '@kbn/alerting-types/rule_settings';
|
||||
import { fetchFlappingSettings } from '../apis/fetch_flapping_settings';
|
||||
|
||||
interface UseFetchFlappingSettingsProps {
|
||||
|
|
|
@ -11,8 +11,8 @@ import { i18n } from '@kbn/i18n';
|
|||
import { useQuery } from '@tanstack/react-query';
|
||||
import type { HttpStart } from '@kbn/core-http-browser';
|
||||
import type { ToastsStart } from '@kbn/core-notifications-browser';
|
||||
import { ISearchRequestParams } from '@kbn/search-types';
|
||||
import { SearchResponseBody } from '@elastic/elasticsearch/lib/api/types';
|
||||
import type { ISearchRequestParams } from '@kbn/search-types';
|
||||
import type { SearchResponseBody } from '@elastic/elasticsearch/lib/api/types';
|
||||
import { BASE_RAC_ALERTS_API_PATH } from '../constants';
|
||||
|
||||
export interface UseFindAlertsQueryProps {
|
||||
|
|
|
@ -11,7 +11,7 @@ import { i18n } from '@kbn/i18n';
|
|||
import { useQuery } from '@tanstack/react-query';
|
||||
import type { HttpStart } from '@kbn/core-http-browser';
|
||||
import type { ToastsStart } from '@kbn/core-notifications-browser';
|
||||
import { SearchResponseBody } from '@elastic/elasticsearch/lib/api/types';
|
||||
import type { SearchResponseBody } from '@elastic/elasticsearch/lib/api/types';
|
||||
import type {
|
||||
AggregationsAggregationContainer,
|
||||
QueryDslQueryContainer,
|
||||
|
|
|
@ -9,11 +9,11 @@
|
|||
|
||||
import { useMemo } from 'react';
|
||||
import { keyBy } from 'lodash';
|
||||
import { UseQueryOptions } from '@tanstack/react-query';
|
||||
import type { UseQueryOptions } from '@tanstack/react-query';
|
||||
import type { HttpStart } from '@kbn/core-http-browser';
|
||||
import type { ToastsStart } from '@kbn/core-notifications-browser';
|
||||
import type { RuleType } from '@kbn/triggers-actions-ui-types';
|
||||
import {
|
||||
import type {
|
||||
RuleTypeIndexWithDescriptions,
|
||||
RuleTypeWithDescription,
|
||||
} from '@kbn/triggers-actions-ui-types';
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
|
||||
import { useQuery } from '@tanstack/react-query';
|
||||
|
||||
import { SetOptional } from 'type-fest';
|
||||
import type { SetOptional } from 'type-fest';
|
||||
import { searchAlerts, type SearchAlertsParams } from '../apis/search_alerts/search_alerts';
|
||||
import { DEFAULT_ALERTS_PAGE_SIZE } from '../constants';
|
||||
import { AlertsQueryContext } from '../contexts/alerts_query_context';
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
import type { DataViewsContract } from '@kbn/data-views-plugin/common';
|
||||
import { useQuery } from '@tanstack/react-query';
|
||||
import { useEffect } from 'react';
|
||||
import { QueryOptionsOverrides } from '../types/tanstack_query_utility_types';
|
||||
import type { QueryOptionsOverrides } from '../types/tanstack_query_utility_types';
|
||||
|
||||
export interface UseVirtualDataViewParams {
|
||||
// Dependencies
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
|
||||
import React, { lazy } from 'react';
|
||||
import { v4 as uuidv4 } from 'uuid';
|
||||
import { ActionTypeModel, ActionTypeRegistryContract } from '../types';
|
||||
import type { ActionTypeModel, ActionTypeRegistryContract } from '../types';
|
||||
|
||||
const createActionTypeRegistryMock = () => {
|
||||
const mocked: jest.Mocked<ActionTypeRegistryContract> = {
|
||||
|
|
|
@ -7,8 +7,8 @@
|
|||
* License v3.0 only", or the "Server Side Public License, v 1".
|
||||
*/
|
||||
|
||||
import { RewriteRequestCase } from '@kbn/actions-types';
|
||||
import { RuleUiAction } from '..';
|
||||
import type { RewriteRequestCase } from '@kbn/actions-types';
|
||||
import type { RuleUiAction } from '..';
|
||||
|
||||
export const transformAction: RewriteRequestCase<RuleUiAction> = (action) => {
|
||||
const { uuid, id, connector_type_id: actionTypeId, params } = action;
|
||||
|
|
|
@ -8,7 +8,12 @@
|
|||
*/
|
||||
|
||||
import { TypeRegistry } from './type_registry';
|
||||
import { ActionTypeModel, GenericValidationResult, RuleTypeModel, ValidationResult } from './types';
|
||||
import type {
|
||||
ActionTypeModel,
|
||||
GenericValidationResult,
|
||||
RuleTypeModel,
|
||||
ValidationResult,
|
||||
} from './types';
|
||||
import { actionTypeRegistryMock } from './test_utils/action_type_registry.mock';
|
||||
|
||||
export const ExpressionComponent: React.FunctionComponent = () => {
|
||||
|
|
|
@ -9,11 +9,11 @@
|
|||
|
||||
import type { ComponentType, ReactNode } from 'react';
|
||||
import type { RuleActionParam, ActionVariable } from '@kbn/alerting-types';
|
||||
import { IconType, RecursivePartial } from '@elastic/eui';
|
||||
import { PublicMethodsOf } from '@kbn/utility-types';
|
||||
import { SubFeature } from '@kbn/actions-types';
|
||||
import { TypeRegistry } from '../type_registry';
|
||||
import { RuleFormParamsErrors } from './rule_types';
|
||||
import type { IconType, RecursivePartial } from '@elastic/eui';
|
||||
import type { PublicMethodsOf } from '@kbn/utility-types';
|
||||
import type { SubFeature } from '@kbn/actions-types';
|
||||
import type { TypeRegistry } from '../type_registry';
|
||||
import type { RuleFormParamsErrors } from './rule_types';
|
||||
|
||||
export interface GenericValidationResult<T> {
|
||||
errors: Record<Extract<keyof T, string>, string[] | unknown>;
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
* License v3.0 only", or the "Server Side Public License, v 1".
|
||||
*/
|
||||
|
||||
import { DocLinksStart } from '@kbn/core-doc-links-browser';
|
||||
import type { DocLinksStart } from '@kbn/core-doc-links-browser';
|
||||
import type { ComponentType } from 'react';
|
||||
import type { ChartsPluginSetup } from '@kbn/charts-plugin/public';
|
||||
import type { DataPublicPluginStart } from '@kbn/data-plugin/public';
|
||||
|
@ -21,9 +21,9 @@ import type {
|
|||
RuleSystemAction,
|
||||
ResolvedSanitizedRule,
|
||||
} from '@kbn/alerting-types';
|
||||
import { RuleType } from '@kbn/triggers-actions-ui-types';
|
||||
import { PublicMethodsOf } from '@kbn/utility-types';
|
||||
import { TypeRegistry } from '../type_registry';
|
||||
import type { RuleType } from '@kbn/triggers-actions-ui-types';
|
||||
import type { PublicMethodsOf } from '@kbn/utility-types';
|
||||
import type { TypeRegistry } from '../type_registry';
|
||||
|
||||
export type { SanitizedRuleAction as RuleAction } from '@kbn/alerting-types';
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
* License v3.0 only", or the "Server Side Public License, v 1".
|
||||
*/
|
||||
|
||||
import { UseQueryOptions } from '@tanstack/react-query';
|
||||
import type { UseQueryOptions } from '@tanstack/react-query';
|
||||
|
||||
/**
|
||||
* Extracts the data type from a fetching function
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
* License v3.0 only", or the "Server Side Public License, v 1".
|
||||
*/
|
||||
|
||||
import { AsApiContract } from '@kbn/actions-types';
|
||||
import type { AsApiContract } from '@kbn/actions-types';
|
||||
import type { KibanaServices, MaintenanceWindow } from './types';
|
||||
|
||||
const rewriteMaintenanceWindowRes = ({
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
*/
|
||||
|
||||
import type { WeekdayStr, Options } from '@kbn/rrule';
|
||||
import { CoreStart } from '@kbn/core/public';
|
||||
import type { CoreStart } from '@kbn/core/public';
|
||||
|
||||
export enum MaintenanceWindowStatus {
|
||||
Running = 'running',
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
import type { UseQueryOptions } from '@tanstack/react-query';
|
||||
import { useQuery } from '@tanstack/react-query';
|
||||
import { i18n } from '@kbn/i18n';
|
||||
import { KibanaServices } from './types';
|
||||
import type { KibanaServices } from './types';
|
||||
import { fetchActiveMaintenanceWindows } from './api';
|
||||
|
||||
export const useFetchActiveMaintenanceWindows = (
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
* License v3.0 only", or the "Server Side Public License, v 1".
|
||||
*/
|
||||
|
||||
import { CaseStatuses } from '../status/types';
|
||||
import type { CaseStatuses } from '../status/types';
|
||||
export interface CaseTooltipContentProps {
|
||||
title: string;
|
||||
description: string;
|
||||
|
|
|
@ -7,7 +7,8 @@
|
|||
* License v3.0 only", or the "Server Side Public License, v 1".
|
||||
*/
|
||||
|
||||
import { Filter, FILTERS } from '@kbn/es-query';
|
||||
import type { Filter } from '@kbn/es-query';
|
||||
import { FILTERS } from '@kbn/es-query';
|
||||
export const getEmptyValue = () => '—';
|
||||
|
||||
type StrictFilter = Filter & {
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
import type { GroupingQueryArgs } from './types';
|
||||
import { getGroupingQuery, parseGroupingQuery } from '.';
|
||||
import { getEmptyValue } from './helpers';
|
||||
import { GroupingAggregation } from '../../..';
|
||||
import type { GroupingAggregation } from '../../..';
|
||||
import { groupingBucket } from '../../mocks';
|
||||
|
||||
const testProps: GroupingQueryArgs = {
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
*/
|
||||
|
||||
import { getEmptyValue } from './helpers';
|
||||
import { GroupingAggregation, ParsedGroupingAggregation } from '../..';
|
||||
import type { GroupingAggregation, ParsedGroupingAggregation } from '../..';
|
||||
import type { GroupingQueryArgs, GroupingQuery } from './types';
|
||||
/** The maximum number of groups to render */
|
||||
export const DEFAULT_GROUP_BY_FIELD_SIZE = 10;
|
||||
|
|
|
@ -7,7 +7,8 @@
|
|||
* License v3.0 only", or the "Server Side Public License, v 1".
|
||||
*/
|
||||
|
||||
import { EMPTY_GROUP_BY_ID, GroupModel, GroupsById, Storage } from './hooks/types';
|
||||
import type { GroupModel, GroupsById, Storage } from './hooks/types';
|
||||
import { EMPTY_GROUP_BY_ID } from './hooks/types';
|
||||
import * as i18n from './components/translations';
|
||||
|
||||
/**
|
||||
|
|
|
@ -7,7 +7,8 @@
|
|||
* License v3.0 only", or the "Server Side Public License, v 1".
|
||||
*/
|
||||
|
||||
import { ActionType, GroupOption, UpdateActiveGroups, UpdateGroupOptions } from '../types';
|
||||
import type { GroupOption, UpdateActiveGroups, UpdateGroupOptions } from '../types';
|
||||
import { ActionType } from '../types';
|
||||
|
||||
const updateActiveGroups = ({
|
||||
activeGroups,
|
||||
|
|
|
@ -7,15 +7,8 @@
|
|||
* License v3.0 only", or the "Server Side Public License, v 1".
|
||||
*/
|
||||
|
||||
import {
|
||||
Action,
|
||||
ActionType,
|
||||
defaultGroup,
|
||||
EMPTY_GROUP_BY_ID,
|
||||
GroupMap,
|
||||
GroupsById,
|
||||
Storage,
|
||||
} from '../types';
|
||||
import type { Action, GroupMap, GroupsById, Storage } from '../types';
|
||||
import { ActionType, defaultGroup, EMPTY_GROUP_BY_ID } from '../types';
|
||||
import { addGroupsToStorage, getAllGroupsInStorage } from '../..';
|
||||
|
||||
const storage: Storage = window.localStorage;
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
* License v3.0 only", or the "Server Side Public License, v 1".
|
||||
*/
|
||||
|
||||
import { GroupsById, GroupState } from '../types';
|
||||
import type { GroupsById, GroupState } from '../types';
|
||||
|
||||
const selectGroupById = (state: GroupState): GroupsById => state.groups.groupById;
|
||||
|
||||
|
|
|
@ -9,14 +9,8 @@
|
|||
|
||||
import moment, { type Moment } from 'moment-timezone';
|
||||
|
||||
import {
|
||||
Frequency,
|
||||
Weekday,
|
||||
type WeekdayStr,
|
||||
type Options,
|
||||
type IterOptions,
|
||||
ConstructorOptions,
|
||||
} from './types';
|
||||
import type { ConstructorOptions } from './types';
|
||||
import { Frequency, Weekday, type WeekdayStr, type Options, type IterOptions } from './types';
|
||||
import { sanitizeOptions } from './sanitize';
|
||||
import { validateOptions } from './validate';
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
*/
|
||||
|
||||
import moment from 'moment-timezone';
|
||||
import { ConstructorOptions } from './types';
|
||||
import type { ConstructorOptions } from './types';
|
||||
|
||||
export function validateOptions(opts: ConstructorOptions) {
|
||||
const byWeekDayRegex = new RegExp('^(((\\+|-)[1-4])?(MO|TU|WE|TH|FR|SA|SU))$');
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
* License v3.0 only", or the "Server Side Public License, v 1".
|
||||
*/
|
||||
|
||||
import * as estypes from '@elastic/elasticsearch/lib/api/typesWithBodyKey';
|
||||
import type * as estypes from '@elastic/elasticsearch/lib/api/typesWithBodyKey';
|
||||
import type { EsQueryConfig } from '@kbn/es-query';
|
||||
|
||||
/**
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
* License v3.0 only", or the "Server Side Public License, v 1".
|
||||
*/
|
||||
|
||||
import { ValuesType } from 'utility-types';
|
||||
import type { ValuesType } from 'utility-types';
|
||||
|
||||
const TIMESTAMP = '@timestamp' as const;
|
||||
|
||||
|
|
|
@ -7,8 +7,8 @@
|
|||
* License v3.0 only", or the "Server Side Public License, v 1".
|
||||
*/
|
||||
|
||||
import { AlertConsumers } from '../alerts_as_data_rbac';
|
||||
import { STACK_ALERTS_FEATURE_ID } from './stack_rules';
|
||||
import type { AlertConsumers } from '../alerts_as_data_rbac';
|
||||
import type { STACK_ALERTS_FEATURE_ID } from './stack_rules';
|
||||
|
||||
export * from './stack_rules';
|
||||
export * from './o11y_rules';
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
* License v3.0 only", or the "Server Side Public License, v 1".
|
||||
*/
|
||||
|
||||
import { ValuesType } from 'utility-types';
|
||||
import type { ValuesType } from 'utility-types';
|
||||
import {
|
||||
ALERT_NAMESPACE,
|
||||
ALERT_RULE_NAMESPACE,
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
* License v3.0 only", or the "Server Side Public License, v 1".
|
||||
*/
|
||||
|
||||
import { ActionGroup } from '@kbn/alerting-types';
|
||||
import type { ActionGroup } from '@kbn/alerting-types';
|
||||
|
||||
export type OmitMessageVariablesType = 'all' | 'keepContext';
|
||||
|
||||
|
|
|
@ -12,7 +12,8 @@
|
|||
// provides TypeScript and config-schema interfaces for ECS for use with
|
||||
// the event log
|
||||
|
||||
import { schema, TypeOf } from '@kbn/config-schema';
|
||||
import type { TypeOf } from '@kbn/config-schema';
|
||||
import { schema } from '@kbn/config-schema';
|
||||
import semver from 'semver';
|
||||
|
||||
type DeepWriteable<T> = { -readonly [P in keyof T]: DeepWriteable<T[P]> };
|
||||
|
|
|
@ -302,7 +302,8 @@ const SchemaFileTemplate = `
|
|||
// provides TypeScript and config-schema interfaces for ECS for use with
|
||||
// the event log
|
||||
|
||||
import { schema, TypeOf } from '@kbn/config-schema';
|
||||
import type { TypeOf } from '@kbn/config-schema';
|
||||
import { schema } from '@kbn/config-schema';
|
||||
import semver from 'semver';
|
||||
|
||||
type DeepWriteable<T> = { -readonly [P in keyof T]: DeepWriteable<T[P]> };
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
* 2.0.
|
||||
*/
|
||||
|
||||
import { IClusterClientAdapter } from './cluster_client_adapter';
|
||||
import type { IClusterClientAdapter } from './cluster_client_adapter';
|
||||
|
||||
const createClusterClientMock = () => {
|
||||
const mock: jest.Mocked<IClusterClientAdapter> = {
|
||||
|
|
|
@ -6,18 +6,21 @@
|
|||
*/
|
||||
|
||||
import { elasticsearchServiceMock, loggingSystemMock } from '@kbn/core/server/mocks';
|
||||
import {
|
||||
ClusterClientAdapter,
|
||||
import type {
|
||||
IClusterClientAdapter,
|
||||
EVENT_BUFFER_LENGTH,
|
||||
getQueryBody,
|
||||
FindEventsOptionsBySavedObjectFilter,
|
||||
AggregateEventsOptionsBySavedObjectFilter,
|
||||
AggregateEventsWithAuthFilter,
|
||||
getQueryBodyWithAuthFilter,
|
||||
Doc,
|
||||
} from './cluster_client_adapter';
|
||||
import { AggregateOptionsType, queryOptionsSchema } from '../event_log_client';
|
||||
import {
|
||||
ClusterClientAdapter,
|
||||
EVENT_BUFFER_LENGTH,
|
||||
getQueryBody,
|
||||
getQueryBodyWithAuthFilter,
|
||||
} from './cluster_client_adapter';
|
||||
import type { AggregateOptionsType } from '../event_log_client';
|
||||
import { queryOptionsSchema } from '../event_log_client';
|
||||
import { delay } from '../lib/delay';
|
||||
import { pick, times } from 'lodash';
|
||||
import type * as estypes from '@elastic/elasticsearch/lib/api/types';
|
||||
|
|
|
@ -9,15 +9,17 @@ import { Subject } from 'rxjs';
|
|||
import { bufferTime, filter as rxFilter, concatMap } from 'rxjs';
|
||||
import { reject, isUndefined, isNumber, pick, isEmpty, get } from 'lodash';
|
||||
import type { PublicMethodsOf } from '@kbn/utility-types';
|
||||
import { Logger, ElasticsearchClient } from '@kbn/core/server';
|
||||
import type { Logger, ElasticsearchClient } from '@kbn/core/server';
|
||||
import util from 'util';
|
||||
import type * as estypes from '@elastic/elasticsearch/lib/api/typesWithBodyKey';
|
||||
import { fromKueryExpression, toElasticsearchQuery, KueryNode, nodeBuilder } from '@kbn/es-query';
|
||||
import { BulkResponse, long } from '@elastic/elasticsearch/lib/api/types';
|
||||
import { IEvent, IValidatedEvent, SAVED_OBJECT_REL_PRIMARY } from '../types';
|
||||
import { AggregateOptionsType, FindOptionsType, QueryOptionsType } from '../event_log_client';
|
||||
import { ParsedIndexAlias } from './init';
|
||||
import { EsNames } from './names';
|
||||
import type { KueryNode } from '@kbn/es-query';
|
||||
import { fromKueryExpression, toElasticsearchQuery, nodeBuilder } from '@kbn/es-query';
|
||||
import type { BulkResponse, long } from '@elastic/elasticsearch/lib/api/types';
|
||||
import type { IEvent, IValidatedEvent } from '../types';
|
||||
import { SAVED_OBJECT_REL_PRIMARY } from '../types';
|
||||
import type { AggregateOptionsType, FindOptionsType, QueryOptionsType } from '../event_log_client';
|
||||
import type { ParsedIndexAlias } from './init';
|
||||
import type { EsNames } from './names';
|
||||
|
||||
export const EVENT_BUFFER_TIME = 1000; // milliseconds
|
||||
export const EVENT_BUFFER_LENGTH = 100;
|
||||
|
|
|
@ -7,9 +7,9 @@
|
|||
|
||||
import { loggingSystemMock } from '@kbn/core/server/mocks';
|
||||
|
||||
import { EsContext } from './context';
|
||||
import type { EsContext } from './context';
|
||||
import { namesMock } from './names.mock';
|
||||
import { IClusterClientAdapter } from './cluster_client_adapter';
|
||||
import type { IClusterClientAdapter } from './cluster_client_adapter';
|
||||
import { clusterClientAdapterMock } from './cluster_client_adapter.mock';
|
||||
|
||||
export const MOCK_RETRY_DELAY = 20;
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
*/
|
||||
|
||||
import { createEsContext } from './context';
|
||||
import { Logger } from '@kbn/core/server';
|
||||
import type { Logger } from '@kbn/core/server';
|
||||
import { elasticsearchServiceMock, loggingSystemMock } from '@kbn/core/server/mocks';
|
||||
import { createReadySignal } from '../lib/ready_signal';
|
||||
import { GetDataStreamsResponse } from './cluster_client_adapter.test';
|
||||
|
|
|
@ -5,12 +5,15 @@
|
|||
* 2.0.
|
||||
*/
|
||||
|
||||
import { Logger, ElasticsearchClient } from '@kbn/core/server';
|
||||
import type { Logger, ElasticsearchClient } from '@kbn/core/server';
|
||||
|
||||
import { EsNames, getEsNames } from './names';
|
||||
import type { EsNames } from './names';
|
||||
import { getEsNames } from './names';
|
||||
import { initializeEs } from './init';
|
||||
import { ClusterClientAdapter, IClusterClientAdapter } from './cluster_client_adapter';
|
||||
import { createReadySignal, ReadySignal } from '../lib/ready_signal';
|
||||
import type { IClusterClientAdapter } from './cluster_client_adapter';
|
||||
import { ClusterClientAdapter } from './cluster_client_adapter';
|
||||
import type { ReadySignal } from '../lib/ready_signal';
|
||||
import { createReadySignal } from '../lib/ready_signal';
|
||||
|
||||
export const RETRY_DELAY = 2000;
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
* 2.0.
|
||||
*/
|
||||
|
||||
import { EsNames } from './names';
|
||||
import type { EsNames } from './names';
|
||||
import mappings from '../../generated/mappings.json';
|
||||
|
||||
// returns the body of an index template used in an ES indices.putTemplate call
|
||||
|
|
|
@ -8,9 +8,10 @@
|
|||
import type * as estypes from '@elastic/elasticsearch/lib/api/typesWithBodyKey';
|
||||
import { asyncForEach } from '@kbn/std';
|
||||
import { groupBy } from 'lodash';
|
||||
import pRetry, { FailedAttemptError } from 'p-retry';
|
||||
import type { FailedAttemptError } from 'p-retry';
|
||||
import pRetry from 'p-retry';
|
||||
import { getIndexTemplate } from './documents';
|
||||
import { EsContext } from './context';
|
||||
import type { EsContext } from './context';
|
||||
|
||||
const MAX_RETRY_DELAY = 30000;
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
* 2.0.
|
||||
*/
|
||||
|
||||
import { EsNames } from './names';
|
||||
import type { EsNames } from './names';
|
||||
|
||||
const createNamesMock = () => {
|
||||
const mock: jest.Mocked<EsNames> = {
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
* 2.0.
|
||||
*/
|
||||
|
||||
import { IEventLogClient } from './types';
|
||||
import type { IEventLogClient } from './types';
|
||||
|
||||
const createEventLogClientMock = () => {
|
||||
const mock: jest.Mocked<IEventLogClient> = {
|
||||
|
|
|
@ -5,13 +5,13 @@
|
|||
* 2.0.
|
||||
*/
|
||||
|
||||
import { KibanaRequest } from '@kbn/core/server';
|
||||
import type { KibanaRequest } from '@kbn/core/server';
|
||||
import { EventLogClient } from './event_log_client';
|
||||
import { EsContext } from './es';
|
||||
import type { EsContext } from './es';
|
||||
import { contextMock } from './es/context.mock';
|
||||
import { merge } from 'lodash';
|
||||
import moment from 'moment';
|
||||
import { IClusterClientAdapter } from './es/cluster_client_adapter';
|
||||
import type { IClusterClientAdapter } from './es/cluster_client_adapter';
|
||||
import { fromKueryExpression } from '@kbn/es-query';
|
||||
|
||||
const expectedSavedObject = {
|
||||
|
|
|
@ -6,17 +6,18 @@
|
|||
*/
|
||||
|
||||
import { omit } from 'lodash';
|
||||
import { Observable } from 'rxjs';
|
||||
import { schema, TypeOf } from '@kbn/config-schema';
|
||||
import { IClusterClient, KibanaRequest } from '@kbn/core/server';
|
||||
import * as estypes from '@elastic/elasticsearch/lib/api/typesWithBodyKey';
|
||||
import { SpacesServiceStart } from '@kbn/spaces-plugin/server';
|
||||
import type { Observable } from 'rxjs';
|
||||
import type { TypeOf } from '@kbn/config-schema';
|
||||
import { schema } from '@kbn/config-schema';
|
||||
import type { IClusterClient, KibanaRequest } from '@kbn/core/server';
|
||||
import type { estypes } from '@elastic/elasticsearch';
|
||||
import type { SpacesServiceStart } from '@kbn/spaces-plugin/server';
|
||||
|
||||
import { KueryNode } from '@kbn/es-query';
|
||||
import { EsContext } from './es';
|
||||
import { IEventLogClient } from './types';
|
||||
import { QueryEventsBySavedObjectResult } from './es/cluster_client_adapter';
|
||||
import { SavedObjectBulkGetterResult } from './saved_object_provider_registry';
|
||||
import type { KueryNode } from '@kbn/es-query';
|
||||
import type { EsContext } from './es';
|
||||
import type { IEventLogClient } from './types';
|
||||
import type { QueryEventsBySavedObjectResult } from './es/cluster_client_adapter';
|
||||
import type { SavedObjectBulkGetterResult } from './saved_object_provider_registry';
|
||||
export type PluginClusterClient = Pick<IClusterClient, 'asInternalUser'>;
|
||||
export type AdminClusterClient$ = Observable<PluginClusterClient>;
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
* 2.0.
|
||||
*/
|
||||
|
||||
import { IEventLogService } from './types';
|
||||
import type { IEventLogService } from './types';
|
||||
import { eventLoggerMock } from './event_logger.mock';
|
||||
|
||||
const createEventLogServiceMock = () => {
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
* 2.0.
|
||||
*/
|
||||
|
||||
import { IEventLogConfig } from './types';
|
||||
import type { IEventLogConfig } from './types';
|
||||
import { EventLogService } from './event_log_service';
|
||||
import { contextMock } from './es/context.mock';
|
||||
import { loggingSystemMock } from '@kbn/core/server/mocks';
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue