mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 09:48:58 -04:00
fix no-restricted-imports
(#195456)
## Summary I noticed that our `no-restricted-imports` rules were not working on some parts of the codebase. Turns our the rule was overriden by mistake. This PR fixes the rules and places that were not following them: - lodash set for safety - react-use for a bit smaller bundles - router for context annoncement (`useExecutionContext`) and hopefully easier upgrade to newer version
This commit is contained in:
parent
c0bd82b30c
commit
1055120d0f
79 changed files with 131 additions and 117 deletions
13
.eslintrc.js
13
.eslintrc.js
|
@ -1014,6 +1014,7 @@ module.exports = {
|
|||
'error',
|
||||
{
|
||||
patterns: ['**/legacy_uptime/*'],
|
||||
paths: RESTRICTED_IMPORTS,
|
||||
},
|
||||
],
|
||||
},
|
||||
|
@ -1055,6 +1056,7 @@ module.exports = {
|
|||
{
|
||||
// prevents UI code from importing server side code and then webpack including it when doing builds
|
||||
patterns: ['**/server/*'],
|
||||
paths: RESTRICTED_IMPORTS,
|
||||
},
|
||||
],
|
||||
},
|
||||
|
@ -1113,6 +1115,7 @@ module.exports = {
|
|||
{
|
||||
// prevents UI code from importing server side code and then webpack including it when doing builds
|
||||
patterns: ['**/server/*'],
|
||||
paths: RESTRICTED_IMPORTS,
|
||||
},
|
||||
],
|
||||
},
|
||||
|
@ -1184,13 +1187,7 @@ module.exports = {
|
|||
// to help deprecation and prevent accidental re-use/continued use of code we plan on removing. If you are
|
||||
// finding yourself turning this off a lot for "new code" consider renaming the file and functions if it is has valid uses.
|
||||
patterns: ['*legacy*'],
|
||||
paths: [
|
||||
{
|
||||
name: 'react-router-dom',
|
||||
importNames: ['Route'],
|
||||
message: "import { Route } from '@kbn/kibana-react-plugin/public'",
|
||||
},
|
||||
],
|
||||
paths: RESTRICTED_IMPORTS,
|
||||
},
|
||||
],
|
||||
},
|
||||
|
@ -1348,6 +1345,7 @@ module.exports = {
|
|||
{
|
||||
// prevents UI code from importing server side code and then webpack including it when doing builds
|
||||
patterns: ['**/server/*'],
|
||||
paths: RESTRICTED_IMPORTS,
|
||||
},
|
||||
],
|
||||
},
|
||||
|
@ -1525,6 +1523,7 @@ module.exports = {
|
|||
// to help deprecation and prevent accidental re-use/continued use of code we plan on removing. If you are
|
||||
// finding yourself turning this off a lot for "new code" consider renaming the file and functions if it has valid uses.
|
||||
patterns: ['*legacy*'],
|
||||
paths: RESTRICTED_IMPORTS,
|
||||
},
|
||||
],
|
||||
},
|
||||
|
|
2
.github/CODEOWNERS
vendored
2
.github/CODEOWNERS
vendored
|
@ -1327,6 +1327,8 @@ x-pack/test_serverless/**/test_suites/observability/ai_assistant @elastic/obs-ai
|
|||
/x-pack/dev-tools @elastic/kibana-operations
|
||||
/catalog-info.yaml @elastic/kibana-operations @elastic/kibana-tech-leads
|
||||
/.devcontainer/ @elastic/kibana-operations
|
||||
/.eslintrc.js @elastic/kibana-operations
|
||||
/.eslintignore @elastic/kibana-operations
|
||||
|
||||
# Appex QA
|
||||
/x-pack/test_serverless/tsconfig.json @elastic/appex-qa
|
||||
|
|
|
@ -15,7 +15,8 @@ import { useLoadConnectors } from '../connectorland/use_load_connectors';
|
|||
|
||||
import { DefinedUseQueryResult, UseQueryResult } from '@tanstack/react-query';
|
||||
|
||||
import { useLocalStorage, useSessionStorage } from 'react-use';
|
||||
import useLocalStorage from 'react-use/lib/useLocalStorage';
|
||||
import useSessionStorage from 'react-use/lib/useSessionStorage';
|
||||
import { QuickPrompts } from './quick_prompts/quick_prompts';
|
||||
import { mockAssistantAvailability, TestProviders } from '../mock/test_providers/test_providers';
|
||||
import { useFetchCurrentUserConversations } from './api';
|
||||
|
@ -27,7 +28,8 @@ import { omit } from 'lodash';
|
|||
|
||||
jest.mock('../connectorland/use_load_connectors');
|
||||
jest.mock('../connectorland/connector_setup');
|
||||
jest.mock('react-use');
|
||||
jest.mock('react-use/lib/useLocalStorage');
|
||||
jest.mock('react-use/lib/useSessionStorage');
|
||||
|
||||
jest.mock('./quick_prompts/quick_prompts', () => ({ QuickPrompts: jest.fn() }));
|
||||
jest.mock('./api/conversations/use_fetch_current_user_conversations');
|
||||
|
|
|
@ -32,15 +32,12 @@ const testTitle = 'SPL_QUERY_CONVERSION_TITLE';
|
|||
const testPrompt = 'SPL_QUERY_CONVERSION_PROMPT';
|
||||
const customTitle = 'A_CUSTOM_OPTION';
|
||||
|
||||
jest.mock('react-use', () => ({
|
||||
...jest.requireActual('react-use'),
|
||||
useMeasure: () => [
|
||||
() => {},
|
||||
{
|
||||
width: 500,
|
||||
},
|
||||
],
|
||||
}));
|
||||
jest.mock('react-use/lib/useMeasure', () => () => [
|
||||
() => {},
|
||||
{
|
||||
width: 500,
|
||||
},
|
||||
]);
|
||||
|
||||
jest.mock('../../assistant_context', () => ({
|
||||
...jest.requireActual('../../assistant_context'),
|
||||
|
|
|
@ -14,7 +14,7 @@ import {
|
|||
EuiButtonIcon,
|
||||
EuiButtonEmpty,
|
||||
} from '@elastic/eui';
|
||||
import { useMeasure } from 'react-use';
|
||||
import useMeasure from 'react-use/lib/useMeasure';
|
||||
|
||||
import { css } from '@emotion/react';
|
||||
import {
|
||||
|
|
|
@ -8,13 +8,11 @@
|
|||
import { renderHook } from '@testing-library/react-hooks';
|
||||
|
||||
import { useAssistantContext } from '.';
|
||||
import { useLocalStorage } from 'react-use';
|
||||
import useLocalStorage from 'react-use/lib/useLocalStorage';
|
||||
import { TestProviders } from '../mock/test_providers/test_providers';
|
||||
|
||||
jest.mock('react-use', () => ({
|
||||
useLocalStorage: jest.fn().mockReturnValue(['456', jest.fn()]),
|
||||
useSessionStorage: jest.fn().mockReturnValue(['456', jest.fn()]),
|
||||
}));
|
||||
jest.mock('react-use/lib/useLocalStorage', () => jest.fn().mockReturnValue(['456', jest.fn()]));
|
||||
jest.mock('react-use/lib/useSessionStorage', () => jest.fn().mockReturnValue(['456', jest.fn()]));
|
||||
|
||||
describe('AssistantContext', () => {
|
||||
beforeEach(() => jest.clearAllMocks());
|
||||
|
|
|
@ -10,7 +10,8 @@ import { omit } from 'lodash/fp';
|
|||
import React, { useCallback, useMemo, useState, useRef } from 'react';
|
||||
import type { IToasts } from '@kbn/core-notifications-browser';
|
||||
import { ActionTypeRegistryContract } from '@kbn/triggers-actions-ui-plugin/public';
|
||||
import { useLocalStorage, useSessionStorage } from 'react-use';
|
||||
import useLocalStorage from 'react-use/lib/useLocalStorage';
|
||||
import useSessionStorage from 'react-use/lib/useSessionStorage';
|
||||
import type { DocLinksStart } from '@kbn/core-doc-links-browser';
|
||||
import { AssistantFeatures, defaultAssistantFeatures } from '@kbn/elastic-assistant-common';
|
||||
import { NavigateToAppOptions } from '@kbn/core/public';
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
* 2.0.
|
||||
*/
|
||||
|
||||
import { set } from 'lodash';
|
||||
import { set } from '@kbn/safer-lodash-set';
|
||||
import { UserRt, UserWithProfileInfoRt, UsersRt, CaseUserProfileRt, CaseAssigneesRt } from './v1';
|
||||
|
||||
describe('User', () => {
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
* 2.0.
|
||||
*/
|
||||
|
||||
import { set } from 'lodash';
|
||||
import { set } from '@kbn/safer-lodash-set';
|
||||
import React from 'react';
|
||||
import { screen } from '@testing-library/react';
|
||||
import type { AppMockRenderer } from '../../common/mock';
|
||||
|
|
|
@ -12,7 +12,8 @@ import { loggingSystemMock } from '@kbn/core-logging-server-mocks';
|
|||
|
||||
import { CasesOracleService } from './cases_oracle_service';
|
||||
import { CASE_RULES_SAVED_OBJECT } from '../../../common/constants';
|
||||
import { isEmpty, set } from 'lodash';
|
||||
import { isEmpty } from 'lodash';
|
||||
import { set } from '@kbn/safer-lodash-set';
|
||||
|
||||
describe('CasesOracleService', () => {
|
||||
const savedObjectsClient = savedObjectsClientMock.create();
|
||||
|
|
|
@ -8,7 +8,8 @@
|
|||
import { createHash } from 'node:crypto';
|
||||
import stringify from 'json-stable-stringify';
|
||||
|
||||
import { isEmpty, set } from 'lodash';
|
||||
import { isEmpty } from 'lodash';
|
||||
import { set } from '@kbn/safer-lodash-set';
|
||||
import { CasesService } from './cases_service';
|
||||
|
||||
describe('CasesService', () => {
|
||||
|
|
|
@ -5,7 +5,8 @@
|
|||
* 2.0.
|
||||
*/
|
||||
|
||||
import { set, omit, unset } from 'lodash';
|
||||
import { omit, unset } from 'lodash';
|
||||
import { set } from '@kbn/safer-lodash-set';
|
||||
import { loggerMock } from '@kbn/logging-mocks';
|
||||
import { savedObjectsClientMock } from '@kbn/core/server/mocks';
|
||||
import type {
|
||||
|
|
|
@ -11,7 +11,8 @@ import { createSavedObjectsSerializerMock } from '../../../client/mocks';
|
|||
import { savedObjectsClientMock } from '@kbn/core-saved-objects-api-server-mocks';
|
||||
import { loggerMock } from '@kbn/logging-mocks';
|
||||
import { auditLoggerMock } from '@kbn/security-plugin/server/audit/mocks';
|
||||
import { set, unset } from 'lodash';
|
||||
import { unset } from 'lodash';
|
||||
import { set } from '@kbn/safer-lodash-set';
|
||||
import { createConnectorObject } from '../../test_utils';
|
||||
import { UserActionPersister } from './create';
|
||||
import { createUserActionSO } from '../test_utils';
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
*/
|
||||
|
||||
import { useMemo } from 'react';
|
||||
import { useObservable } from 'react-use';
|
||||
import useObservable from 'react-use/lib/useObservable';
|
||||
import { MINIMUM_LICENSE_TYPE } from '../../../common/constants';
|
||||
import { useKibana } from './use_kibana';
|
||||
import type { RenderUpselling } from '../../services';
|
||||
|
|
|
@ -5,8 +5,8 @@
|
|||
* 2.0.
|
||||
*/
|
||||
import React from 'react';
|
||||
import { Redirect, Switch } from 'react-router-dom';
|
||||
import { Route } from '@kbn/shared-ux-router';
|
||||
import { Redirect } from 'react-router-dom';
|
||||
import { Route, Routes } from '@kbn/shared-ux-router';
|
||||
import { KibanaContextProvider } from '@kbn/kibana-react-plugin/public';
|
||||
import type { Services } from '../../services';
|
||||
import { TelemetryContextProvider } from './telemetry';
|
||||
|
@ -33,7 +33,7 @@ const CreateIntegrationRouter = React.memo(() => {
|
|||
const { canUseIntegrationAssistant, canUseIntegrationUpload } = useRoutesAuthorization();
|
||||
const isAvailable = useIsAvailable();
|
||||
return (
|
||||
<Switch>
|
||||
<Routes>
|
||||
{isAvailable && canUseIntegrationAssistant && (
|
||||
<Route path={PagePath[Page.assistant]} exact component={CreateIntegrationAssistant} />
|
||||
)}
|
||||
|
@ -44,7 +44,7 @@ const CreateIntegrationRouter = React.memo(() => {
|
|||
<Route path={PagePath[Page.landing]} exact component={CreateIntegrationLanding} />
|
||||
|
||||
<Route render={() => <Redirect to={PagePath[Page.landing]} />} />
|
||||
</Switch>
|
||||
</Routes>
|
||||
);
|
||||
});
|
||||
CreateIntegrationRouter.displayName = 'CreateIntegrationRouter';
|
||||
|
|
|
@ -11,7 +11,7 @@ import { useDispatch, useSelector } from 'react-redux';
|
|||
import { EuiButton, EuiButtonEmpty, EuiCallOut, EuiMarkdownFormat, EuiSpacer } from '@elastic/eui';
|
||||
import { syntheticsSettingsLocatorID } from '@kbn/observability-plugin/common';
|
||||
import { useFetcher } from '@kbn/observability-shared-plugin/public';
|
||||
import { useSessionStorage } from 'react-use';
|
||||
import useSessionStorage from 'react-use/lib/useSessionStorage';
|
||||
import { i18n } from '@kbn/i18n';
|
||||
import { isEmpty } from 'lodash';
|
||||
import { useKibana } from '@kbn/kibana-react-plugin/public';
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
import React, { useCallback, useState } from 'react';
|
||||
import { EuiFormRow, EuiFormRowProps } from '@elastic/eui';
|
||||
import { useSelector } from 'react-redux';
|
||||
import { useDebounce } from 'react-use';
|
||||
import useDebounce from 'react-use/lib/useDebounce';
|
||||
import { ControllerRenderProps, ControllerFieldState, useFormContext } from 'react-hook-form';
|
||||
import { useKibanaSpace, useIsEditFlow } from '../hooks';
|
||||
import { selectServiceLocationsState } from '../../../state';
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
|
||||
import { useCallback, useEffect, useMemo, useState } from 'react';
|
||||
import { useSelector, useDispatch } from 'react-redux';
|
||||
import { useDebounce } from 'react-use';
|
||||
import useDebounce from 'react-use/lib/useDebounce';
|
||||
import { useLocation } from 'react-router-dom';
|
||||
|
||||
import { useSyntheticsRefreshContext } from '../../../contexts/synthetics_refresh_context';
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
|
||||
import { useCallback, useEffect, useRef } from 'react';
|
||||
import { useDispatch, useSelector } from 'react-redux';
|
||||
import { useDebounce } from 'react-use';
|
||||
import useDebounce from 'react-use/lib/useDebounce';
|
||||
import { useMonitorFiltersState } from '../common/monitor_filters/use_filters';
|
||||
import {
|
||||
fetchMonitorListAction,
|
||||
|
|
|
@ -19,7 +19,7 @@ import {
|
|||
import React, { useState } from 'react';
|
||||
import { i18n } from '@kbn/i18n';
|
||||
import { useSelector } from 'react-redux';
|
||||
import { useKey } from 'react-use';
|
||||
import useKey from 'react-use/lib/useKey';
|
||||
import { FlyoutParamProps } from '../types';
|
||||
import { OverviewLoader } from '../overview_loader';
|
||||
import { useFilteredGroupMonitors } from './use_filtered_group_monitors';
|
||||
|
|
|
@ -21,7 +21,7 @@ import { i18n } from '@kbn/i18n';
|
|||
import { FormattedMessage } from '@kbn/i18n-react';
|
||||
import { useKibana } from '@kbn/kibana-react-plugin/public';
|
||||
import { EuiBasicTableColumn } from '@elastic/eui/src/components/basic_table/basic_table';
|
||||
import { useDebounce } from 'react-use';
|
||||
import useDebounce from 'react-use/lib/useDebounce';
|
||||
import { TableTitle } from '../../common/components/table_title';
|
||||
import { ParamsText } from './params_text';
|
||||
import { SyntheticsParams } from '../../../../../../common/runtime_types';
|
||||
|
|
|
@ -15,7 +15,7 @@ import React, {
|
|||
FC,
|
||||
} from 'react';
|
||||
import useLocalStorage from 'react-use/lib/useLocalStorage';
|
||||
import { useEvent } from 'react-use';
|
||||
import useEvent from 'react-use/lib/useEvent';
|
||||
import moment from 'moment';
|
||||
import { Subject } from 'rxjs';
|
||||
import { i18n } from '@kbn/i18n';
|
||||
|
|
|
@ -9,7 +9,7 @@ import { ChromeBreadcrumb } from '@kbn/core/public';
|
|||
import { render } from '../utils/testing';
|
||||
import React from 'react';
|
||||
import { i18n } from '@kbn/i18n';
|
||||
import { Route } from 'react-router-dom';
|
||||
import { Route } from '@kbn/shared-ux-router';
|
||||
import { OVERVIEW_ROUTE } from '../../../../common/constants';
|
||||
import { KibanaContextProvider } from '@kbn/kibana-react-plugin/public';
|
||||
import {
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
|
||||
import { useMemo, useState } from 'react';
|
||||
import { useParams } from 'react-router-dom';
|
||||
import { useDebounce } from 'react-use';
|
||||
import useDebounce from 'react-use/lib/useDebounce';
|
||||
import { useFetcher } from '@kbn/observability-shared-plugin/public';
|
||||
|
||||
import { fetchMonitorManagementList, getMonitorListPageStateWithDefaults } from '../state';
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
import moment from 'moment';
|
||||
import { Moment } from 'moment-timezone';
|
||||
import * as redux from 'react-redux';
|
||||
// eslint-disable-next-line no-restricted-imports
|
||||
import * as reactRouterDom from 'react-router-dom';
|
||||
|
||||
export function mockMoment() {
|
||||
|
|
|
@ -8,7 +8,8 @@
|
|||
/* eslint-disable max-classes-per-file */
|
||||
|
||||
import type { DeepPartial } from 'utility-types';
|
||||
import { merge, set } from 'lodash';
|
||||
import { merge } from 'lodash';
|
||||
import { set } from '@kbn/safer-lodash-set';
|
||||
import { gte } from 'semver';
|
||||
import type { EndpointCapabilities } from '../service/response_actions/constants';
|
||||
import { BaseDataGenerator } from './base_data_generator';
|
||||
|
|
|
@ -17,7 +17,8 @@ import {
|
|||
checkIfPopupMessagesContainCustomNotifications,
|
||||
resetCustomNotifications,
|
||||
} from './policy_config_helpers';
|
||||
import { get, merge, set } from 'lodash';
|
||||
import { get, merge } from 'lodash';
|
||||
import { set } from '@kbn/safer-lodash-set';
|
||||
|
||||
describe('Policy Config helpers', () => {
|
||||
describe('disableProtections', () => {
|
||||
|
|
|
@ -5,7 +5,8 @@
|
|||
* 2.0.
|
||||
*/
|
||||
|
||||
import { get, set } from 'lodash';
|
||||
import { get } from 'lodash';
|
||||
import { set } from '@kbn/safer-lodash-set';
|
||||
import { DefaultPolicyNotificationMessage } from './policy_config';
|
||||
import type { PolicyConfig } from '../types';
|
||||
import { PolicyOperatingSystem, ProtectionModes, AntivirusRegistrationModes } from '../types';
|
||||
|
|
|
@ -5,7 +5,8 @@
|
|||
* 2.0.
|
||||
*/
|
||||
|
||||
import { merge, setWith } from 'lodash';
|
||||
import { merge } from 'lodash';
|
||||
import { setWith } from '@kbn/safer-lodash-set';
|
||||
|
||||
/*
|
||||
* Expands an object with "dotted" fields to a nested object with unflattened fields.
|
||||
|
|
|
@ -12,7 +12,7 @@ import { createAddToTimelineCellActionFactory } from './add_to_timeline';
|
|||
import type { CellActionExecutionContext } from '@kbn/cell-actions';
|
||||
import { GEO_FIELD_TYPE } from '../../../../timelines/components/timeline/body/renderers/constants';
|
||||
import { createStartServicesMock } from '../../../../common/lib/kibana/kibana_react.mock';
|
||||
import { set } from 'lodash/fp';
|
||||
import { set } from '@kbn/safer-lodash-set/fp';
|
||||
import { KBN_FIELD_TYPES } from '@kbn/field-types';
|
||||
|
||||
const services = createStartServicesMock();
|
||||
|
|
|
@ -29,10 +29,7 @@ const data = {
|
|||
|
||||
const mockUseObservable = jest.fn();
|
||||
|
||||
jest.mock('react-use', () => ({
|
||||
...jest.requireActual('react-use'),
|
||||
useObservable: () => mockUseObservable(),
|
||||
}));
|
||||
jest.mock('react-use/lib/useObservable', () => () => mockUseObservable());
|
||||
|
||||
jest.mock('../../../common/lib/kibana', () => {
|
||||
const original = jest.requireActual('../../../common/lib/kibana');
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
import React, { useCallback } from 'react';
|
||||
import { EuiWrappingPopover } from '@elastic/eui';
|
||||
import { useLocation } from 'react-router-dom';
|
||||
import { useObservable } from 'react-use';
|
||||
import useObservable from 'react-use/lib/useObservable';
|
||||
import { StatefulTopN } from '../../../common/components/top_n';
|
||||
import { getScopeFromPath } from '../../../sourcerer/containers/sourcerer_paths';
|
||||
import { useSourcererDataView } from '../../../sourcerer/containers';
|
||||
|
|
|
@ -23,7 +23,7 @@ import { once } from 'lodash/fp';
|
|||
import type { HttpSetup } from '@kbn/core-http-browser';
|
||||
import type { Message } from '@kbn/elastic-assistant-common';
|
||||
import { loadAllActions as loadConnectors } from '@kbn/triggers-actions-ui-plugin/public/common/constants';
|
||||
import { useObservable } from 'react-use';
|
||||
import useObservable from 'react-use/lib/useObservable';
|
||||
import { APP_ID } from '../../common';
|
||||
import { useBasePath, useKibana } from '../common/lib/kibana';
|
||||
import { useAssistantTelemetry } from './use_assistant_telemetry';
|
||||
|
|
|
@ -13,7 +13,7 @@ import { UpsellingService } from '@kbn/security-solution-upselling/service';
|
|||
import { Router } from '@kbn/shared-ux-router';
|
||||
import { render, screen } from '@testing-library/react';
|
||||
import React from 'react';
|
||||
import { useLocalStorage } from 'react-use';
|
||||
import useLocalStorage from 'react-use/lib/useLocalStorage';
|
||||
|
||||
import { TestProviders } from '../../common/mock';
|
||||
import { ATTACK_DISCOVERY_PATH } from '../../../common/constants';
|
||||
|
@ -38,15 +38,10 @@ const mockConnectors: unknown[] = [
|
|||
},
|
||||
];
|
||||
|
||||
jest.mock('react-use', () => {
|
||||
const actual = jest.requireActual('react-use');
|
||||
|
||||
return {
|
||||
...actual,
|
||||
useLocalStorage: jest.fn().mockReturnValue(['test-id', jest.fn()]),
|
||||
useSessionStorage: jest.fn().mockReturnValue([undefined, jest.fn()]),
|
||||
};
|
||||
});
|
||||
jest.mock('react-use/lib/useLocalStorage', () => jest.fn().mockReturnValue(['test-id', jest.fn()]));
|
||||
jest.mock('react-use/lib/useSessionStorage', () =>
|
||||
jest.fn().mockReturnValue([undefined, jest.fn()])
|
||||
);
|
||||
|
||||
jest.mock(
|
||||
'@kbn/elastic-assistant/impl/assistant/api/anonymization_fields/use_fetch_anonymization_fields',
|
||||
|
|
|
@ -16,7 +16,7 @@ import {
|
|||
import type { AttackDiscoveries, Replacements } from '@kbn/elastic-assistant-common';
|
||||
import { uniq } from 'lodash/fp';
|
||||
import React, { useCallback, useEffect, useMemo, useState } from 'react';
|
||||
import { useLocalStorage } from 'react-use';
|
||||
import useLocalStorage from 'react-use/lib/useLocalStorage';
|
||||
|
||||
import { SecurityPageName } from '../../../common/constants';
|
||||
import { HeaderPage } from '../../common/components/header_page';
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
import React, { useMemo } from 'react';
|
||||
import { i18n } from '@kbn/i18n';
|
||||
import type { KibanaPageTemplateProps } from '@kbn/shared-ux-page-kibana-template';
|
||||
import { useObservable } from 'react-use';
|
||||
import useObservable from 'react-use/lib/useObservable';
|
||||
import { useKibana } from '../../../lib/kibana';
|
||||
import { useBreadcrumbsNav } from '../breadcrumbs';
|
||||
import { SecuritySideNav } from '../security_side_nav';
|
||||
|
|
|
@ -10,7 +10,7 @@ import { buildContextMenuForActions } from '@kbn/ui-actions-plugin/public';
|
|||
import React, { useCallback, useMemo, useState } from 'react';
|
||||
import styled from 'styled-components';
|
||||
|
||||
import { useAsync } from 'react-use';
|
||||
import useAsync from 'react-use/lib/useAsync';
|
||||
import { InputsModelId } from '../../store/inputs/constants';
|
||||
import { ModalInspectQuery } from '../inspect/modal';
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
* 2.0.
|
||||
*/
|
||||
|
||||
import { set } from 'lodash';
|
||||
import { set } from '@kbn/safer-lodash-set';
|
||||
import { getHostPlatform } from './get_host_platform';
|
||||
import type { TimelineEventsDetailsItem } from '@kbn/timelines-plugin/common';
|
||||
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
* 2.0.
|
||||
*/
|
||||
|
||||
// eslint-disable-next-line no-restricted-imports
|
||||
import { Router } from 'react-router-dom';
|
||||
// eslint-disable-next-line @kbn/eslint/module_migration
|
||||
import routeData from 'react-router';
|
||||
|
|
|
@ -16,6 +16,7 @@ import {
|
|||
} from './helpers';
|
||||
import { renderHook } from '@testing-library/react-hooks';
|
||||
import { createMemoryHistory } from 'history';
|
||||
// eslint-disable-next-line no-restricted-imports
|
||||
import { Router } from 'react-router-dom';
|
||||
import React from 'react';
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
*/
|
||||
|
||||
import React from 'react';
|
||||
import { useToggle } from 'react-use';
|
||||
import useToggle from 'react-use/lib/useToggle';
|
||||
import { EuiLink, EuiPopover, EuiText, EuiButtonIcon } from '@elastic/eui';
|
||||
import { FormattedMessage } from '@kbn/i18n-react';
|
||||
import { useKibana } from '../../../../common/lib/kibana';
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
*/
|
||||
|
||||
import React from 'react';
|
||||
import { useToggle } from 'react-use';
|
||||
import useToggle from 'react-use/lib/useToggle';
|
||||
import { EuiPopover, EuiText, EuiButtonIcon } from '@elastic/eui';
|
||||
import { FormattedMessage } from '@kbn/i18n-react';
|
||||
import * as defineRuleI18n from '../../../rule_creation_ui/components/step_define_rule/translations';
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
*/
|
||||
|
||||
import React from 'react';
|
||||
import { useToggle } from 'react-use';
|
||||
import useToggle from 'react-use/lib/useToggle';
|
||||
import { EuiPopover, EuiText, EuiButtonIcon } from '@elastic/eui';
|
||||
import { FormattedMessage } from '@kbn/i18n-react';
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
*/
|
||||
|
||||
import React, { useCallback } from 'react';
|
||||
import { useToggle } from 'react-use';
|
||||
import useToggle from 'react-use/lib/useToggle';
|
||||
import { css } from '@emotion/css';
|
||||
import { EuiButtonEmpty } from '@elastic/eui';
|
||||
import type { Type } from '@kbn/securitysolution-io-ts-alerting-types';
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
*/
|
||||
|
||||
import React from 'react';
|
||||
import { useToggle } from 'react-use';
|
||||
import useToggle from 'react-use/lib/useToggle';
|
||||
import { EuiPopover, EuiText, EuiButtonIcon } from '@elastic/eui';
|
||||
import { FormattedMessage } from '@kbn/i18n-react';
|
||||
|
||||
|
|
|
@ -16,7 +16,7 @@ import {
|
|||
EuiPopover,
|
||||
} from '@elastic/eui';
|
||||
import React, { useCallback, useMemo } from 'react';
|
||||
import { useBoolean } from 'react-use';
|
||||
import useBoolean from 'react-use/lib/useBoolean';
|
||||
import { useUserData } from '../../../../../detections/components/user_info';
|
||||
import { useAddPrebuiltRulesTableContext } from './add_prebuilt_rules_table_context';
|
||||
import * as i18n from './translations';
|
||||
|
|
|
@ -16,7 +16,7 @@ import {
|
|||
EuiPopover,
|
||||
} from '@elastic/eui';
|
||||
import React, { useCallback, useMemo } from 'react';
|
||||
import { useBoolean } from 'react-use';
|
||||
import useBoolean from 'react-use/lib/useBoolean';
|
||||
import type { Rule } from '../../../../rule_management/logic';
|
||||
import type { RuleSignatureId } from '../../../../../../common/api/detection_engine';
|
||||
import type { AddPrebuiltRulesTableActions } from './add_prebuilt_rules_table_context';
|
||||
|
|
|
@ -34,7 +34,7 @@ import React, { useState } from 'react';
|
|||
import { FormattedMessage } from '@kbn/i18n-react';
|
||||
import { css } from '@emotion/css';
|
||||
import { i18n } from '@kbn/i18n';
|
||||
import { useToggle } from 'react-use';
|
||||
import useToggle from 'react-use/lib/useToggle';
|
||||
import { PICK_ASSET_CRITICALITY } from './translations';
|
||||
import { AssetCriticalityBadge } from './asset_criticality_badge';
|
||||
import type { Entity, State } from './use_asset_criticality';
|
||||
|
|
|
@ -5,8 +5,7 @@
|
|||
* 2.0.
|
||||
*/
|
||||
import React from 'react';
|
||||
import { Switch } from 'react-router-dom';
|
||||
import { Route } from '@kbn/shared-ux-router';
|
||||
import { Route, Routes } from '@kbn/shared-ux-router';
|
||||
|
||||
import { TrackApplicationView } from '@kbn/usage-collection-plugin/public';
|
||||
|
||||
|
@ -33,14 +32,14 @@ const EntityAnalyticsManagementTelemetry = () => (
|
|||
|
||||
const EntityAnalyticsManagementContainer: React.FC = React.memo(() => {
|
||||
return (
|
||||
<Switch>
|
||||
<Routes>
|
||||
<Route
|
||||
path={ENTITY_ANALYTICS_MANAGEMENT_PATH}
|
||||
exact
|
||||
component={EntityAnalyticsManagementTelemetry}
|
||||
/>
|
||||
<Route component={NotFoundPage} />
|
||||
</Switch>
|
||||
</Routes>
|
||||
);
|
||||
});
|
||||
EntityAnalyticsManagementContainer.displayName = 'EntityAnalyticsManagementContainer';
|
||||
|
@ -56,14 +55,14 @@ const EntityAnalyticsAssetClassificationTelemetry = () => (
|
|||
|
||||
const EntityAnalyticsAssetClassificationContainer: React.FC = React.memo(() => {
|
||||
return (
|
||||
<Switch>
|
||||
<Routes>
|
||||
<Route
|
||||
path={ENTITY_ANALYTICS_ASSET_CRITICALITY_PATH}
|
||||
exact
|
||||
component={EntityAnalyticsAssetClassificationTelemetry}
|
||||
/>
|
||||
<Route component={NotFoundPage} />
|
||||
</Switch>
|
||||
</Routes>
|
||||
);
|
||||
});
|
||||
|
||||
|
|
|
@ -6,7 +6,8 @@
|
|||
*/
|
||||
|
||||
import React from 'react';
|
||||
import { Router, useParams } from 'react-router-dom';
|
||||
import { Router } from '@kbn/shared-ux-router';
|
||||
import { useParams } from 'react-router-dom';
|
||||
|
||||
import { useSourcererDataView } from '../../../../sourcerer/containers';
|
||||
import { TestProviders } from '../../../../common/mock';
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
*/
|
||||
|
||||
import React from 'react';
|
||||
// eslint-disable-next-line no-restricted-imports
|
||||
import { Switch, MemoryRouter } from 'react-router-dom';
|
||||
import type { AppContextTestRender } from '../../../common/mock/endpoint';
|
||||
import { createAppRootMockRenderer } from '../../../common/mock/endpoint';
|
||||
|
|
|
@ -16,7 +16,7 @@ import {
|
|||
DefaultPolicyNotificationMessage,
|
||||
DefaultPolicyRuleNotificationMessage,
|
||||
} from '../../../../common/endpoint/models/policy_config';
|
||||
import { set } from 'lodash';
|
||||
import { set } from '@kbn/safer-lodash-set';
|
||||
import { API_VERSIONS } from '@kbn/fleet-plugin/common';
|
||||
|
||||
const useQueryMock = _useQuery as jest.Mock;
|
||||
|
|
|
@ -18,7 +18,7 @@ import { AdvancedSection } from './advanced_section';
|
|||
import userEvent from '@testing-library/user-event';
|
||||
import { AdvancedPolicySchema } from '../../../models/advanced_policy_schema';
|
||||
import { within } from '@testing-library/react';
|
||||
import { set } from 'lodash';
|
||||
import { set } from '@kbn/safer-lodash-set';
|
||||
|
||||
jest.mock('../../../../../../common/hooks/use_license');
|
||||
|
||||
|
|
|
@ -17,7 +17,8 @@ import {
|
|||
SWITCH_LABEL,
|
||||
} from './attack_surface_reduction_card';
|
||||
import { useLicense as _useLicense } from '../../../../../../../common/hooks/use_license';
|
||||
import { cloneDeep, set } from 'lodash';
|
||||
import { cloneDeep } from 'lodash';
|
||||
import { set } from '@kbn/safer-lodash-set';
|
||||
import userEvent from '@testing-library/user-event';
|
||||
import { createLicenseServiceMock } from '../../../../../../../../common/license/mocks';
|
||||
import { licenseService as licenseServiceMocked } from '../../../../../../../common/hooks/__mocks__/use_license';
|
||||
|
|
|
@ -13,7 +13,7 @@ import React from 'react';
|
|||
import { licenseService as licenseServiceMocked } from '../../../../../../../common/hooks/__mocks__/use_license';
|
||||
import { useLicense as _useLicense } from '../../../../../../../common/hooks/use_license';
|
||||
import { createLicenseServiceMock } from '../../../../../../../../common/license/mocks';
|
||||
import { set } from 'lodash';
|
||||
import { set } from '@kbn/safer-lodash-set';
|
||||
import { ProtectionModes } from '../../../../../../../../common/endpoint/types';
|
||||
import type { BehaviourProtectionCardProps } from './protection_seetings_card/behaviour_protection_card';
|
||||
import {
|
||||
|
|
|
@ -12,7 +12,7 @@ import { FleetPackagePolicyGenerator } from '../../../../../../../../common/endp
|
|||
import React from 'react';
|
||||
import type { LinuxEventCollectionCardProps } from './linux_event_collection_card';
|
||||
import { LinuxEventCollectionCard } from './linux_event_collection_card';
|
||||
import { set } from 'lodash';
|
||||
import { set } from '@kbn/safer-lodash-set';
|
||||
|
||||
describe('Policy Linux Event Collection Card', () => {
|
||||
const testSubj = getPolicySettingsFormTestSubjects('test').linuxEvents;
|
||||
|
|
|
@ -10,7 +10,7 @@ import type { AppContextTestRender } from '../../../../../../../common/mock/endp
|
|||
import { createAppRootMockRenderer } from '../../../../../../../common/mock/endpoint';
|
||||
import { FleetPackagePolicyGenerator } from '../../../../../../../../common/endpoint/data_generators/fleet_package_policy_generator';
|
||||
import React from 'react';
|
||||
import { set } from 'lodash';
|
||||
import { set } from '@kbn/safer-lodash-set';
|
||||
import type { MacEventCollectionCardProps } from './mac_event_collection_card';
|
||||
import { MacEventCollectionCard } from './mac_event_collection_card';
|
||||
|
||||
|
|
|
@ -19,7 +19,8 @@ import type { MalwareProtectionsProps } from './malware_protections_card';
|
|||
import { MalwareProtectionsCard } from './malware_protections_card';
|
||||
import type { PolicyConfig } from '../../../../../../../../common/endpoint/types';
|
||||
import { ProtectionModes } from '../../../../../../../../common/endpoint/types';
|
||||
import { cloneDeep, set } from 'lodash';
|
||||
import { cloneDeep } from 'lodash';
|
||||
import { set } from '@kbn/safer-lodash-set';
|
||||
import userEvent from '@testing-library/user-event';
|
||||
|
||||
jest.mock('../../../../../../../common/hooks/use_license');
|
||||
|
|
|
@ -11,7 +11,7 @@ import { createAppRootMockRenderer } from '../../../../../../../common/mock/endp
|
|||
import { FleetPackagePolicyGenerator } from '../../../../../../../../common/endpoint/data_generators/fleet_package_policy_generator';
|
||||
import React from 'react';
|
||||
import { ProtectionModes } from '../../../../../../../../common/endpoint/types';
|
||||
import { set } from 'lodash';
|
||||
import { set } from '@kbn/safer-lodash-set';
|
||||
import type { MemoryProtectionCardProps } from './memory_protection_card';
|
||||
import { LOCKED_CARD_MEMORY_TITLE, MemoryProtectionCard } from './memory_protection_card';
|
||||
import { createLicenseServiceMock } from '../../../../../../../../common/license/mocks';
|
||||
|
|
|
@ -11,7 +11,7 @@ import { createAppRootMockRenderer } from '../../../../../../../common/mock/endp
|
|||
import { FleetPackagePolicyGenerator } from '../../../../../../../../common/endpoint/data_generators/fleet_package_policy_generator';
|
||||
import React from 'react';
|
||||
import { ProtectionModes } from '../../../../../../../../common/endpoint/types';
|
||||
import { set } from 'lodash';
|
||||
import { set } from '@kbn/safer-lodash-set';
|
||||
import { createLicenseServiceMock } from '../../../../../../../../common/license/mocks';
|
||||
import { licenseService as licenseServiceMocked } from '../../../../../../../common/hooks/__mocks__/use_license';
|
||||
import { useLicense as _useLicense } from '../../../../../../../common/hooks/use_license';
|
||||
|
|
|
@ -10,7 +10,7 @@ import type { AppContextTestRender } from '../../../../../../../common/mock/endp
|
|||
import { createAppRootMockRenderer } from '../../../../../../../common/mock/endpoint';
|
||||
import { FleetPackagePolicyGenerator } from '../../../../../../../../common/endpoint/data_generators/fleet_package_policy_generator';
|
||||
import React from 'react';
|
||||
import { set } from 'lodash';
|
||||
import { set } from '@kbn/safer-lodash-set';
|
||||
import type { WindowsEventCollectionCardProps } from './windows_event_collection_card';
|
||||
import { WindowsEventCollectionCard } from './windows_event_collection_card';
|
||||
|
||||
|
|
|
@ -12,7 +12,8 @@ import React from 'react';
|
|||
import type { DetectPreventProtectionLevelProps } from './detect_prevent_protection_level';
|
||||
import { DetectPreventProtectionLevel } from './detect_prevent_protection_level';
|
||||
import userEvent from '@testing-library/user-event';
|
||||
import { cloneDeep, set } from 'lodash';
|
||||
import { cloneDeep } from 'lodash';
|
||||
import { set } from '@kbn/safer-lodash-set';
|
||||
import { ProtectionModes } from '../../../../../../../common/endpoint/types';
|
||||
import { expectIsViewOnly, exactMatchText } from '../mocks';
|
||||
import { createLicenseServiceMock } from '../../../../../../../common/license/mocks';
|
||||
|
|
|
@ -17,7 +17,8 @@ import { EventCollectionCard } from './event_collection_card';
|
|||
import { OperatingSystem } from '@kbn/securitysolution-utils';
|
||||
import { expectIsViewOnly, exactMatchText } from '../mocks';
|
||||
import userEvent from '@testing-library/user-event';
|
||||
import { cloneDeep, set } from 'lodash';
|
||||
import { cloneDeep } from 'lodash';
|
||||
import { set } from '@kbn/safer-lodash-set';
|
||||
import { within } from '@testing-library/react';
|
||||
|
||||
describe('Policy Event Collection Card common component', () => {
|
||||
|
|
|
@ -19,7 +19,8 @@ import {
|
|||
EuiSpacer,
|
||||
EuiText,
|
||||
} from '@elastic/eui';
|
||||
import { cloneDeep, get, set } from 'lodash';
|
||||
import { cloneDeep, get } from 'lodash';
|
||||
import { set } from '@kbn/safer-lodash-set';
|
||||
import type { EuiCheckboxProps } from '@elastic/eui';
|
||||
import { getEmptyValue } from '../../../../../../common/components/empty_value';
|
||||
import { useTestIdGenerator } from '../../../../../hooks/use_test_id_generator';
|
||||
|
|
|
@ -20,7 +20,8 @@ import {
|
|||
NotifyUserOption,
|
||||
} from './notify_user_option';
|
||||
import { expectIsViewOnly, exactMatchText } from '../mocks';
|
||||
import { cloneDeep, set } from 'lodash';
|
||||
import { cloneDeep } from 'lodash';
|
||||
import { set } from '@kbn/safer-lodash-set';
|
||||
import { ProtectionModes } from '../../../../../../../common/endpoint/types';
|
||||
import userEvent from '@testing-library/user-event';
|
||||
|
||||
|
|
|
@ -16,7 +16,8 @@ import type { ProtectionSettingCardSwitchProps } from './protection_setting_card
|
|||
import { ProtectionSettingCardSwitch } from './protection_setting_card_switch';
|
||||
import { exactMatchText, expectIsViewOnly, setMalwareMode } from '../mocks';
|
||||
import { ProtectionModes } from '../../../../../../../common/endpoint/types';
|
||||
import { cloneDeep, set } from 'lodash';
|
||||
import { cloneDeep } from 'lodash';
|
||||
import { set } from '@kbn/safer-lodash-set';
|
||||
import userEvent from '@testing-library/user-event';
|
||||
|
||||
jest.mock('../../../../../../common/hooks/use_license');
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
* 2.0.
|
||||
*/
|
||||
|
||||
import { set } from 'lodash';
|
||||
import { set } from '@kbn/safer-lodash-set';
|
||||
import type { PolicyConfig } from '../../../../../../common/endpoint/types';
|
||||
import {
|
||||
AntivirusRegistrationModes,
|
||||
|
|
|
@ -21,7 +21,8 @@ import {
|
|||
getPolicySettingsFormTestSubjects,
|
||||
setMalwareMode,
|
||||
} from '../policy_settings_form/mocks';
|
||||
import { cloneDeep, set } from 'lodash';
|
||||
import { cloneDeep } from 'lodash';
|
||||
import { set } from '@kbn/safer-lodash-set';
|
||||
import { ProtectionModes } from '../../../../../../common/endpoint/types';
|
||||
import { waitFor, cleanup } from '@testing-library/react';
|
||||
import { packagePolicyRouteService, API_VERSIONS } from '@kbn/fleet-plugin/common';
|
||||
|
|
|
@ -6,8 +6,7 @@
|
|||
*/
|
||||
|
||||
import React from 'react';
|
||||
import { Switch } from 'react-router-dom';
|
||||
import { Route } from '@kbn/shared-ux-router';
|
||||
import { Route, Routes } from '@kbn/shared-ux-router';
|
||||
import { TrackApplicationView } from '@kbn/usage-collection-plugin/public';
|
||||
import { NoteManagementPage } from './pages/note_management_page';
|
||||
import { SpyRoute } from '../common/utils/route/spy_routes';
|
||||
|
@ -26,10 +25,10 @@ const NotesManagementTelemetry = () => (
|
|||
|
||||
const NotesManagementContainer: React.FC = React.memo(() => {
|
||||
return (
|
||||
<Switch>
|
||||
<Routes>
|
||||
<Route path={NOTES_PATH} exact component={NotesManagementTelemetry} />
|
||||
<Route component={NotFoundPage} />
|
||||
</Switch>
|
||||
</Routes>
|
||||
);
|
||||
});
|
||||
NotesManagementContainer.displayName = 'NotesManagementContainer';
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
*/
|
||||
|
||||
import React from 'react';
|
||||
import { useObservable } from 'react-use';
|
||||
import useObservable from 'react-use/lib/useObservable';
|
||||
|
||||
import { useOnboardingService } from '../../../../../hooks/use_onboarding_service';
|
||||
import { AgentlessAvailableCallout } from './agentless_available_callout';
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
import { renderHook } from '@testing-library/react-hooks';
|
||||
import { useBodyConfig } from './use_body_config';
|
||||
import { useKibana } from '../../../../common/lib/kibana/kibana_react';
|
||||
import { useObservable } from 'react-use';
|
||||
import useObservable from 'react-use/lib/useObservable';
|
||||
import { hasCapabilities } from '../../../../common/lib/capabilities';
|
||||
|
||||
const bodyConfig = [
|
||||
|
@ -43,7 +43,7 @@ const bodyConfig = [
|
|||
];
|
||||
|
||||
// Mock dependencies
|
||||
jest.mock('react-use');
|
||||
jest.mock('react-use/lib/useObservable');
|
||||
jest.mock('../../../../common/lib/kibana/kibana_react');
|
||||
jest.mock('../../../../common/lib/capabilities');
|
||||
jest.mock('../body_config', () => ({ bodyConfig }));
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
* 2.0.
|
||||
*/
|
||||
|
||||
import { useObservable } from 'react-use';
|
||||
import useObservable from 'react-use/lib/useObservable';
|
||||
import { useMemo } from 'react';
|
||||
import { hasCapabilities } from '../../../../common/lib/capabilities';
|
||||
import { useKibana } from '../../../../common/lib/kibana/kibana_react';
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
*/
|
||||
|
||||
import React from 'react';
|
||||
import { useObservable } from 'react-use';
|
||||
import useObservable from 'react-use/lib/useObservable';
|
||||
import { useOnboardingService } from '../../../../hooks/use_onboarding_service';
|
||||
import { LinkCard } from '../common/link_card';
|
||||
import teammatesImage from './images/teammates_card.png';
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
* 2.0.
|
||||
*/
|
||||
|
||||
import { useLocalStorage } from 'react-use';
|
||||
import useLocalStorage from 'react-use/lib/useLocalStorage';
|
||||
import type { OnboardingCardId } from '../constants';
|
||||
import type { IntegrationTabId } from '../components/onboarding_body/cards/integrations/types';
|
||||
|
||||
|
|
|
@ -5,7 +5,8 @@
|
|||
* 2.0.
|
||||
*/
|
||||
|
||||
import { get, has, set, omit, isObject, toString as fpToString } from 'lodash/fp';
|
||||
import { get, has, omit, isObject, toString as fpToString } from 'lodash/fp';
|
||||
import { set } from '@kbn/safer-lodash-set/fp';
|
||||
import type { Action, Middleware } from 'redux';
|
||||
import type { CoreStart } from '@kbn/core/public';
|
||||
import type { Filter, MatchAllFilter } from '@kbn/es-query';
|
||||
|
|
|
@ -71,7 +71,8 @@ import type { HapiReadableStream, SecuritySolutionRequestHandlerContext } from '
|
|||
import { createHapiReadableStreamMock } from '../../services/actions/mocks';
|
||||
import { EndpointActionGenerator } from '../../../../common/endpoint/data_generators/endpoint_action_generator';
|
||||
import { CustomHttpRequestError } from '../../../utils/custom_http_request_error';
|
||||
import { omit, set } from 'lodash';
|
||||
import { omit } from 'lodash';
|
||||
import { set } from '@kbn/safer-lodash-set';
|
||||
import type { ResponseActionAgentType } from '../../../../common/endpoint/service/response_actions/constants';
|
||||
import { responseActionsClientMock } from '../../services/actions/clients/mocks';
|
||||
import type { ActionsApiRequestHandlerContext } from '@kbn/actions-plugin/server';
|
||||
|
|
|
@ -36,7 +36,7 @@ import {
|
|||
ENDPOINT_ACTIONS_INDEX,
|
||||
} from '../../../../../../common/endpoint/constants';
|
||||
import type { DeepMutable } from '../../../../../../common/endpoint/types/utility_types';
|
||||
import { set } from 'lodash';
|
||||
import { set } from '@kbn/safer-lodash-set';
|
||||
import { responseActionsClientMock } from '../mocks';
|
||||
import type { ResponseActionAgentType } from '../../../../../../common/endpoint/service/response_actions/constants';
|
||||
import { getResponseActionFeatureKey } from '../../../feature_usage/feature_keys';
|
||||
|
|
|
@ -8,7 +8,8 @@
|
|||
import { ecsFieldMap } from '@kbn/alerts-as-data-utils';
|
||||
import { flattenWithPrefix } from '@kbn/securitysolution-rules';
|
||||
|
||||
import { isPlainObject, isArray, set } from 'lodash';
|
||||
import { isPlainObject, isArray } from 'lodash';
|
||||
import { set } from '@kbn/safer-lodash-set';
|
||||
|
||||
import type { SearchTypes } from '../../../../../../common/detection_engine/types';
|
||||
import { isValidIpType } from './ecs_types_validators/is_valid_ip_type';
|
||||
|
|
|
@ -8,7 +8,8 @@
|
|||
import moment from 'moment';
|
||||
import type { ExceptionListItemSchema } from '@kbn/securitysolution-io-ts-list-types';
|
||||
import type { PackagePolicy } from '@kbn/fleet-plugin/common/types/models/package_policy';
|
||||
import { merge, set } from 'lodash';
|
||||
import { merge } from 'lodash';
|
||||
import { set } from '@kbn/safer-lodash-set';
|
||||
import type { Logger, LogMeta } from '@kbn/core/server';
|
||||
import { sha256 } from 'js-sha256';
|
||||
import type * as estypes from '@elastic/elasticsearch/lib/api/typesWithBodyKey';
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue