chore(NA): splits types from code on @kbn/rule-data-utils (#121535)

* chore(NA): splits types from code on @kbn/rule-data-utils

* chore(NA): remove old style imports for this pkg

* chore(NA): eslint fix

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
This commit is contained in:
Tiago Costa 2021-12-20 20:41:46 +00:00 committed by GitHub
parent e8bf0392f0
commit aa6fe695af
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
65 changed files with 93 additions and 161 deletions

View file

@ -850,10 +850,6 @@ module.exports = {
name: 'semver',
message: 'Please use "semver/*/{function}" instead',
},
{
name: '@kbn/rule-data-utils',
message: `Import directly from @kbn/rule-data-utils/* submodules in public/common code`,
},
],
},
],

View file

@ -581,6 +581,7 @@
"@types/kbn__plugin-generator": "link:bazel-bin/packages/kbn-plugin-generator/npm_module_types",
"@types/kbn__plugin-helpers": "link:bazel-bin/packages/kbn-plugin-helpers/npm_module_types",
"@types/kbn__react-field": "link:bazel-bin/packages/kbn-react-field/npm_module_types",
"@types/kbn__rule-data-utils": "link:bazel-bin/packages/kbn-rule-data-utils/npm_module_types",
"@types/license-checker": "15.0.0",
"@types/listr": "^0.14.0",
"@types/loader-utils": "^1.1.3",

View file

@ -99,6 +99,7 @@ filegroup(
"//packages/kbn-plugin-generator:build_types",
"//packages/kbn-plugin-helpers:build_types",
"//packages/kbn-react-field:build_types",
"//packages/kbn-rule-data-utils:build_types",
],
)

View file

