();
+ for (const baseMigrationVersion of Object.keys(baseEmbeddableMigrations)) {
+ uniqueVersions.add(baseMigrationVersion);
+ }
+ const factories = this.embeddableFactories.values();
+ for (const factory of factories) {
+ Object.keys(factory.migrations).forEach((version) => uniqueVersions.add(version));
+ }
+ const enhancements = this.enhancements.values();
+ for (const enhancement of enhancements) {
+ Object.keys(enhancement.migrations).forEach((version) => uniqueVersions.add(version));
+ }
+ return Array.from(uniqueVersions);
+ };
}
diff --git a/src/plugins/embeddable/server/server.api.md b/src/plugins/embeddable/server/server.api.md
index 5c7efec57e93b..d5c7ce29bab9e 100644
--- a/src/plugins/embeddable/server/server.api.md
+++ b/src/plugins/embeddable/server/server.api.md
@@ -23,6 +23,8 @@ export interface EmbeddableRegistryDefinition {
+ // (undocumented)
+ getMigrationVersions: () => string[];
// (undocumented)
registerEmbeddableFactory: (factory: EmbeddableRegistryDefinition) => void;
// (undocumented)
diff --git a/src/plugins/screenshot_mode/.i18nrc.json b/src/plugins/screenshot_mode/.i18nrc.json
new file mode 100644
index 0000000000000..79643fbb63d30
--- /dev/null
+++ b/src/plugins/screenshot_mode/.i18nrc.json
@@ -0,0 +1,7 @@
+{
+ "prefix": "screenshotMode",
+ "paths": {
+ "screenshotMode": "."
+ },
+ "translations": ["translations/ja-JP.json"]
+}
diff --git a/src/plugins/screenshot_mode/README.md b/src/plugins/screenshot_mode/README.md
new file mode 100755
index 0000000000000..faa298b33d5fa
--- /dev/null
+++ b/src/plugins/screenshot_mode/README.md
@@ -0,0 +1,27 @@
+# Screenshot Mode
+
+The service exposed by this plugin informs consumers whether they should optimize for non-interactivity. In this way plugins can avoid loading unnecessary code, data or other services.
+
+The primary intention is to inform other lower-level plugins (plugins that don't depend on other plugins) that we do not expect an actual user to interact with browser. In this way we can avoid loading unnecessary resources (code and data).
+
+**NB** This plugin should have no other dependencies to avoid any possibility of circular dependencies.
+
+---
+
+## Development
+
+### How to test in screenshot mode
+
+Please note: the following information is subject to change over time.
+
+In order to test whether we are correctly detecting screenshot mode, developers can run the following JS snippet:
+
+```js
+window.localStorage.setItem('__KBN_SCREENSHOT_MODE_ENABLED_KEY__', true);
+```
+
+To get out of screenshot mode, run the following snippet:
+
+```js
+window.localStorage.removeItem('__KBN_SCREENSHOT_MODE_ENABLED_KEY__');
+```
diff --git a/src/plugins/screenshot_mode/common/constants.ts b/src/plugins/screenshot_mode/common/constants.ts
new file mode 100644
index 0000000000000..d5073f5920c0e
--- /dev/null
+++ b/src/plugins/screenshot_mode/common/constants.ts
@@ -0,0 +1,9 @@
+/*
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
+ * or more contributor license agreements. Licensed under the Elastic License
+ * 2.0 and the Server Side Public License, v 1; you may not use this file except
+ * in compliance with, at your election, the Elastic License 2.0 or the Server
+ * Side Public License, v 1.
+ */
+
+export const KBN_SCREENSHOT_MODE_HEADER = 'x-kbn-screenshot-mode'.toLowerCase();
diff --git a/src/plugins/screenshot_mode/common/get_set_browser_screenshot_mode.ts b/src/plugins/screenshot_mode/common/get_set_browser_screenshot_mode.ts
new file mode 100644
index 0000000000000..7714f88cebeec
--- /dev/null
+++ b/src/plugins/screenshot_mode/common/get_set_browser_screenshot_mode.ts
@@ -0,0 +1,63 @@
+/*
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
+ * or more contributor license agreements. Licensed under the Elastic License
+ * 2.0 and the Server Side Public License, v 1; you may not use this file except
+ * in compliance with, at your election, the Elastic License 2.0 or the Server
+ * Side Public License, v 1.
+ */
+
+// **PLEASE NOTE**
+// The functionality in this file targets a browser environment and is intended to be used both in public and server.
+// For instance, reporting uses these functions when starting puppeteer to set the current browser into "screenshot" mode.
+
+export const KBN_SCREENSHOT_MODE_ENABLED_KEY = '__KBN_SCREENSHOT_MODE_ENABLED_KEY__';
+
+/**
+ * This function is responsible for detecting whether we are currently in screenshot mode.
+ *
+ * We check in the current window context whether screenshot mode is enabled, otherwise we check
+ * localStorage. The ability to set a value in localStorage enables more convenient development and testing
+ * in functionality that needs to detect screenshot mode.
+ */
+export const getScreenshotMode = (): boolean => {
+ return (
+ ((window as unknown) as Record)[KBN_SCREENSHOT_MODE_ENABLED_KEY] === true ||
+ window.localStorage.getItem(KBN_SCREENSHOT_MODE_ENABLED_KEY) === 'true'
+ );
+};
+
+/**
+ * Use this function to set the current browser to screenshot mode.
+ *
+ * This function should be called as early as possible to ensure that screenshot mode is
+ * correctly detected for the first page load. It is not suitable for use inside any plugin
+ * code unless the plugin code is guaranteed to, somehow, load before any other code.
+ *
+ * Additionally, we don't know what environment this code will run in so we remove as many external
+ * references as possible to make it portable. For instance, running inside puppeteer.
+ */
+export const setScreenshotModeEnabled = () => {
+ Object.defineProperty(
+ window,
+ '__KBN_SCREENSHOT_MODE_ENABLED_KEY__', // Literal value to prevent adding an external reference
+ {
+ enumerable: true,
+ writable: true,
+ configurable: false,
+ value: true,
+ }
+ );
+};
+
+export const setScreenshotModeDisabled = () => {
+ Object.defineProperty(
+ window,
+ '__KBN_SCREENSHOT_MODE_ENABLED_KEY__', // Literal value to prevent adding an external reference
+ {
+ enumerable: true,
+ writable: true,
+ configurable: false,
+ value: undefined,
+ }
+ );
+};
diff --git a/src/plugins/screenshot_mode/common/index.ts b/src/plugins/screenshot_mode/common/index.ts
new file mode 100644
index 0000000000000..fd9ad6f70feba
--- /dev/null
+++ b/src/plugins/screenshot_mode/common/index.ts
@@ -0,0 +1,15 @@
+/*
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
+ * or more contributor license agreements. Licensed under the Elastic License
+ * 2.0 and the Server Side Public License, v 1; you may not use this file except
+ * in compliance with, at your election, the Elastic License 2.0 or the Server
+ * Side Public License, v 1.
+ */
+
+export {
+ getScreenshotMode,
+ setScreenshotModeEnabled,
+ setScreenshotModeDisabled,
+} from './get_set_browser_screenshot_mode';
+
+export { KBN_SCREENSHOT_MODE_HEADER } from './constants';
diff --git a/src/plugins/screenshot_mode/jest.config.js b/src/plugins/screenshot_mode/jest.config.js
new file mode 100644
index 0000000000000..e84f3742f8c1d
--- /dev/null
+++ b/src/plugins/screenshot_mode/jest.config.js
@@ -0,0 +1,13 @@
+/*
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
+ * or more contributor license agreements. Licensed under the Elastic License
+ * 2.0 and the Server Side Public License, v 1; you may not use this file except
+ * in compliance with, at your election, the Elastic License 2.0 or the Server
+ * Side Public License, v 1.
+ */
+
+module.exports = {
+ preset: '@kbn/test',
+ rootDir: '../../..',
+ roots: ['/src/plugins/screenshot_mode'],
+};
diff --git a/src/plugins/screenshot_mode/kibana.json b/src/plugins/screenshot_mode/kibana.json
new file mode 100644
index 0000000000000..67c40b20be525
--- /dev/null
+++ b/src/plugins/screenshot_mode/kibana.json
@@ -0,0 +1,9 @@
+{
+ "id": "screenshotMode",
+ "version": "1.0.0",
+ "kibanaVersion": "kibana",
+ "ui": true,
+ "server": true,
+ "requiredPlugins": [],
+ "optionalPlugins": []
+}
diff --git a/src/plugins/screenshot_mode/public/index.ts b/src/plugins/screenshot_mode/public/index.ts
new file mode 100644
index 0000000000000..6a46b240d592e
--- /dev/null
+++ b/src/plugins/screenshot_mode/public/index.ts
@@ -0,0 +1,17 @@
+/*
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
+ * or more contributor license agreements. Licensed under the Elastic License
+ * 2.0 and the Server Side Public License, v 1; you may not use this file except
+ * in compliance with, at your election, the Elastic License 2.0 or the Server
+ * Side Public License, v 1.
+ */
+
+import { ScreenshotModePlugin } from './plugin';
+
+export function plugin() {
+ return new ScreenshotModePlugin();
+}
+
+export { KBN_SCREENSHOT_MODE_HEADER, setScreenshotModeEnabled } from '../common';
+
+export { ScreenshotModePluginSetup } from './types';
diff --git a/src/plugins/screenshot_mode/public/plugin.test.ts b/src/plugins/screenshot_mode/public/plugin.test.ts
new file mode 100644
index 0000000000000..33ae501466876
--- /dev/null
+++ b/src/plugins/screenshot_mode/public/plugin.test.ts
@@ -0,0 +1,43 @@
+/*
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
+ * or more contributor license agreements. Licensed under the Elastic License
+ * 2.0 and the Server Side Public License, v 1; you may not use this file except
+ * in compliance with, at your election, the Elastic License 2.0 or the Server
+ * Side Public License, v 1.
+ */
+
+import { coreMock } from '../../../../src/core/public/mocks';
+import { ScreenshotModePlugin } from './plugin';
+import { setScreenshotModeEnabled, setScreenshotModeDisabled } from '../common';
+
+describe('Screenshot mode public', () => {
+ let plugin: ScreenshotModePlugin;
+
+ beforeEach(() => {
+ plugin = new ScreenshotModePlugin();
+ });
+
+ afterAll(() => {
+ setScreenshotModeDisabled();
+ });
+
+ describe('setup contract', () => {
+ it('detects screenshot mode "true"', () => {
+ setScreenshotModeEnabled();
+ const screenshotMode = plugin.setup(coreMock.createSetup());
+ expect(screenshotMode.isScreenshotMode()).toBe(true);
+ });
+
+ it('detects screenshot mode "false"', () => {
+ setScreenshotModeDisabled();
+ const screenshotMode = plugin.setup(coreMock.createSetup());
+ expect(screenshotMode.isScreenshotMode()).toBe(false);
+ });
+ });
+
+ describe('start contract', () => {
+ it('returns nothing', () => {
+ expect(plugin.start(coreMock.createStart())).toBe(undefined);
+ });
+ });
+});
diff --git a/src/plugins/screenshot_mode/public/plugin.ts b/src/plugins/screenshot_mode/public/plugin.ts
new file mode 100644
index 0000000000000..7a166566a0173
--- /dev/null
+++ b/src/plugins/screenshot_mode/public/plugin.ts
@@ -0,0 +1,25 @@
+/*
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
+ * or more contributor license agreements. Licensed under the Elastic License
+ * 2.0 and the Server Side Public License, v 1; you may not use this file except
+ * in compliance with, at your election, the Elastic License 2.0 or the Server
+ * Side Public License, v 1.
+ */
+
+import { CoreSetup, CoreStart, Plugin } from '../../../core/public';
+
+import { ScreenshotModePluginSetup } from './types';
+
+import { getScreenshotMode } from '../common';
+
+export class ScreenshotModePlugin implements Plugin {
+ public setup(core: CoreSetup): ScreenshotModePluginSetup {
+ return {
+ isScreenshotMode: () => getScreenshotMode() === true,
+ };
+ }
+
+ public start(core: CoreStart) {}
+
+ public stop() {}
+}
diff --git a/src/plugins/screenshot_mode/public/types.ts b/src/plugins/screenshot_mode/public/types.ts
new file mode 100644
index 0000000000000..744ea8615f2a7
--- /dev/null
+++ b/src/plugins/screenshot_mode/public/types.ts
@@ -0,0 +1,17 @@
+/*
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
+ * or more contributor license agreements. Licensed under the Elastic License
+ * 2.0 and the Server Side Public License, v 1; you may not use this file except
+ * in compliance with, at your election, the Elastic License 2.0 or the Server
+ * Side Public License, v 1.
+ */
+
+export interface IScreenshotModeService {
+ /**
+ * Returns a boolean indicating whether the current user agent (browser) would like to view UI optimized for
+ * screenshots or printing.
+ */
+ isScreenshotMode: () => boolean;
+}
+
+export type ScreenshotModePluginSetup = IScreenshotModeService;
diff --git a/src/plugins/screenshot_mode/server/index.ts b/src/plugins/screenshot_mode/server/index.ts
new file mode 100644
index 0000000000000..68714e9a21b87
--- /dev/null
+++ b/src/plugins/screenshot_mode/server/index.ts
@@ -0,0 +1,21 @@
+/*
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
+ * or more contributor license agreements. Licensed under the Elastic License
+ * 2.0 and the Server Side Public License, v 1; you may not use this file except
+ * in compliance with, at your election, the Elastic License 2.0 or the Server
+ * Side Public License, v 1.
+ */
+
+import { ScreenshotModePlugin } from './plugin';
+
+export { setScreenshotModeEnabled, KBN_SCREENSHOT_MODE_HEADER } from '../common';
+
+export {
+ ScreenshotModeRequestHandlerContext,
+ ScreenshotModePluginSetup,
+ ScreenshotModePluginStart,
+} from './types';
+
+export function plugin() {
+ return new ScreenshotModePlugin();
+}
diff --git a/src/plugins/screenshot_mode/server/is_screenshot_mode.test.ts b/src/plugins/screenshot_mode/server/is_screenshot_mode.test.ts
new file mode 100644
index 0000000000000..6d783970bd362
--- /dev/null
+++ b/src/plugins/screenshot_mode/server/is_screenshot_mode.test.ts
@@ -0,0 +1,25 @@
+/*
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
+ * or more contributor license agreements. Licensed under the Elastic License
+ * 2.0 and the Server Side Public License, v 1; you may not use this file except
+ * in compliance with, at your election, the Elastic License 2.0 or the Server
+ * Side Public License, v 1.
+ */
+
+import { httpServerMock } from 'src/core/server/mocks';
+import { KBN_SCREENSHOT_MODE_HEADER } from '../common';
+import { isScreenshotMode } from './is_screenshot_mode';
+
+const { createKibanaRequest } = httpServerMock;
+
+describe('isScreenshotMode', () => {
+ test('screenshot headers are present', () => {
+ expect(
+ isScreenshotMode(createKibanaRequest({ headers: { [KBN_SCREENSHOT_MODE_HEADER]: 'true' } }))
+ ).toBe(true);
+ });
+
+ test('screenshot headers are not present', () => {
+ expect(isScreenshotMode(createKibanaRequest())).toBe(false);
+ });
+});
diff --git a/src/plugins/screenshot_mode/server/is_screenshot_mode.ts b/src/plugins/screenshot_mode/server/is_screenshot_mode.ts
new file mode 100644
index 0000000000000..79787bcd1fb50
--- /dev/null
+++ b/src/plugins/screenshot_mode/server/is_screenshot_mode.ts
@@ -0,0 +1,16 @@
+/*
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
+ * or more contributor license agreements. Licensed under the Elastic License
+ * 2.0 and the Server Side Public License, v 1; you may not use this file except
+ * in compliance with, at your election, the Elastic License 2.0 or the Server
+ * Side Public License, v 1.
+ */
+
+import { KibanaRequest } from 'src/core/server';
+import { KBN_SCREENSHOT_MODE_HEADER } from '../common';
+
+export const isScreenshotMode = (request: KibanaRequest): boolean => {
+ return Object.keys(request.headers).some((header) => {
+ return header.toLowerCase() === KBN_SCREENSHOT_MODE_HEADER;
+ });
+};
diff --git a/src/plugins/screenshot_mode/server/plugin.ts b/src/plugins/screenshot_mode/server/plugin.ts
new file mode 100644
index 0000000000000..9ef410d999ea5
--- /dev/null
+++ b/src/plugins/screenshot_mode/server/plugin.ts
@@ -0,0 +1,47 @@
+/*
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
+ * or more contributor license agreements. Licensed under the Elastic License
+ * 2.0 and the Server Side Public License, v 1; you may not use this file except
+ * in compliance with, at your election, the Elastic License 2.0 or the Server
+ * Side Public License, v 1.
+ */
+
+import { Plugin, CoreSetup } from '../../../core/server';
+import {
+ ScreenshotModeRequestHandlerContext,
+ ScreenshotModePluginSetup,
+ ScreenshotModePluginStart,
+} from './types';
+import { isScreenshotMode } from './is_screenshot_mode';
+
+export class ScreenshotModePlugin
+ implements Plugin {
+ public setup(core: CoreSetup): ScreenshotModePluginSetup {
+ core.http.registerRouteHandlerContext(
+ 'screenshotMode',
+ (ctx, req) => {
+ return {
+ isScreenshot: isScreenshotMode(req),
+ };
+ }
+ );
+
+ // We use "require" here to ensure the import does not have external references due to code bundling that
+ // commonly happens during transpiling. External references would be missing in the environment puppeteer creates.
+ // eslint-disable-next-line @typescript-eslint/no-var-requires
+ const { setScreenshotModeEnabled } = require('../common');
+
+ return {
+ setScreenshotModeEnabled,
+ isScreenshotMode,
+ };
+ }
+
+ public start(): ScreenshotModePluginStart {
+ return {
+ isScreenshotMode,
+ };
+ }
+
+ public stop() {}
+}
diff --git a/src/plugins/screenshot_mode/server/types.ts b/src/plugins/screenshot_mode/server/types.ts
new file mode 100644
index 0000000000000..4347252e58fce
--- /dev/null
+++ b/src/plugins/screenshot_mode/server/types.ts
@@ -0,0 +1,35 @@
+/*
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
+ * or more contributor license agreements. Licensed under the Elastic License
+ * 2.0 and the Server Side Public License, v 1; you may not use this file except
+ * in compliance with, at your election, the Elastic License 2.0 or the Server
+ * Side Public License, v 1.
+ */
+
+import { RequestHandlerContext, KibanaRequest } from 'src/core/server';
+
+/**
+ * Any context that requires access to the screenshot mode flag but does not have access
+ * to request context {@link ScreenshotModeRequestHandlerContext}, for instance if they are pre-context,
+ * can use this function to check whether the request originates from a client that is in screenshot mode.
+ */
+type IsScreenshotMode = (request: KibanaRequest) => boolean;
+
+export interface ScreenshotModePluginSetup {
+ isScreenshotMode: IsScreenshotMode;
+
+ /**
+ * Set the current environment to screenshot mode. Intended to run in a browser-environment.
+ */
+ setScreenshotModeEnabled: () => void;
+}
+
+export interface ScreenshotModePluginStart {
+ isScreenshotMode: IsScreenshotMode;
+}
+
+export interface ScreenshotModeRequestHandlerContext extends RequestHandlerContext {
+ screenshotMode: {
+ isScreenshot: boolean;
+ };
+}
diff --git a/src/plugins/screenshot_mode/tsconfig.json b/src/plugins/screenshot_mode/tsconfig.json
new file mode 100644
index 0000000000000..58194b385448b
--- /dev/null
+++ b/src/plugins/screenshot_mode/tsconfig.json
@@ -0,0 +1,18 @@
+{
+ "extends": "../../../tsconfig.base.json",
+ "compilerOptions": {
+ "composite": true,
+ "outDir": "./target/types",
+ "emitDeclarationOnly": true,
+ "declaration": true,
+ "declarationMap": true
+ },
+ "include": [
+ "common/**/*",
+ "public/**/*",
+ "server/**/*"
+ ],
+ "references": [
+ { "path": "../../core/tsconfig.json" },
+ ]
+}
diff --git a/src/setup_node_env/harden/lodash_template.js b/src/setup_node_env/harden/lodash_template.js
index a0f181eab08fc..3379cbfdeeb94 100644
--- a/src/setup_node_env/harden/lodash_template.js
+++ b/src/setup_node_env/harden/lodash_template.js
@@ -10,6 +10,8 @@ var hook = require('require-in-the-middle');
var isIterateeCall = require('lodash/_isIterateeCall');
hook(['lodash'], function (lodash) {
+ // we use lodash.template here to harden third-party usage of this otherwise banned function.
+ // eslint-disable-next-line no-restricted-properties
lodash.template = createProxy(lodash.template);
return lodash;
});
@@ -52,6 +54,9 @@ function createFpProxy(template) {
// > Iteratee arguments are capped to avoid gotchas with variadic iteratees.
// this means that we can't specify the options in the second argument to fp.template because it's ignored.
// Instead, we're going to use the non-FP _.template with only the first argument which has already been patched
+
+ // we use lodash.template here to harden third-party usage of this otherwise banned function.
+ // eslint-disable-next-line no-restricted-properties
return _.template(args[0]);
},
});
diff --git a/test/functional/apps/visualize/input_control_vis/chained_controls.ts b/test/functional/apps/visualize/input_control_vis/chained_controls.ts
index 18d1367b37e72..2f91c789a478b 100644
--- a/test/functional/apps/visualize/input_control_vis/chained_controls.ts
+++ b/test/functional/apps/visualize/input_control_vis/chained_controls.ts
@@ -17,7 +17,9 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
const find = getService('find');
const comboBox = getService('comboBox');
- describe('chained controls', function () {
+ // FLAKY: https://github.com/elastic/kibana/issues/96997
+ // FLAKY: https://github.com/elastic/kibana/issues/100372
+ describe.skip('chained controls', function () {
this.tags('includeFirefox');
before(async () => {
diff --git a/test/harden/lodash_template.js b/test/harden/lodash_template.js
index ad70f88ad22c5..b04f8ad66275a 100644
--- a/test/harden/lodash_template.js
+++ b/test/harden/lodash_template.js
@@ -8,6 +8,7 @@
require('../../src/setup_node_env');
const _ = require('lodash');
+// eslint-disable-next-line no-restricted-modules
const template = require('lodash/template');
const fp = require('lodash/fp');
const fpTemplate = require('lodash/fp/template');
@@ -24,6 +25,7 @@ test('test setup ok', (t) => {
t.end();
});
+// eslint-disable-next-line no-restricted-properties
[_.template, template].forEach((fn) => {
test(`_.template('<%= foo %>')`, (t) => {
const output = fn('<%= foo %>')({ foo: 'bar' });
diff --git a/x-pack/examples/reporting_example/kibana.json b/x-pack/examples/reporting_example/kibana.json
index 22768338aec37..f7e351ba3f3bc 100644
--- a/x-pack/examples/reporting_example/kibana.json
+++ b/x-pack/examples/reporting_example/kibana.json
@@ -5,5 +5,5 @@
"server": false,
"ui": true,
"optionalPlugins": [],
- "requiredPlugins": ["reporting", "developerExamples", "navigation"]
+ "requiredPlugins": ["reporting", "developerExamples", "navigation", "screenshotMode"]
}
diff --git a/x-pack/examples/reporting_example/public/application.tsx b/x-pack/examples/reporting_example/public/application.tsx
index 25a1cc767f1f5..0a865d1c9e96b 100644
--- a/x-pack/examples/reporting_example/public/application.tsx
+++ b/x-pack/examples/reporting_example/public/application.tsx
@@ -8,18 +8,15 @@
import React from 'react';
import ReactDOM from 'react-dom';
import { AppMountParameters, CoreStart } from '../../../../src/core/public';
-import { StartDeps } from './types';
+import { SetupDeps, StartDeps } from './types';
import { ReportingExampleApp } from './components/app';
export const renderApp = (
coreStart: CoreStart,
- startDeps: StartDeps,
+ deps: Omit,
{ appBasePath, element }: AppMountParameters
) => {
- ReactDOM.render(
- ,
- element
- );
+ ReactDOM.render(, element);
return () => ReactDOM.unmountComponentAtNode(element);
};
diff --git a/x-pack/examples/reporting_example/public/components/app.tsx b/x-pack/examples/reporting_example/public/components/app.tsx
index fd4a85dd06779..0174ec2a17ad4 100644
--- a/x-pack/examples/reporting_example/public/components/app.tsx
+++ b/x-pack/examples/reporting_example/public/components/app.tsx
@@ -26,6 +26,7 @@ import React, { useEffect, useState } from 'react';
import { BrowserRouter as Router } from 'react-router-dom';
import * as Rx from 'rxjs';
import { takeWhile } from 'rxjs/operators';
+import { ScreenshotModePluginSetup } from 'src/plugins/screenshot_mode/public';
import { CoreStart } from '../../../../../src/core/public';
import { NavigationPublicPluginStart } from '../../../../../src/plugins/navigation/public';
import { constants, ReportingStart } from '../../../../../x-pack/plugins/reporting/public';
@@ -37,6 +38,7 @@ interface ReportingExampleAppDeps {
http: CoreStart['http'];
navigation: NavigationPublicPluginStart;
reporting: ReportingStart;
+ screenshotMode: ScreenshotModePluginSetup;
}
const sourceLogos = ['Beats', 'Cloud', 'Logging', 'Kibana'];
@@ -46,6 +48,7 @@ export const ReportingExampleApp = ({
notifications,
http,
reporting,
+ screenshotMode,
}: ReportingExampleAppDeps) => {
const { getDefaultLayoutSelectors, ReportingAPIClient } = reporting;
const [logos, setLogos] = useState([]);
@@ -125,6 +128,8 @@ export const ReportingExampleApp = ({
))}
+
+ Screenshot Mode is {screenshotMode.isScreenshotMode() ? 'ON' : 'OFF'}!
diff --git a/x-pack/examples/reporting_example/public/plugin.ts b/x-pack/examples/reporting_example/public/plugin.ts
index 6ac1cbe01db92..644ac7cc8d8a8 100644
--- a/x-pack/examples/reporting_example/public/plugin.ts
+++ b/x-pack/examples/reporting_example/public/plugin.ts
@@ -16,7 +16,7 @@ import { PLUGIN_ID, PLUGIN_NAME } from '../common';
import { SetupDeps, StartDeps } from './types';
export class ReportingExamplePlugin implements Plugin {
- public setup(core: CoreSetup, { developerExamples, ...depsSetup }: SetupDeps): void {
+ public setup(core: CoreSetup, { developerExamples, screenshotMode }: SetupDeps): void {
core.application.register({
id: PLUGIN_ID,
title: PLUGIN_NAME,
@@ -30,7 +30,7 @@ export class ReportingExamplePlugin implements Plugin {
unknown
];
// Render the application
- return renderApp(coreStart, { ...depsSetup, ...depsStart }, params);
+ return renderApp(coreStart, { ...depsStart, screenshotMode }, params);
},
});
diff --git a/x-pack/examples/reporting_example/public/types.ts b/x-pack/examples/reporting_example/public/types.ts
index 56e8c34d9dae4..55a573285e24f 100644
--- a/x-pack/examples/reporting_example/public/types.ts
+++ b/x-pack/examples/reporting_example/public/types.ts
@@ -5,8 +5,9 @@
* 2.0.
*/
+import { NavigationPublicPluginStart } from 'src/plugins/navigation/public';
+import { ScreenshotModePluginSetup } from 'src/plugins/screenshot_mode/public';
import { DeveloperExamplesSetup } from '../../../../examples/developer_examples/public';
-import { NavigationPublicPluginStart } from '../../../../src/plugins/navigation/public';
import { ReportingStart } from '../../../plugins/reporting/public';
// eslint-disable-next-line @typescript-eslint/no-empty-interface
@@ -16,6 +17,7 @@ export interface PluginStart {}
export interface SetupDeps {
developerExamples: DeveloperExamplesSetup;
+ screenshotMode: ScreenshotModePluginSetup;
}
export interface StartDeps {
navigation: NavigationPublicPluginStart;
diff --git a/x-pack/plugins/canvas/shareable_runtime/components/canvas.tsx b/x-pack/plugins/canvas/shareable_runtime/components/canvas.tsx
index 52bf01a3ec003..dd54f95b75fa8 100644
--- a/x-pack/plugins/canvas/shareable_runtime/components/canvas.tsx
+++ b/x-pack/plugins/canvas/shareable_runtime/components/canvas.tsx
@@ -85,9 +85,9 @@ export const CanvasComponent = ({
// any point, or change the interval, we need to make sure the interval is
// killed on React re-render-- otherwise the pages will start bouncing around
// as timeouts are accumulated.
- clearTimeout(timeout);
+ window.clearTimeout(timeout);
- timeout = setTimeout(
+ timeout = window.setTimeout(
() => onSetPage(page >= workpad.pages.length - 1 ? 0 : page + 1),
getTimeInterval(autoplay.interval)
);
diff --git a/x-pack/plugins/features/server/feature_privilege_iterator.js b/x-pack/plugins/features/server/feature_privilege_iterator.js
deleted file mode 100644
index 842c30d643b67..0000000000000
--- a/x-pack/plugins/features/server/feature_privilege_iterator.js
+++ /dev/null
@@ -1,11 +0,0 @@
-/*
- * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
- * or more contributor license agreements. Licensed under the Elastic License
- * 2.0; you may not use this file except in compliance with the Elastic License
- * 2.0.
- */
-
-// the file created to remove TS cicular dependency between features and security pluin
-// https://github.com/elastic/kibana/issues/87388
-// eslint-disable-next-line @kbn/eslint/no-restricted-paths
-export { featurePrivilegeIterator } from '../../security/server/authorization';
diff --git a/x-pack/plugins/security/server/authorization/privileges/feature_privilege_iterator/feature_privilege_iterator.test.ts b/x-pack/plugins/features/server/feature_privilege_iterator/feature_privilege_iterator.test.ts
similarity index 99%
rename from x-pack/plugins/security/server/authorization/privileges/feature_privilege_iterator/feature_privilege_iterator.test.ts
rename to x-pack/plugins/features/server/feature_privilege_iterator/feature_privilege_iterator.test.ts
index f42ac3ef21c06..6acc29793797f 100644
--- a/x-pack/plugins/security/server/authorization/privileges/feature_privilege_iterator/feature_privilege_iterator.test.ts
+++ b/x-pack/plugins/features/server/feature_privilege_iterator/feature_privilege_iterator.test.ts
@@ -5,7 +5,7 @@
* 2.0.
*/
-import { KibanaFeature } from '../../../../../features/server';
+import { KibanaFeature } from '../';
import { featurePrivilegeIterator } from './feature_privilege_iterator';
describe('featurePrivilegeIterator', () => {
diff --git a/x-pack/plugins/security/server/authorization/privileges/feature_privilege_iterator/feature_privilege_iterator.ts b/x-pack/plugins/features/server/feature_privilege_iterator/feature_privilege_iterator.ts
similarity index 71%
rename from x-pack/plugins/security/server/authorization/privileges/feature_privilege_iterator/feature_privilege_iterator.ts
rename to x-pack/plugins/features/server/feature_privilege_iterator/feature_privilege_iterator.ts
index de2f44a446a19..e194a051c8a6e 100644
--- a/x-pack/plugins/security/server/authorization/privileges/feature_privilege_iterator/feature_privilege_iterator.ts
+++ b/x-pack/plugins/features/server/feature_privilege_iterator/feature_privilege_iterator.ts
@@ -7,20 +7,48 @@
import _ from 'lodash';
-import type { FeatureKibanaPrivileges, KibanaFeature } from '../../../../../features/server';
-import type { LicenseType } from '../../../../../licensing/server';
+import type { FeatureKibanaPrivileges, KibanaFeature } from '../';
+import type { LicenseType } from '../../../licensing/server';
import { subFeaturePrivilegeIterator } from './sub_feature_privilege_iterator';
-interface IteratorOptions {
+/**
+ * Options to control feature privilege iteration.
+ */
+export interface FeaturePrivilegeIteratorOptions {
+ /**
+ * Augment each privilege definition with its sub-feature privileges.
+ */
augmentWithSubFeaturePrivileges: boolean;
+
+ /**
+ * The current license type. Controls which sub-features are returned, as they may have different license terms than the overall feature.
+ */
licenseType: LicenseType;
+
+ /**
+ * Optional predicate to filter the returned set of privileges.
+ */
predicate?: (privilegeId: string, privilege: FeatureKibanaPrivileges) => boolean;
}
-export function* featurePrivilegeIterator(
+/**
+ * Utility for iterating through all privileges belonging to a specific feature.
+ * Iteration can be customized in several ways:
+ * - Filter privileges with a given predicate.
+ * - Augment privileges with their respective sub-feature privileges.
+ *
+ * @param feature the feature whose privileges to iterate through.
+ * @param options options to control iteration.
+ */
+export type FeaturePrivilegeIterator = (
feature: KibanaFeature,
- options: IteratorOptions
-): IterableIterator<{ privilegeId: string; privilege: FeatureKibanaPrivileges }> {
+ options: FeaturePrivilegeIteratorOptions
+) => IterableIterator<{ privilegeId: string; privilege: FeatureKibanaPrivileges }>;
+
+const featurePrivilegeIterator: FeaturePrivilegeIterator = function* featurePrivilegeIterator(
+ feature: KibanaFeature,
+ options: FeaturePrivilegeIteratorOptions
+) {
for (const entry of Object.entries(feature.privileges ?? {})) {
const [privilegeId, privilege] = entry;
@@ -37,7 +65,7 @@ export function* featurePrivilegeIterator(
yield { privilegeId, privilege };
}
}
-}
+};
function mergeWithSubFeatures(
privilegeId: string,
@@ -97,3 +125,5 @@ function mergeArrays(input1: readonly string[] | undefined, input2: readonly str
const second = input2 ?? [];
return Array.from(new Set([...first, ...second]));
}
+
+export { featurePrivilegeIterator };
diff --git a/x-pack/plugins/security/server/authorization/privileges/feature_privilege_iterator/index.ts b/x-pack/plugins/features/server/feature_privilege_iterator/index.ts
similarity index 66%
rename from x-pack/plugins/security/server/authorization/privileges/feature_privilege_iterator/index.ts
rename to x-pack/plugins/features/server/feature_privilege_iterator/index.ts
index ee7b5d9ab68ab..3be8fd4d81f96 100644
--- a/x-pack/plugins/security/server/authorization/privileges/feature_privilege_iterator/index.ts
+++ b/x-pack/plugins/features/server/feature_privilege_iterator/index.ts
@@ -5,5 +5,10 @@
* 2.0.
*/
+export type {
+ FeaturePrivilegeIterator,
+ FeaturePrivilegeIteratorOptions,
+} from './feature_privilege_iterator';
+export type { SubFeaturePrivilegeIterator } from './sub_feature_privilege_iterator';
export { featurePrivilegeIterator } from './feature_privilege_iterator';
export { subFeaturePrivilegeIterator } from './sub_feature_privilege_iterator';
diff --git a/x-pack/plugins/security/server/authorization/privileges/feature_privilege_iterator/sub_feature_privilege_iterator.ts b/x-pack/plugins/features/server/feature_privilege_iterator/sub_feature_privilege_iterator.ts
similarity index 52%
rename from x-pack/plugins/security/server/authorization/privileges/feature_privilege_iterator/sub_feature_privilege_iterator.ts
rename to x-pack/plugins/features/server/feature_privilege_iterator/sub_feature_privilege_iterator.ts
index 4e71fb363b080..e4cc52bca81bc 100644
--- a/x-pack/plugins/security/server/authorization/privileges/feature_privilege_iterator/sub_feature_privilege_iterator.ts
+++ b/x-pack/plugins/features/server/feature_privilege_iterator/sub_feature_privilege_iterator.ts
@@ -5,10 +5,21 @@
* 2.0.
*/
-import type { KibanaFeature, SubFeaturePrivilegeConfig } from '../../../../../features/common';
-import type { LicenseType } from '../../../../../licensing/server';
+import type { KibanaFeature, SubFeaturePrivilegeConfig } from '../../common';
+import type { LicenseType } from '../../../licensing/server';
-export function* subFeaturePrivilegeIterator(
+/**
+ * Utility for iterating through all sub-feature privileges belonging to a specific feature.
+ *
+ * @param feature the feature whose sub-feature privileges to iterate through.
+ * @param licenseType the current license.
+ */
+export type SubFeaturePrivilegeIterator = (
+ feature: KibanaFeature,
+ licenseType: LicenseType
+) => IterableIterator;
+
+const subFeaturePrivilegeIterator: SubFeaturePrivilegeIterator = function* subFeaturePrivilegeIterator(
feature: KibanaFeature,
licenseType: LicenseType
): IterableIterator {
@@ -19,4 +30,6 @@ export function* subFeaturePrivilegeIterator(
);
}
}
-}
+};
+
+export { subFeaturePrivilegeIterator };
diff --git a/x-pack/plugins/features/server/mocks.ts b/x-pack/plugins/features/server/mocks.ts
index 7b10a185dd0db..c052f0354a907 100644
--- a/x-pack/plugins/features/server/mocks.ts
+++ b/x-pack/plugins/features/server/mocks.ts
@@ -6,6 +6,10 @@
*/
import { PluginSetupContract, PluginStartContract } from './plugin';
+import {
+ featurePrivilegeIterator,
+ subFeaturePrivilegeIterator,
+} from './feature_privilege_iterator';
const createSetup = (): jest.Mocked => {
return {
@@ -15,6 +19,8 @@ const createSetup = (): jest.Mocked => {
registerKibanaFeature: jest.fn(),
registerElasticsearchFeature: jest.fn(),
enableReportingUiCapabilities: jest.fn(),
+ featurePrivilegeIterator: jest.fn().mockImplementation(featurePrivilegeIterator),
+ subFeaturePrivilegeIterator: jest.fn().mockImplementation(subFeaturePrivilegeIterator),
};
};
diff --git a/x-pack/plugins/features/server/oss_features.test.ts b/x-pack/plugins/features/server/oss_features.test.ts
index 86705cae6d5a6..207abaeee9472 100644
--- a/x-pack/plugins/features/server/oss_features.test.ts
+++ b/x-pack/plugins/features/server/oss_features.test.ts
@@ -6,7 +6,6 @@
*/
import { buildOSSFeatures } from './oss_features';
-// @ts-expect-error
import { featurePrivilegeIterator } from './feature_privilege_iterator';
import { KibanaFeature } from '.';
import { LicenseType } from '../../licensing/server';
diff --git a/x-pack/plugins/features/server/plugin.ts b/x-pack/plugins/features/server/plugin.ts
index 60a48a539f81e..b1f540031f6dc 100644
--- a/x-pack/plugins/features/server/plugin.ts
+++ b/x-pack/plugins/features/server/plugin.ts
@@ -26,6 +26,14 @@ import {
KibanaFeature,
KibanaFeatureConfig,
} from '../common';
+import type {
+ FeaturePrivilegeIterator,
+ SubFeaturePrivilegeIterator,
+} from './feature_privilege_iterator';
+import {
+ featurePrivilegeIterator,
+ subFeaturePrivilegeIterator,
+} from './feature_privilege_iterator';
/**
* Describes public Features plugin contract returned at the `setup` stage.
@@ -54,6 +62,18 @@ export interface PluginSetupContract {
* `features` to include Reporting when registering OSS features.
*/
enableReportingUiCapabilities(): void;
+
+ /**
+ * Utility for iterating through all privileges belonging to a specific feature.
+ * {@see FeaturePrivilegeIterator }
+ */
+ featurePrivilegeIterator: FeaturePrivilegeIterator;
+
+ /**
+ * Utility for iterating through all sub-feature privileges belonging to a specific feature.
+ * {@see SubFeaturePrivilegeIterator }
+ */
+ subFeaturePrivilegeIterator: SubFeaturePrivilegeIterator;
}
export interface PluginStartContract {
@@ -110,6 +130,8 @@ export class FeaturesPlugin
),
getFeaturesUICapabilities,
enableReportingUiCapabilities: this.enableReportingUiCapabilities.bind(this),
+ featurePrivilegeIterator,
+ subFeaturePrivilegeIterator,
});
}
diff --git a/x-pack/plugins/fleet/server/saved_objects/index.ts b/x-pack/plugins/fleet/server/saved_objects/index.ts
index e2e33f1ee6c26..4331baef11001 100644
--- a/x-pack/plugins/fleet/server/saved_objects/index.ts
+++ b/x-pack/plugins/fleet/server/saved_objects/index.ts
@@ -42,6 +42,7 @@ import {
migrateSettingsToV7130,
migrateOutputToV7130,
} from './migrations/to_v7_13_0';
+import { migratePackagePolicyToV7140 } from './migrations/to_v7_14_0';
/*
* Saved object types and mappings
@@ -267,6 +268,7 @@ const getSavedObjectTypes = (
'7.11.0': migratePackagePolicyToV7110,
'7.12.0': migratePackagePolicyToV7120,
'7.13.0': migratePackagePolicyToV7130,
+ '7.14.0': migratePackagePolicyToV7140,
},
},
[PACKAGES_SAVED_OBJECT_TYPE]: {
diff --git a/x-pack/plugins/fleet/server/saved_objects/migrations/security_solution/index.ts b/x-pack/plugins/fleet/server/saved_objects/migrations/security_solution/index.ts
index ddce95a96879a..b4f09e541298a 100644
--- a/x-pack/plugins/fleet/server/saved_objects/migrations/security_solution/index.ts
+++ b/x-pack/plugins/fleet/server/saved_objects/migrations/security_solution/index.ts
@@ -8,3 +8,4 @@
export { migratePackagePolicyToV7110 } from './to_v7_11_0';
export { migratePackagePolicyToV7120 } from './to_v7_12_0';
export { migrateEndpointPackagePolicyToV7130 } from './to_v7_13_0';
+export { migrateEndpointPackagePolicyToV7140 } from './to_v7_14_0';
diff --git a/x-pack/plugins/fleet/server/saved_objects/migrations/security_solution/to_v7_14_0.test.ts b/x-pack/plugins/fleet/server/saved_objects/migrations/security_solution/to_v7_14_0.test.ts
new file mode 100644
index 0000000000000..f0c397e93ac4e
--- /dev/null
+++ b/x-pack/plugins/fleet/server/saved_objects/migrations/security_solution/to_v7_14_0.test.ts
@@ -0,0 +1,238 @@
+/*
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
+ * or more contributor license agreements. Licensed under the Elastic License
+ * 2.0; you may not use this file except in compliance with the Elastic License
+ * 2.0.
+ */
+
+import type { SavedObjectMigrationContext, SavedObjectUnsanitizedDoc } from 'kibana/server';
+
+import type { PackagePolicy } from '../../../../common';
+
+import { migrateEndpointPackagePolicyToV7140 } from './to_v7_14_0';
+
+describe('7.14.0 Endpoint Package Policy migration', () => {
+ const migration = migrateEndpointPackagePolicyToV7140;
+ const policyDoc = ({
+ windowsMalware = {},
+ windowsRansomware = {},
+ windowsPopup = {},
+ linuxMalware = {},
+ linuxPopup = {},
+ }) => {
+ return {
+ id: 'mock-saved-object-id',
+ attributes: {
+ name: 'Some Policy Name',
+ package: {
+ name: 'endpoint',
+ title: '',
+ version: '',
+ },
+ id: 'endpoint',
+ policy_id: '',
+ enabled: true,
+ namespace: '',
+ output_id: '',
+ revision: 0,
+ updated_at: '',
+ updated_by: '',
+ created_at: '',
+ created_by: '',
+ inputs: [
+ {
+ type: 'endpoint',
+ enabled: true,
+ streams: [],
+ config: {
+ policy: {
+ value: {
+ windows: {
+ ...windowsMalware,
+ ...windowsRansomware,
+ ...windowsPopup,
+ },
+ linux: {
+ events: { process: true, file: true, network: true },
+ logging: { file: 'info' },
+ ...linuxMalware,
+ ...linuxPopup,
+ },
+ },
+ },
+ },
+ },
+ ],
+ },
+ type: ' nested',
+ };
+ };
+
+ it('adds supported option for ransomware on migrations and linux malware when windows malware is disabled', () => {
+ const initialDoc = policyDoc({
+ windowsMalware: { malware: { mode: 'off' } },
+ windowsRansomware: { ransomware: { mode: 'off' } },
+ windowsPopup: {
+ popup: {
+ malware: {
+ message: '',
+ enabled: false,
+ },
+ ransomware: {
+ message: '',
+ enabled: false,
+ },
+ },
+ },
+ });
+
+ const migratedDoc = policyDoc({
+ windowsMalware: { malware: { mode: 'off' } },
+ windowsRansomware: { ransomware: { mode: 'off', supported: true } },
+ windowsPopup: {
+ popup: {
+ malware: {
+ message: '',
+ enabled: false,
+ },
+ ransomware: {
+ message: '',
+ enabled: false,
+ },
+ },
+ },
+ linuxMalware: {
+ malware: {
+ mode: 'off',
+ },
+ },
+ linuxPopup: {
+ popup: {
+ malware: {
+ message: '',
+ enabled: false,
+ },
+ },
+ },
+ });
+
+ expect(migration(initialDoc, {} as SavedObjectMigrationContext)).toEqual(migratedDoc);
+ });
+
+ it('adds supported option for ransomware on migrations and linux malware option and notification customization when windows malware is enabled', () => {
+ const initialDoc = policyDoc({
+ windowsMalware: { malware: { mode: 'on' } },
+ windowsRansomware: { ransomware: { mode: 'on' } },
+ windowsPopup: {
+ popup: {
+ malware: {
+ message: '',
+ enabled: true,
+ },
+ ransomware: {
+ message: '',
+ enabled: true,
+ },
+ },
+ },
+ });
+
+ const migratedDoc = policyDoc({
+ windowsMalware: { malware: { mode: 'on' } },
+ windowsRansomware: { ransomware: { mode: 'on', supported: true } },
+ windowsPopup: {
+ popup: {
+ malware: {
+ message: '',
+ enabled: true,
+ },
+ ransomware: {
+ message: '',
+ enabled: true,
+ },
+ },
+ },
+ linuxMalware: {
+ malware: {
+ mode: 'on',
+ },
+ },
+ linuxPopup: {
+ popup: {
+ malware: {
+ message: '',
+ enabled: true,
+ },
+ },
+ },
+ });
+
+ expect(migration(initialDoc, {} as SavedObjectMigrationContext)).toEqual(migratedDoc);
+ });
+
+ it('does not modify non-endpoint package policies', () => {
+ const doc: SavedObjectUnsanitizedDoc = {
+ id: 'mock-saved-object-id',
+ attributes: {
+ name: 'Some Policy Name',
+ package: {
+ name: 'notEndpoint',
+ title: '',
+ version: '',
+ },
+ id: 'notEndpoint',
+ policy_id: '',
+ enabled: true,
+ namespace: '',
+ output_id: '',
+ revision: 0,
+ updated_at: '',
+ updated_by: '',
+ created_at: '',
+ created_by: '',
+ inputs: [
+ {
+ type: 'notEndpoint',
+ enabled: true,
+ streams: [],
+ config: {},
+ },
+ ],
+ },
+ type: ' nested',
+ };
+
+ expect(
+ migration(doc, {} as SavedObjectMigrationContext) as SavedObjectUnsanitizedDoc
+ ).toEqual({
+ attributes: {
+ name: 'Some Policy Name',
+ package: {
+ name: 'notEndpoint',
+ title: '',
+ version: '',
+ },
+ id: 'notEndpoint',
+ policy_id: '',
+ enabled: true,
+ namespace: '',
+ output_id: '',
+ revision: 0,
+ updated_at: '',
+ updated_by: '',
+ created_at: '',
+ created_by: '',
+ inputs: [
+ {
+ type: 'notEndpoint',
+ enabled: true,
+ streams: [],
+ config: {},
+ },
+ ],
+ },
+ type: ' nested',
+ id: 'mock-saved-object-id',
+ });
+ });
+});
diff --git a/x-pack/plugins/fleet/server/saved_objects/migrations/security_solution/to_v7_14_0.ts b/x-pack/plugins/fleet/server/saved_objects/migrations/security_solution/to_v7_14_0.ts
new file mode 100644
index 0000000000000..cd7dcc2d3e1df
--- /dev/null
+++ b/x-pack/plugins/fleet/server/saved_objects/migrations/security_solution/to_v7_14_0.ts
@@ -0,0 +1,39 @@
+/*
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
+ * or more contributor license agreements. Licensed under the Elastic License
+ * 2.0; you may not use this file except in compliance with the Elastic License
+ * 2.0.
+ */
+
+import type { SavedObjectMigrationFn, SavedObjectUnsanitizedDoc } from 'kibana/server';
+import { cloneDeep } from 'lodash';
+
+import type { PackagePolicy } from '../../../../common';
+
+export const migrateEndpointPackagePolicyToV7140: SavedObjectMigrationFn<
+ PackagePolicy,
+ PackagePolicy
+> = (packagePolicyDoc) => {
+ const updatedPackagePolicyDoc: SavedObjectUnsanitizedDoc = cloneDeep(
+ packagePolicyDoc
+ );
+ if (packagePolicyDoc.attributes.package?.name === 'endpoint') {
+ const input = updatedPackagePolicyDoc.attributes.inputs[0];
+ if (input && input.config) {
+ const policy = input.config.policy.value;
+ const linuxMalware = cloneDeep(input.config.policy.value.windows.malware);
+ const linuxMalwarePopup = {
+ malware: cloneDeep(input.config.policy.value.windows.popup.malware),
+ };
+
+ policy.linux.malware = linuxMalware;
+ policy.linux.popup = linuxMalwarePopup;
+
+ // This value is based on license.
+ // For the migration, we add 'true', our license watcher will correct it, if needed, when the app starts.
+ policy.windows.ransomware.supported = true;
+ }
+ }
+
+ return updatedPackagePolicyDoc;
+};
diff --git a/x-pack/plugins/fleet/server/saved_objects/migrations/to_v7_14_0.ts b/x-pack/plugins/fleet/server/saved_objects/migrations/to_v7_14_0.ts
new file mode 100644
index 0000000000000..3255e15c6ceec
--- /dev/null
+++ b/x-pack/plugins/fleet/server/saved_objects/migrations/to_v7_14_0.ts
@@ -0,0 +1,29 @@
+/*
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
+ * or more contributor license agreements. Licensed under the Elastic License
+ * 2.0; you may not use this file except in compliance with the Elastic License
+ * 2.0.
+ */
+
+import type { SavedObjectMigrationFn } from 'kibana/server';
+
+import type { PackagePolicy } from '../../../common';
+
+import { migrateEndpointPackagePolicyToV7140 } from './security_solution';
+
+export const migratePackagePolicyToV7140: SavedObjectMigrationFn = (
+ packagePolicyDoc,
+ migrationContext
+) => {
+ let updatedPackagePolicyDoc = packagePolicyDoc;
+
+ // Endpoint specific migrations
+ if (packagePolicyDoc.attributes.package?.name === 'endpoint') {
+ updatedPackagePolicyDoc = migrateEndpointPackagePolicyToV7140(
+ packagePolicyDoc,
+ migrationContext
+ );
+ }
+
+ return updatedPackagePolicyDoc;
+};
diff --git a/x-pack/plugins/infra/public/containers/logs/log_filter/log_filter_state.ts b/x-pack/plugins/infra/public/containers/logs/log_filter/log_filter_state.ts
index 6a78d7c6f94bc..d4cb7ca90541f 100644
--- a/x-pack/plugins/infra/public/containers/logs/log_filter/log_filter_state.ts
+++ b/x-pack/plugins/infra/public/containers/logs/log_filter/log_filter_state.ts
@@ -7,7 +7,7 @@
import createContainer from 'constate';
import { useCallback, useState } from 'react';
-import { useDebounce } from 'react-use';
+import useDebounce from 'react-use/lib/useDebounce';
import { esQuery, IIndexPattern, Query } from '../../../../../../../src/plugins/data/public';
type ParsedQuery = ReturnType;
diff --git a/x-pack/plugins/infra/public/pages/link_to/redirect_to_node_logs.tsx b/x-pack/plugins/infra/public/pages/link_to/redirect_to_node_logs.tsx
index 82e3813bde886..bc8c5699229d8 100644
--- a/x-pack/plugins/infra/public/pages/link_to/redirect_to_node_logs.tsx
+++ b/x-pack/plugins/infra/public/pages/link_to/redirect_to_node_logs.tsx
@@ -6,9 +6,7 @@
*/
import { i18n } from '@kbn/i18n';
-// Prefer importing entire lodash library, e.g. import { get } from "lodash"
-// eslint-disable-next-line no-restricted-imports
-import flowRight from 'lodash/flowRight';
+import { flowRight } from 'lodash';
import React from 'react';
import { Redirect, RouteComponentProps } from 'react-router-dom';
import useMount from 'react-use/lib/useMount';
diff --git a/x-pack/plugins/infra/public/pages/logs/settings/form_elements.tsx b/x-pack/plugins/infra/public/pages/logs/settings/form_elements.tsx
index 751d9762b937a..90504a691cb95 100644
--- a/x-pack/plugins/infra/public/pages/logs/settings/form_elements.tsx
+++ b/x-pack/plugins/infra/public/pages/logs/settings/form_elements.tsx
@@ -7,7 +7,7 @@
import equal from 'fast-deep-equal';
import { useCallback, useMemo, useState } from 'react';
-import { useAsync } from 'react-use';
+import useAsync from 'react-use/lib/useAsync';
import { ObjectEntries } from '../../../../common/utility_types';
import { ChildFormValidationError, GenericValidationError } from './validation_errors';
diff --git a/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/node_details/tabs/logs.tsx b/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/node_details/tabs/logs.tsx
index 4fa9fdf8cdd4a..b792078c394e9 100644
--- a/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/node_details/tabs/logs.tsx
+++ b/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/node_details/tabs/logs.tsx
@@ -6,7 +6,7 @@
*/
import React, { useCallback, useMemo, useState } from 'react';
-import { useThrottle } from 'react-use';
+import useThrottle from 'react-use/lib/useThrottle';
import { FormattedMessage } from '@kbn/i18n/react';
import { i18n } from '@kbn/i18n';
import { EuiFieldSearch } from '@elastic/eui';
diff --git a/x-pack/plugins/lists/common/constants.mock.ts b/x-pack/plugins/lists/common/constants.mock.ts
index 325ed48113966..a05b06b086fff 100644
--- a/x-pack/plugins/lists/common/constants.mock.ts
+++ b/x-pack/plugins/lists/common/constants.mock.ts
@@ -6,7 +6,7 @@
*/
import moment from 'moment';
-import {
+import type {
EndpointEntriesArray,
EntriesArray,
Entry,
diff --git a/x-pack/plugins/lists/common/exceptions/build_exceptions_filter.test.ts b/x-pack/plugins/lists/common/exceptions/build_exceptions_filter.test.ts
index ae0cfbfbfc425..b414e76daa558 100644
--- a/x-pack/plugins/lists/common/exceptions/build_exceptions_filter.test.ts
+++ b/x-pack/plugins/lists/common/exceptions/build_exceptions_filter.test.ts
@@ -5,7 +5,10 @@
* 2.0.
*/
-import { EntryMatchAny } from '@kbn/securitysolution-io-ts-list-types';
+import type {
+ EntryMatchAny,
+ ExceptionListItemSchema,
+} from '@kbn/securitysolution-io-ts-list-types';
import { getEntryMatchExcludeMock, getEntryMatchMock } from '../schemas/types/entry_match.mock';
import {
@@ -19,7 +22,6 @@ import {
getEntryNestedMock,
} from '../schemas/types/entry_nested.mock';
import { getExceptionListItemSchemaMock } from '../schemas/response/exception_list_item_schema.mock';
-import { ExceptionListItemSchema } from '../schemas';
import {
buildExceptionFilter,
diff --git a/x-pack/plugins/lists/common/exceptions/build_exceptions_filter.ts b/x-pack/plugins/lists/common/exceptions/build_exceptions_filter.ts
index 6e76076bc63ef..9276f46e8a82c 100644
--- a/x-pack/plugins/lists/common/exceptions/build_exceptions_filter.ts
+++ b/x-pack/plugins/lists/common/exceptions/build_exceptions_filter.ts
@@ -7,10 +7,12 @@
import { chunk } from 'lodash/fp';
import {
+ CreateExceptionListItemSchema,
EntryExists,
EntryMatch,
EntryMatchAny,
EntryNested,
+ ExceptionListItemSchema,
entriesExists,
entriesMatch,
entriesMatchAny,
@@ -18,7 +20,6 @@ import {
} from '@kbn/securitysolution-io-ts-list-types';
import type { Filter } from '../../../../../src/plugins/data/common';
-import type { CreateExceptionListItemSchema, ExceptionListItemSchema } from '../schemas';
import type { BooleanFilter, NestedFilter } from './types';
import { hasLargeValueList } from './utils';
diff --git a/x-pack/plugins/lists/common/schemas/common/index.ts b/x-pack/plugins/lists/common/schemas/common/index.ts
deleted file mode 100644
index 7aa477e1db748..0000000000000
--- a/x-pack/plugins/lists/common/schemas/common/index.ts
+++ /dev/null
@@ -1,8 +0,0 @@
-/*
- * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
- * or more contributor license agreements. Licensed under the Elastic License
- * 2.0; you may not use this file except in compliance with the Elastic License
- * 2.0.
- */
-
-export * from './schemas';
diff --git a/x-pack/plugins/lists/common/schemas/common/schemas.test.ts b/x-pack/plugins/lists/common/schemas/common/schemas.test.ts
deleted file mode 100644
index c83691ead2ee6..0000000000000
--- a/x-pack/plugins/lists/common/schemas/common/schemas.test.ts
+++ /dev/null
@@ -1,139 +0,0 @@
-/*
- * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
- * or more contributor license agreements. Licensed under the Elastic License
- * 2.0; you may not use this file except in compliance with the Elastic License
- * 2.0.
- */
-
-import { pipe } from 'fp-ts/lib/pipeable';
-import { left } from 'fp-ts/lib/Either';
-import {
- ExceptionListTypeEnum,
- ListOperatorEnum as OperatorEnum,
- Type,
- exceptionListType,
- listOperator as operator,
- osType,
- osTypeArrayOrUndefined,
- type,
-} from '@kbn/securitysolution-io-ts-list-types';
-import { exactCheck, foldLeftRight, getPaths } from '@kbn/securitysolution-io-ts-utils';
-
-describe('Common schemas', () => {
- describe('operator', () => {
- test('it should validate for "included"', () => {
- const payload = 'included';
- const decoded = operator.decode(payload);
- const message = pipe(decoded, foldLeftRight);
-
- expect(getPaths(left(message.errors))).toEqual([]);
- expect(message.schema).toEqual(payload);
- });
-
- test('it should validate for "excluded"', () => {
- const payload = 'excluded';
- const decoded = operator.decode(payload);
- const message = pipe(decoded, foldLeftRight);
-
- expect(getPaths(left(message.errors))).toEqual([]);
- expect(message.schema).toEqual(payload);
- });
-
- test('it should contain same amount of keys as enum', () => {
- // Might seem like a weird test, but its meant to
- // ensure that if operator is updated, you
- // also update the operatorEnum, a workaround
- // for io-ts not yet supporting enums
- // https://github.com/gcanti/io-ts/issues/67
- const keys = Object.keys(operator.keys).sort().join(',').toLowerCase();
- const enumKeys = Object.keys(OperatorEnum).sort().join(',').toLowerCase();
-
- expect(keys).toEqual(enumKeys);
- });
- });
-
- describe('exceptionListType', () => {
- test('it should validate for "detection"', () => {
- const payload = 'detection';
- const decoded = exceptionListType.decode(payload);
- const message = pipe(decoded, foldLeftRight);
-
- expect(getPaths(left(message.errors))).toEqual([]);
- expect(message.schema).toEqual(payload);
- });
-
- test('it should validate for "endpoint"', () => {
- const payload = 'endpoint';
- const decoded = exceptionListType.decode(payload);
- const message = pipe(decoded, foldLeftRight);
-
- expect(getPaths(left(message.errors))).toEqual([]);
- expect(message.schema).toEqual(payload);
- });
-
- test('it should contain same amount of keys as enum', () => {
- // Might seem like a weird test, but its meant to
- // ensure that if exceptionListType is updated, you
- // also update the ExceptionListTypeEnum, a workaround
- // for io-ts not yet supporting enums
- // https://github.com/gcanti/io-ts/issues/67
- const keys = Object.keys(exceptionListType.keys).sort().join(',').toLowerCase();
- const enumKeys = Object.keys(ExceptionListTypeEnum).sort().join(',').toLowerCase();
-
- expect(keys).toEqual(enumKeys);
- });
- });
-
- describe('type', () => {
- test('it will work with a given expected type', () => {
- const payload: Type = 'keyword';
- const decoded = type.decode(payload);
- const checked = exactCheck(payload, decoded);
- const message = pipe(checked, foldLeftRight);
- expect(getPaths(left(message.errors))).toEqual([]);
- expect(message.schema).toEqual(payload);
- });
-
- test('it will give an error if given a type that does not exist', () => {
- const payload: Type | 'madeup' = 'madeup';
- const decoded = type.decode(payload);
- const checked = exactCheck(payload, decoded);
- const message = pipe(checked, foldLeftRight);
- expect(getPaths(left(message.errors))).toEqual([
- 'Invalid value "madeup" supplied to ""binary" | "boolean" | "byte" | "date" | "date_nanos" | "date_range" | "double" | "double_range" | "float" | "float_range" | "geo_point" | "geo_shape" | "half_float" | "integer" | "integer_range" | "ip" | "ip_range" | "keyword" | "long" | "long_range" | "shape" | "short" | "text""',
- ]);
- expect(message.schema).toEqual({});
- });
- });
-
- describe('osType', () => {
- test('it will validate a correct osType', () => {
- const payload = 'windows';
- const decoded = osType.decode(payload);
- const checked = exactCheck(payload, decoded);
- const message = pipe(checked, foldLeftRight);
- expect(getPaths(left(message.errors))).toEqual([]);
- expect(message.schema).toEqual(payload);
- });
-
- test('it will fail to validate an incorrect osType', () => {
- const payload = 'foo';
- const decoded = osType.decode(payload);
- const checked = exactCheck(payload, decoded);
- const message = pipe(checked, foldLeftRight);
- expect(getPaths(left(message.errors))).toEqual([
- 'Invalid value "foo" supplied to ""linux" | "macos" | "windows""',
- ]);
- expect(message.schema).toEqual({});
- });
-
- test('it will default to an empty array when osTypeArrayOrUndefined is used', () => {
- const payload = undefined;
- const decoded = osTypeArrayOrUndefined.decode(payload);
- const checked = exactCheck(payload, decoded);
- const message = pipe(checked, foldLeftRight);
- expect(getPaths(left(message.errors))).toEqual([]);
- expect(message.schema).toEqual([]);
- });
- });
-});
diff --git a/x-pack/plugins/lists/common/schemas/common/schemas.ts b/x-pack/plugins/lists/common/schemas/common/schemas.ts
deleted file mode 100644
index 83ec27d60b76c..0000000000000
--- a/x-pack/plugins/lists/common/schemas/common/schemas.ts
+++ /dev/null
@@ -1,91 +0,0 @@
-/*
- * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
- * or more contributor license agreements. Licensed under the Elastic License
- * 2.0; you may not use this file except in compliance with the Elastic License
- * 2.0.
- */
-
-/* eslint-disable @typescript-eslint/naming-convention */
-
-import * as t from 'io-ts';
-import { NonEmptyString } from '@kbn/securitysolution-io-ts-types';
-import { DefaultNamespace } from '@kbn/securitysolution-io-ts-list-types';
-
-export const list_id = NonEmptyString;
-export type ListId = t.TypeOf;
-export const list_idOrUndefined = t.union([list_id, t.undefined]);
-export type ListIdOrUndefined = t.TypeOf;
-
-export const item = t.string;
-
-export const file = t.object;
-export const list_type = t.keyof({ item: null, list: null });
-export type ListType = t.TypeOf;
-
-export const item_id = NonEmptyString;
-export type ItemId = t.TypeOf;
-export const itemIdOrUndefined = t.union([item_id, t.undefined]);
-export type ItemIdOrUndefined = t.TypeOf;
-
-export const per_page = t.number; // TODO: Change this out for PositiveNumber from siem
-export type PerPage = t.TypeOf;
-
-export const perPageOrUndefined = t.union([per_page, t.undefined]);
-export type PerPageOrUndefined = t.TypeOf;
-
-export const total = t.number; // TODO: Change this out for PositiveNumber from siem
-export const totalUndefined = t.union([total, t.undefined]);
-export type TotalOrUndefined = t.TypeOf;
-
-export const page = t.number; // TODO: Change this out for PositiveNumber from siem
-export type Page = t.TypeOf;
-
-export const pageOrUndefined = t.union([page, t.undefined]);
-export type PageOrUndefined = t.TypeOf;
-
-export const sort_field = t.string;
-export const sortFieldOrUndefined = t.union([sort_field, t.undefined]);
-export type SortFieldOrUndefined = t.TypeOf;
-
-export const sort_order = t.keyof({ asc: null, desc: null });
-export const sortOrderOrUndefined = t.union([sort_order, t.undefined]);
-export type SortOrderOrUndefined = t.TypeOf;
-
-export const filter = t.string;
-export type Filter = t.TypeOf;
-export const filterOrUndefined = t.union([filter, t.undefined]);
-export type FilterOrUndefined = t.TypeOf;
-
-export const cursor = t.string;
-export type Cursor = t.TypeOf;
-export const cursorOrUndefined = t.union([cursor, t.undefined]);
-export type CursorOrUndefined = t.TypeOf;
-
-export const namespace_type = DefaultNamespace;
-
-export const serializer = t.string;
-export type Serializer = t.TypeOf;
-
-export const serializerOrUndefined = t.union([serializer, t.undefined]);
-export type SerializerOrUndefined = t.TypeOf;
-
-export const deserializer = t.string;
-export type Deserializer = t.TypeOf;
-
-export const deserializerOrUndefined = t.union([deserializer, t.undefined]);
-export type DeserializerOrUndefined = t.TypeOf;
-
-export const _version = t.string;
-export const _versionOrUndefined = t.union([_version, t.undefined]);
-export type _VersionOrUndefined = t.TypeOf;
-
-export const immutable = t.boolean;
-export type Immutable = t.TypeOf;
-
-export const immutableOrUndefined = t.union([immutable, t.undefined]);
-export type ImmutableOrUndefined = t.TypeOf;
-
-export const value = t.string;
-export const valueOrUndefined = t.union([value, t.undefined]);
-
-export const tie_breaker_id = t.string; // TODO: Use UUID for this instead of a string for validation
diff --git a/x-pack/plugins/lists/common/schemas/index.ts b/x-pack/plugins/lists/common/schemas/index.ts
deleted file mode 100644
index 7731d555a5dd3..0000000000000
--- a/x-pack/plugins/lists/common/schemas/index.ts
+++ /dev/null
@@ -1,10 +0,0 @@
-/*
- * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
- * or more contributor license agreements. Licensed under the Elastic License
- * 2.0; you may not use this file except in compliance with the Elastic License
- * 2.0.
- */
-
-export * from './common';
-export * from './request';
-export * from './response';
diff --git a/x-pack/plugins/lists/common/schemas/request/create_exception_list_item_schema.mock.ts b/x-pack/plugins/lists/common/schemas/request/create_exception_list_item_schema.mock.ts
index 6ef6b40d706f8..447e79e4f77d7 100644
--- a/x-pack/plugins/lists/common/schemas/request/create_exception_list_item_schema.mock.ts
+++ b/x-pack/plugins/lists/common/schemas/request/create_exception_list_item_schema.mock.ts
@@ -5,6 +5,8 @@
* 2.0.
*/
+import type { CreateExceptionListItemSchema } from '@kbn/securitysolution-io-ts-list-types';
+
import {
COMMENTS,
DESCRIPTION,
@@ -19,8 +21,6 @@ import {
TAGS,
} from '../../constants.mock';
-import { CreateExceptionListItemSchema } from './create_exception_list_item_schema';
-
export const getCreateExceptionListItemSchemaMock = (): CreateExceptionListItemSchema => ({
comments: COMMENTS,
description: DESCRIPTION,
diff --git a/x-pack/plugins/lists/common/schemas/request/create_exception_list_schema.mock.ts b/x-pack/plugins/lists/common/schemas/request/create_exception_list_schema.mock.ts
index 49af6f49442ab..2df0de3e8108a 100644
--- a/x-pack/plugins/lists/common/schemas/request/create_exception_list_schema.mock.ts
+++ b/x-pack/plugins/lists/common/schemas/request/create_exception_list_schema.mock.ts
@@ -5,6 +5,8 @@
* 2.0.
*/
+import type { CreateExceptionListSchema } from '@kbn/securitysolution-io-ts-list-types';
+
import {
DESCRIPTION,
ENDPOINT_TYPE,
@@ -15,8 +17,6 @@ import {
VERSION,
} from '../../constants.mock';
-import { CreateExceptionListSchema } from './create_exception_list_schema';
-
export const getCreateExceptionListSchemaMock = (): CreateExceptionListSchema => ({
description: DESCRIPTION,
list_id: undefined,
diff --git a/x-pack/plugins/lists/common/schemas/request/create_list_item_schema.mock.ts b/x-pack/plugins/lists/common/schemas/request/create_list_item_schema.mock.ts
index 3c556ab70e1dc..6587ec3e85873 100644
--- a/x-pack/plugins/lists/common/schemas/request/create_list_item_schema.mock.ts
+++ b/x-pack/plugins/lists/common/schemas/request/create_list_item_schema.mock.ts
@@ -5,9 +5,9 @@
* 2.0.
*/
-import { LIST_ID, LIST_ITEM_ID, META, VALUE } from '../../constants.mock';
+import type { CreateListItemSchema } from '@kbn/securitysolution-io-ts-list-types';
-import { CreateListItemSchema } from './create_list_item_schema';
+import { LIST_ID, LIST_ITEM_ID, META, VALUE } from '../../constants.mock';
export const getCreateListItemSchemaMock = (): CreateListItemSchema => ({
id: LIST_ITEM_ID,
diff --git a/x-pack/plugins/lists/common/schemas/request/create_list_schema.mock.ts b/x-pack/plugins/lists/common/schemas/request/create_list_schema.mock.ts
index b922f73a376ba..117659423103d 100644
--- a/x-pack/plugins/lists/common/schemas/request/create_list_schema.mock.ts
+++ b/x-pack/plugins/lists/common/schemas/request/create_list_schema.mock.ts
@@ -5,9 +5,9 @@
* 2.0.
*/
-import { DESCRIPTION, LIST_ID, META, NAME, TYPE, VERSION } from '../../constants.mock';
+import type { CreateListSchema } from '@kbn/securitysolution-io-ts-list-types';
-import { CreateListSchema } from './create_list_schema';
+import { DESCRIPTION, LIST_ID, META, NAME, TYPE, VERSION } from '../../constants.mock';
export const getCreateListSchemaMock = (): CreateListSchema => ({
description: DESCRIPTION,
diff --git a/x-pack/plugins/lists/common/schemas/request/delete_endpoint_list_item_schema.mock.ts b/x-pack/plugins/lists/common/schemas/request/delete_endpoint_list_item_schema.mock.ts
deleted file mode 100644
index a6434b0d4a3fd..0000000000000
--- a/x-pack/plugins/lists/common/schemas/request/delete_endpoint_list_item_schema.mock.ts
+++ /dev/null
@@ -1,14 +0,0 @@
-/*
- * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
- * or more contributor license agreements. Licensed under the Elastic License
- * 2.0; you may not use this file except in compliance with the Elastic License
- * 2.0.
- */
-
-import { ID } from '../../constants.mock';
-
-import { DeleteEndpointListItemSchema } from './delete_endpoint_list_item_schema';
-
-export const getDeleteEndpointListItemSchemaMock = (): DeleteEndpointListItemSchema => ({
- id: ID,
-});
diff --git a/x-pack/plugins/lists/common/schemas/request/delete_exception_list_item_schema.mock.ts b/x-pack/plugins/lists/common/schemas/request/delete_exception_list_item_schema.mock.ts
deleted file mode 100644
index 1dfd8c7663d0a..0000000000000
--- a/x-pack/plugins/lists/common/schemas/request/delete_exception_list_item_schema.mock.ts
+++ /dev/null
@@ -1,15 +0,0 @@
-/*
- * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
- * or more contributor license agreements. Licensed under the Elastic License
- * 2.0; you may not use this file except in compliance with the Elastic License
- * 2.0.
- */
-
-import { ID, NAMESPACE_TYPE } from '../../constants.mock';
-
-import { DeleteExceptionListItemSchema } from './delete_exception_list_item_schema';
-
-export const getDeleteExceptionListItemSchemaMock = (): DeleteExceptionListItemSchema => ({
- id: ID,
- namespace_type: NAMESPACE_TYPE,
-});
diff --git a/x-pack/plugins/lists/common/schemas/request/delete_exception_list_schema.mock.ts b/x-pack/plugins/lists/common/schemas/request/delete_exception_list_schema.mock.ts
deleted file mode 100644
index 743d504576d88..0000000000000
--- a/x-pack/plugins/lists/common/schemas/request/delete_exception_list_schema.mock.ts
+++ /dev/null
@@ -1,15 +0,0 @@
-/*
- * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
- * or more contributor license agreements. Licensed under the Elastic License
- * 2.0; you may not use this file except in compliance with the Elastic License
- * 2.0.
- */
-
-import { ID, NAMESPACE_TYPE } from '../../constants.mock';
-
-import { DeleteExceptionListSchema } from './delete_exception_list_schema';
-
-export const getDeleteExceptionListSchemaMock = (): DeleteExceptionListSchema => ({
- id: ID,
- namespace_type: NAMESPACE_TYPE,
-});
diff --git a/x-pack/plugins/lists/common/schemas/request/delete_list_item_schema.mock.ts b/x-pack/plugins/lists/common/schemas/request/delete_list_item_schema.mock.ts
deleted file mode 100644
index dc9b7443e2202..0000000000000
--- a/x-pack/plugins/lists/common/schemas/request/delete_list_item_schema.mock.ts
+++ /dev/null
@@ -1,16 +0,0 @@
-/*
- * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
- * or more contributor license agreements. Licensed under the Elastic License
- * 2.0; you may not use this file except in compliance with the Elastic License
- * 2.0.
- */
-
-import { ID, LIST_ID, VALUE } from '../../constants.mock';
-
-import { DeleteListItemSchema } from './delete_list_item_schema';
-
-export const getDeleteListItemSchemaMock = (): DeleteListItemSchema => ({
- id: ID,
- list_id: LIST_ID,
- value: VALUE,
-});
diff --git a/x-pack/plugins/lists/common/schemas/request/delete_list_schema.mock.ts b/x-pack/plugins/lists/common/schemas/request/delete_list_schema.mock.ts
deleted file mode 100644
index 74b1fb163fc95..0000000000000
--- a/x-pack/plugins/lists/common/schemas/request/delete_list_schema.mock.ts
+++ /dev/null
@@ -1,16 +0,0 @@
-/*
- * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
- * or more contributor license agreements. Licensed under the Elastic License
- * 2.0; you may not use this file except in compliance with the Elastic License
- * 2.0.
- */
-
-import { LIST_ID } from '../../constants.mock';
-
-import { DeleteListSchema } from './delete_list_schema';
-
-export const getDeleteListSchemaMock = (): DeleteListSchema => ({
- deleteReferences: false,
- id: LIST_ID,
- ignoreReferences: true,
-});
diff --git a/x-pack/plugins/lists/common/schemas/request/export_exception_list_query_schema.mock.ts b/x-pack/plugins/lists/common/schemas/request/export_exception_list_query_schema.mock.ts
deleted file mode 100644
index 084296d31a76b..0000000000000
--- a/x-pack/plugins/lists/common/schemas/request/export_exception_list_query_schema.mock.ts
+++ /dev/null
@@ -1,16 +0,0 @@
-/*
- * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
- * or more contributor license agreements. Licensed under the Elastic License
- * 2.0; you may not use this file except in compliance with the Elastic License
- * 2.0.
- */
-
-import { ID, LIST_ID, NAMESPACE_TYPE } from '../../constants.mock';
-
-import { ExportExceptionListQuerySchema } from './export_exception_list_query_schema';
-
-export const getExportExceptionListQuerySchemaMock = (): ExportExceptionListQuerySchema => ({
- id: ID,
- list_id: LIST_ID,
- namespace_type: NAMESPACE_TYPE,
-});
diff --git a/x-pack/plugins/lists/common/schemas/request/export_list_item_query_schema.mock.ts b/x-pack/plugins/lists/common/schemas/request/export_list_item_query_schema.mock.ts
deleted file mode 100644
index 4cc5a10ede900..0000000000000
--- a/x-pack/plugins/lists/common/schemas/request/export_list_item_query_schema.mock.ts
+++ /dev/null
@@ -1,14 +0,0 @@
-/*
- * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
- * or more contributor license agreements. Licensed under the Elastic License
- * 2.0; you may not use this file except in compliance with the Elastic License
- * 2.0.
- */
-
-import { LIST_ID } from '../../constants.mock';
-
-import { ExportListItemQuerySchema } from './export_list_item_query_schema';
-
-export const getExportListItemQuerySchemaMock = (): ExportListItemQuerySchema => ({
- list_id: LIST_ID,
-});
diff --git a/x-pack/plugins/lists/common/schemas/request/import_list_item_query_schema.mock.ts b/x-pack/plugins/lists/common/schemas/request/import_list_item_query_schema.mock.ts
deleted file mode 100644
index fac2f2603ee8a..0000000000000
--- a/x-pack/plugins/lists/common/schemas/request/import_list_item_query_schema.mock.ts
+++ /dev/null
@@ -1,17 +0,0 @@
-/*
- * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
- * or more contributor license agreements. Licensed under the Elastic License
- * 2.0; you may not use this file except in compliance with the Elastic License
- * 2.0.
- */
-
-import { LIST_ID, TYPE } from '../../constants.mock';
-
-import { ImportListItemQuerySchema } from './import_list_item_query_schema';
-
-export const getImportListItemQuerySchemaMock = (): ImportListItemQuerySchema => ({
- deserializer: undefined,
- list_id: LIST_ID,
- serializer: undefined,
- type: TYPE,
-});
diff --git a/x-pack/plugins/lists/common/schemas/request/import_list_item_schema.mock.ts b/x-pack/plugins/lists/common/schemas/request/import_list_item_schema.mock.ts
index 8a1d6d709c905..e6c696895e8a3 100644
--- a/x-pack/plugins/lists/common/schemas/request/import_list_item_schema.mock.ts
+++ b/x-pack/plugins/lists/common/schemas/request/import_list_item_schema.mock.ts
@@ -5,7 +5,7 @@
* 2.0.
*/
-import { ImportListItemSchema } from './import_list_item_schema';
+import type { ImportListItemSchema } from '@kbn/securitysolution-io-ts-list-types';
export const getImportListItemSchemaMock = (): ImportListItemSchema => ({
file: {},
diff --git a/x-pack/plugins/lists/common/schemas/request/patch_list_item_schema.mock.ts b/x-pack/plugins/lists/common/schemas/request/patch_list_item_schema.mock.ts
deleted file mode 100644
index a5bbeb59f6554..0000000000000
--- a/x-pack/plugins/lists/common/schemas/request/patch_list_item_schema.mock.ts
+++ /dev/null
@@ -1,16 +0,0 @@
-/*
- * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
- * or more contributor license agreements. Licensed under the Elastic License
- * 2.0; you may not use this file except in compliance with the Elastic License
- * 2.0.
- */
-
-import { LIST_ITEM_ID, META, VALUE } from '../../constants.mock';
-
-import { PatchListItemSchema } from './patch_list_item_schema';
-
-export const getPathListItemSchemaMock = (): PatchListItemSchema => ({
- id: LIST_ITEM_ID,
- meta: META,
- value: VALUE,
-});
diff --git a/x-pack/plugins/lists/common/schemas/request/read_endpoint_list_item_schema.mock.ts b/x-pack/plugins/lists/common/schemas/request/read_endpoint_list_item_schema.mock.ts
deleted file mode 100644
index b88a861fe5ff3..0000000000000
--- a/x-pack/plugins/lists/common/schemas/request/read_endpoint_list_item_schema.mock.ts
+++ /dev/null
@@ -1,15 +0,0 @@
-/*
- * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
- * or more contributor license agreements. Licensed under the Elastic License
- * 2.0; you may not use this file except in compliance with the Elastic License
- * 2.0.
- */
-
-import { ID, ITEM_ID } from '../../constants.mock';
-
-import { ReadEndpointListItemSchema } from './read_endpoint_list_item_schema';
-
-export const getReadEndpointListItemSchemaMock = (): ReadEndpointListItemSchema => ({
- id: ID,
- item_id: ITEM_ID,
-});
diff --git a/x-pack/plugins/lists/common/schemas/request/read_exception_list_item_schema.mock.ts b/x-pack/plugins/lists/common/schemas/request/read_exception_list_item_schema.mock.ts
deleted file mode 100644
index 1e6e5a158afe9..0000000000000
--- a/x-pack/plugins/lists/common/schemas/request/read_exception_list_item_schema.mock.ts
+++ /dev/null
@@ -1,16 +0,0 @@
-/*
- * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
- * or more contributor license agreements. Licensed under the Elastic License
- * 2.0; you may not use this file except in compliance with the Elastic License
- * 2.0.
- */
-
-import { ID, ITEM_ID, NAMESPACE_TYPE } from '../../constants.mock';
-
-import { ReadExceptionListItemSchema } from './read_exception_list_item_schema';
-
-export const getReadExceptionListItemSchemaMock = (): ReadExceptionListItemSchema => ({
- id: ID,
- item_id: ITEM_ID,
- namespace_type: NAMESPACE_TYPE,
-});
diff --git a/x-pack/plugins/lists/common/schemas/request/read_exception_list_schema.mock.ts b/x-pack/plugins/lists/common/schemas/request/read_exception_list_schema.mock.ts
deleted file mode 100644
index 4b9cd42546aa2..0000000000000
--- a/x-pack/plugins/lists/common/schemas/request/read_exception_list_schema.mock.ts
+++ /dev/null
@@ -1,16 +0,0 @@
-/*
- * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
- * or more contributor license agreements. Licensed under the Elastic License
- * 2.0; you may not use this file except in compliance with the Elastic License
- * 2.0.
- */
-
-import { ID, LIST_ID, NAMESPACE_TYPE } from '../../constants.mock';
-
-import { ReadExceptionListSchema } from './read_exception_list_schema';
-
-export const getReadExceptionListSchemaMock = (): ReadExceptionListSchema => ({
- id: ID,
- list_id: LIST_ID,
- namespace_type: NAMESPACE_TYPE,
-});
diff --git a/x-pack/plugins/lists/common/schemas/request/read_list_item_schema.mock.ts b/x-pack/plugins/lists/common/schemas/request/read_list_item_schema.mock.ts
deleted file mode 100644
index 873909ece055d..0000000000000
--- a/x-pack/plugins/lists/common/schemas/request/read_list_item_schema.mock.ts
+++ /dev/null
@@ -1,16 +0,0 @@
-/*
- * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
- * or more contributor license agreements. Licensed under the Elastic License
- * 2.0; you may not use this file except in compliance with the Elastic License
- * 2.0.
- */
-
-import { LIST_ID, LIST_ITEM_ID, VALUE } from '../../constants.mock';
-
-import { ReadListItemSchema } from './read_list_item_schema';
-
-export const getReadListItemSchemaMock = (): ReadListItemSchema => ({
- id: LIST_ITEM_ID,
- list_id: LIST_ID,
- value: VALUE,
-});
diff --git a/x-pack/plugins/lists/common/schemas/request/read_list_schema.mock.ts b/x-pack/plugins/lists/common/schemas/request/read_list_schema.mock.ts
deleted file mode 100644
index a0bd7316d22f2..0000000000000
--- a/x-pack/plugins/lists/common/schemas/request/read_list_schema.mock.ts
+++ /dev/null
@@ -1,14 +0,0 @@
-/*
- * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
- * or more contributor license agreements. Licensed under the Elastic License
- * 2.0; you may not use this file except in compliance with the Elastic License
- * 2.0.
- */
-
-import { LIST_ID } from '../../constants.mock';
-
-import { ReadListSchema } from './read_list_schema';
-
-export const getReadListSchemaMock = (): ReadListSchema => ({
- id: LIST_ID,
-});
diff --git a/x-pack/plugins/lists/common/schemas/request/update_exception_list_item_schema.mock.ts b/x-pack/plugins/lists/common/schemas/request/update_exception_list_item_schema.mock.ts
index 8eeba162295c1..f4d620f9c88c2 100644
--- a/x-pack/plugins/lists/common/schemas/request/update_exception_list_item_schema.mock.ts
+++ b/x-pack/plugins/lists/common/schemas/request/update_exception_list_item_schema.mock.ts
@@ -5,6 +5,8 @@
* 2.0.
*/
+import type { UpdateExceptionListItemSchema } from '@kbn/securitysolution-io-ts-list-types';
+
import {
COMMENTS,
DESCRIPTION,
@@ -20,8 +22,6 @@ import {
TAGS,
} from '../../constants.mock';
-import { UpdateExceptionListItemSchema } from './update_exception_list_item_schema';
-
export const getUpdateExceptionListItemSchemaMock = (): UpdateExceptionListItemSchema => ({
_version: undefined,
comments: COMMENTS,
diff --git a/x-pack/plugins/lists/common/schemas/request/update_exception_list_schema.mock.ts b/x-pack/plugins/lists/common/schemas/request/update_exception_list_schema.mock.ts
index 9a567aca9bd1c..b57317ca2a505 100644
--- a/x-pack/plugins/lists/common/schemas/request/update_exception_list_schema.mock.ts
+++ b/x-pack/plugins/lists/common/schemas/request/update_exception_list_schema.mock.ts
@@ -5,9 +5,9 @@
* 2.0.
*/
-import { DESCRIPTION, ID, LIST_ID, META, NAME, NAMESPACE_TYPE } from '../../constants.mock';
+import type { UpdateExceptionListSchema } from '@kbn/securitysolution-io-ts-list-types';
-import { UpdateExceptionListSchema } from './update_exception_list_schema';
+import { DESCRIPTION, ID, LIST_ID, META, NAME, NAMESPACE_TYPE } from '../../constants.mock';
export const getUpdateExceptionListSchemaMock = (): UpdateExceptionListSchema => ({
_version: undefined,
diff --git a/x-pack/plugins/lists/common/schemas/request/update_list_item_schema.mock.ts b/x-pack/plugins/lists/common/schemas/request/update_list_item_schema.mock.ts
index f2f1ad2dd16df..ae8ff98c66b95 100644
--- a/x-pack/plugins/lists/common/schemas/request/update_list_item_schema.mock.ts
+++ b/x-pack/plugins/lists/common/schemas/request/update_list_item_schema.mock.ts
@@ -5,9 +5,9 @@
* 2.0.
*/
-import { ID, LIST_ITEM_ID, META, VALUE } from '../../constants.mock';
+import type { UpdateListItemSchema } from '@kbn/securitysolution-io-ts-list-types';
-import { UpdateListItemSchema } from './update_list_item_schema';
+import { ID, LIST_ITEM_ID, META, VALUE } from '../../constants.mock';
export const getUpdateListItemSchemaMock = (): UpdateListItemSchema => ({
id: ID,
diff --git a/x-pack/plugins/lists/common/schemas/request/update_list_schema.mock.ts b/x-pack/plugins/lists/common/schemas/request/update_list_schema.mock.ts
index 4fdc990a321c1..d38744a35a6cb 100644
--- a/x-pack/plugins/lists/common/schemas/request/update_list_schema.mock.ts
+++ b/x-pack/plugins/lists/common/schemas/request/update_list_schema.mock.ts
@@ -5,9 +5,9 @@
* 2.0.
*/
-import { DESCRIPTION, LIST_ID, META, NAME, _VERSION } from '../../constants.mock';
+import type { UpdateListSchema } from '@kbn/securitysolution-io-ts-list-types';
-import { UpdateListSchema } from './update_list_schema';
+import { DESCRIPTION, LIST_ID, META, NAME, _VERSION } from '../../constants.mock';
export const getUpdateListSchemaMock = (): UpdateListSchema => ({
_version: _VERSION,
diff --git a/x-pack/plugins/lists/common/schemas/response/acknowledge_schema.mock.ts b/x-pack/plugins/lists/common/schemas/response/acknowledge_schema.mock.ts
index b189bf9f133bd..0aa6990d44b3d 100644
--- a/x-pack/plugins/lists/common/schemas/response/acknowledge_schema.mock.ts
+++ b/x-pack/plugins/lists/common/schemas/response/acknowledge_schema.mock.ts
@@ -5,7 +5,7 @@
* 2.0.
*/
-import { AcknowledgeSchema } from './acknowledge_schema';
+import type { AcknowledgeSchema } from '@kbn/securitysolution-io-ts-list-types';
export const getAcknowledgeSchemaResponseMock = (): AcknowledgeSchema => ({
acknowledged: true,
diff --git a/x-pack/plugins/lists/common/schemas/response/exception_list_item_schema.mock.ts b/x-pack/plugins/lists/common/schemas/response/exception_list_item_schema.mock.ts
index c7d1459319eaf..22a176da222d6 100644
--- a/x-pack/plugins/lists/common/schemas/response/exception_list_item_schema.mock.ts
+++ b/x-pack/plugins/lists/common/schemas/response/exception_list_item_schema.mock.ts
@@ -5,6 +5,8 @@
* 2.0.
*/
+import type { ExceptionListItemSchema } from '@kbn/securitysolution-io-ts-list-types';
+
import {
COMMENTS,
DATE_NOW,
@@ -22,8 +24,6 @@ import {
USER,
} from '../../constants.mock';
-import { ExceptionListItemSchema } from './exception_list_item_schema';
-
export const getExceptionListItemSchemaMock = (
overrides?: Partial
): ExceptionListItemSchema => ({
diff --git a/x-pack/plugins/lists/common/schemas/response/exception_list_item_schema.ts b/x-pack/plugins/lists/common/schemas/response/exception_list_item_schema.ts
deleted file mode 100644
index 0b6f8a7640529..0000000000000
--- a/x-pack/plugins/lists/common/schemas/response/exception_list_item_schema.ts
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
- * or more contributor license agreements. Licensed under the Elastic License
- * 2.0; you may not use this file except in compliance with the Elastic License
- * 2.0.
- */
-
-import * as t from 'io-ts';
-import {
- commentsArray,
- created_at,
- created_by,
- description,
- entriesArray,
- exceptionListItemType,
- id,
- metaOrUndefined,
- name,
- osTypeArray,
- tags,
- updated_at,
- updated_by,
-} from '@kbn/securitysolution-io-ts-list-types';
-
-import {
- _versionOrUndefined,
- item_id,
- list_id,
- namespace_type,
- tie_breaker_id,
-} from '../common/schemas';
-
-export const exceptionListItemSchema = t.exact(
- t.type({
- _version: _versionOrUndefined,
- comments: commentsArray,
- created_at,
- created_by,
- description,
- entries: entriesArray,
- id,
- item_id,
- list_id,
- meta: metaOrUndefined,
- name,
- namespace_type,
- os_types: osTypeArray,
- tags,
- tie_breaker_id,
- type: exceptionListItemType,
- updated_at,
- updated_by,
- })
-);
-
-export type ExceptionListItemSchema = t.TypeOf;
diff --git a/x-pack/plugins/lists/common/schemas/response/exception_list_schema.mock.ts b/x-pack/plugins/lists/common/schemas/response/exception_list_schema.mock.ts
index 99c63055e6654..59e1138972ce0 100644
--- a/x-pack/plugins/lists/common/schemas/response/exception_list_schema.mock.ts
+++ b/x-pack/plugins/lists/common/schemas/response/exception_list_schema.mock.ts
@@ -5,6 +5,8 @@
* 2.0.
*/
+import type { ExceptionListSchema } from '@kbn/securitysolution-io-ts-list-types';
+
import {
DATE_NOW,
DESCRIPTION,
@@ -26,8 +28,6 @@ import {
ENDPOINT_TRUSTED_APPS_LIST_NAME,
} from '../../constants';
-import { ExceptionListSchema } from './exception_list_schema';
-
export const getExceptionListSchemaMock = (): ExceptionListSchema => ({
_version: _VERSION,
created_at: DATE_NOW,
diff --git a/x-pack/plugins/lists/common/schemas/response/exception_list_schema.ts b/x-pack/plugins/lists/common/schemas/response/exception_list_schema.ts
deleted file mode 100644
index f96496343fb7e..0000000000000
--- a/x-pack/plugins/lists/common/schemas/response/exception_list_schema.ts
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
- * or more contributor license agreements. Licensed under the Elastic License
- * 2.0; you may not use this file except in compliance with the Elastic License
- * 2.0.
- */
-
-import * as t from 'io-ts';
-import {
- created_at,
- created_by,
- description,
- exceptionListType,
- id,
- metaOrUndefined,
- name,
- osTypeArray,
- tags,
- updated_at,
- updated_by,
-} from '@kbn/securitysolution-io-ts-list-types';
-import { version } from '@kbn/securitysolution-io-ts-types';
-
-import {
- _versionOrUndefined,
- immutable,
- list_id,
- namespace_type,
- tie_breaker_id,
-} from '../common/schemas';
-
-export const exceptionListSchema = t.exact(
- t.type({
- _version: _versionOrUndefined,
- created_at,
- created_by,
- description,
- id,
- immutable,
- list_id,
- meta: metaOrUndefined,
- name,
- namespace_type,
- os_types: osTypeArray,
- tags,
- tie_breaker_id,
- type: exceptionListType,
- updated_at,
- updated_by,
- version,
- })
-);
-
-export type ExceptionListSchema = t.TypeOf;
diff --git a/x-pack/plugins/lists/common/schemas/response/found_exception_list_item_schema.mock.ts b/x-pack/plugins/lists/common/schemas/response/found_exception_list_item_schema.mock.ts
index bda84ff427bc1..d06ab90e84168 100644
--- a/x-pack/plugins/lists/common/schemas/response/found_exception_list_item_schema.mock.ts
+++ b/x-pack/plugins/lists/common/schemas/response/found_exception_list_item_schema.mock.ts
@@ -5,8 +5,9 @@
* 2.0.
*/
+import type { FoundExceptionListItemSchema } from '@kbn/securitysolution-io-ts-list-types';
+
import { getExceptionListItemSchemaMock } from './exception_list_item_schema.mock';
-import { FoundExceptionListItemSchema } from './found_exception_list_item_schema';
export const getFoundExceptionListItemSchemaMock = (): FoundExceptionListItemSchema => ({
data: [getExceptionListItemSchemaMock()],
diff --git a/x-pack/plugins/lists/common/schemas/response/found_exception_list_schema.mock.ts b/x-pack/plugins/lists/common/schemas/response/found_exception_list_schema.mock.ts
index a27ff5cf76f08..e3611120348f4 100644
--- a/x-pack/plugins/lists/common/schemas/response/found_exception_list_schema.mock.ts
+++ b/x-pack/plugins/lists/common/schemas/response/found_exception_list_schema.mock.ts
@@ -5,8 +5,9 @@
* 2.0.
*/
+import type { FoundExceptionListSchema } from '@kbn/securitysolution-io-ts-list-types';
+
import { getExceptionListSchemaMock } from './exception_list_schema.mock';
-import { FoundExceptionListSchema } from './found_exception_list_schema';
export const getFoundExceptionListSchemaMock = (): FoundExceptionListSchema => ({
data: [getExceptionListSchemaMock()],
diff --git a/x-pack/plugins/lists/common/schemas/response/found_list_item_schema.mock.ts b/x-pack/plugins/lists/common/schemas/response/found_list_item_schema.mock.ts
index 1163e13f903b6..38d09810f9b34 100644
--- a/x-pack/plugins/lists/common/schemas/response/found_list_item_schema.mock.ts
+++ b/x-pack/plugins/lists/common/schemas/response/found_list_item_schema.mock.ts
@@ -5,7 +5,8 @@
* 2.0.
*/
-import { FoundListItemSchema } from './found_list_item_schema';
+import type { FoundListItemSchema } from '@kbn/securitysolution-io-ts-list-types';
+
import { getListItemResponseMock } from './list_item_schema.mock';
export const getFoundListItemSchemaMock = (): FoundListItemSchema => ({
diff --git a/x-pack/plugins/lists/common/schemas/response/found_list_item_schema.ts b/x-pack/plugins/lists/common/schemas/response/found_list_item_schema.ts
deleted file mode 100644
index 3f8d4a7b1b84c..0000000000000
--- a/x-pack/plugins/lists/common/schemas/response/found_list_item_schema.ts
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
- * or more contributor license agreements. Licensed under the Elastic License
- * 2.0; you may not use this file except in compliance with the Elastic License
- * 2.0.
- */
-
-import * as t from 'io-ts';
-
-import { cursor, page, per_page, total } from '../common/schemas';
-
-import { listItemSchema } from './list_item_schema';
-
-export const foundListItemSchema = t.exact(
- t.type({
- cursor,
- data: t.array(listItemSchema),
- page,
- per_page,
- total,
- })
-);
-
-export type FoundListItemSchema = t.TypeOf;
diff --git a/x-pack/plugins/lists/common/schemas/response/found_list_schema.mock.ts b/x-pack/plugins/lists/common/schemas/response/found_list_schema.mock.ts
index 94628da28ff5f..1691221842d39 100644
--- a/x-pack/plugins/lists/common/schemas/response/found_list_schema.mock.ts
+++ b/x-pack/plugins/lists/common/schemas/response/found_list_schema.mock.ts
@@ -5,7 +5,8 @@
* 2.0.
*/
-import { FoundListSchema } from './found_list_schema';
+import type { FoundListSchema } from '@kbn/securitysolution-io-ts-list-types';
+
import { getListResponseMock } from './list_schema.mock';
export const getFoundListSchemaMock = (): FoundListSchema => ({
diff --git a/x-pack/plugins/lists/common/schemas/response/found_list_schema.ts b/x-pack/plugins/lists/common/schemas/response/found_list_schema.ts
deleted file mode 100644
index d51e8b788281f..0000000000000
--- a/x-pack/plugins/lists/common/schemas/response/found_list_schema.ts
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
- * or more contributor license agreements. Licensed under the Elastic License
- * 2.0; you may not use this file except in compliance with the Elastic License
- * 2.0.
- */
-
-import * as t from 'io-ts';
-
-import { cursor, page, per_page, total } from '../common/schemas';
-
-import { listSchema } from './list_schema';
-
-export const foundListSchema = t.exact(
- t.type({
- cursor,
- data: t.array(listSchema),
- page,
- per_page,
- total,
- })
-);
-
-export type FoundListSchema = t.TypeOf;
diff --git a/x-pack/plugins/lists/common/schemas/response/list_item_index_exist_schema.mock.ts b/x-pack/plugins/lists/common/schemas/response/list_item_index_exist_schema.mock.ts
index 70c3f15e032cf..afbb03cab870d 100644
--- a/x-pack/plugins/lists/common/schemas/response/list_item_index_exist_schema.mock.ts
+++ b/x-pack/plugins/lists/common/schemas/response/list_item_index_exist_schema.mock.ts
@@ -5,7 +5,7 @@
* 2.0.
*/
-import { ListItemIndexExistSchema } from './list_item_index_exist_schema';
+import type { ListItemIndexExistSchema } from '@kbn/securitysolution-io-ts-list-types';
export const getListItemIndexExistSchemaResponseMock = (): ListItemIndexExistSchema => ({
list_index: true,
diff --git a/x-pack/plugins/lists/common/schemas/response/list_item_schema.mock.ts b/x-pack/plugins/lists/common/schemas/response/list_item_schema.mock.ts
index 5d630dd8f705d..908ee9feafcc2 100644
--- a/x-pack/plugins/lists/common/schemas/response/list_item_schema.mock.ts
+++ b/x-pack/plugins/lists/common/schemas/response/list_item_schema.mock.ts
@@ -5,7 +5,8 @@
* 2.0.
*/
-import { ListItemSchema } from '../../../common/schemas';
+import type { ListItemSchema } from '@kbn/securitysolution-io-ts-list-types';
+
import {
DATE_NOW,
ELASTIC_USER,
diff --git a/x-pack/plugins/lists/common/schemas/response/list_item_schema.ts b/x-pack/plugins/lists/common/schemas/response/list_item_schema.ts
deleted file mode 100644
index 3f11718bc42e6..0000000000000
--- a/x-pack/plugins/lists/common/schemas/response/list_item_schema.ts
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
- * or more contributor license agreements. Licensed under the Elastic License
- * 2.0; you may not use this file except in compliance with the Elastic License
- * 2.0.
- */
-
-import * as t from 'io-ts';
-import {
- created_at,
- created_by,
- id,
- metaOrUndefined,
- type,
- updated_at,
- updated_by,
-} from '@kbn/securitysolution-io-ts-list-types';
-
-import {
- _versionOrUndefined,
- deserializerOrUndefined,
- list_id,
- serializerOrUndefined,
- tie_breaker_id,
- value,
-} from '../common/schemas';
-
-export const listItemSchema = t.exact(
- t.type({
- _version: _versionOrUndefined,
- created_at,
- created_by,
- deserializer: deserializerOrUndefined,
- id,
- list_id,
- meta: metaOrUndefined,
- serializer: serializerOrUndefined,
- tie_breaker_id,
- type,
- updated_at,
- updated_by,
- value,
- })
-);
-
-export type ListItemSchema = t.TypeOf;
-
-export const listItemArraySchema = t.array(listItemSchema);
-export type ListItemArraySchema = t.TypeOf;
diff --git a/x-pack/plugins/lists/common/schemas/response/list_schema.mock.ts b/x-pack/plugins/lists/common/schemas/response/list_schema.mock.ts
index d1b7c022b3b7a..64afb1e73beaa 100644
--- a/x-pack/plugins/lists/common/schemas/response/list_schema.mock.ts
+++ b/x-pack/plugins/lists/common/schemas/response/list_schema.mock.ts
@@ -5,7 +5,8 @@
* 2.0.
*/
-import { ListSchema } from '../../../common/schemas';
+import type { ListSchema } from '@kbn/securitysolution-io-ts-list-types';
+
import {
DATE_NOW,
DESCRIPTION,
diff --git a/x-pack/plugins/lists/common/schemas/response/list_schema.ts b/x-pack/plugins/lists/common/schemas/response/list_schema.ts
deleted file mode 100644
index 5b478cd25daa6..0000000000000
--- a/x-pack/plugins/lists/common/schemas/response/list_schema.ts
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
- * or more contributor license agreements. Licensed under the Elastic License
- * 2.0; you may not use this file except in compliance with the Elastic License
- * 2.0.
- */
-
-import * as t from 'io-ts';
-import {
- created_at,
- created_by,
- description,
- id,
- metaOrUndefined,
- name,
- type,
- updated_at,
- updated_by,
-} from '@kbn/securitysolution-io-ts-list-types';
-import { version } from '@kbn/securitysolution-io-ts-types';
-
-import {
- _versionOrUndefined,
- deserializerOrUndefined,
- immutable,
- serializerOrUndefined,
- tie_breaker_id,
-} from '../common/schemas';
-
-export const listSchema = t.exact(
- t.type({
- _version: _versionOrUndefined,
- created_at,
- created_by,
- description,
- deserializer: deserializerOrUndefined,
- id,
- immutable,
- meta: metaOrUndefined,
- name,
- serializer: serializerOrUndefined,
- tie_breaker_id,
- type,
- updated_at,
- updated_by,
- version,
- })
-);
-
-export type ListSchema = t.TypeOf;
-
-export const listArraySchema = t.array(listSchema);
-export type ListArraySchema = t.TypeOf;
diff --git a/x-pack/plugins/lists/common/schemas/response/search_list_item_schema.mock.ts b/x-pack/plugins/lists/common/schemas/response/search_list_item_schema.mock.ts
index 6f86102484bb7..d51f454eb3d40 100644
--- a/x-pack/plugins/lists/common/schemas/response/search_list_item_schema.mock.ts
+++ b/x-pack/plugins/lists/common/schemas/response/search_list_item_schema.mock.ts
@@ -5,7 +5,8 @@
* 2.0.
*/
-import { SearchListItemSchema } from '../../../common/schemas';
+import type { SearchListItemSchema } from '@kbn/securitysolution-io-ts-list-types';
+
import { VALUE } from '../../../common/constants.mock';
import { getListItemResponseMock } from './list_item_schema.mock';
diff --git a/x-pack/plugins/lists/common/schemas/types/comment.mock.ts b/x-pack/plugins/lists/common/schemas/types/comment.mock.ts
index 5963cb4947a85..cb6e30af7da8c 100644
--- a/x-pack/plugins/lists/common/schemas/types/comment.mock.ts
+++ b/x-pack/plugins/lists/common/schemas/types/comment.mock.ts
@@ -5,7 +5,7 @@
* 2.0.
*/
-import { Comment, CommentsArray } from '@kbn/securitysolution-io-ts-list-types';
+import type { Comment, CommentsArray } from '@kbn/securitysolution-io-ts-list-types';
import { DATE_NOW, ID, USER } from '../../constants.mock';
diff --git a/x-pack/plugins/lists/common/schemas/types/create_comment.mock.ts b/x-pack/plugins/lists/common/schemas/types/create_comment.mock.ts
index 868c43fe5d6da..f8d67f4f2c15d 100644
--- a/x-pack/plugins/lists/common/schemas/types/create_comment.mock.ts
+++ b/x-pack/plugins/lists/common/schemas/types/create_comment.mock.ts
@@ -5,7 +5,7 @@
* 2.0.
*/
-import { CreateComment, CreateCommentsArray } from '@kbn/securitysolution-io-ts-list-types';
+import type { CreateComment, CreateCommentsArray } from '@kbn/securitysolution-io-ts-list-types';
export const getCreateCommentsMock = (): CreateComment => ({
comment: 'some comments',
diff --git a/x-pack/plugins/lists/common/schemas/types/entries.mock.ts b/x-pack/plugins/lists/common/schemas/types/entries.mock.ts
index caa62c55c93bb..7f1c759c37577 100644
--- a/x-pack/plugins/lists/common/schemas/types/entries.mock.ts
+++ b/x-pack/plugins/lists/common/schemas/types/entries.mock.ts
@@ -5,7 +5,7 @@
* 2.0.
*/
-import { EntriesArray } from '@kbn/securitysolution-io-ts-list-types';
+import type { EntriesArray } from '@kbn/securitysolution-io-ts-list-types';
import { getEntryMatchMock } from './entry_match.mock';
import { getEntryMatchAnyMock } from './entry_match_any.mock';
diff --git a/x-pack/plugins/lists/common/schemas/types/entry_exists.mock.ts b/x-pack/plugins/lists/common/schemas/types/entry_exists.mock.ts
index 6165184d2a404..a592bf0fdd4b4 100644
--- a/x-pack/plugins/lists/common/schemas/types/entry_exists.mock.ts
+++ b/x-pack/plugins/lists/common/schemas/types/entry_exists.mock.ts
@@ -5,7 +5,7 @@
* 2.0.
*/
-import { EntryExists } from '@kbn/securitysolution-io-ts-list-types';
+import type { EntryExists } from '@kbn/securitysolution-io-ts-list-types';
import { EXISTS, FIELD, OPERATOR } from '../../constants.mock';
diff --git a/x-pack/plugins/lists/common/schemas/types/entry_list.mock.ts b/x-pack/plugins/lists/common/schemas/types/entry_list.mock.ts
index 1cdc86d95ed88..3ab5d6ec17c39 100644
--- a/x-pack/plugins/lists/common/schemas/types/entry_list.mock.ts
+++ b/x-pack/plugins/lists/common/schemas/types/entry_list.mock.ts
@@ -5,7 +5,7 @@
* 2.0.
*/
-import { EntryList } from '@kbn/securitysolution-io-ts-list-types';
+import type { EntryList } from '@kbn/securitysolution-io-ts-list-types';
import { FIELD, LIST, LIST_ID, OPERATOR, TYPE } from '../../constants.mock';
diff --git a/x-pack/plugins/lists/common/schemas/types/entry_match.mock.ts b/x-pack/plugins/lists/common/schemas/types/entry_match.mock.ts
index efcd1e0877d1b..b969e5ceb218e 100644
--- a/x-pack/plugins/lists/common/schemas/types/entry_match.mock.ts
+++ b/x-pack/plugins/lists/common/schemas/types/entry_match.mock.ts
@@ -5,7 +5,7 @@
* 2.0.
*/
-import { EntryMatch } from '@kbn/securitysolution-io-ts-list-types';
+import type { EntryMatch } from '@kbn/securitysolution-io-ts-list-types';
import { ENTRY_VALUE, FIELD, MATCH, OPERATOR } from '../../constants.mock';
diff --git a/x-pack/plugins/lists/common/schemas/types/entry_match_any.mock.ts b/x-pack/plugins/lists/common/schemas/types/entry_match_any.mock.ts
index 60613fc72baba..c06df97257900 100644
--- a/x-pack/plugins/lists/common/schemas/types/entry_match_any.mock.ts
+++ b/x-pack/plugins/lists/common/schemas/types/entry_match_any.mock.ts
@@ -5,7 +5,7 @@
* 2.0.
*/
-import { EntryMatchAny } from '@kbn/securitysolution-io-ts-list-types';
+import type { EntryMatchAny } from '@kbn/securitysolution-io-ts-list-types';
import { ENTRY_VALUE, FIELD, MATCH_ANY, OPERATOR } from '../../constants.mock';
diff --git a/x-pack/plugins/lists/common/schemas/types/entry_nested.mock.ts b/x-pack/plugins/lists/common/schemas/types/entry_nested.mock.ts
index 2497c3d4c3ce2..d0d0a36700982 100644
--- a/x-pack/plugins/lists/common/schemas/types/entry_nested.mock.ts
+++ b/x-pack/plugins/lists/common/schemas/types/entry_nested.mock.ts
@@ -5,7 +5,7 @@
* 2.0.
*/
-import { EntryNested } from '@kbn/securitysolution-io-ts-list-types';
+import type { EntryNested } from '@kbn/securitysolution-io-ts-list-types';
import { NESTED, NESTED_FIELD } from '../../constants.mock';
diff --git a/x-pack/plugins/lists/common/schemas/types/update_comment.mock.ts b/x-pack/plugins/lists/common/schemas/types/update_comment.mock.ts
index 783b595850bc5..e37ba69f8e308 100644
--- a/x-pack/plugins/lists/common/schemas/types/update_comment.mock.ts
+++ b/x-pack/plugins/lists/common/schemas/types/update_comment.mock.ts
@@ -5,7 +5,7 @@
* 2.0.
*/
-import { UpdateComment, UpdateCommentsArray } from '@kbn/securitysolution-io-ts-list-types';
+import type { UpdateComment, UpdateCommentsArray } from '@kbn/securitysolution-io-ts-list-types';
import { ID } from '../../constants.mock';
diff --git a/x-pack/plugins/lists/common/shared_exports.ts b/x-pack/plugins/lists/common/shared_exports.ts
index 3f1dc01644e21..6baa46ac5b842 100644
--- a/x-pack/plugins/lists/common/shared_exports.ts
+++ b/x-pack/plugins/lists/common/shared_exports.ts
@@ -5,15 +5,6 @@
* 2.0.
*/
-export type {
- ListSchema,
- ExceptionListSchema,
- ExceptionListItemSchema,
- CreateExceptionListSchema,
- CreateExceptionListItemSchema,
- UpdateExceptionListItemSchema,
-} from './schemas';
-
export { buildExceptionFilter } from './exceptions';
export {
diff --git a/x-pack/plugins/lists/public/exceptions/api.ts b/x-pack/plugins/lists/public/exceptions/api.ts
index e97530da7904a..19c19c7e2c1ed 100644
--- a/x-pack/plugins/lists/public/exceptions/api.ts
+++ b/x-pack/plugins/lists/public/exceptions/api.ts
@@ -8,15 +8,6 @@
import { chain, fromEither, tryCatch } from 'fp-ts/lib/TaskEither';
import { flow } from 'fp-ts/lib/function';
import { validateEither } from '@kbn/securitysolution-io-ts-utils';
-
-import { toError, toPromise } from '../common/fp_utils';
-import {
- ENDPOINT_LIST_URL,
- EXCEPTION_LIST_ITEM_URL,
- EXCEPTION_LIST_NAMESPACE,
- EXCEPTION_LIST_NAMESPACE_AGNOSTIC,
- EXCEPTION_LIST_URL,
-} from '../../common/constants';
import {
CreateEndpointListSchema,
ExceptionListItemSchema,
@@ -28,7 +19,16 @@ import {
exceptionListSchema,
foundExceptionListItemSchema,
foundExceptionListSchema,
-} from '../../common/schemas';
+} from '@kbn/securitysolution-io-ts-list-types';
+
+import { toError, toPromise } from '../common/fp_utils';
+import {
+ ENDPOINT_LIST_URL,
+ EXCEPTION_LIST_ITEM_URL,
+ EXCEPTION_LIST_NAMESPACE,
+ EXCEPTION_LIST_NAMESPACE_AGNOSTIC,
+ EXCEPTION_LIST_URL,
+} from '../../common/constants';
import {
AddEndpointExceptionListProps,
diff --git a/x-pack/plugins/lists/public/exceptions/components/autocomplete/field_value_lists.test.tsx b/x-pack/plugins/lists/public/exceptions/components/autocomplete/field_value_lists.test.tsx
index a5588b36aae03..8090aa7484bee 100644
--- a/x-pack/plugins/lists/public/exceptions/components/autocomplete/field_value_lists.test.tsx
+++ b/x-pack/plugins/lists/public/exceptions/components/autocomplete/field_value_lists.test.tsx
@@ -9,10 +9,10 @@ import React from 'react';
import { mount } from 'enzyme';
import { EuiComboBox, EuiComboBoxOptionOption } from '@elastic/eui';
import { waitFor } from '@testing-library/react';
+import type { ListSchema } from '@kbn/securitysolution-io-ts-list-types';
import { coreMock } from '../../../../../../../src/core/public/mocks';
import { getField } from '../../../../../../../src/plugins/data/common/index_patterns/fields/fields.mocks';
-import { ListSchema } from '../../../../common';
import { getFoundListSchemaMock } from '../../../../../lists/common/schemas/response/found_list_schema.mock';
import { getListResponseMock } from '../../../../../lists/common/schemas/response/list_schema.mock';
import { DATE_NOW, IMMUTABLE, VERSION } from '../../../../../lists/common/constants.mock';
diff --git a/x-pack/plugins/lists/public/exceptions/components/autocomplete/field_value_lists.tsx b/x-pack/plugins/lists/public/exceptions/components/autocomplete/field_value_lists.tsx
index 3d910403d4843..d6b9ccd57e89e 100644
--- a/x-pack/plugins/lists/public/exceptions/components/autocomplete/field_value_lists.tsx
+++ b/x-pack/plugins/lists/public/exceptions/components/autocomplete/field_value_lists.tsx
@@ -8,8 +8,8 @@
import React, { useCallback, useEffect, useMemo, useState } from 'react';
import { EuiComboBox, EuiComboBoxOptionOption, EuiFormRow } from '@elastic/eui';
import { HttpStart } from 'kibana/public';
+import type { ListSchema } from '@kbn/securitysolution-io-ts-list-types';
-import { ListSchema } from '../../../../common';
import { IFieldType } from '../../../../../../../src/plugins/data/common';
import { useFindLists } from '../../..';
diff --git a/x-pack/plugins/lists/public/exceptions/components/autocomplete/helpers.test.ts b/x-pack/plugins/lists/public/exceptions/components/autocomplete/helpers.test.ts
index 2fed462974a26..21764c6f459d8 100644
--- a/x-pack/plugins/lists/public/exceptions/components/autocomplete/helpers.test.ts
+++ b/x-pack/plugins/lists/public/exceptions/components/autocomplete/helpers.test.ts
@@ -6,20 +6,20 @@
*/
import moment from 'moment';
-
-import { getField } from '../../../../../../../src/plugins/data/common/index_patterns/fields/fields.mocks';
-import { IFieldType } from '../../../../../../../src/plugins/data/common';
-import { getListResponseMock } from '../../../../../lists/common/schemas/response/list_schema.mock';
-import { ListSchema } from '../../../../common';
-
-import * as i18n from './translations';
+import type { ListSchema } from '@kbn/securitysolution-io-ts-list-types';
import {
EXCEPTION_OPERATORS,
doesNotExistOperator,
existsOperator,
isNotOperator,
isOperator,
-} from './operators';
+} from '@kbn/securitysolution-list-utils';
+
+import { getField } from '../../../../../../../src/plugins/data/common/index_patterns/fields/fields.mocks';
+import { IFieldType } from '../../../../../../../src/plugins/data/common';
+import { getListResponseMock } from '../../../../../lists/common/schemas/response/list_schema.mock';
+
+import * as i18n from './translations';
import {
checkEmptyValue,
filterFieldToList,
diff --git a/x-pack/plugins/lists/public/exceptions/components/autocomplete/helpers.ts b/x-pack/plugins/lists/public/exceptions/components/autocomplete/helpers.ts
index b982193d1d349..965214815eedf 100644
--- a/x-pack/plugins/lists/public/exceptions/components/autocomplete/helpers.ts
+++ b/x-pack/plugins/lists/public/exceptions/components/autocomplete/helpers.ts
@@ -7,18 +7,17 @@
import dateMath from '@elastic/datemath';
import { EuiComboBoxOptionOption } from '@elastic/eui';
-import type { Type } from '@kbn/securitysolution-io-ts-list-types';
-
-import type { ListSchema } from '../../../../common';
-import { IFieldType } from '../../../../../../../src/plugins/data/common';
-
+import type { ListSchema, Type } from '@kbn/securitysolution-io-ts-list-types';
import {
EXCEPTION_OPERATORS,
doesNotExistOperator,
existsOperator,
isNotOperator,
isOperator,
-} from './operators';
+} from '@kbn/securitysolution-list-utils';
+
+import { IFieldType } from '../../../../../../../src/plugins/data/common';
+
import { GetGenericComboBoxPropsReturn, OperatorOption } from './types';
import * as i18n from './translations';
diff --git a/x-pack/plugins/lists/public/exceptions/components/autocomplete/operator.test.tsx b/x-pack/plugins/lists/public/exceptions/components/autocomplete/operator.test.tsx
index 1d033272197ca..dadde8800b67f 100644
--- a/x-pack/plugins/lists/public/exceptions/components/autocomplete/operator.test.tsx
+++ b/x-pack/plugins/lists/public/exceptions/components/autocomplete/operator.test.tsx
@@ -8,11 +8,11 @@
import React from 'react';
import { mount } from 'enzyme';
import { EuiComboBox, EuiComboBoxOptionOption } from '@elastic/eui';
+import { isNotOperator, isOperator } from '@kbn/securitysolution-list-utils';
import { getField } from '../../../../../../../src/plugins/data/common/index_patterns/fields/fields.mocks';
import { OperatorComponent } from './operator';
-import { isNotOperator, isOperator } from './operators';
describe('OperatorComponent', () => {
test('it renders disabled if "isDisabled" is true', () => {
diff --git a/x-pack/plugins/lists/public/exceptions/components/builder/entry_delete_button.tsx b/x-pack/plugins/lists/public/exceptions/components/builder/entry_delete_button.tsx
index 01739bd3f85cb..b30bcd9ae1621 100644
--- a/x-pack/plugins/lists/public/exceptions/components/builder/entry_delete_button.tsx
+++ b/x-pack/plugins/lists/public/exceptions/components/builder/entry_delete_button.tsx
@@ -8,8 +8,7 @@
import React, { useCallback } from 'react';
import { EuiButtonIcon, EuiFlexItem } from '@elastic/eui';
import styled from 'styled-components';
-
-import { BuilderEntry } from './types';
+import type { BuilderEntry } from '@kbn/securitysolution-list-utils';
const MyFirstRowContainer = styled(EuiFlexItem)`
padding-top: 20px;
diff --git a/x-pack/plugins/lists/public/exceptions/components/builder/entry_renderer.test.tsx b/x-pack/plugins/lists/public/exceptions/components/builder/entry_renderer.test.tsx
index 1396a47b64713..616757eb5b674 100644
--- a/x-pack/plugins/lists/public/exceptions/components/builder/entry_renderer.test.tsx
+++ b/x-pack/plugins/lists/public/exceptions/components/builder/entry_renderer.test.tsx
@@ -9,7 +9,6 @@ import { ReactWrapper, mount } from 'enzyme';
import React from 'react';
import { EuiComboBox, EuiComboBoxOptionOption } from '@elastic/eui';
import { waitFor } from '@testing-library/dom';
-
import {
doesNotExistOperator,
existsOperator,
@@ -19,7 +18,8 @@ import {
isNotOperator,
isOneOfOperator,
isOperator,
-} from '../autocomplete/operators';
+} from '@kbn/securitysolution-list-utils';
+
import {
fields,
getField,
diff --git a/x-pack/plugins/lists/public/exceptions/components/builder/entry_renderer.tsx b/x-pack/plugins/lists/public/exceptions/components/builder/entry_renderer.tsx
index 09863660e98af..7daef8467dd1a 100644
--- a/x-pack/plugins/lists/public/exceptions/components/builder/entry_renderer.tsx
+++ b/x-pack/plugins/lists/public/exceptions/components/builder/entry_renderer.tsx
@@ -10,9 +10,22 @@ import { EuiFlexGroup, EuiFlexItem, EuiFormRow } from '@elastic/eui';
import styled from 'styled-components';
import {
ExceptionListType,
+ ListSchema,
ListOperatorTypeEnum as OperatorTypeEnum,
OsTypeArray,
} from '@kbn/securitysolution-io-ts-list-types';
+import {
+ BuilderEntry,
+ EXCEPTION_OPERATORS_ONLY_LISTS,
+ FormattedBuilderEntry,
+ getEntryOnFieldChange,
+ getEntryOnListChange,
+ getEntryOnMatchAnyChange,
+ getEntryOnMatchChange,
+ getEntryOnOperatorChange,
+ getFilteredIndexPatterns,
+ getOperatorOptions,
+} from '@kbn/securitysolution-list-utils';
import { AutocompleteStart } from '../../../../../../../src/plugins/data/public';
import { IFieldType, IIndexPattern } from '../../../../../../../src/plugins/data/common';
@@ -20,24 +33,12 @@ import { HttpStart } from '../../../../../../../src/core/public';
import { FieldComponent } from '../autocomplete/field';
import { OperatorComponent } from '../autocomplete/operator';
import { OperatorOption } from '../autocomplete/types';
-import { EXCEPTION_OPERATORS_ONLY_LISTS } from '../autocomplete/operators';
import { AutocompleteFieldExistsComponent } from '../autocomplete/field_value_exists';
import { AutocompleteFieldMatchComponent } from '../autocomplete/field_value_match';
import { AutocompleteFieldMatchAnyComponent } from '../autocomplete/field_value_match_any';
import { AutocompleteFieldListsComponent } from '../autocomplete/field_value_lists';
-import { ListSchema } from '../../../../common';
import { getEmptyValue } from '../../../common/empty_value';
-import {
- getEntryOnFieldChange,
- getEntryOnListChange,
- getEntryOnMatchAnyChange,
- getEntryOnMatchChange,
- getEntryOnOperatorChange,
- getFilteredIndexPatterns,
- getOperatorOptions,
-} from './helpers';
-import { BuilderEntry, FormattedBuilderEntry } from './types';
import * as i18n from './translations';
const MyValuesInput = styled(EuiFlexItem)`
diff --git a/x-pack/plugins/lists/public/exceptions/components/builder/exception_item_renderer.tsx b/x-pack/plugins/lists/public/exceptions/components/builder/exception_item_renderer.tsx
index e10cd2934328f..eee5b8b1e992d 100644
--- a/x-pack/plugins/lists/public/exceptions/components/builder/exception_item_renderer.tsx
+++ b/x-pack/plugins/lists/public/exceptions/components/builder/exception_item_renderer.tsx
@@ -11,14 +11,19 @@ import styled from 'styled-components';
import { HttpStart } from 'kibana/public';
import { AutocompleteStart } from 'src/plugins/data/public';
import { ExceptionListType, OsTypeArray } from '@kbn/securitysolution-io-ts-list-types';
+import {
+ BuilderEntry,
+ ExceptionsBuilderExceptionItem,
+ FormattedBuilderEntry,
+ getFormattedBuilderEntries,
+ getUpdatedEntriesOnDelete,
+} from '@kbn/securitysolution-list-utils';
import { IIndexPattern } from '../../../../../../../src/plugins/data/common';
-import { BuilderEntry, ExceptionsBuilderExceptionItem, FormattedBuilderEntry } from './types';
import { BuilderAndBadgeComponent } from './and_badge';
import { BuilderEntryDeleteButtonComponent } from './entry_delete_button';
import { BuilderEntryItem } from './entry_renderer';
-import { getFormattedBuilderEntries, getUpdatedEntriesOnDelete } from './helpers';
const MyBeautifulLine = styled(EuiFlexItem)`
&:after {
diff --git a/x-pack/plugins/lists/public/exceptions/components/builder/exception_items_renderer.tsx b/x-pack/plugins/lists/public/exceptions/components/builder/exception_items_renderer.tsx
index 6058d4f7b725b..1b68ef07657a8 100644
--- a/x-pack/plugins/lists/public/exceptions/components/builder/exception_items_renderer.tsx
+++ b/x-pack/plugins/lists/public/exceptions/components/builder/exception_items_renderer.tsx
@@ -11,33 +11,32 @@ import styled from 'styled-components';
import { HttpStart } from 'kibana/public';
import { addIdToItem } from '@kbn/securitysolution-utils';
import {
+ CreateExceptionListItemSchema,
+ ExceptionListItemSchema,
ExceptionListType,
NamespaceType,
ListOperatorEnum as OperatorEnum,
ListOperatorTypeEnum as OperatorTypeEnum,
OsTypeArray,
entriesNested,
+ exceptionListItemSchema,
} from '@kbn/securitysolution-io-ts-list-types';
-
import {
- CreateExceptionListItemSchema,
- ExceptionListItemSchema,
- exceptionListItemSchema,
-} from '../../../../common/schemas';
+ CreateExceptionListItemBuilderSchema,
+ ExceptionsBuilderExceptionItem,
+ containsValueListEntry,
+ filterExceptionItems,
+ getDefaultEmptyEntry,
+ getDefaultNestedEmptyEntry,
+ getNewExceptionItem,
+} from '@kbn/securitysolution-list-utils';
+
import { AutocompleteStart, IIndexPattern } from '../../../../../../../src/plugins/data/public';
import { AndOrBadge } from '../and_or_badge';
-import { CreateExceptionListItemBuilderSchema, ExceptionsBuilderExceptionItem } from './types';
import { BuilderExceptionListItemComponent } from './exception_item_renderer';
import { BuilderLogicButtons } from './logic_buttons';
import { State, exceptionsBuilderReducer } from './reducer';
-import {
- containsValueListEntry,
- filterExceptionItems,
- getDefaultEmptyEntry,
- getDefaultNestedEmptyEntry,
- getNewExceptionItem,
-} from './helpers';
const MyInvisibleAndBadge = styled(EuiFlexItem)`
visibility: hidden;
diff --git a/x-pack/plugins/lists/public/exceptions/components/builder/helpers.test.ts b/x-pack/plugins/lists/public/exceptions/components/builder/helpers.test.ts
index dbfeaa4a258ca..ec46038c397e5 100644
--- a/x-pack/plugins/lists/public/exceptions/components/builder/helpers.test.ts
+++ b/x-pack/plugins/lists/public/exceptions/components/builder/helpers.test.ts
@@ -6,51 +6,26 @@
*/
import {
+ CreateExceptionListItemSchema,
EntryExists,
EntryList,
EntryMatch,
EntryMatchAny,
EntryNested,
+ ExceptionListItemSchema,
ExceptionListType,
ListOperatorEnum as OperatorEnum,
ListOperatorTypeEnum as OperatorTypeEnum,
} from '@kbn/securitysolution-io-ts-list-types';
-
-import { CreateExceptionListItemSchema, ExceptionListItemSchema } from '../../../../common';
-import { ENTRIES_WITH_IDS } from '../../../../common/constants.mock';
-import { getEntryExistsMock } from '../../../../common/schemas/types/entry_exists.mock';
-import { getExceptionListItemSchemaMock } from '../../../../common/schemas/response/exception_list_item_schema.mock';
-import {
- fields,
- getField,
-} from '../../../../../../../src/plugins/data/common/index_patterns/fields/fields.mocks';
-import { IFieldType, IIndexPattern } from '../../../../../../../src/plugins/data/common';
-import { getEntryNestedMock } from '../../../../common/schemas/types/entry_nested.mock';
-import { getEntryMatchMock } from '../../../../common/schemas/types/entry_match.mock';
-import { getEntryMatchAnyMock } from '../../../../common/schemas/types/entry_match_any.mock';
-import { getListResponseMock } from '../../../../common/schemas/response/list_schema.mock';
import {
+ BuilderEntry,
EXCEPTION_OPERATORS,
EXCEPTION_OPERATORS_SANS_LISTS,
- doesNotExistOperator,
- existsOperator,
- isInListOperator,
- isNotInListOperator,
- isNotOneOfOperator,
- isNotOperator,
- isOneOfOperator,
- isOperator,
-} from '../autocomplete/operators';
-import { OperatorOption } from '../autocomplete/types';
-import { getEntryListMock } from '../../../../common/schemas/types/entry_list.mock';
-
-import {
- BuilderEntry,
EmptyEntry,
ExceptionsBuilderExceptionItem,
FormattedBuilderEntry,
-} from './types';
-import {
+ doesNotExistOperator,
+ existsOperator,
filterExceptionItems,
getCorrespondingKeywordField,
getEntryFromOperator,
@@ -69,7 +44,30 @@ import {
getOperatorType,
getUpdatedEntriesOnDelete,
isEntryNested,
-} from './helpers';
+ isInListOperator,
+ isNotInListOperator,
+ isNotOneOfOperator,
+ isNotOperator,
+ isOneOfOperator,
+ isOperator,
+} from '@kbn/securitysolution-list-utils';
+
+import { ENTRIES_WITH_IDS } from '../../../../common/constants.mock';
+import { getEntryExistsMock } from '../../../../common/schemas/types/entry_exists.mock';
+import { getExceptionListItemSchemaMock } from '../../../../common/schemas/response/exception_list_item_schema.mock';
+import {
+ fields,
+ getField,
+} from '../../../../../../../src/plugins/data/common/index_patterns/fields/fields.mocks';
+import { IFieldType, IIndexPattern } from '../../../../../../../src/plugins/data/common';
+import { getEntryNestedMock } from '../../../../common/schemas/types/entry_nested.mock';
+import { getEntryMatchMock } from '../../../../common/schemas/types/entry_match.mock';
+import { getEntryMatchAnyMock } from '../../../../common/schemas/types/entry_match_any.mock';
+import { getListResponseMock } from '../../../../common/schemas/response/list_schema.mock';
+import { OperatorOption } from '../autocomplete/types';
+import { getEntryListMock } from '../../../../common/schemas/types/entry_list.mock';
+
+// TODO: ALL THESE TESTS SHOULD BE MOVED TO @kbn/securitysolution-list-utils for its helper. The only reason why they're here is due to missing other packages we hae to create or missing things from kbn packages such as mocks from kibana core
jest.mock('uuid', () => ({
v4: jest.fn().mockReturnValue('123'),
diff --git a/x-pack/plugins/lists/public/exceptions/components/builder/reducer.ts b/x-pack/plugins/lists/public/exceptions/components/builder/reducer.ts
index 0e8a5fadd3b1a..14744bc5cc773 100644
--- a/x-pack/plugins/lists/public/exceptions/components/builder/reducer.ts
+++ b/x-pack/plugins/lists/public/exceptions/components/builder/reducer.ts
@@ -5,12 +5,14 @@
* 2.0.
*/
-import { ListOperatorTypeEnum as OperatorTypeEnum } from '@kbn/securitysolution-io-ts-list-types';
-
-import { ExceptionListItemSchema } from '../../../../common';
-
-import { ExceptionsBuilderExceptionItem } from './types';
-import { getDefaultEmptyEntry } from './helpers';
+import {
+ ExceptionListItemSchema,
+ ListOperatorTypeEnum as OperatorTypeEnum,
+} from '@kbn/securitysolution-io-ts-list-types';
+import {
+ ExceptionsBuilderExceptionItem,
+ getDefaultEmptyEntry,
+} from '@kbn/securitysolution-list-utils';
export type ViewerModalName = 'addModal' | 'editModal' | null;
diff --git a/x-pack/plugins/lists/public/exceptions/hooks/persist_exception_item.ts b/x-pack/plugins/lists/public/exceptions/hooks/persist_exception_item.ts
index 6135d14aef6a4..0ed3668b94c0c 100644
--- a/x-pack/plugins/lists/public/exceptions/hooks/persist_exception_item.ts
+++ b/x-pack/plugins/lists/public/exceptions/hooks/persist_exception_item.ts
@@ -6,11 +6,11 @@
*/
import { Dispatch, useEffect, useState } from 'react';
-
-import {
+import type {
CreateExceptionListItemSchema,
UpdateExceptionListItemSchema,
-} from '../../../common/schemas';
+} from '@kbn/securitysolution-io-ts-list-types';
+
import { addExceptionListItem, updateExceptionListItem } from '../api';
import { transformNewItemOutput, transformOutput } from '../transforms';
import { PersistHookProps } from '../types';
diff --git a/x-pack/plugins/lists/public/exceptions/hooks/persist_exception_list.ts b/x-pack/plugins/lists/public/exceptions/hooks/persist_exception_list.ts
index aef87569e7284..eccd8532a7e2f 100644
--- a/x-pack/plugins/lists/public/exceptions/hooks/persist_exception_list.ts
+++ b/x-pack/plugins/lists/public/exceptions/hooks/persist_exception_list.ts
@@ -6,8 +6,8 @@
*/
import { Dispatch, useEffect, useState } from 'react';
+import type { UpdateExceptionListSchema } from '@kbn/securitysolution-io-ts-list-types';
-import { UpdateExceptionListSchema } from '../../../common/schemas';
import { addExceptionList, updateExceptionList } from '../api';
import { AddExceptionList, PersistHookProps } from '../types';
diff --git a/x-pack/plugins/lists/public/exceptions/hooks/use_api.ts b/x-pack/plugins/lists/public/exceptions/hooks/use_api.ts
index 9e4e338b09dbf..6e04827dad60b 100644
--- a/x-pack/plugins/lists/public/exceptions/hooks/use_api.ts
+++ b/x-pack/plugins/lists/public/exceptions/hooks/use_api.ts
@@ -6,15 +6,15 @@
*/
import { useMemo } from 'react';
-
-import * as Api from '../api';
-import { HttpStart } from '../../../../../../src/core/public';
-import {
+import type {
CreateExceptionListItemSchema,
ExceptionListItemSchema,
ExceptionListSchema,
UpdateExceptionListItemSchema,
-} from '../../../common/schemas';
+} from '@kbn/securitysolution-io-ts-list-types';
+
+import * as Api from '../api';
+import { HttpStart } from '../../../../../../src/core/public';
import { ApiCallFindListsItemsMemoProps, ApiCallMemoProps, ApiListExportProps } from '../types';
import { getIdsAndNamespaces } from '../utils';
import { transformInput, transformNewItemOutput, transformOutput } from '../transforms';
diff --git a/x-pack/plugins/lists/public/exceptions/hooks/use_exception_list_items.test.ts b/x-pack/plugins/lists/public/exceptions/hooks/use_exception_list_items.test.ts
index 1191b240d27bb..97c60d1ba80f2 100644
--- a/x-pack/plugins/lists/public/exceptions/hooks/use_exception_list_items.test.ts
+++ b/x-pack/plugins/lists/public/exceptions/hooks/use_exception_list_items.test.ts
@@ -6,11 +6,11 @@
*/
import { act, renderHook } from '@testing-library/react-hooks';
+import type { ExceptionListItemSchema } from '@kbn/securitysolution-io-ts-list-types';
import { coreMock } from '../../../../../../src/core/public/mocks';
import * as api from '../api';
import { getFoundExceptionListItemSchemaMock } from '../../../common/schemas/response/found_exception_list_item_schema.mock';
-import { ExceptionListItemSchema } from '../../../common/schemas';
import { UseExceptionListItemsSuccess, UseExceptionListProps } from '../types';
import { transformInput } from '../transforms';
diff --git a/x-pack/plugins/lists/public/exceptions/hooks/use_exception_list_items.ts b/x-pack/plugins/lists/public/exceptions/hooks/use_exception_list_items.ts
index b9a8628d2ceac..52fbccc376012 100644
--- a/x-pack/plugins/lists/public/exceptions/hooks/use_exception_list_items.ts
+++ b/x-pack/plugins/lists/public/exceptions/hooks/use_exception_list_items.ts
@@ -6,10 +6,10 @@
*/
import { useEffect, useRef, useState } from 'react';
+import type { ExceptionListItemSchema } from '@kbn/securitysolution-io-ts-list-types';
import { fetchExceptionListsItemsByListIds } from '../api';
import { FilterExceptionsOptions, Pagination, UseExceptionListProps } from '../types';
-import { ExceptionListItemSchema } from '../../../common/schemas';
import { getIdsAndNamespaces } from '../utils';
import { transformInput } from '../transforms';
diff --git a/x-pack/plugins/lists/public/exceptions/hooks/use_exception_lists.test.ts b/x-pack/plugins/lists/public/exceptions/hooks/use_exception_lists.test.ts
index 7fdf861543117..ce737c5163d08 100644
--- a/x-pack/plugins/lists/public/exceptions/hooks/use_exception_lists.test.ts
+++ b/x-pack/plugins/lists/public/exceptions/hooks/use_exception_lists.test.ts
@@ -6,11 +6,11 @@
*/
import { act, renderHook } from '@testing-library/react-hooks';
+import type { ExceptionListSchema } from '@kbn/securitysolution-io-ts-list-types';
import { coreMock } from '../../../../../../src/core/public/mocks';
import * as api from '../api';
import { getFoundExceptionListSchemaMock } from '../../../common/schemas/response/found_exception_list_schema.mock';
-import { ExceptionListSchema } from '../../../common/schemas';
import { UseExceptionListsProps } from '../types';
import { ReturnExceptionLists, useExceptionLists } from './use_exception_lists';
diff --git a/x-pack/plugins/lists/public/exceptions/hooks/use_exception_lists.ts b/x-pack/plugins/lists/public/exceptions/hooks/use_exception_lists.ts
index 0a39cf5ba437f..31f4106c3afbb 100644
--- a/x-pack/plugins/lists/public/exceptions/hooks/use_exception_lists.ts
+++ b/x-pack/plugins/lists/public/exceptions/hooks/use_exception_lists.ts
@@ -6,10 +6,10 @@
*/
import { useEffect, useMemo, useRef, useState } from 'react';
+import type { ExceptionListSchema } from '@kbn/securitysolution-io-ts-list-types';
import { fetchExceptionLists } from '../api';
import { Pagination, UseExceptionListsProps } from '../types';
-import { ExceptionListSchema } from '../../../common/schemas';
import { getFilters } from '../utils';
export type Func = () => void;
diff --git a/x-pack/plugins/lists/public/exceptions/transforms.test.ts b/x-pack/plugins/lists/public/exceptions/transforms.test.ts
index b2a1efc1d2c1d..2586571e88c4c 100644
--- a/x-pack/plugins/lists/public/exceptions/transforms.test.ts
+++ b/x-pack/plugins/lists/public/exceptions/transforms.test.ts
@@ -5,11 +5,15 @@
* 2.0.
*/
-import { Entry, EntryMatch, EntryNested } from '@kbn/securitysolution-io-ts-list-types';
+import type {
+ CreateExceptionListItemSchema,
+ Entry,
+ EntryMatch,
+ EntryNested,
+ ExceptionListItemSchema,
+ UpdateExceptionListItemSchema,
+} from '@kbn/securitysolution-io-ts-list-types';
-import { ExceptionListItemSchema } from '../../common/schemas/response/exception_list_item_schema';
-import { UpdateExceptionListItemSchema } from '../../common/schemas/request/update_exception_list_item_schema';
-import { CreateExceptionListItemSchema } from '../../common/schemas/request/create_exception_list_item_schema';
import { getCreateExceptionListItemSchemaMock } from '../../common/schemas/request/create_exception_list_item_schema.mock';
import { getUpdateExceptionListItemSchemaMock } from '../../common/schemas/request/update_exception_list_item_schema.mock';
import { getExceptionListItemSchemaMock } from '../../common/schemas/response/exception_list_item_schema.mock';
diff --git a/x-pack/plugins/lists/public/exceptions/transforms.ts b/x-pack/plugins/lists/public/exceptions/transforms.ts
index 564ba1a699f98..49cf012a1c16b 100644
--- a/x-pack/plugins/lists/public/exceptions/transforms.ts
+++ b/x-pack/plugins/lists/public/exceptions/transforms.ts
@@ -7,13 +7,13 @@
import { flow } from 'fp-ts/lib/function';
import { addIdToItem, removeIdFromItem } from '@kbn/securitysolution-utils';
-import type { EntriesArray, Entry } from '@kbn/securitysolution-io-ts-list-types';
-
import type {
CreateExceptionListItemSchema,
+ EntriesArray,
+ Entry,
ExceptionListItemSchema,
UpdateExceptionListItemSchema,
-} from '../../common';
+} from '@kbn/securitysolution-io-ts-list-types';
// These are a collection of transforms that are UI specific and useful for UI concerns
// that are inserted between the API and the actual user interface. In some ways these
diff --git a/x-pack/plugins/lists/public/exceptions/types.ts b/x-pack/plugins/lists/public/exceptions/types.ts
index 0cad700b2b598..8686c5d7ad250 100644
--- a/x-pack/plugins/lists/public/exceptions/types.ts
+++ b/x-pack/plugins/lists/public/exceptions/types.ts
@@ -5,19 +5,20 @@
* 2.0.
*/
-import { ExceptionListType, NamespaceType } from '@kbn/securitysolution-io-ts-list-types';
-
-import {
+import type {
CreateExceptionListItemSchema,
CreateExceptionListSchema,
ExceptionListItemSchema,
ExceptionListSchema,
+ ExceptionListType,
+ NamespaceType,
Page,
PerPage,
TotalOrUndefined,
UpdateExceptionListItemSchema,
UpdateExceptionListSchema,
-} from '../../common/schemas';
+} from '@kbn/securitysolution-io-ts-list-types';
+
import { HttpStart, NotificationsStart } from '../../../../../src/core/public';
export interface FilterExceptionsOptions {
diff --git a/x-pack/plugins/lists/public/exceptions/utils.ts b/x-pack/plugins/lists/public/exceptions/utils.ts
index c840a25b2a103..ee0219ba0ed31 100644
--- a/x-pack/plugins/lists/public/exceptions/utils.ts
+++ b/x-pack/plugins/lists/public/exceptions/utils.ts
@@ -6,7 +6,7 @@
*/
import { get } from 'lodash/fp';
-import { NamespaceType, NamespaceTypeArray } from '@kbn/securitysolution-io-ts-list-types';
+import type { NamespaceType, NamespaceTypeArray } from '@kbn/securitysolution-io-ts-list-types';
import { ENDPOINT_TRUSTED_APPS_LIST_ID } from '../../common/constants';
import {
diff --git a/x-pack/plugins/lists/public/lists/api.ts b/x-pack/plugins/lists/public/lists/api.ts
index 09baa83519fc4..ec17c079b8fff 100644
--- a/x-pack/plugins/lists/public/lists/api.ts
+++ b/x-pack/plugins/lists/public/lists/api.ts
@@ -9,7 +9,6 @@ import { chain, fromEither, map, tryCatch } from 'fp-ts/lib/TaskEither';
import { flow } from 'fp-ts/lib/function';
import { pipe } from 'fp-ts/lib/pipeable';
import { validateEither } from '@kbn/securitysolution-io-ts-utils';
-
import {
AcknowledgeSchema,
DeleteListSchemaEncoded,
@@ -29,7 +28,8 @@ import {
importListItemSchema,
listItemIndexExistSchema,
listSchema,
-} from '../../common/schemas';
+} from '@kbn/securitysolution-io-ts-list-types';
+
import { LIST_INDEX, LIST_ITEM_URL, LIST_PRIVILEGES_URL, LIST_URL } from '../../common/constants';
import { toError, toPromise } from '../common/fp_utils';
diff --git a/x-pack/plugins/lists/public/lists/types.ts b/x-pack/plugins/lists/public/lists/types.ts
index ad82a63163ce3..575ccde1ea286 100644
--- a/x-pack/plugins/lists/public/lists/types.ts
+++ b/x-pack/plugins/lists/public/lists/types.ts
@@ -5,7 +5,7 @@
* 2.0.
*/
-import { Type } from '@kbn/securitysolution-io-ts-list-types';
+import type { Type } from '@kbn/securitysolution-io-ts-list-types';
import { HttpStart } from '../../../../../src/core/public';
diff --git a/x-pack/plugins/lists/public/shared_exports.ts b/x-pack/plugins/lists/public/shared_exports.ts
index 6d14c6b541904..857109f3a11e7 100644
--- a/x-pack/plugins/lists/public/shared_exports.ts
+++ b/x-pack/plugins/lists/public/shared_exports.ts
@@ -20,13 +20,6 @@ export { useExportList } from './lists/hooks/use_export_list';
export { useReadListIndex } from './lists/hooks/use_read_list_index';
export { useCreateListIndex } from './lists/hooks/use_create_list_index';
export { useReadListPrivileges } from './lists/hooks/use_read_list_privileges';
-export {
- getEntryValue,
- getExceptionOperatorSelect,
- getOperatorType,
- getNewExceptionItem,
- addIdToEntries,
-} from './exceptions/components/builder/helpers';
export {
fetchExceptionListById,
addExceptionList,
diff --git a/x-pack/plugins/lists/server/routes/create_endpoint_list_item_route.ts b/x-pack/plugins/lists/server/routes/create_endpoint_list_item_route.ts
index 9c42df6abd7bd..be2125b6f250a 100644
--- a/x-pack/plugins/lists/server/routes/create_endpoint_list_item_route.ts
+++ b/x-pack/plugins/lists/server/routes/create_endpoint_list_item_route.ts
@@ -7,14 +7,14 @@
import { validate } from '@kbn/securitysolution-io-ts-utils';
import { transformError } from '@kbn/securitysolution-es-utils';
-
-import type { ListsPluginRouter } from '../types';
-import { ENDPOINT_LIST_ID, ENDPOINT_LIST_ITEM_URL } from '../../common/constants';
import {
CreateEndpointListItemSchemaDecoded,
createEndpointListItemSchema,
exceptionListItemSchema,
-} from '../../common/schemas';
+} from '@kbn/securitysolution-io-ts-list-types';
+
+import type { ListsPluginRouter } from '../types';
+import { ENDPOINT_LIST_ID, ENDPOINT_LIST_ITEM_URL } from '../../common/constants';
import { buildRouteValidation, buildSiemResponse, getExceptionListClient } from './utils';
import { validateExceptionListSize } from './validate';
diff --git a/x-pack/plugins/lists/server/routes/create_endpoint_list_route.ts b/x-pack/plugins/lists/server/routes/create_endpoint_list_route.ts
index 599870c226564..0f30b7d40217f 100644
--- a/x-pack/plugins/lists/server/routes/create_endpoint_list_route.ts
+++ b/x-pack/plugins/lists/server/routes/create_endpoint_list_route.ts
@@ -7,10 +7,10 @@
import { validate } from '@kbn/securitysolution-io-ts-utils';
import { transformError } from '@kbn/securitysolution-es-utils';
+import { createEndpointListSchema } from '@kbn/securitysolution-io-ts-list-types';
import type { ListsPluginRouter } from '../types';
import { ENDPOINT_LIST_URL } from '../../common/constants';
-import { createEndpointListSchema } from '../../common/schemas';
import { buildSiemResponse } from './utils';
import { getExceptionListClient } from './utils/get_exception_list_client';
diff --git a/x-pack/plugins/lists/server/routes/create_exception_list_item_route.ts b/x-pack/plugins/lists/server/routes/create_exception_list_item_route.ts
index 81260584e8a50..e85c6480262f0 100644
--- a/x-pack/plugins/lists/server/routes/create_exception_list_item_route.ts
+++ b/x-pack/plugins/lists/server/routes/create_exception_list_item_route.ts
@@ -7,14 +7,14 @@
import { validate } from '@kbn/securitysolution-io-ts-utils';
import { transformError } from '@kbn/securitysolution-es-utils';
-
-import type { ListsPluginRouter } from '../types';
-import { EXCEPTION_LIST_ITEM_URL } from '../../common/constants';
import {
CreateExceptionListItemSchemaDecoded,
createExceptionListItemSchema,
exceptionListItemSchema,
-} from '../../common/schemas';
+} from '@kbn/securitysolution-io-ts-list-types';
+
+import type { ListsPluginRouter } from '../types';
+import { EXCEPTION_LIST_ITEM_URL } from '../../common/constants';
import { buildRouteValidation, buildSiemResponse } from './utils';
import { getExceptionListClient } from './utils/get_exception_list_client';
diff --git a/x-pack/plugins/lists/server/routes/create_exception_list_route.ts b/x-pack/plugins/lists/server/routes/create_exception_list_route.ts
index 1a35bdb008662..fb515591745e4 100644
--- a/x-pack/plugins/lists/server/routes/create_exception_list_route.ts
+++ b/x-pack/plugins/lists/server/routes/create_exception_list_route.ts
@@ -7,14 +7,14 @@
import { validate } from '@kbn/securitysolution-io-ts-utils';
import { transformError } from '@kbn/securitysolution-es-utils';
-
-import type { ListsPluginRouter } from '../types';
-import { EXCEPTION_LIST_URL } from '../../common/constants';
import {
CreateExceptionListSchemaDecoded,
createExceptionListSchema,
exceptionListSchema,
-} from '../../common/schemas';
+} from '@kbn/securitysolution-io-ts-list-types';
+
+import type { ListsPluginRouter } from '../types';
+import { EXCEPTION_LIST_URL } from '../../common/constants';
import { buildRouteValidation, buildSiemResponse } from './utils';
import { getExceptionListClient } from './utils/get_exception_list_client';
diff --git a/x-pack/plugins/lists/server/routes/create_list_index_route.ts b/x-pack/plugins/lists/server/routes/create_list_index_route.ts
index 3b0d34b8952a1..db085befa5a2e 100644
--- a/x-pack/plugins/lists/server/routes/create_list_index_route.ts
+++ b/x-pack/plugins/lists/server/routes/create_list_index_route.ts
@@ -7,10 +7,10 @@
import { validate } from '@kbn/securitysolution-io-ts-utils';
import { transformError } from '@kbn/securitysolution-es-utils';
+import { acknowledgeSchema } from '@kbn/securitysolution-io-ts-list-types';
import type { ListsPluginRouter } from '../types';
import { LIST_INDEX } from '../../common/constants';
-import { acknowledgeSchema } from '../../common/schemas';
import { buildSiemResponse } from './utils';
diff --git a/x-pack/plugins/lists/server/routes/create_list_item_route.ts b/x-pack/plugins/lists/server/routes/create_list_item_route.ts
index 4df121af4c1ba..961be259cd8d5 100644
--- a/x-pack/plugins/lists/server/routes/create_list_item_route.ts
+++ b/x-pack/plugins/lists/server/routes/create_list_item_route.ts
@@ -7,10 +7,10 @@
import { validate } from '@kbn/securitysolution-io-ts-utils';
import { transformError } from '@kbn/securitysolution-es-utils';
+import { createListItemSchema, listItemSchema } from '@kbn/securitysolution-io-ts-list-types';
import type { ListsPluginRouter } from '../types';
import { LIST_ITEM_URL } from '../../common/constants';
-import { createListItemSchema, listItemSchema } from '../../common/schemas';
import { buildRouteValidation, buildSiemResponse } from './utils';
diff --git a/x-pack/plugins/lists/server/routes/create_list_route.ts b/x-pack/plugins/lists/server/routes/create_list_route.ts
index dabbd690bba21..4135d6d794188 100644
--- a/x-pack/plugins/lists/server/routes/create_list_route.ts
+++ b/x-pack/plugins/lists/server/routes/create_list_route.ts
@@ -7,10 +7,14 @@
import { validate } from '@kbn/securitysolution-io-ts-utils';
import { transformError } from '@kbn/securitysolution-es-utils';
+import {
+ CreateListSchemaDecoded,
+ createListSchema,
+ listSchema,
+} from '@kbn/securitysolution-io-ts-list-types';
import type { ListsPluginRouter } from '../types';
import { LIST_URL } from '../../common/constants';
-import { CreateListSchemaDecoded, createListSchema, listSchema } from '../../common/schemas';
import { buildRouteValidation, buildSiemResponse } from './utils';
diff --git a/x-pack/plugins/lists/server/routes/delete_endpoint_list_item_route.ts b/x-pack/plugins/lists/server/routes/delete_endpoint_list_item_route.ts
index 59d91f6234176..725594c4cbf9e 100644
--- a/x-pack/plugins/lists/server/routes/delete_endpoint_list_item_route.ts
+++ b/x-pack/plugins/lists/server/routes/delete_endpoint_list_item_route.ts
@@ -7,14 +7,14 @@
import { validate } from '@kbn/securitysolution-io-ts-utils';
import { transformError } from '@kbn/securitysolution-es-utils';
-
-import type { ListsPluginRouter } from '../types';
-import { ENDPOINT_LIST_ITEM_URL } from '../../common/constants';
import {
DeleteEndpointListItemSchemaDecoded,
deleteEndpointListItemSchema,
exceptionListItemSchema,
-} from '../../common/schemas';
+} from '@kbn/securitysolution-io-ts-list-types';
+
+import type { ListsPluginRouter } from '../types';
+import { ENDPOINT_LIST_ITEM_URL } from '../../common/constants';
import {
buildRouteValidation,
diff --git a/x-pack/plugins/lists/server/routes/delete_exception_list_item_route.ts b/x-pack/plugins/lists/server/routes/delete_exception_list_item_route.ts
index ce4f91ffc671a..0467b46c08491 100644
--- a/x-pack/plugins/lists/server/routes/delete_exception_list_item_route.ts
+++ b/x-pack/plugins/lists/server/routes/delete_exception_list_item_route.ts
@@ -7,14 +7,14 @@
import { validate } from '@kbn/securitysolution-io-ts-utils';
import { transformError } from '@kbn/securitysolution-es-utils';
-
-import type { ListsPluginRouter } from '../types';
-import { EXCEPTION_LIST_ITEM_URL } from '../../common/constants';
import {
DeleteExceptionListItemSchemaDecoded,
deleteExceptionListItemSchema,
exceptionListItemSchema,
-} from '../../common/schemas';
+} from '@kbn/securitysolution-io-ts-list-types';
+
+import type { ListsPluginRouter } from '../types';
+import { EXCEPTION_LIST_ITEM_URL } from '../../common/constants';
import {
buildRouteValidation,
diff --git a/x-pack/plugins/lists/server/routes/delete_exception_list_route.ts b/x-pack/plugins/lists/server/routes/delete_exception_list_route.ts
index eeeb5fb44c16a..7df509690ae90 100644
--- a/x-pack/plugins/lists/server/routes/delete_exception_list_route.ts
+++ b/x-pack/plugins/lists/server/routes/delete_exception_list_route.ts
@@ -7,14 +7,14 @@
import { validate } from '@kbn/securitysolution-io-ts-utils';
import { transformError } from '@kbn/securitysolution-es-utils';
-
-import type { ListsPluginRouter } from '../types';
-import { EXCEPTION_LIST_URL } from '../../common/constants';
import {
DeleteExceptionListSchemaDecoded,
deleteExceptionListSchema,
exceptionListSchema,
-} from '../../common/schemas';
+} from '@kbn/securitysolution-io-ts-list-types';
+
+import type { ListsPluginRouter } from '../types';
+import { EXCEPTION_LIST_URL } from '../../common/constants';
import {
buildRouteValidation,
diff --git a/x-pack/plugins/lists/server/routes/delete_list_index_route.ts b/x-pack/plugins/lists/server/routes/delete_list_index_route.ts
index 22c56a21df419..15b15ec746f23 100644
--- a/x-pack/plugins/lists/server/routes/delete_list_index_route.ts
+++ b/x-pack/plugins/lists/server/routes/delete_list_index_route.ts
@@ -7,10 +7,10 @@
import { validate } from '@kbn/securitysolution-io-ts-utils';
import { transformError } from '@kbn/securitysolution-es-utils';
+import { acknowledgeSchema } from '@kbn/securitysolution-io-ts-list-types';
import type { ListsPluginRouter } from '../types';
import { LIST_INDEX } from '../../common/constants';
-import { acknowledgeSchema } from '../../common/schemas';
import { buildSiemResponse } from './utils';
diff --git a/x-pack/plugins/lists/server/routes/delete_list_item_route.ts b/x-pack/plugins/lists/server/routes/delete_list_item_route.ts
index 197590ecb142c..e9cc035dda85a 100644
--- a/x-pack/plugins/lists/server/routes/delete_list_item_route.ts
+++ b/x-pack/plugins/lists/server/routes/delete_list_item_route.ts
@@ -7,10 +7,14 @@
import { validate } from '@kbn/securitysolution-io-ts-utils';
import { transformError } from '@kbn/securitysolution-es-utils';
+import {
+ deleteListItemSchema,
+ listItemArraySchema,
+ listItemSchema,
+} from '@kbn/securitysolution-io-ts-list-types';
import type { ListsPluginRouter } from '../types';
import { LIST_ITEM_URL } from '../../common/constants';
-import { deleteListItemSchema, listItemArraySchema, listItemSchema } from '../../common/schemas';
import { buildRouteValidation, buildSiemResponse } from './utils';
diff --git a/x-pack/plugins/lists/server/routes/delete_list_route.ts b/x-pack/plugins/lists/server/routes/delete_list_route.ts
index 78235584bc0cd..e22fdc5df121e 100644
--- a/x-pack/plugins/lists/server/routes/delete_list_route.ts
+++ b/x-pack/plugins/lists/server/routes/delete_list_route.ts
@@ -6,18 +6,18 @@
*/
import { validate } from '@kbn/securitysolution-io-ts-utils';
-import { EntriesArray } from '@kbn/securitysolution-io-ts-list-types';
import { transformError } from '@kbn/securitysolution-es-utils';
-
-import type { ListsPluginRouter } from '../types';
-import { LIST_URL } from '../../common/constants';
import {
+ EntriesArray,
ExceptionListItemSchema,
FoundExceptionListSchema,
deleteListSchema,
exceptionListItemSchema,
listSchema,
-} from '../../common/schemas';
+} from '@kbn/securitysolution-io-ts-list-types';
+
+import type { ListsPluginRouter } from '../types';
+import { LIST_URL } from '../../common/constants';
import { getSavedObjectType } from '../services/exception_lists/utils';
import { ExceptionListClient } from '../services/exception_lists/exception_list_client';
import { escapeQuotes } from '../services/utils/escape_query';
diff --git a/x-pack/plugins/lists/server/routes/export_exception_list_route.ts b/x-pack/plugins/lists/server/routes/export_exception_list_route.ts
index 3d82cbac47a88..8f274d10a870b 100644
--- a/x-pack/plugins/lists/server/routes/export_exception_list_route.ts
+++ b/x-pack/plugins/lists/server/routes/export_exception_list_route.ts
@@ -6,10 +6,10 @@
*/
import { transformError } from '@kbn/securitysolution-es-utils';
+import { exportExceptionListQuerySchema } from '@kbn/securitysolution-io-ts-list-types';
import type { ListsPluginRouter } from '../types';
import { EXCEPTION_LIST_URL } from '../../common/constants';
-import { exportExceptionListQuerySchema } from '../../common/schemas';
import { buildRouteValidation, buildSiemResponse, getExceptionListClient } from './utils';
diff --git a/x-pack/plugins/lists/server/routes/export_list_item_route.ts b/x-pack/plugins/lists/server/routes/export_list_item_route.ts
index 13a2aa9beea05..d104f11024e93 100644
--- a/x-pack/plugins/lists/server/routes/export_list_item_route.ts
+++ b/x-pack/plugins/lists/server/routes/export_list_item_route.ts
@@ -8,10 +8,10 @@
import { Stream } from 'stream';
import { transformError } from '@kbn/securitysolution-es-utils';
+import { exportListItemQuerySchema } from '@kbn/securitysolution-io-ts-list-types';
import type { ListsPluginRouter } from '../types';
import { LIST_ITEM_URL } from '../../common/constants';
-import { exportListItemQuerySchema } from '../../common/schemas';
import { buildRouteValidation, buildSiemResponse } from './utils';
diff --git a/x-pack/plugins/lists/server/routes/find_endpoint_list_item_route.ts b/x-pack/plugins/lists/server/routes/find_endpoint_list_item_route.ts
index cbf3c320c407a..0284321ef4619 100644
--- a/x-pack/plugins/lists/server/routes/find_endpoint_list_item_route.ts
+++ b/x-pack/plugins/lists/server/routes/find_endpoint_list_item_route.ts
@@ -7,14 +7,14 @@
import { validate } from '@kbn/securitysolution-io-ts-utils';
import { transformError } from '@kbn/securitysolution-es-utils';
-
-import type { ListsPluginRouter } from '../types';
-import { ENDPOINT_LIST_ID, ENDPOINT_LIST_ITEM_URL } from '../../common/constants';
import {
FindEndpointListItemSchemaDecoded,
findEndpointListItemSchema,
foundExceptionListItemSchema,
-} from '../../common/schemas';
+} from '@kbn/securitysolution-io-ts-list-types';
+
+import type { ListsPluginRouter } from '../types';
+import { ENDPOINT_LIST_ID, ENDPOINT_LIST_ITEM_URL } from '../../common/constants';
import { buildRouteValidation, buildSiemResponse, getExceptionListClient } from './utils';
diff --git a/x-pack/plugins/lists/server/routes/find_exception_list_item_route.ts b/x-pack/plugins/lists/server/routes/find_exception_list_item_route.ts
index 45ce1dbb87fba..fc3450d2277d5 100644
--- a/x-pack/plugins/lists/server/routes/find_exception_list_item_route.ts
+++ b/x-pack/plugins/lists/server/routes/find_exception_list_item_route.ts
@@ -7,14 +7,14 @@
import { validate } from '@kbn/securitysolution-io-ts-utils';
import { transformError } from '@kbn/securitysolution-es-utils';
-
-import type { ListsPluginRouter } from '../types';
-import { EXCEPTION_LIST_ITEM_URL } from '../../common/constants';
import {
FindExceptionListItemSchemaDecoded,
findExceptionListItemSchema,
foundExceptionListItemSchema,
-} from '../../common/schemas';
+} from '@kbn/securitysolution-io-ts-list-types';
+
+import type { ListsPluginRouter } from '../types';
+import { EXCEPTION_LIST_ITEM_URL } from '../../common/constants';
import { buildRouteValidation, buildSiemResponse, getExceptionListClient } from './utils';
diff --git a/x-pack/plugins/lists/server/routes/find_exception_list_route.ts b/x-pack/plugins/lists/server/routes/find_exception_list_route.ts
index 0181bfed5b857..966aa1391a312 100644
--- a/x-pack/plugins/lists/server/routes/find_exception_list_route.ts
+++ b/x-pack/plugins/lists/server/routes/find_exception_list_route.ts
@@ -7,14 +7,14 @@
import { validate } from '@kbn/securitysolution-io-ts-utils';
import { transformError } from '@kbn/securitysolution-es-utils';
-
-import type { ListsPluginRouter } from '../types';
-import { EXCEPTION_LIST_URL } from '../../common/constants';
import {
FindExceptionListSchemaDecoded,
findExceptionListSchema,
foundExceptionListSchema,
-} from '../../common/schemas';
+} from '@kbn/securitysolution-io-ts-list-types';
+
+import type { ListsPluginRouter } from '../types';
+import { EXCEPTION_LIST_URL } from '../../common/constants';
import { buildRouteValidation, buildSiemResponse, getExceptionListClient } from './utils';
diff --git a/x-pack/plugins/lists/server/routes/find_list_item_route.ts b/x-pack/plugins/lists/server/routes/find_list_item_route.ts
index c64dfd561e0e3..1ae60f7faba35 100644
--- a/x-pack/plugins/lists/server/routes/find_list_item_route.ts
+++ b/x-pack/plugins/lists/server/routes/find_list_item_route.ts
@@ -7,14 +7,14 @@
import { validate } from '@kbn/securitysolution-io-ts-utils';
import { transformError } from '@kbn/securitysolution-es-utils';
-
-import type { ListsPluginRouter } from '../types';
-import { LIST_ITEM_URL } from '../../common/constants';
import {
FindListItemSchemaDecoded,
findListItemSchema,
foundListItemSchema,
-} from '../../common/schemas';
+} from '@kbn/securitysolution-io-ts-list-types';
+
+import type { ListsPluginRouter } from '../types';
+import { LIST_ITEM_URL } from '../../common/constants';
import { decodeCursor } from '../services/utils';
import { buildRouteValidation, buildSiemResponse, getListClient } from './utils';
diff --git a/x-pack/plugins/lists/server/routes/find_list_route.ts b/x-pack/plugins/lists/server/routes/find_list_route.ts
index 19c20515ef5f2..31e2773359ee1 100644
--- a/x-pack/plugins/lists/server/routes/find_list_route.ts
+++ b/x-pack/plugins/lists/server/routes/find_list_route.ts
@@ -7,10 +7,10 @@
import { validate } from '@kbn/securitysolution-io-ts-utils';
import { transformError } from '@kbn/securitysolution-es-utils';
+import { findListSchema, foundListSchema } from '@kbn/securitysolution-io-ts-list-types';
import type { ListsPluginRouter } from '../types';
import { LIST_URL } from '../../common/constants';
-import { findListSchema, foundListSchema } from '../../common/schemas';
import { decodeCursor } from '../services/utils';
import { buildRouteValidation, buildSiemResponse, getListClient } from './utils';
diff --git a/x-pack/plugins/lists/server/routes/import_list_item_route.ts b/x-pack/plugins/lists/server/routes/import_list_item_route.ts
index 77d9623f40a23..3843f8389a4ed 100644
--- a/x-pack/plugins/lists/server/routes/import_list_item_route.ts
+++ b/x-pack/plugins/lists/server/routes/import_list_item_route.ts
@@ -8,10 +8,10 @@
import { schema } from '@kbn/config-schema';
import { validate } from '@kbn/securitysolution-io-ts-utils';
import { transformError } from '@kbn/securitysolution-es-utils';
+import { importListItemQuerySchema, listSchema } from '@kbn/securitysolution-io-ts-list-types';
import type { ListsPluginRouter } from '../types';
import { LIST_ITEM_URL } from '../../common/constants';
-import { importListItemQuerySchema, listSchema } from '../../common/schemas';
import { ConfigType } from '../config';
import { buildRouteValidation, buildSiemResponse } from './utils';
diff --git a/x-pack/plugins/lists/server/routes/patch_list_item_route.ts b/x-pack/plugins/lists/server/routes/patch_list_item_route.ts
index ce4ff71a1d886..3e85e501bd216 100644
--- a/x-pack/plugins/lists/server/routes/patch_list_item_route.ts
+++ b/x-pack/plugins/lists/server/routes/patch_list_item_route.ts
@@ -7,10 +7,10 @@
import { validate } from '@kbn/securitysolution-io-ts-utils';
import { transformError } from '@kbn/securitysolution-es-utils';
+import { listItemSchema, patchListItemSchema } from '@kbn/securitysolution-io-ts-list-types';
import type { ListsPluginRouter } from '../types';
import { LIST_ITEM_URL } from '../../common/constants';
-import { listItemSchema, patchListItemSchema } from '../../common/schemas';
import { buildRouteValidation, buildSiemResponse } from './utils';
diff --git a/x-pack/plugins/lists/server/routes/patch_list_route.ts b/x-pack/plugins/lists/server/routes/patch_list_route.ts
index 3f2427b30f2be..fb88432bb1960 100644
--- a/x-pack/plugins/lists/server/routes/patch_list_route.ts
+++ b/x-pack/plugins/lists/server/routes/patch_list_route.ts
@@ -7,10 +7,10 @@
import { validate } from '@kbn/securitysolution-io-ts-utils';
import { transformError } from '@kbn/securitysolution-es-utils';
+import { listSchema, patchListSchema } from '@kbn/securitysolution-io-ts-list-types';
import type { ListsPluginRouter } from '../types';
import { LIST_URL } from '../../common/constants';
-import { listSchema, patchListSchema } from '../../common/schemas';
import { buildRouteValidation, buildSiemResponse } from './utils';
diff --git a/x-pack/plugins/lists/server/routes/read_endpoint_list_item_route.ts b/x-pack/plugins/lists/server/routes/read_endpoint_list_item_route.ts
index 72cfe38090cd8..be4a258cd5fb0 100644
--- a/x-pack/plugins/lists/server/routes/read_endpoint_list_item_route.ts
+++ b/x-pack/plugins/lists/server/routes/read_endpoint_list_item_route.ts
@@ -7,14 +7,14 @@
import { validate } from '@kbn/securitysolution-io-ts-utils';
import { transformError } from '@kbn/securitysolution-es-utils';
-
-import type { ListsPluginRouter } from '../types';
-import { ENDPOINT_LIST_ITEM_URL } from '../../common/constants';
import {
ReadEndpointListItemSchemaDecoded,
exceptionListItemSchema,
readEndpointListItemSchema,
-} from '../../common/schemas';
+} from '@kbn/securitysolution-io-ts-list-types';
+
+import type { ListsPluginRouter } from '../types';
+import { ENDPOINT_LIST_ITEM_URL } from '../../common/constants';
import {
buildRouteValidation,
diff --git a/x-pack/plugins/lists/server/routes/read_exception_list_item_route.ts b/x-pack/plugins/lists/server/routes/read_exception_list_item_route.ts
index 3563645f554bb..e114625cde6a3 100644
--- a/x-pack/plugins/lists/server/routes/read_exception_list_item_route.ts
+++ b/x-pack/plugins/lists/server/routes/read_exception_list_item_route.ts
@@ -7,14 +7,14 @@
import { validate } from '@kbn/securitysolution-io-ts-utils';
import { transformError } from '@kbn/securitysolution-es-utils';
-
-import type { ListsPluginRouter } from '../types';
-import { EXCEPTION_LIST_ITEM_URL } from '../../common/constants';
import {
ReadExceptionListItemSchemaDecoded,
exceptionListItemSchema,
readExceptionListItemSchema,
-} from '../../common/schemas';
+} from '@kbn/securitysolution-io-ts-list-types';
+
+import type { ListsPluginRouter } from '../types';
+import { EXCEPTION_LIST_ITEM_URL } from '../../common/constants';
import {
buildRouteValidation,
diff --git a/x-pack/plugins/lists/server/routes/read_exception_list_route.ts b/x-pack/plugins/lists/server/routes/read_exception_list_route.ts
index f82c397e67d2b..e88eb9cbb0745 100644
--- a/x-pack/plugins/lists/server/routes/read_exception_list_route.ts
+++ b/x-pack/plugins/lists/server/routes/read_exception_list_route.ts
@@ -7,14 +7,14 @@
import { validate } from '@kbn/securitysolution-io-ts-utils';
import { transformError } from '@kbn/securitysolution-es-utils';
-
-import type { ListsPluginRouter } from '../types';
-import { EXCEPTION_LIST_URL } from '../../common/constants';
import {
ReadExceptionListSchemaDecoded,
exceptionListSchema,
readExceptionListSchema,
-} from '../../common/schemas';
+} from '@kbn/securitysolution-io-ts-list-types';
+
+import type { ListsPluginRouter } from '../types';
+import { EXCEPTION_LIST_URL } from '../../common/constants';
import {
buildRouteValidation,
diff --git a/x-pack/plugins/lists/server/routes/read_list_index_route.ts b/x-pack/plugins/lists/server/routes/read_list_index_route.ts
index 619600f3a7ee1..34344fb1051d2 100644
--- a/x-pack/plugins/lists/server/routes/read_list_index_route.ts
+++ b/x-pack/plugins/lists/server/routes/read_list_index_route.ts
@@ -7,10 +7,10 @@
import { validate } from '@kbn/securitysolution-io-ts-utils';
import { transformError } from '@kbn/securitysolution-es-utils';
+import { listItemIndexExistSchema } from '@kbn/securitysolution-io-ts-list-types';
import type { ListsPluginRouter } from '../types';
import { LIST_INDEX } from '../../common/constants';
-import { listItemIndexExistSchema } from '../../common/schemas';
import { buildSiemResponse } from './utils';
diff --git a/x-pack/plugins/lists/server/routes/read_list_item_route.ts b/x-pack/plugins/lists/server/routes/read_list_item_route.ts
index 2355a393d4a77..80a0b4b83514f 100644
--- a/x-pack/plugins/lists/server/routes/read_list_item_route.ts
+++ b/x-pack/plugins/lists/server/routes/read_list_item_route.ts
@@ -7,10 +7,14 @@
import { validate } from '@kbn/securitysolution-io-ts-utils';
import { transformError } from '@kbn/securitysolution-es-utils';
+import {
+ listItemArraySchema,
+ listItemSchema,
+ readListItemSchema,
+} from '@kbn/securitysolution-io-ts-list-types';
import type { ListsPluginRouter } from '../types';
import { LIST_ITEM_URL } from '../../common/constants';
-import { listItemArraySchema, listItemSchema, readListItemSchema } from '../../common/schemas';
import { buildRouteValidation, buildSiemResponse } from './utils';
diff --git a/x-pack/plugins/lists/server/routes/read_list_route.ts b/x-pack/plugins/lists/server/routes/read_list_route.ts
index e66774998d554..3446d5af7b5f1 100644
--- a/x-pack/plugins/lists/server/routes/read_list_route.ts
+++ b/x-pack/plugins/lists/server/routes/read_list_route.ts
@@ -7,10 +7,10 @@
import { validate } from '@kbn/securitysolution-io-ts-utils';
import { transformError } from '@kbn/securitysolution-es-utils';
+import { listSchema, readListSchema } from '@kbn/securitysolution-io-ts-list-types';
import type { ListsPluginRouter } from '../types';
import { LIST_URL } from '../../common/constants';
-import { listSchema, readListSchema } from '../../common/schemas';
import { buildRouteValidation, buildSiemResponse } from './utils';
diff --git a/x-pack/plugins/lists/server/routes/update_endpoint_list_item_route.ts b/x-pack/plugins/lists/server/routes/update_endpoint_list_item_route.ts
index 9468fd2e8c226..4f00c94bda73a 100644
--- a/x-pack/plugins/lists/server/routes/update_endpoint_list_item_route.ts
+++ b/x-pack/plugins/lists/server/routes/update_endpoint_list_item_route.ts
@@ -7,14 +7,14 @@
import { validate } from '@kbn/securitysolution-io-ts-utils';
import { transformError } from '@kbn/securitysolution-es-utils';
-
-import type { ListsPluginRouter } from '../types';
-import { ENDPOINT_LIST_ITEM_URL } from '../../common/constants';
import {
UpdateEndpointListItemSchemaDecoded,
exceptionListItemSchema,
updateEndpointListItemSchema,
-} from '../../common/schemas';
+} from '@kbn/securitysolution-io-ts-list-types';
+
+import type { ListsPluginRouter } from '../types';
+import { ENDPOINT_LIST_ITEM_URL } from '../../common/constants';
import { buildRouteValidation, buildSiemResponse } from './utils';
diff --git a/x-pack/plugins/lists/server/routes/update_exception_list_item_route.ts b/x-pack/plugins/lists/server/routes/update_exception_list_item_route.ts
index 6fbb1b7de80af..453fdcbdfd916 100644
--- a/x-pack/plugins/lists/server/routes/update_exception_list_item_route.ts
+++ b/x-pack/plugins/lists/server/routes/update_exception_list_item_route.ts
@@ -7,15 +7,15 @@
import { validate } from '@kbn/securitysolution-io-ts-utils';
import { transformError } from '@kbn/securitysolution-es-utils';
-
-import type { ListsPluginRouter } from '../types';
-import { EXCEPTION_LIST_ITEM_URL } from '../../common/constants';
import {
UpdateExceptionListItemSchemaDecoded,
exceptionListItemSchema,
updateExceptionListItemSchema,
-} from '../../common/schemas';
-import { updateExceptionListItemValidate } from '../../common/schemas/request/update_exception_list_item_validation';
+ updateExceptionListItemValidate,
+} from '@kbn/securitysolution-io-ts-list-types';
+
+import type { ListsPluginRouter } from '../types';
+import { EXCEPTION_LIST_ITEM_URL } from '../../common/constants';
import { buildRouteValidation, buildSiemResponse } from './utils';
diff --git a/x-pack/plugins/lists/server/routes/update_exception_list_route.ts b/x-pack/plugins/lists/server/routes/update_exception_list_route.ts
index cf670b28cee56..ef3da5506ab23 100644
--- a/x-pack/plugins/lists/server/routes/update_exception_list_route.ts
+++ b/x-pack/plugins/lists/server/routes/update_exception_list_route.ts
@@ -7,14 +7,14 @@
import { validate } from '@kbn/securitysolution-io-ts-utils';
import { transformError } from '@kbn/securitysolution-es-utils';
-
-import type { ListsPluginRouter } from '../types';
-import { EXCEPTION_LIST_URL } from '../../common/constants';
import {
UpdateExceptionListSchemaDecoded,
exceptionListSchema,
updateExceptionListSchema,
-} from '../../common/schemas';
+} from '@kbn/securitysolution-io-ts-list-types';
+
+import type { ListsPluginRouter } from '../types';
+import { EXCEPTION_LIST_URL } from '../../common/constants';
import {
buildRouteValidation,
diff --git a/x-pack/plugins/lists/server/routes/update_list_item_route.ts b/x-pack/plugins/lists/server/routes/update_list_item_route.ts
index f806b3f5d09d7..a8a0189dbb24b 100644
--- a/x-pack/plugins/lists/server/routes/update_list_item_route.ts
+++ b/x-pack/plugins/lists/server/routes/update_list_item_route.ts
@@ -7,10 +7,10 @@
import { validate } from '@kbn/securitysolution-io-ts-utils';
import { transformError } from '@kbn/securitysolution-es-utils';
+import { listItemSchema, updateListItemSchema } from '@kbn/securitysolution-io-ts-list-types';
import type { ListsPluginRouter } from '../types';
import { LIST_ITEM_URL } from '../../common/constants';
-import { listItemSchema, updateListItemSchema } from '../../common/schemas';
import { buildRouteValidation, buildSiemResponse } from './utils';
diff --git a/x-pack/plugins/lists/server/routes/update_list_route.ts b/x-pack/plugins/lists/server/routes/update_list_route.ts
index 25457d7cdb333..c4293d7ca72f4 100644
--- a/x-pack/plugins/lists/server/routes/update_list_route.ts
+++ b/x-pack/plugins/lists/server/routes/update_list_route.ts
@@ -7,10 +7,10 @@
import { validate } from '@kbn/securitysolution-io-ts-utils';
import { transformError } from '@kbn/securitysolution-es-utils';
+import { listSchema, updateListSchema } from '@kbn/securitysolution-io-ts-list-types';
import type { ListsPluginRouter } from '../types';
import { LIST_URL } from '../../common/constants';
-import { listSchema, updateListSchema } from '../../common/schemas';
import { buildRouteValidation, buildSiemResponse } from './utils';
diff --git a/x-pack/plugins/lists/server/routes/validate.ts b/x-pack/plugins/lists/server/routes/validate.ts
index 2577770cf32ef..21e2ad187d045 100644
--- a/x-pack/plugins/lists/server/routes/validate.ts
+++ b/x-pack/plugins/lists/server/routes/validate.ts
@@ -12,12 +12,12 @@ import { exactCheck, formatErrors, validate } from '@kbn/securitysolution-io-ts-
import {
NamespaceType,
NonEmptyEntriesArray,
+ foundExceptionListItemSchema,
nonEmptyEndpointEntriesArray,
} from '@kbn/securitysolution-io-ts-list-types';
import { ExceptionListClient } from '../services/exception_lists/exception_list_client';
import { MAX_EXCEPTION_LIST_SIZE } from '../../common/constants';
-import { foundExceptionListItemSchema } from '../../common/schemas';
export const validateExceptionListSize = async (
exceptionLists: ExceptionListClient,
diff --git a/x-pack/plugins/lists/server/schemas/elastic_query/index_es_list_item_schema.ts b/x-pack/plugins/lists/server/schemas/elastic_query/index_es_list_item_schema.ts
index 42788c15736b7..b3130b95fe978 100644
--- a/x-pack/plugins/lists/server/schemas/elastic_query/index_es_list_item_schema.ts
+++ b/x-pack/plugins/lists/server/schemas/elastic_query/index_es_list_item_schema.ts
@@ -9,18 +9,16 @@ import * as t from 'io-ts';
import {
created_at,
created_by,
+ deserializerOrUndefined,
+ list_id,
metaOrUndefined,
+ serializerOrUndefined,
+ tie_breaker_id,
updated_at,
updated_by,
} from '@kbn/securitysolution-io-ts-list-types';
import { esDataTypeUnion } from '../common/schemas';
-import {
- deserializerOrUndefined,
- list_id,
- serializerOrUndefined,
- tie_breaker_id,
-} from '../../../common/schemas';
export const indexEsListItemSchema = t.intersection([
t.exact(
diff --git a/x-pack/plugins/lists/server/schemas/elastic_query/index_es_list_schema.ts b/x-pack/plugins/lists/server/schemas/elastic_query/index_es_list_schema.ts
index 607535b68c1e5..85e2eb95dd7e4 100644
--- a/x-pack/plugins/lists/server/schemas/elastic_query/index_es_list_schema.ts
+++ b/x-pack/plugins/lists/server/schemas/elastic_query/index_es_list_schema.ts
@@ -10,21 +10,18 @@ import {
created_at,
created_by,
description,
+ deserializerOrUndefined,
+ immutable,
metaOrUndefined,
name,
+ serializerOrUndefined,
+ tie_breaker_id,
type,
updated_at,
updated_by,
} from '@kbn/securitysolution-io-ts-list-types';
import { version } from '@kbn/securitysolution-io-ts-types';
-import {
- deserializerOrUndefined,
- immutable,
- serializerOrUndefined,
- tie_breaker_id,
-} from '../../../common/schemas';
-
export const indexEsListSchema = t.exact(
t.type({
created_at,
diff --git a/x-pack/plugins/lists/server/schemas/elastic_response/search_es_list_item_schema.ts b/x-pack/plugins/lists/server/schemas/elastic_response/search_es_list_item_schema.ts
index c787f70bfa675..158783ce088b2 100644
--- a/x-pack/plugins/lists/server/schemas/elastic_response/search_es_list_item_schema.ts
+++ b/x-pack/plugins/lists/server/schemas/elastic_response/search_es_list_item_schema.ts
@@ -9,7 +9,11 @@ import * as t from 'io-ts';
import {
created_at,
created_by,
+ deserializerOrUndefined,
+ list_id,
metaOrUndefined,
+ serializerOrUndefined,
+ tie_breaker_id,
updated_at,
updated_by,
} from '@kbn/securitysolution-io-ts-list-types';
@@ -39,12 +43,6 @@ import {
shortOrUndefined,
textOrUndefined,
} from '../common/schemas';
-import {
- deserializerOrUndefined,
- list_id,
- serializerOrUndefined,
- tie_breaker_id,
-} from '../../../common/schemas';
export const searchEsListItemSchema = t.exact(
t.type({
diff --git a/x-pack/plugins/lists/server/schemas/elastic_response/search_es_list_schema.ts b/x-pack/plugins/lists/server/schemas/elastic_response/search_es_list_schema.ts
index f6d6ae4effe72..7e2ca2d6343cb 100644
--- a/x-pack/plugins/lists/server/schemas/elastic_response/search_es_list_schema.ts
+++ b/x-pack/plugins/lists/server/schemas/elastic_response/search_es_list_schema.ts
@@ -10,21 +10,18 @@ import {
created_at,
created_by,
description,
+ deserializerOrUndefined,
+ immutable,
metaOrUndefined,
name,
+ serializerOrUndefined,
+ tie_breaker_id,
type,
updated_at,
updated_by,
} from '@kbn/securitysolution-io-ts-list-types';
import { version } from '@kbn/securitysolution-io-ts-types';
-import {
- deserializerOrUndefined,
- immutable,
- serializerOrUndefined,
- tie_breaker_id,
-} from '../../../common/schemas';
-
export const searchEsListSchema = t.exact(
t.type({
created_at,
diff --git a/x-pack/plugins/lists/server/schemas/saved_objects/exceptions_list_so_schema.ts b/x-pack/plugins/lists/server/schemas/saved_objects/exceptions_list_so_schema.ts
index d815dbaae0432..b5583e5bc9820 100644
--- a/x-pack/plugins/lists/server/schemas/saved_objects/exceptions_list_so_schema.ts
+++ b/x-pack/plugins/lists/server/schemas/saved_objects/exceptions_list_so_schema.ts
@@ -14,22 +14,19 @@ import {
entriesArrayOrUndefined,
exceptionListItemType,
exceptionListType,
+ immutableOrUndefined,
+ itemIdOrUndefined,
+ list_id,
+ list_type,
metaOrUndefined,
name,
osTypeArray,
tags,
+ tie_breaker_id,
updated_by,
} from '@kbn/securitysolution-io-ts-list-types';
import { versionOrUndefined } from '@kbn/securitysolution-io-ts-types';
-import {
- immutableOrUndefined,
- itemIdOrUndefined,
- list_id,
- list_type,
- tie_breaker_id,
-} from '../../../common/schemas';
-
/**
* Superset saved object of both lists and list items since they share the same saved object type.
*/
diff --git a/x-pack/plugins/lists/server/services/exception_lists/create_endoint_event_filters_list.ts b/x-pack/plugins/lists/server/services/exception_lists/create_endoint_event_filters_list.ts
index 9bcf6c63d065d..c2a7218f1cef8 100644
--- a/x-pack/plugins/lists/server/services/exception_lists/create_endoint_event_filters_list.ts
+++ b/x-pack/plugins/lists/server/services/exception_lists/create_endoint_event_filters_list.ts
@@ -8,13 +8,13 @@
import { SavedObjectsClientContract } from 'kibana/server';
import uuid from 'uuid';
import { Version } from '@kbn/securitysolution-io-ts-types';
+import type { ExceptionListSchema } from '@kbn/securitysolution-io-ts-list-types';
import {
ENDPOINT_EVENT_FILTERS_LIST_DESCRIPTION,
ENDPOINT_EVENT_FILTERS_LIST_ID,
ENDPOINT_EVENT_FILTERS_LIST_NAME,
} from '../../../common/constants';
-import { ExceptionListSchema } from '../../../common/schemas';
import { ExceptionListSoSchema } from '../../schemas/saved_objects';
import { getSavedObjectType, transformSavedObjectToExceptionList } from './utils';
diff --git a/x-pack/plugins/lists/server/services/exception_lists/create_endpoint_list.ts b/x-pack/plugins/lists/server/services/exception_lists/create_endpoint_list.ts
index 86891e5f83955..aaf18362ec745 100644
--- a/x-pack/plugins/lists/server/services/exception_lists/create_endpoint_list.ts
+++ b/x-pack/plugins/lists/server/services/exception_lists/create_endpoint_list.ts
@@ -8,13 +8,13 @@
import { SavedObjectsClientContract } from 'kibana/server';
import uuid from 'uuid';
import { Version } from '@kbn/securitysolution-io-ts-types';
+import type { ExceptionListSchema } from '@kbn/securitysolution-io-ts-list-types';
import {
ENDPOINT_LIST_DESCRIPTION,
ENDPOINT_LIST_ID,
ENDPOINT_LIST_NAME,
} from '../../../common/constants';
-import { ExceptionListSchema } from '../../../common/schemas';
import { ExceptionListSoSchema } from '../../schemas/saved_objects';
import { getSavedObjectType, transformSavedObjectToExceptionList } from './utils';
diff --git a/x-pack/plugins/lists/server/services/exception_lists/create_endpoint_trusted_apps_list.ts b/x-pack/plugins/lists/server/services/exception_lists/create_endpoint_trusted_apps_list.ts
index ada043403f248..a85f6da0f8b8f 100644
--- a/x-pack/plugins/lists/server/services/exception_lists/create_endpoint_trusted_apps_list.ts
+++ b/x-pack/plugins/lists/server/services/exception_lists/create_endpoint_trusted_apps_list.ts
@@ -7,14 +7,14 @@
import { SavedObjectsClientContract } from 'kibana/server';
import uuid from 'uuid';
-import { Version } from '@kbn/securitysolution-io-ts-types';
+import type { Version } from '@kbn/securitysolution-io-ts-types';
+import type { ExceptionListSchema } from '@kbn/securitysolution-io-ts-list-types';
import {
ENDPOINT_TRUSTED_APPS_LIST_DESCRIPTION,
ENDPOINT_TRUSTED_APPS_LIST_ID,
ENDPOINT_TRUSTED_APPS_LIST_NAME,
} from '../../../common/constants';
-import { ExceptionListSchema } from '../../../common/schemas';
import { ExceptionListSoSchema } from '../../schemas/saved_objects';
import { getSavedObjectType, transformSavedObjectToExceptionList } from './utils';
diff --git a/x-pack/plugins/lists/server/services/exception_lists/create_exception_list.ts b/x-pack/plugins/lists/server/services/exception_lists/create_exception_list.ts
index c6110dc4f470c..f1d1f15a576a0 100644
--- a/x-pack/plugins/lists/server/services/exception_lists/create_exception_list.ts
+++ b/x-pack/plugins/lists/server/services/exception_lists/create_exception_list.ts
@@ -7,9 +7,12 @@
import { SavedObjectsClientContract } from 'kibana/server';
import uuid from 'uuid';
-import {
+import type {
Description,
+ ExceptionListSchema,
ExceptionListType,
+ Immutable,
+ ListId,
MetaOrUndefined,
Name,
NamespaceType,
@@ -17,7 +20,6 @@ import {
} from '@kbn/securitysolution-io-ts-list-types';
import { Version } from '@kbn/securitysolution-io-ts-types';
-import { ExceptionListSchema, Immutable, ListId } from '../../../common/schemas';
import { ExceptionListSoSchema } from '../../schemas/saved_objects';
import { getSavedObjectType, transformSavedObjectToExceptionList } from './utils';
diff --git a/x-pack/plugins/lists/server/services/exception_lists/create_exception_list_item.ts b/x-pack/plugins/lists/server/services/exception_lists/create_exception_list_item.ts
index 0bcc888a4c313..763ee8e3d85c7 100644
--- a/x-pack/plugins/lists/server/services/exception_lists/create_exception_list_item.ts
+++ b/x-pack/plugins/lists/server/services/exception_lists/create_exception_list_item.ts
@@ -7,11 +7,14 @@
import { SavedObjectsClientContract } from 'kibana/server';
import uuid from 'uuid';
-import {
+import type {
CreateCommentsArray,
Description,
EntriesArray,
+ ExceptionListItemSchema,
ExceptionListItemType,
+ ItemId,
+ ListId,
MetaOrUndefined,
Name,
NamespaceType,
@@ -19,7 +22,6 @@ import {
Tags,
} from '@kbn/securitysolution-io-ts-list-types';
-import { ExceptionListItemSchema, ItemId, ListId } from '../../../common/schemas';
import { ExceptionListSoSchema } from '../../schemas/saved_objects';
import {
diff --git a/x-pack/plugins/lists/server/services/exception_lists/delete_exception_list.ts b/x-pack/plugins/lists/server/services/exception_lists/delete_exception_list.ts
index 201cb9544a8f3..def0585740d45 100644
--- a/x-pack/plugins/lists/server/services/exception_lists/delete_exception_list.ts
+++ b/x-pack/plugins/lists/server/services/exception_lists/delete_exception_list.ts
@@ -6,9 +6,12 @@
*/
import { SavedObjectsClientContract } from 'kibana/server';
-import { IdOrUndefined, NamespaceType } from '@kbn/securitysolution-io-ts-list-types';
-
-import { ExceptionListSchema, ListIdOrUndefined } from '../../../common/schemas';
+import type {
+ ExceptionListSchema,
+ IdOrUndefined,
+ ListIdOrUndefined,
+ NamespaceType,
+} from '@kbn/securitysolution-io-ts-list-types';
import { getSavedObjectType } from './utils';
import { getExceptionList } from './get_exception_list';
diff --git a/x-pack/plugins/lists/server/services/exception_lists/delete_exception_list_item.ts b/x-pack/plugins/lists/server/services/exception_lists/delete_exception_list_item.ts
index 9f735fd51c7f2..65df08a445b58 100644
--- a/x-pack/plugins/lists/server/services/exception_lists/delete_exception_list_item.ts
+++ b/x-pack/plugins/lists/server/services/exception_lists/delete_exception_list_item.ts
@@ -6,9 +6,13 @@
*/
import { SavedObjectsClientContract } from 'kibana/server';
-import { Id, IdOrUndefined, NamespaceType } from '@kbn/securitysolution-io-ts-list-types';
-
-import { ExceptionListItemSchema, ItemIdOrUndefined } from '../../../common/schemas';
+import type {
+ ExceptionListItemSchema,
+ Id,
+ IdOrUndefined,
+ ItemIdOrUndefined,
+ NamespaceType,
+} from '@kbn/securitysolution-io-ts-list-types';
import { getSavedObjectType } from './utils';
import { getExceptionListItem } from './get_exception_list_item';
diff --git a/x-pack/plugins/lists/server/services/exception_lists/delete_exception_list_items_by_list.ts b/x-pack/plugins/lists/server/services/exception_lists/delete_exception_list_items_by_list.ts
index b08872eac8e01..b3190d174bb71 100644
--- a/x-pack/plugins/lists/server/services/exception_lists/delete_exception_list_items_by_list.ts
+++ b/x-pack/plugins/lists/server/services/exception_lists/delete_exception_list_items_by_list.ts
@@ -5,10 +5,9 @@
* 2.0.
*/
-import { NamespaceType } from '@kbn/securitysolution-io-ts-list-types';
+import type { ListId, NamespaceType } from '@kbn/securitysolution-io-ts-list-types';
import { SavedObjectsClientContract } from '../../../../../../src/core/server/';
-import { ListId } from '../../../common/schemas';
import { findExceptionListItem } from './find_exception_list_item';
import { getSavedObjectType } from './utils';
diff --git a/x-pack/plugins/lists/server/services/exception_lists/exception_list_client.ts b/x-pack/plugins/lists/server/services/exception_lists/exception_list_client.ts
index 84b6de1672cd6..a613219776004 100644
--- a/x-pack/plugins/lists/server/services/exception_lists/exception_list_client.ts
+++ b/x-pack/plugins/lists/server/services/exception_lists/exception_list_client.ts
@@ -6,14 +6,14 @@
*/
import { SavedObjectsClientContract } from 'kibana/server';
-
-import { ENDPOINT_LIST_ID } from '../../../common/constants';
-import {
+import type {
ExceptionListItemSchema,
ExceptionListSchema,
FoundExceptionListItemSchema,
FoundExceptionListSchema,
-} from '../../../common/schemas';
+} from '@kbn/securitysolution-io-ts-list-types';
+
+import { ENDPOINT_LIST_ID } from '../../../common/constants';
import {
ConstructorOptions,
diff --git a/x-pack/plugins/lists/server/services/exception_lists/exception_list_client_types.ts b/x-pack/plugins/lists/server/services/exception_lists/exception_list_client_types.ts
index c6f5e3a3bc166..cbbf7f1513444 100644
--- a/x-pack/plugins/lists/server/services/exception_lists/exception_list_client_types.ts
+++ b/x-pack/plugins/lists/server/services/exception_lists/exception_list_client_types.ts
@@ -6,7 +6,7 @@
*/
import { SavedObjectsClientContract } from 'kibana/server';
-import {
+import type {
CreateCommentsArray,
Description,
DescriptionOrUndefined,
@@ -15,17 +15,28 @@ import {
ExceptionListItemTypeOrUndefined,
ExceptionListType,
ExceptionListTypeOrUndefined,
+ FilterOrUndefined,
Id,
IdOrUndefined,
+ Immutable,
+ ItemId,
+ ItemIdOrUndefined,
+ ListId,
+ ListIdOrUndefined,
MetaOrUndefined,
Name,
NameOrUndefined,
NamespaceType,
NamespaceTypeArray,
OsTypeArray,
+ PageOrUndefined,
+ PerPageOrUndefined,
+ SortFieldOrUndefined,
+ SortOrderOrUndefined,
Tags,
TagsOrUndefined,
UpdateCommentsArray,
+ _VersionOrUndefined,
} from '@kbn/securitysolution-io-ts-list-types';
import {
EmptyStringArrayDecoded,
@@ -34,20 +45,6 @@ import {
VersionOrUndefined,
} from '@kbn/securitysolution-io-ts-types';
-import {
- FilterOrUndefined,
- Immutable,
- ItemId,
- ItemIdOrUndefined,
- ListId,
- ListIdOrUndefined,
- PageOrUndefined,
- PerPageOrUndefined,
- SortFieldOrUndefined,
- SortOrderOrUndefined,
- _VersionOrUndefined,
-} from '../../../common/schemas';
-
export interface ConstructorOptions {
user: string;
savedObjectsClient: SavedObjectsClientContract;
diff --git a/x-pack/plugins/lists/server/services/exception_lists/find_exception_list.ts b/x-pack/plugins/lists/server/services/exception_lists/find_exception_list.ts
index dfe7a97d0b2f3..314cfc75e5a11 100644
--- a/x-pack/plugins/lists/server/services/exception_lists/find_exception_list.ts
+++ b/x-pack/plugins/lists/server/services/exception_lists/find_exception_list.ts
@@ -6,17 +6,17 @@
*/
import { SavedObjectsClientContract } from 'kibana/server';
-import { NamespaceTypeArray } from '@kbn/securitysolution-io-ts-list-types';
-
-import { SavedObjectType } from '../../../common/types';
-import {
+import type {
FilterOrUndefined,
FoundExceptionListSchema,
+ NamespaceTypeArray,
PageOrUndefined,
PerPageOrUndefined,
SortFieldOrUndefined,
SortOrderOrUndefined,
-} from '../../../common/schemas';
+} from '@kbn/securitysolution-io-ts-list-types';
+
+import { SavedObjectType } from '../../../common/types';
import { ExceptionListSoSchema } from '../../schemas/saved_objects';
import { getSavedObjectTypes, transformSavedObjectsToFoundExceptionList } from './utils';
diff --git a/x-pack/plugins/lists/server/services/exception_lists/find_exception_list_item.ts b/x-pack/plugins/lists/server/services/exception_lists/find_exception_list_item.ts
index b75520614150b..3d050652afed1 100644
--- a/x-pack/plugins/lists/server/services/exception_lists/find_exception_list_item.ts
+++ b/x-pack/plugins/lists/server/services/exception_lists/find_exception_list_item.ts
@@ -6,17 +6,16 @@
*/
import { SavedObjectsClientContract } from 'kibana/server';
-import { NamespaceType } from '@kbn/securitysolution-io-ts-list-types';
-
-import {
+import type {
FilterOrUndefined,
FoundExceptionListItemSchema,
ListId,
+ NamespaceType,
PageOrUndefined,
PerPageOrUndefined,
SortFieldOrUndefined,
SortOrderOrUndefined,
-} from '../../../common/schemas';
+} from '@kbn/securitysolution-io-ts-list-types';
import { findExceptionListsItem } from './find_exception_list_items';
diff --git a/x-pack/plugins/lists/server/services/exception_lists/find_exception_list_items.ts b/x-pack/plugins/lists/server/services/exception_lists/find_exception_list_items.ts
index ad4646a57a5ca..04eca6a042ace 100644
--- a/x-pack/plugins/lists/server/services/exception_lists/find_exception_list_items.ts
+++ b/x-pack/plugins/lists/server/services/exception_lists/find_exception_list_items.ts
@@ -6,8 +6,16 @@
*/
import { SavedObjectsClientContract } from 'kibana/server';
-import { Id, NamespaceTypeArray } from '@kbn/securitysolution-io-ts-list-types';
-import {
+import type {
+ FoundExceptionListItemSchema,
+ Id,
+ NamespaceTypeArray,
+ PageOrUndefined,
+ PerPageOrUndefined,
+ SortFieldOrUndefined,
+ SortOrderOrUndefined,
+} from '@kbn/securitysolution-io-ts-list-types';
+import type {
EmptyStringArrayDecoded,
NonEmptyStringArrayDecoded,
} from '@kbn/securitysolution-io-ts-types';
@@ -17,13 +25,6 @@ import {
exceptionListAgnosticSavedObjectType,
exceptionListSavedObjectType,
} from '../../../common/types';
-import {
- FoundExceptionListItemSchema,
- PageOrUndefined,
- PerPageOrUndefined,
- SortFieldOrUndefined,
- SortOrderOrUndefined,
-} from '../../../common/schemas';
import { escapeQuotes } from '../utils/escape_query';
import { ExceptionListSoSchema } from '../../schemas/saved_objects';
diff --git a/x-pack/plugins/lists/server/services/exception_lists/get_exception_list.ts b/x-pack/plugins/lists/server/services/exception_lists/get_exception_list.ts
index 928190efbf531..e1dc8bfe98847 100644
--- a/x-pack/plugins/lists/server/services/exception_lists/get_exception_list.ts
+++ b/x-pack/plugins/lists/server/services/exception_lists/get_exception_list.ts
@@ -5,13 +5,17 @@
* 2.0.
*/
-import { IdOrUndefined, NamespaceType } from '@kbn/securitysolution-io-ts-list-types';
+import type {
+ ExceptionListSchema,
+ IdOrUndefined,
+ ListIdOrUndefined,
+ NamespaceType,
+} from '@kbn/securitysolution-io-ts-list-types';
import {
SavedObjectsClientContract,
SavedObjectsErrorHelpers,
} from '../../../../../../src/core/server/';
-import { ExceptionListSchema, ListIdOrUndefined } from '../../../common/schemas';
import { ExceptionListSoSchema } from '../../schemas/saved_objects';
import { getSavedObjectType, transformSavedObjectToExceptionList } from './utils';
diff --git a/x-pack/plugins/lists/server/services/exception_lists/get_exception_list_item.ts b/x-pack/plugins/lists/server/services/exception_lists/get_exception_list_item.ts
index be612868abe48..a8b201cff0397 100644
--- a/x-pack/plugins/lists/server/services/exception_lists/get_exception_list_item.ts
+++ b/x-pack/plugins/lists/server/services/exception_lists/get_exception_list_item.ts
@@ -5,13 +5,17 @@
* 2.0.
*/
-import { IdOrUndefined, NamespaceType } from '@kbn/securitysolution-io-ts-list-types';
+import type {
+ ExceptionListItemSchema,
+ IdOrUndefined,
+ ItemIdOrUndefined,
+ NamespaceType,
+} from '@kbn/securitysolution-io-ts-list-types';
import {
SavedObjectsClientContract,
SavedObjectsErrorHelpers,
} from '../../../../../../src/core/server/';
-import { ExceptionListItemSchema, ItemIdOrUndefined } from '../../../common/schemas';
import { ExceptionListSoSchema } from '../../schemas/saved_objects';
import { getSavedObjectType, transformSavedObjectToExceptionListItem } from './utils';
diff --git a/x-pack/plugins/lists/server/services/exception_lists/update_exception_list.ts b/x-pack/plugins/lists/server/services/exception_lists/update_exception_list.ts
index 43c319cca0005..0cdae4375fa59 100644
--- a/x-pack/plugins/lists/server/services/exception_lists/update_exception_list.ts
+++ b/x-pack/plugins/lists/server/services/exception_lists/update_exception_list.ts
@@ -6,23 +6,21 @@
*/
import { SavedObjectsClientContract } from 'kibana/server';
-import {
+import type {
DescriptionOrUndefined,
+ ExceptionListSchema,
ExceptionListTypeOrUndefined,
IdOrUndefined,
+ ListIdOrUndefined,
MetaOrUndefined,
NameOrUndefined,
NamespaceType,
OsTypeArray,
TagsOrUndefined,
+ _VersionOrUndefined,
} from '@kbn/securitysolution-io-ts-list-types';
import { VersionOrUndefined } from '@kbn/securitysolution-io-ts-types';
-import {
- ExceptionListSchema,
- ListIdOrUndefined,
- _VersionOrUndefined,
-} from '../../../common/schemas';
import { ExceptionListSoSchema } from '../../schemas/saved_objects';
import { getSavedObjectType, transformSavedObjectUpdateToExceptionList } from './utils';
diff --git a/x-pack/plugins/lists/server/services/exception_lists/update_exception_list_item.ts b/x-pack/plugins/lists/server/services/exception_lists/update_exception_list_item.ts
index 0d9ba8d8fefcc..2c1f5b81b2bcf 100644
--- a/x-pack/plugins/lists/server/services/exception_lists/update_exception_list_item.ts
+++ b/x-pack/plugins/lists/server/services/exception_lists/update_exception_list_item.ts
@@ -6,24 +6,22 @@
*/
import { SavedObjectsClientContract } from 'kibana/server';
-import {
+import type {
DescriptionOrUndefined,
EntriesArray,
+ ExceptionListItemSchema,
ExceptionListItemTypeOrUndefined,
IdOrUndefined,
+ ItemIdOrUndefined,
MetaOrUndefined,
NameOrUndefined,
NamespaceType,
OsTypeArray,
TagsOrUndefined,
UpdateCommentsArrayOrUndefined,
+ _VersionOrUndefined,
} from '@kbn/securitysolution-io-ts-list-types';
-import {
- ExceptionListItemSchema,
- ItemIdOrUndefined,
- _VersionOrUndefined,
-} from '../../../common/schemas';
import { ExceptionListSoSchema } from '../../schemas/saved_objects';
import {
diff --git a/x-pack/plugins/lists/server/services/exception_lists/utils.ts b/x-pack/plugins/lists/server/services/exception_lists/utils.ts
index 12fe8eabd4f6a..7479510110709 100644
--- a/x-pack/plugins/lists/server/services/exception_lists/utils.ts
+++ b/x-pack/plugins/lists/server/services/exception_lists/utils.ts
@@ -11,6 +11,10 @@ import {
CommentsArray,
CreateComment,
CreateCommentsArray,
+ ExceptionListItemSchema,
+ ExceptionListSchema,
+ FoundExceptionListItemSchema,
+ FoundExceptionListSchema,
NamespaceType,
NamespaceTypeArray,
UpdateCommentsArrayOrUndefined,
@@ -23,12 +27,6 @@ import {
exceptionListAgnosticSavedObjectType,
exceptionListSavedObjectType,
} from '../../../common/types';
-import {
- ExceptionListItemSchema,
- ExceptionListSchema,
- FoundExceptionListItemSchema,
- FoundExceptionListSchema,
-} from '../../../common/schemas';
import { ExceptionListSoSchema } from '../../schemas/saved_objects';
export const getSavedObjectType = ({
diff --git a/x-pack/plugins/lists/server/services/items/create_list_item.ts b/x-pack/plugins/lists/server/services/items/create_list_item.ts
index ebeef3e90933d..b4203f000b7b9 100644
--- a/x-pack/plugins/lists/server/services/items/create_list_item.ts
+++ b/x-pack/plugins/lists/server/services/items/create_list_item.ts
@@ -7,13 +7,15 @@
import uuid from 'uuid';
import { ElasticsearchClient } from 'kibana/server';
-import { IdOrUndefined, MetaOrUndefined, Type } from '@kbn/securitysolution-io-ts-list-types';
-
import {
DeserializerOrUndefined,
+ IdOrUndefined,
ListItemSchema,
+ MetaOrUndefined,
SerializerOrUndefined,
-} from '../../../common/schemas';
+ Type,
+} from '@kbn/securitysolution-io-ts-list-types';
+
import { transformListItemToElasticQuery } from '../utils';
import { encodeHitVersion } from '../utils/encode_hit_version';
import { IndexEsListItemSchema } from '../../schemas/elastic_query';
diff --git a/x-pack/plugins/lists/server/services/items/create_list_items_bulk.ts b/x-pack/plugins/lists/server/services/items/create_list_items_bulk.ts
index 00956a7c3c3fa..d9b3bc322cd7a 100644
--- a/x-pack/plugins/lists/server/services/items/create_list_items_bulk.ts
+++ b/x-pack/plugins/lists/server/services/items/create_list_items_bulk.ts
@@ -7,10 +7,14 @@
import uuid from 'uuid';
import { ElasticsearchClient } from 'kibana/server';
-import { MetaOrUndefined, Type } from '@kbn/securitysolution-io-ts-list-types';
+import type {
+ DeserializerOrUndefined,
+ MetaOrUndefined,
+ SerializerOrUndefined,
+ Type,
+} from '@kbn/securitysolution-io-ts-list-types';
import { transformListItemToElasticQuery } from '../utils';
-import { DeserializerOrUndefined, SerializerOrUndefined } from '../../../common/schemas';
import { CreateEsBulkTypeSchema, IndexEsListItemSchema } from '../../schemas/elastic_query';
export interface CreateListItemsBulkOptions {
diff --git a/x-pack/plugins/lists/server/services/items/delete_list_item.ts b/x-pack/plugins/lists/server/services/items/delete_list_item.ts
index c08e683aafa1c..c43f2faf8c52d 100644
--- a/x-pack/plugins/lists/server/services/items/delete_list_item.ts
+++ b/x-pack/plugins/lists/server/services/items/delete_list_item.ts
@@ -6,9 +6,7 @@
*/
import { ElasticsearchClient } from 'kibana/server';
-import { Id } from '@kbn/securitysolution-io-ts-list-types';
-
-import { ListItemSchema } from '../../../common/schemas';
+import type { Id, ListItemSchema } from '@kbn/securitysolution-io-ts-list-types';
import { getListItem } from '.';
diff --git a/x-pack/plugins/lists/server/services/items/delete_list_item_by_value.ts b/x-pack/plugins/lists/server/services/items/delete_list_item_by_value.ts
index 1adcf45e85748..cc3dc92f8f152 100644
--- a/x-pack/plugins/lists/server/services/items/delete_list_item_by_value.ts
+++ b/x-pack/plugins/lists/server/services/items/delete_list_item_by_value.ts
@@ -6,9 +6,8 @@
*/
import { ElasticsearchClient } from 'kibana/server';
-import { Type } from '@kbn/securitysolution-io-ts-list-types';
+import type { ListItemArraySchema, Type } from '@kbn/securitysolution-io-ts-list-types';
-import { ListItemArraySchema } from '../../../common/schemas';
import { getQueryFilterFromTypeValue } from '../utils';
import { getListItemByValues } from './get_list_item_by_values';
diff --git a/x-pack/plugins/lists/server/services/items/find_list_item.ts b/x-pack/plugins/lists/server/services/items/find_list_item.ts
index e1586daf1cbb1..803cc34ed2a12 100644
--- a/x-pack/plugins/lists/server/services/items/find_list_item.ts
+++ b/x-pack/plugins/lists/server/services/items/find_list_item.ts
@@ -6,8 +6,7 @@
*/
import { ElasticsearchClient } from 'kibana/server';
-
-import {
+import type {
Filter,
FoundListItemSchema,
ListId,
@@ -15,7 +14,8 @@ import {
PerPage,
SortFieldOrUndefined,
SortOrderOrUndefined,
-} from '../../../common/schemas';
+} from '@kbn/securitysolution-io-ts-list-types';
+
import { SearchEsListItemSchema } from '../../schemas/elastic_response';
import { getList } from '../lists';
import {
diff --git a/x-pack/plugins/lists/server/services/items/get_list_item.ts b/x-pack/plugins/lists/server/services/items/get_list_item.ts
index a1653cb31ce16..f7b9c06349870 100644
--- a/x-pack/plugins/lists/server/services/items/get_list_item.ts
+++ b/x-pack/plugins/lists/server/services/items/get_list_item.ts
@@ -6,9 +6,8 @@
*/
import { ElasticsearchClient } from 'kibana/server';
-import { Id } from '@kbn/securitysolution-io-ts-list-types';
+import type { Id, ListItemSchema } from '@kbn/securitysolution-io-ts-list-types';
-import { ListItemSchema } from '../../../common/schemas';
import { transformElasticToListItem } from '../utils';
import { findSourceType } from '../utils/find_source_type';
import { SearchEsListItemSchema } from '../../schemas/elastic_response';
diff --git a/x-pack/plugins/lists/server/services/items/get_list_item_by_value.ts b/x-pack/plugins/lists/server/services/items/get_list_item_by_value.ts
index a190f9388bef3..d631720d11cd3 100644
--- a/x-pack/plugins/lists/server/services/items/get_list_item_by_value.ts
+++ b/x-pack/plugins/lists/server/services/items/get_list_item_by_value.ts
@@ -6,9 +6,7 @@
*/
import { ElasticsearchClient } from 'kibana/server';
-import { Type } from '@kbn/securitysolution-io-ts-list-types';
-
-import { ListItemArraySchema } from '../../../common/schemas';
+import type { ListItemArraySchema, Type } from '@kbn/securitysolution-io-ts-list-types';
import { getListItemByValues } from '.';
diff --git a/x-pack/plugins/lists/server/services/items/get_list_item_by_values.ts b/x-pack/plugins/lists/server/services/items/get_list_item_by_values.ts
index 0fcb958940d9b..9c7709b6f4459 100644
--- a/x-pack/plugins/lists/server/services/items/get_list_item_by_values.ts
+++ b/x-pack/plugins/lists/server/services/items/get_list_item_by_values.ts
@@ -6,9 +6,8 @@
*/
import { ElasticsearchClient } from 'kibana/server';
-import { Type } from '@kbn/securitysolution-io-ts-list-types';
+import type { ListItemArraySchema, Type } from '@kbn/securitysolution-io-ts-list-types';
-import { ListItemArraySchema } from '../../../common/schemas';
import {
TransformElasticToListItemOptions,
getQueryFilterFromTypeValue,
diff --git a/x-pack/plugins/lists/server/services/items/search_list_item_by_values.test.ts b/x-pack/plugins/lists/server/services/items/search_list_item_by_values.test.ts
index 817432495926b..174a44ce16600 100644
--- a/x-pack/plugins/lists/server/services/items/search_list_item_by_values.test.ts
+++ b/x-pack/plugins/lists/server/services/items/search_list_item_by_values.test.ts
@@ -7,8 +7,8 @@
// eslint-disable-next-line @kbn/eslint/no-restricted-paths
import { elasticsearchClientMock } from 'src/core/server/elasticsearch/client/mocks';
+import type { SearchListItemArraySchema } from '@kbn/securitysolution-io-ts-list-types';
-import { SearchListItemArraySchema } from '../../../common/schemas';
import { LIST_ID, LIST_ITEM_INDEX, TYPE, VALUE, VALUE_2 } from '../../../common/constants.mock';
import { getSearchListItemMock } from '../../schemas/elastic_response/search_es_list_item_schema.mock';
diff --git a/x-pack/plugins/lists/server/services/items/search_list_item_by_values.ts b/x-pack/plugins/lists/server/services/items/search_list_item_by_values.ts
index 2b525fde6a428..942791c0ebe91 100644
--- a/x-pack/plugins/lists/server/services/items/search_list_item_by_values.ts
+++ b/x-pack/plugins/lists/server/services/items/search_list_item_by_values.ts
@@ -6,9 +6,8 @@
*/
import { ElasticsearchClient } from 'kibana/server';
-import { Type } from '@kbn/securitysolution-io-ts-list-types';
+import type { SearchListItemArraySchema, Type } from '@kbn/securitysolution-io-ts-list-types';
-import { SearchListItemArraySchema } from '../../../common/schemas';
import {
TransformElasticMSearchToListItemOptions,
getQueryFilterFromTypeValue,
diff --git a/x-pack/plugins/lists/server/services/items/update_list_item.test.ts b/x-pack/plugins/lists/server/services/items/update_list_item.test.ts
index 195bce879f34d..8d8f1e117647a 100644
--- a/x-pack/plugins/lists/server/services/items/update_list_item.test.ts
+++ b/x-pack/plugins/lists/server/services/items/update_list_item.test.ts
@@ -7,8 +7,8 @@
// eslint-disable-next-line @kbn/eslint/no-restricted-paths
import { elasticsearchClientMock } from 'src/core/server/elasticsearch/client/mocks';
+import type { ListItemSchema } from '@kbn/securitysolution-io-ts-list-types';
-import { ListItemSchema } from '../../../common/schemas';
import { getListItemResponseMock } from '../../../common/schemas/response/list_item_schema.mock';
import { updateListItem } from './update_list_item';
diff --git a/x-pack/plugins/lists/server/services/items/update_list_item.ts b/x-pack/plugins/lists/server/services/items/update_list_item.ts
index 4f1a19430aeda..c73149019f416 100644
--- a/x-pack/plugins/lists/server/services/items/update_list_item.ts
+++ b/x-pack/plugins/lists/server/services/items/update_list_item.ts
@@ -6,9 +6,13 @@
*/
import { ElasticsearchClient } from 'kibana/server';
-import { Id, MetaOrUndefined } from '@kbn/securitysolution-io-ts-list-types';
+import type {
+ Id,
+ ListItemSchema,
+ MetaOrUndefined,
+ _VersionOrUndefined,
+} from '@kbn/securitysolution-io-ts-list-types';
-import { ListItemSchema, _VersionOrUndefined } from '../../../common/schemas';
import { transformListItemToElasticQuery } from '../utils';
import { decodeVersion } from '../utils/decode_version';
import { encodeHitVersion } from '../utils/encode_hit_version';
diff --git a/x-pack/plugins/lists/server/services/items/write_lines_to_bulk_list_items.ts b/x-pack/plugins/lists/server/services/items/write_lines_to_bulk_list_items.ts
index 392c44cf72b00..89a6bdbc77878 100644
--- a/x-pack/plugins/lists/server/services/items/write_lines_to_bulk_list_items.ts
+++ b/x-pack/plugins/lists/server/services/items/write_lines_to_bulk_list_items.ts
@@ -8,16 +8,17 @@
import { Readable } from 'stream';
import { ElasticsearchClient } from 'kibana/server';
-import { MetaOrUndefined, Type } from '@kbn/securitysolution-io-ts-list-types';
-import { Version } from '@kbn/securitysolution-io-ts-types';
-
-import { createListIfItDoesNotExist } from '../lists/create_list_if_it_does_not_exist';
-import {
+import type {
DeserializerOrUndefined,
ListIdOrUndefined,
ListSchema,
+ MetaOrUndefined,
SerializerOrUndefined,
-} from '../../../common/schemas';
+ Type,
+} from '@kbn/securitysolution-io-ts-list-types';
+import { Version } from '@kbn/securitysolution-io-ts-types';
+
+import { createListIfItDoesNotExist } from '../lists/create_list_if_it_does_not_exist';
import { ConfigType } from '../../config';
import { BufferLines } from './buffer_lines';
diff --git a/x-pack/plugins/lists/server/services/lists/create_list.test.ts b/x-pack/plugins/lists/server/services/lists/create_list.test.ts
index 600d148d77b95..0474f1bac2700 100644
--- a/x-pack/plugins/lists/server/services/lists/create_list.test.ts
+++ b/x-pack/plugins/lists/server/services/lists/create_list.test.ts
@@ -7,8 +7,8 @@
// eslint-disable-next-line @kbn/eslint/no-restricted-paths
import { elasticsearchClientMock } from 'src/core/server/elasticsearch/client/mocks';
+import type { ListSchema } from '@kbn/securitysolution-io-ts-list-types';
-import { ListSchema } from '../../../common/schemas';
import { getListResponseMock } from '../../../common/schemas/response/list_schema.mock';
import { LIST_ID, LIST_INDEX } from '../../../common/constants.mock';
import { getIndexESListMock } from '../../schemas/elastic_query/index_es_list_schema.mock';
diff --git a/x-pack/plugins/lists/server/services/lists/create_list.ts b/x-pack/plugins/lists/server/services/lists/create_list.ts
index bd5b3c901fdc5..6c7081d7c701e 100644
--- a/x-pack/plugins/lists/server/services/lists/create_list.ts
+++ b/x-pack/plugins/lists/server/services/lists/create_list.ts
@@ -7,22 +7,20 @@
import uuid from 'uuid';
import { ElasticsearchClient } from 'kibana/server';
-import {
+import type {
Description,
+ DeserializerOrUndefined,
IdOrUndefined,
+ Immutable,
+ ListSchema,
MetaOrUndefined,
Name,
+ SerializerOrUndefined,
Type,
} from '@kbn/securitysolution-io-ts-list-types';
-import { Version } from '@kbn/securitysolution-io-ts-types';
+import type { Version } from '@kbn/securitysolution-io-ts-types';
import { encodeHitVersion } from '../utils/encode_hit_version';
-import {
- DeserializerOrUndefined,
- Immutable,
- ListSchema,
- SerializerOrUndefined,
-} from '../../../common/schemas';
import { IndexEsListSchema } from '../../schemas/elastic_query';
export interface CreateListOptions {
diff --git a/x-pack/plugins/lists/server/services/lists/create_list_if_it_does_not_exist.ts b/x-pack/plugins/lists/server/services/lists/create_list_if_it_does_not_exist.ts
index 4d4e634a465a7..f97fbd2d88cc0 100644
--- a/x-pack/plugins/lists/server/services/lists/create_list_if_it_does_not_exist.ts
+++ b/x-pack/plugins/lists/server/services/lists/create_list_if_it_does_not_exist.ts
@@ -6,21 +6,18 @@
*/
import { ElasticsearchClient } from 'kibana/server';
-import {
+import type {
Description,
+ DeserializerOrUndefined,
Id,
+ Immutable,
+ ListSchema,
MetaOrUndefined,
Name,
+ SerializerOrUndefined,
Type,
} from '@kbn/securitysolution-io-ts-list-types';
-import { Version } from '@kbn/securitysolution-io-ts-types';
-
-import {
- DeserializerOrUndefined,
- Immutable,
- ListSchema,
- SerializerOrUndefined,
-} from '../../../common/schemas';
+import type { Version } from '@kbn/securitysolution-io-ts-types';
import { getList } from './get_list';
import { createList } from './create_list';
diff --git a/x-pack/plugins/lists/server/services/lists/delete_list.ts b/x-pack/plugins/lists/server/services/lists/delete_list.ts
index a215044b92b4c..b9a55e107ab76 100644
--- a/x-pack/plugins/lists/server/services/lists/delete_list.ts
+++ b/x-pack/plugins/lists/server/services/lists/delete_list.ts
@@ -6,9 +6,7 @@
*/
import { ElasticsearchClient } from 'kibana/server';
-import { Id } from '@kbn/securitysolution-io-ts-list-types';
-
-import { ListSchema } from '../../../common/schemas';
+import type { Id, ListSchema } from '@kbn/securitysolution-io-ts-list-types';
import { getList } from './get_list';
diff --git a/x-pack/plugins/lists/server/services/lists/find_list.ts b/x-pack/plugins/lists/server/services/lists/find_list.ts
index 92d7262c19543..1c7a5fe60b995 100644
--- a/x-pack/plugins/lists/server/services/lists/find_list.ts
+++ b/x-pack/plugins/lists/server/services/lists/find_list.ts
@@ -6,15 +6,15 @@
*/
import { ElasticsearchClient } from 'kibana/server';
-
-import {
+import type {
Filter,
FoundListSchema,
Page,
PerPage,
SortFieldOrUndefined,
SortOrderOrUndefined,
-} from '../../../common/schemas';
+} from '@kbn/securitysolution-io-ts-list-types';
+
import { SearchEsListSchema } from '../../schemas/elastic_response';
import {
encodeCursor,
diff --git a/x-pack/plugins/lists/server/services/lists/get_list.ts b/x-pack/plugins/lists/server/services/lists/get_list.ts
index 7ff17bc2ee553..9b120ca0dd358 100644
--- a/x-pack/plugins/lists/server/services/lists/get_list.ts
+++ b/x-pack/plugins/lists/server/services/lists/get_list.ts
@@ -6,9 +6,8 @@
*/
import { ElasticsearchClient } from 'kibana/server';
-import { Id } from '@kbn/securitysolution-io-ts-list-types';
+import type { Id, ListSchema } from '@kbn/securitysolution-io-ts-list-types';
-import { ListSchema } from '../../../common/schemas';
import { transformElasticToList } from '../utils/transform_elastic_to_list';
import { SearchEsListSchema } from '../../schemas/elastic_response';
diff --git a/x-pack/plugins/lists/server/services/lists/list_client.ts b/x-pack/plugins/lists/server/services/lists/list_client.ts
index a602bcf943808..107bc31f2baea 100644
--- a/x-pack/plugins/lists/server/services/lists/list_client.ts
+++ b/x-pack/plugins/lists/server/services/lists/list_client.ts
@@ -17,15 +17,15 @@ import {
setPolicy,
setTemplate,
} from '@kbn/securitysolution-es-utils';
-
-import {
+import type {
FoundListItemSchema,
FoundListSchema,
ListItemArraySchema,
ListItemSchema,
ListSchema,
SearchListItemArraySchema,
-} from '../../../common/schemas';
+} from '@kbn/securitysolution-io-ts-list-types';
+
import { ConfigType } from '../../config';
import {
createList,
diff --git a/x-pack/plugins/lists/server/services/lists/list_client_types.ts b/x-pack/plugins/lists/server/services/lists/list_client_types.ts
index 28732090342cd..86b69d5469dc4 100644
--- a/x-pack/plugins/lists/server/services/lists/list_client_types.ts
+++ b/x-pack/plugins/lists/server/services/lists/list_client_types.ts
@@ -8,31 +8,29 @@
import { PassThrough, Readable } from 'stream';
import { ElasticsearchClient } from 'kibana/server';
-import {
+import type {
Description,
DescriptionOrUndefined,
- Id,
- IdOrUndefined,
- MetaOrUndefined,
- Name,
- NameOrUndefined,
- Type,
-} from '@kbn/securitysolution-io-ts-list-types';
-import { Version, VersionOrUndefined } from '@kbn/securitysolution-io-ts-types';
-
-import {
DeserializerOrUndefined,
Filter,
+ Id,
+ IdOrUndefined,
Immutable,
ListId,
ListIdOrUndefined,
+ MetaOrUndefined,
+ Name,
+ NameOrUndefined,
Page,
PerPage,
SerializerOrUndefined,
SortFieldOrUndefined,
SortOrderOrUndefined,
+ Type,
_VersionOrUndefined,
-} from '../../../common/schemas';
+} from '@kbn/securitysolution-io-ts-list-types';
+import { Version, VersionOrUndefined } from '@kbn/securitysolution-io-ts-types';
+
import { ConfigType } from '../../config';
export interface ConstructorOptions {
diff --git a/x-pack/plugins/lists/server/services/lists/update_list.test.ts b/x-pack/plugins/lists/server/services/lists/update_list.test.ts
index 8cc1c60ecc23d..df5aa4e53ca6c 100644
--- a/x-pack/plugins/lists/server/services/lists/update_list.test.ts
+++ b/x-pack/plugins/lists/server/services/lists/update_list.test.ts
@@ -7,8 +7,8 @@
// eslint-disable-next-line @kbn/eslint/no-restricted-paths
import { elasticsearchClientMock } from 'src/core/server/elasticsearch/client/mocks';
+import type { ListSchema } from '@kbn/securitysolution-io-ts-list-types';
-import { ListSchema } from '../../../common/schemas';
import { getListResponseMock } from '../../../common/schemas/response/list_schema.mock';
import { updateList } from './update_list';
diff --git a/x-pack/plugins/lists/server/services/lists/update_list.ts b/x-pack/plugins/lists/server/services/lists/update_list.ts
index 2e1cc43826817..22235341ca075 100644
--- a/x-pack/plugins/lists/server/services/lists/update_list.ts
+++ b/x-pack/plugins/lists/server/services/lists/update_list.ts
@@ -6,17 +6,18 @@
*/
import { ElasticsearchClient } from 'kibana/server';
-import {
+import type {
DescriptionOrUndefined,
Id,
+ ListSchema,
MetaOrUndefined,
NameOrUndefined,
+ _VersionOrUndefined,
} from '@kbn/securitysolution-io-ts-list-types';
import { VersionOrUndefined } from '@kbn/securitysolution-io-ts-types';
import { decodeVersion } from '../utils/decode_version';
import { encodeHitVersion } from '../utils/encode_hit_version';
-import { ListSchema, _VersionOrUndefined } from '../../../common/schemas';
import { UpdateEsListSchema } from '../../schemas/elastic_query';
import { getList } from '.';
diff --git a/x-pack/plugins/lists/server/services/utils/calculate_scroll_math.ts b/x-pack/plugins/lists/server/services/utils/calculate_scroll_math.ts
index 1ea8deda602c7..e2f2229188ef4 100644
--- a/x-pack/plugins/lists/server/services/utils/calculate_scroll_math.ts
+++ b/x-pack/plugins/lists/server/services/utils/calculate_scroll_math.ts
@@ -5,7 +5,7 @@
* 2.0.
*/
-import { Page, PerPage } from '../../../common/schemas';
+import type { Page, PerPage } from '@kbn/securitysolution-io-ts-list-types';
interface CalculateScrollMathOptions {
perPage: PerPage;
diff --git a/x-pack/plugins/lists/server/services/utils/encode_decode_cursor.ts b/x-pack/plugins/lists/server/services/utils/encode_decode_cursor.ts
index a1a349d5e38da..e7b785aea9fb5 100644
--- a/x-pack/plugins/lists/server/services/utils/encode_decode_cursor.ts
+++ b/x-pack/plugins/lists/server/services/utils/encode_decode_cursor.ts
@@ -9,8 +9,10 @@ import * as t from 'io-ts';
import { fold } from 'fp-ts/lib/Either';
import { pipe } from 'fp-ts/lib/pipeable';
import { exactCheck } from '@kbn/securitysolution-io-ts-utils';
-
-import { CursorOrUndefined, SortFieldOrUndefined } from '../../../common/schemas';
+import type {
+ CursorOrUndefined,
+ SortFieldOrUndefined,
+} from '@kbn/securitysolution-io-ts-list-types';
/**
* Used only internally for this ad-hoc opaque cursor structure to keep track of the
diff --git a/x-pack/plugins/lists/server/services/utils/find_source_type.test.ts b/x-pack/plugins/lists/server/services/utils/find_source_type.test.ts
index 80b10142d553a..9f61173ac2caa 100644
--- a/x-pack/plugins/lists/server/services/utils/find_source_type.test.ts
+++ b/x-pack/plugins/lists/server/services/utils/find_source_type.test.ts
@@ -5,7 +5,7 @@
* 2.0.
*/
-import { Type } from '@kbn/securitysolution-io-ts-list-types';
+import type { Type } from '@kbn/securitysolution-io-ts-list-types';
import { getSearchEsListItemMock } from '../../schemas/elastic_response/search_es_list_item_schema.mock';
import { SearchEsListItemSchema } from '../../schemas/elastic_response';
diff --git a/x-pack/plugins/lists/server/services/utils/find_source_value.ts b/x-pack/plugins/lists/server/services/utils/find_source_value.ts
index 7990481c3e3db..ed39b51dac6c6 100644
--- a/x-pack/plugins/lists/server/services/utils/find_source_value.ts
+++ b/x-pack/plugins/lists/server/services/utils/find_source_value.ts
@@ -6,9 +6,8 @@
*/
import Mustache from 'mustache';
-import { type } from '@kbn/securitysolution-io-ts-list-types';
+import { DeserializerOrUndefined, type } from '@kbn/securitysolution-io-ts-list-types';
-import { DeserializerOrUndefined } from '../../../common/schemas';
import { SearchEsListItemSchema } from '../../schemas/elastic_response';
import { esDataTypeGeoPointRange, esDataTypeRange } from '../../schemas/common/schemas';
diff --git a/x-pack/plugins/lists/server/services/utils/get_query_filter_from_type_value.ts b/x-pack/plugins/lists/server/services/utils/get_query_filter_from_type_value.ts
index 6a30cb5d6a847..a272bc52c857b 100644
--- a/x-pack/plugins/lists/server/services/utils/get_query_filter_from_type_value.ts
+++ b/x-pack/plugins/lists/server/services/utils/get_query_filter_from_type_value.ts
@@ -6,7 +6,7 @@
*/
import { isEmpty, isObject } from 'lodash/fp';
-import { Type } from '@kbn/securitysolution-io-ts-list-types';
+import type { Type } from '@kbn/securitysolution-io-ts-list-types';
export type QueryFilterType = [
{ term: Record },
diff --git a/x-pack/plugins/lists/server/services/utils/get_search_after_scroll.ts b/x-pack/plugins/lists/server/services/utils/get_search_after_scroll.ts
index ae37e47861845..4ddd3f1c73315 100644
--- a/x-pack/plugins/lists/server/services/utils/get_search_after_scroll.ts
+++ b/x-pack/plugins/lists/server/services/utils/get_search_after_scroll.ts
@@ -6,8 +6,12 @@
*/
import { ElasticsearchClient } from 'kibana/server';
+import type {
+ Filter,
+ SortFieldOrUndefined,
+ SortOrderOrUndefined,
+} from '@kbn/securitysolution-io-ts-list-types';
-import { Filter, SortFieldOrUndefined, SortOrderOrUndefined } from '../../../common/schemas';
import { Scroll } from '../lists/types';
import { getQueryFilter } from './get_query_filter';
diff --git a/x-pack/plugins/lists/server/services/utils/get_search_after_with_tie_breaker.ts b/x-pack/plugins/lists/server/services/utils/get_search_after_with_tie_breaker.ts
index 3cd902aeeb36e..7db46ce1a464c 100644
--- a/x-pack/plugins/lists/server/services/utils/get_search_after_with_tie_breaker.ts
+++ b/x-pack/plugins/lists/server/services/utils/get_search_after_with_tie_breaker.ts
@@ -5,8 +5,7 @@
* 2.0.
*/
import type { estypes } from '@elastic/elasticsearch';
-
-import { SortFieldOrUndefined } from '../../../common/schemas';
+import type { SortFieldOrUndefined } from '@kbn/securitysolution-io-ts-list-types';
export type TieBreaker = T & {
tie_breaker_id: string;
diff --git a/x-pack/plugins/lists/server/services/utils/get_sort_with_tie_breaker.ts b/x-pack/plugins/lists/server/services/utils/get_sort_with_tie_breaker.ts
index 97cfe3dd8e634..dbcec20d3d8a8 100644
--- a/x-pack/plugins/lists/server/services/utils/get_sort_with_tie_breaker.ts
+++ b/x-pack/plugins/lists/server/services/utils/get_sort_with_tie_breaker.ts
@@ -5,8 +5,7 @@
* 2.0.
*/
import type { estypes } from '@elastic/elasticsearch';
-
-import { SortFieldOrUndefined, SortOrderOrUndefined } from '../../../common/schemas';
+import { SortFieldOrUndefined, SortOrderOrUndefined } from '@kbn/securitysolution-io-ts-list-types';
export const getSortWithTieBreaker = ({
sortField,
diff --git a/x-pack/plugins/lists/server/services/utils/get_source_with_tie_breaker.ts b/x-pack/plugins/lists/server/services/utils/get_source_with_tie_breaker.ts
index 7a7e55f542d9e..2526e0240b26b 100644
--- a/x-pack/plugins/lists/server/services/utils/get_source_with_tie_breaker.ts
+++ b/x-pack/plugins/lists/server/services/utils/get_source_with_tie_breaker.ts
@@ -5,7 +5,7 @@
* 2.0.
*/
-import { SortFieldOrUndefined } from '../../../common/schemas';
+import type { SortFieldOrUndefined } from '@kbn/securitysolution-io-ts-list-types';
export const getSourceWithTieBreaker = ({
sortField,
diff --git a/x-pack/plugins/lists/server/services/utils/scroll_to_start_page.ts b/x-pack/plugins/lists/server/services/utils/scroll_to_start_page.ts
index 2b65c0df54a83..8ca0d574fd6e6 100644
--- a/x-pack/plugins/lists/server/services/utils/scroll_to_start_page.ts
+++ b/x-pack/plugins/lists/server/services/utils/scroll_to_start_page.ts
@@ -6,8 +6,12 @@
*/
import { ElasticsearchClient } from 'kibana/server';
+import type {
+ Filter,
+ SortFieldOrUndefined,
+ SortOrderOrUndefined,
+} from '@kbn/securitysolution-io-ts-list-types';
-import { Filter, SortFieldOrUndefined, SortOrderOrUndefined } from '../../../common/schemas';
import { Scroll } from '../lists/types';
import { calculateScrollMath } from './calculate_scroll_math';
diff --git a/x-pack/plugins/lists/server/services/utils/transform_elastic_named_search_to_list_item.test.ts b/x-pack/plugins/lists/server/services/utils/transform_elastic_named_search_to_list_item.test.ts
index 1846f1b7909fb..75e38819d3b05 100644
--- a/x-pack/plugins/lists/server/services/utils/transform_elastic_named_search_to_list_item.test.ts
+++ b/x-pack/plugins/lists/server/services/utils/transform_elastic_named_search_to_list_item.test.ts
@@ -5,9 +5,10 @@
* 2.0.
*/
+import type { SearchListItemArraySchema } from '@kbn/securitysolution-io-ts-list-types';
+
import { getSearchListItemResponseMock } from '../../../common/schemas/response/search_list_item_schema.mock';
import { LIST_INDEX, LIST_ITEM_ID, TYPE, VALUE } from '../../../common/constants.mock';
-import { SearchListItemArraySchema } from '../../../common/schemas';
import {
getSearchEsListItemMock,
getSearchListItemMock,
diff --git a/x-pack/plugins/lists/server/services/utils/transform_elastic_named_search_to_list_item.ts b/x-pack/plugins/lists/server/services/utils/transform_elastic_named_search_to_list_item.ts
index 902fc17039792..b669b983fe46d 100644
--- a/x-pack/plugins/lists/server/services/utils/transform_elastic_named_search_to_list_item.ts
+++ b/x-pack/plugins/lists/server/services/utils/transform_elastic_named_search_to_list_item.ts
@@ -6,9 +6,8 @@
*/
import type { estypes } from '@elastic/elasticsearch';
-import { Type } from '@kbn/securitysolution-io-ts-list-types';
+import { SearchListItemArraySchema, Type } from '@kbn/securitysolution-io-ts-list-types';
-import { SearchListItemArraySchema } from '../../../common/schemas';
import { SearchEsListItemSchema } from '../../schemas/elastic_response';
import { transformElasticHitsToListItem } from './transform_elastic_to_list_item';
diff --git a/x-pack/plugins/lists/server/services/utils/transform_elastic_to_list.ts b/x-pack/plugins/lists/server/services/utils/transform_elastic_to_list.ts
index 8d8c076f6e219..19177c1c2785f 100644
--- a/x-pack/plugins/lists/server/services/utils/transform_elastic_to_list.ts
+++ b/x-pack/plugins/lists/server/services/utils/transform_elastic_to_list.ts
@@ -6,8 +6,8 @@
*/
import type { estypes } from '@elastic/elasticsearch';
+import type { ListArraySchema } from '@kbn/securitysolution-io-ts-list-types';
-import { ListArraySchema } from '../../../common/schemas';
import { SearchEsListSchema } from '../../schemas/elastic_response';
import { encodeHitVersion } from './encode_hit_version';
diff --git a/x-pack/plugins/lists/server/services/utils/transform_elastic_to_list_item.test.ts b/x-pack/plugins/lists/server/services/utils/transform_elastic_to_list_item.test.ts
index 3629881f61d5a..2714d13cb0a26 100644
--- a/x-pack/plugins/lists/server/services/utils/transform_elastic_to_list_item.test.ts
+++ b/x-pack/plugins/lists/server/services/utils/transform_elastic_to_list_item.test.ts
@@ -5,8 +5,9 @@
* 2.0.
*/
+import type { ListItemArraySchema } from '@kbn/securitysolution-io-ts-list-types';
+
import { getListItemResponseMock } from '../../../common/schemas/response/list_item_schema.mock';
-import { ListItemArraySchema } from '../../../common/schemas';
import { getSearchListItemMock } from '../../schemas/elastic_response/search_es_list_item_schema.mock';
import {
diff --git a/x-pack/plugins/lists/server/services/utils/transform_elastic_to_list_item.ts b/x-pack/plugins/lists/server/services/utils/transform_elastic_to_list_item.ts
index 1cbf72e8eb653..585eeeb118110 100644
--- a/x-pack/plugins/lists/server/services/utils/transform_elastic_to_list_item.ts
+++ b/x-pack/plugins/lists/server/services/utils/transform_elastic_to_list_item.ts
@@ -6,9 +6,8 @@
*/
import type { estypes } from '@elastic/elasticsearch';
-import { Type } from '@kbn/securitysolution-io-ts-list-types';
+import type { ListItemArraySchema, Type } from '@kbn/securitysolution-io-ts-list-types';
-import { ListItemArraySchema } from '../../../common/schemas';
import { ErrorWithStatusCode } from '../../error_with_status_code';
import { SearchEsListItemSchema } from '../../schemas/elastic_response';
diff --git a/x-pack/plugins/lists/server/services/utils/transform_list_item_to_elastic_query.ts b/x-pack/plugins/lists/server/services/utils/transform_list_item_to_elastic_query.ts
index fc97bef54b0a6..67a7504594bef 100644
--- a/x-pack/plugins/lists/server/services/utils/transform_list_item_to_elastic_query.ts
+++ b/x-pack/plugins/lists/server/services/utils/transform_list_item_to_elastic_query.ts
@@ -5,9 +5,8 @@
* 2.0.
*/
-import { Type } from '@kbn/securitysolution-io-ts-list-types';
+import type { SerializerOrUndefined, Type } from '@kbn/securitysolution-io-ts-list-types';
-import { SerializerOrUndefined } from '../../../common/schemas';
import {
EsDataTypeGeoPoint,
EsDataTypeGeoShape,
diff --git a/x-pack/plugins/maps/server/maps_telemetry/collectors/register.ts b/x-pack/plugins/maps/server/maps_telemetry/collectors/register.ts
index ded96266ee75f..d6bd87a39eeee 100644
--- a/x-pack/plugins/maps/server/maps_telemetry/collectors/register.ts
+++ b/x-pack/plugins/maps/server/maps_telemetry/collectors/register.ts
@@ -275,6 +275,88 @@ export function registerMapsUsageCollector(
},
},
},
+ resolutions: {
+ coarse: {
+ min: {
+ type: 'long',
+ _meta: { description: 'min number of grid-agg layers with coarse resolution' },
+ },
+ max: {
+ type: 'long',
+ _meta: { description: 'max number of grid-agg layers with coarse resolution' },
+ },
+ avg: {
+ type: 'float',
+ _meta: { description: 'avg number of grid-agg layers with coarse resolution' },
+ },
+ total: {
+ type: 'long',
+ _meta: {
+ description: 'total number of grid-agg layers with coarse resolution',
+ },
+ },
+ },
+ fine: {
+ min: {
+ type: 'long',
+ _meta: { description: 'min number of grid-agg layers with fine resolution' },
+ },
+ max: {
+ type: 'long',
+ _meta: { description: 'max number of grid-agg layers with fine resolution' },
+ },
+ avg: {
+ type: 'float',
+ _meta: { description: 'avg number of grid-agg layers with fine resolution' },
+ },
+ total: {
+ type: 'long',
+ _meta: {
+ description: 'total number of grid-agg layers with fine resolution',
+ },
+ },
+ },
+ most_fine: {
+ min: {
+ type: 'long',
+ _meta: { description: 'min number of grid-agg layers with most_fine resolution' },
+ },
+ max: {
+ type: 'long',
+ _meta: { description: 'max number of grid-agg layers with most_fine resolution' },
+ },
+ avg: {
+ type: 'float',
+ _meta: { description: 'avg number of grid-agg layers with most_fine resolution' },
+ },
+ total: {
+ type: 'long',
+ _meta: {
+ description: 'total number of grid-agg layers with most_fine resolution',
+ },
+ },
+ },
+ super_fine: {
+ min: {
+ type: 'long',
+ _meta: { description: 'min number of grid-agg layers with super_fine resolution' },
+ },
+ max: {
+ type: 'long',
+ _meta: { description: 'max number of grid-agg layers with super_fine resolution' },
+ },
+ avg: {
+ type: 'float',
+ _meta: { description: 'avg number of grid-agg layers with super_fine resolution' },
+ },
+ total: {
+ type: 'long',
+ _meta: {
+ description: 'total number of grid-agg layers with super_fine resolution',
+ },
+ },
+ },
+ },
joins: {
term: {
min: {
diff --git a/x-pack/plugins/maps/server/maps_telemetry/maps_telemetry.ts b/x-pack/plugins/maps/server/maps_telemetry/maps_telemetry.ts
index d7a4bcf33ea3b..46457265e977e 100644
--- a/x-pack/plugins/maps/server/maps_telemetry/maps_telemetry.ts
+++ b/x-pack/plugins/maps/server/maps_telemetry/maps_telemetry.ts
@@ -27,10 +27,12 @@ import { MapsConfigType } from '../../config';
import { injectReferences } from '././../../common/migrations/references';
import {
getBaseMapsPerCluster,
+ getGridResolutionsPerCluster,
getScalingOptionsPerCluster,
getTelemetryLayerTypesPerCluster,
getTermJoinsPerCluster,
TELEMETRY_BASEMAP_COUNTS_PER_CLUSTER,
+ TELEMETRY_GRID_RESOLUTION_COUNTS_PER_CLUSTER,
TELEMETRY_LAYER_TYPE_COUNTS_PER_CLUSTER,
TELEMETRY_SCALING_OPTION_COUNTS_PER_CLUSTER,
TELEMETRY_TERM_JOIN_COUNTS_PER_CLUSTER,
@@ -66,6 +68,7 @@ export interface LayersStatsUsage {
scalingOptions: TELEMETRY_SCALING_OPTION_COUNTS_PER_CLUSTER;
joins: TELEMETRY_TERM_JOIN_COUNTS_PER_CLUSTER;
basemaps: TELEMETRY_BASEMAP_COUNTS_PER_CLUSTER;
+ resolutions: TELEMETRY_GRID_RESOLUTION_COUNTS_PER_CLUSTER;
attributesPerMap: {
dataSourcesCount: {
min: number;
@@ -264,6 +267,7 @@ export function buildMapsSavedObjectsTelemetry(layerLists: LayerDescriptor[][]):
const scalingOptions = getScalingOptionsPerCluster(layerLists);
const joins = getTermJoinsPerCluster(layerLists);
const basemaps = getBaseMapsPerCluster(layerLists);
+ const resolutions = getGridResolutionsPerCluster(layerLists);
return {
// Total count of maps
@@ -274,6 +278,7 @@ export function buildMapsSavedObjectsTelemetry(layerLists: LayerDescriptor[][]):
scalingOptions,
joins,
basemaps,
+ resolutions,
attributesPerMap: {
// Count of data sources per map
dataSourcesCount: {
diff --git a/x-pack/plugins/maps/server/maps_telemetry/util.ts b/x-pack/plugins/maps/server/maps_telemetry/util.ts
index c739f4a539e1e..24d211de659ff 100644
--- a/x-pack/plugins/maps/server/maps_telemetry/util.ts
+++ b/x-pack/plugins/maps/server/maps_telemetry/util.ts
@@ -11,7 +11,7 @@ import {
ESSearchSourceDescriptor,
LayerDescriptor,
} from '../../common/descriptor_types';
-import { LAYER_TYPE, RENDER_AS, SCALING_TYPES, SOURCE_TYPES } from '../../common';
+import { GRID_RESOLUTION, LAYER_TYPE, RENDER_AS, SCALING_TYPES, SOURCE_TYPES } from '../../common';
import {
DEFAULT_EMS_DARKMAP_ID,
DEFAULT_EMS_ROADMAP_DESATURATED_ID,
@@ -73,6 +73,16 @@ export interface TELEMETRY_TERM_JOIN_COUNTS_PER_CLUSTER {
[TELEMETRY_TERM_JOIN]?: ClusterCountStats;
}
+export enum TELEMETRY_GRID_RESOLUTION {
+ COARSE = 'coarse',
+ FINE = 'fine',
+ MOST_FINE = 'most_fine',
+ SUPER_FINE = 'super_fine',
+}
+export type TELEMETRY_GRID_RESOLUTION_COUNTS_PER_CLUSTER = {
+ [key in TELEMETRY_GRID_RESOLUTION]?: ClusterCountStats;
+};
+
// These capture a particular "combo" of source and layer-settings.
// They are mutually exclusive (ie. a layerDescriptor can only be a single telemetry_layer_type)
// They are more useful from a telemetry-perspective than:
@@ -261,6 +271,42 @@ export function getTermJoinsPerCluster(
});
}
+function getGridResolution(layerDescriptor: LayerDescriptor): TELEMETRY_GRID_RESOLUTION | null {
+ if (
+ !layerDescriptor.sourceDescriptor ||
+ layerDescriptor.sourceDescriptor.type !== SOURCE_TYPES.ES_GEO_GRID ||
+ !(layerDescriptor.sourceDescriptor as ESGeoGridSourceDescriptor).resolution
+ ) {
+ return null;
+ }
+
+ const descriptor = layerDescriptor.sourceDescriptor as ESGeoGridSourceDescriptor;
+
+ if (descriptor.resolution === GRID_RESOLUTION.COARSE) {
+ return TELEMETRY_GRID_RESOLUTION.COARSE;
+ }
+
+ if (descriptor.resolution === GRID_RESOLUTION.FINE) {
+ return TELEMETRY_GRID_RESOLUTION.FINE;
+ }
+
+ if (descriptor.resolution === GRID_RESOLUTION.MOST_FINE) {
+ return TELEMETRY_GRID_RESOLUTION.MOST_FINE;
+ }
+
+ if (descriptor.resolution === GRID_RESOLUTION.SUPER_FINE) {
+ return TELEMETRY_GRID_RESOLUTION.SUPER_FINE;
+ }
+
+ return null;
+}
+
+export function getGridResolutionsPerCluster(
+ layerLists: LayerDescriptor[][]
+): TELEMETRY_GRID_RESOLUTION_COUNTS_PER_CLUSTER {
+ return getCountsByCluster(layerLists, getGridResolution);
+}
+
export function getBaseMapsPerCluster(
layerLists: LayerDescriptor[][]
): TELEMETRY_BASEMAP_COUNTS_PER_CLUSTER {
diff --git a/x-pack/plugins/observability/public/components/shared/field_value_suggestions/index.tsx b/x-pack/plugins/observability/public/components/shared/field_value_suggestions/index.tsx
index 359710e4b9c59..ebe1111337919 100644
--- a/x-pack/plugins/observability/public/components/shared/field_value_suggestions/index.tsx
+++ b/x-pack/plugins/observability/public/components/shared/field_value_suggestions/index.tsx
@@ -7,7 +7,7 @@
import React, { useState } from 'react';
-import { useDebounce } from 'react-use';
+import useDebounce from 'react-use/lib/useDebounce';
import { useValuesList } from '../../../hooks/use_values_list';
import { FieldValueSelection } from './field_value_selection';
import { FieldValueSuggestionsProps } from './types';
diff --git a/x-pack/plugins/observability/public/hooks/use_values_list.ts b/x-pack/plugins/observability/public/hooks/use_values_list.ts
index 8d6e0abb896b3..ff133d07489b0 100644
--- a/x-pack/plugins/observability/public/hooks/use_values_list.ts
+++ b/x-pack/plugins/observability/public/hooks/use_values_list.ts
@@ -7,7 +7,7 @@
import { capitalize, union } from 'lodash';
import { useEffect, useState } from 'react';
-import { useDebounce } from 'react-use';
+import useDebounce from 'react-use/lib/useDebounce';
import { IndexPattern } from '../../../../../src/plugins/data/common';
import { ESFilter } from '../../../../../typings/elasticsearch';
import { createEsParams, useEsSearch } from './use_es_search';
diff --git a/x-pack/plugins/osquery/public/agents/agents_table.tsx b/x-pack/plugins/osquery/public/agents/agents_table.tsx
index 7f57f70e459da..7e8f49c051614 100644
--- a/x-pack/plugins/osquery/public/agents/agents_table.tsx
+++ b/x-pack/plugins/osquery/public/agents/agents_table.tsx
@@ -9,7 +9,7 @@ import { find } from 'lodash/fp';
import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react';
import { EuiComboBox, EuiHealth, EuiHighlight, EuiSpacer } from '@elastic/eui';
-import { useDebounce } from 'react-use';
+import useDebounce from 'react-use/lib/useDebounce';
import { useAllAgents } from './use_all_agents';
import { useAgentGroups } from './use_agent_groups';
import { useOsqueryPolicies } from './use_osquery_policies';
diff --git a/x-pack/plugins/reporting/kibana.json b/x-pack/plugins/reporting/kibana.json
index 31f679a4ec8d0..ddba61e9a0b8d 100644
--- a/x-pack/plugins/reporting/kibana.json
+++ b/x-pack/plugins/reporting/kibana.json
@@ -2,11 +2,7 @@
"id": "reporting",
"version": "8.0.0",
"kibanaVersion": "kibana",
- "optionalPlugins": [
- "security",
- "spaces",
- "usageCollection"
- ],
+ "optionalPlugins": ["security", "spaces", "usageCollection"],
"configPath": ["xpack", "reporting"],
"requiredPlugins": [
"data",
@@ -16,13 +12,11 @@
"uiActions",
"taskManager",
"embeddable",
+ "screenshotMode",
"share",
"features"
],
"server": true,
"ui": true,
- "requiredBundles": [
- "kibanaReact",
- "discover"
- ]
+ "requiredBundles": ["kibanaReact", "discover"]
}
diff --git a/x-pack/plugins/reporting/server/browsers/chromium/driver/chromium_driver.ts b/x-pack/plugins/reporting/server/browsers/chromium/driver/chromium_driver.ts
index 914a39fdf1268..30b351ff90b6f 100644
--- a/x-pack/plugins/reporting/server/browsers/chromium/driver/chromium_driver.ts
+++ b/x-pack/plugins/reporting/server/browsers/chromium/driver/chromium_driver.ts
@@ -11,6 +11,8 @@ import open from 'opn';
import puppeteer, { ElementHandle, EvaluateFn, SerializableOrJSHandle } from 'puppeteer';
import { parse as parseUrl } from 'url';
import { getDisallowedOutgoingUrlError } from '../';
+import { ReportingCore } from '../../..';
+import { KBN_SCREENSHOT_MODE_HEADER } from '../../../../../../../src/plugins/screenshot_mode/server';
import { ConditionalHeaders, ConditionalHeadersConditions } from '../../../export_types/common';
import { LevelLogger } from '../../../lib';
import { ViewZoomWidthHeight } from '../../../lib/layouts/layout';
@@ -59,8 +61,14 @@ export class HeadlessChromiumDriver {
private listenersAttached = false;
private interceptedCount = 0;
+ private core: ReportingCore;
- constructor(page: puppeteer.Page, { inspect, networkPolicy }: ChromiumDriverOptions) {
+ constructor(
+ core: ReportingCore,
+ page: puppeteer.Page,
+ { inspect, networkPolicy }: ChromiumDriverOptions
+ ) {
+ this.core = core;
this.page = page;
this.inspect = inspect;
this.networkPolicy = networkPolicy;
@@ -98,6 +106,8 @@ export class HeadlessChromiumDriver {
// Reset intercepted request count
this.interceptedCount = 0;
+ const enableScreenshotMode = this.core.getEnableScreenshotMode();
+ await this.page.evaluateOnNewDocument(enableScreenshotMode);
await this.page.setRequestInterception(true);
this.registerListeners(conditionalHeaders, logger);
@@ -261,6 +271,7 @@ export class HeadlessChromiumDriver {
{
...interceptedRequest.request.headers,
...conditionalHeaders.headers,
+ [KBN_SCREENSHOT_MODE_HEADER]: 'true',
},
(value, name) => ({
name,
diff --git a/x-pack/plugins/reporting/server/browsers/chromium/driver_factory/index.ts b/x-pack/plugins/reporting/server/browsers/chromium/driver_factory/index.ts
index 5fe2050ddb6f1..2005541b81ead 100644
--- a/x-pack/plugins/reporting/server/browsers/chromium/driver_factory/index.ts
+++ b/x-pack/plugins/reporting/server/browsers/chromium/driver_factory/index.ts
@@ -15,6 +15,7 @@ import * as Rx from 'rxjs';
import { InnerSubscriber } from 'rxjs/internal/InnerSubscriber';
import { ignoreElements, map, mergeMap, tap } from 'rxjs/operators';
import { getChromiumDisconnectedError } from '../';
+import { ReportingCore } from '../../..';
import { BROWSER_TYPE } from '../../../../common/constants';
import { durationToNumber } from '../../../../common/schema_utils';
import { CaptureConfig } from '../../../../server/types';
@@ -32,11 +33,14 @@ export class HeadlessChromiumDriverFactory {
private browserConfig: BrowserConfig;
private userDataDir: string;
private getChromiumArgs: (viewport: ViewportConfig) => string[];
+ private core: ReportingCore;
- constructor(binaryPath: string, captureConfig: CaptureConfig, logger: LevelLogger) {
+ constructor(core: ReportingCore, binaryPath: string, logger: LevelLogger) {
+ this.core = core;
this.binaryPath = binaryPath;
- this.captureConfig = captureConfig;
- this.browserConfig = captureConfig.browser.chromium;
+ const config = core.getConfig();
+ this.captureConfig = config.get('capture');
+ this.browserConfig = this.captureConfig.browser.chromium;
if (this.browserConfig.disableSandbox) {
logger.warning(`Enabling the Chromium sandbox provides an additional layer of protection.`);
@@ -138,7 +142,7 @@ export class HeadlessChromiumDriverFactory {
this.getProcessLogger(browser, logger).subscribe();
// HeadlessChromiumDriver: object to "drive" a browser page
- const driver = new HeadlessChromiumDriver(page, {
+ const driver = new HeadlessChromiumDriver(this.core, page, {
inspect: !!this.browserConfig.inspect,
networkPolicy: this.captureConfig.networkPolicy,
});
diff --git a/x-pack/plugins/reporting/server/browsers/chromium/index.ts b/x-pack/plugins/reporting/server/browsers/chromium/index.ts
index 0d5639254b816..e0d043f821ab4 100644
--- a/x-pack/plugins/reporting/server/browsers/chromium/index.ts
+++ b/x-pack/plugins/reporting/server/browsers/chromium/index.ts
@@ -7,15 +7,15 @@
import { i18n } from '@kbn/i18n';
import { BrowserDownload } from '../';
-import { CaptureConfig } from '../../../server/types';
+import { ReportingCore } from '../../../server';
import { LevelLogger } from '../../lib';
import { HeadlessChromiumDriverFactory } from './driver_factory';
import { ChromiumArchivePaths } from './paths';
export const chromium: BrowserDownload = {
paths: new ChromiumArchivePaths(),
- createDriverFactory: (binaryPath: string, captureConfig: CaptureConfig, logger: LevelLogger) =>
- new HeadlessChromiumDriverFactory(binaryPath, captureConfig, logger),
+ createDriverFactory: (core: ReportingCore, binaryPath: string, logger: LevelLogger) =>
+ new HeadlessChromiumDriverFactory(core, binaryPath, logger),
};
export const getChromiumDisconnectedError = () =>
diff --git a/x-pack/plugins/reporting/server/browsers/index.ts b/x-pack/plugins/reporting/server/browsers/index.ts
index df95b69d9d254..c47514960bb09 100644
--- a/x-pack/plugins/reporting/server/browsers/index.ts
+++ b/x-pack/plugins/reporting/server/browsers/index.ts
@@ -6,9 +6,8 @@
*/
import { first } from 'rxjs/operators';
-import { ReportingConfig } from '../';
+import { ReportingCore } from '../';
import { LevelLogger } from '../lib';
-import { CaptureConfig } from '../types';
import { chromium, ChromiumArchivePaths } from './chromium';
import { HeadlessChromiumDriverFactory } from './chromium/driver_factory';
import { installBrowser } from './install';
@@ -18,8 +17,8 @@ export { HeadlessChromiumDriver } from './chromium/driver';
export { HeadlessChromiumDriverFactory } from './chromium/driver_factory';
type CreateDriverFactory = (
+ core: ReportingCore,
binaryPath: string,
- captureConfig: CaptureConfig,
logger: LevelLogger
) => HeadlessChromiumDriverFactory;
@@ -28,12 +27,8 @@ export interface BrowserDownload {
paths: ChromiumArchivePaths;
}
-export const initializeBrowserDriverFactory = async (
- config: ReportingConfig,
- logger: LevelLogger
-) => {
+export const initializeBrowserDriverFactory = async (core: ReportingCore, logger: LevelLogger) => {
const { binaryPath$ } = installBrowser(logger);
const binaryPath = await binaryPath$.pipe(first()).toPromise();
- const captureConfig = config.get('capture');
- return chromium.createDriverFactory(binaryPath, captureConfig, logger);
+ return chromium.createDriverFactory(core, binaryPath, logger);
};
diff --git a/x-pack/plugins/reporting/server/core.ts b/x-pack/plugins/reporting/server/core.ts
index 62cab5a8fef19..2d55a4aa7fa6d 100644
--- a/x-pack/plugins/reporting/server/core.ts
+++ b/x-pack/plugins/reporting/server/core.ts
@@ -8,6 +8,7 @@
import Hapi from '@hapi/hapi';
import * as Rx from 'rxjs';
import { first, map, take } from 'rxjs/operators';
+import { ScreenshotModePluginSetup } from 'src/plugins/screenshot_mode/server';
import {
BasePath,
IClusterClient,
@@ -41,6 +42,7 @@ export interface ReportingInternalSetup {
security?: SecurityPluginSetup;
spaces?: SpacesPluginSetup;
taskManager: TaskManagerSetupContract;
+ screenshotMode: ScreenshotModePluginSetup;
logger: LevelLogger;
}
@@ -237,6 +239,11 @@ export class ReportingCore {
return screenshotsObservableFactory(config.get('capture'), browserDriverFactory);
}
+ public getEnableScreenshotMode() {
+ const { screenshotMode } = this.getPluginSetupDeps();
+ return screenshotMode.setScreenshotModeEnabled;
+ }
+
/*
* Gives synchronous access to the setupDeps
*/
diff --git a/x-pack/plugins/reporting/server/lib/screenshots/observable.test.ts b/x-pack/plugins/reporting/server/lib/screenshots/observable.test.ts
index a10f1f7a3788d..dd8aadb49a5ba 100644
--- a/x-pack/plugins/reporting/server/lib/screenshots/observable.test.ts
+++ b/x-pack/plugins/reporting/server/lib/screenshots/observable.test.ts
@@ -19,6 +19,7 @@ jest.mock('puppeteer', () => ({
import moment from 'moment';
import * as Rx from 'rxjs';
+import { ReportingCore } from '../..';
import { HeadlessChromiumDriver } from '../../browsers';
import { ConditionalHeaders } from '../../export_types/common';
import {
@@ -27,6 +28,7 @@ import {
createMockConfigSchema,
createMockLayoutInstance,
createMockLevelLogger,
+ createMockReportingCore,
} from '../../test_helpers';
import { ElementsPositionAndAttribute } from './';
import * as contexts from './constants';
@@ -37,7 +39,7 @@ import { screenshotsObservableFactory } from './observable';
*/
const logger = createMockLevelLogger();
-const reportingConfig = {
+const mockSchema = createMockConfigSchema({
capture: {
loadDelay: moment.duration(2, 's'),
timeouts: {
@@ -46,12 +48,13 @@ const reportingConfig = {
renderComplete: moment.duration(10, 's'),
},
},
-};
-const mockSchema = createMockConfigSchema(reportingConfig);
+});
const mockConfig = createMockConfig(mockSchema);
const captureConfig = mockConfig.get('capture');
const mockLayout = createMockLayoutInstance(captureConfig);
+let core: ReportingCore;
+
/*
* Tests
*/
@@ -59,7 +62,8 @@ describe('Screenshot Observable Pipeline', () => {
let mockBrowserDriverFactory: any;
beforeEach(async () => {
- mockBrowserDriverFactory = await createMockBrowserDriverFactory(logger, {});
+ core = await createMockReportingCore(mockSchema);
+ mockBrowserDriverFactory = await createMockBrowserDriverFactory(core, logger, {});
});
it('pipelines a single url into screenshot and timeRange', async () => {
@@ -118,7 +122,7 @@ describe('Screenshot Observable Pipeline', () => {
const mockOpen = jest.fn();
// mocks
- mockBrowserDriverFactory = await createMockBrowserDriverFactory(logger, {
+ mockBrowserDriverFactory = await createMockBrowserDriverFactory(core, logger, {
screenshot: mockScreenshot,
open: mockOpen,
});
@@ -218,7 +222,7 @@ describe('Screenshot Observable Pipeline', () => {
});
// mocks
- mockBrowserDriverFactory = await createMockBrowserDriverFactory(logger, {
+ mockBrowserDriverFactory = await createMockBrowserDriverFactory(core, logger, {
waitForSelector: mockWaitForSelector,
});
@@ -312,7 +316,7 @@ describe('Screenshot Observable Pipeline', () => {
return Rx.never().toPromise();
});
- mockBrowserDriverFactory = await createMockBrowserDriverFactory(logger, {
+ mockBrowserDriverFactory = await createMockBrowserDriverFactory(core, logger, {
getCreatePage: mockGetCreatePage,
waitForSelector: mockWaitForSelector,
});
@@ -345,7 +349,7 @@ describe('Screenshot Observable Pipeline', () => {
return Promise.resolve();
}
});
- mockBrowserDriverFactory = await createMockBrowserDriverFactory(logger, {
+ mockBrowserDriverFactory = await createMockBrowserDriverFactory(core, logger, {
evaluate: mockBrowserEvaluate,
});
mockLayout.getViewport = () => null;
diff --git a/x-pack/plugins/reporting/server/plugin.ts b/x-pack/plugins/reporting/server/plugin.ts
index 26a9be2b15c3f..fc52e10dd0cf9 100644
--- a/x-pack/plugins/reporting/server/plugin.ts
+++ b/x-pack/plugins/reporting/server/plugin.ts
@@ -48,12 +48,13 @@ export class ReportingPlugin
registerUiSettings(core);
const { http } = core;
- const { features, licensing, security, spaces, taskManager } = plugins;
+ const { screenshotMode, features, licensing, security, spaces, taskManager } = plugins;
const router = http.createRouter();
const basePath = http.basePath;
reportingCore.pluginSetup({
+ screenshotMode,
features,
licensing,
basePath,
@@ -91,9 +92,8 @@ export class ReportingPlugin
// async background start
(async () => {
await reportingCore.pluginSetsUp();
- const config = reportingCore.getConfig();
- const browserDriverFactory = await initializeBrowserDriverFactory(config, this.logger);
+ const browserDriverFactory = await initializeBrowserDriverFactory(reportingCore, this.logger);
const store = new ReportingStore(reportingCore, this.logger);
await reportingCore.pluginStart({
diff --git a/x-pack/plugins/reporting/server/test_helpers/create_mock_browserdriverfactory.ts b/x-pack/plugins/reporting/server/test_helpers/create_mock_browserdriverfactory.ts
index 3446160c0d7f5..7dd7c246e9a04 100644
--- a/x-pack/plugins/reporting/server/test_helpers/create_mock_browserdriverfactory.ts
+++ b/x-pack/plugins/reporting/server/test_helpers/create_mock_browserdriverfactory.ts
@@ -8,6 +8,7 @@
import moment from 'moment';
import { Page } from 'puppeteer';
import * as Rx from 'rxjs';
+import { ReportingCore } from '..';
import { chromium, HeadlessChromiumDriver, HeadlessChromiumDriverFactory } from '../browsers';
import { LevelLogger } from '../lib';
import { ElementsPositionAndAttribute } from '../lib/screenshots';
@@ -96,6 +97,7 @@ const defaultOpts: CreateMockBrowserDriverFactoryOpts = {
};
export const createMockBrowserDriverFactory = async (
+ core: ReportingCore,
logger: LevelLogger,
opts: Partial = {}
): Promise => {
@@ -122,9 +124,9 @@ export const createMockBrowserDriverFactory = async (
};
const binaryPath = '/usr/local/share/common/secure/super_awesome_binary';
- const mockBrowserDriverFactory = chromium.createDriverFactory(binaryPath, captureConfig, logger);
+ const mockBrowserDriverFactory = chromium.createDriverFactory(core, binaryPath, logger);
const mockPage = ({ setViewport: () => {} } as unknown) as Page;
- const mockBrowserDriver = new HeadlessChromiumDriver(mockPage, {
+ const mockBrowserDriver = new HeadlessChromiumDriver(core, mockPage, {
inspect: true,
networkPolicy: captureConfig.networkPolicy,
});
diff --git a/x-pack/plugins/reporting/server/types.ts b/x-pack/plugins/reporting/server/types.ts
index 757d1a68075a8..7df1dce597d56 100644
--- a/x-pack/plugins/reporting/server/types.ts
+++ b/x-pack/plugins/reporting/server/types.ts
@@ -8,6 +8,7 @@
import type { IRouter, KibanaRequest, RequestHandlerContext } from 'src/core/server';
// eslint-disable-next-line @kbn/eslint/no-restricted-paths
import { DataPluginStart } from 'src/plugins/data/server/plugin';
+import { ScreenshotModePluginSetup } from 'src/plugins/screenshot_mode/server';
import { UsageCollectionSetup } from 'src/plugins/usage_collection/server';
import { PluginSetupContract as FeaturesPluginSetup } from '../../features/server';
import { LicensingPluginSetup } from '../../licensing/server';
@@ -32,6 +33,7 @@ export interface ReportingSetupDeps {
spaces?: SpacesPluginSetup;
taskManager: TaskManagerSetupContract;
usageCollection?: UsageCollectionSetup;
+ screenshotMode: ScreenshotModePluginSetup;
}
export interface ReportingStartDeps {
diff --git a/x-pack/plugins/reporting/tsconfig.json b/x-pack/plugins/reporting/tsconfig.json
index 88e8d343f4700..c28086b96aea2 100644
--- a/x-pack/plugins/reporting/tsconfig.json
+++ b/x-pack/plugins/reporting/tsconfig.json
@@ -20,6 +20,7 @@
{ "path": "../../../src/plugins/embeddable/tsconfig.json" },
{ "path": "../../../src/plugins/kibana_react/tsconfig.json" },
{ "path": "../../../src/plugins/management/tsconfig.json" },
+ { "path": "../../../src/plugins/screenshot_mode/tsconfig.json" },
{ "path": "../../../src/plugins/share/tsconfig.json" },
{ "path": "../../../src/plugins/ui_actions/tsconfig.json" },
{ "path": "../../../src/plugins/usage_collection/tsconfig.json" },
diff --git a/x-pack/plugins/security/server/authorization/authorization_service.tsx b/x-pack/plugins/security/server/authorization/authorization_service.tsx
index 144a8bc5fd0c4..1e2588dafe233 100644
--- a/x-pack/plugins/security/server/authorization/authorization_service.tsx
+++ b/x-pack/plugins/security/server/authorization/authorization_service.tsx
@@ -51,7 +51,6 @@ import { validateReservedPrivileges } from './validate_reserved_privileges';
export { Actions } from './actions';
export { CheckSavedObjectsPrivileges } from './check_saved_objects_privileges';
-export { featurePrivilegeIterator } from './privileges';
interface AuthorizationServiceSetupParams {
packageVersion: string;
diff --git a/x-pack/plugins/security/server/authorization/index.ts b/x-pack/plugins/security/server/authorization/index.ts
index 6cbb4d10c75e4..16a3c2ae50058 100644
--- a/x-pack/plugins/security/server/authorization/index.ts
+++ b/x-pack/plugins/security/server/authorization/index.ts
@@ -8,5 +8,4 @@
export { Actions } from './actions';
export { AuthorizationService, AuthorizationServiceSetup } from './authorization_service';
export { CheckSavedObjectsPrivileges } from './check_saved_objects_privileges';
-export { featurePrivilegeIterator } from './privileges';
export { CheckPrivilegesPayload } from './types';
diff --git a/x-pack/plugins/security/server/authorization/privileges/index.ts b/x-pack/plugins/security/server/authorization/privileges/index.ts
index 90d611180e60c..31c9cf2713c9d 100644
--- a/x-pack/plugins/security/server/authorization/privileges/index.ts
+++ b/x-pack/plugins/security/server/authorization/privileges/index.ts
@@ -6,4 +6,3 @@
*/
export { privilegesFactory, PrivilegesService } from './privileges';
-export { featurePrivilegeIterator } from './feature_privilege_iterator';
diff --git a/x-pack/plugins/security/server/authorization/privileges/privileges.test.ts b/x-pack/plugins/security/server/authorization/privileges/privileges.test.ts
index ecbbb637f4da0..dfe6bef1e00e0 100644
--- a/x-pack/plugins/security/server/authorization/privileges/privileges.test.ts
+++ b/x-pack/plugins/security/server/authorization/privileges/privileges.test.ts
@@ -85,9 +85,8 @@ describe('features', () => {
}),
];
- const mockFeaturesPlugin = {
- getKibanaFeatures: jest.fn().mockReturnValue(features),
- };
+ const mockFeaturesPlugin = featuresPluginMock.createSetup();
+ mockFeaturesPlugin.getKibanaFeatures.mockReturnValue(features);
const mockLicenseService = {
getFeatures: jest.fn().mockReturnValue({ allowSubFeaturePrivileges: true }),
getType: jest.fn().mockReturnValue('basic'),
@@ -190,9 +189,8 @@ describe('features', () => {
}),
];
- const mockFeaturesPlugin = {
- getKibanaFeatures: jest.fn().mockReturnValue(features),
- };
+ const mockFeaturesPlugin = featuresPluginMock.createSetup();
+ mockFeaturesPlugin.getKibanaFeatures.mockReturnValue(features);
const mockLicenseService = {
getFeatures: jest.fn().mockReturnValue({ allowSubFeaturePrivileges: true }),
getType: jest.fn().mockReturnValue('basic'),
@@ -268,9 +266,8 @@ describe('features', () => {
}),
];
- const mockFeaturesPlugin = {
- getKibanaFeatures: jest.fn().mockReturnValue(features),
- };
+ const mockFeaturesPlugin = featuresPluginMock.createSetup();
+ mockFeaturesPlugin.getKibanaFeatures.mockReturnValue(features);
const mockLicenseService = {
getFeatures: jest.fn().mockReturnValue({ allowSubFeaturePrivileges: true }),
getType: jest.fn().mockReturnValue('basic'),
@@ -413,9 +410,8 @@ describe('features', () => {
}),
];
- const mockFeaturesPlugin = {
- getKibanaFeatures: jest.fn().mockReturnValue(features),
- };
+ const mockFeaturesPlugin = featuresPluginMock.createSetup();
+ mockFeaturesPlugin.getKibanaFeatures.mockReturnValue(features);
const mockLicenseService = {
getFeatures: jest.fn().mockReturnValue({ allowSubFeaturePrivileges: true }),
getType: jest.fn().mockReturnValue('basic'),
@@ -502,9 +498,8 @@ describe('features', () => {
}),
];
- const mockFeaturesPlugin = {
- getKibanaFeatures: jest.fn().mockReturnValue(features),
- };
+ const mockFeaturesPlugin = featuresPluginMock.createSetup();
+ mockFeaturesPlugin.getKibanaFeatures.mockReturnValue(features);
const mockLicenseService = {
getFeatures: jest.fn().mockReturnValue({ allowSubFeaturePrivileges: true }),
getType: jest.fn().mockReturnValue('basic'),
@@ -577,9 +572,8 @@ describe('features', () => {
}),
];
- const mockFeaturesPlugin = {
- getKibanaFeatures: jest.fn().mockReturnValue(features),
- };
+ const mockFeaturesPlugin = featuresPluginMock.createSetup();
+ mockFeaturesPlugin.getKibanaFeatures.mockReturnValue(features);
const mockLicenseService = {
getFeatures: jest.fn().mockReturnValue({ allowSubFeaturePrivileges: true }),
getType: jest.fn().mockReturnValue('basic'),
@@ -653,9 +647,8 @@ describe('features', () => {
}),
];
- const mockFeaturesPlugin = {
- getKibanaFeatures: jest.fn().mockReturnValue(features),
- };
+ const mockFeaturesPlugin = featuresPluginMock.createSetup();
+ mockFeaturesPlugin.getKibanaFeatures.mockReturnValue(features);
const mockLicenseService = {
getFeatures: jest.fn().mockReturnValue({ allowSubFeaturePrivileges: true }),
getType: jest.fn().mockReturnValue('basic'),
@@ -723,9 +716,8 @@ describe('reserved', () => {
}),
];
- const mockFeaturesPlugin = {
- getKibanaFeatures: jest.fn().mockReturnValue(features),
- };
+ const mockFeaturesPlugin = featuresPluginMock.createSetup();
+ mockFeaturesPlugin.getKibanaFeatures.mockReturnValue(features);
const mockLicenseService = {
getFeatures: jest.fn().mockReturnValue({ allowSubFeaturePrivileges: true }),
getType: jest.fn().mockReturnValue('basic'),
@@ -762,9 +754,8 @@ describe('reserved', () => {
}),
];
- const mockFeaturesPlugin = {
- getKibanaFeatures: jest.fn().mockReturnValue(features),
- };
+ const mockFeaturesPlugin = featuresPluginMock.createSetup();
+ mockFeaturesPlugin.getKibanaFeatures.mockReturnValue(features);
const mockLicenseService = {
getFeatures: jest.fn().mockReturnValue({ allowSubFeaturePrivileges: true }),
getType: jest.fn().mockReturnValue('basic'),
@@ -837,9 +828,8 @@ describe('reserved', () => {
}),
];
- const mockFeaturesPlugin = {
- getKibanaFeatures: jest.fn().mockReturnValue(features),
- };
+ const mockFeaturesPlugin = featuresPluginMock.createSetup();
+ mockFeaturesPlugin.getKibanaFeatures.mockReturnValue(features);
const mockLicenseService = {
getFeatures: jest.fn().mockReturnValue({ allowSubFeaturePrivileges: true }),
getType: jest.fn().mockReturnValue('basic'),
@@ -901,9 +891,8 @@ describe('subFeatures', () => {
}),
];
- const mockFeaturesPlugin = {
- getKibanaFeatures: jest.fn().mockReturnValue(features),
- };
+ const mockFeaturesPlugin = featuresPluginMock.createSetup();
+ mockFeaturesPlugin.getKibanaFeatures.mockReturnValue(features);
const mockLicenseService = {
getFeatures: jest.fn().mockReturnValue({ allowSubFeaturePrivileges: true }),
getType: jest.fn().mockReturnValue('basic'),
@@ -1036,9 +1025,8 @@ describe('subFeatures', () => {
}),
];
- const mockFeaturesPlugin = {
- getKibanaFeatures: jest.fn().mockReturnValue(features),
- };
+ const mockFeaturesPlugin = featuresPluginMock.createSetup();
+ mockFeaturesPlugin.getKibanaFeatures.mockReturnValue(features);
const mockLicenseService = {
getFeatures: jest.fn().mockReturnValue({ allowSubFeaturePrivileges: true }),
getType: jest.fn().mockReturnValue('basic'),
@@ -1274,9 +1262,8 @@ describe('subFeatures', () => {
}),
];
- const mockFeaturesPlugin = {
- getKibanaFeatures: jest.fn().mockReturnValue(features),
- };
+ const mockFeaturesPlugin = featuresPluginMock.createSetup();
+ mockFeaturesPlugin.getKibanaFeatures.mockReturnValue(features);
const mockLicenseService = {
getFeatures: jest.fn().mockReturnValue({ allowSubFeaturePrivileges: true }),
getType: jest.fn().mockReturnValue('basic'),
@@ -1435,9 +1422,8 @@ describe('subFeatures', () => {
}),
];
- const mockFeaturesPlugin = {
- getKibanaFeatures: jest.fn().mockReturnValue(features),
- };
+ const mockFeaturesPlugin = featuresPluginMock.createSetup();
+ mockFeaturesPlugin.getKibanaFeatures.mockReturnValue(features);
const mockLicenseService = {
getFeatures: jest.fn().mockReturnValue({ allowSubFeaturePrivileges: true }),
getType: jest.fn().mockReturnValue('basic'),
@@ -1622,9 +1608,8 @@ describe('subFeatures', () => {
}),
];
- const mockFeaturesPlugin = {
- getKibanaFeatures: jest.fn().mockReturnValue(features),
- };
+ const mockFeaturesPlugin = featuresPluginMock.createSetup();
+ mockFeaturesPlugin.getKibanaFeatures.mockReturnValue(features);
const mockLicenseService = {
getFeatures: jest.fn().mockReturnValue({ allowSubFeaturePrivileges: true }),
getType: jest.fn().mockReturnValue('basic'),
@@ -1766,9 +1751,8 @@ describe('subFeatures', () => {
}),
];
- const mockFeaturesPlugin = {
- getKibanaFeatures: jest.fn().mockReturnValue(features),
- };
+ const mockFeaturesPlugin = featuresPluginMock.createSetup();
+ mockFeaturesPlugin.getKibanaFeatures.mockReturnValue(features);
const mockLicenseService = {
getFeatures: jest.fn().mockReturnValue({ allowSubFeaturePrivileges: false }),
getType: jest.fn().mockReturnValue('basic'),
@@ -1993,9 +1977,8 @@ describe('subFeatures', () => {
}),
];
- const mockFeaturesPlugin = {
- getKibanaFeatures: jest.fn().mockReturnValue(features),
- };
+ const mockFeaturesPlugin = featuresPluginMock.createSetup();
+ mockFeaturesPlugin.getKibanaFeatures.mockReturnValue(features);
const mockLicenseService = {
getFeatures: jest.fn().mockReturnValue({ allowSubFeaturePrivileges: true }),
getType: jest.fn().mockReturnValue('gold'),
@@ -2229,9 +2212,8 @@ describe('subFeatures', () => {
}),
];
- const mockFeaturesPlugin = {
- getKibanaFeatures: jest.fn().mockReturnValue(features),
- };
+ const mockFeaturesPlugin = featuresPluginMock.createSetup();
+ mockFeaturesPlugin.getKibanaFeatures.mockReturnValue(features);
const mockLicenseService = {
getFeatures: jest.fn().mockReturnValue({ allowSubFeaturePrivileges: true }),
getType: jest.fn().mockReturnValue('platinum'),
diff --git a/x-pack/plugins/security/server/authorization/privileges/privileges.ts b/x-pack/plugins/security/server/authorization/privileges/privileges.ts
index 1826b853ce668..9f50fd0fb1d53 100644
--- a/x-pack/plugins/security/server/authorization/privileges/privileges.ts
+++ b/x-pack/plugins/security/server/authorization/privileges/privileges.ts
@@ -15,10 +15,6 @@ import type { SecurityLicense } from '../../../common/licensing';
import type { RawKibanaPrivileges } from '../../../common/model';
import type { Actions } from '../actions';
import { featurePrivilegeBuilderFactory } from './feature_privilege_builder';
-import {
- featurePrivilegeIterator,
- subFeaturePrivilegeIterator,
-} from './feature_privilege_iterator';
export interface PrivilegesService {
get(): RawKibanaPrivileges;
@@ -44,7 +40,7 @@ export function privilegesFactory(
let readActions: string[] = [];
basePrivilegeFeatures.forEach((feature) => {
- for (const { privilegeId, privilege } of featurePrivilegeIterator(feature, {
+ for (const { privilegeId, privilege } of featuresService.featurePrivilegeIterator(feature, {
augmentWithSubFeaturePrivileges: true,
licenseType,
predicate: (pId, featurePrivilege) => !featurePrivilege.excludeFromBasePrivileges,
@@ -63,7 +59,7 @@ export function privilegesFactory(
const featurePrivileges: Record> = {};
for (const feature of features) {
featurePrivileges[feature.id] = {};
- for (const featurePrivilege of featurePrivilegeIterator(feature, {
+ for (const featurePrivilege of featuresService.featurePrivilegeIterator(feature, {
augmentWithSubFeaturePrivileges: true,
licenseType,
})) {
@@ -75,7 +71,7 @@ export function privilegesFactory(
}
if (allowSubFeaturePrivileges && feature.subFeatures?.length > 0) {
- for (const featurePrivilege of featurePrivilegeIterator(feature, {
+ for (const featurePrivilege of featuresService.featurePrivilegeIterator(feature, {
augmentWithSubFeaturePrivileges: false,
licenseType,
})) {
@@ -86,7 +82,10 @@ export function privilegesFactory(
];
}
- for (const subFeaturePrivilege of subFeaturePrivilegeIterator(feature, licenseType)) {
+ for (const subFeaturePrivilege of featuresService.subFeaturePrivilegeIterator(
+ feature,
+ licenseType
+ )) {
featurePrivileges[feature.id][subFeaturePrivilege.id] = [
actions.login,
actions.version,
diff --git a/x-pack/plugins/security_solution/common/detection_engine/get_query_filter.ts b/x-pack/plugins/security_solution/common/detection_engine/get_query_filter.ts
index 7d24c1e157e40..4308b814f47a7 100644
--- a/x-pack/plugins/security_solution/common/detection_engine/get_query_filter.ts
+++ b/x-pack/plugins/security_solution/common/detection_engine/get_query_filter.ts
@@ -6,16 +6,16 @@
*/
import { Language } from '@kbn/securitysolution-io-ts-alerting-types';
+import type {
+ ExceptionListItemSchema,
+ CreateExceptionListItemSchema,
+} from '@kbn/securitysolution-io-ts-list-types';
import {
Filter,
IIndexPattern,
buildEsQuery,
EsQueryConfig,
} from '../../../../../src/plugins/data/common';
-import {
- ExceptionListItemSchema,
- CreateExceptionListItemSchema,
-} from '../../../lists/common/schemas';
import { ESBoolQuery } from '../typed_json';
import { buildExceptionFilter } from '../shared_imports';
import { Query, Index, TimestampOverrideOrUndefined } from './schemas/common/schemas';
diff --git a/x-pack/plugins/security_solution/common/detection_engine/schemas/response/rules_schema.test.ts b/x-pack/plugins/security_solution/common/detection_engine/schemas/response/rules_schema.test.ts
index a8521c013f451..ef18cf24e87a3 100644
--- a/x-pack/plugins/security_solution/common/detection_engine/schemas/response/rules_schema.test.ts
+++ b/x-pack/plugins/security_solution/common/detection_engine/schemas/response/rules_schema.test.ts
@@ -29,7 +29,7 @@ import {
getThreatMatchingSchemaMock,
getRulesEqlSchemaMock,
} from './rules_schema.mocks';
-import { ListArray } from '@kbn/securitysolution-io-ts-list-types';
+import type { ListArray } from '@kbn/securitysolution-io-ts-list-types';
export const ANCHOR_DATE = '2020-02-20T03:57:54.037Z';
diff --git a/x-pack/plugins/security_solution/common/detection_engine/utils.ts b/x-pack/plugins/security_solution/common/detection_engine/utils.ts
index 6aa672881ff70..56f2a11900dd3 100644
--- a/x-pack/plugins/security_solution/common/detection_engine/utils.ts
+++ b/x-pack/plugins/security_solution/common/detection_engine/utils.ts
@@ -7,10 +7,13 @@
import { isEmpty } from 'lodash';
-import type { EntriesArray } from '@kbn/securitysolution-io-ts-list-types';
+import type {
+ EntriesArray,
+ CreateExceptionListItemSchema,
+ ExceptionListItemSchema,
+} from '@kbn/securitysolution-io-ts-list-types';
import { Type } from '@kbn/securitysolution-io-ts-alerting-types';
-import { CreateExceptionListItemSchema, ExceptionListItemSchema } from '../shared_imports';
import { JobStatus, Threshold, ThresholdNormalized } from './schemas/common/schemas';
diff --git a/x-pack/plugins/security_solution/common/endpoint/data_generators/event_filter_generator.ts b/x-pack/plugins/security_solution/common/endpoint/data_generators/event_filter_generator.ts
index 6bdbb9cde2034..c09f098979160 100644
--- a/x-pack/plugins/security_solution/common/endpoint/data_generators/event_filter_generator.ts
+++ b/x-pack/plugins/security_solution/common/endpoint/data_generators/event_filter_generator.ts
@@ -5,9 +5,9 @@
* 2.0.
*/
+import type { CreateExceptionListItemSchema } from '@kbn/securitysolution-io-ts-list-types';
import { BaseDataGenerator } from './base_data_generator';
import { ENDPOINT_EVENT_FILTERS_LIST_ID } from '../../../../lists/common/constants';
-import { CreateExceptionListItemSchema } from '../../../../lists/common';
import { getCreateExceptionListItemSchemaMock } from '../../../../lists/common/schemas/request/create_exception_list_item_schema.mock';
export class EventFilterGenerator extends BaseDataGenerator {
diff --git a/x-pack/plugins/security_solution/common/endpoint/models/policy_config.ts b/x-pack/plugins/security_solution/common/endpoint/models/policy_config.ts
index cbac2d03cfb97..63784b8b8b440 100644
--- a/x-pack/plugins/security_solution/common/endpoint/models/policy_config.ts
+++ b/x-pack/plugins/security_solution/common/endpoint/models/policy_config.ts
@@ -27,6 +27,7 @@ export const policyFactory = (): PolicyConfig => {
},
ransomware: {
mode: ProtectionModes.prevent,
+ supported: true,
},
popup: {
malware: {
@@ -70,6 +71,15 @@ export const policyFactory = (): PolicyConfig => {
file: true,
network: true,
},
+ malware: {
+ mode: ProtectionModes.prevent,
+ },
+ popup: {
+ malware: {
+ message: '',
+ enabled: true,
+ },
+ },
logging: {
file: 'info',
},
@@ -89,6 +99,7 @@ export const policyFactoryWithoutPaidFeatures = (
...policy.windows,
ransomware: {
mode: ProtectionModes.off,
+ supported: false,
},
popup: {
...policy.windows.popup,
@@ -112,6 +123,34 @@ export const policyFactoryWithoutPaidFeatures = (
},
},
},
+ linux: {
+ ...policy.linux,
+ popup: {
+ ...policy.linux.popup,
+ malware: {
+ message: '',
+ enabled: true,
+ },
+ },
+ },
+ };
+};
+
+/**
+ * Strips paid features from an existing or new `PolicyConfig` for gold and below license
+ */
+export const policyFactoryWithSupportedFeatures = (
+ policy: PolicyConfig = policyFactory()
+): PolicyConfig => {
+ return {
+ ...policy,
+ windows: {
+ ...policy.windows,
+ ransomware: {
+ ...policy.windows.ransomware,
+ supported: true,
+ },
+ },
};
};
diff --git a/x-pack/plugins/security_solution/common/endpoint/types/index.ts b/x-pack/plugins/security_solution/common/endpoint/types/index.ts
index b9e72bcd625ec..055b3f6a34378 100644
--- a/x-pack/plugins/security_solution/common/endpoint/types/index.ts
+++ b/x-pack/plugins/security_solution/common/endpoint/types/index.ts
@@ -835,7 +835,7 @@ export interface PolicyConfig {
security: boolean;
};
malware: ProtectionFields;
- ransomware: ProtectionFields;
+ ransomware: ProtectionFields & SupportedFields;
logging: {
file: string;
};
@@ -878,6 +878,13 @@ export interface PolicyConfig {
process: boolean;
network: boolean;
};
+ malware: ProtectionFields;
+ popup: {
+ malware: {
+ message: string;
+ enabled: boolean;
+ };
+ };
logging: {
file: string;
};
@@ -902,7 +909,7 @@ export interface UIPolicyConfig {
/**
* Linux-specific policy configuration that is supported via the UI
*/
- linux: Pick;
+ linux: Pick;
}
/** Policy: Protection fields */
@@ -910,6 +917,11 @@ export interface ProtectionFields {
mode: ProtectionModes;
}
+/** Policy: Supported fields */
+export interface SupportedFields {
+ supported: boolean;
+}
+
/** Policy protection mode options */
export enum ProtectionModes {
detect = 'detect',
diff --git a/x-pack/plugins/security_solution/common/license/policy_config.test.ts b/x-pack/plugins/security_solution/common/license/policy_config.test.ts
index e8637e43ce1c7..219538184765a 100644
--- a/x-pack/plugins/security_solution/common/license/policy_config.test.ts
+++ b/x-pack/plugins/security_solution/common/license/policy_config.test.ts
@@ -7,11 +7,12 @@
import {
isEndpointPolicyValidForLicense,
- unsetPolicyFeaturesAboveLicenseLevel,
+ unsetPolicyFeaturesAccordingToLicenseLevel,
} from './policy_config';
import {
DefaultMalwareMessage,
policyFactory,
+ policyFactoryWithSupportedFeatures,
policyFactoryWithoutPaidFeatures,
} from '../endpoint/models/policy_config';
import { licenseMock } from '../../../licensing/common/licensing.mock';
@@ -77,6 +78,7 @@ describe('policy_config and licenses', () => {
it('allows ransomware to be turned on for Platinum licenses', () => {
const policy = policyFactoryWithoutPaidFeatures();
policy.windows.ransomware.mode = ProtectionModes.prevent;
+ policy.windows.ransomware.supported = true;
const valid = isEndpointPolicyValidForLicense(policy, Platinum);
expect(valid).toBeTruthy();
@@ -94,6 +96,7 @@ describe('policy_config and licenses', () => {
it('allows ransomware notification to be turned on with a Platinum license', () => {
const policy = policyFactoryWithoutPaidFeatures();
policy.windows.popup.ransomware.enabled = true;
+ policy.windows.ransomware.supported = true;
const valid = isEndpointPolicyValidForLicense(policy, Platinum);
expect(valid).toBeTruthy();
});
@@ -130,7 +133,7 @@ describe('policy_config and licenses', () => {
});
});
- describe('unsetPolicyFeaturesAboveLicenseLevel', () => {
+ describe('unsetPolicyFeaturesAccordingToLicenseLevel', () => {
it('does not change any malware fields with a Platinum license', () => {
const policy = policyFactory();
const popupMessage = 'WOOP WOOP';
@@ -138,7 +141,7 @@ describe('policy_config and licenses', () => {
policy.mac.popup.malware.message = popupMessage;
policy.windows.popup.malware.enabled = false;
- const retPolicy = unsetPolicyFeaturesAboveLicenseLevel(policy, Platinum);
+ const retPolicy = unsetPolicyFeaturesAccordingToLicenseLevel(policy, Platinum);
expect(retPolicy.windows.popup.malware.enabled).toBeFalsy();
expect(retPolicy.windows.popup.malware.message).toEqual(popupMessage);
expect(retPolicy.mac.popup.malware.message).toEqual(popupMessage);
@@ -151,7 +154,7 @@ describe('policy_config and licenses', () => {
policy.windows.popup.ransomware.enabled = false;
policy.windows.popup.ransomware.message = popupMessage;
- const retPolicy = unsetPolicyFeaturesAboveLicenseLevel(policy, Platinum);
+ const retPolicy = unsetPolicyFeaturesAccordingToLicenseLevel(policy, Platinum);
expect(retPolicy.windows.ransomware.mode).toEqual(ProtectionModes.detect);
expect(retPolicy.windows.popup.ransomware.enabled).toBeFalsy();
expect(retPolicy.windows.popup.ransomware.message).toEqual(popupMessage);
@@ -167,7 +170,7 @@ describe('policy_config and licenses', () => {
policy.windows.popup.ransomware.message = popupMessage;
policy.windows.popup.ransomware.enabled = false;
- const retPolicy = unsetPolicyFeaturesAboveLicenseLevel(policy, Gold);
+ const retPolicy = unsetPolicyFeaturesAccordingToLicenseLevel(policy, Gold);
expect(retPolicy.windows.popup.malware.enabled).toEqual(
defaults.windows.popup.malware.enabled
);
@@ -183,7 +186,7 @@ describe('policy_config and licenses', () => {
const popupMessage = 'WOOP WOOP';
policy.windows.popup.ransomware.message = popupMessage;
- const retPolicy = unsetPolicyFeaturesAboveLicenseLevel(policy, Gold);
+ const retPolicy = unsetPolicyFeaturesAccordingToLicenseLevel(policy, Gold);
expect(retPolicy.windows.ransomware.mode).toEqual(defaults.windows.ransomware.mode);
expect(retPolicy.windows.popup.ransomware.enabled).toEqual(
@@ -194,6 +197,26 @@ describe('policy_config and licenses', () => {
// need to invert the test, since it could be either value
expect(['', DefaultMalwareMessage]).toContain(retPolicy.windows.popup.ransomware.message);
});
+
+ it('sets ransomware supported field to false when license is below Platinum', () => {
+ const defaults = policyFactoryWithoutPaidFeatures(); // reference
+ const policy = policyFactory(); // what we will modify, and should be reset
+ policy.windows.ransomware.supported = true;
+
+ const retPolicy = unsetPolicyFeaturesAccordingToLicenseLevel(policy, Gold);
+
+ expect(retPolicy.windows.ransomware.supported).toEqual(defaults.windows.ransomware.supported);
+ });
+
+ it('sets ransomware supported field to true when license is at Platinum', () => {
+ const defaults = policyFactoryWithSupportedFeatures(); // reference
+ const policy = policyFactory(); // what we will modify, and should be reset
+ policy.windows.ransomware.supported = false;
+
+ const retPolicy = unsetPolicyFeaturesAccordingToLicenseLevel(policy, Platinum);
+
+ expect(retPolicy.windows.ransomware.supported).toEqual(defaults.windows.ransomware.supported);
+ });
});
describe('policyFactoryWithoutPaidFeatures for gold and below license', () => {
diff --git a/x-pack/plugins/security_solution/common/license/policy_config.ts b/x-pack/plugins/security_solution/common/license/policy_config.ts
index 903e241b1b490..171f2d9d0287d 100644
--- a/x-pack/plugins/security_solution/common/license/policy_config.ts
+++ b/x-pack/plugins/security_solution/common/license/policy_config.ts
@@ -11,6 +11,7 @@ import { PolicyConfig } from '../endpoint/types';
import {
DefaultMalwareMessage,
policyFactoryWithoutPaidFeatures,
+ policyFactoryWithSupportedFeatures,
} from '../endpoint/models/policy_config';
/**
@@ -22,6 +23,13 @@ export const isEndpointPolicyValidForLicense = (
license: ILicense | null
): boolean => {
if (isAtLeast(license, 'platinum')) {
+ const defaults = policyFactoryWithSupportedFeatures();
+
+ // only platinum or higher may enable ransomware
+ if (policy.windows.ransomware.supported !== defaults.windows.ransomware.supported) {
+ return false;
+ }
+
return true; // currently, platinum allows all features
}
@@ -62,6 +70,11 @@ export const isEndpointPolicyValidForLicense = (
return false;
}
+ // only platinum or higher may enable ransomware
+ if (policy.windows.ransomware.supported !== defaults.windows.ransomware.supported) {
+ return false;
+ }
+
return true;
};
@@ -69,12 +82,12 @@ export const isEndpointPolicyValidForLicense = (
* Resets paid features in a PolicyConfig back to default values
* when unsupported by the given license level.
*/
-export const unsetPolicyFeaturesAboveLicenseLevel = (
+export const unsetPolicyFeaturesAccordingToLicenseLevel = (
policy: PolicyConfig,
license: ILicense | null
): PolicyConfig => {
if (isAtLeast(license, 'platinum')) {
- return policy;
+ return policyFactoryWithSupportedFeatures(policy);
}
// set any license-gated features back to the defaults
diff --git a/x-pack/plugins/security_solution/common/shared_imports.ts b/x-pack/plugins/security_solution/common/shared_imports.ts
index 8f858e724394b..ec84980f2c456 100644
--- a/x-pack/plugins/security_solution/common/shared_imports.ts
+++ b/x-pack/plugins/security_solution/common/shared_imports.ts
@@ -6,12 +6,6 @@
*/
export {
- ListSchema,
- ExceptionListSchema,
- ExceptionListItemSchema,
- CreateExceptionListSchema,
- CreateExceptionListItemSchema,
- UpdateExceptionListItemSchema,
ENDPOINT_LIST_ID,
ENDPOINT_TRUSTED_APPS_LIST_ID,
EXCEPTION_LIST_URL,
diff --git a/x-pack/plugins/security_solution/public/common/components/autocomplete/field_value_lists.test.tsx b/x-pack/plugins/security_solution/public/common/components/autocomplete/field_value_lists.test.tsx
index 45d4137f8c5b0..82b6256ccbc7a 100644
--- a/x-pack/plugins/security_solution/public/common/components/autocomplete/field_value_lists.test.tsx
+++ b/x-pack/plugins/security_solution/public/common/components/autocomplete/field_value_lists.test.tsx
@@ -11,7 +11,7 @@ import { EuiComboBox, EuiComboBoxOptionOption } from '@elastic/eui';
import { waitFor } from '@testing-library/react';
import { getField } from '../../../../../../../src/plugins/data/common/index_patterns/fields/fields.mocks';
-import { ListSchema } from '../../../shared_imports';
+import type { ListSchema } from '@kbn/securitysolution-io-ts-list-types';
import { getFoundListSchemaMock } from '../../../../../lists/common/schemas/response/found_list_schema.mock';
import { getListResponseMock } from '../../../../../lists/common/schemas/response/list_schema.mock';
import { DATE_NOW, VERSION, IMMUTABLE } from '../../../../../lists/common/constants.mock';
diff --git a/x-pack/plugins/security_solution/public/common/components/autocomplete/field_value_lists.tsx b/x-pack/plugins/security_solution/public/common/components/autocomplete/field_value_lists.tsx
index 37e5961c8cd7e..8d7929d765b4f 100644
--- a/x-pack/plugins/security_solution/public/common/components/autocomplete/field_value_lists.tsx
+++ b/x-pack/plugins/security_solution/public/common/components/autocomplete/field_value_lists.tsx
@@ -8,8 +8,9 @@
import React, { useState, useEffect, useCallback, useMemo } from 'react';
import { EuiFormRow, EuiComboBoxOptionOption, EuiComboBox } from '@elastic/eui';
+import type { ListSchema } from '@kbn/securitysolution-io-ts-list-types';
import { IFieldType } from '../../../../../../../src/plugins/data/common';
-import { useFindLists, ListSchema } from '../../../shared_imports';
+import { useFindLists } from '../../../shared_imports';
import { useKibana } from '../../../common/lib/kibana';
import { filterFieldToList, getGenericComboBoxProps } from './helpers';
import * as i18n from './translations';
diff --git a/x-pack/plugins/security_solution/public/common/components/autocomplete/helpers.test.ts b/x-pack/plugins/security_solution/public/common/components/autocomplete/helpers.test.ts
index c001541db5a34..ae695bf7be978 100644
--- a/x-pack/plugins/security_solution/public/common/components/autocomplete/helpers.test.ts
+++ b/x-pack/plugins/security_solution/public/common/components/autocomplete/helpers.test.ts
@@ -17,7 +17,7 @@ import {
isNotOperator,
existsOperator,
doesNotExistOperator,
-} from './operators';
+} from '@kbn/securitysolution-list-utils';
import {
getOperators,
checkEmptyValue,
@@ -27,7 +27,7 @@ import {
filterFieldToList,
} from './helpers';
import { getListResponseMock } from '../../../../../lists/common/schemas/response/list_schema.mock';
-import { ListSchema } from '../../../../../lists/common';
+import type { ListSchema } from '@kbn/securitysolution-io-ts-list-types';
describe('helpers', () => {
// @ts-ignore
diff --git a/x-pack/plugins/security_solution/public/common/components/autocomplete/helpers.ts b/x-pack/plugins/security_solution/public/common/components/autocomplete/helpers.ts
index 13f4e5e6fd6f9..81f5a66238567 100644
--- a/x-pack/plugins/security_solution/public/common/components/autocomplete/helpers.ts
+++ b/x-pack/plugins/security_solution/public/common/components/autocomplete/helpers.ts
@@ -8,17 +8,16 @@
import dateMath from '@elastic/datemath';
import { EuiComboBoxOptionOption } from '@elastic/eui';
-import type { Type } from '@kbn/securitysolution-io-ts-list-types';
-import type { ListSchema } from '../../../shared_imports';
-import { IFieldType } from '../../../../../../../src/plugins/data/common';
-
+import type { Type, ListSchema } from '@kbn/securitysolution-io-ts-list-types';
import {
EXCEPTION_OPERATORS,
isOperator,
isNotOperator,
existsOperator,
doesNotExistOperator,
-} from './operators';
+} from '@kbn/securitysolution-list-utils';
+import { IFieldType } from '../../../../../../../src/plugins/data/common';
+
import { GetGenericComboBoxPropsReturn, OperatorOption } from './types';
import * as i18n from './translations';
diff --git a/x-pack/plugins/security_solution/public/common/components/autocomplete/operator.test.tsx b/x-pack/plugins/security_solution/public/common/components/autocomplete/operator.test.tsx
index db16cbde2acb4..5e00d2beb571c 100644
--- a/x-pack/plugins/security_solution/public/common/components/autocomplete/operator.test.tsx
+++ b/x-pack/plugins/security_solution/public/common/components/autocomplete/operator.test.tsx
@@ -11,7 +11,7 @@ import { EuiComboBox, EuiComboBoxOptionOption } from '@elastic/eui';
import { getField } from '../../../../../../../src/plugins/data/common/index_patterns/fields/fields.mocks';
import { OperatorComponent } from './operator';
-import { isOperator, isNotOperator } from './operators';
+import { isOperator, isNotOperator } from '@kbn/securitysolution-list-utils';
describe('OperatorComponent', () => {
test('it renders disabled if "isDisabled" is true', () => {
diff --git a/x-pack/plugins/security_solution/public/common/components/autocomplete/operators.ts b/x-pack/plugins/security_solution/public/common/components/autocomplete/operators.ts
deleted file mode 100644
index 53e2ddf84b3d3..0000000000000
--- a/x-pack/plugins/security_solution/public/common/components/autocomplete/operators.ts
+++ /dev/null
@@ -1,110 +0,0 @@
-/*
- * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
- * or more contributor license agreements. Licensed under the Elastic License
- * 2.0; you may not use this file except in compliance with the Elastic License
- * 2.0.
- */
-
-import { i18n } from '@kbn/i18n';
-import {
- ListOperatorEnum as OperatorEnum,
- ListOperatorTypeEnum as OperatorTypeEnum,
-} from '@kbn/securitysolution-io-ts-list-types';
-import { OperatorOption } from './types';
-
-export const isOperator: OperatorOption = {
- message: i18n.translate('xpack.securitySolution.exceptions.isOperatorLabel', {
- defaultMessage: 'is',
- }),
- value: 'is',
- type: OperatorTypeEnum.MATCH,
- operator: OperatorEnum.INCLUDED,
-};
-
-export const isNotOperator: OperatorOption = {
- message: i18n.translate('xpack.securitySolution.exceptions.isNotOperatorLabel', {
- defaultMessage: 'is not',
- }),
- value: 'is_not',
- type: OperatorTypeEnum.MATCH,
- operator: OperatorEnum.EXCLUDED,
-};
-
-export const isOneOfOperator: OperatorOption = {
- message: i18n.translate('xpack.securitySolution.exceptions.isOneOfOperatorLabel', {
- defaultMessage: 'is one of',
- }),
- value: 'is_one_of',
- type: OperatorTypeEnum.MATCH_ANY,
- operator: OperatorEnum.INCLUDED,
-};
-
-export const isNotOneOfOperator: OperatorOption = {
- message: i18n.translate('xpack.securitySolution.exceptions.isNotOneOfOperatorLabel', {
- defaultMessage: 'is not one of',
- }),
- value: 'is_not_one_of',
- type: OperatorTypeEnum.MATCH_ANY,
- operator: OperatorEnum.EXCLUDED,
-};
-
-export const existsOperator: OperatorOption = {
- message: i18n.translate('xpack.securitySolution.exceptions.existsOperatorLabel', {
- defaultMessage: 'exists',
- }),
- value: 'exists',
- type: OperatorTypeEnum.EXISTS,
- operator: OperatorEnum.INCLUDED,
-};
-
-export const doesNotExistOperator: OperatorOption = {
- message: i18n.translate('xpack.securitySolution.exceptions.doesNotExistOperatorLabel', {
- defaultMessage: 'does not exist',
- }),
- value: 'does_not_exist',
- type: OperatorTypeEnum.EXISTS,
- operator: OperatorEnum.EXCLUDED,
-};
-
-export const isInListOperator: OperatorOption = {
- message: i18n.translate('xpack.securitySolution.exceptions.isInListOperatorLabel', {
- defaultMessage: 'is in list',
- }),
- value: 'is_in_list',
- type: OperatorTypeEnum.LIST,
- operator: OperatorEnum.INCLUDED,
-};
-
-export const isNotInListOperator: OperatorOption = {
- message: i18n.translate('xpack.securitySolution.exceptions.isNotInListOperatorLabel', {
- defaultMessage: 'is not in list',
- }),
- value: 'is_not_in_list',
- type: OperatorTypeEnum.LIST,
- operator: OperatorEnum.EXCLUDED,
-};
-
-export const EXCEPTION_OPERATORS: OperatorOption[] = [
- isOperator,
- isNotOperator,
- isOneOfOperator,
- isNotOneOfOperator,
- existsOperator,
- doesNotExistOperator,
- isInListOperator,
- isNotInListOperator,
-];
-
-export const EXCEPTION_OPERATORS_SANS_LISTS: OperatorOption[] = [
- isOperator,
- isNotOperator,
- isOneOfOperator,
- isNotOneOfOperator,
- existsOperator,
- doesNotExistOperator,
-];
-
-export const EXCEPTION_OPERATORS_ONLY_LISTS: OperatorOption[] = [
- isInListOperator,
- isNotInListOperator,
-];
diff --git a/x-pack/plugins/security_solution/public/common/components/exceptions/add_exception_modal/index.test.tsx b/x-pack/plugins/security_solution/public/common/components/exceptions/add_exception_modal/index.test.tsx
index 5fb527a821bac..fc126fca0270e 100644
--- a/x-pack/plugins/security_solution/public/common/components/exceptions/add_exception_modal/index.test.tsx
+++ b/x-pack/plugins/security_solution/public/common/components/exceptions/add_exception_modal/index.test.tsx
@@ -21,9 +21,8 @@ import { useFetchOrCreateRuleExceptionList } from '../use_fetch_or_create_rule_e
import { useSignalIndex } from '../../../../detections/containers/detection_engine/alerts/use_signal_index';
import * as helpers from '../helpers';
import { getExceptionListItemSchemaMock } from '../../../../../../lists/common/schemas/response/exception_list_item_schema.mock';
-import { EntriesArray } from '@kbn/securitysolution-io-ts-list-types';
+import type { EntriesArray, ExceptionListItemSchema } from '@kbn/securitysolution-io-ts-list-types';
-import { ExceptionListItemSchema } from '../../../../../../lists/common';
import {
getRulesEqlSchemaMock,
getRulesSchemaMock,
diff --git a/x-pack/plugins/security_solution/public/common/components/exceptions/add_exception_modal/index.tsx b/x-pack/plugins/security_solution/public/common/components/exceptions/add_exception_modal/index.tsx
index 3216a020c3b04..288206034a9a0 100644
--- a/x-pack/plugins/security_solution/public/common/components/exceptions/add_exception_modal/index.tsx
+++ b/x-pack/plugins/security_solution/public/common/components/exceptions/add_exception_modal/index.tsx
@@ -29,18 +29,17 @@ import type {
ExceptionListType,
OsTypeArray,
OsType,
+ ExceptionListItemSchema,
+ CreateExceptionListItemSchema,
} from '@kbn/securitysolution-io-ts-list-types';
+import { ExceptionsBuilderExceptionItem } from '@kbn/securitysolution-list-utils';
import {
hasEqlSequenceQuery,
isEqlRule,
isThresholdRule,
} from '../../../../../common/detection_engine/utils';
import { Status } from '../../../../../common/detection_engine/schemas/common/schemas';
-import {
- ExceptionListItemSchema,
- CreateExceptionListItemSchema,
- ExceptionBuilder,
-} from '../../../../../public/shared_imports';
+import { ExceptionBuilder } from '../../../../../public/shared_imports';
import * as i18nCommon from '../../../translations';
import * as i18n from './translations';
@@ -64,7 +63,7 @@ import {
filterIndexPatterns,
} from '../helpers';
import { ErrorInfo, ErrorCallout } from '../error_callout';
-import { AlertData, ExceptionsBuilderExceptionItem } from '../types';
+import { AlertData } from '../types';
import { useFetchIndex } from '../../../containers/source';
import { useGetInstalledJob } from '../../ml/hooks/use_get_jobs';
diff --git a/x-pack/plugins/security_solution/public/common/components/exceptions/edit_exception_modal/index.test.tsx b/x-pack/plugins/security_solution/public/common/components/exceptions/edit_exception_modal/index.test.tsx
index ab6d4b401bb41..73f0a19ea1391 100644
--- a/x-pack/plugins/security_solution/public/common/components/exceptions/edit_exception_modal/index.test.tsx
+++ b/x-pack/plugins/security_solution/public/common/components/exceptions/edit_exception_modal/index.test.tsx
@@ -20,7 +20,7 @@ import {
import { useAddOrUpdateException } from '../use_add_exception';
import { useSignalIndex } from '../../../../detections/containers/detection_engine/alerts/use_signal_index';
import { getExceptionListItemSchemaMock } from '../../../../../../lists/common/schemas/response/exception_list_item_schema.mock';
-import { EntriesArray } from '@kbn/securitysolution-io-ts-list-types';
+import type { EntriesArray } from '@kbn/securitysolution-io-ts-list-types';
import {
getRulesEqlSchemaMock,
getRulesSchemaMock,
diff --git a/x-pack/plugins/security_solution/public/common/components/exceptions/edit_exception_modal/index.tsx b/x-pack/plugins/security_solution/public/common/components/exceptions/edit_exception_modal/index.tsx
index ed050574c3994..cc0ee7e1c0ed6 100644
--- a/x-pack/plugins/security_solution/public/common/components/exceptions/edit_exception_modal/index.tsx
+++ b/x-pack/plugins/security_solution/public/common/components/exceptions/edit_exception_modal/index.tsx
@@ -26,6 +26,8 @@ import type {
ExceptionListType,
OsTypeArray,
OsType,
+ ExceptionListItemSchema,
+ CreateExceptionListItemSchema,
} from '@kbn/securitysolution-io-ts-list-types';
import {
hasEqlSequenceQuery,
@@ -35,11 +37,7 @@ import {
import { useFetchIndex } from '../../../containers/source';
import { useSignalIndex } from '../../../../detections/containers/detection_engine/alerts/use_signal_index';
import { useRuleAsync } from '../../../../detections/containers/detection_engine/rules/use_rule_async';
-import {
- ExceptionListItemSchema,
- CreateExceptionListItemSchema,
- ExceptionBuilder,
-} from '../../../../../public/shared_imports';
+import { ExceptionBuilder } from '../../../../../public/shared_imports';
import * as i18n from './translations';
import * as sharedI18n from '../translations';
diff --git a/x-pack/plugins/security_solution/public/common/components/exceptions/error_callout.tsx b/x-pack/plugins/security_solution/public/common/components/exceptions/error_callout.tsx
index ba8b5b522f0a7..67522cfdc8d58 100644
--- a/x-pack/plugins/security_solution/public/common/components/exceptions/error_callout.tsx
+++ b/x-pack/plugins/security_solution/public/common/components/exceptions/error_callout.tsx
@@ -16,7 +16,7 @@ import {
EuiSpacer,
} from '@elastic/eui';
-import { List } from '@kbn/securitysolution-io-ts-list-types';
+import type { List } from '@kbn/securitysolution-io-ts-list-types';
import { HttpSetup } from '../../../../../../../src/core/public';
import { Rule } from '../../../detections/containers/detection_engine/rules/types';
import * as i18n from './translations';
diff --git a/x-pack/plugins/security_solution/public/common/components/exceptions/helpers.test.tsx b/x-pack/plugins/security_solution/public/common/components/exceptions/helpers.test.tsx
index 98c2b4db5676e..383b177d40c64 100644
--- a/x-pack/plugins/security_solution/public/common/components/exceptions/helpers.test.tsx
+++ b/x-pack/plugins/security_solution/public/common/components/exceptions/helpers.test.tsx
@@ -32,6 +32,7 @@ import {
ListOperatorTypeEnum as OperatorTypeEnum,
EntriesArray,
OsTypeArray,
+ ExceptionListItemSchema,
} from '@kbn/securitysolution-io-ts-list-types';
import { getExceptionListItemSchemaMock } from '../../../../../lists/common/schemas/response/exception_list_item_schema.mock';
@@ -39,7 +40,6 @@ import { getEntryMatchMock } from '../../../../../lists/common/schemas/types/ent
import { getCommentsArrayMock } from '../../../../../lists/common/schemas/types/comment.mock';
import { fields } from '../../../../../../../src/plugins/data/common/index_patterns/fields/fields.mocks';
import { ENTRIES, OLD_DATE_RELATIVE_TO_DATE_NOW } from '../../../../../lists/common/constants.mock';
-import { ExceptionListItemSchema } from '../../../../../lists/common/schemas';
import { IFieldType, IIndexPattern } from 'src/plugins/data/common';
jest.mock('uuid', () => ({
diff --git a/x-pack/plugins/security_solution/public/common/components/exceptions/helpers.tsx b/x-pack/plugins/security_solution/public/common/components/exceptions/helpers.tsx
index 437e93bb26fef..20413a6493661 100644
--- a/x-pack/plugins/security_solution/public/common/components/exceptions/helpers.tsx
+++ b/x-pack/plugins/security_solution/public/common/components/exceptions/helpers.tsx
@@ -22,18 +22,19 @@ import {
OsTypeArray,
ExceptionListType,
ListOperatorTypeEnum as OperatorTypeEnum,
-} from '@kbn/securitysolution-io-ts-list-types';
-
-import * as i18n from './translations';
-import { AlertData, ExceptionsBuilderExceptionItem, Flattened } from './types';
-import {
ExceptionListItemSchema,
CreateExceptionListItemSchema,
UpdateExceptionListItemSchema,
+} from '@kbn/securitysolution-io-ts-list-types';
+
+import {
getOperatorType,
getNewExceptionItem,
addIdToEntries,
-} from '../../../shared_imports';
+ ExceptionsBuilderExceptionItem,
+} from '@kbn/securitysolution-list-utils';
+import * as i18n from './translations';
+import { AlertData, Flattened } from './types';
import { IIndexPattern } from '../../../../../../../src/plugins/data/common';
import { Ecs } from '../../../../common/ecs';
diff --git a/x-pack/plugins/security_solution/public/common/components/exceptions/types.ts b/x-pack/plugins/security_solution/public/common/components/exceptions/types.ts
index bbf83a58e3679..798a212978208 100644
--- a/x-pack/plugins/security_solution/public/common/components/exceptions/types.ts
+++ b/x-pack/plugins/security_solution/public/common/components/exceptions/types.ts
@@ -6,25 +6,9 @@
*/
import { ReactNode } from 'react';
-import type {
- EntryNested,
- Entry,
- EntryMatch,
- EntryMatchAny,
- EntryMatchWildcard,
- EntryExists,
- NamespaceType,
- ListOperatorTypeEnum as OperatorTypeEnum,
- ListOperatorEnum as OperatorEnum,
-} from '@kbn/securitysolution-io-ts-list-types';
+import type { NamespaceType } from '@kbn/securitysolution-io-ts-list-types';
import type { Ecs } from '../../../../common/ecs';
import type { CodeSignature } from '../../../../common/ecs/file';
-import type { IFieldType } from '../../../../../../../src/plugins/data/common';
-import type { OperatorOption } from '../autocomplete/types';
-import type {
- ExceptionListItemSchema,
- CreateExceptionListItemSchema,
-} from '../../../shared_imports';
export interface FormattedEntry {
fieldName: string;
@@ -62,78 +46,6 @@ export interface ExceptionsPagination {
pageSizeOptions: number[];
}
-export interface FormattedBuilderEntry {
- id: string;
- field: IFieldType | undefined;
- operator: OperatorOption;
- value: string | string[] | undefined;
- nested: 'parent' | 'child' | undefined;
- entryIndex: number;
- parent: { parent: BuilderEntryNested; parentIndex: number } | undefined;
- correspondingKeywordField: IFieldType | undefined;
-}
-
-export interface EmptyEntry {
- id: string;
- field: string | undefined;
- operator: OperatorEnum;
- type: OperatorTypeEnum.MATCH | OperatorTypeEnum.MATCH_ANY;
- value: string | string[] | undefined;
-}
-
-export interface EmptyListEntry {
- id: string;
- field: string | undefined;
- operator: OperatorEnum;
- type: OperatorTypeEnum.LIST;
- list: { id: string | undefined; type: string | undefined };
-}
-
-export interface EmptyNestedEntry {
- id: string;
- field: string | undefined;
- type: OperatorTypeEnum.NESTED;
- entries: Array<
- | (EntryMatch & { id?: string })
- | (EntryMatchWildcard & { id?: string })
- | (EntryMatchAny & { id?: string })
- | (EntryExists & { id?: string })
- >;
-}
-
-export type BuilderEntry =
- | (Entry & { id?: string })
- | EmptyListEntry
- | EmptyEntry
- | BuilderEntryNested
- | EmptyNestedEntry;
-
-export type BuilderEntryNested = Omit & {
- id?: string;
- entries: Array<
- | (EntryMatch & { id?: string })
- | (EntryMatchWildcard & { id?: string })
- | (EntryMatchAny & { id?: string })
- | (EntryExists & { id?: string })
- >;
-};
-
-export type ExceptionListItemBuilderSchema = Omit & {
- entries: BuilderEntry[];
-};
-
-export type CreateExceptionListItemBuilderSchema = Omit<
- CreateExceptionListItemSchema,
- 'meta' | 'entries'
-> & {
- meta: { temporaryUuid: string };
- entries: BuilderEntry[];
-};
-
-export type ExceptionsBuilderExceptionItem =
- | ExceptionListItemBuilderSchema
- | CreateExceptionListItemBuilderSchema;
-
export interface FlattenedCodeSignature {
subject_name: string;
trusted: string;
diff --git a/x-pack/plugins/security_solution/public/common/components/exceptions/use_add_exception.test.tsx b/x-pack/plugins/security_solution/public/common/components/exceptions/use_add_exception.test.tsx
index c8a624b009c43..2fd70b5451c99 100644
--- a/x-pack/plugins/security_solution/public/common/components/exceptions/use_add_exception.test.tsx
+++ b/x-pack/plugins/security_solution/public/common/components/exceptions/use_add_exception.test.tsx
@@ -20,7 +20,8 @@ import type {
ExceptionListItemSchema,
CreateExceptionListItemSchema,
UpdateExceptionListItemSchema,
-} from '../../../shared_imports';
+} from '@kbn/securitysolution-io-ts-list-types';
+
import {
useAddOrUpdateException,
UseAddOrUpdateExceptionProps,
diff --git a/x-pack/plugins/security_solution/public/common/components/exceptions/use_add_exception.tsx b/x-pack/plugins/security_solution/public/common/components/exceptions/use_add_exception.tsx
index 6aa68373d5eb5..9a4731749d2ad 100644
--- a/x-pack/plugins/security_solution/public/common/components/exceptions/use_add_exception.tsx
+++ b/x-pack/plugins/security_solution/public/common/components/exceptions/use_add_exception.tsx
@@ -7,13 +7,14 @@
import { useEffect, useRef, useState, useCallback } from 'react';
import { UpdateDocumentByQueryResponse } from 'elasticsearch';
-import { HttpStart } from '../../../../../../../src/core/public';
-
-import {
+import type {
ExceptionListItemSchema,
CreateExceptionListItemSchema,
- useApi,
-} from '../../../shared_imports';
+} from '@kbn/securitysolution-io-ts-list-types';
+import { HttpStart } from '../../../../../../../src/core/public';
+
+import { useApi } from '../../../shared_imports';
+
import { updateAlertStatus } from '../../../detections/containers/detection_engine/alerts/api';
import { getUpdateAlertsQuery } from '../../../detections/components/alerts_table/actions';
import {
diff --git a/x-pack/plugins/security_solution/public/common/components/exceptions/use_fetch_or_create_rule_exception_list.test.tsx b/x-pack/plugins/security_solution/public/common/components/exceptions/use_fetch_or_create_rule_exception_list.test.tsx
index d38d920eee188..9d018eba0a484 100644
--- a/x-pack/plugins/security_solution/public/common/components/exceptions/use_fetch_or_create_rule_exception_list.test.tsx
+++ b/x-pack/plugins/security_solution/public/common/components/exceptions/use_fetch_or_create_rule_exception_list.test.tsx
@@ -12,14 +12,17 @@ import * as rulesApi from '../../../detections/containers/detection_engine/rules
import * as listsApi from '../../../../../lists/public/exceptions/api';
import { getExceptionListSchemaMock } from '../../../../../lists/common/schemas/response/exception_list_schema.mock';
import { savedRuleMock } from '../../../detections/containers/detection_engine/rules/mock';
-import type { ExceptionListType, ListArray } from '@kbn/securitysolution-io-ts-list-types';
+import type {
+ ExceptionListType,
+ ListArray,
+ ExceptionListSchema,
+} from '@kbn/securitysolution-io-ts-list-types';
import { getListArrayMock } from '../../../../common/detection_engine/schemas/types/lists.mock';
import {
useFetchOrCreateRuleExceptionList,
UseFetchOrCreateRuleExceptionListProps,
ReturnUseFetchOrCreateRuleExceptionList,
} from './use_fetch_or_create_rule_exception_list';
-import { ExceptionListSchema } from '../../../shared_imports';
const mockKibanaHttpService = coreMock.createStart().http;
jest.mock('../../../detections/containers/detection_engine/rules/api');
diff --git a/x-pack/plugins/security_solution/public/common/components/exceptions/use_fetch_or_create_rule_exception_list.tsx b/x-pack/plugins/security_solution/public/common/components/exceptions/use_fetch_or_create_rule_exception_list.tsx
index 98c207f47a45b..50f943c889838 100644
--- a/x-pack/plugins/security_solution/public/common/components/exceptions/use_fetch_or_create_rule_exception_list.tsx
+++ b/x-pack/plugins/security_solution/public/common/components/exceptions/use_fetch_or_create_rule_exception_list.tsx
@@ -6,7 +6,12 @@
*/
import { useEffect, useState } from 'react';
-import { List, ListArray } from '@kbn/securitysolution-io-ts-list-types';
+import type {
+ List,
+ ListArray,
+ ExceptionListSchema,
+ CreateExceptionListSchema,
+} from '@kbn/securitysolution-io-ts-list-types';
import { HttpStart } from '../../../../../../../src/core/public';
import { Rule } from '../../../detections/containers/detection_engine/rules/types';
@@ -19,11 +24,7 @@ import {
addExceptionList,
addEndpointExceptionList,
} from '../../../shared_imports';
-import {
- ExceptionListSchema,
- CreateExceptionListSchema,
- ENDPOINT_LIST_ID,
-} from '../../../../common/shared_imports';
+import { ENDPOINT_LIST_ID } from '../../../../common/shared_imports';
export type ReturnUseFetchOrCreateRuleExceptionList = [boolean, ExceptionListSchema | null];
diff --git a/x-pack/plugins/security_solution/public/common/components/exceptions/viewer/exception_item/exception_details.tsx b/x-pack/plugins/security_solution/public/common/components/exceptions/viewer/exception_item/exception_details.tsx
index ff242506927f1..d20d28aca6fda 100644
--- a/x-pack/plugins/security_solution/public/common/components/exceptions/viewer/exception_item/exception_details.tsx
+++ b/x-pack/plugins/security_solution/public/common/components/exceptions/viewer/exception_item/exception_details.tsx
@@ -16,10 +16,10 @@ import {
import React, { useMemo, Fragment } from 'react';
import styled, { css } from 'styled-components';
+import type { ExceptionListItemSchema } from '@kbn/securitysolution-io-ts-list-types';
import type { DescriptionListItem } from '../../types';
import { getDescriptionListContent } from '../helpers';
import * as i18n from '../../translations';
-import type { ExceptionListItemSchema } from '../../../../../../public/shared_imports';
const MyExceptionDetails = styled(EuiFlexItem)`
${({ theme }) => css`
diff --git a/x-pack/plugins/security_solution/public/common/components/exceptions/viewer/exception_item/index.tsx b/x-pack/plugins/security_solution/public/common/components/exceptions/viewer/exception_item/index.tsx
index 7909366e7a32e..b73442b04c9b4 100644
--- a/x-pack/plugins/security_solution/public/common/components/exceptions/viewer/exception_item/index.tsx
+++ b/x-pack/plugins/security_solution/public/common/components/exceptions/viewer/exception_item/index.tsx
@@ -16,12 +16,12 @@ import {
import React, { useEffect, useState, useMemo, useCallback } from 'react';
import styled from 'styled-components';
+import type { ExceptionListItemSchema } from '@kbn/securitysolution-io-ts-list-types';
import { ExceptionDetails } from './exception_details';
import { ExceptionEntries } from './exception_entries';
import { getFormattedComments } from '../../helpers';
import { getFormattedEntries } from '../helpers';
import type { FormattedEntry, ExceptionListItemIdentifiers } from '../../types';
-import type { ExceptionListItemSchema } from '../../../../../../public/shared_imports';
const MyFlexItem = styled(EuiFlexItem)`
&.comments--show {
diff --git a/x-pack/plugins/security_solution/public/common/components/exceptions/viewer/exceptions_viewer_items.tsx b/x-pack/plugins/security_solution/public/common/components/exceptions/viewer/exceptions_viewer_items.tsx
index 1e4cd306c4661..64fb032b0425c 100644
--- a/x-pack/plugins/security_solution/public/common/components/exceptions/viewer/exceptions_viewer_items.tsx
+++ b/x-pack/plugins/security_solution/public/common/components/exceptions/viewer/exceptions_viewer_items.tsx
@@ -9,10 +9,10 @@ import React from 'react';
import { EuiEmptyPrompt, EuiFlexGroup, EuiFlexItem, EuiSpacer } from '@elastic/eui';
import styled from 'styled-components';
+import type { ExceptionListItemSchema } from '@kbn/securitysolution-io-ts-list-types';
import * as i18n from '../translations';
import { ExceptionItem } from './exception_item';
import { AndOrBadge } from '../../and_or_badge';
-import type { ExceptionListItemSchema } from '../../../../../public/shared_imports';
import type { ExceptionListItemIdentifiers } from '../types';
const MyFlexItem = styled(EuiFlexItem)`
diff --git a/x-pack/plugins/security_solution/public/common/components/exceptions/viewer/helpers.tsx b/x-pack/plugins/security_solution/public/common/components/exceptions/viewer/helpers.tsx
index 936423d0c362b..597e8a6fed52f 100644
--- a/x-pack/plugins/security_solution/public/common/components/exceptions/viewer/helpers.tsx
+++ b/x-pack/plugins/security_solution/public/common/components/exceptions/viewer/helpers.tsx
@@ -7,15 +7,15 @@
import moment from 'moment';
-import { entriesNested } from '@kbn/securitysolution-io-ts-list-types';
+import { entriesNested, ExceptionListItemSchema } from '@kbn/securitysolution-io-ts-list-types';
import {
- ExceptionListItemSchema,
getEntryValue,
getExceptionOperatorSelect,
-} from '../../../../shared_imports';
+ BuilderEntry,
+} from '@kbn/securitysolution-list-utils';
import { formatOperatingSystems } from '../helpers';
-import type { FormattedEntry, BuilderEntry, DescriptionListItem } from '../types';
+import type { FormattedEntry, DescriptionListItem } from '../types';
import * as i18n from '../translations';
/**
diff --git a/x-pack/plugins/security_solution/public/common/components/exceptions/viewer/index.tsx b/x-pack/plugins/security_solution/public/common/components/exceptions/viewer/index.tsx
index 8055e771a1647..b1d3f66924342 100644
--- a/x-pack/plugins/security_solution/public/common/components/exceptions/viewer/index.tsx
+++ b/x-pack/plugins/security_solution/public/common/components/exceptions/viewer/index.tsx
@@ -9,7 +9,10 @@ import React, { useCallback, useEffect, useReducer } from 'react';
import { EuiSpacer } from '@elastic/eui';
import uuid from 'uuid';
-import type { ExceptionListTypeEnum } from '@kbn/securitysolution-io-ts-list-types';
+import type {
+ ExceptionListTypeEnum,
+ ExceptionListItemSchema,
+} from '@kbn/securitysolution-io-ts-list-types';
import * as i18n from '../translations';
import { useStateToaster } from '../../toasters';
import { useKibana } from '../../../../common/lib/kibana';
@@ -21,7 +24,6 @@ import { allExceptionItemsReducer, State, ViewerModalName } from './reducer';
import {
useExceptionListItems,
ExceptionListIdentifiers,
- ExceptionListItemSchema,
UseExceptionListItemsSuccess,
useApi,
} from '../../../../../public/shared_imports';
diff --git a/x-pack/plugins/security_solution/public/common/components/exceptions/viewer/reducer.ts b/x-pack/plugins/security_solution/public/common/components/exceptions/viewer/reducer.ts
index 4908a88b72526..4f75aa379cef2 100644
--- a/x-pack/plugins/security_solution/public/common/components/exceptions/viewer/reducer.ts
+++ b/x-pack/plugins/security_solution/public/common/components/exceptions/viewer/reducer.ts
@@ -5,18 +5,17 @@
* 2.0.
*/
-import type { ExceptionListType } from '@kbn/securitysolution-io-ts-list-types';
+import type {
+ ExceptionListType,
+ ExceptionListItemSchema,
+} from '@kbn/securitysolution-io-ts-list-types';
import type {
FilterOptions,
ExceptionsPagination,
ExceptionListItemIdentifiers,
Filter,
} from '../types';
-import type {
- ExceptionListItemSchema,
- ExceptionListIdentifiers,
- Pagination,
-} from '../../../../../public/shared_imports';
+import type { ExceptionListIdentifiers, Pagination } from '../../../../../public/shared_imports';
export type ViewerModalName = 'addModal' | 'editModal' | null;
diff --git a/x-pack/plugins/security_solution/public/common/store/sourcerer/helpers.ts b/x-pack/plugins/security_solution/public/common/store/sourcerer/helpers.ts
index 7d817ad30f1a0..fd3a6f1fab3c1 100644
--- a/x-pack/plugins/security_solution/public/common/store/sourcerer/helpers.ts
+++ b/x-pack/plugins/security_solution/public/common/store/sourcerer/helpers.ts
@@ -5,8 +5,7 @@
* 2.0.
*/
-// eslint-disable-next-line no-restricted-imports
-import isEmpty from 'lodash/isEmpty';
+import { isEmpty } from 'lodash';
import { SourcererModel, SourcererScopeName } from './model';
import { TimelineEventsType } from '../../../../common/types/timeline';
diff --git a/x-pack/plugins/security_solution/public/detections/components/rules/step_define_rule/index.tsx b/x-pack/plugins/security_solution/public/detections/components/rules/step_define_rule/index.tsx
index 29342bd32298e..162f86c543308 100644
--- a/x-pack/plugins/security_solution/public/detections/components/rules/step_define_rule/index.tsx
+++ b/x-pack/plugins/security_solution/public/detections/components/rules/step_define_rule/index.tsx
@@ -8,9 +8,7 @@
import { EuiButtonEmpty, EuiFormRow, EuiSpacer } from '@elastic/eui';
import React, { FC, memo, useCallback, useState, useEffect } from 'react';
import styled from 'styled-components';
-// Prefer importing entire lodash library, e.g. import { get } from "lodash"
-// eslint-disable-next-line no-restricted-imports
-import isEqual from 'lodash/isEqual';
+import { isEqual } from 'lodash';
import { IndexPattern } from 'src/plugins/data/public';
import { DEFAULT_INDEX_KEY } from '../../../../../common/constants';
diff --git a/x-pack/plugins/security_solution/public/detections/components/value_lists_management_modal/form.tsx b/x-pack/plugins/security_solution/public/detections/components/value_lists_management_modal/form.tsx
index ea903882c326d..641a39a4c21a3 100644
--- a/x-pack/plugins/security_solution/public/detections/components/value_lists_management_modal/form.tsx
+++ b/x-pack/plugins/security_solution/public/detections/components/value_lists_management_modal/form.tsx
@@ -18,8 +18,8 @@ import {
EuiSelectOption,
} from '@elastic/eui';
-import type { Type } from '@kbn/securitysolution-io-ts-list-types';
-import { useImportList, ListSchema } from '../../../shared_imports';
+import type { Type, ListSchema } from '@kbn/securitysolution-io-ts-list-types';
+import { useImportList } from '../../../shared_imports';
import * as i18n from './translations';
import { useKibana } from '../../../common/lib/kibana';
diff --git a/x-pack/plugins/security_solution/public/detections/components/value_lists_management_modal/modal.test.tsx b/x-pack/plugins/security_solution/public/detections/components/value_lists_management_modal/modal.test.tsx
index 9f05fdbe6bee8..bc20419db3547 100644
--- a/x-pack/plugins/security_solution/public/detections/components/value_lists_management_modal/modal.test.tsx
+++ b/x-pack/plugins/security_solution/public/detections/components/value_lists_management_modal/modal.test.tsx
@@ -10,7 +10,9 @@ import { mount } from 'enzyme';
import { waitFor } from '@testing-library/react';
import { getListResponseMock } from '../../../../../lists/common/schemas/response/list_schema.mock';
-import { exportList, useDeleteList, useFindLists, ListSchema } from '../../../shared_imports';
+import { exportList, useDeleteList, useFindLists } from '../../../shared_imports';
+import type { ListSchema } from '@kbn/securitysolution-io-ts-list-types';
+
import { TestProviders } from '../../../common/mock';
import { ValueListsModal } from './modal';
diff --git a/x-pack/plugins/security_solution/public/detections/components/value_lists_management_modal/modal.tsx b/x-pack/plugins/security_solution/public/detections/components/value_lists_management_modal/modal.tsx
index aefa447269f46..348c9c4b24ea3 100644
--- a/x-pack/plugins/security_solution/public/detections/components/value_lists_management_modal/modal.tsx
+++ b/x-pack/plugins/security_solution/public/detections/components/value_lists_management_modal/modal.tsx
@@ -20,13 +20,9 @@ import {
EuiText,
} from '@elastic/eui';
-import {
- ListSchema,
- exportList,
- useFindLists,
- useDeleteList,
- useCursor,
-} from '../../../shared_imports';
+import type { ListSchema } from '@kbn/securitysolution-io-ts-list-types';
+import { exportList, useFindLists, useDeleteList, useCursor } from '../../../shared_imports';
+
import { useKibana } from '../../../common/lib/kibana';
import { useAppToasts } from '../../../common/hooks/use_app_toasts';
import * as i18n from './translations';
diff --git a/x-pack/plugins/security_solution/public/detections/components/value_lists_management_modal/table_helpers.tsx b/x-pack/plugins/security_solution/public/detections/components/value_lists_management_modal/table_helpers.tsx
index cc9ba225cac0e..e7d726ed89e6f 100644
--- a/x-pack/plugins/security_solution/public/detections/components/value_lists_management_modal/table_helpers.tsx
+++ b/x-pack/plugins/security_solution/public/detections/components/value_lists_management_modal/table_helpers.tsx
@@ -11,7 +11,7 @@ import React from 'react';
import styled from 'styled-components';
import { EuiButtonIcon, EuiLoadingSpinner, EuiToolTip } from '@elastic/eui';
-import { ListSchema } from '../../../../../lists/common/schemas/response';
+import type { ListSchema } from '@kbn/securitysolution-io-ts-list-types';
import { FormattedDate } from '../../../common/components/formatted_date';
import * as i18n from './translations';
import { TableItemCallback, TableProps } from './types';
diff --git a/x-pack/plugins/security_solution/public/detections/components/value_lists_management_modal/types.ts b/x-pack/plugins/security_solution/public/detections/components/value_lists_management_modal/types.ts
index 681e9630a0d32..92fb105a3617e 100644
--- a/x-pack/plugins/security_solution/public/detections/components/value_lists_management_modal/types.ts
+++ b/x-pack/plugins/security_solution/public/detections/components/value_lists_management_modal/types.ts
@@ -7,7 +7,7 @@
import { EuiBasicTableProps } from '@elastic/eui';
-import { ListSchema } from '../../../../../lists/common/schemas/response';
+import type { ListSchema } from '@kbn/securitysolution-io-ts-list-types';
export interface TableItem extends ListSchema {
isDeleting: boolean;
diff --git a/x-pack/plugins/security_solution/public/detections/containers/detection_engine/rules/use_dissasociate_exception_list.tsx b/x-pack/plugins/security_solution/public/detections/containers/detection_engine/rules/use_dissasociate_exception_list.tsx
index 8807f02774e0e..107e66a69768e 100644
--- a/x-pack/plugins/security_solution/public/detections/containers/detection_engine/rules/use_dissasociate_exception_list.tsx
+++ b/x-pack/plugins/security_solution/public/detections/containers/detection_engine/rules/use_dissasociate_exception_list.tsx
@@ -7,7 +7,7 @@
import { useEffect, useState, useRef } from 'react';
-import { List } from '@kbn/securitysolution-io-ts-list-types';
+import type { List } from '@kbn/securitysolution-io-ts-list-types';
import { HttpStart } from '../../../../../../../../src/core/public';
import { patchRule } from './api';
diff --git a/x-pack/plugins/security_solution/public/detections/pages/detection_engine/rules/all/exceptions/columns.tsx b/x-pack/plugins/security_solution/public/detections/pages/detection_engine/rules/all/exceptions/columns.tsx
index 64cb936f160f1..f64586db9b06c 100644
--- a/x-pack/plugins/security_solution/public/detections/pages/detection_engine/rules/all/exceptions/columns.tsx
+++ b/x-pack/plugins/security_solution/public/detections/pages/detection_engine/rules/all/exceptions/columns.tsx
@@ -11,7 +11,7 @@ import React from 'react';
import { EuiButtonIcon, EuiBasicTableColumn, EuiToolTip } from '@elastic/eui';
import { History } from 'history';
-import { NamespaceType } from '@kbn/securitysolution-io-ts-list-types';
+import type { NamespaceType } from '@kbn/securitysolution-io-ts-list-types';
import { Spacer } from '../../../../../../common/components/page';
import { FormatUrl } from '../../../../../../common/components/link_to';
import { LinkAnchor } from '../../../../../../common/components/links';
diff --git a/x-pack/plugins/security_solution/public/detections/pages/detection_engine/rules/all/exceptions/exceptions_table.tsx b/x-pack/plugins/security_solution/public/detections/pages/detection_engine/rules/all/exceptions/exceptions_table.tsx
index 50cf1b1830fec..e4f627c1ae474 100644
--- a/x-pack/plugins/security_solution/public/detections/pages/detection_engine/rules/all/exceptions/exceptions_table.tsx
+++ b/x-pack/plugins/security_solution/public/detections/pages/detection_engine/rules/all/exceptions/exceptions_table.tsx
@@ -15,7 +15,7 @@ import {
} from '@elastic/eui';
import { History } from 'history';
-import { NamespaceType } from '@kbn/securitysolution-io-ts-list-types';
+import type { NamespaceType } from '@kbn/securitysolution-io-ts-list-types';
import { useAppToasts } from '../../../../../../common/hooks/use_app_toasts';
import { AutoDownload } from '../../../../../../common/components/auto_download/auto_download';
import { useKibana } from '../../../../../../common/lib/kibana';
diff --git a/x-pack/plugins/security_solution/public/detections/pages/detection_engine/rules/all/exceptions/use_all_exception_lists.tsx b/x-pack/plugins/security_solution/public/detections/pages/detection_engine/rules/all/exceptions/use_all_exception_lists.tsx
index d104026c79bfc..44518944a9227 100644
--- a/x-pack/plugins/security_solution/public/detections/pages/detection_engine/rules/all/exceptions/use_all_exception_lists.tsx
+++ b/x-pack/plugins/security_solution/public/detections/pages/detection_engine/rules/all/exceptions/use_all_exception_lists.tsx
@@ -7,8 +7,8 @@
import { useCallback, useEffect, useState } from 'react';
+import type { ExceptionListSchema } from '@kbn/securitysolution-io-ts-list-types';
import { Rule } from '../../../../../containers/detection_engine/rules';
-import { ExceptionListSchema } from '../../../../../../../../lists/common';
import { fetchRules } from '../../../../../containers/detection_engine/rules/api';
export interface ExceptionListInfo extends ExceptionListSchema {
rules: Rule[];
diff --git a/x-pack/plugins/security_solution/public/detections/pages/detection_engine/rules/types.ts b/x-pack/plugins/security_solution/public/detections/pages/detection_engine/rules/types.ts
index cf82e7cb7944e..dc580f591da56 100644
--- a/x-pack/plugins/security_solution/public/detections/pages/detection_engine/rules/types.ts
+++ b/x-pack/plugins/security_solution/public/detections/pages/detection_engine/rules/types.ts
@@ -5,7 +5,7 @@
* 2.0.
*/
-import { List } from '@kbn/securitysolution-io-ts-list-types';
+import type { List } from '@kbn/securitysolution-io-ts-list-types';
import {
RiskScoreMapping,
ThreatIndex,
diff --git a/x-pack/plugins/security_solution/public/management/pages/event_filters/service/index.ts b/x-pack/plugins/security_solution/public/management/pages/event_filters/service/index.ts
index 6a95ac5c15e83..30b4c81ba0c3b 100644
--- a/x-pack/plugins/security_solution/public/management/pages/event_filters/service/index.ts
+++ b/x-pack/plugins/security_solution/public/management/pages/event_filters/service/index.ts
@@ -6,16 +6,17 @@
*/
import { HttpStart } from 'kibana/public';
-import {
+import type {
+ FoundExceptionListItemSchema,
ExceptionListItemSchema,
CreateExceptionListItemSchema,
- ENDPOINT_EVENT_FILTERS_LIST_ID,
UpdateExceptionListItemSchema,
-} from '../../../../shared_imports';
+} from '@kbn/securitysolution-io-ts-list-types';
+import { ENDPOINT_EVENT_FILTERS_LIST_ID } from '../../../../shared_imports';
+
import { Immutable } from '../../../../../common/endpoint/types';
import { EVENT_FILTER_LIST, EXCEPTION_LIST_ITEM_URL, EXCEPTION_LIST_URL } from '../constants';
-import { FoundExceptionListItemSchema } from '../../../../../../lists/common/schemas';
import { EventFiltersService } from '../types';
export class EventFiltersHttpService implements EventFiltersService {
diff --git a/x-pack/plugins/security_solution/public/management/pages/event_filters/store/action.ts b/x-pack/plugins/security_solution/public/management/pages/event_filters/store/action.ts
index 4ae90e7abba90..016170686c7dd 100644
--- a/x-pack/plugins/security_solution/public/management/pages/event_filters/store/action.ts
+++ b/x-pack/plugins/security_solution/public/management/pages/event_filters/store/action.ts
@@ -6,11 +6,11 @@
*/
import { Action } from 'redux';
-import {
+import type {
ExceptionListItemSchema,
CreateExceptionListItemSchema,
UpdateExceptionListItemSchema,
-} from '../../../../shared_imports';
+} from '@kbn/securitysolution-io-ts-list-types';
import { AsyncResourceState } from '../../../state/async_resource_state';
import { EventFiltersListPageState } from '../types';
diff --git a/x-pack/plugins/security_solution/public/management/pages/event_filters/store/middleware.ts b/x-pack/plugins/security_solution/public/management/pages/event_filters/store/middleware.ts
index d8191850e438e..6712769e8b4af 100644
--- a/x-pack/plugins/security_solution/public/management/pages/event_filters/store/middleware.ts
+++ b/x-pack/plugins/security_solution/public/management/pages/event_filters/store/middleware.ts
@@ -5,6 +5,11 @@
* 2.0.
*/
+import type {
+ CreateExceptionListItemSchema,
+ ExceptionListItemSchema,
+ UpdateExceptionListItemSchema,
+} from '@kbn/securitysolution-io-ts-list-types';
import { AppAction } from '../../../../common/store/actions';
import {
ImmutableMiddleware,
@@ -14,13 +19,8 @@ import {
import { EventFiltersHttpService } from '../service';
-import {
- CreateExceptionListItemSchema,
- ExceptionListItemSchema,
- transformNewItemOutput,
- transformOutput,
- UpdateExceptionListItemSchema,
-} from '../../../../shared_imports';
+import { transformNewItemOutput, transformOutput } from '../../../../shared_imports';
+
import {
getCurrentListPageDataState,
getCurrentLocation,
diff --git a/x-pack/plugins/security_solution/public/management/pages/event_filters/store/selector.ts b/x-pack/plugins/security_solution/public/management/pages/event_filters/store/selector.ts
index 1bbc695f53236..d4e81fd812668 100644
--- a/x-pack/plugins/security_solution/public/management/pages/event_filters/store/selector.ts
+++ b/x-pack/plugins/security_solution/public/management/pages/event_filters/store/selector.ts
@@ -7,9 +7,12 @@
import { createSelector } from 'reselect';
import { Pagination } from '@elastic/eui';
+import type {
+ ExceptionListItemSchema,
+ FoundExceptionListItemSchema,
+} from '@kbn/securitysolution-io-ts-list-types';
import { EventFiltersListPageState, EventFiltersServiceGetListOptions } from '../types';
-import { ExceptionListItemSchema } from '../../../../shared_imports';
import { ServerApiError } from '../../../../common/types';
import {
isLoadingResourceState,
@@ -18,7 +21,6 @@ import {
isUninitialisedResourceState,
getLastLoadedResourceState,
} from '../../../state/async_resource_state';
-import { FoundExceptionListItemSchema } from '../../../../../../lists/common/schemas';
import {
MANAGEMENT_DEFAULT_PAGE_SIZE,
MANAGEMENT_PAGE_SIZE_OPTIONS,
diff --git a/x-pack/plugins/security_solution/public/management/pages/event_filters/store/utils.ts b/x-pack/plugins/security_solution/public/management/pages/event_filters/store/utils.ts
index 35ba7ce5853a6..6adc490b40e78 100644
--- a/x-pack/plugins/security_solution/public/management/pages/event_filters/store/utils.ts
+++ b/x-pack/plugins/security_solution/public/management/pages/event_filters/store/utils.ts
@@ -6,7 +6,7 @@
*/
import uuid from 'uuid';
-import { CreateExceptionListItemSchema } from '../../../../shared_imports';
+import type { CreateExceptionListItemSchema } from '@kbn/securitysolution-io-ts-list-types';
import { Ecs } from '../../../../../common/ecs';
import { ENDPOINT_EVENT_FILTERS_LIST_ID } from '../constants';
diff --git a/x-pack/plugins/security_solution/public/management/pages/event_filters/test_utils/index.ts b/x-pack/plugins/security_solution/public/management/pages/event_filters/test_utils/index.ts
index 701fb8d77b2e6..69a8ee383be8e 100644
--- a/x-pack/plugins/security_solution/public/management/pages/event_filters/test_utils/index.ts
+++ b/x-pack/plugins/security_solution/public/management/pages/event_filters/test_utils/index.ts
@@ -6,24 +6,23 @@
*/
import { combineReducers, createStore } from 'redux';
+import type {
+ FoundExceptionListItemSchema,
+ ExceptionListItemSchema,
+} from '@kbn/securitysolution-io-ts-list-types';
import { Ecs } from '../../../../../common/ecs';
import {
MANAGEMENT_STORE_GLOBAL_NAMESPACE,
MANAGEMENT_STORE_EVENT_FILTERS_NAMESPACE,
} from '../../../common/constants';
-import {
- EXCEPTION_LIST_ITEM_URL,
- EXCEPTION_LIST_URL,
- ExceptionListItemSchema,
-} from '../../../../shared_imports';
+import { EXCEPTION_LIST_ITEM_URL, EXCEPTION_LIST_URL } from '../../../../shared_imports';
import { eventFiltersPageReducer } from '../store/reducer';
import {
httpHandlerMockFactory,
ResponseProvidersInterface,
} from '../../../../common/mock/endpoint/http_handler_mock_factory';
-import { FoundExceptionListItemSchema } from '../../../../../../lists/common/schemas';
import { getFoundExceptionListItemSchemaMock } from '../../../../../../lists/common/schemas/response/found_exception_list_item_schema.mock';
import { getExceptionListItemSchemaMock } from '../../../../../../lists/common/schemas/response/exception_list_item_schema.mock';
diff --git a/x-pack/plugins/security_solution/public/management/pages/event_filters/types.ts b/x-pack/plugins/security_solution/public/management/pages/event_filters/types.ts
index cc70a2037a5af..be6689b7e5b57 100644
--- a/x-pack/plugins/security_solution/public/management/pages/event_filters/types.ts
+++ b/x-pack/plugins/security_solution/public/management/pages/event_filters/types.ts
@@ -5,14 +5,14 @@
* 2.0.
*/
-import {
+import type {
+ FoundExceptionListItemSchema,
CreateExceptionListItemSchema,
ExceptionListItemSchema,
UpdateExceptionListItemSchema,
-} from '../../../shared_imports';
+} from '@kbn/securitysolution-io-ts-list-types';
import { AsyncResourceState } from '../../state/async_resource_state';
import { Immutable } from '../../../../common/endpoint/types';
-import { FoundExceptionListItemSchema } from '../../../../../lists/common/schemas';
export interface EventFiltersPageLocation {
page_index: number;
diff --git a/x-pack/plugins/security_solution/public/management/pages/event_filters/view/components/flyout/index.test.tsx b/x-pack/plugins/security_solution/public/management/pages/event_filters/view/components/flyout/index.test.tsx
index 722eb57bf872c..5ee4c4eb0aacb 100644
--- a/x-pack/plugins/security_solution/public/management/pages/event_filters/view/components/flyout/index.test.tsx
+++ b/x-pack/plugins/security_solution/public/management/pages/event_filters/view/components/flyout/index.test.tsx
@@ -14,10 +14,10 @@ import {
} from '../../../../../../common/mock/endpoint';
import { MiddlewareActionSpyHelper } from '../../../../../../common/store/test_utils';
-import {
+import type {
CreateExceptionListItemSchema,
ExceptionListItemSchema,
-} from '../../../../../../shared_imports';
+} from '@kbn/securitysolution-io-ts-list-types';
import { EventFiltersHttpService } from '../../../service';
import { createdEventFilterEntryMock } from '../../../test_utils';
import { getFormEntryState, isUninitialisedForm } from '../../../store/selector';
diff --git a/x-pack/plugins/security_solution/public/management/pages/event_filters/view/components/form/index.tsx b/x-pack/plugins/security_solution/public/management/pages/event_filters/view/components/form/index.tsx
index d74baab0d2bbc..83fd6ff1a366d 100644
--- a/x-pack/plugins/security_solution/public/management/pages/event_filters/view/components/form/index.tsx
+++ b/x-pack/plugins/security_solution/public/management/pages/event_filters/view/components/form/index.tsx
@@ -19,6 +19,7 @@ import {
} from '@elastic/eui';
import { isEmpty } from 'lodash/fp';
+import type { ExceptionListItemSchema } from '@kbn/securitysolution-io-ts-list-types';
import { OperatingSystem } from '../../../../../../../common/endpoint/types';
import { AddExceptionComments } from '../../../../../../common/components/exceptions/add_exception_comments';
import { filterIndexPatterns } from '../../../../../../common/components/exceptions/helpers';
@@ -26,7 +27,7 @@ import { Loader } from '../../../../../../common/components/loader';
import { useKibana } from '../../../../../../common/lib/kibana';
import { useFetchIndex } from '../../../../../../common/containers/source';
import { AppAction } from '../../../../../../common/store/actions';
-import { ExceptionListItemSchema, ExceptionBuilder } from '../../../../../../shared_imports';
+import { ExceptionBuilder } from '../../../../../../shared_imports';
import { useEventFiltersSelector } from '../../hooks';
import { getFormEntryStateMutable, getHasNameError, getNewComment } from '../../../store/selector';
diff --git a/x-pack/plugins/security_solution/public/management/pages/event_filters/view/components/modal/index.test.tsx b/x-pack/plugins/security_solution/public/management/pages/event_filters/view/components/modal/index.test.tsx
index 0c976b3571515..178b774e91635 100644
--- a/x-pack/plugins/security_solution/public/management/pages/event_filters/view/components/modal/index.test.tsx
+++ b/x-pack/plugins/security_solution/public/management/pages/event_filters/view/components/modal/index.test.tsx
@@ -13,10 +13,10 @@ import { ThemeProvider } from 'styled-components';
import { createGlobalNoMiddlewareStore, ecsEventMock } from '../../../test_utils';
import { getMockTheme } from '../../../../../../common/lib/kibana/kibana_react.mock';
import { MODAL_TITLE, MODAL_SUBTITLE, ACTIONS_CONFIRM, ACTIONS_CANCEL } from './translations';
-import {
+import type {
CreateExceptionListItemSchema,
ExceptionListItemSchema,
-} from '../../../../../../shared_imports';
+} from '@kbn/securitysolution-io-ts-list-types';
jest.mock('../form');
jest.mock('../../hooks', () => {
diff --git a/x-pack/plugins/security_solution/public/management/pages/event_filters/view/event_filters_list_page.tsx b/x-pack/plugins/security_solution/public/management/pages/event_filters/view/event_filters_list_page.tsx
index ea1e041f11c50..32fc018210418 100644
--- a/x-pack/plugins/security_solution/public/management/pages/event_filters/view/event_filters_list_page.tsx
+++ b/x-pack/plugins/security_solution/public/management/pages/event_filters/view/event_filters_list_page.tsx
@@ -14,6 +14,7 @@ import { FormattedMessage } from '@kbn/i18n/react';
import { EuiButton, EuiSpacer, EuiHorizontalRule, EuiText } from '@elastic/eui';
import styled from 'styled-components';
+import type { ExceptionListItemSchema } from '@kbn/securitysolution-io-ts-list-types';
import { AppAction } from '../../../../common/store/actions';
import { getEventFiltersListPath } from '../../../common/routing';
import { AdministrationListPage as _AdministrationListPage } from '../../../components/administration_list_page';
@@ -33,7 +34,6 @@ import {
showDeleteModal,
} from '../store/selector';
import { PaginatedContent, PaginatedContentProps } from '../../../components/paginated_content';
-import { ExceptionListItemSchema } from '../../../../../../lists/common';
import { Immutable } from '../../../../../common/endpoint/types';
import {
ExceptionItem,
diff --git a/x-pack/plugins/security_solution/public/management/pages/event_filters/view/translations.ts b/x-pack/plugins/security_solution/public/management/pages/event_filters/view/translations.ts
index a33a031d5972e..0d8d4a8706e9c 100644
--- a/x-pack/plugins/security_solution/public/management/pages/event_filters/view/translations.ts
+++ b/x-pack/plugins/security_solution/public/management/pages/event_filters/view/translations.ts
@@ -7,10 +7,10 @@
import { i18n } from '@kbn/i18n';
-import {
+import type {
CreateExceptionListItemSchema,
UpdateExceptionListItemSchema,
-} from '../../../../shared_imports';
+} from '@kbn/securitysolution-io-ts-list-types';
import { ServerApiError } from '../../../../common/types';
export const getCreationSuccessMessage = (
diff --git a/x-pack/plugins/security_solution/public/management/pages/event_filters/view/use_event_filters_notification.test.tsx b/x-pack/plugins/security_solution/public/management/pages/event_filters/view/use_event_filters_notification.test.tsx
index 5dcb3fa6a12af..064e3312a52bb 100644
--- a/x-pack/plugins/security_solution/public/management/pages/event_filters/view/use_event_filters_notification.test.tsx
+++ b/x-pack/plugins/security_solution/public/management/pages/event_filters/view/use_event_filters_notification.test.tsx
@@ -12,7 +12,10 @@ import { renderHook, act } from '@testing-library/react-hooks';
import { NotificationsStart } from 'kibana/public';
import { coreMock } from '../../../../../../../../src/core/public/mocks';
import { KibanaContextProvider } from '../../../../../../../../src/plugins/kibana_react/public/context';
-import { CreateExceptionListItemSchema, ExceptionListItemSchema } from '../../../../shared_imports';
+import type {
+ CreateExceptionListItemSchema,
+ ExceptionListItemSchema,
+} from '@kbn/securitysolution-io-ts-list-types';
import {
createdEventFilterEntryMock,
diff --git a/x-pack/plugins/security_solution/public/management/pages/policy/store/policy_details/index.test.ts b/x-pack/plugins/security_solution/public/management/pages/policy/store/policy_details/index.test.ts
index 74dfbe4dec3ba..94208390b660b 100644
--- a/x-pack/plugins/security_solution/public/management/pages/policy/store/policy_details/index.test.ts
+++ b/x-pack/plugins/security_solution/public/management/pages/policy/store/policy_details/index.test.ts
@@ -284,7 +284,7 @@ describe('policy details: ', () => {
security: true,
},
malware: { mode: 'prevent' },
- ransomware: { mode: 'off' },
+ ransomware: { mode: 'off', supported: false },
popup: {
malware: {
enabled: true,
@@ -314,6 +314,13 @@ describe('policy details: ', () => {
linux: {
events: { process: true, file: true, network: true },
logging: { file: 'info' },
+ malware: { mode: 'prevent' },
+ popup: {
+ malware: {
+ enabled: true,
+ message: '',
+ },
+ },
},
},
},
diff --git a/x-pack/plugins/security_solution/public/management/pages/policy/store/policy_details/middleware.ts b/x-pack/plugins/security_solution/public/management/pages/policy/store/policy_details/middleware.ts
index 2e44021a79126..793d083400aa2 100644
--- a/x-pack/plugins/security_solution/public/management/pages/policy/store/policy_details/middleware.ts
+++ b/x-pack/plugins/security_solution/public/management/pages/policy/store/policy_details/middleware.ts
@@ -41,6 +41,7 @@ export const policyDetailsMiddlewareFactory: ImmutableMiddlewareFactory {
if (policyData) {
- const policyValue = unsetPolicyFeaturesAboveLicenseLevel(
+ const policyValue = unsetPolicyFeaturesAccordingToLicenseLevel(
policyData.inputs[0].config.policy.value,
license as ILicense
);
@@ -197,6 +197,8 @@ export const policyConfig: (s: PolicyDetailsState) => UIPolicyConfig = createSel
linux: {
advanced: linux.advanced,
events: linux.events,
+ malware: linux.malware,
+ popup: linux.popup,
},
};
}
diff --git a/x-pack/plugins/security_solution/public/management/pages/policy/types.ts b/x-pack/plugins/security_solution/public/management/pages/policy/types.ts
index b2b95e2765bd8..269e70b3c2474 100644
--- a/x-pack/plugins/security_solution/public/management/pages/policy/types.ts
+++ b/x-pack/plugins/security_solution/public/management/pages/policy/types.ts
@@ -122,10 +122,13 @@ export type RansomwareProtectionOSes = KeysByValueCriteria<
export type PolicyProtection =
| keyof Pick
- | keyof Pick;
+ | keyof Pick
+ | keyof Pick;
export type MacPolicyProtection = keyof Pick;
+export type LinuxPolicyProtection = keyof Pick;
+
export interface GetPolicyListResponse extends GetPackagePoliciesResponse {
items: PolicyData[];
}
diff --git a/x-pack/plugins/security_solution/public/management/pages/policy/view/policy_forms/components/protection_radio.tsx b/x-pack/plugins/security_solution/public/management/pages/policy/view/policy_forms/components/protection_radio.tsx
index 8394b557207af..fe698fdb727a5 100644
--- a/x-pack/plugins/security_solution/public/management/pages/policy/view/policy_forms/components/protection_radio.tsx
+++ b/x-pack/plugins/security_solution/public/management/pages/policy/view/policy_forms/components/protection_radio.tsx
@@ -14,7 +14,7 @@ import {
ProtectionModes,
UIPolicyConfig,
} from '../../../../../../../common/endpoint/types';
-import { MacPolicyProtection, PolicyProtection } from '../../../types';
+import { MacPolicyProtection, LinuxPolicyProtection, PolicyProtection } from '../../../types';
import { usePolicyDetailsSelector } from '../../policy_hooks';
import { policyConfig } from '../../../store/policy_details/selectors';
import { AppAction } from '../../../../../../common/store/actions';
@@ -46,6 +46,8 @@ export const ProtectionRadio = React.memo(
newPayload[os][protection].mode = protectionMode;
} else if (os === 'mac') {
newPayload[os][protection as MacPolicyProtection].mode = protectionMode;
+ } else if (os === 'linux') {
+ newPayload[os][protection as LinuxPolicyProtection].mode = protectionMode;
}
if (isPlatinumPlus) {
if (os === 'windows') {
@@ -60,6 +62,12 @@ export const ProtectionRadio = React.memo(
} else {
newPayload[os].popup[protection as MacPolicyProtection].enabled = false;
}
+ } else if (os === 'linux') {
+ if (protectionMode === ProtectionModes.prevent) {
+ newPayload[os].popup[protection as LinuxPolicyProtection].enabled = true;
+ } else {
+ newPayload[os].popup[protection as LinuxPolicyProtection].enabled = false;
+ }
}
}
}
diff --git a/x-pack/plugins/security_solution/public/management/pages/policy/view/policy_forms/components/user_notification.tsx b/x-pack/plugins/security_solution/public/management/pages/policy/view/policy_forms/components/user_notification.tsx
index def9e78e994b0..e442491ed7ee8 100644
--- a/x-pack/plugins/security_solution/public/management/pages/policy/view/policy_forms/components/user_notification.tsx
+++ b/x-pack/plugins/security_solution/public/management/pages/policy/view/policy_forms/components/user_notification.tsx
@@ -24,7 +24,7 @@ import {
ProtectionModes,
UIPolicyConfig,
} from '../../../../../../../common/endpoint/types';
-import { PolicyProtection, MacPolicyProtection } from '../../../types';
+import { PolicyProtection, MacPolicyProtection, LinuxPolicyProtection } from '../../../types';
import { ConfigFormHeading } from '../../components/config_form';
import { usePolicyDetailsSelector } from '../../policy_hooks';
import { policyConfig } from '../../../store/policy_details/selectors';
@@ -57,6 +57,9 @@ export const UserNotification = React.memo(
} else if (os === 'mac') {
newPayload[os].popup[protection as MacPolicyProtection].enabled =
event.target.checked;
+ } else if (os === 'linux') {
+ newPayload[os].popup[protection as LinuxPolicyProtection].enabled =
+ event.target.checked;
}
}
dispatch({
@@ -77,6 +80,9 @@ export const UserNotification = React.memo(
newPayload[os].popup[protection].message = event.target.value;
} else if (os === 'mac') {
newPayload[os].popup[protection as MacPolicyProtection].message = event.target.value;
+ } else if (os === 'linux') {
+ newPayload[os].popup[protection as LinuxPolicyProtection].message =
+ event.target.value;
}
}
dispatch({
diff --git a/x-pack/plugins/security_solution/public/management/pages/policy/view/policy_forms/protections/malware.tsx b/x-pack/plugins/security_solution/public/management/pages/policy/view/policy_forms/protections/malware.tsx
index 03cd587ca7e5c..c17d6df36be68 100644
--- a/x-pack/plugins/security_solution/public/management/pages/policy/view/policy_forms/protections/malware.tsx
+++ b/x-pack/plugins/security_solution/public/management/pages/policy/view/policy_forms/protections/malware.tsx
@@ -24,7 +24,7 @@ import { ProtectionSwitch } from '../components/protection_switch';
* which will configure for all relevant OSes.
*/
export const MalwareProtections = React.memo(() => {
- const OSes: Immutable = [OS.windows, OS.mac];
+ const OSes: Immutable = [OS.windows, OS.mac, OS.linux];
const protection = 'malware';
const isPlatinumPlus = useLicense().isPlatinumPlus();
@@ -33,7 +33,7 @@ export const MalwareProtections = React.memo(() => {
type={i18n.translate('xpack.securitySolution.endpoint.policy.details.malware', {
defaultMessage: 'Malware',
})}
- supportedOss={[OperatingSystem.WINDOWS, OperatingSystem.MAC]}
+ supportedOss={[OperatingSystem.WINDOWS, OperatingSystem.MAC, OperatingSystem.LINUX]}
dataTestSubj="malwareProtectionsForm"
rightCorner={}
>
diff --git a/x-pack/plugins/security_solution/public/shared_imports.ts b/x-pack/plugins/security_solution/public/shared_imports.ts
index 76ec761d41703..59e49ec45686e 100644
--- a/x-pack/plugins/security_solution/public/shared_imports.ts
+++ b/x-pack/plugins/security_solution/public/shared_imports.ts
@@ -45,11 +45,6 @@ export {
useReadListIndex,
useReadListPrivileges,
fetchExceptionListById,
- addIdToEntries,
- getOperatorType,
- getNewExceptionItem,
- getEntryValue,
- getExceptionOperatorSelect,
addExceptionList,
ExceptionListFilter,
ExceptionListIdentifiers,
diff --git a/x-pack/plugins/security_solution/public/timelines/containers/api.ts b/x-pack/plugins/security_solution/public/timelines/containers/api.ts
index d1c798a27b6c4..e591685a31829 100644
--- a/x-pack/plugins/security_solution/public/timelines/containers/api.ts
+++ b/x-pack/plugins/security_solution/public/timelines/containers/api.ts
@@ -8,9 +8,7 @@
import { fold } from 'fp-ts/lib/Either';
import { identity } from 'fp-ts/lib/function';
import { pipe } from 'fp-ts/lib/pipeable';
-// Prefer importing entire lodash library, e.g. import { get } from "lodash"
-// eslint-disable-next-line no-restricted-imports
-import isEmpty from 'lodash/isEmpty';
+import { isEmpty } from 'lodash';
import { throwErrors } from '../../../../cases/common';
import {
diff --git a/x-pack/plugins/security_solution/scripts/endpoint/event_filters/index.ts b/x-pack/plugins/security_solution/scripts/endpoint/event_filters/index.ts
index 93af1f406300c..e3579d11331de 100644
--- a/x-pack/plugins/security_solution/scripts/endpoint/event_filters/index.ts
+++ b/x-pack/plugins/security_solution/scripts/endpoint/event_filters/index.ts
@@ -9,6 +9,7 @@ import { run, RunFn, createFailError } from '@kbn/dev-utils';
import { KbnClient } from '@kbn/test';
import { AxiosError } from 'axios';
import bluebird from 'bluebird';
+import type { CreateExceptionListSchema } from '@kbn/securitysolution-io-ts-list-types';
import { EventFilterGenerator } from '../../../common/endpoint/data_generators/event_filter_generator';
import {
ENDPOINT_EVENT_FILTERS_LIST_DESCRIPTION,
@@ -17,7 +18,6 @@ import {
EXCEPTION_LIST_ITEM_URL,
EXCEPTION_LIST_URL,
} from '../../../../lists/common/constants';
-import { CreateExceptionListSchema } from '../../../../lists/common';
export const cli = () => {
run(
diff --git a/x-pack/plugins/security_solution/scripts/endpoint/trusted_apps/index.ts b/x-pack/plugins/security_solution/scripts/endpoint/trusted_apps/index.ts
index edefaa9c2a50c..bfa3fe88f7ac8 100644
--- a/x-pack/plugins/security_solution/scripts/endpoint/trusted_apps/index.ts
+++ b/x-pack/plugins/security_solution/scripts/endpoint/trusted_apps/index.ts
@@ -5,7 +5,6 @@
* 2.0.
*/
-// @ts-ignore
import minimist from 'minimist';
import { ToolingLog } from '@kbn/dev-utils';
import { KbnClient } from '@kbn/test';
diff --git a/x-pack/plugins/security_solution/server/endpoint/lib/artifacts/lists.test.ts b/x-pack/plugins/security_solution/server/endpoint/lib/artifacts/lists.test.ts
index 5b4aed35bbc7c..9df242469752e 100644
--- a/x-pack/plugins/security_solution/server/endpoint/lib/artifacts/lists.test.ts
+++ b/x-pack/plugins/security_solution/server/endpoint/lib/artifacts/lists.test.ts
@@ -9,7 +9,7 @@ import { ExceptionListClient } from '../../../../../lists/server';
import { listMock } from '../../../../../lists/server/mocks';
import { getFoundExceptionListItemSchemaMock } from '../../../../../lists/common/schemas/response/found_exception_list_item_schema.mock';
import { getExceptionListItemSchemaMock } from '../../../../../lists/common/schemas/response/exception_list_item_schema.mock';
-import { EntriesArray, EntryList } from '@kbn/securitysolution-io-ts-list-types';
+import type { EntriesArray, EntryList } from '@kbn/securitysolution-io-ts-list-types';
import {
buildArtifact,
getEndpointExceptionList,
diff --git a/x-pack/plugins/security_solution/server/endpoint/lib/artifacts/lists.ts b/x-pack/plugins/security_solution/server/endpoint/lib/artifacts/lists.ts
index e73e3eb5c56f8..26212da1355db 100644
--- a/x-pack/plugins/security_solution/server/endpoint/lib/artifacts/lists.ts
+++ b/x-pack/plugins/security_solution/server/endpoint/lib/artifacts/lists.ts
@@ -7,9 +7,12 @@
import { createHash } from 'crypto';
import { deflate } from 'zlib';
-import { Entry, EntryNested } from '@kbn/securitysolution-io-ts-list-types';
+import type {
+ Entry,
+ EntryNested,
+ ExceptionListItemSchema,
+} from '@kbn/securitysolution-io-ts-list-types';
import { validate } from '@kbn/securitysolution-io-ts-utils';
-import { ExceptionListItemSchema } from '../../../../../lists/common/schemas';
import { ExceptionListClient } from '../../../../../lists/server';
import { ENDPOINT_LIST_ID, ENDPOINT_TRUSTED_APPS_LIST_ID } from '../../../../common/shared_imports';
diff --git a/x-pack/plugins/security_solution/server/endpoint/lib/policy/license_watch.ts b/x-pack/plugins/security_solution/server/endpoint/lib/policy/license_watch.ts
index 58a73d31708a1..b8c6e57f72cea 100644
--- a/x-pack/plugins/security_solution/server/endpoint/lib/policy/license_watch.ts
+++ b/x-pack/plugins/security_solution/server/endpoint/lib/policy/license_watch.ts
@@ -24,9 +24,9 @@ import { PackagePolicyServiceInterface } from '../../../../../fleet/server';
import { ILicense } from '../../../../../licensing/common/types';
import {
isEndpointPolicyValidForLicense,
- unsetPolicyFeaturesAboveLicenseLevel,
+ unsetPolicyFeaturesAccordingToLicenseLevel,
} from '../../../../common/license/policy_config';
-import { isAtLeast, LicenseService } from '../../../../common/license/license';
+import { LicenseService } from '../../../../common/license/license';
export class PolicyWatcher {
private logger: Logger;
@@ -76,10 +76,6 @@ export class PolicyWatcher {
}
public async watch(license: ILicense) {
- if (isAtLeast(license, 'platinum')) {
- return;
- }
-
let page = 1;
let response: {
items: PackagePolicy[];
@@ -114,7 +110,7 @@ export class PolicyWatcher {
};
const policyConfig = updatePolicy.inputs[0].config?.policy.value;
if (!isEndpointPolicyValidForLicense(policyConfig, license)) {
- updatePolicy.inputs[0].config!.policy.value = unsetPolicyFeaturesAboveLicenseLevel(
+ updatePolicy.inputs[0].config!.policy.value = unsetPolicyFeaturesAccordingToLicenseLevel(
policyConfig,
license
);
diff --git a/x-pack/plugins/security_solution/server/endpoint/routes/trusted_apps/handlers.test.ts b/x-pack/plugins/security_solution/server/endpoint/routes/trusted_apps/handlers.test.ts
index 0b4e1cb2b09b1..5e60fcd4bb115 100644
--- a/x-pack/plugins/security_solution/server/endpoint/routes/trusted_apps/handlers.test.ts
+++ b/x-pack/plugins/security_solution/server/endpoint/routes/trusted_apps/handlers.test.ts
@@ -9,7 +9,7 @@ import { KibanaResponseFactory } from 'kibana/server';
import { xpackMocks } from '../../../../../../mocks';
import { loggingSystemMock, httpServerMock } from '../../../../../../../src/core/server/mocks';
-import { ExceptionListItemSchema } from '../../../../../lists/common/schemas/response';
+import { ExceptionListItemSchema } from '@kbn/securitysolution-io-ts-list-types';
import { listMock } from '../../../../../lists/server/mocks';
import { ExceptionListClient } from '../../../../../lists/server';
import { createMockConfig } from '../../../lib/detection_engine/routes/__mocks__';
diff --git a/x-pack/plugins/security_solution/server/endpoint/routes/trusted_apps/mapping.test.ts b/x-pack/plugins/security_solution/server/endpoint/routes/trusted_apps/mapping.test.ts
index 9ee2ece627841..fe46277664408 100644
--- a/x-pack/plugins/security_solution/server/endpoint/routes/trusted_apps/mapping.test.ts
+++ b/x-pack/plugins/security_solution/server/endpoint/routes/trusted_apps/mapping.test.ts
@@ -6,7 +6,7 @@
*/
import { CreateExceptionListItemOptions } from '../../../../../lists/server';
-import { ExceptionListItemSchema } from '../../../../../lists/common/schemas/response';
+import { ExceptionListItemSchema } from '@kbn/securitysolution-io-ts-list-types';
import {
ConditionEntryField,
diff --git a/x-pack/plugins/security_solution/server/endpoint/routes/trusted_apps/mapping.ts b/x-pack/plugins/security_solution/server/endpoint/routes/trusted_apps/mapping.ts
index 897ffe4ee48cd..1a4ff2812cd23 100644
--- a/x-pack/plugins/security_solution/server/endpoint/routes/trusted_apps/mapping.ts
+++ b/x-pack/plugins/security_solution/server/endpoint/routes/trusted_apps/mapping.ts
@@ -14,10 +14,9 @@ import type {
EntryNested,
NestedEntriesArray,
OsType,
+ ExceptionListItemSchema,
} from '@kbn/securitysolution-io-ts-list-types';
-import type { ExceptionListItemSchema } from '../../../../../lists/common';
-
import { ENDPOINT_TRUSTED_APPS_LIST_ID } from '../../../../../lists/common/constants';
import type {
CreateExceptionListItemOptions,
diff --git a/x-pack/plugins/security_solution/server/endpoint/routes/trusted_apps/service.test.ts b/x-pack/plugins/security_solution/server/endpoint/routes/trusted_apps/service.test.ts
index d99a89ce11137..081010ea0098a 100644
--- a/x-pack/plugins/security_solution/server/endpoint/routes/trusted_apps/service.test.ts
+++ b/x-pack/plugins/security_solution/server/endpoint/routes/trusted_apps/service.test.ts
@@ -5,7 +5,7 @@
* 2.0.
*/
-import { ExceptionListItemSchema } from '../../../../../lists/common/schemas/response';
+import type { ExceptionListItemSchema } from '@kbn/securitysolution-io-ts-list-types';
import { listMock } from '../../../../../lists/server/mocks';
import { ExceptionListClient } from '../../../../../lists/server';
import {
diff --git a/x-pack/plugins/security_solution/server/endpoint/routes/trusted_apps/service.ts b/x-pack/plugins/security_solution/server/endpoint/routes/trusted_apps/service.ts
index a2d79f7246b14..c30a7a9a38cdc 100644
--- a/x-pack/plugins/security_solution/server/endpoint/routes/trusted_apps/service.ts
+++ b/x-pack/plugins/security_solution/server/endpoint/routes/trusted_apps/service.ts
@@ -5,11 +5,9 @@
* 2.0.
*/
+import type { ExceptionListItemSchema } from '@kbn/securitysolution-io-ts-list-types';
import { ExceptionListClient } from '../../../../../lists/server';
-import {
- ENDPOINT_TRUSTED_APPS_LIST_ID,
- ExceptionListItemSchema,
-} from '../../../../../lists/common';
+import { ENDPOINT_TRUSTED_APPS_LIST_ID } from '../../../../../lists/common';
import {
DeleteTrustedAppsRequestParams,
diff --git a/x-pack/plugins/security_solution/server/endpoint/services/artifacts/manifest_manager/manifest_manager.mock.ts b/x-pack/plugins/security_solution/server/endpoint/services/artifacts/manifest_manager/manifest_manager.mock.ts
index 6f41fe3578496..f471ace617a6d 100644
--- a/x-pack/plugins/security_solution/server/endpoint/services/artifacts/manifest_manager/manifest_manager.mock.ts
+++ b/x-pack/plugins/security_solution/server/endpoint/services/artifacts/manifest_manager/manifest_manager.mock.ts
@@ -12,7 +12,7 @@ import { PackagePolicyServiceInterface } from '../../../../../../fleet/server';
import { createPackagePolicyServiceMock } from '../../../../../../fleet/server/mocks';
import { ExceptionListClient } from '../../../../../../lists/server';
import { listMock } from '../../../../../../lists/server/mocks';
-import { ExceptionListItemSchema } from '../../../../../../lists/common/schemas/response';
+import type { ExceptionListItemSchema } from '@kbn/securitysolution-io-ts-list-types';
import {
createPackagePolicyWithManifestMock,
createPackagePolicyWithInitialManifestMock,
diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rules/types.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/rules/types.ts
index 660518fa4d8ee..380eb085e0d5a 100644
--- a/x-pack/plugins/security_solution/server/lib/detection_engine/rules/types.ts
+++ b/x-pack/plugins/security_solution/server/lib/detection_engine/rules/types.ts
@@ -14,7 +14,7 @@ import {
SavedObjectsFindResponse,
SavedObjectsClientContract,
} from 'kibana/server';
-import {
+import type {
MachineLearningJobIdOrUndefined,
From,
FromOrUndefined,
@@ -42,9 +42,9 @@ import {
MaxSignalsOrUndefined,
MaxSignals,
} from '@kbn/securitysolution-io-ts-alerting-types';
-import { VersionOrUndefined, Version } from '@kbn/securitysolution-io-ts-types';
+import type { VersionOrUndefined, Version } from '@kbn/securitysolution-io-ts-types';
-import { ListArrayOrUndefined, ListArray } from '@kbn/securitysolution-io-ts-list-types';
+import type { ListArrayOrUndefined, ListArray } from '@kbn/securitysolution-io-ts-list-types';
import { UpdateRulesSchema } from '../../../../common/detection_engine/schemas/request';
import { RuleAlertAction } from '../../../../common/detection_engine/types';
import {
diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rules/utils.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/rules/utils.ts
index a31f9bec2cd58..6e6bb38e46df6 100644
--- a/x-pack/plugins/security_solution/server/lib/detection_engine/rules/utils.ts
+++ b/x-pack/plugins/security_solution/server/lib/detection_engine/rules/utils.ts
@@ -6,7 +6,7 @@
*/
import { pickBy, isEmpty } from 'lodash/fp';
-import {
+import type {
FromOrUndefined,
MachineLearningJobIdOrUndefined,
RiskScoreMappingOrUndefined,
@@ -25,8 +25,8 @@ import {
SeverityMappingOrUndefined,
MaxSignalsOrUndefined,
} from '@kbn/securitysolution-io-ts-alerting-types';
-import { ListArrayOrUndefined } from '@kbn/securitysolution-io-ts-list-types';
-import { VersionOrUndefined } from '@kbn/securitysolution-io-ts-types';
+import type { ListArrayOrUndefined } from '@kbn/securitysolution-io-ts-list-types';
+import type { VersionOrUndefined } from '@kbn/securitysolution-io-ts-types';
import {
DescriptionOrUndefined,
AnomalyThresholdOrUndefined,
diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/signals/executors/eql.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/signals/executors/eql.ts
index aa51d133260b8..a5ebfef9d2c68 100644
--- a/x-pack/plugins/security_solution/server/lib/detection_engine/signals/executors/eql.ts
+++ b/x-pack/plugins/security_solution/server/lib/detection_engine/signals/executors/eql.ts
@@ -9,6 +9,7 @@ import { ApiResponse } from '@elastic/elasticsearch';
import { performance } from 'perf_hooks';
import { Logger } from 'src/core/server';
import { SavedObject } from 'src/core/types';
+import type { ExceptionListItemSchema } from '@kbn/securitysolution-io-ts-list-types';
import {
AlertInstanceContext,
AlertInstanceState,
@@ -16,7 +17,6 @@ import {
} from '../../../../../../alerting/server';
import { buildEqlSearchRequest } from '../../../../../common/detection_engine/get_query_filter';
import { hasLargeValueItem } from '../../../../../common/detection_engine/utils';
-import { ExceptionListItemSchema } from '../../../../../common/shared_imports';
import { isOutdated } from '../../migrations/helpers';
import { getIndexVersion } from '../../routes/index/get_index_version';
import { MIN_EQL_RULE_INDEX_VERSION } from '../../routes/index/get_signals_template';
diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/signals/executors/ml.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/signals/executors/ml.ts
index 928767e922d67..28703046289f5 100644
--- a/x-pack/plugins/security_solution/server/lib/detection_engine/signals/executors/ml.ts
+++ b/x-pack/plugins/security_solution/server/lib/detection_engine/signals/executors/ml.ts
@@ -7,6 +7,7 @@
import { KibanaRequest, Logger } from 'src/core/server';
import { SavedObject } from 'src/core/types';
+import type { ExceptionListItemSchema } from '@kbn/securitysolution-io-ts-list-types';
import {
AlertInstanceContext,
AlertInstanceState,
@@ -14,7 +15,6 @@ import {
} from '../../../../../../alerting/server';
import { ListClient } from '../../../../../../lists/server';
import { isJobStarted } from '../../../../../common/machine_learning/helpers';
-import { ExceptionListItemSchema } from '../../../../../common/shared_imports';
import { SetupPlugins } from '../../../../plugin';
import { MachineLearningRuleParams } from '../../schemas/rule_schemas';
import { RefreshTypes } from '../../types';
diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/signals/executors/query.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/signals/executors/query.ts
index 54f935ec74026..05e2e3056e99e 100644
--- a/x-pack/plugins/security_solution/server/lib/detection_engine/signals/executors/query.ts
+++ b/x-pack/plugins/security_solution/server/lib/detection_engine/signals/executors/query.ts
@@ -7,13 +7,13 @@
import { SavedObject } from 'src/core/types';
import { Logger } from 'src/core/server';
+import type { ExceptionListItemSchema } from '@kbn/securitysolution-io-ts-list-types';
import {
AlertInstanceContext,
AlertInstanceState,
AlertServices,
} from '../../../../../../alerting/server';
import { ListClient } from '../../../../../../lists/server';
-import { ExceptionListItemSchema } from '../../../../../common/shared_imports';
import { RefreshTypes } from '../../types';
import { getFilter } from '../get_filter';
import { getInputIndex } from '../get_input_output_index';
diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/signals/executors/threat_match.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/signals/executors/threat_match.ts
index 62619cf948d40..10b4ce939ca3a 100644
--- a/x-pack/plugins/security_solution/server/lib/detection_engine/signals/executors/threat_match.ts
+++ b/x-pack/plugins/security_solution/server/lib/detection_engine/signals/executors/threat_match.ts
@@ -7,13 +7,13 @@
import { SavedObject } from 'src/core/types';
import { Logger } from 'src/core/server';
+import type { ExceptionListItemSchema } from '@kbn/securitysolution-io-ts-list-types';
import {
AlertInstanceContext,
AlertInstanceState,
AlertServices,
} from '../../../../../../alerting/server';
import { ListClient } from '../../../../../../lists/server';
-import { ExceptionListItemSchema } from '../../../../../common/shared_imports';
import { RefreshTypes } from '../../types';
import { getInputIndex } from '../get_input_output_index';
import { RuleRangeTuple, AlertAttributes } from '../types';
diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/signals/executors/threshold.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/signals/executors/threshold.ts
index 204481f5d910c..fa0986044e250 100644
--- a/x-pack/plugins/security_solution/server/lib/detection_engine/signals/executors/threshold.ts
+++ b/x-pack/plugins/security_solution/server/lib/detection_engine/signals/executors/threshold.ts
@@ -7,13 +7,13 @@
import { Logger } from 'src/core/server';
import { SavedObject } from 'src/core/types';
+import type { ExceptionListItemSchema } from '@kbn/securitysolution-io-ts-list-types';
import {
AlertInstanceContext,
AlertInstanceState,
AlertServices,
} from '../../../../../../alerting/server';
import { hasLargeValueItem } from '../../../../../common/detection_engine/utils';
-import { ExceptionListItemSchema } from '../../../../../common/shared_imports';
import { ThresholdRuleParams } from '../../schemas/rule_schemas';
import { RefreshTypes } from '../../types';
import { getFilter } from '../get_filter';
diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/signals/filters/create_field_and_set_tuples.test.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/signals/filters/create_field_and_set_tuples.test.ts
index 578c1aba64558..b46237cc93bc8 100644
--- a/x-pack/plugins/security_solution/server/lib/detection_engine/signals/filters/create_field_and_set_tuples.test.ts
+++ b/x-pack/plugins/security_solution/server/lib/detection_engine/signals/filters/create_field_and_set_tuples.test.ts
@@ -11,7 +11,7 @@ import { mockLogger, sampleDocWithSortId } from '../__mocks__/es_results';
import { getExceptionListItemSchemaMock } from '../../../../../../lists/common/schemas/response/exception_list_item_schema.mock';
import { listMock } from '../../../../../../lists/server/mocks';
import { getSearchListItemResponseMock } from '../../../../../../lists/common/schemas/response/search_list_item_schema.mock';
-import { EntryList } from '@kbn/securitysolution-io-ts-list-types';
+import type { EntryList } from '@kbn/securitysolution-io-ts-list-types';
import { buildRuleMessageMock as buildRuleMessage } from '../rule_messages.mock';
describe('filterEventsAgainstList', () => {
diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/signals/filters/filter_events_against_list.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/signals/filters/filter_events_against_list.ts
index f50f0b521ed76..198a1e805febe 100644
--- a/x-pack/plugins/security_solution/server/lib/detection_engine/signals/filters/filter_events_against_list.ts
+++ b/x-pack/plugins/security_solution/server/lib/detection_engine/signals/filters/filter_events_against_list.ts
@@ -6,9 +6,8 @@
*/
import type { estypes } from '@elastic/elasticsearch';
-import { entriesList } from '@kbn/securitysolution-io-ts-list-types';
+import { entriesList, ExceptionListItemSchema } from '@kbn/securitysolution-io-ts-list-types';
-import { ExceptionListItemSchema } from '../../../../../../lists/common/schemas';
import { hasLargeValueList } from '../../../../../common/detection_engine/utils';
import { FilterEventsAgainstListOptions } from './types';
import { filterEvents } from './filter_events';
diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/signals/filters/types.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/signals/filters/types.ts
index f653fde816c62..1252ca3f5faa5 100644
--- a/x-pack/plugins/security_solution/server/lib/detection_engine/signals/filters/types.ts
+++ b/x-pack/plugins/security_solution/server/lib/detection_engine/signals/filters/types.ts
@@ -7,10 +7,9 @@
import type { estypes } from '@elastic/elasticsearch';
import { Logger } from 'src/core/server';
-import { Type } from '@kbn/securitysolution-io-ts-list-types';
+import type { Type, ExceptionListItemSchema } from '@kbn/securitysolution-io-ts-list-types';
import { ListClient } from '../../../../../../lists/server';
import { BuildRuleMessage } from '../rule_messages';
-import { ExceptionListItemSchema } from '../../../../../../lists/common/schemas';
export interface FilterEventsAgainstListOptions {
listClient: ListClient;
diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/signals/find_ml_signals.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/signals/find_ml_signals.ts
index 6870ae2d80bbf..10f89b56229dc 100644
--- a/x-pack/plugins/security_solution/server/lib/detection_engine/signals/find_ml_signals.ts
+++ b/x-pack/plugins/security_solution/server/lib/detection_engine/signals/find_ml_signals.ts
@@ -6,7 +6,7 @@
*/
import dateMath from '@elastic/datemath';
-import { ExceptionListItemSchema } from '../../../../../lists/common';
+import type { ExceptionListItemSchema } from '@kbn/securitysolution-io-ts-list-types';
import { KibanaRequest, SavedObjectsClientContract } from '../../../../../../../src/core/server';
import { MlPluginSetup } from '../../../../../ml/server';
diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/signals/get_filter.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/signals/get_filter.ts
index 3d6a1f8da7f4d..346c4adeba537 100644
--- a/x-pack/plugins/security_solution/server/lib/detection_engine/signals/get_filter.ts
+++ b/x-pack/plugins/security_solution/server/lib/detection_engine/signals/get_filter.ts
@@ -7,6 +7,7 @@
import { BadRequestError } from '@kbn/securitysolution-es-utils';
import { Type, LanguageOrUndefined, Language } from '@kbn/securitysolution-io-ts-alerting-types';
+import type { ExceptionListItemSchema } from '@kbn/securitysolution-io-ts-list-types';
import { assertUnreachable } from '../../../../common/utility_types';
import { getQueryFilter } from '../../../../common/detection_engine/get_query_filter';
import {
@@ -14,7 +15,6 @@ import {
SavedIdOrUndefined,
IndexOrUndefined,
} from '../../../../common/detection_engine/schemas/common/schemas';
-import { ExceptionListItemSchema } from '../../../../../lists/common/schemas';
import {
AlertInstanceContext,
AlertInstanceState,
diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/signals/search_after_bulk_create.test.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/signals/search_after_bulk_create.test.ts
index 0c7723b6f4cc2..52c887c3ca55a 100644
--- a/x-pack/plugins/security_solution/server/lib/detection_engine/signals/search_after_bulk_create.test.ts
+++ b/x-pack/plugins/security_solution/server/lib/detection_engine/signals/search_after_bulk_create.test.ts
@@ -23,7 +23,7 @@ import uuid from 'uuid';
import { listMock } from '../../../../../lists/server/mocks';
import { getExceptionListItemSchemaMock } from '../../../../../lists/common/schemas/response/exception_list_item_schema.mock';
import { BulkResponse, RuleRangeTuple } from './types';
-import { SearchListItemArraySchema } from '../../../../../lists/common/schemas';
+import type { SearchListItemArraySchema } from '@kbn/securitysolution-io-ts-list-types';
import { getSearchListItemResponseMock } from '../../../../../lists/common/schemas/response/search_list_item_schema.mock';
import { getRuleRangeTuples } from './utils';
// eslint-disable-next-line @kbn/eslint/no-restricted-paths
diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/signals/threat_mapping/types.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/signals/threat_mapping/types.ts
index 82fc0dd3abd0a..094c4d74d8ac7 100644
--- a/x-pack/plugins/security_solution/server/lib/detection_engine/signals/threat_mapping/types.ts
+++ b/x-pack/plugins/security_solution/server/lib/detection_engine/signals/threat_mapping/types.ts
@@ -5,7 +5,7 @@
* 2.0.
*/
import type { estypes } from '@elastic/elasticsearch';
-import {
+import type {
ThreatQuery,
ThreatMapping,
ThreatMappingEntries,
@@ -17,13 +17,13 @@ import {
LanguageOrUndefined,
Type,
} from '@kbn/securitysolution-io-ts-alerting-types';
+import type { ExceptionListItemSchema } from '@kbn/securitysolution-io-ts-list-types';
import { ListClient } from '../../../../../../lists/server';
import {
AlertInstanceContext,
AlertInstanceState,
AlertServices,
} from '../../../../../../alerting/server';
-import { ExceptionListItemSchema } from '../../../../../../lists/common/schemas';
import { ElasticsearchClient, Logger, SavedObject } from '../../../../../../../../src/core/server';
import { TelemetryEventsSender } from '../../../telemetry/sender';
import { BuildRuleMessage } from '../rule_messages';
diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/signals/types.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/signals/types.ts
index 80d08a77ba5d2..8f34e58ebc85b 100644
--- a/x-pack/plugins/security_solution/server/lib/detection_engine/signals/types.ts
+++ b/x-pack/plugins/security_solution/server/lib/detection_engine/signals/types.ts
@@ -8,6 +8,7 @@
import type { estypes } from '@elastic/elasticsearch';
import { DslQuery, Filter } from 'src/plugins/data/common';
import moment, { Moment } from 'moment';
+import type { ExceptionListItemSchema } from '@kbn/securitysolution-io-ts-list-types';
import { Status } from '../../../../common/detection_engine/schemas/common/schemas';
import { RulesSchema } from '../../../../common/detection_engine/schemas/response/rules_schema';
import {
@@ -28,7 +29,6 @@ import {
import { RefreshTypes } from '../types';
import { ListClient } from '../../../../../lists/server';
import { Logger, SavedObject } from '../../../../../../../src/core/server';
-import { ExceptionListItemSchema } from '../../../../../lists/common/schemas';
import { BuildRuleMessage } from './rule_messages';
import { TelemetryEventsSender } from '../../telemetry/sender';
import { RuleParams } from '../schemas/rule_schemas';
diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/signals/utils.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/signals/utils.ts
index c2e3fe83b8893..488a46ab4748d 100644
--- a/x-pack/plugins/security_solution/server/lib/detection_engine/signals/utils.ts
+++ b/x-pack/plugins/security_solution/server/lib/detection_engine/signals/utils.ts
@@ -14,7 +14,7 @@ import { isEmpty, partition } from 'lodash';
import { ApiResponse, Context } from '@elastic/elasticsearch/lib/Transport';
import { SortResults } from '@elastic/elasticsearch/api/types';
-import { ListArray } from '@kbn/securitysolution-io-ts-list-types';
+import type { ListArray, ExceptionListItemSchema } from '@kbn/securitysolution-io-ts-list-types';
import {
TimestampOverrideOrUndefined,
Privilege,
@@ -27,7 +27,6 @@ import {
parseDuration,
} from '../../../../../alerting/server';
import { ExceptionListClient, ListClient, ListPluginSetup } from '../../../../../lists/server';
-import { ExceptionListItemSchema } from '../../../../../lists/common/schemas';
import {
BulkResponseErrorAggregation,
SignalHit,
diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/types.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/types.ts
index 03ec7928115b7..1b80a9b6b02e2 100644
--- a/x-pack/plugins/security_solution/server/lib/detection_engine/types.ts
+++ b/x-pack/plugins/security_solution/server/lib/detection_engine/types.ts
@@ -26,7 +26,7 @@ import {
} from '@kbn/securitysolution-io-ts-alerting-types';
import { Version } from '@kbn/securitysolution-io-ts-types';
-import { ListArrayOrUndefined } from '@kbn/securitysolution-io-ts-list-types';
+import type { ListArrayOrUndefined } from '@kbn/securitysolution-io-ts-list-types';
import {
AnomalyThresholdOrUndefined,
Description,
diff --git a/x-pack/plugins/security_solution/server/lib/machine_learning/index.ts b/x-pack/plugins/security_solution/server/lib/machine_learning/index.ts
index db42dc2720b2a..40dc9392d31ea 100644
--- a/x-pack/plugins/security_solution/server/lib/machine_learning/index.ts
+++ b/x-pack/plugins/security_solution/server/lib/machine_learning/index.ts
@@ -7,8 +7,8 @@
import type { estypes } from '@elastic/elasticsearch';
+import type { ExceptionListItemSchema } from '@kbn/securitysolution-io-ts-list-types';
import { buildExceptionFilter } from '../../../common/shared_imports';
-import { ExceptionListItemSchema } from '../../../../lists/common';
import { AnomalyRecordDoc as Anomaly } from '../../../../ml/server';
export { Anomaly };
diff --git a/x-pack/plugins/telemetry_collection_xpack/schema/xpack_plugins.json b/x-pack/plugins/telemetry_collection_xpack/schema/xpack_plugins.json
index f88034f70ddf4..1c0062a20d892 100644
--- a/x-pack/plugins/telemetry_collection_xpack/schema/xpack_plugins.json
+++ b/x-pack/plugins/telemetry_collection_xpack/schema/xpack_plugins.json
@@ -3216,6 +3216,122 @@
}
}
},
+ "resolutions": {
+ "properties": {
+ "coarse": {
+ "properties": {
+ "min": {
+ "type": "long",
+ "_meta": {
+ "description": "min number of grid-agg layers with coarse resolution"
+ }
+ },
+ "max": {
+ "type": "long",
+ "_meta": {
+ "description": "max number of grid-agg layers with coarse resolution"
+ }
+ },
+ "avg": {
+ "type": "float",
+ "_meta": {
+ "description": "avg number of grid-agg layers with coarse resolution"
+ }
+ },
+ "total": {
+ "type": "long",
+ "_meta": {
+ "description": "total number of grid-agg layers with coarse resolution"
+ }
+ }
+ }
+ },
+ "fine": {
+ "properties": {
+ "min": {
+ "type": "long",
+ "_meta": {
+ "description": "min number of grid-agg layers with fine resolution"
+ }
+ },
+ "max": {
+ "type": "long",
+ "_meta": {
+ "description": "max number of grid-agg layers with fine resolution"
+ }
+ },
+ "avg": {
+ "type": "float",
+ "_meta": {
+ "description": "avg number of grid-agg layers with fine resolution"
+ }
+ },
+ "total": {
+ "type": "long",
+ "_meta": {
+ "description": "total number of grid-agg layers with fine resolution"
+ }
+ }
+ }
+ },
+ "most_fine": {
+ "properties": {
+ "min": {
+ "type": "long",
+ "_meta": {
+ "description": "min number of grid-agg layers with most_fine resolution"
+ }
+ },
+ "max": {
+ "type": "long",
+ "_meta": {
+ "description": "max number of grid-agg layers with most_fine resolution"
+ }
+ },
+ "avg": {
+ "type": "float",
+ "_meta": {
+ "description": "avg number of grid-agg layers with most_fine resolution"
+ }
+ },
+ "total": {
+ "type": "long",
+ "_meta": {
+ "description": "total number of grid-agg layers with most_fine resolution"
+ }
+ }
+ }
+ },
+ "super_fine": {
+ "properties": {
+ "min": {
+ "type": "long",
+ "_meta": {
+ "description": "min number of grid-agg layers with super_fine resolution"
+ }
+ },
+ "max": {
+ "type": "long",
+ "_meta": {
+ "description": "max number of grid-agg layers with super_fine resolution"
+ }
+ },
+ "avg": {
+ "type": "float",
+ "_meta": {
+ "description": "avg number of grid-agg layers with super_fine resolution"
+ }
+ },
+ "total": {
+ "type": "long",
+ "_meta": {
+ "description": "total number of grid-agg layers with super_fine resolution"
+ }
+ }
+ }
+ }
+ }
+ },
"joins": {
"properties": {
"term": {
diff --git a/x-pack/plugins/translations/translations/ja-JP.json b/x-pack/plugins/translations/translations/ja-JP.json
index 795a61e862601..800231dd5e6ac 100644
--- a/x-pack/plugins/translations/translations/ja-JP.json
+++ b/x-pack/plugins/translations/translations/ja-JP.json
@@ -13488,14 +13488,6 @@
"xpack.lists.exceptions.builder.fieldLabel": "フィールド",
"xpack.lists.exceptions.builder.operatorLabel": "演算子",
"xpack.lists.exceptions.builder.valueLabel": "値",
- "xpack.lists.exceptions.doesNotExistOperatorLabel": "存在しない",
- "xpack.lists.exceptions.existsOperatorLabel": "存在する",
- "xpack.lists.exceptions.isInListOperatorLabel": "リストにある",
- "xpack.lists.exceptions.isNotInListOperatorLabel": "リストにない",
- "xpack.lists.exceptions.isNotOneOfOperatorLabel": "is not one of",
- "xpack.lists.exceptions.isNotOperatorLabel": "is not",
- "xpack.lists.exceptions.isOneOfOperatorLabel": "is one of",
- "xpack.lists.exceptions.isOperatorLabel": "is",
"xpack.lists.exceptions.orDescription": "OR",
"xpack.logstash.addRoleAlert.grantAdditionalPrivilegesDescription": "Kibana の管理で、Kibana ユーザーに {role} ロールを割り当ててください。",
"xpack.logstash.addRoleAlert.grantAdditionalPrivilegesTitle": "追加権限の授与。",
@@ -20958,7 +20950,6 @@
"xpack.securitySolution.exceptions.detectionListLabel": "検出リスト",
"xpack.securitySolution.exceptions.dissasociateExceptionListError": "例外リストを削除できませんでした",
"xpack.securitySolution.exceptions.dissasociateListSuccessText": "例外リスト ({id}) が正常に削除されました",
- "xpack.securitySolution.exceptions.doesNotExistOperatorLabel": "存在しない",
"xpack.securitySolution.exceptions.editButtonLabel": "編集",
"xpack.securitySolution.exceptions.editException.bulkCloseLabel": "この例外一致し、このルールによって生成された、すべてのアラートを閉じる",
"xpack.securitySolution.exceptions.editException.bulkCloseLabel.disabled": "この例外と一致し、このルールによって生成された、すべてのアラートを閉じる (リストと非ECSフィールドはサポートされません) ",
@@ -20976,16 +20967,9 @@
"xpack.securitySolution.exceptions.endpointListLabel": "エンドポイントリスト",
"xpack.securitySolution.exceptions.errorLabel": "エラー",
"xpack.securitySolution.exceptions.exceptionsPaginationLabel": "ページごとの項目数:{items}",
- "xpack.securitySolution.exceptions.existsOperatorLabel": "存在する",
"xpack.securitySolution.exceptions.fetch404Error": "関連付けられた例外リスト ({listId}) は存在しません。その他の例外を検出ルールに追加するには、見つからない例外リストを削除してください。",
"xpack.securitySolution.exceptions.fetchError": "例外リストの取得エラー",
"xpack.securitySolution.exceptions.fieldDescription": "フィールド",
- "xpack.securitySolution.exceptions.isInListOperatorLabel": "リストにある",
- "xpack.securitySolution.exceptions.isNotInListOperatorLabel": "リストにない",
- "xpack.securitySolution.exceptions.isNotOneOfOperatorLabel": "is not one of",
- "xpack.securitySolution.exceptions.isNotOperatorLabel": "is not",
- "xpack.securitySolution.exceptions.isOneOfOperatorLabel": "is one of",
- "xpack.securitySolution.exceptions.isOperatorLabel": "is",
"xpack.securitySolution.exceptions.modalErrorAccordionText": "ルール参照情報を表示:",
"xpack.securitySolution.exceptions.operatingSystemLabel": "OS",
"xpack.securitySolution.exceptions.operatorDescription": "演算子",
diff --git a/x-pack/plugins/translations/translations/zh-CN.json b/x-pack/plugins/translations/translations/zh-CN.json
index 3272e0ecfa8cf..e524d3f3a88d6 100644
--- a/x-pack/plugins/translations/translations/zh-CN.json
+++ b/x-pack/plugins/translations/translations/zh-CN.json
@@ -13665,14 +13665,6 @@
"xpack.lists.exceptions.builder.fieldLabel": "字段",
"xpack.lists.exceptions.builder.operatorLabel": "运算符",
"xpack.lists.exceptions.builder.valueLabel": "值",
- "xpack.lists.exceptions.doesNotExistOperatorLabel": "不存在",
- "xpack.lists.exceptions.existsOperatorLabel": "存在",
- "xpack.lists.exceptions.isInListOperatorLabel": "在列表中",
- "xpack.lists.exceptions.isNotInListOperatorLabel": "不在列表中",
- "xpack.lists.exceptions.isNotOneOfOperatorLabel": "不属于",
- "xpack.lists.exceptions.isNotOperatorLabel": "不是",
- "xpack.lists.exceptions.isOneOfOperatorLabel": "属于",
- "xpack.lists.exceptions.isOperatorLabel": "是",
"xpack.lists.exceptions.orDescription": "OR",
"xpack.logstash.addRoleAlert.grantAdditionalPrivilegesDescription": "在 Kibana“管理”中,将 {role} 角色分配给您的 Kibana 用户。",
"xpack.logstash.addRoleAlert.grantAdditionalPrivilegesTitle": "授予其他权限。",
@@ -21266,7 +21258,6 @@
"xpack.securitySolution.exceptions.detectionListLabel": "检测列表",
"xpack.securitySolution.exceptions.dissasociateExceptionListError": "无法移除例外列表",
"xpack.securitySolution.exceptions.dissasociateListSuccessText": "例外列表 ({id}) 已成功移除",
- "xpack.securitySolution.exceptions.doesNotExistOperatorLabel": "不存在",
"xpack.securitySolution.exceptions.editButtonLabel": "编辑",
"xpack.securitySolution.exceptions.editException.bulkCloseLabel": "关闭所有与此例外匹配且根据此规则生成的告警",
"xpack.securitySolution.exceptions.editException.bulkCloseLabel.disabled": "关闭所有与此例外匹配且根据此规则生成的告警 (不支持列表和非 ECS 字段) ",
@@ -21284,17 +21275,10 @@
"xpack.securitySolution.exceptions.endpointListLabel": "终端列表",
"xpack.securitySolution.exceptions.errorLabel": "错误",
"xpack.securitySolution.exceptions.exceptionsPaginationLabel": "每页项数:{items}",
- "xpack.securitySolution.exceptions.existsOperatorLabel": "存在",
"xpack.securitySolution.exceptions.fetch404Error": "关联的例外列表 ({listId}) 已不存在。请移除缺少的例外列表,以将其他例外添加到检测规则。",
"xpack.securitySolution.exceptions.fetchError": "提取例外列表时出错",
"xpack.securitySolution.exceptions.fieldDescription": "字段",
"xpack.securitySolution.exceptions.hideCommentsLabel": "隐藏 ({comments}) 个{comments, plural, other {注释}}",
- "xpack.securitySolution.exceptions.isInListOperatorLabel": "在列表中",
- "xpack.securitySolution.exceptions.isNotInListOperatorLabel": "不在列表中",
- "xpack.securitySolution.exceptions.isNotOneOfOperatorLabel": "不属于",
- "xpack.securitySolution.exceptions.isNotOperatorLabel": "不是",
- "xpack.securitySolution.exceptions.isOneOfOperatorLabel": "属于",
- "xpack.securitySolution.exceptions.isOperatorLabel": "是",
"xpack.securitySolution.exceptions.modalErrorAccordionText": "显示规则引用信息:",
"xpack.securitySolution.exceptions.operatingSystemLabel": "OS",
"xpack.securitySolution.exceptions.operatorDescription": "运算符",
diff --git a/x-pack/plugins/uptime/public/components/overview/query_bar/use_query_bar.ts b/x-pack/plugins/uptime/public/components/overview/query_bar/use_query_bar.ts
index 164231bfdd89b..2f2d8bf092ddf 100644
--- a/x-pack/plugins/uptime/public/components/overview/query_bar/use_query_bar.ts
+++ b/x-pack/plugins/uptime/public/components/overview/query_bar/use_query_bar.ts
@@ -6,7 +6,7 @@
*/
import React, { useCallback, useState } from 'react';
-import { useDebounce } from 'react-use';
+import useDebounce from 'react-use/lib/useDebounce';
import { useDispatch } from 'react-redux';
import { Query } from 'src/plugins/data/common';
import { useGetUrlParams, useUpdateKueryString, useUrlParams } from '../../../hooks';
diff --git a/x-pack/test/detection_engine_api_integration/security_and_spaces/tests/create_exceptions.ts b/x-pack/test/detection_engine_api_integration/security_and_spaces/tests/create_exceptions.ts
index 18f9858726723..c014d08e91f66 100644
--- a/x-pack/test/detection_engine_api_integration/security_and_spaces/tests/create_exceptions.ts
+++ b/x-pack/test/detection_engine_api_integration/security_and_spaces/tests/create_exceptions.ts
@@ -8,6 +8,7 @@
/* eslint-disable @typescript-eslint/naming-convention */
import expect from '@kbn/expect';
+import type { CreateExceptionListItemSchema } from '@kbn/securitysolution-io-ts-list-types';
import {
CreateRulesSchema,
EqlCreateSchema,
@@ -24,7 +25,6 @@ import {
} from '../../../lists_api_integration/utils';
import { RulesSchema } from '../../../../plugins/security_solution/common/detection_engine/schemas/response';
import { getCreateExceptionListMinimalSchemaMock } from '../../../../plugins/lists/common/schemas/request/create_exception_list_schema.mock';
-import { CreateExceptionListItemSchema } from '../../../../plugins/lists/common';
import {
EXCEPTION_LIST_ITEM_URL,
EXCEPTION_LIST_URL,
diff --git a/x-pack/test/detection_engine_api_integration/utils.ts b/x-pack/test/detection_engine_api_integration/utils.ts
index 0f888c3ee515a..3a06ea1c8bc7a 100644
--- a/x-pack/test/detection_engine_api_integration/utils.ts
+++ b/x-pack/test/detection_engine_api_integration/utils.ts
@@ -12,7 +12,13 @@ import { SuperTest } from 'supertest';
import supertestAsPromised from 'supertest-as-promised';
import { Context } from '@elastic/elasticsearch/lib/Transport';
import { SearchResponse } from 'elasticsearch';
-import { NonEmptyEntriesArray } from '@kbn/securitysolution-io-ts-list-types';
+import type { NonEmptyEntriesArray } from '@kbn/securitysolution-io-ts-list-types';
+import type {
+ CreateExceptionListItemSchema,
+ CreateExceptionListSchema,
+ ExceptionListItemSchema,
+ ExceptionListSchema,
+} from '@kbn/securitysolution-io-ts-list-types';
import { PrePackagedRulesAndTimelinesStatusSchema } from '../../plugins/security_solution/common/detection_engine/schemas/response';
import { getCreateExceptionListDetectionSchemaMock } from '../../plugins/lists/common/schemas/request/create_exception_list_schema.mock';
import {
@@ -22,12 +28,6 @@ import {
QueryCreateSchema,
} from '../../plugins/security_solution/common/detection_engine/schemas/request';
import { EXCEPTION_LIST_ITEM_URL, EXCEPTION_LIST_URL } from '../../plugins/lists/common/constants';
-import {
- CreateExceptionListItemSchema,
- CreateExceptionListSchema,
- ExceptionListItemSchema,
- ExceptionListSchema,
-} from '../../plugins/lists/common';
import { Signal } from '../../plugins/security_solution/server/lib/detection_engine/signals/types';
import { signalsMigrationType } from '../../plugins/security_solution/server/lib/detection_engine/migrations/saved_objects';
import {
diff --git a/x-pack/test/functional/apps/spaces/spaces_selection.ts b/x-pack/test/functional/apps/spaces/spaces_selection.ts
index 99efdf29eecb9..f3d3665bf9f61 100644
--- a/x-pack/test/functional/apps/spaces/spaces_selection.ts
+++ b/x-pack/test/functional/apps/spaces/spaces_selection.ts
@@ -22,7 +22,8 @@ export default function spaceSelectorFunctionalTests({
'spaceSelector',
]);
- describe('Spaces', function () {
+ // FLAKY: https://github.com/elastic/kibana/issues/99581
+ describe.skip('Spaces', function () {
this.tags('includeFirefox');
describe('Space Selector', () => {
before(async () => {
diff --git a/x-pack/test/lists_api_integration/security_and_spaces/tests/create_exception_list_items.ts b/x-pack/test/lists_api_integration/security_and_spaces/tests/create_exception_list_items.ts
index 0d32ea4d1e0ad..b394b0a21e59c 100644
--- a/x-pack/test/lists_api_integration/security_and_spaces/tests/create_exception_list_items.ts
+++ b/x-pack/test/lists_api_integration/security_and_spaces/tests/create_exception_list_items.ts
@@ -7,7 +7,7 @@
import expect from '@kbn/expect';
-import { ExceptionListItemSchema } from '../../../../plugins/lists/common';
+import type { ExceptionListItemSchema } from '@kbn/securitysolution-io-ts-list-types';
import { getExceptionListItemResponseMockWithoutAutoGeneratedValues } from '../../../../plugins/lists/common/schemas/response/exception_list_item_schema.mock';
import { getCreateExceptionListMinimalSchemaMock } from '../../../../plugins/lists/common/schemas/request/create_exception_list_schema.mock';
import {
diff --git a/x-pack/test/lists_api_integration/security_and_spaces/tests/create_exception_lists.ts b/x-pack/test/lists_api_integration/security_and_spaces/tests/create_exception_lists.ts
index 49421f40a3053..840a425b4bf5e 100644
--- a/x-pack/test/lists_api_integration/security_and_spaces/tests/create_exception_lists.ts
+++ b/x-pack/test/lists_api_integration/security_and_spaces/tests/create_exception_lists.ts
@@ -7,7 +7,7 @@
import expect from '@kbn/expect';
-import { ExceptionListSchema } from '../../../../plugins/lists/common';
+import type { ExceptionListSchema } from '@kbn/securitysolution-io-ts-list-types';
import { EXCEPTION_LIST_URL } from '../../../../plugins/lists/common/constants';
import { FtrProviderContext } from '../../common/ftr_provider_context';
import { getExceptionResponseMockWithoutAutoGeneratedValues } from '../../../../plugins/lists/common/schemas/response/exception_list_schema.mock';
diff --git a/x-pack/test/lists_api_integration/security_and_spaces/tests/delete_exception_list_items.ts b/x-pack/test/lists_api_integration/security_and_spaces/tests/delete_exception_list_items.ts
index 36f72e8b8cb51..4cf95daa146d3 100644
--- a/x-pack/test/lists_api_integration/security_and_spaces/tests/delete_exception_list_items.ts
+++ b/x-pack/test/lists_api_integration/security_and_spaces/tests/delete_exception_list_items.ts
@@ -7,7 +7,7 @@
import expect from '@kbn/expect';
-import { ExceptionListItemSchema } from '../../../../plugins/lists/common';
+import type { ExceptionListItemSchema } from '@kbn/securitysolution-io-ts-list-types';
import { getExceptionListItemResponseMockWithoutAutoGeneratedValues } from '../../../../plugins/lists/common/schemas/response/exception_list_item_schema.mock';
import {
getCreateExceptionListItemMinimalSchemaMock,
diff --git a/x-pack/test/lists_api_integration/security_and_spaces/tests/delete_exception_lists.ts b/x-pack/test/lists_api_integration/security_and_spaces/tests/delete_exception_lists.ts
index aa916f00d2f88..4b8b9b84f5dfc 100644
--- a/x-pack/test/lists_api_integration/security_and_spaces/tests/delete_exception_lists.ts
+++ b/x-pack/test/lists_api_integration/security_and_spaces/tests/delete_exception_lists.ts
@@ -7,7 +7,7 @@
import expect from '@kbn/expect';
-import { ExceptionListSchema } from '../../../../plugins/lists/common';
+import type { ExceptionListSchema } from '@kbn/securitysolution-io-ts-list-types';
import { getExceptionResponseMockWithoutAutoGeneratedValues } from '../../../../plugins/lists/common/schemas/response/exception_list_schema.mock';
import {
getCreateExceptionListMinimalSchemaMock,
diff --git a/x-pack/test/lists_api_integration/security_and_spaces/tests/export_list_items.ts b/x-pack/test/lists_api_integration/security_and_spaces/tests/export_list_items.ts
index 67222000d2d7d..563c0c5b3c313 100644
--- a/x-pack/test/lists_api_integration/security_and_spaces/tests/export_list_items.ts
+++ b/x-pack/test/lists_api_integration/security_and_spaces/tests/export_list_items.ts
@@ -6,10 +6,10 @@
*/
import expect from '@kbn/expect';
+import type { CreateListItemSchema } from '@kbn/securitysolution-io-ts-list-types';
import { getCreateMinimalListItemSchemaMock } from '../../../../plugins/lists/common/schemas/request/create_list_item_schema.mock';
import { getCreateMinimalListSchemaMock } from '../../../../plugins/lists/common/schemas/request/create_list_schema.mock';
import { LIST_ID, NAME } from '../../../../plugins/lists/common/constants.mock';
-import { CreateListItemSchema } from '../../../../plugins/lists/common/schemas';
import { FtrProviderContext } from '../../common/ftr_provider_context';
import { LIST_ITEM_URL, LIST_URL } from '../../../../plugins/lists/common/constants';
diff --git a/x-pack/test/lists_api_integration/security_and_spaces/tests/import_list_items.ts b/x-pack/test/lists_api_integration/security_and_spaces/tests/import_list_items.ts
index 3e20941669976..d80b538882bb8 100644
--- a/x-pack/test/lists_api_integration/security_and_spaces/tests/import_list_items.ts
+++ b/x-pack/test/lists_api_integration/security_and_spaces/tests/import_list_items.ts
@@ -6,9 +6,8 @@
*/
import expect from '@kbn/expect';
-import { ListItemSchema } from '../../../../plugins/lists/common/schemas';
+import type { ListSchema, ListItemSchema } from '@kbn/securitysolution-io-ts-list-types';
import { getListItemResponseMockWithoutAutoGeneratedValues } from '../../../../plugins/lists/common/schemas/response/list_item_schema.mock';
-import { ListSchema } from '../../../../plugins/lists/common';
import { getListResponseMockWithoutAutoGeneratedValues } from '../../../../plugins/lists/common/schemas/response/list_schema.mock';
import { FtrProviderContext } from '../../common/ftr_provider_context';
diff --git a/x-pack/test/lists_api_integration/security_and_spaces/tests/read_exception_list_items.ts b/x-pack/test/lists_api_integration/security_and_spaces/tests/read_exception_list_items.ts
index da0473150a3e3..b3af396e27021 100644
--- a/x-pack/test/lists_api_integration/security_and_spaces/tests/read_exception_list_items.ts
+++ b/x-pack/test/lists_api_integration/security_and_spaces/tests/read_exception_list_items.ts
@@ -7,12 +7,12 @@
import expect from '@kbn/expect';
+import type { ExceptionListItemSchema } from '@kbn/securitysolution-io-ts-list-types';
import { getExceptionListItemResponseMockWithoutAutoGeneratedValues } from '../../../../plugins/lists/common/schemas/response/exception_list_item_schema.mock';
import {
getCreateExceptionListItemMinimalSchemaMock,
getCreateExceptionListItemMinimalSchemaMockWithoutId,
} from '../../../../plugins/lists/common/schemas/request/create_exception_list_item_schema.mock';
-import { ExceptionListItemSchema } from '../../../../plugins/lists/common';
import { getCreateExceptionListMinimalSchemaMock } from '../../../../plugins/lists/common/schemas/request/create_exception_list_schema.mock';
import { FtrProviderContext } from '../../common/ftr_provider_context';
import {
diff --git a/x-pack/test/lists_api_integration/security_and_spaces/tests/read_exception_lists.ts b/x-pack/test/lists_api_integration/security_and_spaces/tests/read_exception_lists.ts
index 0e130c87dce6a..a53f3d1d2bded 100644
--- a/x-pack/test/lists_api_integration/security_and_spaces/tests/read_exception_lists.ts
+++ b/x-pack/test/lists_api_integration/security_and_spaces/tests/read_exception_lists.ts
@@ -7,7 +7,7 @@
import expect from '@kbn/expect';
-import { ExceptionListSchema } from '../../../../plugins/lists/common';
+import type { ExceptionListSchema } from '@kbn/securitysolution-io-ts-list-types';
import { getExceptionResponseMockWithoutAutoGeneratedValues } from '../../../../plugins/lists/common/schemas/response/exception_list_schema.mock';
import {
getCreateExceptionListMinimalSchemaMock,
diff --git a/x-pack/test/lists_api_integration/security_and_spaces/tests/update_exception_list_items.ts b/x-pack/test/lists_api_integration/security_and_spaces/tests/update_exception_list_items.ts
index 3af8372f0e71f..d072a96772295 100644
--- a/x-pack/test/lists_api_integration/security_and_spaces/tests/update_exception_list_items.ts
+++ b/x-pack/test/lists_api_integration/security_and_spaces/tests/update_exception_list_items.ts
@@ -7,6 +7,10 @@
import expect from '@kbn/expect';
+import type {
+ UpdateExceptionListItemSchema,
+ ExceptionListItemSchema,
+} from '@kbn/securitysolution-io-ts-list-types';
import { getExceptionListItemResponseMockWithoutAutoGeneratedValues } from '../../../../plugins/lists/common/schemas/response/exception_list_item_schema.mock';
import { getCreateExceptionListItemMinimalSchemaMock } from '../../../../plugins/lists/common/schemas/request/create_exception_list_item_schema.mock';
import { getCreateExceptionListMinimalSchemaMock } from '../../../../plugins/lists/common/schemas/request/create_exception_list_schema.mock';
@@ -17,10 +21,6 @@ import {
} from '../../../../plugins/lists/common/constants';
import { deleteAllExceptions, removeExceptionListServerGeneratedProperties } from '../../utils';
-import {
- UpdateExceptionListItemSchema,
- ExceptionListItemSchema,
-} from '../../../../plugins/lists/common/schemas';
import { getUpdateMinimalExceptionListItemSchemaMock } from '../../../../plugins/lists/common/schemas/request/update_exception_list_item_schema.mock';
diff --git a/x-pack/test/lists_api_integration/security_and_spaces/tests/update_exception_lists.ts b/x-pack/test/lists_api_integration/security_and_spaces/tests/update_exception_lists.ts
index d07e12db1c85b..6f5866e8968ff 100644
--- a/x-pack/test/lists_api_integration/security_and_spaces/tests/update_exception_lists.ts
+++ b/x-pack/test/lists_api_integration/security_and_spaces/tests/update_exception_lists.ts
@@ -7,16 +7,16 @@
import expect from '@kbn/expect';
+import type {
+ UpdateExceptionListSchema,
+ ExceptionListSchema,
+} from '@kbn/securitysolution-io-ts-list-types';
import { getExceptionResponseMockWithoutAutoGeneratedValues } from '../../../../plugins/lists/common/schemas/response/exception_list_schema.mock';
import { getCreateExceptionListMinimalSchemaMock } from '../../../../plugins/lists/common/schemas/request/create_exception_list_schema.mock';
import { FtrProviderContext } from '../../common/ftr_provider_context';
import { EXCEPTION_LIST_URL } from '../../../../plugins/lists/common/constants';
import { deleteAllExceptions, removeExceptionListServerGeneratedProperties } from '../../utils';
-import {
- UpdateExceptionListSchema,
- ExceptionListSchema,
-} from '../../../../plugins/lists/common/schemas';
import { getUpdateMinimalExceptionListSchemaMock } from '../../../../plugins/lists/common/schemas/request/update_exception_list_schema.mock';
diff --git a/x-pack/test/lists_api_integration/security_and_spaces/tests/update_list_items.ts b/x-pack/test/lists_api_integration/security_and_spaces/tests/update_list_items.ts
index 3fa9110d8945d..fdcb7eeacdbad 100644
--- a/x-pack/test/lists_api_integration/security_and_spaces/tests/update_list_items.ts
+++ b/x-pack/test/lists_api_integration/security_and_spaces/tests/update_list_items.ts
@@ -7,6 +7,11 @@
import expect from '@kbn/expect';
+import type {
+ UpdateListItemSchema,
+ CreateListItemSchema,
+ ListItemSchema,
+} from '@kbn/securitysolution-io-ts-list-types';
import { getListItemResponseMockWithoutAutoGeneratedValues } from '../../../../plugins/lists/common/schemas/response/list_item_schema.mock';
import { getCreateMinimalListItemSchemaMock } from '../../../../plugins/lists/common/schemas/request/create_list_item_schema.mock';
import { FtrProviderContext } from '../../common/ftr_provider_context';
@@ -19,11 +24,6 @@ import {
removeListItemServerGeneratedProperties,
} from '../../utils';
import { getUpdateMinimalListItemSchemaMock } from '../../../../plugins/lists/common/schemas/request/update_list_item_schema.mock';
-import {
- UpdateListItemSchema,
- CreateListItemSchema,
- ListItemSchema,
-} from '../../../../plugins/lists/common/schemas';
// eslint-disable-next-line import/no-default-export
export default ({ getService }: FtrProviderContext) => {
diff --git a/x-pack/test/lists_api_integration/security_and_spaces/tests/update_lists.ts b/x-pack/test/lists_api_integration/security_and_spaces/tests/update_lists.ts
index 05a46a06eab39..ad42f6f9e9e6e 100644
--- a/x-pack/test/lists_api_integration/security_and_spaces/tests/update_lists.ts
+++ b/x-pack/test/lists_api_integration/security_and_spaces/tests/update_lists.ts
@@ -7,6 +7,7 @@
import expect from '@kbn/expect';
+import type { UpdateListSchema, ListSchema } from '@kbn/securitysolution-io-ts-list-types';
import { FtrProviderContext } from '../../common/ftr_provider_context';
import { LIST_URL } from '../../../../plugins/lists/common/constants';
@@ -18,7 +19,6 @@ import {
} from '../../utils';
import { getListResponseMockWithoutAutoGeneratedValues } from '../../../../plugins/lists/common/schemas/response/list_schema.mock';
import { getUpdateMinimalListSchemaMock } from '../../../../plugins/lists/common/schemas/request/update_list_schema.mock';
-import { UpdateListSchema, ListSchema } from '../../../../plugins/lists/common/schemas';
// eslint-disable-next-line import/no-default-export
export default ({ getService }: FtrProviderContext) => {
diff --git a/x-pack/test/lists_api_integration/utils.ts b/x-pack/test/lists_api_integration/utils.ts
index 29846a79d6b02..81a4298ea1d0c 100644
--- a/x-pack/test/lists_api_integration/utils.ts
+++ b/x-pack/test/lists_api_integration/utils.ts
@@ -9,14 +9,14 @@ import { SuperTest } from 'supertest';
import supertestAsPromised from 'supertest-as-promised';
import type { KibanaClient } from '@elastic/elasticsearch/api/kibana';
-import { Type } from '@kbn/securitysolution-io-ts-list-types';
-import { getImportListItemAsBuffer } from '../../plugins/lists/common/schemas/request/import_list_item_schema.mock';
-import {
+import type {
+ Type,
+ ListSchema,
ListItemSchema,
ExceptionListSchema,
ExceptionListItemSchema,
-} from '../../plugins/lists/common/schemas';
-import { ListSchema } from '../../plugins/lists/common';
+} from '@kbn/securitysolution-io-ts-list-types';
+import { getImportListItemAsBuffer } from '../../plugins/lists/common/schemas/request/import_list_item_schema.mock';
import { LIST_INDEX, LIST_ITEM_URL } from '../../plugins/lists/common/constants';
import { countDownES, countDownTest } from '../detection_engine_api_integration/utils';
diff --git a/x-pack/test/security_solution_endpoint/apps/endpoint/policy_details.ts b/x-pack/test/security_solution_endpoint/apps/endpoint/policy_details.ts
index fc814d7d2b060..d8bc9f6444f64 100644
--- a/x-pack/test/security_solution_endpoint/apps/endpoint/policy_details.ts
+++ b/x-pack/test/security_solution_endpoint/apps/endpoint/policy_details.ts
@@ -261,6 +261,13 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) {
events: { file: false, network: true, process: true },
logging: { file: 'info' },
advanced: { agent: { connection_delay: 'true' } },
+ malware: { mode: 'prevent' },
+ popup: {
+ malware: {
+ enabled: true,
+ message: 'Elastic Security {action} {filename}',
+ },
+ },
},
mac: {
events: { file: false, network: true, process: true },
@@ -285,7 +292,7 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) {
},
logging: { file: 'info' },
malware: { mode: 'prevent' },
- ransomware: { mode: 'prevent' },
+ ransomware: { mode: 'prevent', supported: true },
popup: {
malware: {
enabled: true,
@@ -422,6 +429,13 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) {
events: { file: true, network: true, process: true },
logging: { file: 'info' },
advanced: { agent: { connection_delay: 'true' } },
+ malware: { mode: 'prevent' },
+ popup: {
+ malware: {
+ enabled: true,
+ message: 'Elastic Security {action} {filename}',
+ },
+ },
},
mac: {
events: { file: true, network: true, process: true },
@@ -446,7 +460,7 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) {
},
logging: { file: 'info' },
malware: { mode: 'prevent' },
- ransomware: { mode: 'prevent' },
+ ransomware: { mode: 'prevent', supported: true },
popup: {
malware: {
enabled: true,
@@ -580,6 +594,13 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) {
linux: {
events: { file: true, network: true, process: true },
logging: { file: 'info' },
+ malware: { mode: 'prevent' },
+ popup: {
+ malware: {
+ enabled: true,
+ message: 'Elastic Security {action} {filename}',
+ },
+ },
},
mac: {
events: { file: true, network: true, process: true },
@@ -604,7 +625,7 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) {
},
logging: { file: 'info' },
malware: { mode: 'prevent' },
- ransomware: { mode: 'prevent' },
+ ransomware: { mode: 'prevent', supported: true },
popup: {
malware: {
enabled: true,
@@ -627,7 +648,8 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) {
});
});
- describe('when on Ingest Policy Edit Package Policy page', async () => {
+ // FLAKY: https://github.com/elastic/kibana/issues/100296
+ describe.skip('when on Ingest Policy Edit Package Policy page', async () => {
let policyInfo: PolicyTestResourceInfo;
beforeEach(async () => {
// Create a policy and navigate to Ingest app
diff --git a/x-pack/test/upgrade/apps/canvas/canvas_smoke_tests.ts b/x-pack/test/upgrade/apps/canvas/canvas_smoke_tests.ts
index c7db9127e01bd..2f38e828fa64d 100644
--- a/x-pack/test/upgrade/apps/canvas/canvas_smoke_tests.ts
+++ b/x-pack/test/upgrade/apps/canvas/canvas_smoke_tests.ts
@@ -11,6 +11,7 @@ import { FtrProviderContext } from '../../ftr_provider_context';
export default function ({ getPageObjects, getService }: FtrProviderContext) {
const retry = getService('retry');
const PageObjects = getPageObjects(['common', 'header']);
+ const browser = getService('browser');
const testSubjects = getService('testSubjects');
describe('canvas smoke tests', function describeIndexTests() {
@@ -23,29 +24,44 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) {
{
name: 'flights',
id: 'workpad-a474e74b-aedc-47c3-894a-db77e62c41e0/page/1',
+ altId: '',
numElements: 35,
},
- { name: 'logs', id: 'workpad-5563cc40-5760-4afe-bf33-9da72fac53b7/page/1', numElements: 57 },
+ {
+ name: 'logs',
+ id: 'workpad-5563cc40-5760-4afe-bf33-9da72fac53b7/page/1',
+ altId: 'workpad-ad72a4e9-b422-480c-be6d-a64a0b79541d',
+ numElements: 57,
+ },
{
name: 'ecommerce',
id: 'workpad-e08b9bdb-ec14-4339-94c4-063bddfd610e/page/1',
+ altId: '',
numElements: 16,
},
{
name: 'ecommerce',
id: 'workpad-e08b9bdb-ec14-4339-94c4-063bddfd610e/page/2',
+ altId: '',
numElements: 9,
},
];
spaces.forEach(({ space, basePath }) => {
- canvasTests.forEach(({ name, id, numElements }) => {
+ canvasTests.forEach(({ name, id, altId, numElements }) => {
describe('space ' + space + ' name ' + name, () => {
beforeEach(async () => {
await PageObjects.common.navigateToActualUrl('canvas', 'workpad/' + id, {
basePath,
});
await PageObjects.header.waitUntilLoadingHasFinished();
+ const url = await browser.getCurrentUrl();
+ if (!url.includes(id) && altId.length > 0) {
+ await PageObjects.common.navigateToActualUrl('canvas', 'workpad/' + altId, {
+ basePath,
+ });
+ }
+ await PageObjects.header.waitUntilLoadingHasFinished();
});
it('renders elements on workpad', async () => {
await retry.try(async () => {
diff --git a/x-pack/test/upgrade/apps/dashboard/dashboard_smoke_tests.ts b/x-pack/test/upgrade/apps/dashboard/dashboard_smoke_tests.ts
index 9efc9224b2438..73819b5bac695 100644
--- a/x-pack/test/upgrade/apps/dashboard/dashboard_smoke_tests.ts
+++ b/x-pack/test/upgrade/apps/dashboard/dashboard_smoke_tests.ts
@@ -24,9 +24,9 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) {
];
const dashboardTests = [
- { name: 'flights', numPanels: 19 },
- { name: 'logs', numPanels: 11 },
- { name: 'ecommerce', numPanels: 12 },
+ { name: 'flights', numPanels: 17 },
+ { name: 'logs', numPanels: 10 },
+ { name: 'ecommerce', numPanels: 11 },
];
spaces.forEach(({ space, basePath }) => {
@@ -47,7 +47,7 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) {
const toTime = `${todayYearMonthDay} @ 23:59:59.999`;
await PageObjects.timePicker.setAbsoluteRange(fromTime, toTime);
const panelCount = await PageObjects.dashboard.getPanelCount();
- expect(panelCount).to.be(numPanels);
+ expect(panelCount).to.be.above(numPanels);
});
});
it('should render visualizations', async () => {
@@ -60,7 +60,7 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) {
// log.debug('Checking area, bar and heatmap charts rendered');
// await dashboardExpect.seriesElementCount(15);
log.debug('Checking saved searches rendered');
- await dashboardExpect.savedSearchRowCount(50);
+ await dashboardExpect.savedSearchRowCount(49);
log.debug('Checking input controls rendered');
await dashboardExpect.inputControlItemCount(3);
log.debug('Checking tag cloud rendered');
diff --git a/x-pack/test/upgrade/apps/maps/maps_smoke_tests.ts b/x-pack/test/upgrade/apps/maps/maps_smoke_tests.ts
index 7ec83aad26641..17b457151bd9e 100644
--- a/x-pack/test/upgrade/apps/maps/maps_smoke_tests.ts
+++ b/x-pack/test/upgrade/apps/maps/maps_smoke_tests.ts
@@ -117,7 +117,7 @@ export default function ({
'ecommerce_map',
updateBaselines
);
- expect(percentDifference).to.be.lessThan(0.02);
+ expect(percentDifference.toFixed(3)).to.be.lessThan(0.031);
});
});
@@ -141,7 +141,7 @@ export default function ({
'flights_map',
updateBaselines
);
- expect(percentDifference).to.be.lessThan(0.02);
+ expect(percentDifference.toFixed(3)).to.be.lessThan(0.031);
});
});
@@ -166,7 +166,7 @@ export default function ({
'web_logs_map',
updateBaselines
);
- expect(percentDifference).to.be.lessThan(0.02);
+ expect(percentDifference.toFixed(3)).to.be.lessThan(0.031);
});
});
});
diff --git a/yarn.lock b/yarn.lock
index 53a311857e643..19922d11802d6 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -1766,10 +1766,10 @@
normalize-path "^2.0.1"
through2 "^2.0.3"
-"@hapi/accept@^5.0.1":
- version "5.0.1"
- resolved "https://registry.yarnpkg.com/@hapi/accept/-/accept-5.0.1.tgz#068553e867f0f63225a506ed74e899441af53e10"
- integrity sha512-fMr4d7zLzsAXo28PRRQPXR1o2Wmu+6z+VY1UzDp0iFo13Twj8WePakwXBiqn3E1aAlTpSNzCXdnnQXFhst8h8Q==
+"@hapi/accept@^5.0.1", "@hapi/accept@^5.0.2":
+ version "5.0.2"
+ resolved "https://registry.yarnpkg.com/@hapi/accept/-/accept-5.0.2.tgz#ab7043b037e68b722f93f376afb05e85c0699523"
+ integrity sha512-CmzBx/bXUR8451fnZRuZAJRlzgm0Jgu5dltTX/bszmR2lheb9BpyN47Q1RbaGTsvFzn0PXAEs+lXDKfshccYZw==
dependencies:
"@hapi/boom" "9.x.x"
"@hapi/hoek" "9.x.x"
@@ -2707,6 +2707,9 @@
uid ""
"@kbn/securitysolution-es-utils@link:bazel-bin/packages/kbn-securitysolution-es-utils/npm_module":
+ version "0.0.0"
+ uid ""
+
"@kbn/securitysolution-io-ts-alerting-types@link:bazel-bin/packages/kbn-securitysolution-io-ts-alerting-types/npm_module":
version "0.0.0"
uid ""
@@ -2723,6 +2726,10 @@
version "0.0.0"
uid ""
+"@kbn/securitysolution-list-utils@link:bazel-bin/packages/kbn-securitysolution-list-utils/npm_module":
+ version "0.0.0"
+ uid ""
+
"@kbn/securitysolution-utils@link:bazel-bin/packages/kbn-securitysolution-utils/npm_module":
version "0.0.0"
uid ""
@@ -4601,11 +4608,6 @@
dependencies:
"@turf/helpers" "6.x"
-"@types/accept@3.1.1":
- version "3.1.1"
- resolved "https://registry.yarnpkg.com/@types/accept/-/accept-3.1.1.tgz#74457f6afabd23181e32b6bafae238bda0ce0da7"
- integrity sha512-pXwi0bKUriKuNUv7d1xwbxKTqyTIzmMr1StxcGARmiuTLQyjNo+YwDq0w8dzY8wQjPofdgs1hvQLTuJaGuSKiQ==
-
"@types/angular-mocks@^1.7.0":
version "1.7.0"
resolved "https://registry.yarnpkg.com/@types/angular-mocks/-/angular-mocks-1.7.0.tgz#310d999a3c47c10ecd8eef466b5861df84799429"
@@ -5405,10 +5407,10 @@
resolved "https://registry.yarnpkg.com/@types/minimatch/-/minimatch-2.0.29.tgz#5002e14f75e2d71e564281df0431c8c1b4a2a36a"
integrity sha1-UALhT3Xi1x5WQoHfBDHIwbSio2o=
-"@types/minimist@^1.2.0":
- version "1.2.0"
- resolved "https://registry.yarnpkg.com/@types/minimist/-/minimist-1.2.0.tgz#69a23a3ad29caf0097f06eda59b361ee2f0639f6"
- integrity sha1-aaI6OtKcrwCX8G7aWbNh7i8GOfY=
+"@types/minimist@^1.2.0", "@types/minimist@^1.2.1":
+ version "1.2.1"
+ resolved "https://registry.yarnpkg.com/@types/minimist/-/minimist-1.2.1.tgz#283f669ff76d7b8260df8ab7a4262cc83d988256"
+ integrity sha512-fZQQafSREFyuZcdWFAExYjBiCL7AUCdgsk80iO0q4yihYYdcIiH28CcuPTGFgLOCC8RlW49GSQxdHwZP+I7CNg==
"@types/minipass@*":
version "2.2.0"
@@ -5477,10 +5479,10 @@
dependencies:
"@types/node" "*"
-"@types/node@*", "@types/node@12.12.50", "@types/node@14.14.14", "@types/node@8.10.54", "@types/node@>= 8", "@types/node@>=8.9.0", "@types/node@^10.1.0":
- version "14.14.14"
- resolved "https://registry.yarnpkg.com/@types/node/-/node-14.14.14.tgz#f7fd5f3cc8521301119f63910f0fb965c7d761ae"
- integrity sha512-UHnOPWVWV1z+VV8k6L1HhG7UbGBgIdghqF3l9Ny9ApPghbjICXkUJSd/b9gOgQfjM1r+37cipdw/HJ3F6ICEnQ==
+"@types/node@*", "@types/node@12.12.50", "@types/node@14.14.44", "@types/node@8.10.54", "@types/node@>= 8", "@types/node@>=8.9.0", "@types/node@^10.1.0":
+ version "14.14.44"
+ resolved "https://registry.yarnpkg.com/@types/node/-/node-14.14.44.tgz#df7503e6002847b834371c004b372529f3f85215"
+ integrity sha512-+gaugz6Oce6ZInfI/tK4Pq5wIIkJMEJUu92RB3Eu93mtj4wjjjz9EB5mLp5s1pSsLXdC/CPut/xF20ZzAQJbTA==
"@types/nodemailer@^6.4.0":
version "6.4.0"
@@ -6481,14 +6483,6 @@ abortcontroller-polyfill@^1.4.0:
resolved "https://registry.yarnpkg.com/abortcontroller-polyfill/-/abortcontroller-polyfill-1.4.0.tgz#0d5eb58e522a461774af8086414f68e1dda7a6c4"
integrity sha512-3ZFfCRfDzx3GFjO6RAkYx81lPGpUS20ISxux9gLxuKnqafNcFQo59+IoZqpO2WvQlyc287B62HDnDdNYRmlvWA==
-accept@3.0.2:
- version "3.0.2"
- resolved "https://registry.yarnpkg.com/accept/-/accept-3.0.2.tgz#83e41cec7e1149f3fd474880423873db6c6cc9ac"
- integrity sha512-bghLXFkCOsC1Y2TZ51etWfKDs6q249SAoHTZVfzWWdlZxoij+mgkj9AmUJWQpDY48TfnrTDIe43Xem4zdMe7mQ==
- dependencies:
- boom "7.x.x"
- hoek "5.x.x"
-
accepts@~1.3.4, accepts@~1.3.5, accepts@~1.3.7:
version "1.3.7"
resolved "https://registry.yarnpkg.com/accepts/-/accepts-1.3.7.tgz#531bc726517a3b2b41f850021c6cc15eaab507cd"
@@ -8280,13 +8274,6 @@ boolbase@^1.0.0, boolbase@~1.0.0:
resolved "https://registry.yarnpkg.com/boolbase/-/boolbase-1.0.0.tgz#68dff5fbe60c51eb37725ea9e3ed310dcc1e776e"
integrity sha1-aN/1++YMUes3cl6p4+0xDcwed24=
-boom@7.x.x:
- version "7.2.2"
- resolved "https://registry.yarnpkg.com/boom/-/boom-7.2.2.tgz#ac92101451aa5cea901aed07d881dd32b4f08345"
- integrity sha512-IFUbOa8PS7xqmhIjpeStwT3d09hGkNYQ6aj2iELSTxcVs2u0aKn1NzhkdUQSzsRg1FVkj3uit3I6mXQCBixw+A==
- dependencies:
- hoek "6.x.x"
-
bottleneck@^2.15.3:
version "2.18.0"
resolved "https://registry.yarnpkg.com/bottleneck/-/bottleneck-2.18.0.tgz#41fa63ae185b65435d789d1700334bc48222dacf"
@@ -10365,10 +10352,10 @@ crypto-browserify@^3.0.0, crypto-browserify@^3.11.0:
randombytes "^2.0.0"
randomfill "^1.0.3"
-crypto-js@^3.1.9-1:
- version "3.3.0"
- resolved "https://registry.yarnpkg.com/crypto-js/-/crypto-js-3.3.0.tgz#846dd1cce2f68aacfa156c8578f926a609b7976b"
- integrity sha512-DIT51nX0dCfKltpRiXV+/TVZq+Qq2NgF4644+K7Ttnla7zEzqc+kjJyiB96BHNyUTBxyjzRcZYpUdZa+QAqi6Q==
+crypto-js@4.0.0, crypto-js@^3.1.9-1:
+ version "4.0.0"
+ resolved "https://registry.yarnpkg.com/crypto-js/-/crypto-js-4.0.0.tgz#2904ab2677a9d042856a2ea2ef80de92e4a36dcc"
+ integrity sha512-bzHZN8Pn+gS7DQA6n+iUmBfl0hO5DJq++QP3U6uTucDtk/0iGpXd/Gg7CGR0p8tJhofJyaKoWBuJI4eAO00BBg==
crypto-random-string@^1.0.0:
version "1.0.0"
@@ -15349,11 +15336,6 @@ hoek@5.x.x:
resolved "https://registry.yarnpkg.com/hoek/-/hoek-5.0.4.tgz#0f7fa270a1cafeb364a4b2ddfaa33f864e4157da"
integrity sha512-Alr4ZQgoMlnere5FZJsIyfIjORBqZll5POhDsF4q64dPuJR6rNxXdDxtHSQq8OXRurhmx+PWYEE8bXRROY8h0w==
-hoek@6.x.x:
- version "6.0.3"
- resolved "https://registry.yarnpkg.com/hoek/-/hoek-6.0.3.tgz#7884360426d927865a0a1251fc9c59313af5b798"
- integrity sha512-TU6RyZ/XaQCTWRLrdqZZtZqwxUVr6PDMfi6MlWNURZ7A6czanQqX4pFE1mdOUQR9FdPCsZ0UzL8jI/izZ+eBSQ==
-
hoist-non-react-statics@^2.3.1, hoist-non-react-statics@^2.5.5, hoist-non-react-statics@^3.0.0, hoist-non-react-statics@^3.1.0, hoist-non-react-statics@^3.3.0, hoist-non-react-statics@^3.3.2:
version "3.3.2"
resolved "https://registry.yarnpkg.com/hoist-non-react-statics/-/hoist-non-react-statics-3.3.2.tgz#ece0acaf71d62c2969c2ec59feff42a4b1a85b45"
@@ -17877,10 +17859,10 @@ kdbush@^3.0.0:
resolved "https://registry.yarnpkg.com/kdbush/-/kdbush-3.0.0.tgz#f8484794d47004cc2d85ed3a79353dbe0abc2bf0"
integrity sha512-hRkd6/XW4HTsA9vjVpY9tuXJYLSlelnkTmVFu4M9/7MIYQtFcHpbugAU7UbOfjOiVSVYl2fqgBuJ32JUmRo5Ew==
-kea@^2.3.0:
- version "2.3.3"
- resolved "https://registry.yarnpkg.com/kea/-/kea-2.3.3.tgz#8fbd6d0c4ba5079c5abe46486bbc7dc1fd071a62"
- integrity sha512-NZQHisfEvlg+e6BsHckW03IYaIBY+fuK4xiov7ShZ0GudUmNLhqgHSxUsykU/wdrCPEI6ANX1gyDIRTnUd3HyA==
+kea@^2.4.2:
+ version "2.4.2"
+ resolved "https://registry.yarnpkg.com/kea/-/kea-2.4.2.tgz#53af42702f2c8962422e456e5dd943391bad26e9"
+ integrity sha512-cdGds/gsJsbo/KbVAMk5/tTr229eDibVT1wmPPxPO/10zYb8GFoP3udBIQb+Hop5qGEu2wIHVdXwJvXqSS8JAg==
keyv@^3.0.0:
version "3.0.0"
@@ -22772,16 +22754,6 @@ react-color@^2.13.8, react-color@^2.17.0:
reactcss "^1.2.0"
tinycolor2 "^1.4.1"
-react-datetime@^2.14.0:
- version "2.15.0"
- resolved "https://registry.yarnpkg.com/react-datetime/-/react-datetime-2.15.0.tgz#a8f7da6c58b6b45dbeea32d4e8485db17614e12c"
- integrity sha512-RP5OqXVfrhdoFALJzMU8tKxRFaIZzJZqZEpf5oK7pvwG80a/bET/TdJ7jT7W9lyAf1nKNo6zyYkvHW3ZJ/ypvg==
- dependencies:
- create-react-class "^15.5.2"
- object-assign "^3.0.0"
- prop-types "^15.5.7"
- react-onclickoutside "^6.5.0"
-
react-dev-utils@^11.0.3:
version "11.0.4"
resolved "https://registry.yarnpkg.com/react-dev-utils/-/react-dev-utils-11.0.4.tgz#a7ccb60257a1ca2e0efe7a83e38e6700d17aa37a"
@@ -23067,11 +23039,6 @@ react-motion@^0.4.8:
prop-types "^15.5.8"
raf "^3.1.0"
-react-onclickoutside@^6.5.0:
- version "6.7.1"
- resolved "https://registry.yarnpkg.com/react-onclickoutside/-/react-onclickoutside-6.7.1.tgz#6a5b5b8b4eae6b776259712c89c8a2b36b17be93"
- integrity sha512-p84kBqGaMoa7VYT0vZ/aOYRfJB+gw34yjpda1Z5KeLflg70HipZOT+MXQenEhdkPAABuE2Astq4zEPdMqUQxcg==
-
react-popper-tooltip@^2.10.1:
version "2.11.1"
resolved "https://registry.yarnpkg.com/react-popper-tooltip/-/react-popper-tooltip-2.11.1.tgz#3c4bdfd8bc10d1c2b9a162e859bab8958f5b2644"
@@ -27155,10 +27122,10 @@ trim-trailing-lines@^1.0.0:
resolved "https://registry.yarnpkg.com/trim-trailing-lines/-/trim-trailing-lines-1.1.0.tgz#7aefbb7808df9d669f6da2e438cac8c46ada7684"
integrity sha1-eu+7eAjfnWafbaLkOMrIxGradoQ=
-trim@0.0.1, trim@0.0.3:
- version "0.0.3"
- resolved "https://registry.yarnpkg.com/trim/-/trim-0.0.3.tgz#05243a47a3a4113e6b49367880a9cca59697a20b"
- integrity sha512-h82ywcYhHK7veeelXrCScdH7HkWfbIT1D/CgYO+nmDarz3SGNssVBMws6jU16Ga60AJCRAvPV6w6RLuNerQqjg==
+trim@0.0.1, trim@1.0.1:
+ version "1.0.1"
+ resolved "https://registry.yarnpkg.com/trim/-/trim-1.0.1.tgz#68e78f6178ccab9687a610752f4f5e5a7022ee8c"
+ integrity sha512-3JVP2YVqITUisXblCDq/Bi4P9457G/sdEamInkyvCsjbTcXLXIiG7XCb4kGMFWh6JGXesS3TKxOPtrncN/xe8w==
triple-beam@^1.2.0, triple-beam@^1.3.0:
version "1.3.0"