@ -1,9 +1,10 @@
load("@npm//@bazel/typescript:index.bzl", "ts_config", "ts_project")
load("@build_bazel_rules_nodejs//:index.bzl", "js_library", "pkg_npm")
load("//src/dev/bazel:index.bzl", "jsts_transpiler")
load("@npm//@bazel/typescript:index.bzl", "ts_config")
load("@build_bazel_rules_nodejs//:index.bzl", "js_library")
load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project")
PKG_BASE_NAME = "kbn-rule-data-utils"
PKG_REQUIRE_NAME = "@kbn/rule-data-utils"
TYPES_PKG_REQUIRE_NAME = "@types/kbn__rule-data-utils"
SOURCE_FILES = glob(
[
@ -20,10 +21,6 @@ filegroup(
NPM_MODULE_EXTRA_FILES = [
"package.json",
"alerts_as_data_rbac/package.json",
"alerts_as_data_severity/package.json",
"alerts_as_data_status/package.json",
"technical_field_names/package.json",
]
RUNTIME_DEPS = [
@ -75,7 +72,7 @@ ts_project(
js_library(
name = PKG_BASE_NAME,
srcs = NPM_MODULE_EXTRA_FILES,
deps = RUNTIME_DEPS + [":target_node", ":tsc_types"],
deps = RUNTIME_DEPS + [":target_node"],
package_name = PKG_REQUIRE_NAME,
visibility = ["//visibility:public"],
)
@ -94,3 +91,20 @@ filegroup(
],
visibility = ["//visibility:public"],
)
pkg_npm_types(
name = "npm_module_types",
srcs = SRCS,
deps = [":tsc_types"],
package_name = TYPES_PKG_REQUIRE_NAME,
tsconfig = ":tsconfig",
visibility = ["//visibility:public"],
)
filegroup(
name = "build_types",
srcs = [
":npm_module_types",
],
visibility = ["//visibility:public"],
)

View file

@ -1,4 +0,0 @@
{
"main": "../target_node/alerts_as_data_rbac",
"types": "../target_types/alerts_as_data_rbac"
}

View file

@ -1,4 +0,0 @@
{
"main": "../target_node/alerts_as_data_severity",
"types": "../target_types/alerts_as_data_severity"
}

View file

@ -1,4 +0,0 @@
{
"main": "../target_node/alerts_as_data_status",
"types": "../target_types/alerts_as_data_status"
}

View file

@ -1,7 +1,6 @@
{
"name": "@kbn/rule-data-utils",
"main": "./target_node/index.js",
"types": "./target_types/index.d.ts",
"version": "1.0.0",
"license": "SSPL-1.0 OR Elastic License 2.0",
"private": true

View file

@ -1,4 +0,0 @@
{
"main": "../target_node/technical_field_names",
"types": "../target_types/technical_field_names"
}

View file

@ -12,7 +12,7 @@ import {
ALERT_EVALUATION_THRESHOLD,
ALERT_EVALUATION_VALUE,
ALERT_SEVERITY,
} from '@kbn/rule-data-utils/technical_field_names';
} from '@kbn/rule-data-utils';
import type { ObservabilityRuleTypeRegistry } from '../../../../observability/public';
import { ENVIRONMENT_ALL } from '../../../common/environment_filter_values';
import {

View file

@ -16,7 +16,7 @@ import {
} from '@elastic/charts';
import { EuiTitle } from '@elastic/eui';
import React, { Suspense, useState } from 'react';
import { ALERT_RULE_TYPE_ID } from '@kbn/rule-data-utils/technical_field_names';
import { ALERT_RULE_TYPE_ID } from '@kbn/rule-data-utils';
import { i18n } from '@kbn/i18n';
import { useApmServiceContext } from '../../../../context/apm_service/use_apm_service_context';
import { APIReturnType } from '../../../../services/rest/createCallApmApi';

View file

@ -16,13 +16,13 @@ import {
ALERT_SEVERITY,
ALERT_START,
ALERT_STATUS,
ALERT_STATUS_ACTIVE,
ALERT_UUID,
SPACE_IDS,
ALERT_RULE_UUID,
ALERT_RULE_NAME,
ALERT_RULE_CATEGORY,
} from '@kbn/rule-data-utils/technical_field_names';
import { ALERT_STATUS_ACTIVE } from '@kbn/rule-data-utils/alerts_as_data_status';
} from '@kbn/rule-data-utils';
import { ValuesType } from 'utility-types';
import { EuiTheme } from '../../../../../../../../src/plugins/kibana_react/common';
import { ObservabilityRuleTypeRegistry } from '../../../../../../observability/public';

View file

@ -19,7 +19,7 @@ import {
ALERT_UUID,
ALERT_RULE_TYPE_ID,
ALERT_RULE_NAME,
} from '@kbn/rule-data-utils/technical_field_names';
} from '@kbn/rule-data-utils';
import React, { Dispatch, SetStateAction } from 'react';
import { EuiTheme } from 'src/plugins/kibana_react/common';
import { ValuesType } from 'utility-types';

View file

@ -9,7 +9,7 @@ import { EuiFlexGroup, EuiFlexItem, EuiSelect, EuiTitle } from '@elastic/eui';
import { i18n } from '@kbn/i18n';
import React from 'react';
import { useHistory } from 'react-router-dom';
import { ALERT_RULE_TYPE_ID } from '@kbn/rule-data-utils/technical_field_names';
import { ALERT_RULE_TYPE_ID } from '@kbn/rule-data-utils';
import { AlertType } from '../../../../../common/alert_types';
import { useApmServiceContext } from '../../../../context/apm_service/use_apm_service_context';
import { LatencyAggregationType } from '../../../../../common/latency_aggregation_types';

View file

@ -14,6 +14,7 @@ import {
ALERT_SEVERITY,
ALERT_START,
ALERT_STATUS,
ALERT_STATUS_ACTIVE,
ALERT_UUID,
TIMESTAMP,
ALERT_RULE_UUID,
@ -22,8 +23,7 @@ import {
ALERT_RULE_CONSUMER,
ALERT_RULE_PRODUCER,
SPACE_IDS,
} from '@kbn/rule-data-utils/technical_field_names';
import { ALERT_STATUS_ACTIVE } from '@kbn/rule-data-utils/alerts_as_data_status';
} from '@kbn/rule-data-utils';
import { Meta, Story } from '@storybook/react';
import React from 'react';
import { MemoryRouter } from 'react-router-dom';

View file

@ -11,7 +11,7 @@ import {
ALERT_EVALUATION_THRESHOLD,
ALERT_EVALUATION_VALUE,
ALERT_REASON,
} from '@kbn/rule-data-utils/technical_field_names';
} from '@kbn/rule-data-utils';
import { createLifecycleRuleTypeFactory } from '../../../../rule_registry/server';
import {
ENVIRONMENT_NOT_DEFINED,

View file

@ -11,7 +11,7 @@ import {
ALERT_EVALUATION_THRESHOLD,
ALERT_EVALUATION_VALUE,
ALERT_REASON,
} from '@kbn/rule-data-utils/technical_field_names';
} from '@kbn/rule-data-utils';
import { take } from 'rxjs/operators';
import { asDuration } from '../../../../observability/common/utils/formatters';
import { createLifecycleRuleTypeFactory } from '../../../../rule_registry/server';

View file

@ -14,7 +14,7 @@ import {
ALERT_EVALUATION_VALUE,
ALERT_SEVERITY,
ALERT_REASON,
} from '@kbn/rule-data-utils/technical_field_names';
} from '@kbn/rule-data-utils';
import { createLifecycleRuleTypeFactory } from '../../../../rule_registry/server';
import { ProcessorEvent } from '../../../common/processor_event';
import { getSeverity } from '../../../common/anomaly_detection';

View file

@ -11,7 +11,7 @@ import {
ALERT_EVALUATION_THRESHOLD,
ALERT_EVALUATION_VALUE,
ALERT_REASON,
} from '@kbn/rule-data-utils/technical_field_names';
} from '@kbn/rule-data-utils';
import {
ENVIRONMENT_NOT_DEFINED,
getEnvironmentEsField,

View file

@ -5,7 +5,7 @@
* 2.0.
*/
import { EVENT_KIND } from '@kbn/rule-data-utils/technical_field_names';
import { EVENT_KIND } from '@kbn/rule-data-utils';
import { IRuleDataClient } from '../../../../rule_registry/server';
import {
SERVICE_NAME,

View file

@ -12,7 +12,7 @@ import {
EuiCommentList,
EuiCommentProps,
} from '@elastic/eui';
import { ALERT_RULE_NAME, ALERT_RULE_UUID } from '@kbn/rule-data-utils/technical_field_names';
import { ALERT_RULE_NAME, ALERT_RULE_UUID } from '@kbn/rule-data-utils';
import classNames from 'classnames';
import { get, isEmpty } from 'lodash';

View file

@ -5,11 +5,7 @@
* 2.0.
*/
import {
ALERT_REASON,
ALERT_RULE_PARAMETERS,
TIMESTAMP,
} from '@kbn/rule-data-utils/technical_field_names';
import { ALERT_REASON, ALERT_RULE_PARAMETERS, TIMESTAMP } from '@kbn/rule-data-utils';
import { encode } from 'rison-node';
import { stringify } from 'query-string';
import { ObservabilityRuleTypeFormatter } from '../../../../observability/public';

View file

@ -5,7 +5,7 @@
* 2.0.
*/
import { ALERT_REASON, ALERT_START } from '@kbn/rule-data-utils/technical_field_names';
import { ALERT_REASON, ALERT_START } from '@kbn/rule-data-utils';
import { modifyUrl } from '@kbn/std';
import { ObservabilityRuleTypeFormatter } from '../../../../observability/public';

View file

@ -5,7 +5,7 @@
* 2.0.
*/
import { ALERT_REASON } from '@kbn/rule-data-utils/technical_field_names';
import { ALERT_REASON } from '@kbn/rule-data-utils';
import { ObservabilityRuleTypeFormatter } from '../../../../observability/public';
export const formatReason: ObservabilityRuleTypeFormatter = ({ fields }) => {

View file

@ -7,10 +7,7 @@
import * as t from 'io-ts';
export type Maybe<T> = T | null | undefined;
import {
ALERT_STATUS_ACTIVE,
ALERT_STATUS_RECOVERED,
} from '@kbn/rule-data-utils/alerts_as_data_status';
import { ALERT_STATUS_ACTIVE, ALERT_STATUS_RECOVERED } from '@kbn/rule-data-utils';
export const alertWorkflowStatusRt = t.keyof({
open: null,

View file

@ -8,7 +8,7 @@
import React from 'react';
import { i18n } from '@kbn/i18n';
import { EuiHealth, EuiText } from '@elastic/eui';
import { ALERT_STATUS_ACTIVE, AlertStatus } from '@kbn/rule-data-utils/alerts_as_data_status';
import { ALERT_STATUS_ACTIVE, AlertStatus } from '@kbn/rule-data-utils';
import { useTheme } from '../../hooks/use_theme';
interface AlertStatusIndicatorProps {

View file

@ -5,7 +5,7 @@
* 2.0.
*/
import { ALERT_UUID } from '@kbn/rule-data-utils/technical_field_names';
import { ALERT_UUID } from '@kbn/rule-data-utils';
import React, { ComponentType } from 'react';
import { KibanaContextProvider } from '../../../../../../../../src/plugins/kibana_react/public';
import { PluginContext, PluginContextValue } from '../../../../context/plugin_context';

View file

@ -28,11 +28,9 @@ import {
ALERT_UUID,
ALERT_RULE_CATEGORY,
ALERT_RULE_NAME,
} from '@kbn/rule-data-utils/technical_field_names';
import {
ALERT_STATUS_ACTIVE,
ALERT_STATUS_RECOVERED,
} from '@kbn/rule-data-utils/alerts_as_data_status';
} from '@kbn/rule-data-utils';
import moment from 'moment-timezone';
import React, { useMemo } from 'react';
import type { TopAlert } from '../../containers';

View file

@ -18,11 +18,9 @@ import {
ALERT_RULE_NAME,
ALERT_RULE_CATEGORY,
ALERT_RULE_PRODUCER,
} from '@kbn/rule-data-utils/technical_field_names';
import {
ALERT_STATUS_ACTIVE,
ALERT_STATUS_RECOVERED,
} from '@kbn/rule-data-utils/alerts_as_data_status';
} from '@kbn/rule-data-utils';
export const apmAlertResponseExample = [
{

View file

@ -8,11 +8,7 @@
import { EuiButtonGroup, EuiButtonGroupOptionProps } from '@elastic/eui';
import { i18n } from '@kbn/i18n';
import React from 'react';
import {
ALERT_STATUS_ACTIVE,
ALERT_STATUS_RECOVERED,
} from '@kbn/rule-data-utils/alerts_as_data_status';
import { ALERT_STATUS } from '@kbn/rule-data-utils/technical_field_names';
import { ALERT_STATUS_ACTIVE, ALERT_STATUS_RECOVERED, ALERT_STATUS } from '@kbn/rule-data-utils';
import { AlertStatusFilterButton } from '../../../../common/typings';
import { AlertStatusFilter } from '../../../../common/typings';

View file

@ -8,10 +8,10 @@
import {
ALERT_START,
ALERT_STATUS,
ALERT_STATUS_ACTIVE,
ALERT_RULE_TYPE_ID,
ALERT_RULE_NAME,
} from '@kbn/rule-data-utils/technical_field_names';
import { ALERT_STATUS_ACTIVE } from '@kbn/rule-data-utils/alerts_as_data_status';
} from '@kbn/rule-data-utils';
import type { TopAlert } from '../';
import { experimentalRuleFieldMap } from '../../../../../rule_registry/common/assets/field_maps/experimental_rule_field_map';
import { parseTechnicalFields } from '../../../../../rule_registry/common/parse_technical_fields';

View file

@ -5,11 +5,7 @@
* 2.0.
*/
import {
ALERT_STATUS_ACTIVE,
ALERT_STATUS_RECOVERED,
} from '@kbn/rule-data-utils/alerts_as_data_status';
import { ALERT_STATUS } from '@kbn/rule-data-utils/technical_field_names';
import { ALERT_STATUS, ALERT_STATUS_ACTIVE, ALERT_STATUS_RECOVERED } from '@kbn/rule-data-utils';
import type { CellValueElementProps } from '../../../../../../timelines/common';
import { createObservabilityRuleTypeRegistryMock } from '../../../../rules/observability_rule_type_registry_mock';
import * as PluginHook from '../../../../hooks/use_plugin_context';

View file

@ -10,13 +10,11 @@ import {
ALERT_DURATION,
ALERT_SEVERITY,
ALERT_STATUS,
ALERT_REASON,
TIMESTAMP,
} from '@kbn/rule-data-utils/technical_field_names';
import {
ALERT_STATUS_ACTIVE,
ALERT_STATUS_RECOVERED,
} from '@kbn/rule-data-utils/alerts_as_data_status';
ALERT_REASON,
TIMESTAMP,
} from '@kbn/rule-data-utils';
import type { CellValueElementProps, TimelineNonEcsData } from '../../../../../../timelines/common';
import { AlertStatusIndicator } from '../../../../components/shared/alert_status_indicator';
import { TimestampTooltip } from '../../../../components/shared/timestamp_tooltip';

View file

@ -11,8 +11,7 @@ import { IndexPatternBase } from '@kbn/es-query';
import { i18n } from '@kbn/i18n';
import React, { useCallback, useEffect, useRef, useState } from 'react';
import useAsync from 'react-use/lib/useAsync';
import { AlertStatus } from '@kbn/rule-data-utils/alerts_as_data_status';
import { ALERT_STATUS } from '@kbn/rule-data-utils/technical_field_names';
import { ALERT_STATUS, AlertStatus } from '@kbn/rule-data-utils';
import { euiStyled } from '../../../../../../../../src/plugins/kibana_react/common';
import { loadAlertAggregations as loadRuleAggregations } from '../../../../../../../plugins/triggers_actions_ui/public';

View file

@ -10,12 +10,7 @@
* We have types and code at different imports because we don't want to import the whole package in the resulting webpack bundle for the plugin.
* This way plugins can do targeted imports to reduce the final code bundle
*/
import {
ALERT_DURATION,
ALERT_REASON,
ALERT_STATUS,
TIMESTAMP,
} from '@kbn/rule-data-utils/technical_field_names';
import { ALERT_DURATION, ALERT_REASON, ALERT_STATUS, TIMESTAMP } from '@kbn/rule-data-utils';
import {
EuiButtonIcon,

View file

@ -5,6 +5,4 @@
* 2.0.
*/
export * from '@kbn/rule-data-utils/technical_field_names';
export * from '@kbn/rule-data-utils/alerts_as_data_status';
export * from '@kbn/rule-data-utils/alerts_as_data_rbac';
export * from '@kbn/rule-data-utils';

View file

@ -9,19 +9,13 @@ import type * as estypes from '@elastic/elasticsearch/lib/api/typesWithBodyKey';
import { PublicMethodsOf } from '@kbn/utility-types';
import { Filter, buildEsQuery, EsQueryConfig } from '@kbn/es-query';
import { decodeVersion, encodeHitVersion } from '@kbn/securitysolution-es-utils';
import type {
getEsQueryConfig as getEsQueryConfigTyped,
getSafeSortIds as getSafeSortIdsTyped,
isValidFeatureId as isValidFeatureIdTyped,
import {
getEsQueryConfig,
getSafeSortIds,
isValidFeatureId,
STATUS_VALUES,
ValidFeatureId,
} from '@kbn/rule-data-utils';
import {
getEsQueryConfig as getEsQueryConfigNonTyped,
getSafeSortIds as getSafeSortIdsNonTyped,
isValidFeatureId as isValidFeatureIdNonTyped,
// @ts-expect-error
} from '@kbn/rule-data-utils/target_node/alerts_as_data_rbac';
import {
InlineScript,
@ -46,10 +40,6 @@ import {
import { ParsedTechnicalFields } from '../../common/parse_technical_fields';
import { Dataset, IRuleDataService } from '../rule_data_plugin_service';
const getEsQueryConfig: typeof getEsQueryConfigTyped = getEsQueryConfigNonTyped;
const getSafeSortIds: typeof getSafeSortIdsTyped = getSafeSortIdsNonTyped;
const isValidFeatureId: typeof isValidFeatureIdTyped = isValidFeatureIdNonTyped;
// TODO: Fix typings https://github.com/elastic/kibana/issues/101776
type NonNullableProps<Obj extends {}, Props extends keyof Obj> = Omit<Obj, Props> & {
[K in Props]-?: NonNullable<Obj[K]>;

View file

@ -7,7 +7,7 @@
import { ResourceInstaller } from './resource_installer';
import { loggerMock } from '@kbn/logging/mocks';
import { AlertConsumers } from '@kbn/rule-data-utils/alerts_as_data_rbac';
import { AlertConsumers } from '@kbn/rule-data-utils';
import { Dataset } from './index_options';
import { IndexInfo } from './index_info';

View file

@ -8,7 +8,7 @@
import { loggerMock } from '@kbn/logging/mocks';
import { RuleDataService } from './rule_data_plugin_service';
import { elasticsearchServiceMock } from 'src/core/server/mocks';
import { AlertConsumers } from '@kbn/rule-data-utils/alerts_as_data_rbac';
import { AlertConsumers } from '@kbn/rule-data-utils';
import { Dataset } from './index_options';
import { RuleDataClient } from '../rule_data_client/rule_data_client';
import { createRuleDataClientMock as mockCreateRuleDataClient } from '../rule_data_client/rule_data_client.mock';

View file

@ -18,7 +18,7 @@ import {
SPACE_IDS,
TAGS,
TIMESTAMP,
} from '@kbn/rule-data-utils/technical_field_names';
} from '@kbn/rule-data-utils';
import { AlertExecutorOptions } from '../../../alerting/server';
import { ParsedTechnicalFields } from '../../common/parse_technical_fields';

View file

@ -5,7 +5,7 @@
* 2.0.
*/
import { ALERT_NAMESPACE, ALERT_RULE_NAMESPACE } from '@kbn/rule-data-utils/technical_field_names';
import { ALERT_NAMESPACE, ALERT_RULE_NAMESPACE } from '@kbn/rule-data-utils';
export const ALERT_ANCESTORS = `${ALERT_NAMESPACE}.ancestors` as const;
export const ALERT_BUILDING_BLOCK_TYPE = `${ALERT_NAMESPACE}.building_block_type` as const;

View file

@ -14,11 +14,7 @@ import dateMath from '@elastic/datemath';
import { FilterStateStore, Filter } from '@kbn/es-query';
import { i18n } from '@kbn/i18n';
import {
ALERT_RULE_FROM,
ALERT_RULE_TYPE,
ALERT_RULE_NOTE,
} from '@kbn/rule-data-utils/technical_field_names';
import { ALERT_RULE_FROM, ALERT_RULE_TYPE, ALERT_RULE_NOTE } from '@kbn/rule-data-utils';
import {
ALERT_ORIGINAL_TIME,

View file

@ -9,7 +9,7 @@ import {
ALERT_BUILDING_BLOCK_TYPE,
ALERT_WORKFLOW_STATUS,
ALERT_RULE_RULE_ID,
} from '@kbn/rule-data-utils/technical_field_names';
} from '@kbn/rule-data-utils';
import type { Filter } from '@kbn/es-query';
import { RowRendererId } from '../../../../common/types/timeline';

View file

@ -6,11 +6,7 @@
*/
import { EuiDataGridColumn } from '@elastic/eui';
import {
ALERT_DURATION,
ALERT_REASON,
ALERT_STATUS,
} from '@kbn/rule-data-utils/technical_field_names';
import { ALERT_DURATION, ALERT_REASON, ALERT_STATUS } from '@kbn/rule-data-utils';
import { ColumnHeaderOptions } from '../../../../../common/types';
import { defaultColumnHeaderType } from '../../../../timelines/components/timeline/body/column_headers/default_headers';

View file

@ -9,7 +9,7 @@ import { mount } from 'enzyme';
import { cloneDeep } from 'lodash/fp';
import React from 'react';
import { ALERT_DURATION, ALERT_STATUS } from '@kbn/rule-data-utils/technical_field_names';
import { ALERT_DURATION, ALERT_STATUS } from '@kbn/rule-data-utils';
import { mockBrowserFields } from '../../../../common/containers/source/mock';
import { DragDropContextWrapper } from '../../../../common/components/drag_and_drop/drag_drop_context_wrapper';

View file

@ -9,12 +9,7 @@ import moment from 'moment';
import React from 'react';
import { EuiDataGridCellValueElementProps, EuiLink } from '@elastic/eui';
import {
ALERT_DURATION,
ALERT_REASON,
ALERT_SEVERITY,
ALERT_STATUS,
} from '@kbn/rule-data-utils/technical_field_names';
import { ALERT_DURATION, ALERT_REASON, ALERT_SEVERITY, ALERT_STATUS } from '@kbn/rule-data-utils';
import { TruncatableText } from '../../../../common/components/truncatable_text';
import { Severity } from '../../../components/severity';

View file

@ -5,7 +5,7 @@
* 2.0.
*/
import { ALERT_RULE_UUID } from '@kbn/rule-data-utils/technical_field_names';
import { ALERT_RULE_UUID } from '@kbn/rule-data-utils';
import { get, isEmpty } from 'lodash/fp';
import React from 'react';
import { matchPath, RouteProps, Redirect } from 'react-router-dom';

View file

@ -7,7 +7,7 @@
import { get, isEmpty, isNumber, isObject, isString } from 'lodash/fp';
import { ALERT_RULE_PARAMETERS } from '@kbn/rule-data-utils/technical_field_names';
import { ALERT_RULE_PARAMETERS } from '@kbn/rule-data-utils';
import { EventHit, EventSource, TimelineEventsDetailsItem } from '../search_strategy';
import { toObjectArrayOfStrings, toStringArray } from './to_array';
export const baseCategoryFields = ['@timestamp', 'labels', 'message', 'tags'];

View file

@ -15,7 +15,7 @@ import {
import { AddToCaseAction } from './add_to_case_action';
import { SECURITY_SOLUTION_OWNER } from '../../../../../../cases/common';
import { AddToCaseActionButton } from './add_to_case_action_button';
import { ALERT_RULE_UUID } from '@kbn/rule-data-utils/technical_field_names';
import { ALERT_RULE_UUID } from '@kbn/rule-data-utils';
jest.mock('react-router-dom', () => ({
useLocation: () => ({

View file

@ -5,10 +5,7 @@
* 2.0.
*/
import {
ALERT_RULE_CONSUMER,
ALERT_RULE_PRODUCER,
} from '@kbn/rule-data-utils/technical_field_names';
import { ALERT_RULE_CONSUMER, ALERT_RULE_PRODUCER } from '@kbn/rule-data-utils';
import { isEmpty } from 'lodash/fp';
import { EuiDataGridCellValueElementProps } from '@elastic/eui';

View file

@ -32,10 +32,7 @@ import React, {
import { connect, ConnectedProps, useDispatch } from 'react-redux';
import styled, { ThemeContext } from 'styled-components';
import {
ALERT_RULE_CONSUMER,
ALERT_RULE_PRODUCER,
} from '@kbn/rule-data-utils/technical_field_names';
import { ALERT_RULE_CONSUMER, ALERT_RULE_PRODUCER } from '@kbn/rule-data-utils';
import { Filter } from '@kbn/es-query';
import {
TGridCellAction,

View file

@ -15,11 +15,7 @@ import {
EuiHorizontalRule,
} from '@elastic/eui';
import { i18n } from '@kbn/i18n';
import {
ALERT_REASON,
ALERT_RULE_NAME,
ALERT_RULE_UUID,
} from '@kbn/rule-data-utils/technical_field_names';
import { ALERT_REASON, ALERT_RULE_NAME, ALERT_RULE_UUID } from '@kbn/rule-data-utils';
import { get } from 'lodash';
import moment from 'moment';
import React, { ComponentType, useCallback, useMemo } from 'react';

View file

@ -5,7 +5,7 @@
* 2.0.
*/
import { AlertConsumers } from '@kbn/rule-data-utils/alerts_as_data_rbac';
import { AlertConsumers } from '@kbn/rule-data-utils';
import { EuiFlexGroup, EuiFlexItem, EuiPanel } from '@elastic/eui';
import { isEmpty } from 'lodash/fp';
import React, { useEffect, useMemo, useRef, useState } from 'react';

View file

@ -5,7 +5,7 @@
* 2.0.
*/
import type { AlertConsumers } from '@kbn/rule-data-utils/alerts_as_data_rbac';
import type { AlertConsumers } from '@kbn/rule-data-utils';
import deepEqual from 'fast-deep-equal';
import { isEmpty, isString, noop } from 'lodash/fp';
import { useCallback, useEffect, useRef, useState } from 'react';

View file

@ -6,7 +6,7 @@
*/
import { normalizedEventFields } from './use_add_to_case';
import { ALERT_RULE_NAME, ALERT_RULE_UUID } from '@kbn/rule-data-utils/technical_field_names';
import { ALERT_RULE_NAME, ALERT_RULE_UUID } from '@kbn/rule-data-utils';
import { merge } from 'lodash';
const defaultArgs = {

View file

@ -7,7 +7,7 @@
import { get, isEmpty } from 'lodash/fp';
import { useState, useCallback, useMemo, SyntheticEvent } from 'react';
import { useDispatch } from 'react-redux';
import { ALERT_RULE_NAME, ALERT_RULE_UUID } from '@kbn/rule-data-utils/technical_field_names';
import { ALERT_RULE_NAME, ALERT_RULE_UUID } from '@kbn/rule-data-utils';
import { useKibana } from '../../../../../src/plugins/kibana_react/public';
import { Case, SubCase } from '../../../cases/common';
import { TimelinesStartServices } from '../types';

View file

@ -6,7 +6,7 @@
*/
import React from 'react';
import { ALERT_START, ALERT_STATUS } from '@kbn/rule-data-utils/technical_field_names';
import { ALERT_START, ALERT_STATUS } from '@kbn/rule-data-utils';
import { TGridIntegratedProps } from '../components/t_grid/integrated';
import { mockBrowserFields, mockDocValueFields, mockRuntimeMappings } from './browser_fields';
import { mockDataProviders } from './mock_data_providers';

View file

@ -8,8 +8,7 @@
import React from 'react';
import moment from 'moment';
import { ALERT_END, ALERT_STATUS, ALERT_REASON } from '@kbn/rule-data-utils/technical_field_names';
import { ALERT_STATUS_ACTIVE } from '@kbn/rule-data-utils/alerts_as_data_status';
import { ALERT_END, ALERT_STATUS, ALERT_STATUS_ACTIVE, ALERT_REASON } from '@kbn/rule-data-utils';
import { AlertTypeInitializer } from '.';
import { getMonitorRouteFromMonitorId } from './common';

View file

@ -12,9 +12,9 @@ import {
ALERT_END,
ALERT_START,
ALERT_STATUS,
ALERT_STATUS_ACTIVE,
ALERT_REASON,
} from '@kbn/rule-data-utils/technical_field_names';
import { ALERT_STATUS_ACTIVE } from '@kbn/rule-data-utils/alerts_as_data_status';
} from '@kbn/rule-data-utils';
import { AlertTypeInitializer } from '.';
import { getMonitorRouteFromMonitorId } from './common';

View file

@ -6,7 +6,7 @@
*/
import React from 'react';
import { ALERT_REASON } from '@kbn/rule-data-utils/technical_field_names';
import { ALERT_REASON } from '@kbn/rule-data-utils';
import { ObservabilityRuleTypeModel } from '../../../../observability/public';
import { CLIENT_ALERT_TYPES } from '../../../common/constants/alerts';
import { TlsTranslations } from '../../../common/translations';

View file

@ -6,7 +6,7 @@
*/
import expect from '@kbn/expect';
import { ALERT_WORKFLOW_STATUS } from '@kbn/rule-data-utils/technical_field_names';
import { ALERT_WORKFLOW_STATUS } from '@kbn/rule-data-utils';
import { FtrProviderContext } from '../../../../common/ftr_provider_context';

View file

@ -7,7 +7,7 @@
import { omit } from 'lodash/fp';
import expect from '@kbn/expect';
import { ALERT_WORKFLOW_STATUS } from '@kbn/rule-data-utils/technical_field_names';
import { ALERT_WORKFLOW_STATUS } from '@kbn/rule-data-utils';
import { FtrProviderContext } from '../../../../common/ftr_provider_context';
import { CASES_URL } from '../../../../../../plugins/cases/common/constants';

View file

@ -7,11 +7,7 @@
import expect from '@kbn/expect';
import { chunk } from 'lodash';
import {
ALERT_STATUS_ACTIVE,
ALERT_STATUS_RECOVERED,
AlertStatus,
} from '@kbn/rule-data-utils/alerts_as_data_status';
import { ALERT_STATUS_ACTIVE, ALERT_STATUS_RECOVERED, AlertStatus } from '@kbn/rule-data-utils';
import { FtrProviderContext } from '../../../ftr_provider_context';
import { WebElementWrapper } from '../../../../../../test/functional/services/lib/web_element_wrapper';

View file

@ -6,7 +6,7 @@
*/
import expect from '@kbn/expect';
import { ALERT_STATUS_ACTIVE } from '@kbn/rule-data-utils/alerts_as_data_status';
import { ALERT_STATUS_ACTIVE } from '@kbn/rule-data-utils';
import { FtrProviderContext } from '../../../ftr_provider_context';
const ROWS_NEEDED_FOR_PAGINATION = 10;

View file

@ -5888,6 +5888,10 @@
version "0.0.0"
uid ""
"@types/kbn__rule-data-utils@link:bazel-bin/packages/kbn-rule-data-utils/npm_module_types":
version "0.0.0"
uid ""
"@types/keyv@*":
version "3.1.1"
resolved "https://registry.yarnpkg.com/@types/keyv/-/keyv-3.1.1.tgz#e45a45324fca9dab716ab1230ee249c9fb52cfa7"
@ -10465,7 +10469,7 @@ core-js@^2.4.0, core-js@^2.5.0, core-js@^2.6.9:
resolved "https://registry.yarnpkg.com/core-js/-/core-js-2.6.9.tgz#6b4b214620c834152e179323727fc19741b084f2"
integrity sha512-HOpZf6eXmnl7la+cUdMnLvUxKNqLUzJvgIziQ0DiF3JwSImNphIqdGqzj6hIKyX04MmV0poclQ7+wjWvxQyR2A==
core-js@^3.19.3, core-js@^3.0.4, core-js@^3.6.5, core-js@^3.8.2, core-js@^3.8.3:
core-js@^3.0.4, core-js@^3.19.3, core-js@^3.6.5, core-js@^3.8.2, core-js@^3.8.3:
version "3.19.3"
resolved "https://registry.yarnpkg.com/core-js/-/core-js-3.19.3.tgz#6df8142a996337503019ff3235a7022d7cdf4559"
integrity sha512-LeLBMgEGSsG7giquSzvgBrTS7V5UL6ks3eQlUSbN8dJStlLFiRzUm5iqsRyzUB8carhfKjkJ2vzKqE6z1Vga9g==