{
toggleCustomLinkFlyout();
diff --git a/x-pack/legacy/plugins/canvas/public/apps/export/export/export_app.js b/x-pack/legacy/plugins/canvas/public/apps/export/export/export_app.js
index 9b198cee34aae..7537f8eaa9039 100644
--- a/x-pack/legacy/plugins/canvas/public/apps/export/export/export_app.js
+++ b/x-pack/legacy/plugins/canvas/public/apps/export/export/export_app.js
@@ -28,6 +28,7 @@ export class ExportApp extends React.PureComponent {
const { workpad, selectedPageId } = this.props;
const { pages, height, width } = workpad;
const activePage = pages.find(page => page.id === selectedPageId);
+ const pageElementCount = activePage.elements.length;
return (
@@ -39,7 +40,7 @@ export class ExportApp extends React.PureComponent {
{Style.it(
workpad.css,
-
+
(this.sharedItemRef = ref)}
>
diff --git a/x-pack/plugins/apm/server/lib/settings/custom_link/custom_link_types.d.ts b/x-pack/legacy/plugins/maps/common/descriptor_types.ts
similarity index 52%
rename from x-pack/plugins/apm/server/lib/settings/custom_link/custom_link_types.d.ts
rename to x-pack/legacy/plugins/maps/common/descriptor_types.ts
index edb9eb35b9029..1f0eda26e7f7d 100644
--- a/x-pack/plugins/apm/server/lib/settings/custom_link/custom_link_types.d.ts
+++ b/x-pack/legacy/plugins/maps/common/descriptor_types.ts
@@ -3,12 +3,6 @@
* or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with the Elastic License.
*/
-import * as t from 'io-ts';
-import { FilterOptions } from '../../../../common/custom_link_filter_options';
-export type CustomLink = {
- id?: string;
- '@timestamp': number;
- label: string;
- url: string;
-} & FilterOptions;
+// eslint-disable-next-line @kbn/eslint/no-restricted-paths
+export * from '../../../../plugins/maps/common/descriptor_types';
diff --git a/x-pack/legacy/plugins/maps/public/actions/map_actions.d.ts b/x-pack/legacy/plugins/maps/public/actions/map_actions.d.ts
index 3a61d5affd861..48ab957089361 100644
--- a/x-pack/legacy/plugins/maps/public/actions/map_actions.d.ts
+++ b/x-pack/legacy/plugins/maps/public/actions/map_actions.d.ts
@@ -6,7 +6,7 @@
/* eslint-disable @typescript-eslint/consistent-type-definitions */
import { LAYER_TYPE } from '../../common/constants';
-import { DataMeta, MapFilters } from '../../common/data_request_descriptor_types';
+import { DataMeta, MapFilters } from '../../common/descriptor_types';
export type SyncContext = {
startLoading(dataId: string, requestToken: symbol, meta: DataMeta): void;
diff --git a/x-pack/legacy/plugins/maps/public/layers/blended_vector_layer.ts b/x-pack/legacy/plugins/maps/public/layers/blended_vector_layer.ts
index 8c54720987e41..f5526ad703dd2 100644
--- a/x-pack/legacy/plugins/maps/public/layers/blended_vector_layer.ts
+++ b/x-pack/legacy/plugins/maps/public/layers/blended_vector_layer.ts
@@ -34,7 +34,7 @@ import {
VectorStyleDescriptor,
SizeDynamicOptions,
DynamicStylePropertyOptions,
-} from '../../common/style_property_descriptor_types';
+} from '../../common/descriptor_types';
const ACTIVE_COUNT_DATA_ID = 'ACTIVE_COUNT_DATA_ID';
diff --git a/x-pack/legacy/plugins/maps/public/layers/sources/es_source.d.ts b/x-pack/legacy/plugins/maps/public/layers/sources/es_source.d.ts
index b565cb9108aea..ffd1d343b59e0 100644
--- a/x-pack/legacy/plugins/maps/public/layers/sources/es_source.d.ts
+++ b/x-pack/legacy/plugins/maps/public/layers/sources/es_source.d.ts
@@ -7,7 +7,7 @@
import { AbstractVectorSource } from './vector_source';
import { IVectorSource } from './vector_source';
import { IndexPattern, SearchSource } from '../../../../../../../src/plugins/data/public';
-import { VectorSourceRequestMeta } from '../../../common/data_request_descriptor_types';
+import { VectorSourceRequestMeta } from '../../../common/descriptor_types';
export interface IESSource extends IVectorSource {
getId(): string;
diff --git a/x-pack/legacy/plugins/maps/public/layers/sources/vector_source.d.ts b/x-pack/legacy/plugins/maps/public/layers/sources/vector_source.d.ts
index fd585e100924e..7a747da244233 100644
--- a/x-pack/legacy/plugins/maps/public/layers/sources/vector_source.d.ts
+++ b/x-pack/legacy/plugins/maps/public/layers/sources/vector_source.d.ts
@@ -8,7 +8,7 @@
import { FeatureCollection } from 'geojson';
import { AbstractSource, ISource } from './source';
import { IField } from '../fields/field';
-import { ESSearchSourceResponseMeta } from '../../../common/data_request_descriptor_types';
+import { ESSearchSourceResponseMeta } from '../../../common/descriptor_types';
export type GeoJsonFetchMeta = ESSearchSourceResponseMeta;
diff --git a/x-pack/legacy/plugins/maps/public/layers/styles/vector/components/field_meta/categorical_field_meta_popover.tsx b/x-pack/legacy/plugins/maps/public/layers/styles/vector/components/field_meta/categorical_field_meta_popover.tsx
index 9aec7ece45f36..550b3737963d5 100644
--- a/x-pack/legacy/plugins/maps/public/layers/styles/vector/components/field_meta/categorical_field_meta_popover.tsx
+++ b/x-pack/legacy/plugins/maps/public/layers/styles/vector/components/field_meta/categorical_field_meta_popover.tsx
@@ -11,7 +11,7 @@ import { EuiFormRow, EuiSwitch, EuiSwitchEvent } from '@elastic/eui';
import { i18n } from '@kbn/i18n';
import { FieldMetaPopover } from './field_meta_popover';
import { IDynamicStyleProperty } from '../../properties/dynamic_style_property';
-import { FieldMetaOptions } from '../../../../../../common/style_property_descriptor_types';
+import { FieldMetaOptions } from '../../../../../../common/descriptor_types';
type Props = {
styleProperty: IDynamicStyleProperty;
diff --git a/x-pack/legacy/plugins/maps/public/layers/styles/vector/components/field_meta/ordinal_field_meta_popover.tsx b/x-pack/legacy/plugins/maps/public/layers/styles/vector/components/field_meta/ordinal_field_meta_popover.tsx
index 777f60b5075af..32a54a45ed4d7 100644
--- a/x-pack/legacy/plugins/maps/public/layers/styles/vector/components/field_meta/ordinal_field_meta_popover.tsx
+++ b/x-pack/legacy/plugins/maps/public/layers/styles/vector/components/field_meta/ordinal_field_meta_popover.tsx
@@ -12,7 +12,7 @@ import { i18n } from '@kbn/i18n';
import { DEFAULT_SIGMA } from '../../vector_style_defaults';
import { FieldMetaPopover } from './field_meta_popover';
import { IDynamicStyleProperty } from '../../properties/dynamic_style_property';
-import { FieldMetaOptions } from '../../../../../../common/style_property_descriptor_types';
+import { FieldMetaOptions } from '../../../../../../common/descriptor_types';
import { VECTOR_STYLES } from '../../../../../../common/constants';
function getIsEnableToggleLabel(styleName: string) {
diff --git a/x-pack/legacy/plugins/maps/public/layers/styles/vector/properties/dynamic_style_property.d.ts b/x-pack/legacy/plugins/maps/public/layers/styles/vector/properties/dynamic_style_property.d.ts
index a83dd55c0c175..88eb489c4996e 100644
--- a/x-pack/legacy/plugins/maps/public/layers/styles/vector/properties/dynamic_style_property.d.ts
+++ b/x-pack/legacy/plugins/maps/public/layers/styles/vector/properties/dynamic_style_property.d.ts
@@ -8,11 +8,12 @@
import { IStyleProperty } from './style_property';
import { FIELD_ORIGIN } from '../../../../../common/constants';
import {
- FieldMetaOptions,
+ CategoryFieldMeta,
DynamicStylePropertyOptions,
-} from '../../../../../common/style_property_descriptor_types';
+ FieldMetaOptions,
+ RangeFieldMeta,
+} from '../../../../../common/descriptor_types';
import { IField } from '../../../fields/field';
-import { CategoryFieldMeta, RangeFieldMeta } from '../../../../../common/descriptor_types';
export interface IDynamicStyleProperty extends IStyleProperty {
getOptions(): DynamicStylePropertyOptions;
diff --git a/x-pack/legacy/plugins/maps/public/layers/styles/vector/properties/style_property.ts b/x-pack/legacy/plugins/maps/public/layers/styles/vector/properties/style_property.ts
index fef7778c5f08e..af04a95e3c3bd 100644
--- a/x-pack/legacy/plugins/maps/public/layers/styles/vector/properties/style_property.ts
+++ b/x-pack/legacy/plugins/maps/public/layers/styles/vector/properties/style_property.ts
@@ -8,10 +8,7 @@
import { ReactElement } from 'react';
// @ts-ignore
import { getVectorStyleLabel } from '../components/get_vector_style_label';
-import {
- FieldMetaOptions,
- StylePropertyOptions,
-} from '../../../../../common/style_property_descriptor_types';
+import { FieldMetaOptions, StylePropertyOptions } from '../../../../../common/descriptor_types';
import { VECTOR_STYLES } from '../../../../../common/constants';
type LegendProps = {
diff --git a/x-pack/legacy/plugins/maps/public/layers/styles/vector/vector_style.d.ts b/x-pack/legacy/plugins/maps/public/layers/styles/vector/vector_style.d.ts
index 37aea501f5193..77ea44ac26bf9 100644
--- a/x-pack/legacy/plugins/maps/public/layers/styles/vector/vector_style.d.ts
+++ b/x-pack/legacy/plugins/maps/public/layers/styles/vector/vector_style.d.ts
@@ -7,7 +7,7 @@ import { IStyleProperty } from './properties/style_property';
import { IDynamicStyleProperty } from './properties/dynamic_style_property';
import { IVectorLayer } from '../../vector_layer';
import { IVectorSource } from '../../sources/vector_source';
-import { VectorStyleDescriptor } from '../../../../common/style_property_descriptor_types';
+import { VectorStyleDescriptor } from '../../../../common/descriptor_types';
export interface IVectorStyle {
getAllStyleProperties(): IStyleProperty[];
diff --git a/x-pack/legacy/plugins/maps/public/layers/styles/vector/vector_style_defaults.ts b/x-pack/legacy/plugins/maps/public/layers/styles/vector/vector_style_defaults.ts
index f104afd2a7857..86602381cf615 100644
--- a/x-pack/legacy/plugins/maps/public/layers/styles/vector/vector_style_defaults.ts
+++ b/x-pack/legacy/plugins/maps/public/layers/styles/vector/vector_style_defaults.ts
@@ -18,7 +18,7 @@ import {
DEFAULT_LINE_COLORS,
// @ts-ignore
} from '../color_utils';
-import { VectorStylePropertiesDescriptor } from '../../../../common/style_property_descriptor_types';
+import { VectorStylePropertiesDescriptor } from '../../../../common/descriptor_types';
// @ts-ignore
import { getUiSettings } from '../../../kibana_services';
diff --git a/x-pack/legacy/plugins/maps/public/layers/util/can_skip_fetch.ts b/x-pack/legacy/plugins/maps/public/layers/util/can_skip_fetch.ts
index 7b75bb0f21b79..758cc35f41fbb 100644
--- a/x-pack/legacy/plugins/maps/public/layers/util/can_skip_fetch.ts
+++ b/x-pack/legacy/plugins/maps/public/layers/util/can_skip_fetch.ts
@@ -9,7 +9,7 @@ import turf from 'turf';
import turfBooleanContains from '@turf/boolean-contains';
import { isRefreshOnlyQuery } from './is_refresh_only_query';
import { ISource } from '../sources/source';
-import { DataMeta } from '../../../common/data_request_descriptor_types';
+import { DataMeta } from '../../../common/descriptor_types';
import { DataRequest } from './data_request';
const SOURCE_UPDATE_REQUIRED = true;
diff --git a/x-pack/legacy/plugins/maps/public/layers/util/data_request.ts b/x-pack/legacy/plugins/maps/public/layers/util/data_request.ts
index e361574194628..eeef5c49c6ef8 100644
--- a/x-pack/legacy/plugins/maps/public/layers/util/data_request.ts
+++ b/x-pack/legacy/plugins/maps/public/layers/util/data_request.ts
@@ -6,7 +6,7 @@
/* eslint-disable max-classes-per-file */
import _ from 'lodash';
-import { DataRequestDescriptor, DataMeta } from '../../../common/data_request_descriptor_types';
+import { DataRequestDescriptor, DataMeta } from '../../../common/descriptor_types';
export class DataRequest {
private readonly _descriptor: DataRequestDescriptor;
diff --git a/x-pack/legacy/plugins/maps/public/layers/util/is_refresh_only_query.ts b/x-pack/legacy/plugins/maps/public/layers/util/is_refresh_only_query.ts
index 48b1340207fd4..a56da4b23aa1e 100644
--- a/x-pack/legacy/plugins/maps/public/layers/util/is_refresh_only_query.ts
+++ b/x-pack/legacy/plugins/maps/public/layers/util/is_refresh_only_query.ts
@@ -4,7 +4,7 @@
* you may not use this file except in compliance with the Elastic License.
*/
-import { Query } from '../../../common/map_descriptor';
+import { Query } from '../../../common/descriptor_types';
// Refresh only query is query where timestamps are different but query is the same.
// Triggered by clicking "Refresh" button in QueryBar
diff --git a/x-pack/legacy/plugins/maps/public/layers/vector_layer.d.ts b/x-pack/legacy/plugins/maps/public/layers/vector_layer.d.ts
index 390374f761fc7..70fd9927b7732 100644
--- a/x-pack/legacy/plugins/maps/public/layers/vector_layer.d.ts
+++ b/x-pack/legacy/plugins/maps/public/layers/vector_layer.d.ts
@@ -7,8 +7,11 @@
import { AbstractLayer } from './layer';
import { IVectorSource } from './sources/vector_source';
-import { VectorLayerDescriptor } from '../../common/descriptor_types';
-import { MapFilters, VectorSourceRequestMeta } from '../../common/data_request_descriptor_types';
+import {
+ MapFilters,
+ VectorLayerDescriptor,
+ VectorSourceRequestMeta,
+} from '../../common/descriptor_types';
import { ILayer } from './layer';
import { IJoin } from './joins/join';
import { IVectorStyle } from './styles/vector/vector_style';
diff --git a/x-pack/legacy/plugins/siem/cypress.json b/x-pack/legacy/plugins/siem/cypress.json
index d2397e1ec90dd..cc41b72714ed9 100644
--- a/x-pack/legacy/plugins/siem/cypress.json
+++ b/x-pack/legacy/plugins/siem/cypress.json
@@ -1,6 +1,6 @@
{
"baseUrl": "http://localhost:5601",
- "defaultCommandTimeout": 30000,
+ "defaultCommandTimeout": 60000,
"screenshotsFolder": "../../../../target/kibana-siem/cypress/screenshots",
"trashAssetsBeforeRuns": false,
"video": false,
diff --git a/x-pack/legacy/plugins/siem/cypress/integration/signal_detection_rules_custom.spec.ts b/x-pack/legacy/plugins/siem/cypress/integration/signal_detection_rules_custom.spec.ts
index 06ba4bed005ca..3f509c35b64ea 100644
--- a/x-pack/legacy/plugins/siem/cypress/integration/signal_detection_rules_custom.spec.ts
+++ b/x-pack/legacy/plugins/siem/cypress/integration/signal_detection_rules_custom.spec.ts
@@ -4,7 +4,7 @@
* you may not use this file except in compliance with the Elastic License.
*/
-import { newRule } from '../objects/rule';
+import { newRule, totalNumberOfPrebuiltRules } from '../objects/rule';
import {
ABOUT_FALSE_POSITIVES,
@@ -83,7 +83,7 @@ describe('Signal detection rules, custom', () => {
changeToThreeHundredRowsPerPage();
waitForRulesToBeLoaded();
- const expectedNumberOfRules = 93;
+ const expectedNumberOfRules = totalNumberOfPrebuiltRules + 1;
cy.get(RULES_TABLE).then($table => {
cy.wrap($table.find(RULES_ROW).length).should('eql', expectedNumberOfRules);
});
diff --git a/x-pack/legacy/plugins/siem/cypress/integration/signal_detection_rules_ml.spec.ts b/x-pack/legacy/plugins/siem/cypress/integration/signal_detection_rules_ml.spec.ts
index 99391fa73a753..db56193c6b51c 100644
--- a/x-pack/legacy/plugins/siem/cypress/integration/signal_detection_rules_ml.spec.ts
+++ b/x-pack/legacy/plugins/siem/cypress/integration/signal_detection_rules_ml.spec.ts
@@ -4,7 +4,7 @@
* you may not use this file except in compliance with the Elastic License.
*/
-import { machineLearningRule } from '../objects/rule';
+import { machineLearningRule, totalNumberOfPrebuiltRules } from '../objects/rule';
import {
ABOUT_FALSE_POSITIVES,
@@ -88,7 +88,7 @@ describe('Signal detection rules, machine learning', () => {
changeToThreeHundredRowsPerPage();
waitForRulesToBeLoaded();
- const expectedNumberOfRules = 93;
+ const expectedNumberOfRules = totalNumberOfPrebuiltRules + 1;
cy.get(RULES_TABLE).then($table => {
cy.wrap($table.find(RULES_ROW).length).should('eql', expectedNumberOfRules);
});
diff --git a/x-pack/legacy/plugins/siem/cypress/integration/signal_detection_rules_prebuilt.spec.ts b/x-pack/legacy/plugins/siem/cypress/integration/signal_detection_rules_prebuilt.spec.ts
index 172f1dc918163..98af25cd7d209 100644
--- a/x-pack/legacy/plugins/siem/cypress/integration/signal_detection_rules_prebuilt.spec.ts
+++ b/x-pack/legacy/plugins/siem/cypress/integration/signal_detection_rules_prebuilt.spec.ts
@@ -4,11 +4,21 @@
* you may not use this file except in compliance with the Elastic License.
*/
-import { ELASTIC_RULES_BTN, RULES_ROW, RULES_TABLE } from '../screens/signal_detection_rules';
+import {
+ COLLAPSED_ACTION_BTN,
+ ELASTIC_RULES_BTN,
+ RELOAD_PREBUILT_RULES_BTN,
+ RULES_ROW,
+ RULES_TABLE,
+} from '../screens/signal_detection_rules';
import {
changeToThreeHundredRowsPerPage,
+ deleteFirstRule,
+ deleteSelectedRules,
loadPrebuiltDetectionRules,
+ reloadDeletedRules,
+ selectNumberOfRules,
waitForLoadElasticPrebuiltDetectionRulesTableToBeLoaded,
waitForPrebuiltDetectionRulesToBeLoaded,
waitForRulesToBeLoaded,
@@ -18,11 +28,18 @@ import {
waitForSignalsIndexToBeCreated,
waitForSignalsPanelToBeLoaded,
} from '../tasks/detections';
-import { esArchiverLoadEmptyKibana, esArchiverUnloadEmptyKibana } from '../tasks/es_archiver';
+import {
+ esArchiverLoad,
+ esArchiverLoadEmptyKibana,
+ esArchiverUnloadEmptyKibana,
+ esArchiverUnload,
+} from '../tasks/es_archiver';
import { loginAndWaitForPageWithoutDateRange } from '../tasks/login';
import { DETECTIONS } from '../urls/navigation';
+import { totalNumberOfPrebuiltRules } from '../objects/rule';
+
describe('Signal detection rules, prebuilt rules', () => {
before(() => {
esArchiverLoadEmptyKibana();
@@ -33,6 +50,9 @@ describe('Signal detection rules, prebuilt rules', () => {
});
it('Loads prebuilt rules', () => {
+ const expectedNumberOfRules = totalNumberOfPrebuiltRules;
+ const expectedElasticRulesBtnText = `Elastic rules (${expectedNumberOfRules})`;
+
loginAndWaitForPageWithoutDateRange(DETECTIONS);
waitForSignalsPanelToBeLoaded();
waitForSignalsIndexToBeCreated();
@@ -41,7 +61,6 @@ describe('Signal detection rules, prebuilt rules', () => {
loadPrebuiltDetectionRules();
waitForPrebuiltDetectionRulesToBeLoaded();
- const expectedElasticRulesBtnText = 'Elastic rules (92)';
cy.get(ELASTIC_RULES_BTN)
.invoke('text')
.should('eql', expectedElasticRulesBtnText);
@@ -49,9 +68,105 @@ describe('Signal detection rules, prebuilt rules', () => {
changeToThreeHundredRowsPerPage();
waitForRulesToBeLoaded();
- const expectedNumberOfRules = 92;
cy.get(RULES_TABLE).then($table => {
cy.wrap($table.find(RULES_ROW).length).should('eql', expectedNumberOfRules);
});
});
});
+
+describe('Deleting prebuilt rules', () => {
+ beforeEach(() => {
+ esArchiverLoad('prebuilt_rules_loaded');
+ loginAndWaitForPageWithoutDateRange(DETECTIONS);
+ waitForSignalsPanelToBeLoaded();
+ waitForSignalsIndexToBeCreated();
+ goToManageSignalDetectionRules();
+ });
+
+ afterEach(() => {
+ esArchiverUnload('prebuilt_rules_loaded');
+ });
+
+ it('Does not allow to delete one rule when more than one is selected', () => {
+ const numberOfRulesToBeSelected = 2;
+ selectNumberOfRules(numberOfRulesToBeSelected);
+
+ cy.get(COLLAPSED_ACTION_BTN).each(collapsedItemActionBtn => {
+ cy.wrap(collapsedItemActionBtn).should('have.attr', 'disabled');
+ });
+ });
+
+ it('Deletes and recovers one rule', () => {
+ const expectedNumberOfRulesAfterDeletion = totalNumberOfPrebuiltRules - 1;
+ const expectedNumberOfRulesAfterRecovering = totalNumberOfPrebuiltRules;
+
+ deleteFirstRule();
+ cy.reload();
+ changeToThreeHundredRowsPerPage();
+ waitForRulesToBeLoaded();
+
+ cy.get(ELASTIC_RULES_BTN)
+ .invoke('text')
+ .should('eql', `Elastic rules (${expectedNumberOfRulesAfterDeletion})`);
+ cy.get(RULES_TABLE).then($table => {
+ cy.wrap($table.find(RULES_ROW).length).should('eql', expectedNumberOfRulesAfterDeletion);
+ });
+ cy.get(RELOAD_PREBUILT_RULES_BTN).should('exist');
+ cy.get(RELOAD_PREBUILT_RULES_BTN)
+ .invoke('text')
+ .should('eql', 'Reload 1 deleted Elastic prebuilt rule ');
+
+ reloadDeletedRules();
+
+ cy.get(RELOAD_PREBUILT_RULES_BTN).should('not.exist');
+
+ cy.reload();
+ changeToThreeHundredRowsPerPage();
+ waitForRulesToBeLoaded();
+
+ cy.get(RULES_TABLE).then($table => {
+ cy.wrap($table.find(RULES_ROW).length).should('eql', expectedNumberOfRulesAfterRecovering);
+ });
+ cy.get(ELASTIC_RULES_BTN)
+ .invoke('text')
+ .should('eql', `Elastic rules (${expectedNumberOfRulesAfterRecovering})`);
+ });
+
+ it('Deletes and recovers more than one rule', () => {
+ const numberOfRulesToBeSelected = 2;
+ const expectedNumberOfRulesAfterDeletion = totalNumberOfPrebuiltRules - 2;
+ const expectedNumberOfRulesAfterRecovering = totalNumberOfPrebuiltRules;
+
+ selectNumberOfRules(numberOfRulesToBeSelected);
+ deleteSelectedRules();
+ cy.reload();
+ changeToThreeHundredRowsPerPage();
+ waitForRulesToBeLoaded();
+
+ cy.get(RELOAD_PREBUILT_RULES_BTN).should('exist');
+ cy.get(RELOAD_PREBUILT_RULES_BTN)
+ .invoke('text')
+ .should('eql', `Reload ${numberOfRulesToBeSelected} deleted Elastic prebuilt rules `);
+ cy.get(ELASTIC_RULES_BTN)
+ .invoke('text')
+ .should('eql', `Elastic rules (${expectedNumberOfRulesAfterDeletion})`);
+ cy.get(RULES_TABLE).then($table => {
+ cy.wrap($table.find(RULES_ROW).length).should('eql', expectedNumberOfRulesAfterDeletion);
+ });
+
+ reloadDeletedRules();
+
+ cy.get(RELOAD_PREBUILT_RULES_BTN).should('not.exist');
+
+ cy.reload();
+ changeToThreeHundredRowsPerPage();
+ waitForRulesToBeLoaded();
+
+ cy.get(RULES_TABLE).then($table => {
+ cy.wrap($table.find(RULES_ROW).length).should('eql', expectedNumberOfRulesAfterRecovering);
+ });
+ cy.get(ELASTIC_RULES_BTN)
+ .invoke('text')
+ .should('eql', `Elastic rules (${expectedNumberOfRulesAfterRecovering})`);
+ });
+});
diff --git a/x-pack/legacy/plugins/siem/cypress/objects/rule.ts b/x-pack/legacy/plugins/siem/cypress/objects/rule.ts
index a183da1de5d6e..a3c648c9cc934 100644
--- a/x-pack/legacy/plugins/siem/cypress/objects/rule.ts
+++ b/x-pack/legacy/plugins/siem/cypress/objects/rule.ts
@@ -4,6 +4,8 @@
* you may not use this file except in compliance with the Elastic License.
*/
+export const totalNumberOfPrebuiltRules = 92;
+
interface Mitre {
tactic: string;
techniques: string[];
diff --git a/x-pack/legacy/plugins/siem/cypress/screens/signal_detection_rules.ts b/x-pack/legacy/plugins/siem/cypress/screens/signal_detection_rules.ts
index 2576715279347..65f24e3a765ea 100644
--- a/x-pack/legacy/plugins/siem/cypress/screens/signal_detection_rules.ts
+++ b/x-pack/legacy/plugins/siem/cypress/screens/signal_detection_rules.ts
@@ -4,10 +4,18 @@
* you may not use this file except in compliance with the Elastic License.
*/
+export const BULK_ACTIONS_BTN = '[data-test-subj="bulkActions"] span';
+
export const CREATE_NEW_RULE_BTN = '[data-test-subj="create-new-rule"]';
+export const COLLAPSED_ACTION_BTN = '[data-test-subj="euiCollapsedItemActionsButton"]';
+
export const CUSTOM_RULES_BTN = '[data-test-subj="show-custom-rules-filter-button"]';
+export const DELETE_RULE_ACTION_BTN = '[data-test-subj="deleteRuleAction"]';
+
+export const DELETE_RULE_BULK_BTN = '[data-test-subj="deleteRuleBulk"]';
+
export const ELASTIC_RULES_BTN = '[data-test-subj="show-elastic-rules-filter-button"]';
export const LOAD_PREBUILT_RULES_BTN = '[data-test-subj="load-prebuilt-rules"]';
@@ -21,6 +29,10 @@ export const PAGINATION_POPOVER_BTN = '[data-test-subj="tablePaginationPopoverBu
export const RISK_SCORE = '[data-test-subj="riskScore"]';
+export const RELOAD_PREBUILT_RULES_BTN = '[data-test-subj="reloadPrebuiltRulesBtn"]';
+
+export const RULE_CHECKBOX = '.euiTableRow .euiCheckbox__input';
+
export const RULE_NAME = '[data-test-subj="ruleName"]';
export const RULE_SWITCH = '[data-test-subj="rule-switch"]';
diff --git a/x-pack/legacy/plugins/siem/cypress/tasks/login.ts b/x-pack/legacy/plugins/siem/cypress/tasks/login.ts
index 3abf5a6930486..c7788b080d06e 100644
--- a/x-pack/legacy/plugins/siem/cypress/tasks/login.ts
+++ b/x-pack/legacy/plugins/siem/cypress/tasks/login.ts
@@ -131,5 +131,5 @@ export const loginAndWaitForPageWithoutDateRange = (url: string) => {
login();
cy.viewport('macbook-15');
cy.visit(url);
- cy.contains('a', 'SIEM', { timeout: 60000 });
+ cy.contains('a', 'SIEM', { timeout: 120000 });
};
diff --git a/x-pack/legacy/plugins/siem/cypress/tasks/signal_detection_rules.ts b/x-pack/legacy/plugins/siem/cypress/tasks/signal_detection_rules.ts
index 22e5f166b2981..cfc490526d84e 100644
--- a/x-pack/legacy/plugins/siem/cypress/tasks/signal_detection_rules.ts
+++ b/x-pack/legacy/plugins/siem/cypress/tasks/signal_detection_rules.ts
@@ -5,13 +5,21 @@
*/
import {
+ BULK_ACTIONS_BTN,
+ COLLAPSED_ACTION_BTN,
CREATE_NEW_RULE_BTN,
+ CUSTOM_RULES_BTN,
+ DELETE_RULE_ACTION_BTN,
+ DELETE_RULE_BULK_BTN,
LOAD_PREBUILT_RULES_BTN,
LOADING_INITIAL_PREBUILT_RULES_TABLE,
LOADING_SPINNER,
PAGINATION_POPOVER_BTN,
+ RULE_CHECKBOX,
+ RULE_NAME,
RULES_TABLE,
THREE_HUNDRED_ROWS,
+ RELOAD_PREBUILT_RULES_BTN,
} from '../screens/signal_detection_rules';
export const changeToThreeHundredRowsPerPage = () => {
@@ -19,10 +27,22 @@ export const changeToThreeHundredRowsPerPage = () => {
cy.get(THREE_HUNDRED_ROWS).click();
};
+export const deleteFirstRule = () => {
+ cy.get(COLLAPSED_ACTION_BTN)
+ .first()
+ .click({ force: true });
+ cy.get(DELETE_RULE_ACTION_BTN).click();
+};
+
+export const deleteSelectedRules = () => {
+ cy.get(BULK_ACTIONS_BTN).click({ force: true });
+ cy.get(DELETE_RULE_BULK_BTN).click();
+};
+
export const filterByCustomRules = () => {
- cy.get('[data-test-subj="show-custom-rules-filter-button"]').click({ force: true });
- cy.get('[data-test-subj="loading-spinner"]').should('exist');
- cy.get('[data-test-subj="loading-spinner"]').should('not.exist');
+ cy.get(CUSTOM_RULES_BTN).click({ force: true });
+ cy.get(LOADING_SPINNER).should('exist');
+ cy.get(LOADING_SPINNER).should('not.exist');
};
export const goToCreateNewRule = () => {
@@ -30,9 +50,7 @@ export const goToCreateNewRule = () => {
};
export const goToRuleDetails = () => {
- cy.get('[data-test-subj="ruleName"]').click({ force: true });
- cy.get('.euiLoadingSpinner').should('exist');
- cy.get('.euiLoadingSpinner').should('not.exist');
+ cy.get(RULE_NAME).click({ force: true });
};
export const loadPrebuiltDetectionRules = () => {
@@ -41,6 +59,18 @@ export const loadPrebuiltDetectionRules = () => {
.click({ force: true });
};
+export const reloadDeletedRules = () => {
+ cy.get(RELOAD_PREBUILT_RULES_BTN).click({ force: true });
+};
+
+export const selectNumberOfRules = (numberOfRules: number) => {
+ for (let i = 0; i < numberOfRules; i++) {
+ cy.get(RULE_CHECKBOX)
+ .eq(i)
+ .click({ force: true });
+ }
+};
+
export const waitForLoadElasticPrebuiltDetectionRulesTableToBeLoaded = () => {
cy.get(LOADING_INITIAL_PREBUILT_RULES_TABLE).should('exist');
cy.get(LOADING_INITIAL_PREBUILT_RULES_TABLE).should('not.exist');
diff --git a/x-pack/legacy/plugins/siem/public/pages/detection_engine/rules/all/batch_actions.tsx b/x-pack/legacy/plugins/siem/public/pages/detection_engine/rules/all/batch_actions.tsx
index a0942d7f6534a..60ad68b8c9141 100644
--- a/x-pack/legacy/plugins/siem/public/pages/detection_engine/rules/all/batch_actions.tsx
+++ b/x-pack/legacy/plugins/siem/public/pages/detection_engine/rules/all/batch_actions.tsx
@@ -108,6 +108,7 @@ export const getBatchItems = ({
{i18n.BATCH_ACTION_DUPLICATE_SELECTED}
,
!rowItem.immutable,
},
{
+ 'data-test-subj': 'deleteRuleAction',
description: i18n.DELETE_RULE,
icon: 'trash',
name: i18n.DELETE_RULE,
diff --git a/x-pack/legacy/plugins/siem/public/pages/detection_engine/rules/all/index.tsx b/x-pack/legacy/plugins/siem/public/pages/detection_engine/rules/all/index.tsx
index 1a0de46729312..8458b32368525 100644
--- a/x-pack/legacy/plugins/siem/public/pages/detection_engine/rules/all/index.tsx
+++ b/x-pack/legacy/plugins/siem/public/pages/detection_engine/rules/all/index.tsx
@@ -307,6 +307,7 @@ export const AllRules = React.memo(
{i18n.SELECTED_RULES(selectedRuleIds.length)}
{!hasNoPermissions && (
{
{prePackagedRuleStatus === 'someRuleUninstall' && (
{
+ console.error(err);
+ // eslint-disable-next-line no-process-exit
+ process.exit(1);
+});
diff --git a/x-pack/legacy/plugins/siem/scripts/optimize_tsconfig/README.md b/x-pack/legacy/plugins/siem/scripts/optimize_tsconfig/README.md
new file mode 100644
index 0000000000000..d3615d2870ef9
--- /dev/null
+++ b/x-pack/legacy/plugins/siem/scripts/optimize_tsconfig/README.md
@@ -0,0 +1,16 @@
+Hard forked from here:
+x-pack/legacy/plugins/apm/scripts/optimize-tsconfig.js
+
+
+#### Optimizing TypeScript
+
+Kibana and X-Pack are very large TypeScript projects, and it comes at a cost. Editor responsiveness is not great, and the CLI type check for X-Pack takes about a minute. To get faster feedback, we create a smaller SIEM TypeScript project that only type checks the SIEM project and the files it uses. This optimization consists of creating a `tsconfig.json` in SIEM that includes the Kibana/X-Pack typings, and editing the Kibana/X-Pack configurations to not include any files, or removing the configurations altogether. The script configures git to ignore any changes in these files, and has an undo script as well.
+
+To run the optimization:
+
+`$ node x-pack/legacy/plugins/siem/scripts/optimize_tsconfig`
+
+To undo the optimization:
+
+`$ node x-pack/legacy/plugins/siem/scripts/unoptimize_tsconfig`
+
diff --git a/x-pack/legacy/plugins/siem/scripts/optimize_tsconfig/optimize.js b/x-pack/legacy/plugins/siem/scripts/optimize_tsconfig/optimize.js
new file mode 100644
index 0000000000000..9c04e0b69b738
--- /dev/null
+++ b/x-pack/legacy/plugins/siem/scripts/optimize_tsconfig/optimize.js
@@ -0,0 +1,76 @@
+/*
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
+ * or more contributor license agreements. Licensed under the Elastic License;
+ * you may not use this file except in compliance with the Elastic License.
+ */
+
+/* eslint-disable import/no-extraneous-dependencies */
+
+const fs = require('fs');
+const { promisify } = require('util');
+const path = require('path');
+const json5 = require('json5');
+const execa = require('execa');
+
+const readFile = promisify(fs.readFile);
+const writeFile = promisify(fs.writeFile);
+
+const { xpackRoot, kibanaRoot, tsconfigTpl, filesToIgnore } = require('./paths');
+const { unoptimizeTsConfig } = require('./unoptimize');
+
+function prepareParentTsConfigs() {
+ return Promise.all(
+ [path.resolve(xpackRoot, 'tsconfig.json'), path.resolve(kibanaRoot, 'tsconfig.json')].map(
+ async filename => {
+ const config = json5.parse(await readFile(filename, 'utf-8'));
+
+ await writeFile(
+ filename,
+ JSON.stringify(
+ {
+ ...config,
+ include: [],
+ },
+ null,
+ 2
+ ),
+ { encoding: 'utf-8' }
+ );
+ }
+ )
+ );
+}
+
+async function addFilesToXpackTsConfig() {
+ const template = json5.parse(await readFile(tsconfigTpl, 'utf-8'));
+ const xpackTsConfig = path.join(xpackRoot, 'tsconfig.json');
+ const config = json5.parse(await readFile(xpackTsConfig, 'utf-8'));
+
+ await writeFile(xpackTsConfig, JSON.stringify({ ...config, ...template }, null, 2), {
+ encoding: 'utf-8',
+ });
+}
+
+async function setIgnoreChanges() {
+ for (const filename of filesToIgnore) {
+ await execa('git', ['update-index', '--skip-worktree', filename]);
+ }
+}
+
+async function optimizeTsConfig() {
+ await unoptimizeTsConfig();
+
+ await prepareParentTsConfigs();
+
+ await addFilesToXpackTsConfig();
+
+ await setIgnoreChanges();
+ // eslint-disable-next-line no-console
+ console.log(
+ 'Created an optimized tsconfig.json for SIEM. To undo these changes, run `./scripts/unoptimize_tsconfig.js`'
+ );
+}
+
+module.exports = {
+ optimizeTsConfig,
+};
diff --git a/x-pack/legacy/plugins/siem/scripts/optimize_tsconfig/paths.js b/x-pack/legacy/plugins/siem/scripts/optimize_tsconfig/paths.js
new file mode 100644
index 0000000000000..ca26203e17d2e
--- /dev/null
+++ b/x-pack/legacy/plugins/siem/scripts/optimize_tsconfig/paths.js
@@ -0,0 +1,23 @@
+/*
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
+ * or more contributor license agreements. Licensed under the Elastic License;
+ * you may not use this file except in compliance with the Elastic License.
+ */
+const path = require('path');
+
+const xpackRoot = path.resolve(__dirname, '../../../../..');
+const kibanaRoot = path.resolve(xpackRoot, '..');
+
+const tsconfigTpl = path.resolve(__dirname, './tsconfig.json');
+
+const filesToIgnore = [
+ path.resolve(xpackRoot, 'tsconfig.json'),
+ path.resolve(kibanaRoot, 'tsconfig.json'),
+];
+
+module.exports = {
+ xpackRoot,
+ kibanaRoot,
+ tsconfigTpl,
+ filesToIgnore,
+};
diff --git a/x-pack/legacy/plugins/siem/scripts/optimize_tsconfig/tsconfig.json b/x-pack/legacy/plugins/siem/scripts/optimize_tsconfig/tsconfig.json
new file mode 100644
index 0000000000000..bec6988bdebd9
--- /dev/null
+++ b/x-pack/legacy/plugins/siem/scripts/optimize_tsconfig/tsconfig.json
@@ -0,0 +1,15 @@
+{
+ "include": [
+ "typings/**/*",
+ "plugins/siem/**/*",
+ "legacy/plugins/siem/**/*",
+ "plugins/apm/typings/numeral.d.ts",
+ "legacy/plugins/canvas/types/webpack.d.ts"
+ ],
+ "exclude": [
+ "test/**/*",
+ "**/__fixtures__/**/*",
+ "legacy/plugins/siem/cypress/**/*",
+ "**/typespec_tests.ts"
+ ]
+}
diff --git a/x-pack/legacy/plugins/siem/scripts/optimize_tsconfig/unoptimize.js b/x-pack/legacy/plugins/siem/scripts/optimize_tsconfig/unoptimize.js
new file mode 100644
index 0000000000000..21fc1aa2a1a33
--- /dev/null
+++ b/x-pack/legacy/plugins/siem/scripts/optimize_tsconfig/unoptimize.js
@@ -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;
+ * you may not use this file except in compliance with the Elastic License.
+ */
+/* eslint-disable import/no-extraneous-dependencies */
+
+const execa = require('execa');
+
+const { filesToIgnore } = require('./paths');
+
+async function unoptimizeTsConfig() {
+ for (const filename of filesToIgnore) {
+ await execa('git', ['update-index', '--no-skip-worktree', filename]);
+ await execa('git', ['checkout', filename]);
+ }
+}
+
+module.exports = {
+ unoptimizeTsConfig: async () => {
+ await unoptimizeTsConfig();
+ // eslint-disable-next-line no-console
+ console.log('Removed SIEM TypeScript optimizations');
+ },
+};
diff --git a/x-pack/legacy/plugins/siem/scripts/unoptimize_tsconfig.js b/x-pack/legacy/plugins/siem/scripts/unoptimize_tsconfig.js
new file mode 100644
index 0000000000000..d5392c76d9f8f
--- /dev/null
+++ b/x-pack/legacy/plugins/siem/scripts/unoptimize_tsconfig.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;
+ * you may not use this file except in compliance with the Elastic License.
+ */
+
+const { unoptimizeTsConfig } = require('./optimize_tsconfig/unoptimize');
+
+unoptimizeTsConfig().catch(err => {
+ console.error(err);
+ // eslint-disable-next-line no-process-exit
+ process.exit(1);
+});
diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/__mocks__/request_responses.ts b/x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/__mocks__/request_responses.ts
index 24f50c5ce87a0..3b24b722f7356 100644
--- a/x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/__mocks__/request_responses.ts
+++ b/x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/__mocks__/request_responses.ts
@@ -514,7 +514,7 @@ export const updateActionResult = (): ActionResult => ({
config: {},
});
-export const getMockPrivileges = () => ({
+export const getMockPrivilegesResult = () => ({
username: 'test-space',
has_all_requested: false,
cluster: {
@@ -565,8 +565,6 @@ export const getMockPrivileges = () => ({
},
},
application: {},
- is_authenticated: false,
- has_encryption_key: true,
});
export const getFindResultStatusEmpty = (): SavedObjectsFindResponse => ({
diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/privileges/read_privileges_route.test.ts b/x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/privileges/read_privileges_route.test.ts
index 44050f21a1259..aa4f6150889f9 100644
--- a/x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/privileges/read_privileges_route.test.ts
+++ b/x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/privileges/read_privileges_route.test.ts
@@ -4,20 +4,24 @@
* you may not use this file except in compliance with the Elastic License.
*/
+import { securityMock } from '../../../../../../../../plugins/security/server/mocks';
import { readPrivilegesRoute } from './read_privileges_route';
import { serverMock, requestContextMock } from '../__mocks__';
-import { getPrivilegeRequest, getMockPrivileges } from '../__mocks__/request_responses';
+import { getPrivilegeRequest, getMockPrivilegesResult } from '../__mocks__/request_responses';
-describe('read_privileges', () => {
+describe('read_privileges route', () => {
let server: ReturnType;
let { clients, context } = requestContextMock.createTools();
+ let mockSecurity: ReturnType;
beforeEach(() => {
server = serverMock.create();
({ clients, context } = requestContextMock.createTools());
- clients.clusterClient.callAsCurrentUser.mockResolvedValue(getMockPrivileges());
- readPrivilegesRoute(server.router, false);
+ mockSecurity = securityMock.createSetup();
+ mockSecurity.authc.isAuthenticated.mockReturnValue(false);
+ clients.clusterClient.callAsCurrentUser.mockResolvedValue(getMockPrivilegesResult());
+ readPrivilegesRoute(server.router, mockSecurity, false);
});
describe('normal status codes', () => {
@@ -26,10 +30,28 @@ describe('read_privileges', () => {
expect(response.status).toEqual(200);
});
- test.skip('returns the payload when doing a normal request', async () => {
+ test('returns the payload when doing a normal request', async () => {
const response = await server.inject(getPrivilegeRequest(), context);
+ const expectedBody = {
+ ...getMockPrivilegesResult(),
+ is_authenticated: false,
+ has_encryption_key: true,
+ };
expect(response.status).toEqual(200);
- expect(response.body).toEqual(getMockPrivileges());
+ expect(response.body).toEqual(expectedBody);
+ });
+
+ test('is authenticated when security says so', async () => {
+ mockSecurity.authc.isAuthenticated.mockReturnValue(true);
+ const expectedBody = {
+ ...getMockPrivilegesResult(),
+ is_authenticated: true,
+ has_encryption_key: true,
+ };
+
+ const response = await server.inject(getPrivilegeRequest(), context);
+ expect(response.status).toEqual(200);
+ expect(response.body).toEqual(expectedBody);
});
test('returns 500 when bad response from cluster', async () => {
@@ -41,4 +63,26 @@ describe('read_privileges', () => {
expect(response.body).toEqual({ message: 'Test error', status_code: 500 });
});
});
+
+ describe('when security plugin is disabled', () => {
+ beforeEach(() => {
+ server = serverMock.create();
+ ({ clients, context } = requestContextMock.createTools());
+
+ clients.clusterClient.callAsCurrentUser.mockResolvedValue(getMockPrivilegesResult());
+ readPrivilegesRoute(server.router, undefined, false);
+ });
+
+ it('returns unauthenticated', async () => {
+ const expectedBody = {
+ ...getMockPrivilegesResult(),
+ is_authenticated: false,
+ has_encryption_key: true,
+ };
+
+ const response = await server.inject(getPrivilegeRequest(), context);
+ expect(response.status).toEqual(200);
+ expect(response.body).toEqual(expectedBody);
+ });
+ });
});
diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/privileges/read_privileges_route.ts b/x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/privileges/read_privileges_route.ts
index 81ce4a9c3f2fc..2f5ea4d1ec767 100644
--- a/x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/privileges/read_privileges_route.ts
+++ b/x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/privileges/read_privileges_route.ts
@@ -8,10 +8,15 @@ import { merge } from 'lodash/fp';
import { IRouter } from '../../../../../../../../../src/core/server';
import { DETECTION_ENGINE_PRIVILEGES_URL } from '../../../../../common/constants';
+import { SetupPlugins } from '../../../../plugin';
import { buildSiemResponse, transformError } from '../utils';
import { readPrivileges } from '../../privileges/read_privileges';
-export const readPrivilegesRoute = (router: IRouter, usingEphemeralEncryptionKey: boolean) => {
+export const readPrivilegesRoute = (
+ router: IRouter,
+ security: SetupPlugins['security'],
+ usingEphemeralEncryptionKey: boolean
+) => {
router.get(
{
path: DETECTION_ENGINE_PRIVILEGES_URL,
@@ -29,7 +34,7 @@ export const readPrivilegesRoute = (router: IRouter, usingEphemeralEncryptionKey
const index = siemClient.signalsIndex;
const clusterPrivileges = await readPrivileges(clusterClient.callAsCurrentUser, index);
const privileges = merge(clusterPrivileges, {
- is_authenticated: true, // until we support optional auth: https://github.com/elastic/kibana/pull/55327#issuecomment-577159911
+ is_authenticated: security?.authc.isAuthenticated(request) ?? false,
has_encryption_key: !usingEphemeralEncryptionKey,
});
diff --git a/x-pack/legacy/plugins/siem/server/lib/framework/kibana_framework_adapter.ts b/x-pack/legacy/plugins/siem/server/lib/framework/kibana_framework_adapter.ts
index 004ac36bad5b4..6b41426e047ca 100644
--- a/x-pack/legacy/plugins/siem/server/lib/framework/kibana_framework_adapter.ts
+++ b/x-pack/legacy/plugins/siem/server/lib/framework/kibana_framework_adapter.ts
@@ -122,7 +122,7 @@ export class KibanaBackendFrameworkAdapter implements FrameworkAdapter {
private async getCurrentUserInfo(request: KibanaRequest): Promise {
try {
- const user = await this.security.authc.getCurrentUser(request);
+ const user = (await this.security?.authc.getCurrentUser(request)) ?? null;
return user;
} catch {
return null;
diff --git a/x-pack/legacy/plugins/siem/server/lib/timeline/routes/import_timelines_route.ts b/x-pack/legacy/plugins/siem/server/lib/timeline/routes/import_timelines_route.ts
index fefe31b2f36d0..2b41b4e7843a7 100644
--- a/x-pack/legacy/plugins/siem/server/lib/timeline/routes/import_timelines_route.ts
+++ b/x-pack/legacy/plugins/siem/server/lib/timeline/routes/import_timelines_route.ts
@@ -30,6 +30,7 @@ import {
import { IRouter } from '../../../../../../../../src/core/server';
import { TIMELINE_IMPORT_URL } from '../../../../common/constants';
+import { SetupPlugins } from '../../../plugin';
import { importTimelinesPayloadSchema } from './schemas/import_timelines_schema';
import { importRulesSchema } from '../../detection_engine/routes/schemas/response/import_rules_schema';
import { LegacyServices } from '../../../types';
@@ -37,7 +38,6 @@ import { LegacyServices } from '../../../types';
import { Timeline } from '../saved_object';
import { validate } from '../../detection_engine/routes/rules/validate';
import { FrameworkRequest } from '../../framework';
-import { SecurityPluginSetup } from '../../../../../../../plugins/security/server';
const CHUNK_PARSED_OBJECT_SIZE = 10;
@@ -46,7 +46,7 @@ const timelineLib = new Timeline();
export const importTimelinesRoute = (
router: IRouter,
config: LegacyServices['config'],
- securityPluginSetup: SecurityPluginSetup
+ security: SetupPlugins['security']
) => {
router.post(
{
@@ -96,7 +96,7 @@ export const importTimelinesRoute = (
const chunkParseObjects = chunk(CHUNK_PARSED_OBJECT_SIZE, uniqueParsedObjects);
let importTimelineResponse: ImportTimelineResponse[] = [];
- const user = await securityPluginSetup.authc.getCurrentUser(request);
+ const user = await security?.authc.getCurrentUser(request);
let frameworkRequest = set('context.core.savedObjects.client', savedObjectsClient, request);
frameworkRequest = set('user', user, frameworkRequest);
diff --git a/x-pack/legacy/plugins/siem/server/plugin.ts b/x-pack/legacy/plugins/siem/server/plugin.ts
index 2bce9b6a7e1aa..98631ea220a54 100644
--- a/x-pack/legacy/plugins/siem/server/plugin.ts
+++ b/x-pack/legacy/plugins/siem/server/plugin.ts
@@ -46,7 +46,7 @@ export interface SetupPlugins {
encryptedSavedObjects: EncryptedSavedObjectsSetup;
features: FeaturesSetup;
licensing: LicensingPluginSetup;
- security: SecuritySetup;
+ security?: SecuritySetup;
spaces?: SpacesSetup;
}
diff --git a/x-pack/legacy/plugins/siem/server/routes/index.ts b/x-pack/legacy/plugins/siem/server/routes/index.ts
index 29c21ad157235..8c9f92890c26a 100644
--- a/x-pack/legacy/plugins/siem/server/routes/index.ts
+++ b/x-pack/legacy/plugins/siem/server/routes/index.ts
@@ -31,13 +31,13 @@ import { findRulesStatusesRoute } from '../lib/detection_engine/routes/rules/fin
import { getPrepackagedRulesStatusRoute } from '../lib/detection_engine/routes/rules/get_prepackaged_rules_status_route';
import { importTimelinesRoute } from '../lib/timeline/routes/import_timelines_route';
import { exportTimelinesRoute } from '../lib/timeline/routes/export_timelines_route';
-import { SecurityPluginSetup } from '../../../../../plugins/security/server/';
+import { SetupPlugins } from '../plugin';
export const initRoutes = (
router: IRouter,
config: LegacyServices['config'],
usingEphemeralEncryptionKey: boolean,
- security: SecurityPluginSetup
+ security: SetupPlugins['security']
) => {
// Detection Engine Rule routes that have the REST endpoints of /api/detection_engine/rules
// All REST rule creation, deletion, updating, etc......
@@ -79,5 +79,5 @@ export const initRoutes = (
readTagsRoute(router);
// Privileges API to get the generic user privileges
- readPrivilegesRoute(router, usingEphemeralEncryptionKey);
+ readPrivilegesRoute(router, security, usingEphemeralEncryptionKey);
};
diff --git a/x-pack/legacy/plugins/uptime/public/pages/settings.tsx b/x-pack/legacy/plugins/uptime/public/pages/settings.tsx
index e78c3e0f7de09..d3e17a15ee0e0 100644
--- a/x-pack/legacy/plugins/uptime/public/pages/settings.tsx
+++ b/x-pack/legacy/plugins/uptime/public/pages/settings.tsx
@@ -78,7 +78,8 @@ export const SettingsPageComponent = ({
}
};
- const onApply = () => {
+ const onApply = (event: React.FormEvent) => {
+ event.preventDefault();
if (formFields) {
dispatchSetDynamicSettings(formFields);
}
@@ -176,7 +177,9 @@ export const SettingsPageComponent = ({
}
>
, Plugi
const usageCollection = plugins.usageCollection;
if (usageCollection) {
- core.getStartServices().then(async ([coreStart, startPlugins]: [CoreStart, any]) => {
+ core.getStartServices().then(async ([, startPlugins]: [CoreStart, any, any]) => {
registerActionsUsageCollector(usageCollection, startPlugins.taskManager);
initializeActionsTelemetry(
diff --git a/x-pack/plugins/advanced_ui_actions/kibana.json b/x-pack/plugins/advanced_ui_actions/kibana.json
index 515c4749de212..45907e2d8b602 100644
--- a/x-pack/plugins/advanced_ui_actions/kibana.json
+++ b/x-pack/plugins/advanced_ui_actions/kibana.json
@@ -1,6 +1,7 @@
{
"id": "advancedUiActions",
"version": "kibana",
+ "configPath": ["xpack", "advanced_ui_actions"],
"requiredPlugins": [
"embeddable",
"uiActions"
diff --git a/x-pack/plugins/alerting/server/plugin.ts b/x-pack/plugins/alerting/server/plugin.ts
index e88124322c1eb..b0d06d4aeeb74 100644
--- a/x-pack/plugins/alerting/server/plugin.ts
+++ b/x-pack/plugins/alerting/server/plugin.ts
@@ -143,7 +143,7 @@ export class AlertingPlugin {
const usageCollection = plugins.usageCollection;
if (usageCollection) {
- core.getStartServices().then(async ([coreStart, startPlugins]: [CoreStart, any]) => {
+ core.getStartServices().then(async ([, startPlugins]: [CoreStart, any, any]) => {
registerAlertsUsageCollector(usageCollection, startPlugins.taskManager);
initializeAlertingTelemetry(
diff --git a/x-pack/plugins/alerting_builtins/kibana.json b/x-pack/plugins/alerting_builtins/kibana.json
index cd6bb7519c093..78de9a1ae0165 100644
--- a/x-pack/plugins/alerting_builtins/kibana.json
+++ b/x-pack/plugins/alerting_builtins/kibana.json
@@ -4,5 +4,6 @@
"version": "8.0.0",
"kibanaVersion": "kibana",
"requiredPlugins": ["alerting"],
+ "configPath": ["xpack", "alerting_builtins"],
"ui": false
}
diff --git a/x-pack/plugins/apm/common/custom_link/custom_link_filter_options.ts b/x-pack/plugins/apm/common/custom_link/custom_link_filter_options.ts
new file mode 100644
index 0000000000000..65d2877dabe9a
--- /dev/null
+++ b/x-pack/plugins/apm/common/custom_link/custom_link_filter_options.ts
@@ -0,0 +1,18 @@
+/*
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
+ * or more contributor license agreements. Licensed under the Elastic License;
+ * you may not use this file except in compliance with the Elastic License.
+ */
+import {
+ SERVICE_NAME,
+ SERVICE_ENVIRONMENT,
+ TRANSACTION_NAME,
+ TRANSACTION_TYPE
+} from '../elasticsearch_fieldnames';
+
+export const FILTER_OPTIONS = [
+ SERVICE_NAME,
+ SERVICE_ENVIRONMENT,
+ TRANSACTION_TYPE,
+ TRANSACTION_NAME
+] as const;
diff --git a/x-pack/plugins/apm/common/custom_link/custom_link_types.d.ts b/x-pack/plugins/apm/common/custom_link/custom_link_types.d.ts
new file mode 100644
index 0000000000000..ca5e475554951
--- /dev/null
+++ b/x-pack/plugins/apm/common/custom_link/custom_link_types.d.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;
+ * you may not use this file except in compliance with the Elastic License.
+ */
+
+import {
+ SERVICE_NAME,
+ SERVICE_ENVIRONMENT,
+ TRANSACTION_NAME,
+ TRANSACTION_TYPE
+} from '../elasticsearch_fieldnames';
+import { FILTER_OPTIONS } from './custom_link_filter_options';
+
+export interface CustomLinkES {
+ id?: string;
+ '@timestamp'?: number;
+ label: string;
+ url: string;
+ [SERVICE_NAME]?: string[];
+ [SERVICE_ENVIRONMENT]?: string[];
+ [TRANSACTION_NAME]?: string[];
+ [TRANSACTION_TYPE]?: string[];
+}
+
+export type FilterKey = typeof FILTER_OPTIONS[number];
+
+export interface Filter {
+ key: FilterKey | '';
+ value: string;
+}
+
+export interface CustomLink {
+ id?: string;
+ '@timestamp'?: number;
+ label: string;
+ url: string;
+ filters?: Filter[];
+}
diff --git a/x-pack/plugins/apm/common/custom_link_filter_options.ts b/x-pack/plugins/apm/common/custom_link_filter_options.ts
deleted file mode 100644
index 32b19ad60a646..0000000000000
--- a/x-pack/plugins/apm/common/custom_link_filter_options.ts
+++ /dev/null
@@ -1,28 +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;
- * you may not use this file except in compliance with the Elastic License.
- */
-import * as t from 'io-ts';
-import {
- SERVICE_NAME,
- SERVICE_ENVIRONMENT,
- TRANSACTION_TYPE,
- TRANSACTION_NAME
-} from './elasticsearch_fieldnames';
-
-export const FilterOptionsRt = t.partial({
- [SERVICE_NAME]: t.union([t.string, t.array(t.string)]),
- [SERVICE_ENVIRONMENT]: t.union([t.string, t.array(t.string)]),
- [TRANSACTION_NAME]: t.union([t.string, t.array(t.string)]),
- [TRANSACTION_TYPE]: t.union([t.string, t.array(t.string)])
-});
-
-export type FilterOptions = t.TypeOf;
-
-export const FILTER_OPTIONS: ReadonlyArray = [
- SERVICE_NAME,
- SERVICE_ENVIRONMENT,
- TRANSACTION_TYPE,
- TRANSACTION_NAME
-] as const;
diff --git a/x-pack/plugins/apm/server/lib/settings/custom_link/__test__/__snapshots__/get_transaction.test.ts.snap b/x-pack/plugins/apm/server/lib/settings/custom_link/__snapshots__/get_transaction.test.ts.snap
similarity index 59%
rename from x-pack/plugins/apm/server/lib/settings/custom_link/__test__/__snapshots__/get_transaction.test.ts.snap
rename to x-pack/plugins/apm/server/lib/settings/custom_link/__snapshots__/get_transaction.test.ts.snap
index 16a270fd6d25b..a91641b592526 100644
--- a/x-pack/plugins/apm/server/lib/settings/custom_link/__test__/__snapshots__/get_transaction.test.ts.snap
+++ b/x-pack/plugins/apm/server/lib/settings/custom_link/__snapshots__/get_transaction.test.ts.snap
@@ -8,22 +8,35 @@ Object {
"filter": Array [
Object {
"term": Object {
- "service.name": "foo",
+ "processor.event": "transaction",
},
},
Object {
- "term": Object {
- "service.environment": "bar",
+ "terms": Object {
+ "service.name": Array [
+ "foo",
+ ],
},
},
Object {
- "term": Object {
- "transaction.type": "qux",
+ "terms": Object {
+ "service.environment": Array [
+ "bar",
+ ],
},
},
Object {
- "term": Object {
- "transaction.name": "baz",
+ "terms": Object {
+ "transaction.name": Array [
+ "baz",
+ ],
+ },
+ },
+ Object {
+ "terms": Object {
+ "transaction.type": Array [
+ "qux",
+ ],
},
},
],
@@ -37,21 +50,6 @@ Object {
`;
exports[`custom link get transaction fetches without filter 1`] = `
-Object {
- "body": Object {
- "query": Object {
- "bool": Object {
- "filter": Array [],
- },
- },
- },
- "index": "myIndex",
- "size": 1,
- "terminateAfter": 1,
-}
-`;
-
-exports[`custom link get transaction removes not listed filters from query 1`] = `
Object {
"body": Object {
"query": Object {
@@ -59,7 +57,7 @@ Object {
"filter": Array [
Object {
"term": Object {
- "service.name": "foo",
+ "processor.event": "transaction",
},
},
],
diff --git a/x-pack/plugins/apm/server/lib/settings/custom_link/__test__/__snapshots__/list_custom_links.test.ts.snap b/x-pack/plugins/apm/server/lib/settings/custom_link/__snapshots__/list_custom_links.test.ts.snap
similarity index 100%
rename from x-pack/plugins/apm/server/lib/settings/custom_link/__test__/__snapshots__/list_custom_links.test.ts.snap
rename to x-pack/plugins/apm/server/lib/settings/custom_link/__snapshots__/list_custom_links.test.ts.snap
diff --git a/x-pack/plugins/apm/server/lib/settings/custom_link/__test__/create_or_update_custom_link.test.ts b/x-pack/plugins/apm/server/lib/settings/custom_link/create_or_update_custom_link.test.ts
similarity index 72%
rename from x-pack/plugins/apm/server/lib/settings/custom_link/__test__/create_or_update_custom_link.test.ts
rename to x-pack/plugins/apm/server/lib/settings/custom_link/create_or_update_custom_link.test.ts
index 624f01c649322..9bd6c78797605 100644
--- a/x-pack/plugins/apm/server/lib/settings/custom_link/__test__/create_or_update_custom_link.test.ts
+++ b/x-pack/plugins/apm/server/lib/settings/custom_link/create_or_update_custom_link.test.ts
@@ -4,10 +4,10 @@
* you may not use this file except in compliance with the Elastic License.
*/
-import { createOrUpdateCustomLink } from '../create_or_update_custom_link';
-import { CustomLink } from '../custom_link_types';
-import { Setup } from '../../../helpers/setup_request';
-import { mockNow } from '../../../../../../../legacy/plugins/apm/public/utils/testHelpers';
+import { Setup } from '../../helpers/setup_request';
+import { mockNow } from '../../../../../../legacy/plugins/apm/public/utils/testHelpers';
+import { CustomLink } from '../../../../common/custom_link/custom_link_types';
+import { createOrUpdateCustomLink } from './create_or_update_custom_link';
describe('Create or Update Custom link', () => {
const internalClientIndexMock = jest.fn();
@@ -23,8 +23,10 @@ describe('Create or Update Custom link', () => {
const customLink = ({
label: 'foo',
url: 'http://elastic.com/{{trace.id}}',
- 'service.name': 'opbeans-java',
- 'transaction.type': 'Request'
+ filters: [
+ { key: 'service.name', value: 'opbeans-java' },
+ { key: 'transaction.type', value: 'Request' }
+ ]
} as unknown) as CustomLink;
afterEach(() => {
internalClientIndexMock.mockClear();
@@ -43,8 +45,8 @@ describe('Create or Update Custom link', () => {
'@timestamp': 1570737000000,
label: 'foo',
url: 'http://elastic.com/{{trace.id}}',
- 'service.name': 'opbeans-java',
- 'transaction.type': 'Request'
+ 'service.name': ['opbeans-java'],
+ 'transaction.type': ['Request']
}
});
});
@@ -62,8 +64,8 @@ describe('Create or Update Custom link', () => {
'@timestamp': 1570737000000,
label: 'foo',
url: 'http://elastic.com/{{trace.id}}',
- 'service.name': 'opbeans-java',
- 'transaction.type': 'Request'
+ 'service.name': ['opbeans-java'],
+ 'transaction.type': ['Request']
}
});
});
diff --git a/x-pack/plugins/apm/server/lib/settings/custom_link/create_or_update_custom_link.ts b/x-pack/plugins/apm/server/lib/settings/custom_link/create_or_update_custom_link.ts
index 5dce371e4f307..d24fd9988997a 100644
--- a/x-pack/plugins/apm/server/lib/settings/custom_link/create_or_update_custom_link.ts
+++ b/x-pack/plugins/apm/server/lib/settings/custom_link/create_or_update_custom_link.ts
@@ -4,11 +4,13 @@
* you may not use this file except in compliance with the Elastic License.
*/
-import { pick } from 'lodash';
-import { FILTER_OPTIONS } from '../../../../common/custom_link_filter_options';
+import {
+ CustomLink,
+ CustomLinkES
+} from '../../../../common/custom_link/custom_link_types';
import { APMIndexDocumentParams } from '../../helpers/es_client';
import { Setup } from '../../helpers/setup_request';
-import { CustomLink } from './custom_link_types';
+import { toESFormat } from './helper';
export async function createOrUpdateCustomLink({
customLinkId,
@@ -21,14 +23,12 @@ export async function createOrUpdateCustomLink({
}) {
const { internalClient, indices } = setup;
- const params: APMIndexDocumentParams = {
+ const params: APMIndexDocumentParams = {
refresh: true,
index: indices.apmCustomLinkIndex,
body: {
'@timestamp': Date.now(),
- label: customLink.label,
- url: customLink.url,
- ...pick(customLink, FILTER_OPTIONS)
+ ...toESFormat(customLink)
}
};
diff --git a/x-pack/plugins/apm/server/lib/settings/custom_link/custom_link_types.ts b/x-pack/plugins/apm/server/lib/settings/custom_link/custom_link_types.ts
new file mode 100644
index 0000000000000..f35a72ff840f9
--- /dev/null
+++ b/x-pack/plugins/apm/server/lib/settings/custom_link/custom_link_types.ts
@@ -0,0 +1,46 @@
+/*
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
+ * or more contributor license agreements. Licensed under the Elastic License;
+ * you may not use this file except in compliance with the Elastic License.
+ */
+import * as t from 'io-ts';
+import {
+ SERVICE_NAME,
+ SERVICE_ENVIRONMENT,
+ TRANSACTION_NAME,
+ TRANSACTION_TYPE
+} from '../../../../common/elasticsearch_fieldnames';
+
+export interface CustomLinkES {
+ id?: string;
+ '@timestamp'?: number;
+ label: string;
+ url: string;
+ [SERVICE_NAME]?: string[];
+ [SERVICE_ENVIRONMENT]?: string[];
+ [TRANSACTION_NAME]?: string[];
+ [TRANSACTION_TYPE]?: string[];
+}
+
+export const filterOptionsRt = t.partial({
+ [SERVICE_NAME]: t.string,
+ [SERVICE_ENVIRONMENT]: t.string,
+ [TRANSACTION_NAME]: t.string,
+ [TRANSACTION_TYPE]: t.string
+});
+
+export const payloadRt = t.intersection([
+ t.type({
+ label: t.string,
+ url: t.string
+ }),
+ t.partial({
+ id: t.string,
+ filters: t.array(
+ t.type({
+ key: t.string,
+ value: t.string
+ })
+ )
+ })
+]);
diff --git a/x-pack/plugins/apm/server/lib/settings/custom_link/__test__/get_transaction.test.ts b/x-pack/plugins/apm/server/lib/settings/custom_link/get_transaction.test.ts
similarity index 64%
rename from x-pack/plugins/apm/server/lib/settings/custom_link/__test__/get_transaction.test.ts
rename to x-pack/plugins/apm/server/lib/settings/custom_link/get_transaction.test.ts
index 4fc22298a476c..514e473b8e78c 100644
--- a/x-pack/plugins/apm/server/lib/settings/custom_link/__test__/get_transaction.test.ts
+++ b/x-pack/plugins/apm/server/lib/settings/custom_link/get_transaction.test.ts
@@ -6,29 +6,18 @@
import {
inspectSearchParams,
SearchParamsMock
-} from '../../../../../../../legacy/plugins/apm/public/utils/testHelpers';
-import { getTransaction } from '../get_transaction';
-import { Setup } from '../../../helpers/setup_request';
+} from '../../../../../../legacy/plugins/apm/public/utils/testHelpers';
+import { getTransaction } from './get_transaction';
+import { Setup } from '../../helpers/setup_request';
import {
SERVICE_NAME,
TRANSACTION_TYPE,
SERVICE_ENVIRONMENT,
TRANSACTION_NAME
-} from '../../../../../common/elasticsearch_fieldnames';
+} from '../../../../common/elasticsearch_fieldnames';
describe('custom link get transaction', () => {
let mock: SearchParamsMock;
- it('removes not listed filters from query', async () => {
- mock = await inspectSearchParams(setup =>
- getTransaction({
- setup: (setup as unknown) as Setup,
- // @ts-ignore ignoring the _debug is not part of filter options
- filters: { _debug: true, [SERVICE_NAME]: 'foo' }
- })
- );
-
- expect(mock.params).toMatchSnapshot();
- });
it('fetches without filter', async () => {
mock = await inspectSearchParams(setup =>
getTransaction({
diff --git a/x-pack/plugins/apm/server/lib/settings/custom_link/get_transaction.ts b/x-pack/plugins/apm/server/lib/settings/custom_link/get_transaction.ts
index 396a7cb29f014..4310349318783 100644
--- a/x-pack/plugins/apm/server/lib/settings/custom_link/get_transaction.ts
+++ b/x-pack/plugins/apm/server/lib/settings/custom_link/get_transaction.ts
@@ -3,35 +3,47 @@
* or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with the Elastic License.
*/
-
-import { pick } from 'lodash';
-import {
- FilterOptions,
- FILTER_OPTIONS
-} from '../../../../common/custom_link_filter_options';
+import * as t from 'io-ts';
+import { PROCESSOR_EVENT } from '../../../../common/elasticsearch_fieldnames';
import { Transaction } from '../../../../typings/es_schemas/ui/transaction';
import { Setup } from '../../helpers/setup_request';
+import { ProcessorEvent } from '../../../../common/processor_event';
+import { filterOptionsRt } from './custom_link_types';
+import { splitFilterValueByComma } from './helper';
export async function getTransaction({
setup,
filters = {}
}: {
setup: Setup;
- filters?: FilterOptions;
+ filters?: t.TypeOf;
}) {
const { client, indices } = setup;
- const esFilters = Object.entries(pick(filters, FILTER_OPTIONS)).map(
- ([key, value]) => {
- return { term: { [key]: value } };
- }
- );
+ const esFilters = Object.entries(filters)
+ // loops through the filters splitting the value by comma and removing white spaces
+ .map(([key, value]) => {
+ if (value) {
+ return { terms: { [key]: splitFilterValueByComma(value) } };
+ }
+ })
+ // removes filters without value
+ .filter(value => value);
const params = {
terminateAfter: 1,
index: indices['apm_oss.transactionIndices'],
size: 1,
- body: { query: { bool: { filter: esFilters } } }
+ body: {
+ query: {
+ bool: {
+ filter: [
+ { term: { [PROCESSOR_EVENT]: ProcessorEvent.transaction } },
+ ...esFilters
+ ]
+ }
+ }
+ }
};
const resp = await client.search(params);
return resp.hits.hits[0]?._source;
diff --git a/x-pack/plugins/apm/server/lib/settings/custom_link/helper.test.ts b/x-pack/plugins/apm/server/lib/settings/custom_link/helper.test.ts
new file mode 100644
index 0000000000000..6ebf02fcc72d1
--- /dev/null
+++ b/x-pack/plugins/apm/server/lib/settings/custom_link/helper.test.ts
@@ -0,0 +1,137 @@
+/*
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
+ * or more contributor license agreements. Licensed under the Elastic License;
+ * you may not use this file except in compliance with the Elastic License.
+ */
+import { fromESFormat, splitFilterValueByComma, toESFormat } from './helper';
+
+describe('Custom link API helper', () => {
+ describe('splitFilterValueByComma', () => {
+ it('returns empty string when any value is provided', () => {
+ expect(splitFilterValueByComma('')).toEqual([]);
+ });
+ it('removes white spaces', () => {
+ expect(splitFilterValueByComma('foo, bar, ')).toEqual(['foo', 'bar']);
+ expect(splitFilterValueByComma('foo , bar , baz, ')).toEqual([
+ 'foo',
+ 'bar',
+ 'baz'
+ ]);
+ });
+ it('doesnt slipt when comma is not found', () => {
+ expect(splitFilterValueByComma('foo bar')).toEqual(['foo bar']);
+ });
+ it('doesnt slipt with dot', () => {
+ expect(splitFilterValueByComma('foo.bar. baz')).toEqual(['foo.bar. baz']);
+ });
+ });
+
+ describe('fromESFormat', () => {
+ it('converts without filters', () => {
+ expect(
+ fromESFormat({
+ id: '123',
+ '@timestamp': 455,
+ label: 'foo',
+ url: 'bar'
+ })
+ ).toEqual({
+ id: '123',
+ '@timestamp': 455,
+ label: 'foo',
+ url: 'bar',
+ filters: []
+ });
+ });
+ it('converts with filters', () => {
+ expect(
+ fromESFormat({
+ id: '123',
+ '@timestamp': 455,
+ label: 'foo',
+ url: 'bar',
+ 'service.name': ['baz'],
+ 'transaction.name': ['quz', 'qux', 'quux']
+ })
+ ).toEqual({
+ id: '123',
+ '@timestamp': 455,
+ label: 'foo',
+ url: 'bar',
+ filters: [
+ { key: 'service.name', value: 'baz' },
+ { key: 'transaction.name', value: 'quz,qux,quux' }
+ ]
+ });
+ });
+ it('returns empty string when any filter value is provided', () => {
+ expect(
+ fromESFormat({
+ id: '123',
+ '@timestamp': 455,
+ label: 'foo',
+ url: 'bar',
+ 'service.name': [],
+ 'transaction.name': ['quz', 'qux', 'quux']
+ })
+ ).toEqual({
+ id: '123',
+ '@timestamp': 455,
+ label: 'foo',
+ url: 'bar',
+ filters: [
+ { key: 'service.name', value: '' },
+ { key: 'transaction.name', value: 'quz,qux,quux' }
+ ]
+ });
+ });
+ });
+
+ describe('toESFormat', () => {
+ it('converts without filters', () => {
+ expect(
+ toESFormat({
+ label: 'foo',
+ url: 'bar'
+ })
+ ).toEqual({
+ label: 'foo',
+ url: 'bar'
+ });
+ });
+ it('converts with filters', () => {
+ expect(
+ toESFormat({
+ label: 'foo',
+ url: 'bar',
+ filters: [
+ { key: 'service.name', value: 'baz' },
+ { key: 'transaction.name', value: 'quz,qux,quux' }
+ ]
+ })
+ ).toEqual({
+ label: 'foo',
+ url: 'bar',
+ 'service.name': ['baz'],
+ 'transaction.name': ['quz', 'qux', 'quux']
+ });
+ });
+ it('removes filters without key or value', () => {
+ expect(
+ toESFormat({
+ label: 'foo',
+ url: 'bar',
+ filters: [
+ { key: '', value: 'baz' },
+ { key: 'service.name', value: '' },
+ { key: 'transaction.name', value: 'quz,qux,quux' }
+ ]
+ })
+ ).toEqual({
+ label: 'foo',
+ url: 'bar',
+ 'transaction.name': ['quz', 'qux', 'quux']
+ });
+ });
+ });
+});
diff --git a/x-pack/plugins/apm/server/lib/settings/custom_link/helper.ts b/x-pack/plugins/apm/server/lib/settings/custom_link/helper.ts
new file mode 100644
index 0000000000000..cfdbbdc21b43b
--- /dev/null
+++ b/x-pack/plugins/apm/server/lib/settings/custom_link/helper.ts
@@ -0,0 +1,46 @@
+/*
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
+ * or more contributor license agreements. Licensed under the Elastic License;
+ * you may not use this file except in compliance with the Elastic License.
+ */
+import { isEmpty } from 'lodash';
+import {
+ CustomLinkES,
+ CustomLink,
+ Filter,
+ FilterKey
+} from '../../../../common/custom_link/custom_link_types';
+
+export function fromESFormat(customLinkES: CustomLinkES): CustomLink {
+ const { id, label, url, '@timestamp': timestamp, ...filters } = customLinkES;
+ return {
+ id,
+ '@timestamp': timestamp,
+ label,
+ url,
+ filters: Object.entries(filters).map(
+ ([key, value]: [string, string[]]) => ({
+ key: key as FilterKey,
+ value: isEmpty(value) ? '' : value.join()
+ })
+ )
+ };
+}
+
+export function toESFormat(customLink: CustomLink): CustomLinkES {
+ const { label, url, filters = [] } = customLink;
+ const ESFilters = filters
+ .filter(({ key, value }) => key && value)
+ .reduce((acc: Record, { key, value }) => {
+ acc[key] = splitFilterValueByComma(value);
+ return acc;
+ }, {});
+ return { label, url, ...ESFilters };
+}
+
+export function splitFilterValueByComma(filterValue: Filter['value']) {
+ return filterValue
+ .split(',')
+ .map(v => v.trim())
+ .filter(v => v);
+}
diff --git a/x-pack/plugins/apm/server/lib/settings/custom_link/__test__/list_custom_links.test.ts b/x-pack/plugins/apm/server/lib/settings/custom_link/list_custom_links.test.ts
similarity index 79%
rename from x-pack/plugins/apm/server/lib/settings/custom_link/__test__/list_custom_links.test.ts
rename to x-pack/plugins/apm/server/lib/settings/custom_link/list_custom_links.test.ts
index 5466225dc3211..45610e36786b7 100644
--- a/x-pack/plugins/apm/server/lib/settings/custom_link/__test__/list_custom_links.test.ts
+++ b/x-pack/plugins/apm/server/lib/settings/custom_link/list_custom_links.test.ts
@@ -4,16 +4,16 @@
* you may not use this file except in compliance with the Elastic License.
*/
-import { listCustomLinks } from '../list_custom_links';
+import { listCustomLinks } from './list_custom_links';
import {
inspectSearchParams,
SearchParamsMock
-} from '../../../../../../../legacy/plugins/apm/public/utils/testHelpers';
-import { Setup } from '../../../helpers/setup_request';
+} from '../../../../../../legacy/plugins/apm/public/utils/testHelpers';
+import { Setup } from '../../helpers/setup_request';
import {
SERVICE_NAME,
TRANSACTION_NAME
-} from '../../../../../common/elasticsearch_fieldnames';
+} from '../../../../common/elasticsearch_fieldnames';
describe('List Custom Links', () => {
let mock: SearchParamsMock;
diff --git a/x-pack/plugins/apm/server/lib/settings/custom_link/list_custom_links.ts b/x-pack/plugins/apm/server/lib/settings/custom_link/list_custom_links.ts
index 67956ef3a60ce..bae313c8b6eef 100644
--- a/x-pack/plugins/apm/server/lib/settings/custom_link/list_custom_links.ts
+++ b/x-pack/plugins/apm/server/lib/settings/custom_link/list_custom_links.ts
@@ -3,20 +3,23 @@
* or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with the Elastic License.
*/
-
-import { FilterOptions } from '../../../../common/custom_link_filter_options';
+import * as t from 'io-ts';
+import {
+ CustomLink,
+ CustomLinkES
+} from '../../../../common/custom_link/custom_link_types';
import { Setup } from '../../helpers/setup_request';
-import { CustomLink } from './custom_link_types';
+import { fromESFormat } from './helper';
+import { filterOptionsRt } from './custom_link_types';
export async function listCustomLinks({
setup,
filters = {}
}: {
setup: Setup;
- filters?: FilterOptions;
-}) {
+ filters?: t.TypeOf;
+}): Promise {
const { internalClient, indices } = setup;
-
const esFilters = Object.entries(filters).map(([key, value]) => {
return {
bool: {
@@ -47,9 +50,12 @@ export async function listCustomLinks({
]
}
};
- const resp = await internalClient.search(params);
- return resp.hits.hits.map(item => ({
- id: item._id,
- ...item._source
- }));
+ const resp = await internalClient.search(params);
+ const customLinks = resp.hits.hits.map(item =>
+ fromESFormat({
+ id: item._id,
+ ...item._source
+ })
+ );
+ return customLinks;
}
diff --git a/x-pack/plugins/apm/server/routes/settings/custom_link.ts b/x-pack/plugins/apm/server/routes/settings/custom_link.ts
index e11c1df9d4b16..428b96ad3982d 100644
--- a/x-pack/plugins/apm/server/routes/settings/custom_link.ts
+++ b/x-pack/plugins/apm/server/routes/settings/custom_link.ts
@@ -4,51 +4,52 @@
* you may not use this file except in compliance with the Elastic License.
*/
import * as t from 'io-ts';
-import { FilterOptionsRt } from '../../../common/custom_link_filter_options';
-import { createRoute } from '../create_route';
+import { pick } from 'lodash';
+import { FILTER_OPTIONS } from '../../../common/custom_link/custom_link_filter_options';
import { setupRequest } from '../../lib/helpers/setup_request';
import { createOrUpdateCustomLink } from '../../lib/settings/custom_link/create_or_update_custom_link';
+import {
+ filterOptionsRt,
+ payloadRt
+} from '../../lib/settings/custom_link/custom_link_types';
import { deleteCustomLink } from '../../lib/settings/custom_link/delete_custom_link';
-import { listCustomLinks } from '../../lib/settings/custom_link/list_custom_links';
import { getTransaction } from '../../lib/settings/custom_link/get_transaction';
+import { listCustomLinks } from '../../lib/settings/custom_link/list_custom_links';
+import { createRoute } from '../create_route';
export const customLinkTransactionRoute = createRoute(core => ({
path: '/api/apm/settings/custom_links/transaction',
params: {
- query: FilterOptionsRt
+ query: filterOptionsRt
},
handler: async ({ context, request }) => {
const setup = await setupRequest(context, request);
- const { params } = context;
- return await getTransaction({ setup, filters: params.query });
+ const { query } = context.params;
+ // picks only the items listed in FILTER_OPTIONS
+ const filters = pick(query, FILTER_OPTIONS);
+ return await getTransaction({ setup, filters });
}
}));
export const listCustomLinksRoute = createRoute(core => ({
path: '/api/apm/settings/custom_links',
params: {
- query: FilterOptionsRt
+ query: filterOptionsRt
},
handler: async ({ context, request }) => {
const setup = await setupRequest(context, request);
- const { params } = context;
- return await listCustomLinks({ setup, filters: params.query });
+ const { query } = context.params;
+ // picks only the items listed in FILTER_OPTIONS
+ const filters = pick(query, FILTER_OPTIONS);
+ return await listCustomLinks({ setup, filters });
}
}));
-const payload = t.intersection([
- t.type({
- label: t.string,
- url: t.string
- }),
- FilterOptionsRt
-]);
-
export const createCustomLinkRoute = createRoute(() => ({
method: 'POST',
path: '/api/apm/settings/custom_links',
params: {
- body: payload
+ body: payloadRt
},
options: {
tags: ['access:apm', 'access:apm_write']
@@ -68,7 +69,7 @@ export const updateCustomLinkRoute = createRoute(() => ({
path: t.type({
id: t.string
}),
- body: payload
+ body: payloadRt
},
options: {
tags: ['access:apm', 'access:apm_write']
diff --git a/x-pack/plugins/console_extensions/server/lib/spec_definitions/js/index.ts b/x-pack/plugins/console_extensions/server/lib/spec_definitions/js/index.ts
new file mode 100644
index 0000000000000..bc9fbec194d0c
--- /dev/null
+++ b/x-pack/plugins/console_extensions/server/lib/spec_definitions/js/index.ts
@@ -0,0 +1,7 @@
+/*
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
+ * or more contributor license agreements. Licensed under the Elastic License;
+ * you may not use this file except in compliance with the Elastic License.
+ */
+
+export { processors } from './ingest';
diff --git a/x-pack/plugins/console_extensions/server/spec/ingest/index.ts b/x-pack/plugins/console_extensions/server/lib/spec_definitions/js/ingest.ts
similarity index 100%
rename from x-pack/plugins/console_extensions/server/spec/ingest/index.ts
rename to x-pack/plugins/console_extensions/server/lib/spec_definitions/js/ingest.ts
diff --git a/x-pack/plugins/console_extensions/server/spec/generated/async_search.delete.json b/x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/async_search.delete.json
similarity index 100%
rename from x-pack/plugins/console_extensions/server/spec/generated/async_search.delete.json
rename to x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/async_search.delete.json
diff --git a/x-pack/plugins/console_extensions/server/spec/generated/async_search.get.json b/x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/async_search.get.json
similarity index 100%
rename from x-pack/plugins/console_extensions/server/spec/generated/async_search.get.json
rename to x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/async_search.get.json
diff --git a/x-pack/plugins/console_extensions/server/spec/generated/async_search.submit.json b/x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/async_search.submit.json
similarity index 100%
rename from x-pack/plugins/console_extensions/server/spec/generated/async_search.submit.json
rename to x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/async_search.submit.json
diff --git a/x-pack/plugins/console_extensions/server/spec/generated/autoscaling.get_autoscaling_decision.json b/x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/autoscaling.get_autoscaling_decision.json
similarity index 100%
rename from x-pack/plugins/console_extensions/server/spec/generated/autoscaling.get_autoscaling_decision.json
rename to x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/autoscaling.get_autoscaling_decision.json
diff --git a/x-pack/plugins/console_extensions/server/spec/generated/cat.ml_data_frame_analytics.json b/x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/cat.ml_data_frame_analytics.json
similarity index 100%
rename from x-pack/plugins/console_extensions/server/spec/generated/cat.ml_data_frame_analytics.json
rename to x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/cat.ml_data_frame_analytics.json
diff --git a/x-pack/plugins/console_extensions/server/spec/generated/cat.ml_datafeeds.json b/x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/cat.ml_datafeeds.json
similarity index 100%
rename from x-pack/plugins/console_extensions/server/spec/generated/cat.ml_datafeeds.json
rename to x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/cat.ml_datafeeds.json
diff --git a/x-pack/plugins/console_extensions/server/spec/generated/cat.ml_jobs.json b/x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/cat.ml_jobs.json
similarity index 100%
rename from x-pack/plugins/console_extensions/server/spec/generated/cat.ml_jobs.json
rename to x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/cat.ml_jobs.json
diff --git a/x-pack/plugins/console_extensions/server/spec/generated/cat.ml_trained_models.json b/x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/cat.ml_trained_models.json
similarity index 100%
rename from x-pack/plugins/console_extensions/server/spec/generated/cat.ml_trained_models.json
rename to x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/cat.ml_trained_models.json
diff --git a/x-pack/plugins/console_extensions/server/spec/generated/ccr.delete_auto_follow_pattern.json b/x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/ccr.delete_auto_follow_pattern.json
similarity index 100%
rename from x-pack/plugins/console_extensions/server/spec/generated/ccr.delete_auto_follow_pattern.json
rename to x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/ccr.delete_auto_follow_pattern.json
diff --git a/x-pack/plugins/console_extensions/server/spec/generated/ccr.follow.json b/x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/ccr.follow.json
similarity index 100%
rename from x-pack/plugins/console_extensions/server/spec/generated/ccr.follow.json
rename to x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/ccr.follow.json
diff --git a/x-pack/plugins/console_extensions/server/spec/generated/ccr.follow_info.json b/x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/ccr.follow_info.json
similarity index 100%
rename from x-pack/plugins/console_extensions/server/spec/generated/ccr.follow_info.json
rename to x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/ccr.follow_info.json
diff --git a/x-pack/plugins/console_extensions/server/spec/generated/ccr.follow_stats.json b/x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/ccr.follow_stats.json
similarity index 100%
rename from x-pack/plugins/console_extensions/server/spec/generated/ccr.follow_stats.json
rename to x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/ccr.follow_stats.json
diff --git a/x-pack/plugins/console_extensions/server/spec/generated/ccr.forget_follower.json b/x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/ccr.forget_follower.json
similarity index 100%
rename from x-pack/plugins/console_extensions/server/spec/generated/ccr.forget_follower.json
rename to x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/ccr.forget_follower.json
diff --git a/x-pack/plugins/console_extensions/server/spec/generated/ccr.get_auto_follow_pattern.json b/x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/ccr.get_auto_follow_pattern.json
similarity index 100%
rename from x-pack/plugins/console_extensions/server/spec/generated/ccr.get_auto_follow_pattern.json
rename to x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/ccr.get_auto_follow_pattern.json
diff --git a/x-pack/plugins/console_extensions/server/spec/generated/ccr.pause_auto_follow_pattern.json b/x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/ccr.pause_auto_follow_pattern.json
similarity index 100%
rename from x-pack/plugins/console_extensions/server/spec/generated/ccr.pause_auto_follow_pattern.json
rename to x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/ccr.pause_auto_follow_pattern.json
diff --git a/x-pack/plugins/console_extensions/server/spec/generated/ccr.pause_follow.json b/x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/ccr.pause_follow.json
similarity index 100%
rename from x-pack/plugins/console_extensions/server/spec/generated/ccr.pause_follow.json
rename to x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/ccr.pause_follow.json
diff --git a/x-pack/plugins/console_extensions/server/spec/generated/ccr.put_auto_follow_pattern.json b/x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/ccr.put_auto_follow_pattern.json
similarity index 100%
rename from x-pack/plugins/console_extensions/server/spec/generated/ccr.put_auto_follow_pattern.json
rename to x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/ccr.put_auto_follow_pattern.json
diff --git a/x-pack/plugins/console_extensions/server/spec/generated/ccr.resume_auto_follow_pattern.json b/x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/ccr.resume_auto_follow_pattern.json
similarity index 100%
rename from x-pack/plugins/console_extensions/server/spec/generated/ccr.resume_auto_follow_pattern.json
rename to x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/ccr.resume_auto_follow_pattern.json
diff --git a/x-pack/plugins/console_extensions/server/spec/generated/ccr.resume_follow.json b/x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/ccr.resume_follow.json
similarity index 100%
rename from x-pack/plugins/console_extensions/server/spec/generated/ccr.resume_follow.json
rename to x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/ccr.resume_follow.json
diff --git a/x-pack/plugins/console_extensions/server/spec/generated/ccr.stats.json b/x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/ccr.stats.json
similarity index 100%
rename from x-pack/plugins/console_extensions/server/spec/generated/ccr.stats.json
rename to x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/ccr.stats.json
diff --git a/x-pack/plugins/console_extensions/server/spec/generated/ccr.unfollow.json b/x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/ccr.unfollow.json
similarity index 100%
rename from x-pack/plugins/console_extensions/server/spec/generated/ccr.unfollow.json
rename to x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/ccr.unfollow.json
diff --git a/x-pack/plugins/console_extensions/server/spec/generated/enrich.delete_policy.json b/x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/enrich.delete_policy.json
similarity index 100%
rename from x-pack/plugins/console_extensions/server/spec/generated/enrich.delete_policy.json
rename to x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/enrich.delete_policy.json
diff --git a/x-pack/plugins/console_extensions/server/spec/generated/enrich.execute_policy.json b/x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/enrich.execute_policy.json
similarity index 100%
rename from x-pack/plugins/console_extensions/server/spec/generated/enrich.execute_policy.json
rename to x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/enrich.execute_policy.json
diff --git a/x-pack/plugins/console_extensions/server/spec/generated/enrich.get_policy.json b/x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/enrich.get_policy.json
similarity index 100%
rename from x-pack/plugins/console_extensions/server/spec/generated/enrich.get_policy.json
rename to x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/enrich.get_policy.json
diff --git a/x-pack/plugins/console_extensions/server/spec/generated/enrich.put_policy.json b/x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/enrich.put_policy.json
similarity index 100%
rename from x-pack/plugins/console_extensions/server/spec/generated/enrich.put_policy.json
rename to x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/enrich.put_policy.json
diff --git a/x-pack/plugins/console_extensions/server/spec/generated/enrich.stats.json b/x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/enrich.stats.json
similarity index 100%
rename from x-pack/plugins/console_extensions/server/spec/generated/enrich.stats.json
rename to x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/enrich.stats.json
diff --git a/x-pack/plugins/console_extensions/server/spec/generated/graph.explore.json b/x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/graph.explore.json
similarity index 100%
rename from x-pack/plugins/console_extensions/server/spec/generated/graph.explore.json
rename to x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/graph.explore.json
diff --git a/x-pack/plugins/console_extensions/server/spec/generated/ilm.delete_lifecycle.json b/x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/ilm.delete_lifecycle.json
similarity index 100%
rename from x-pack/plugins/console_extensions/server/spec/generated/ilm.delete_lifecycle.json
rename to x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/ilm.delete_lifecycle.json
diff --git a/x-pack/plugins/console_extensions/server/spec/generated/ilm.explain_lifecycle.json b/x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/ilm.explain_lifecycle.json
similarity index 100%
rename from x-pack/plugins/console_extensions/server/spec/generated/ilm.explain_lifecycle.json
rename to x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/ilm.explain_lifecycle.json
diff --git a/x-pack/plugins/console_extensions/server/spec/generated/ilm.get_lifecycle.json b/x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/ilm.get_lifecycle.json
similarity index 100%
rename from x-pack/plugins/console_extensions/server/spec/generated/ilm.get_lifecycle.json
rename to x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/ilm.get_lifecycle.json
diff --git a/x-pack/plugins/console_extensions/server/spec/generated/ilm.get_status.json b/x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/ilm.get_status.json
similarity index 100%
rename from x-pack/plugins/console_extensions/server/spec/generated/ilm.get_status.json
rename to x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/ilm.get_status.json
diff --git a/x-pack/plugins/console_extensions/server/spec/generated/ilm.move_to_step.json b/x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/ilm.move_to_step.json
similarity index 100%
rename from x-pack/plugins/console_extensions/server/spec/generated/ilm.move_to_step.json
rename to x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/ilm.move_to_step.json
diff --git a/x-pack/plugins/console_extensions/server/spec/generated/ilm.put_lifecycle.json b/x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/ilm.put_lifecycle.json
similarity index 100%
rename from x-pack/plugins/console_extensions/server/spec/generated/ilm.put_lifecycle.json
rename to x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/ilm.put_lifecycle.json
diff --git a/x-pack/plugins/console_extensions/server/spec/generated/ilm.remove_policy.json b/x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/ilm.remove_policy.json
similarity index 100%
rename from x-pack/plugins/console_extensions/server/spec/generated/ilm.remove_policy.json
rename to x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/ilm.remove_policy.json
diff --git a/x-pack/plugins/console_extensions/server/spec/generated/ilm.retry.json b/x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/ilm.retry.json
similarity index 100%
rename from x-pack/plugins/console_extensions/server/spec/generated/ilm.retry.json
rename to x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/ilm.retry.json
diff --git a/x-pack/plugins/console_extensions/server/spec/generated/ilm.set_policy.json b/x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/ilm.set_policy.json
similarity index 100%
rename from x-pack/plugins/console_extensions/server/spec/generated/ilm.set_policy.json
rename to x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/ilm.set_policy.json
diff --git a/x-pack/plugins/console_extensions/server/spec/generated/ilm.start.json b/x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/ilm.start.json
similarity index 100%
rename from x-pack/plugins/console_extensions/server/spec/generated/ilm.start.json
rename to x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/ilm.start.json
diff --git a/x-pack/plugins/console_extensions/server/spec/generated/ilm.stop.json b/x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/ilm.stop.json
similarity index 100%
rename from x-pack/plugins/console_extensions/server/spec/generated/ilm.stop.json
rename to x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/ilm.stop.json
diff --git a/x-pack/plugins/console_extensions/server/spec/generated/indices.freeze.json b/x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/indices.freeze.json
similarity index 100%
rename from x-pack/plugins/console_extensions/server/spec/generated/indices.freeze.json
rename to x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/indices.freeze.json
diff --git a/x-pack/plugins/console_extensions/server/spec/generated/indices.reload_search_analyzers.json b/x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/indices.reload_search_analyzers.json
similarity index 100%
rename from x-pack/plugins/console_extensions/server/spec/generated/indices.reload_search_analyzers.json
rename to x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/indices.reload_search_analyzers.json
diff --git a/x-pack/plugins/console_extensions/server/spec/generated/indices.unfreeze.json b/x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/indices.unfreeze.json
similarity index 100%
rename from x-pack/plugins/console_extensions/server/spec/generated/indices.unfreeze.json
rename to x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/indices.unfreeze.json
diff --git a/x-pack/plugins/console_extensions/server/spec/generated/license.delete.json b/x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/license.delete.json
similarity index 100%
rename from x-pack/plugins/console_extensions/server/spec/generated/license.delete.json
rename to x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/license.delete.json
diff --git a/x-pack/plugins/console_extensions/server/spec/generated/license.get.json b/x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/license.get.json
similarity index 100%
rename from x-pack/plugins/console_extensions/server/spec/generated/license.get.json
rename to x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/license.get.json
diff --git a/x-pack/plugins/console_extensions/server/spec/generated/license.get_basic_status.json b/x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/license.get_basic_status.json
similarity index 100%
rename from x-pack/plugins/console_extensions/server/spec/generated/license.get_basic_status.json
rename to x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/license.get_basic_status.json
diff --git a/x-pack/plugins/console_extensions/server/spec/generated/license.get_trial_status.json b/x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/license.get_trial_status.json
similarity index 100%
rename from x-pack/plugins/console_extensions/server/spec/generated/license.get_trial_status.json
rename to x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/license.get_trial_status.json
diff --git a/x-pack/plugins/console_extensions/server/spec/generated/license.post.json b/x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/license.post.json
similarity index 100%
rename from x-pack/plugins/console_extensions/server/spec/generated/license.post.json
rename to x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/license.post.json
diff --git a/x-pack/plugins/console_extensions/server/spec/generated/license.post_start_basic.json b/x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/license.post_start_basic.json
similarity index 100%
rename from x-pack/plugins/console_extensions/server/spec/generated/license.post_start_basic.json
rename to x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/license.post_start_basic.json
diff --git a/x-pack/plugins/console_extensions/server/spec/generated/license.post_start_trial.json b/x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/license.post_start_trial.json
similarity index 100%
rename from x-pack/plugins/console_extensions/server/spec/generated/license.post_start_trial.json
rename to x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/license.post_start_trial.json
diff --git a/x-pack/plugins/console_extensions/server/spec/generated/migration.deprecations.json b/x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/migration.deprecations.json
similarity index 100%
rename from x-pack/plugins/console_extensions/server/spec/generated/migration.deprecations.json
rename to x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/migration.deprecations.json
diff --git a/x-pack/plugins/console_extensions/server/spec/generated/migration.get_assistance.json b/x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/migration.get_assistance.json
similarity index 100%
rename from x-pack/plugins/console_extensions/server/spec/generated/migration.get_assistance.json
rename to x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/migration.get_assistance.json
diff --git a/x-pack/plugins/console_extensions/server/spec/generated/migration.upgrade.json b/x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/migration.upgrade.json
similarity index 100%
rename from x-pack/plugins/console_extensions/server/spec/generated/migration.upgrade.json
rename to x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/migration.upgrade.json
diff --git a/x-pack/plugins/console_extensions/server/spec/generated/ml.close_job.json b/x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/ml.close_job.json
similarity index 100%
rename from x-pack/plugins/console_extensions/server/spec/generated/ml.close_job.json
rename to x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/ml.close_job.json
diff --git a/x-pack/plugins/console_extensions/server/spec/generated/ml.delete_calendar.json b/x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/ml.delete_calendar.json
similarity index 100%
rename from x-pack/plugins/console_extensions/server/spec/generated/ml.delete_calendar.json
rename to x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/ml.delete_calendar.json
diff --git a/x-pack/plugins/console_extensions/server/spec/generated/ml.delete_calendar_event.json b/x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/ml.delete_calendar_event.json
similarity index 100%
rename from x-pack/plugins/console_extensions/server/spec/generated/ml.delete_calendar_event.json
rename to x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/ml.delete_calendar_event.json
diff --git a/x-pack/plugins/console_extensions/server/spec/generated/ml.delete_calendar_job.json b/x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/ml.delete_calendar_job.json
similarity index 100%
rename from x-pack/plugins/console_extensions/server/spec/generated/ml.delete_calendar_job.json
rename to x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/ml.delete_calendar_job.json
diff --git a/x-pack/plugins/console_extensions/server/spec/generated/ml.delete_data_frame_analytics.json b/x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/ml.delete_data_frame_analytics.json
similarity index 100%
rename from x-pack/plugins/console_extensions/server/spec/generated/ml.delete_data_frame_analytics.json
rename to x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/ml.delete_data_frame_analytics.json
diff --git a/x-pack/plugins/console_extensions/server/spec/generated/ml.delete_datafeed.json b/x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/ml.delete_datafeed.json
similarity index 100%
rename from x-pack/plugins/console_extensions/server/spec/generated/ml.delete_datafeed.json
rename to x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/ml.delete_datafeed.json
diff --git a/x-pack/plugins/console_extensions/server/spec/generated/ml.delete_expired_data.json b/x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/ml.delete_expired_data.json
similarity index 100%
rename from x-pack/plugins/console_extensions/server/spec/generated/ml.delete_expired_data.json
rename to x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/ml.delete_expired_data.json
diff --git a/x-pack/plugins/console_extensions/server/spec/generated/ml.delete_filter.json b/x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/ml.delete_filter.json
similarity index 100%
rename from x-pack/plugins/console_extensions/server/spec/generated/ml.delete_filter.json
rename to x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/ml.delete_filter.json
diff --git a/x-pack/plugins/console_extensions/server/spec/generated/ml.delete_forecast.json b/x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/ml.delete_forecast.json
similarity index 100%
rename from x-pack/plugins/console_extensions/server/spec/generated/ml.delete_forecast.json
rename to x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/ml.delete_forecast.json
diff --git a/x-pack/plugins/console_extensions/server/spec/generated/ml.delete_job.json b/x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/ml.delete_job.json
similarity index 100%
rename from x-pack/plugins/console_extensions/server/spec/generated/ml.delete_job.json
rename to x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/ml.delete_job.json
diff --git a/x-pack/plugins/console_extensions/server/spec/generated/ml.delete_model_snapshot.json b/x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/ml.delete_model_snapshot.json
similarity index 100%
rename from x-pack/plugins/console_extensions/server/spec/generated/ml.delete_model_snapshot.json
rename to x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/ml.delete_model_snapshot.json
diff --git a/x-pack/plugins/console_extensions/server/spec/generated/ml.delete_trained_model.json b/x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/ml.delete_trained_model.json
similarity index 100%
rename from x-pack/plugins/console_extensions/server/spec/generated/ml.delete_trained_model.json
rename to x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/ml.delete_trained_model.json
diff --git a/x-pack/plugins/console_extensions/server/spec/generated/ml.evaluate_data_frame.json b/x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/ml.evaluate_data_frame.json
similarity index 100%
rename from x-pack/plugins/console_extensions/server/spec/generated/ml.evaluate_data_frame.json
rename to x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/ml.evaluate_data_frame.json
diff --git a/x-pack/plugins/console_extensions/server/spec/generated/ml.explain_data_frame_analytics.json b/x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/ml.explain_data_frame_analytics.json
similarity index 100%
rename from x-pack/plugins/console_extensions/server/spec/generated/ml.explain_data_frame_analytics.json
rename to x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/ml.explain_data_frame_analytics.json
diff --git a/x-pack/plugins/console_extensions/server/spec/generated/ml.find_file_structure.json b/x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/ml.find_file_structure.json
similarity index 100%
rename from x-pack/plugins/console_extensions/server/spec/generated/ml.find_file_structure.json
rename to x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/ml.find_file_structure.json
diff --git a/x-pack/plugins/console_extensions/server/spec/generated/ml.flush_job.json b/x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/ml.flush_job.json
similarity index 100%
rename from x-pack/plugins/console_extensions/server/spec/generated/ml.flush_job.json
rename to x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/ml.flush_job.json
diff --git a/x-pack/plugins/console_extensions/server/spec/generated/ml.forecast.json b/x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/ml.forecast.json
similarity index 100%
rename from x-pack/plugins/console_extensions/server/spec/generated/ml.forecast.json
rename to x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/ml.forecast.json
diff --git a/x-pack/plugins/console_extensions/server/spec/generated/ml.get_buckets.json b/x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/ml.get_buckets.json
similarity index 100%
rename from x-pack/plugins/console_extensions/server/spec/generated/ml.get_buckets.json
rename to x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/ml.get_buckets.json
diff --git a/x-pack/plugins/console_extensions/server/spec/generated/ml.get_calendar_events.json b/x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/ml.get_calendar_events.json
similarity index 100%
rename from x-pack/plugins/console_extensions/server/spec/generated/ml.get_calendar_events.json
rename to x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/ml.get_calendar_events.json
diff --git a/x-pack/plugins/console_extensions/server/spec/generated/ml.get_calendars.json b/x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/ml.get_calendars.json
similarity index 100%
rename from x-pack/plugins/console_extensions/server/spec/generated/ml.get_calendars.json
rename to x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/ml.get_calendars.json
diff --git a/x-pack/plugins/console_extensions/server/spec/generated/ml.get_categories.json b/x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/ml.get_categories.json
similarity index 100%
rename from x-pack/plugins/console_extensions/server/spec/generated/ml.get_categories.json
rename to x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/ml.get_categories.json
diff --git a/x-pack/plugins/console_extensions/server/spec/generated/ml.get_data_frame_analytics.json b/x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/ml.get_data_frame_analytics.json
similarity index 100%
rename from x-pack/plugins/console_extensions/server/spec/generated/ml.get_data_frame_analytics.json
rename to x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/ml.get_data_frame_analytics.json
diff --git a/x-pack/plugins/console_extensions/server/spec/generated/ml.get_data_frame_analytics_stats.json b/x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/ml.get_data_frame_analytics_stats.json
similarity index 100%
rename from x-pack/plugins/console_extensions/server/spec/generated/ml.get_data_frame_analytics_stats.json
rename to x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/ml.get_data_frame_analytics_stats.json
diff --git a/x-pack/plugins/console_extensions/server/spec/generated/ml.get_datafeed_stats.json b/x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/ml.get_datafeed_stats.json
similarity index 100%
rename from x-pack/plugins/console_extensions/server/spec/generated/ml.get_datafeed_stats.json
rename to x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/ml.get_datafeed_stats.json
diff --git a/x-pack/plugins/console_extensions/server/spec/generated/ml.get_datafeeds.json b/x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/ml.get_datafeeds.json
similarity index 100%
rename from x-pack/plugins/console_extensions/server/spec/generated/ml.get_datafeeds.json
rename to x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/ml.get_datafeeds.json
diff --git a/x-pack/plugins/console_extensions/server/spec/generated/ml.get_filters.json b/x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/ml.get_filters.json
similarity index 100%
rename from x-pack/plugins/console_extensions/server/spec/generated/ml.get_filters.json
rename to x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/ml.get_filters.json
diff --git a/x-pack/plugins/console_extensions/server/spec/generated/ml.get_influencers.json b/x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/ml.get_influencers.json
similarity index 100%
rename from x-pack/plugins/console_extensions/server/spec/generated/ml.get_influencers.json
rename to x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/ml.get_influencers.json
diff --git a/x-pack/plugins/console_extensions/server/spec/generated/ml.get_job_stats.json b/x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/ml.get_job_stats.json
similarity index 100%
rename from x-pack/plugins/console_extensions/server/spec/generated/ml.get_job_stats.json
rename to x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/ml.get_job_stats.json
diff --git a/x-pack/plugins/console_extensions/server/spec/generated/ml.get_jobs.json b/x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/ml.get_jobs.json
similarity index 100%
rename from x-pack/plugins/console_extensions/server/spec/generated/ml.get_jobs.json
rename to x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/ml.get_jobs.json
diff --git a/x-pack/plugins/console_extensions/server/spec/generated/ml.get_model_snapshots.json b/x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/ml.get_model_snapshots.json
similarity index 100%
rename from x-pack/plugins/console_extensions/server/spec/generated/ml.get_model_snapshots.json
rename to x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/ml.get_model_snapshots.json
diff --git a/x-pack/plugins/console_extensions/server/spec/generated/ml.get_overall_buckets.json b/x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/ml.get_overall_buckets.json
similarity index 100%
rename from x-pack/plugins/console_extensions/server/spec/generated/ml.get_overall_buckets.json
rename to x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/ml.get_overall_buckets.json
diff --git a/x-pack/plugins/console_extensions/server/spec/generated/ml.get_records.json b/x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/ml.get_records.json
similarity index 100%
rename from x-pack/plugins/console_extensions/server/spec/generated/ml.get_records.json
rename to x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/ml.get_records.json
diff --git a/x-pack/plugins/console_extensions/server/spec/generated/ml.get_trained_models.json b/x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/ml.get_trained_models.json
similarity index 100%
rename from x-pack/plugins/console_extensions/server/spec/generated/ml.get_trained_models.json
rename to x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/ml.get_trained_models.json
diff --git a/x-pack/plugins/console_extensions/server/spec/generated/ml.get_trained_models_stats.json b/x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/ml.get_trained_models_stats.json
similarity index 100%
rename from x-pack/plugins/console_extensions/server/spec/generated/ml.get_trained_models_stats.json
rename to x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/ml.get_trained_models_stats.json
diff --git a/x-pack/plugins/console_extensions/server/spec/generated/ml.info.json b/x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/ml.info.json
similarity index 100%
rename from x-pack/plugins/console_extensions/server/spec/generated/ml.info.json
rename to x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/ml.info.json
diff --git a/x-pack/plugins/console_extensions/server/spec/generated/ml.open_job.json b/x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/ml.open_job.json
similarity index 100%
rename from x-pack/plugins/console_extensions/server/spec/generated/ml.open_job.json
rename to x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/ml.open_job.json
diff --git a/x-pack/plugins/console_extensions/server/spec/generated/ml.post_calendar_events.json b/x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/ml.post_calendar_events.json
similarity index 100%
rename from x-pack/plugins/console_extensions/server/spec/generated/ml.post_calendar_events.json
rename to x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/ml.post_calendar_events.json
diff --git a/x-pack/plugins/console_extensions/server/spec/generated/ml.post_data.json b/x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/ml.post_data.json
similarity index 100%
rename from x-pack/plugins/console_extensions/server/spec/generated/ml.post_data.json
rename to x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/ml.post_data.json
diff --git a/x-pack/plugins/console_extensions/server/spec/generated/ml.preview_datafeed.json b/x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/ml.preview_datafeed.json
similarity index 100%
rename from x-pack/plugins/console_extensions/server/spec/generated/ml.preview_datafeed.json
rename to x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/ml.preview_datafeed.json
diff --git a/x-pack/plugins/console_extensions/server/spec/generated/ml.put_calendar.json b/x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/ml.put_calendar.json
similarity index 100%
rename from x-pack/plugins/console_extensions/server/spec/generated/ml.put_calendar.json
rename to x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/ml.put_calendar.json
diff --git a/x-pack/plugins/console_extensions/server/spec/generated/ml.put_calendar_job.json b/x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/ml.put_calendar_job.json
similarity index 100%
rename from x-pack/plugins/console_extensions/server/spec/generated/ml.put_calendar_job.json
rename to x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/ml.put_calendar_job.json
diff --git a/x-pack/plugins/console_extensions/server/spec/generated/ml.put_data_frame_analytics.json b/x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/ml.put_data_frame_analytics.json
similarity index 100%
rename from x-pack/plugins/console_extensions/server/spec/generated/ml.put_data_frame_analytics.json
rename to x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/ml.put_data_frame_analytics.json
diff --git a/x-pack/plugins/console_extensions/server/spec/generated/ml.put_datafeed.json b/x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/ml.put_datafeed.json
similarity index 100%
rename from x-pack/plugins/console_extensions/server/spec/generated/ml.put_datafeed.json
rename to x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/ml.put_datafeed.json
diff --git a/x-pack/plugins/console_extensions/server/spec/generated/ml.put_filter.json b/x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/ml.put_filter.json
similarity index 100%
rename from x-pack/plugins/console_extensions/server/spec/generated/ml.put_filter.json
rename to x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/ml.put_filter.json
diff --git a/x-pack/plugins/console_extensions/server/spec/generated/ml.put_job.json b/x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/ml.put_job.json
similarity index 100%
rename from x-pack/plugins/console_extensions/server/spec/generated/ml.put_job.json
rename to x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/ml.put_job.json
diff --git a/x-pack/plugins/console_extensions/server/spec/generated/ml.put_trained_model.json b/x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/ml.put_trained_model.json
similarity index 100%
rename from x-pack/plugins/console_extensions/server/spec/generated/ml.put_trained_model.json
rename to x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/ml.put_trained_model.json
diff --git a/x-pack/plugins/console_extensions/server/spec/generated/ml.revert_model_snapshot.json b/x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/ml.revert_model_snapshot.json
similarity index 100%
rename from x-pack/plugins/console_extensions/server/spec/generated/ml.revert_model_snapshot.json
rename to x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/ml.revert_model_snapshot.json
diff --git a/x-pack/plugins/console_extensions/server/spec/generated/ml.set_upgrade_mode.json b/x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/ml.set_upgrade_mode.json
similarity index 100%
rename from x-pack/plugins/console_extensions/server/spec/generated/ml.set_upgrade_mode.json
rename to x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/ml.set_upgrade_mode.json
diff --git a/x-pack/plugins/console_extensions/server/spec/generated/ml.start_data_frame_analytics.json b/x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/ml.start_data_frame_analytics.json
similarity index 100%
rename from x-pack/plugins/console_extensions/server/spec/generated/ml.start_data_frame_analytics.json
rename to x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/ml.start_data_frame_analytics.json
diff --git a/x-pack/plugins/console_extensions/server/spec/generated/ml.start_datafeed.json b/x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/ml.start_datafeed.json
similarity index 100%
rename from x-pack/plugins/console_extensions/server/spec/generated/ml.start_datafeed.json
rename to x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/ml.start_datafeed.json
diff --git a/x-pack/plugins/console_extensions/server/spec/generated/ml.stop_data_frame_analytics.json b/x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/ml.stop_data_frame_analytics.json
similarity index 100%
rename from x-pack/plugins/console_extensions/server/spec/generated/ml.stop_data_frame_analytics.json
rename to x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/ml.stop_data_frame_analytics.json
diff --git a/x-pack/plugins/console_extensions/server/spec/generated/ml.stop_datafeed.json b/x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/ml.stop_datafeed.json
similarity index 100%
rename from x-pack/plugins/console_extensions/server/spec/generated/ml.stop_datafeed.json
rename to x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/ml.stop_datafeed.json
diff --git a/x-pack/plugins/console_extensions/server/spec/generated/ml.update_datafeed.json b/x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/ml.update_datafeed.json
similarity index 100%
rename from x-pack/plugins/console_extensions/server/spec/generated/ml.update_datafeed.json
rename to x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/ml.update_datafeed.json
diff --git a/x-pack/plugins/console_extensions/server/spec/generated/ml.update_filter.json b/x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/ml.update_filter.json
similarity index 100%
rename from x-pack/plugins/console_extensions/server/spec/generated/ml.update_filter.json
rename to x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/ml.update_filter.json
diff --git a/x-pack/plugins/console_extensions/server/spec/generated/ml.update_job.json b/x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/ml.update_job.json
similarity index 100%
rename from x-pack/plugins/console_extensions/server/spec/generated/ml.update_job.json
rename to x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/ml.update_job.json
diff --git a/x-pack/plugins/console_extensions/server/spec/generated/ml.update_model_snapshot.json b/x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/ml.update_model_snapshot.json
similarity index 100%
rename from x-pack/plugins/console_extensions/server/spec/generated/ml.update_model_snapshot.json
rename to x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/ml.update_model_snapshot.json
diff --git a/x-pack/plugins/console_extensions/server/spec/generated/ml.upgrade.json b/x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/ml.upgrade.json
similarity index 100%
rename from x-pack/plugins/console_extensions/server/spec/generated/ml.upgrade.json
rename to x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/ml.upgrade.json
diff --git a/x-pack/plugins/console_extensions/server/spec/generated/ml.validate.json b/x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/ml.validate.json
similarity index 100%
rename from x-pack/plugins/console_extensions/server/spec/generated/ml.validate.json
rename to x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/ml.validate.json
diff --git a/x-pack/plugins/console_extensions/server/spec/generated/ml.validate_detector.json b/x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/ml.validate_detector.json
similarity index 100%
rename from x-pack/plugins/console_extensions/server/spec/generated/ml.validate_detector.json
rename to x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/ml.validate_detector.json
diff --git a/x-pack/plugins/console_extensions/server/spec/generated/monitoring.bulk.json b/x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/monitoring.bulk.json
similarity index 100%
rename from x-pack/plugins/console_extensions/server/spec/generated/monitoring.bulk.json
rename to x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/monitoring.bulk.json
diff --git a/x-pack/plugins/console_extensions/server/spec/generated/rollup.delete_job.json b/x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/rollup.delete_job.json
similarity index 100%
rename from x-pack/plugins/console_extensions/server/spec/generated/rollup.delete_job.json
rename to x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/rollup.delete_job.json
diff --git a/x-pack/plugins/console_extensions/server/spec/generated/rollup.get_jobs.json b/x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/rollup.get_jobs.json
similarity index 100%
rename from x-pack/plugins/console_extensions/server/spec/generated/rollup.get_jobs.json
rename to x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/rollup.get_jobs.json
diff --git a/x-pack/plugins/console_extensions/server/spec/generated/rollup.get_rollup_caps.json b/x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/rollup.get_rollup_caps.json
similarity index 100%
rename from x-pack/plugins/console_extensions/server/spec/generated/rollup.get_rollup_caps.json
rename to x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/rollup.get_rollup_caps.json
diff --git a/x-pack/plugins/console_extensions/server/spec/generated/rollup.get_rollup_index_caps.json b/x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/rollup.get_rollup_index_caps.json
similarity index 100%
rename from x-pack/plugins/console_extensions/server/spec/generated/rollup.get_rollup_index_caps.json
rename to x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/rollup.get_rollup_index_caps.json
diff --git a/x-pack/plugins/console_extensions/server/spec/generated/rollup.put_job.json b/x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/rollup.put_job.json
similarity index 100%
rename from x-pack/plugins/console_extensions/server/spec/generated/rollup.put_job.json
rename to x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/rollup.put_job.json
diff --git a/x-pack/plugins/console_extensions/server/spec/generated/rollup.rollup_search.json b/x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/rollup.rollup_search.json
similarity index 100%
rename from x-pack/plugins/console_extensions/server/spec/generated/rollup.rollup_search.json
rename to x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/rollup.rollup_search.json
diff --git a/x-pack/plugins/console_extensions/server/spec/generated/rollup.start_job.json b/x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/rollup.start_job.json
similarity index 100%
rename from x-pack/plugins/console_extensions/server/spec/generated/rollup.start_job.json
rename to x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/rollup.start_job.json
diff --git a/x-pack/plugins/console_extensions/server/spec/generated/rollup.stop_job.json b/x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/rollup.stop_job.json
similarity index 100%
rename from x-pack/plugins/console_extensions/server/spec/generated/rollup.stop_job.json
rename to x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/rollup.stop_job.json
diff --git a/x-pack/plugins/console_extensions/server/spec/generated/security.authenticate.json b/x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/security.authenticate.json
similarity index 100%
rename from x-pack/plugins/console_extensions/server/spec/generated/security.authenticate.json
rename to x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/security.authenticate.json
diff --git a/x-pack/plugins/console_extensions/server/spec/generated/security.change_password.json b/x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/security.change_password.json
similarity index 100%
rename from x-pack/plugins/console_extensions/server/spec/generated/security.change_password.json
rename to x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/security.change_password.json
diff --git a/x-pack/plugins/console_extensions/server/spec/generated/security.clear_cached_realms.json b/x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/security.clear_cached_realms.json
similarity index 100%
rename from x-pack/plugins/console_extensions/server/spec/generated/security.clear_cached_realms.json
rename to x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/security.clear_cached_realms.json
diff --git a/x-pack/plugins/console_extensions/server/spec/generated/security.clear_cached_roles.json b/x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/security.clear_cached_roles.json
similarity index 100%
rename from x-pack/plugins/console_extensions/server/spec/generated/security.clear_cached_roles.json
rename to x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/security.clear_cached_roles.json
diff --git a/x-pack/plugins/console_extensions/server/spec/generated/security.create_api_key.json b/x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/security.create_api_key.json
similarity index 100%
rename from x-pack/plugins/console_extensions/server/spec/generated/security.create_api_key.json
rename to x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/security.create_api_key.json
diff --git a/x-pack/plugins/console_extensions/server/spec/generated/security.delete_privileges.json b/x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/security.delete_privileges.json
similarity index 100%
rename from x-pack/plugins/console_extensions/server/spec/generated/security.delete_privileges.json
rename to x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/security.delete_privileges.json
diff --git a/x-pack/plugins/console_extensions/server/spec/generated/security.delete_role.json b/x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/security.delete_role.json
similarity index 100%
rename from x-pack/plugins/console_extensions/server/spec/generated/security.delete_role.json
rename to x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/security.delete_role.json
diff --git a/x-pack/plugins/console_extensions/server/spec/generated/security.delete_role_mapping.json b/x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/security.delete_role_mapping.json
similarity index 100%
rename from x-pack/plugins/console_extensions/server/spec/generated/security.delete_role_mapping.json
rename to x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/security.delete_role_mapping.json
diff --git a/x-pack/plugins/console_extensions/server/spec/generated/security.delete_user.json b/x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/security.delete_user.json
similarity index 100%
rename from x-pack/plugins/console_extensions/server/spec/generated/security.delete_user.json
rename to x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/security.delete_user.json
diff --git a/x-pack/plugins/console_extensions/server/spec/generated/security.disable_user.json b/x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/security.disable_user.json
similarity index 100%
rename from x-pack/plugins/console_extensions/server/spec/generated/security.disable_user.json
rename to x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/security.disable_user.json
diff --git a/x-pack/plugins/console_extensions/server/spec/generated/security.enable_user.json b/x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/security.enable_user.json
similarity index 100%
rename from x-pack/plugins/console_extensions/server/spec/generated/security.enable_user.json
rename to x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/security.enable_user.json
diff --git a/x-pack/plugins/console_extensions/server/spec/generated/security.get_api_key.json b/x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/security.get_api_key.json
similarity index 100%
rename from x-pack/plugins/console_extensions/server/spec/generated/security.get_api_key.json
rename to x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/security.get_api_key.json
diff --git a/x-pack/plugins/console_extensions/server/spec/generated/security.get_builtin_privileges.json b/x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/security.get_builtin_privileges.json
similarity index 100%
rename from x-pack/plugins/console_extensions/server/spec/generated/security.get_builtin_privileges.json
rename to x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/security.get_builtin_privileges.json
diff --git a/x-pack/plugins/console_extensions/server/spec/generated/security.get_privileges.json b/x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/security.get_privileges.json
similarity index 100%
rename from x-pack/plugins/console_extensions/server/spec/generated/security.get_privileges.json
rename to x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/security.get_privileges.json
diff --git a/x-pack/plugins/console_extensions/server/spec/generated/security.get_role.json b/x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/security.get_role.json
similarity index 100%
rename from x-pack/plugins/console_extensions/server/spec/generated/security.get_role.json
rename to x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/security.get_role.json
diff --git a/x-pack/plugins/console_extensions/server/spec/generated/security.get_role_mapping.json b/x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/security.get_role_mapping.json
similarity index 100%
rename from x-pack/plugins/console_extensions/server/spec/generated/security.get_role_mapping.json
rename to x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/security.get_role_mapping.json
diff --git a/x-pack/plugins/console_extensions/server/spec/generated/security.get_token.json b/x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/security.get_token.json
similarity index 100%
rename from x-pack/plugins/console_extensions/server/spec/generated/security.get_token.json
rename to x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/security.get_token.json
diff --git a/x-pack/plugins/console_extensions/server/spec/generated/security.get_user.json b/x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/security.get_user.json
similarity index 100%
rename from x-pack/plugins/console_extensions/server/spec/generated/security.get_user.json
rename to x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/security.get_user.json
diff --git a/x-pack/plugins/console_extensions/server/spec/generated/security.get_user_privileges.json b/x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/security.get_user_privileges.json
similarity index 100%
rename from x-pack/plugins/console_extensions/server/spec/generated/security.get_user_privileges.json
rename to x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/security.get_user_privileges.json
diff --git a/x-pack/plugins/console_extensions/server/spec/generated/security.has_privileges.json b/x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/security.has_privileges.json
similarity index 100%
rename from x-pack/plugins/console_extensions/server/spec/generated/security.has_privileges.json
rename to x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/security.has_privileges.json
diff --git a/x-pack/plugins/console_extensions/server/spec/generated/security.invalidate_api_key.json b/x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/security.invalidate_api_key.json
similarity index 100%
rename from x-pack/plugins/console_extensions/server/spec/generated/security.invalidate_api_key.json
rename to x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/security.invalidate_api_key.json
diff --git a/x-pack/plugins/console_extensions/server/spec/generated/security.invalidate_token.json b/x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/security.invalidate_token.json
similarity index 100%
rename from x-pack/plugins/console_extensions/server/spec/generated/security.invalidate_token.json
rename to x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/security.invalidate_token.json
diff --git a/x-pack/plugins/console_extensions/server/spec/generated/security.put_privileges.json b/x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/security.put_privileges.json
similarity index 100%
rename from x-pack/plugins/console_extensions/server/spec/generated/security.put_privileges.json
rename to x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/security.put_privileges.json
diff --git a/x-pack/plugins/console_extensions/server/spec/generated/security.put_role.json b/x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/security.put_role.json
similarity index 100%
rename from x-pack/plugins/console_extensions/server/spec/generated/security.put_role.json
rename to x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/security.put_role.json
diff --git a/x-pack/plugins/console_extensions/server/spec/generated/security.put_role_mapping.json b/x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/security.put_role_mapping.json
similarity index 100%
rename from x-pack/plugins/console_extensions/server/spec/generated/security.put_role_mapping.json
rename to x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/security.put_role_mapping.json
diff --git a/x-pack/plugins/console_extensions/server/spec/generated/security.put_user.json b/x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/security.put_user.json
similarity index 100%
rename from x-pack/plugins/console_extensions/server/spec/generated/security.put_user.json
rename to x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/security.put_user.json
diff --git a/x-pack/plugins/console_extensions/server/spec/generated/slm.delete_lifecycle.json b/x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/slm.delete_lifecycle.json
similarity index 100%
rename from x-pack/plugins/console_extensions/server/spec/generated/slm.delete_lifecycle.json
rename to x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/slm.delete_lifecycle.json
diff --git a/x-pack/plugins/console_extensions/server/spec/generated/slm.execute_lifecycle.json b/x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/slm.execute_lifecycle.json
similarity index 100%
rename from x-pack/plugins/console_extensions/server/spec/generated/slm.execute_lifecycle.json
rename to x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/slm.execute_lifecycle.json
diff --git a/x-pack/plugins/console_extensions/server/spec/generated/slm.execute_retention.json b/x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/slm.execute_retention.json
similarity index 100%
rename from x-pack/plugins/console_extensions/server/spec/generated/slm.execute_retention.json
rename to x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/slm.execute_retention.json
diff --git a/x-pack/plugins/console_extensions/server/spec/generated/slm.get_lifecycle.json b/x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/slm.get_lifecycle.json
similarity index 100%
rename from x-pack/plugins/console_extensions/server/spec/generated/slm.get_lifecycle.json
rename to x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/slm.get_lifecycle.json
diff --git a/x-pack/plugins/console_extensions/server/spec/generated/slm.get_stats.json b/x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/slm.get_stats.json
similarity index 100%
rename from x-pack/plugins/console_extensions/server/spec/generated/slm.get_stats.json
rename to x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/slm.get_stats.json
diff --git a/x-pack/plugins/console_extensions/server/spec/generated/slm.get_status.json b/x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/slm.get_status.json
similarity index 100%
rename from x-pack/plugins/console_extensions/server/spec/generated/slm.get_status.json
rename to x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/slm.get_status.json
diff --git a/x-pack/plugins/console_extensions/server/spec/generated/slm.put_lifecycle.json b/x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/slm.put_lifecycle.json
similarity index 100%
rename from x-pack/plugins/console_extensions/server/spec/generated/slm.put_lifecycle.json
rename to x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/slm.put_lifecycle.json
diff --git a/x-pack/plugins/console_extensions/server/spec/generated/slm.start.json b/x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/slm.start.json
similarity index 100%
rename from x-pack/plugins/console_extensions/server/spec/generated/slm.start.json
rename to x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/slm.start.json
diff --git a/x-pack/plugins/console_extensions/server/spec/generated/slm.stop.json b/x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/slm.stop.json
similarity index 100%
rename from x-pack/plugins/console_extensions/server/spec/generated/slm.stop.json
rename to x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/slm.stop.json
diff --git a/x-pack/plugins/console_extensions/server/spec/generated/sql.clear_cursor.json b/x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/sql.clear_cursor.json
similarity index 100%
rename from x-pack/plugins/console_extensions/server/spec/generated/sql.clear_cursor.json
rename to x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/sql.clear_cursor.json
diff --git a/x-pack/plugins/console_extensions/server/spec/generated/sql.query.json b/x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/sql.query.json
similarity index 100%
rename from x-pack/plugins/console_extensions/server/spec/generated/sql.query.json
rename to x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/sql.query.json
diff --git a/x-pack/plugins/console_extensions/server/spec/generated/sql.translate.json b/x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/sql.translate.json
similarity index 100%
rename from x-pack/plugins/console_extensions/server/spec/generated/sql.translate.json
rename to x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/sql.translate.json
diff --git a/x-pack/plugins/console_extensions/server/spec/generated/ssl.certificates.json b/x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/ssl.certificates.json
similarity index 100%
rename from x-pack/plugins/console_extensions/server/spec/generated/ssl.certificates.json
rename to x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/ssl.certificates.json
diff --git a/x-pack/plugins/console_extensions/server/spec/generated/transform.cat_transform.json b/x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/transform.cat_transform.json
similarity index 100%
rename from x-pack/plugins/console_extensions/server/spec/generated/transform.cat_transform.json
rename to x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/transform.cat_transform.json
diff --git a/x-pack/plugins/console_extensions/server/spec/generated/transform.delete_transform.json b/x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/transform.delete_transform.json
similarity index 100%
rename from x-pack/plugins/console_extensions/server/spec/generated/transform.delete_transform.json
rename to x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/transform.delete_transform.json
diff --git a/x-pack/plugins/console_extensions/server/spec/generated/transform.get_transform.json b/x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/transform.get_transform.json
similarity index 100%
rename from x-pack/plugins/console_extensions/server/spec/generated/transform.get_transform.json
rename to x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/transform.get_transform.json
diff --git a/x-pack/plugins/console_extensions/server/spec/generated/transform.get_transform_stats.json b/x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/transform.get_transform_stats.json
similarity index 100%
rename from x-pack/plugins/console_extensions/server/spec/generated/transform.get_transform_stats.json
rename to x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/transform.get_transform_stats.json
diff --git a/x-pack/plugins/console_extensions/server/spec/generated/transform.preview_transform.json b/x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/transform.preview_transform.json
similarity index 100%
rename from x-pack/plugins/console_extensions/server/spec/generated/transform.preview_transform.json
rename to x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/transform.preview_transform.json
diff --git a/x-pack/plugins/console_extensions/server/spec/generated/transform.put_transform.json b/x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/transform.put_transform.json
similarity index 100%
rename from x-pack/plugins/console_extensions/server/spec/generated/transform.put_transform.json
rename to x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/transform.put_transform.json
diff --git a/x-pack/plugins/console_extensions/server/spec/generated/transform.start_transform.json b/x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/transform.start_transform.json
similarity index 100%
rename from x-pack/plugins/console_extensions/server/spec/generated/transform.start_transform.json
rename to x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/transform.start_transform.json
diff --git a/x-pack/plugins/console_extensions/server/spec/generated/transform.stop_transform.json b/x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/transform.stop_transform.json
similarity index 100%
rename from x-pack/plugins/console_extensions/server/spec/generated/transform.stop_transform.json
rename to x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/transform.stop_transform.json
diff --git a/x-pack/plugins/console_extensions/server/spec/generated/transform.update_transform.json b/x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/transform.update_transform.json
similarity index 100%
rename from x-pack/plugins/console_extensions/server/spec/generated/transform.update_transform.json
rename to x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/transform.update_transform.json
diff --git a/x-pack/plugins/console_extensions/server/spec/generated/watcher.ack_watch.json b/x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/watcher.ack_watch.json
similarity index 100%
rename from x-pack/plugins/console_extensions/server/spec/generated/watcher.ack_watch.json
rename to x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/watcher.ack_watch.json
diff --git a/x-pack/plugins/console_extensions/server/spec/generated/watcher.activate_watch.json b/x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/watcher.activate_watch.json
similarity index 100%
rename from x-pack/plugins/console_extensions/server/spec/generated/watcher.activate_watch.json
rename to x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/watcher.activate_watch.json
diff --git a/x-pack/plugins/console_extensions/server/spec/generated/watcher.deactivate_watch.json b/x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/watcher.deactivate_watch.json
similarity index 100%
rename from x-pack/plugins/console_extensions/server/spec/generated/watcher.deactivate_watch.json
rename to x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/watcher.deactivate_watch.json
diff --git a/x-pack/plugins/console_extensions/server/spec/generated/watcher.delete_watch.json b/x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/watcher.delete_watch.json
similarity index 100%
rename from x-pack/plugins/console_extensions/server/spec/generated/watcher.delete_watch.json
rename to x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/watcher.delete_watch.json
diff --git a/x-pack/plugins/console_extensions/server/spec/generated/watcher.execute_watch.json b/x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/watcher.execute_watch.json
similarity index 100%
rename from x-pack/plugins/console_extensions/server/spec/generated/watcher.execute_watch.json
rename to x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/watcher.execute_watch.json
diff --git a/x-pack/plugins/console_extensions/server/spec/generated/watcher.get_watch.json b/x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/watcher.get_watch.json
similarity index 100%
rename from x-pack/plugins/console_extensions/server/spec/generated/watcher.get_watch.json
rename to x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/watcher.get_watch.json
diff --git a/x-pack/plugins/console_extensions/server/spec/generated/watcher.put_watch.json b/x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/watcher.put_watch.json
similarity index 100%
rename from x-pack/plugins/console_extensions/server/spec/generated/watcher.put_watch.json
rename to x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/watcher.put_watch.json
diff --git a/x-pack/plugins/console_extensions/server/spec/generated/watcher.start.json b/x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/watcher.start.json
similarity index 100%
rename from x-pack/plugins/console_extensions/server/spec/generated/watcher.start.json
rename to x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/watcher.start.json
diff --git a/x-pack/plugins/console_extensions/server/spec/generated/watcher.stats.json b/x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/watcher.stats.json
similarity index 100%
rename from x-pack/plugins/console_extensions/server/spec/generated/watcher.stats.json
rename to x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/watcher.stats.json
diff --git a/x-pack/plugins/console_extensions/server/spec/generated/watcher.stop.json b/x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/watcher.stop.json
similarity index 100%
rename from x-pack/plugins/console_extensions/server/spec/generated/watcher.stop.json
rename to x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/watcher.stop.json
diff --git a/x-pack/plugins/console_extensions/server/spec/generated/xpack.info.json b/x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/xpack.info.json
similarity index 100%
rename from x-pack/plugins/console_extensions/server/spec/generated/xpack.info.json
rename to x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/xpack.info.json
diff --git a/x-pack/plugins/console_extensions/server/spec/generated/xpack.ssl.certificates.json b/x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/xpack.ssl.certificates.json
similarity index 100%
rename from x-pack/plugins/console_extensions/server/spec/generated/xpack.ssl.certificates.json
rename to x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/xpack.ssl.certificates.json
diff --git a/x-pack/plugins/console_extensions/server/spec/generated/xpack.usage.json b/x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/xpack.usage.json
similarity index 100%
rename from x-pack/plugins/console_extensions/server/spec/generated/xpack.usage.json
rename to x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated/xpack.usage.json
diff --git a/x-pack/plugins/console_extensions/server/spec/overrides/async_search.submit.json b/x-pack/plugins/console_extensions/server/lib/spec_definitions/json/overrides/async_search.submit.json
similarity index 100%
rename from x-pack/plugins/console_extensions/server/spec/overrides/async_search.submit.json
rename to x-pack/plugins/console_extensions/server/lib/spec_definitions/json/overrides/async_search.submit.json
diff --git a/x-pack/plugins/console_extensions/server/spec/overrides/ccr.follow.json b/x-pack/plugins/console_extensions/server/lib/spec_definitions/json/overrides/ccr.follow.json
similarity index 100%
rename from x-pack/plugins/console_extensions/server/spec/overrides/ccr.follow.json
rename to x-pack/plugins/console_extensions/server/lib/spec_definitions/json/overrides/ccr.follow.json
diff --git a/x-pack/plugins/console_extensions/server/spec/overrides/ccr.forget_follower.json b/x-pack/plugins/console_extensions/server/lib/spec_definitions/json/overrides/ccr.forget_follower.json
similarity index 100%
rename from x-pack/plugins/console_extensions/server/spec/overrides/ccr.forget_follower.json
rename to x-pack/plugins/console_extensions/server/lib/spec_definitions/json/overrides/ccr.forget_follower.json
diff --git a/x-pack/plugins/console_extensions/server/spec/overrides/ccr.put_auto_follow_pattern.json b/x-pack/plugins/console_extensions/server/lib/spec_definitions/json/overrides/ccr.put_auto_follow_pattern.json
similarity index 100%
rename from x-pack/plugins/console_extensions/server/spec/overrides/ccr.put_auto_follow_pattern.json
rename to x-pack/plugins/console_extensions/server/lib/spec_definitions/json/overrides/ccr.put_auto_follow_pattern.json
diff --git a/x-pack/plugins/console_extensions/server/spec/overrides/ccr.resume_follow.json b/x-pack/plugins/console_extensions/server/lib/spec_definitions/json/overrides/ccr.resume_follow.json
similarity index 100%
rename from x-pack/plugins/console_extensions/server/spec/overrides/ccr.resume_follow.json
rename to x-pack/plugins/console_extensions/server/lib/spec_definitions/json/overrides/ccr.resume_follow.json
diff --git a/x-pack/plugins/console_extensions/server/spec/overrides/enrich.put_policy.json b/x-pack/plugins/console_extensions/server/lib/spec_definitions/json/overrides/enrich.put_policy.json
similarity index 100%
rename from x-pack/plugins/console_extensions/server/spec/overrides/enrich.put_policy.json
rename to x-pack/plugins/console_extensions/server/lib/spec_definitions/json/overrides/enrich.put_policy.json
diff --git a/x-pack/plugins/console_extensions/server/spec/overrides/ilm.move_to_step.json b/x-pack/plugins/console_extensions/server/lib/spec_definitions/json/overrides/ilm.move_to_step.json
similarity index 100%
rename from x-pack/plugins/console_extensions/server/spec/overrides/ilm.move_to_step.json
rename to x-pack/plugins/console_extensions/server/lib/spec_definitions/json/overrides/ilm.move_to_step.json
diff --git a/x-pack/plugins/console_extensions/server/spec/overrides/ilm.put_lifecycle.json b/x-pack/plugins/console_extensions/server/lib/spec_definitions/json/overrides/ilm.put_lifecycle.json
similarity index 100%
rename from x-pack/plugins/console_extensions/server/spec/overrides/ilm.put_lifecycle.json
rename to x-pack/plugins/console_extensions/server/lib/spec_definitions/json/overrides/ilm.put_lifecycle.json
diff --git a/x-pack/plugins/console_extensions/server/spec/overrides/ml.evaluate_data_frame.json b/x-pack/plugins/console_extensions/server/lib/spec_definitions/json/overrides/ml.evaluate_data_frame.json
similarity index 100%
rename from x-pack/plugins/console_extensions/server/spec/overrides/ml.evaluate_data_frame.json
rename to x-pack/plugins/console_extensions/server/lib/spec_definitions/json/overrides/ml.evaluate_data_frame.json
diff --git a/x-pack/plugins/console_extensions/server/spec/overrides/ml.explain_data_frame_analytics.json b/x-pack/plugins/console_extensions/server/lib/spec_definitions/json/overrides/ml.explain_data_frame_analytics.json
similarity index 100%
rename from x-pack/plugins/console_extensions/server/spec/overrides/ml.explain_data_frame_analytics.json
rename to x-pack/plugins/console_extensions/server/lib/spec_definitions/json/overrides/ml.explain_data_frame_analytics.json
diff --git a/x-pack/plugins/console_extensions/server/spec/overrides/ml.get_buckets.json b/x-pack/plugins/console_extensions/server/lib/spec_definitions/json/overrides/ml.get_buckets.json
similarity index 100%
rename from x-pack/plugins/console_extensions/server/spec/overrides/ml.get_buckets.json
rename to x-pack/plugins/console_extensions/server/lib/spec_definitions/json/overrides/ml.get_buckets.json
diff --git a/x-pack/plugins/console_extensions/server/spec/overrides/ml.get_calendar_events.json b/x-pack/plugins/console_extensions/server/lib/spec_definitions/json/overrides/ml.get_calendar_events.json
similarity index 100%
rename from x-pack/plugins/console_extensions/server/spec/overrides/ml.get_calendar_events.json
rename to x-pack/plugins/console_extensions/server/lib/spec_definitions/json/overrides/ml.get_calendar_events.json
diff --git a/x-pack/plugins/console_extensions/server/spec/overrides/ml.get_calendars.json b/x-pack/plugins/console_extensions/server/lib/spec_definitions/json/overrides/ml.get_calendars.json
similarity index 100%
rename from x-pack/plugins/console_extensions/server/spec/overrides/ml.get_calendars.json
rename to x-pack/plugins/console_extensions/server/lib/spec_definitions/json/overrides/ml.get_calendars.json
diff --git a/x-pack/plugins/console_extensions/server/spec/overrides/ml.get_categories.json b/x-pack/plugins/console_extensions/server/lib/spec_definitions/json/overrides/ml.get_categories.json
similarity index 100%
rename from x-pack/plugins/console_extensions/server/spec/overrides/ml.get_categories.json
rename to x-pack/plugins/console_extensions/server/lib/spec_definitions/json/overrides/ml.get_categories.json
diff --git a/x-pack/plugins/console_extensions/server/spec/overrides/ml.get_influencers.json b/x-pack/plugins/console_extensions/server/lib/spec_definitions/json/overrides/ml.get_influencers.json
similarity index 100%
rename from x-pack/plugins/console_extensions/server/spec/overrides/ml.get_influencers.json
rename to x-pack/plugins/console_extensions/server/lib/spec_definitions/json/overrides/ml.get_influencers.json
diff --git a/x-pack/plugins/console_extensions/server/spec/overrides/ml.get_model_snapshots.json b/x-pack/plugins/console_extensions/server/lib/spec_definitions/json/overrides/ml.get_model_snapshots.json
similarity index 100%
rename from x-pack/plugins/console_extensions/server/spec/overrides/ml.get_model_snapshots.json
rename to x-pack/plugins/console_extensions/server/lib/spec_definitions/json/overrides/ml.get_model_snapshots.json
diff --git a/x-pack/plugins/console_extensions/server/spec/overrides/ml.get_overall_buckets.json b/x-pack/plugins/console_extensions/server/lib/spec_definitions/json/overrides/ml.get_overall_buckets.json
similarity index 100%
rename from x-pack/plugins/console_extensions/server/spec/overrides/ml.get_overall_buckets.json
rename to x-pack/plugins/console_extensions/server/lib/spec_definitions/json/overrides/ml.get_overall_buckets.json
diff --git a/x-pack/plugins/console_extensions/server/spec/overrides/ml.get_records.json b/x-pack/plugins/console_extensions/server/lib/spec_definitions/json/overrides/ml.get_records.json
similarity index 100%
rename from x-pack/plugins/console_extensions/server/spec/overrides/ml.get_records.json
rename to x-pack/plugins/console_extensions/server/lib/spec_definitions/json/overrides/ml.get_records.json
diff --git a/x-pack/plugins/console_extensions/server/spec/overrides/ml.post_calendar_events.json b/x-pack/plugins/console_extensions/server/lib/spec_definitions/json/overrides/ml.post_calendar_events.json
similarity index 100%
rename from x-pack/plugins/console_extensions/server/spec/overrides/ml.post_calendar_events.json
rename to x-pack/plugins/console_extensions/server/lib/spec_definitions/json/overrides/ml.post_calendar_events.json
diff --git a/x-pack/plugins/console_extensions/server/spec/overrides/ml.put_calendar.json b/x-pack/plugins/console_extensions/server/lib/spec_definitions/json/overrides/ml.put_calendar.json
similarity index 100%
rename from x-pack/plugins/console_extensions/server/spec/overrides/ml.put_calendar.json
rename to x-pack/plugins/console_extensions/server/lib/spec_definitions/json/overrides/ml.put_calendar.json
diff --git a/x-pack/plugins/console_extensions/server/spec/overrides/ml.put_data_frame_analytics.json b/x-pack/plugins/console_extensions/server/lib/spec_definitions/json/overrides/ml.put_data_frame_analytics.json
similarity index 100%
rename from x-pack/plugins/console_extensions/server/spec/overrides/ml.put_data_frame_analytics.json
rename to x-pack/plugins/console_extensions/server/lib/spec_definitions/json/overrides/ml.put_data_frame_analytics.json
diff --git a/x-pack/plugins/console_extensions/server/spec/overrides/ml.put_datafeed.json b/x-pack/plugins/console_extensions/server/lib/spec_definitions/json/overrides/ml.put_datafeed.json
similarity index 100%
rename from x-pack/plugins/console_extensions/server/spec/overrides/ml.put_datafeed.json
rename to x-pack/plugins/console_extensions/server/lib/spec_definitions/json/overrides/ml.put_datafeed.json
diff --git a/x-pack/plugins/console_extensions/server/spec/overrides/ml.put_job.json b/x-pack/plugins/console_extensions/server/lib/spec_definitions/json/overrides/ml.put_job.json
similarity index 100%
rename from x-pack/plugins/console_extensions/server/spec/overrides/ml.put_job.json
rename to x-pack/plugins/console_extensions/server/lib/spec_definitions/json/overrides/ml.put_job.json
diff --git a/x-pack/plugins/console_extensions/server/spec/overrides/ml.put_trained_model.json b/x-pack/plugins/console_extensions/server/lib/spec_definitions/json/overrides/ml.put_trained_model.json
similarity index 100%
rename from x-pack/plugins/console_extensions/server/spec/overrides/ml.put_trained_model.json
rename to x-pack/plugins/console_extensions/server/lib/spec_definitions/json/overrides/ml.put_trained_model.json
diff --git a/x-pack/plugins/console_extensions/server/spec/overrides/ml.revert_model_snapshot.json b/x-pack/plugins/console_extensions/server/lib/spec_definitions/json/overrides/ml.revert_model_snapshot.json
similarity index 100%
rename from x-pack/plugins/console_extensions/server/spec/overrides/ml.revert_model_snapshot.json
rename to x-pack/plugins/console_extensions/server/lib/spec_definitions/json/overrides/ml.revert_model_snapshot.json
diff --git a/x-pack/plugins/console_extensions/server/spec/overrides/ml.update_datafeed.json b/x-pack/plugins/console_extensions/server/lib/spec_definitions/json/overrides/ml.update_datafeed.json
similarity index 100%
rename from x-pack/plugins/console_extensions/server/spec/overrides/ml.update_datafeed.json
rename to x-pack/plugins/console_extensions/server/lib/spec_definitions/json/overrides/ml.update_datafeed.json
diff --git a/x-pack/plugins/console_extensions/server/spec/overrides/ml.update_job.json b/x-pack/plugins/console_extensions/server/lib/spec_definitions/json/overrides/ml.update_job.json
similarity index 100%
rename from x-pack/plugins/console_extensions/server/spec/overrides/ml.update_job.json
rename to x-pack/plugins/console_extensions/server/lib/spec_definitions/json/overrides/ml.update_job.json
diff --git a/x-pack/plugins/console_extensions/server/spec/overrides/ml.update_model_snapshot.json b/x-pack/plugins/console_extensions/server/lib/spec_definitions/json/overrides/ml.update_model_snapshot.json
similarity index 100%
rename from x-pack/plugins/console_extensions/server/spec/overrides/ml.update_model_snapshot.json
rename to x-pack/plugins/console_extensions/server/lib/spec_definitions/json/overrides/ml.update_model_snapshot.json
diff --git a/x-pack/plugins/console_extensions/server/spec/overrides/security.authenticate.json b/x-pack/plugins/console_extensions/server/lib/spec_definitions/json/overrides/security.authenticate.json
similarity index 100%
rename from x-pack/plugins/console_extensions/server/spec/overrides/security.authenticate.json
rename to x-pack/plugins/console_extensions/server/lib/spec_definitions/json/overrides/security.authenticate.json
diff --git a/x-pack/plugins/console_extensions/server/spec/overrides/security.change_password.json b/x-pack/plugins/console_extensions/server/lib/spec_definitions/json/overrides/security.change_password.json
similarity index 100%
rename from x-pack/plugins/console_extensions/server/spec/overrides/security.change_password.json
rename to x-pack/plugins/console_extensions/server/lib/spec_definitions/json/overrides/security.change_password.json
diff --git a/x-pack/plugins/console_extensions/server/spec/overrides/security.create_api_key.json b/x-pack/plugins/console_extensions/server/lib/spec_definitions/json/overrides/security.create_api_key.json
similarity index 100%
rename from x-pack/plugins/console_extensions/server/spec/overrides/security.create_api_key.json
rename to x-pack/plugins/console_extensions/server/lib/spec_definitions/json/overrides/security.create_api_key.json
diff --git a/x-pack/plugins/console_extensions/server/spec/overrides/security.get_token.json b/x-pack/plugins/console_extensions/server/lib/spec_definitions/json/overrides/security.get_token.json
similarity index 100%
rename from x-pack/plugins/console_extensions/server/spec/overrides/security.get_token.json
rename to x-pack/plugins/console_extensions/server/lib/spec_definitions/json/overrides/security.get_token.json
diff --git a/x-pack/plugins/console_extensions/server/spec/overrides/security.has_privileges.json b/x-pack/plugins/console_extensions/server/lib/spec_definitions/json/overrides/security.has_privileges.json
similarity index 100%
rename from x-pack/plugins/console_extensions/server/spec/overrides/security.has_privileges.json
rename to x-pack/plugins/console_extensions/server/lib/spec_definitions/json/overrides/security.has_privileges.json
diff --git a/x-pack/plugins/console_extensions/server/spec/overrides/security.invalidate_api_key.json b/x-pack/plugins/console_extensions/server/lib/spec_definitions/json/overrides/security.invalidate_api_key.json
similarity index 100%
rename from x-pack/plugins/console_extensions/server/spec/overrides/security.invalidate_api_key.json
rename to x-pack/plugins/console_extensions/server/lib/spec_definitions/json/overrides/security.invalidate_api_key.json
diff --git a/x-pack/plugins/console_extensions/server/spec/overrides/security.invalidate_token.json b/x-pack/plugins/console_extensions/server/lib/spec_definitions/json/overrides/security.invalidate_token.json
similarity index 100%
rename from x-pack/plugins/console_extensions/server/spec/overrides/security.invalidate_token.json
rename to x-pack/plugins/console_extensions/server/lib/spec_definitions/json/overrides/security.invalidate_token.json
diff --git a/x-pack/plugins/console_extensions/server/spec/overrides/security.put_role.json b/x-pack/plugins/console_extensions/server/lib/spec_definitions/json/overrides/security.put_role.json
similarity index 100%
rename from x-pack/plugins/console_extensions/server/spec/overrides/security.put_role.json
rename to x-pack/plugins/console_extensions/server/lib/spec_definitions/json/overrides/security.put_role.json
diff --git a/x-pack/plugins/console_extensions/server/spec/overrides/security.put_role_mapping.json b/x-pack/plugins/console_extensions/server/lib/spec_definitions/json/overrides/security.put_role_mapping.json
similarity index 100%
rename from x-pack/plugins/console_extensions/server/spec/overrides/security.put_role_mapping.json
rename to x-pack/plugins/console_extensions/server/lib/spec_definitions/json/overrides/security.put_role_mapping.json
diff --git a/x-pack/plugins/console_extensions/server/spec/overrides/security.put_user.json b/x-pack/plugins/console_extensions/server/lib/spec_definitions/json/overrides/security.put_user.json
similarity index 100%
rename from x-pack/plugins/console_extensions/server/spec/overrides/security.put_user.json
rename to x-pack/plugins/console_extensions/server/lib/spec_definitions/json/overrides/security.put_user.json
diff --git a/x-pack/plugins/console_extensions/server/spec/overrides/slm.put_lifecycle.json b/x-pack/plugins/console_extensions/server/lib/spec_definitions/json/overrides/slm.put_lifecycle.json
similarity index 100%
rename from x-pack/plugins/console_extensions/server/spec/overrides/slm.put_lifecycle.json
rename to x-pack/plugins/console_extensions/server/lib/spec_definitions/json/overrides/slm.put_lifecycle.json
diff --git a/x-pack/plugins/console_extensions/server/spec/overrides/slm.start.json b/x-pack/plugins/console_extensions/server/lib/spec_definitions/json/overrides/slm.start.json
similarity index 100%
rename from x-pack/plugins/console_extensions/server/spec/overrides/slm.start.json
rename to x-pack/plugins/console_extensions/server/lib/spec_definitions/json/overrides/slm.start.json
diff --git a/x-pack/plugins/console_extensions/server/spec/overrides/slm.stop.json b/x-pack/plugins/console_extensions/server/lib/spec_definitions/json/overrides/slm.stop.json
similarity index 100%
rename from x-pack/plugins/console_extensions/server/spec/overrides/slm.stop.json
rename to x-pack/plugins/console_extensions/server/lib/spec_definitions/json/overrides/slm.stop.json
diff --git a/x-pack/plugins/console_extensions/server/spec/overrides/sql.query.json b/x-pack/plugins/console_extensions/server/lib/spec_definitions/json/overrides/sql.query.json
similarity index 100%
rename from x-pack/plugins/console_extensions/server/spec/overrides/sql.query.json
rename to x-pack/plugins/console_extensions/server/lib/spec_definitions/json/overrides/sql.query.json
diff --git a/x-pack/plugins/console_extensions/server/spec/overrides/transform.get_transform_stats.json b/x-pack/plugins/console_extensions/server/lib/spec_definitions/json/overrides/transform.get_transform_stats.json
similarity index 100%
rename from x-pack/plugins/console_extensions/server/spec/overrides/transform.get_transform_stats.json
rename to x-pack/plugins/console_extensions/server/lib/spec_definitions/json/overrides/transform.get_transform_stats.json
diff --git a/x-pack/plugins/console_extensions/server/spec/overrides/transform.preview_transform.json b/x-pack/plugins/console_extensions/server/lib/spec_definitions/json/overrides/transform.preview_transform.json
similarity index 100%
rename from x-pack/plugins/console_extensions/server/spec/overrides/transform.preview_transform.json
rename to x-pack/plugins/console_extensions/server/lib/spec_definitions/json/overrides/transform.preview_transform.json
diff --git a/x-pack/plugins/console_extensions/server/spec/overrides/transform.put_transform.json b/x-pack/plugins/console_extensions/server/lib/spec_definitions/json/overrides/transform.put_transform.json
similarity index 100%
rename from x-pack/plugins/console_extensions/server/spec/overrides/transform.put_transform.json
rename to x-pack/plugins/console_extensions/server/lib/spec_definitions/json/overrides/transform.put_transform.json
diff --git a/x-pack/plugins/console_extensions/server/spec/overrides/transform.stop_transform.json b/x-pack/plugins/console_extensions/server/lib/spec_definitions/json/overrides/transform.stop_transform.json
similarity index 100%
rename from x-pack/plugins/console_extensions/server/spec/overrides/transform.stop_transform.json
rename to x-pack/plugins/console_extensions/server/lib/spec_definitions/json/overrides/transform.stop_transform.json
diff --git a/x-pack/plugins/console_extensions/server/spec/overrides/transform.update_transform.json b/x-pack/plugins/console_extensions/server/lib/spec_definitions/json/overrides/transform.update_transform.json
similarity index 100%
rename from x-pack/plugins/console_extensions/server/spec/overrides/transform.update_transform.json
rename to x-pack/plugins/console_extensions/server/lib/spec_definitions/json/overrides/transform.update_transform.json
diff --git a/x-pack/plugins/console_extensions/server/spec/overrides/xpack.graph.explore.json b/x-pack/plugins/console_extensions/server/lib/spec_definitions/json/overrides/xpack.graph.explore.json
similarity index 100%
rename from x-pack/plugins/console_extensions/server/spec/overrides/xpack.graph.explore.json
rename to x-pack/plugins/console_extensions/server/lib/spec_definitions/json/overrides/xpack.graph.explore.json
diff --git a/x-pack/plugins/console_extensions/server/spec/overrides/xpack.info.json b/x-pack/plugins/console_extensions/server/lib/spec_definitions/json/overrides/xpack.info.json
similarity index 100%
rename from x-pack/plugins/console_extensions/server/spec/overrides/xpack.info.json
rename to x-pack/plugins/console_extensions/server/lib/spec_definitions/json/overrides/xpack.info.json
diff --git a/x-pack/plugins/console_extensions/server/spec/overrides/xpack.license.post.json b/x-pack/plugins/console_extensions/server/lib/spec_definitions/json/overrides/xpack.license.post.json
similarity index 100%
rename from x-pack/plugins/console_extensions/server/spec/overrides/xpack.license.post.json
rename to x-pack/plugins/console_extensions/server/lib/spec_definitions/json/overrides/xpack.license.post.json
diff --git a/x-pack/plugins/console_extensions/server/spec/overrides/xpack.rollup.delete_job.json b/x-pack/plugins/console_extensions/server/lib/spec_definitions/json/overrides/xpack.rollup.delete_job.json
similarity index 100%
rename from x-pack/plugins/console_extensions/server/spec/overrides/xpack.rollup.delete_job.json
rename to x-pack/plugins/console_extensions/server/lib/spec_definitions/json/overrides/xpack.rollup.delete_job.json
diff --git a/x-pack/plugins/console_extensions/server/spec/overrides/xpack.rollup.put_job.json b/x-pack/plugins/console_extensions/server/lib/spec_definitions/json/overrides/xpack.rollup.put_job.json
similarity index 100%
rename from x-pack/plugins/console_extensions/server/spec/overrides/xpack.rollup.put_job.json
rename to x-pack/plugins/console_extensions/server/lib/spec_definitions/json/overrides/xpack.rollup.put_job.json
diff --git a/x-pack/plugins/console_extensions/server/spec/overrides/xpack.rollup.rollup_search.json b/x-pack/plugins/console_extensions/server/lib/spec_definitions/json/overrides/xpack.rollup.rollup_search.json
similarity index 100%
rename from x-pack/plugins/console_extensions/server/spec/overrides/xpack.rollup.rollup_search.json
rename to x-pack/plugins/console_extensions/server/lib/spec_definitions/json/overrides/xpack.rollup.rollup_search.json
diff --git a/x-pack/plugins/console_extensions/server/spec/overrides/xpack.security.authenticate.json b/x-pack/plugins/console_extensions/server/lib/spec_definitions/json/overrides/xpack.security.authenticate.json
similarity index 100%
rename from x-pack/plugins/console_extensions/server/spec/overrides/xpack.security.authenticate.json
rename to x-pack/plugins/console_extensions/server/lib/spec_definitions/json/overrides/xpack.security.authenticate.json
diff --git a/x-pack/plugins/console_extensions/server/spec/overrides/xpack.security.change_password.json b/x-pack/plugins/console_extensions/server/lib/spec_definitions/json/overrides/xpack.security.change_password.json
similarity index 100%
rename from x-pack/plugins/console_extensions/server/spec/overrides/xpack.security.change_password.json
rename to x-pack/plugins/console_extensions/server/lib/spec_definitions/json/overrides/xpack.security.change_password.json
diff --git a/x-pack/plugins/console_extensions/server/spec/overrides/xpack.security.get_token.json b/x-pack/plugins/console_extensions/server/lib/spec_definitions/json/overrides/xpack.security.get_token.json
similarity index 100%
rename from x-pack/plugins/console_extensions/server/spec/overrides/xpack.security.get_token.json
rename to x-pack/plugins/console_extensions/server/lib/spec_definitions/json/overrides/xpack.security.get_token.json
diff --git a/x-pack/plugins/console_extensions/server/spec/overrides/xpack.security.invalidate_token.json b/x-pack/plugins/console_extensions/server/lib/spec_definitions/json/overrides/xpack.security.invalidate_token.json
similarity index 100%
rename from x-pack/plugins/console_extensions/server/spec/overrides/xpack.security.invalidate_token.json
rename to x-pack/plugins/console_extensions/server/lib/spec_definitions/json/overrides/xpack.security.invalidate_token.json
diff --git a/x-pack/plugins/console_extensions/server/spec/overrides/xpack.security.put_role.json b/x-pack/plugins/console_extensions/server/lib/spec_definitions/json/overrides/xpack.security.put_role.json
similarity index 100%
rename from x-pack/plugins/console_extensions/server/spec/overrides/xpack.security.put_role.json
rename to x-pack/plugins/console_extensions/server/lib/spec_definitions/json/overrides/xpack.security.put_role.json
diff --git a/x-pack/plugins/console_extensions/server/spec/overrides/xpack.security.put_role_mapping.json b/x-pack/plugins/console_extensions/server/lib/spec_definitions/json/overrides/xpack.security.put_role_mapping.json
similarity index 100%
rename from x-pack/plugins/console_extensions/server/spec/overrides/xpack.security.put_role_mapping.json
rename to x-pack/plugins/console_extensions/server/lib/spec_definitions/json/overrides/xpack.security.put_role_mapping.json
diff --git a/x-pack/plugins/console_extensions/server/spec/overrides/xpack.security.put_user.json b/x-pack/plugins/console_extensions/server/lib/spec_definitions/json/overrides/xpack.security.put_user.json
similarity index 100%
rename from x-pack/plugins/console_extensions/server/spec/overrides/xpack.security.put_user.json
rename to x-pack/plugins/console_extensions/server/lib/spec_definitions/json/overrides/xpack.security.put_user.json
diff --git a/x-pack/plugins/console_extensions/server/spec/overrides/xpack.watcher.execute_watch.json b/x-pack/plugins/console_extensions/server/lib/spec_definitions/json/overrides/xpack.watcher.execute_watch.json
similarity index 100%
rename from x-pack/plugins/console_extensions/server/spec/overrides/xpack.watcher.execute_watch.json
rename to x-pack/plugins/console_extensions/server/lib/spec_definitions/json/overrides/xpack.watcher.execute_watch.json
diff --git a/x-pack/plugins/console_extensions/server/spec/overrides/xpack.watcher.put_watch.json b/x-pack/plugins/console_extensions/server/lib/spec_definitions/json/overrides/xpack.watcher.put_watch.json
similarity index 100%
rename from x-pack/plugins/console_extensions/server/spec/overrides/xpack.watcher.put_watch.json
rename to x-pack/plugins/console_extensions/server/lib/spec_definitions/json/overrides/xpack.watcher.put_watch.json
diff --git a/x-pack/plugins/console_extensions/server/plugin.ts b/x-pack/plugins/console_extensions/server/plugin.ts
index 8c2cb4d0db42b..2a08c258f4bbd 100644
--- a/x-pack/plugins/console_extensions/server/plugin.ts
+++ b/x-pack/plugins/console_extensions/server/plugin.ts
@@ -8,7 +8,7 @@ import { CoreSetup, CoreStart, Logger, Plugin, PluginInitializerContext } from '
import { ConsoleSetup, ConsoleStart } from '../../../../src/plugins/console/server';
-import { processors } from './spec/ingest/index';
+import { processors } from './lib/spec_definitions/js';
interface SetupDependencies {
console: ConsoleSetup;
@@ -18,7 +18,7 @@ interface StartDependencies {
console: ConsoleStart;
}
-const CONSOLE_XPACK_JSON_SPEC_PATH = join(__dirname, 'spec/');
+const CONSOLE_XPACK_JSON_SPEC_PATH = join(__dirname, 'lib/spec_definitions/json');
export class ConsoleExtensionsServerPlugin implements Plugin {
log: Logger;
diff --git a/x-pack/plugins/data_enhanced/kibana.json b/x-pack/plugins/data_enhanced/kibana.json
index b2d5f42d9e468..443bb63a27799 100644
--- a/x-pack/plugins/data_enhanced/kibana.json
+++ b/x-pack/plugins/data_enhanced/kibana.json
@@ -3,7 +3,7 @@
"version": "8.0.0",
"kibanaVersion": "kibana",
"configPath": [
- "xpack"
+ "xpack", "data_enhanced"
],
"requiredPlugins": [
"data"
diff --git a/x-pack/plugins/drilldowns/kibana.json b/x-pack/plugins/drilldowns/kibana.json
index b951c7dc1fc87..4dba07b5a7be3 100644
--- a/x-pack/plugins/drilldowns/kibana.json
+++ b/x-pack/plugins/drilldowns/kibana.json
@@ -3,6 +3,7 @@
"version": "kibana",
"server": false,
"ui": true,
+ "configPath": ["xpack", "drilldowns"],
"requiredPlugins": [
"uiActions",
"embeddable"
diff --git a/x-pack/plugins/endpoint/public/applications/endpoint/models/policy_details_config.ts b/x-pack/plugins/endpoint/public/applications/endpoint/models/policy_details_config.ts
new file mode 100644
index 0000000000000..1900516cb539b
--- /dev/null
+++ b/x-pack/plugins/endpoint/public/applications/endpoint/models/policy_details_config.ts
@@ -0,0 +1,45 @@
+/*
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
+ * or more contributor license agreements. Licensed under the Elastic License;
+ * you may not use this file except in compliance with the Elastic License.
+ */
+
+import { PolicyConfig } from '../types';
+
+/**
+ * A typed Object.entries() function where the keys and values are typed based on the given object
+ */
+const entries = (o: T): Array<[keyof T, T[keyof T]]> =>
+ Object.entries(o) as Array<[keyof T, T[keyof T]]>;
+type DeepPartial = { [K in keyof T]?: DeepPartial };
+
+/**
+ * Returns a deep copy of PolicyDetailsConfig
+ */
+export function clone(policyDetailsConfig: PolicyConfig): PolicyConfig {
+ const clonedConfig: DeepPartial = {};
+ for (const [key, val] of entries(policyDetailsConfig)) {
+ if (typeof val === 'object') {
+ const valClone: Partial = {};
+ clonedConfig[key] = valClone;
+ for (const [key2, val2] of entries(val)) {
+ if (typeof val2 === 'object') {
+ valClone[key2] = {
+ ...val2,
+ };
+ } else {
+ clonedConfig[key] = {
+ ...val,
+ };
+ }
+ }
+ } else {
+ clonedConfig[key] = val;
+ }
+ }
+
+ /**
+ * clonedConfig is typed as DeepPartial so we can construct the copy from an empty object
+ */
+ return clonedConfig as PolicyConfig;
+}
diff --git a/x-pack/plugins/endpoint/public/applications/endpoint/store/policy_details/action.ts b/x-pack/plugins/endpoint/public/applications/endpoint/store/policy_details/action.ts
index cf875e01a6fde..e7e523a9287b8 100644
--- a/x-pack/plugins/endpoint/public/applications/endpoint/store/policy_details/action.ts
+++ b/x-pack/plugins/endpoint/public/applications/endpoint/store/policy_details/action.ts
@@ -4,7 +4,7 @@
* you may not use this file except in compliance with the Elastic License.
*/
-import { PolicyData } from '../../types';
+import { PolicyData, PolicyConfig } from '../../types';
interface ServerReturnedPolicyDetailsData {
type: 'serverReturnedPolicyDetailsData';
@@ -13,4 +13,14 @@ interface ServerReturnedPolicyDetailsData {
};
}
-export type PolicyDetailsAction = ServerReturnedPolicyDetailsData;
+/**
+ * When users change a policy via forms, this action is dispatched with a payload that modifies the configuration of a cloned policy config.
+ */
+interface UserChangedPolicyConfig {
+ type: 'userChangedPolicyConfig';
+ payload: {
+ policyConfig: PolicyConfig;
+ };
+}
+
+export type PolicyDetailsAction = ServerReturnedPolicyDetailsData | UserChangedPolicyConfig;
diff --git a/x-pack/plugins/endpoint/public/applications/endpoint/store/policy_details/index.test.ts b/x-pack/plugins/endpoint/public/applications/endpoint/store/policy_details/index.test.ts
new file mode 100644
index 0000000000000..b20df84fdf575
--- /dev/null
+++ b/x-pack/plugins/endpoint/public/applications/endpoint/store/policy_details/index.test.ts
@@ -0,0 +1,92 @@
+/*
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
+ * or more contributor license agreements. Licensed under the Elastic License;
+ * you may not use this file except in compliance with the Elastic License.
+ */
+
+import { PolicyDetailsState } from '../../types';
+import { createStore, Dispatch, Store } from 'redux';
+import { policyDetailsReducer, PolicyDetailsAction } from './index';
+import { policyConfig, windowsEventing } from './selectors';
+import { clone } from '../../models/policy_details_config';
+
+describe('policy details: ', () => {
+ let store: Store;
+ let getState: typeof store['getState'];
+ let dispatch: Dispatch;
+
+ beforeEach(() => {
+ store = createStore(policyDetailsReducer);
+ getState = store.getState;
+ dispatch = store.dispatch;
+
+ dispatch({
+ type: 'serverReturnedPolicyDetailsData',
+ payload: {
+ policyItem: {
+ id: '',
+ name: '',
+ description: '',
+ config_id: '',
+ enabled: true,
+ output_id: '',
+ inputs: [],
+ namespace: '',
+ package: {
+ name: '',
+ title: '',
+ version: '',
+ },
+ revision: 1,
+ },
+ policyConfig: {
+ windows: {
+ malware: {
+ mode: 'detect',
+ },
+ eventing: {
+ process: false,
+ network: false,
+ },
+ },
+ mac: {
+ malware: {
+ mode: '',
+ },
+ eventing: {
+ process: false,
+ network: false,
+ },
+ },
+ linux: {
+ eventing: {
+ process: false,
+ network: false,
+ },
+ },
+ },
+ },
+ });
+ });
+
+ describe('when the user has enabled windows process eventing', () => {
+ beforeEach(() => {
+ const config = policyConfig(getState());
+ if (!config) {
+ throw new Error();
+ }
+
+ const newPayload1 = clone(config);
+ newPayload1.windows.eventing.process = true;
+
+ dispatch({
+ type: 'userChangedPolicyConfig',
+ payload: { policyConfig: newPayload1 },
+ });
+ });
+
+ it('windows process eventing is enabled', async () => {
+ expect(windowsEventing(getState())!.process).toEqual(true);
+ });
+ });
+});
diff --git a/x-pack/plugins/endpoint/public/applications/endpoint/store/policy_details/middleware.ts b/x-pack/plugins/endpoint/public/applications/endpoint/store/policy_details/middleware.ts
index 39d7eb93569e2..1942538aa9df9 100644
--- a/x-pack/plugins/endpoint/public/applications/endpoint/store/policy_details/middleware.ts
+++ b/x-pack/plugins/endpoint/public/applications/endpoint/store/policy_details/middleware.ts
@@ -5,7 +5,7 @@
*/
import { MiddlewareFactory, PolicyDetailsState } from '../../types';
-import { selectPolicyIdFromParams, isOnPolicyDetailsPage } from './selectors';
+import { policyIdFromParams, isOnPolicyDetailsPage } from './selectors';
import { sendGetDatasource } from '../../services/ingest';
export const policyDetailsMiddlewareFactory: MiddlewareFactory = coreStart => {
@@ -16,7 +16,7 @@ export const policyDetailsMiddlewareFactory: MiddlewareFactory {
return {
policyItem: undefined,
+ policyConfig: undefined,
isLoading: false,
};
};
@@ -34,5 +35,12 @@ export const policyDetailsReducer: Reducer = (
};
}
+ if (action.type === 'userChangedPolicyConfig') {
+ return {
+ ...state,
+ policyConfig: action.payload.policyConfig,
+ };
+ }
+
return state;
};
diff --git a/x-pack/plugins/endpoint/public/applications/endpoint/store/policy_details/selectors.ts b/x-pack/plugins/endpoint/public/applications/endpoint/store/policy_details/selectors.ts
index a08130d0f4b30..6a5d4077b3c32 100644
--- a/x-pack/plugins/endpoint/public/applications/endpoint/store/policy_details/selectors.ts
+++ b/x-pack/plugins/endpoint/public/applications/endpoint/store/policy_details/selectors.ts
@@ -6,9 +6,12 @@
import { createSelector } from 'reselect';
import { PolicyDetailsState } from '../../types';
+import { Immutable } from '../../../../../common/types';
-export const selectPolicyDetails = (state: PolicyDetailsState) => state.policyItem;
+/** Returns the policy details */
+export const policyDetails = (state: PolicyDetailsState) => state.policyItem;
+/** Returns a boolean of whether the user is on the policy details page or not */
export const isOnPolicyDetailsPage = (state: PolicyDetailsState) => {
if (state.location) {
const pathnameParts = state.location.pathname.split('/');
@@ -18,7 +21,8 @@ export const isOnPolicyDetailsPage = (state: PolicyDetailsState) => {
}
};
-export const selectPolicyIdFromParams: (state: PolicyDetailsState) => string = createSelector(
+/** Returns the policyId from the url */
+export const policyIdFromParams: (state: PolicyDetailsState) => string = createSelector(
(state: PolicyDetailsState) => state.location,
(location: PolicyDetailsState['location']) => {
if (location) {
@@ -27,3 +31,32 @@ export const selectPolicyIdFromParams: (state: PolicyDetailsState) => string = c
return '';
}
);
+
+/** Returns the policy configuration */
+export const policyConfig = (state: Immutable) => state.policyConfig;
+
+/** Returns an object of all the windows eventing configuration */
+export const windowsEventing = (state: PolicyDetailsState) => {
+ const config = policyConfig(state);
+ return config && config.windows.eventing;
+};
+
+/** Returns the total number of possible windows eventing configurations */
+export const totalWindowsEventing = (state: PolicyDetailsState): number => {
+ const config = policyConfig(state);
+ if (config) {
+ return Object.keys(config.windows.eventing).length;
+ }
+ return 0;
+};
+
+/** Returns the number of selected windows eventing configurations */
+export const selectedWindowsEventing = (state: PolicyDetailsState): number => {
+ const config = policyConfig(state);
+ if (config) {
+ return Object.values(config.windows.eventing).reduce((count, event) => {
+ return event === true ? count + 1 : count;
+ }, 0);
+ }
+ return 0;
+};
diff --git a/x-pack/plugins/endpoint/public/applications/endpoint/types.ts b/x-pack/plugins/endpoint/public/applications/endpoint/types.ts
index dae2c93c9dd04..6c5330bd78baf 100644
--- a/x-pack/plugins/endpoint/public/applications/endpoint/types.ts
+++ b/x-pack/plugins/endpoint/public/applications/endpoint/types.ts
@@ -75,17 +75,77 @@ export interface PolicyListState {
}
/**
- * Policy list store state
+ * Policy details store state
*/
export interface PolicyDetailsState {
/** A single policy item */
- policyItem: PolicyData | undefined;
+ policyItem?: PolicyData;
/** data is being retrieved from server */
+ policyConfig?: PolicyConfig;
isLoading: boolean;
/** current location of the application */
location?: Immutable;
}
+/**
+ * Policy Details configuration
+ */
+export interface PolicyConfig {
+ windows: WindowsPolicyConfig;
+ mac: MacPolicyConfig;
+ linux: LinuxPolicyConfig;
+}
+
+/**
+ * Windows-specific policy configuration
+ */
+interface WindowsPolicyConfig {
+ /** malware mode can be detect, prevent or prevent and notify user */
+ malware: {
+ mode: string;
+ };
+ eventing: {
+ process: boolean;
+ network: boolean;
+ };
+}
+
+/**
+ * Mac-specific policy configuration
+ */
+interface MacPolicyConfig {
+ /** malware mode can be detect, prevent or prevent and notify user */
+ malware: {
+ mode: string;
+ };
+ eventing: {
+ process: boolean;
+ network: boolean;
+ };
+}
+/**
+ * Linux-specific policy configuration
+ */
+interface LinuxPolicyConfig {
+ eventing: {
+ process: boolean;
+ network: boolean;
+ };
+}
+
+/** OS used in Policy */
+export enum OS {
+ windows = 'windows',
+ mac = 'mac',
+ linux = 'linux',
+}
+
+/** Used in Policy */
+export enum EventingFields {
+ process = 'process',
+ network = 'network',
+}
+
export interface GlobalState {
readonly hostList: HostListState;
readonly alertList: AlertListState;
diff --git a/x-pack/plugins/endpoint/public/applications/endpoint/view/policy/policy_details.tsx b/x-pack/plugins/endpoint/public/applications/endpoint/view/policy/policy_details.tsx
index bdbd323eaab72..7317bd5e03ed9 100644
--- a/x-pack/plugins/endpoint/public/applications/endpoint/view/policy/policy_details.tsx
+++ b/x-pack/plugins/endpoint/public/applications/endpoint/view/policy/policy_details.tsx
@@ -5,13 +5,26 @@
*/
import React from 'react';
-import { EuiTitle } from '@elastic/eui';
+import {
+ EuiTitle,
+ EuiPage,
+ EuiPageBody,
+ EuiPageHeader,
+ EuiPageHeaderSection,
+ EuiFlexGroup,
+ EuiFlexItem,
+ EuiButton,
+ EuiButtonEmpty,
+ EuiText,
+ EuiSpacer,
+} from '@elastic/eui';
import { FormattedMessage } from '@kbn/i18n/react';
import { usePolicyDetailsSelector } from './policy_hooks';
-import { selectPolicyDetails } from '../../store/policy_details/selectors';
+import { policyDetails } from '../../store/policy_details/selectors';
+import { WindowsEventing } from './policy_forms/eventing/windows';
export const PolicyDetails = React.memo(() => {
- const policyItem = usePolicyDetailsSelector(selectPolicyDetails);
+ const policyItem = usePolicyDetailsSelector(policyDetails);
function policyName() {
if (policyItem) {
@@ -29,8 +42,41 @@ export const PolicyDetails = React.memo(() => {
}
return (
-
- {policyName()}
-
+
+
+
+
+
+ {policyName()}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
);
});
diff --git a/x-pack/plugins/endpoint/public/applications/endpoint/view/policy/policy_forms/config_form.tsx b/x-pack/plugins/endpoint/public/applications/endpoint/view/policy/policy_forms/config_form.tsx
new file mode 100644
index 0000000000000..66d5932b91c2b
--- /dev/null
+++ b/x-pack/plugins/endpoint/public/applications/endpoint/view/policy/policy_forms/config_form.tsx
@@ -0,0 +1,110 @@
+/*
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
+ * or more contributor license agreements. Licensed under the Elastic License;
+ * you may not use this file except in compliance with the Elastic License.
+ */
+
+import React from 'react';
+import {
+ EuiCard,
+ EuiFlexGroup,
+ EuiFlexItem,
+ EuiTitle,
+ EuiHorizontalRule,
+ EuiSpacer,
+ EuiText,
+} from '@elastic/eui';
+import { FormattedMessage } from '@kbn/i18n/react';
+import styled from 'styled-components';
+
+const PolicyDetailCard = styled.div`
+ .policyDetailTitleOS {
+ flex-grow: 2;
+ }
+ .policyDetailTitleFlexItem {
+ margin: 0;
+ }
+`;
+export const ConfigForm: React.FC<{
+ type: string;
+ supportedOss: string[];
+ children: React.ReactNode;
+ id: string;
+ selectedEventing: number;
+ totalEventing: number;
+}> = React.memo(({ type, supportedOss, children, id, selectedEventing, totalEventing }) => {
+ const typeTitle = () => {
+ return (
+
+
+
+
+
+
+
+
+
+
+ {type}
+
+
+
+
+
+
+
+
+
+
+
+ {supportedOss.join(', ')}
+
+
+
+
+
+
+
+
+ );
+ };
+
+ const events = () => {
+ return (
+
+
+
+
+
+ );
+ };
+
+ return (
+
+
+
+ {events()}
+
+ {children}
+ >
+ }
+ />
+
+ );
+});
diff --git a/x-pack/plugins/endpoint/public/applications/endpoint/view/policy/policy_forms/eventing/checkbox.tsx b/x-pack/plugins/endpoint/public/applications/endpoint/view/policy/policy_forms/eventing/checkbox.tsx
new file mode 100644
index 0000000000000..add137ea57a5e
--- /dev/null
+++ b/x-pack/plugins/endpoint/public/applications/endpoint/view/policy/policy_forms/eventing/checkbox.tsx
@@ -0,0 +1,49 @@
+/*
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
+ * or more contributor license agreements. Licensed under the Elastic License;
+ * you may not use this file except in compliance with the Elastic License.
+ */
+
+import React, { useCallback } from 'react';
+import { EuiCheckbox } from '@elastic/eui';
+import { useDispatch } from 'react-redux';
+import { usePolicyDetailsSelector } from '../../policy_hooks';
+import { policyConfig, windowsEventing } from '../../../../store/policy_details/selectors';
+import { PolicyDetailsAction } from '../../../../store/policy_details';
+import { OS, EventingFields } from '../../../../types';
+import { clone } from '../../../../models/policy_details_config';
+
+export const EventingCheckbox: React.FC<{
+ id: string;
+ name: string;
+ os: OS;
+ protectionField: EventingFields;
+}> = React.memo(({ id, name, os, protectionField }) => {
+ const policyDetailsConfig = usePolicyDetailsSelector(policyConfig);
+ const eventing = usePolicyDetailsSelector(windowsEventing);
+ const dispatch = useDispatch<(action: PolicyDetailsAction) => void>();
+
+ const handleRadioChange = useCallback(
+ (event: React.ChangeEvent) => {
+ if (policyDetailsConfig) {
+ const newPayload = clone(policyDetailsConfig);
+ newPayload[os].eventing[protectionField] = event.target.checked;
+
+ dispatch({
+ type: 'userChangedPolicyConfig',
+ payload: { policyConfig: newPayload },
+ });
+ }
+ },
+ [dispatch, os, policyDetailsConfig, protectionField]
+ );
+
+ return (
+
+ );
+});
diff --git a/x-pack/plugins/endpoint/public/applications/endpoint/view/policy/policy_forms/eventing/windows.tsx b/x-pack/plugins/endpoint/public/applications/endpoint/view/policy/policy_forms/eventing/windows.tsx
new file mode 100644
index 0000000000000..e92e22fc97fe6
--- /dev/null
+++ b/x-pack/plugins/endpoint/public/applications/endpoint/view/policy/policy_forms/eventing/windows.tsx
@@ -0,0 +1,70 @@
+/*
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
+ * or more contributor license agreements. Licensed under the Elastic License;
+ * you may not use this file except in compliance with the Elastic License.
+ */
+
+import React, { useMemo } from 'react';
+import { i18n } from '@kbn/i18n';
+import { EventingCheckbox } from './checkbox';
+import { OS, EventingFields } from '../../../../types';
+import { usePolicyDetailsSelector } from '../../policy_hooks';
+import {
+ selectedWindowsEventing,
+ totalWindowsEventing,
+} from '../../../../store/policy_details/selectors';
+import { ConfigForm } from '../config_form';
+
+export const WindowsEventing = React.memo(() => {
+ const checkboxes = useMemo(
+ () => [
+ {
+ name: i18n.translate('xpack.endpoint.policyDetailsConfig.eventingProcess', {
+ defaultMessage: 'Process',
+ }),
+ os: OS.windows,
+ protectionField: EventingFields.process,
+ },
+ {
+ name: i18n.translate('xpack.endpoint.policyDetailsConfig.eventingNetwork', {
+ defaultMessage: 'Network',
+ }),
+ os: OS.windows,
+ protectionField: EventingFields.network,
+ },
+ ],
+ []
+ );
+
+ const renderCheckboxes = () => {
+ return checkboxes.map((item, index) => {
+ return (
+
+ );
+ });
+ };
+
+ const selected = usePolicyDetailsSelector(selectedWindowsEventing);
+ const total = usePolicyDetailsSelector(totalWindowsEventing);
+
+ return (
+
+ );
+});
diff --git a/x-pack/plugins/features/kibana.json b/x-pack/plugins/features/kibana.json
index e38d7be892904..325e5a0407493 100644
--- a/x-pack/plugins/features/kibana.json
+++ b/x-pack/plugins/features/kibana.json
@@ -3,6 +3,7 @@
"version": "8.0.0",
"kibanaVersion": "kibana",
"optionalPlugins": ["timelion"],
+ "configPath": ["xpack", "features"],
"server": true,
"ui": true
}
diff --git a/x-pack/plugins/infra/public/containers/logs/log_position/with_log_position_url_state.tsx b/x-pack/plugins/infra/public/containers/logs/log_position/with_log_position_url_state.tsx
index 0d3586f9376f3..ddd5b471a02c6 100644
--- a/x-pack/plugins/infra/public/containers/logs/log_position/with_log_position_url_state.tsx
+++ b/x-pack/plugins/infra/public/containers/logs/log_position/with_log_position_url_state.tsx
@@ -144,5 +144,7 @@ export const replaceLogPositionInQueryString = (time: number) =>
time,
tiebreaker: 0,
},
+ end: new Date(time + ONE_HOUR).toISOString(),
+ start: new Date(time - ONE_HOUR).toISOString(),
streamLive: false,
});
diff --git a/x-pack/plugins/infra/public/pages/link_to/index.ts b/x-pack/plugins/infra/public/pages/link_to/index.ts
index 4c8051f8da73e..27e2d483f8fa9 100644
--- a/x-pack/plugins/infra/public/pages/link_to/index.ts
+++ b/x-pack/plugins/infra/public/pages/link_to/index.ts
@@ -4,6 +4,7 @@
* you may not use this file except in compliance with the Elastic License.
*/
-export { LinkToPage } from './link_to';
+export { LinkToLogsPage } from './link_to_logs';
+export { LinkToMetricsPage } from './link_to_metrics';
export { getNodeLogsUrl, RedirectToNodeLogs } from './redirect_to_node_logs';
export { getNodeDetailUrl, RedirectToNodeDetail } from './redirect_to_node_detail';
diff --git a/x-pack/plugins/infra/public/pages/link_to/link_to_logs.tsx b/x-pack/plugins/infra/public/pages/link_to/link_to_logs.tsx
new file mode 100644
index 0000000000000..04d5c454a92cc
--- /dev/null
+++ b/x-pack/plugins/infra/public/pages/link_to/link_to_logs.tsx
@@ -0,0 +1,34 @@
+/*
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
+ * or more contributor license agreements. Licensed under the Elastic License;
+ * you may not use this file except in compliance with the Elastic License.
+ */
+
+import React from 'react';
+import { match as RouteMatch, Redirect, Route, Switch } from 'react-router-dom';
+
+import { RedirectToLogs } from './redirect_to_logs';
+import { RedirectToNodeLogs } from './redirect_to_node_logs';
+import { inventoryModels } from '../../../common/inventory_models';
+
+interface LinkToPageProps {
+ match: RouteMatch<{}>;
+ location: {
+ search: string;
+ };
+}
+
+const ITEM_TYPES = inventoryModels.map(m => m.id).join('|');
+
+export const LinkToLogsPage: React.FC = props => {
+ return (
+
+
+
+
+
+ );
+};
diff --git a/x-pack/plugins/infra/public/pages/link_to/link_to.tsx b/x-pack/plugins/infra/public/pages/link_to/link_to_metrics.tsx
similarity index 68%
rename from x-pack/plugins/infra/public/pages/link_to/link_to.tsx
rename to x-pack/plugins/infra/public/pages/link_to/link_to_metrics.tsx
index ce62a0a3f4e33..3eb4a9f26fe2e 100644
--- a/x-pack/plugins/infra/public/pages/link_to/link_to.tsx
+++ b/x-pack/plugins/infra/public/pages/link_to/link_to_metrics.tsx
@@ -7,9 +7,7 @@
import React from 'react';
import { match as RouteMatch, Redirect, Route, Switch } from 'react-router-dom';
-import { RedirectToLogs } from './redirect_to_logs';
import { RedirectToNodeDetail } from './redirect_to_node_detail';
-import { RedirectToNodeLogs } from './redirect_to_node_logs';
import { RedirectToHostDetailViaIP } from './redirect_to_host_detail_via_ip';
import { inventoryModels } from '../../../common/inventory_models';
@@ -19,13 +17,9 @@ interface LinkToPageProps {
const ITEM_TYPES = inventoryModels.map(m => m.id).join('|');
-export const LinkToPage: React.FC = props => {
+export const LinkToMetricsPage: React.FC = props => {
return (
-
= props => {
path={`${props.match.url}/host-detail-via-ip/:hostIp`}
component={RedirectToHostDetailViaIP}
/>
-
-
+
);
};
diff --git a/x-pack/plugins/infra/public/pages/link_to/redirect_to_logs.test.tsx b/x-pack/plugins/infra/public/pages/link_to/redirect_to_logs.test.tsx
index b4ed43f84e27f..0556955e47f66 100644
--- a/x-pack/plugins/infra/public/pages/link_to/redirect_to_logs.test.tsx
+++ b/x-pack/plugins/infra/public/pages/link_to/redirect_to_logs.test.tsx
@@ -19,7 +19,7 @@ describe('RedirectToLogs component', () => {
expect(component).toMatchInlineSnapshot(`
`);
});
@@ -33,7 +33,7 @@ describe('RedirectToLogs component', () => {
expect(component).toMatchInlineSnapshot(`
`);
});
diff --git a/x-pack/plugins/infra/public/pages/link_to/redirect_to_node_logs.test.tsx b/x-pack/plugins/infra/public/pages/link_to/redirect_to_node_logs.test.tsx
index 519ee64060932..1394fc48107ef 100644
--- a/x-pack/plugins/infra/public/pages/link_to/redirect_to_node_logs.test.tsx
+++ b/x-pack/plugins/infra/public/pages/link_to/redirect_to_node_logs.test.tsx
@@ -73,7 +73,7 @@ describe('RedirectToNodeLogs component', () => {
expect(component).toMatchInlineSnapshot(`
`);
});
@@ -89,7 +89,7 @@ describe('RedirectToNodeLogs component', () => {
expect(component).toMatchInlineSnapshot(`
`);
});
diff --git a/x-pack/plugins/infra/public/routers/logs_router.tsx b/x-pack/plugins/infra/public/routers/logs_router.tsx
index 6700ed1fc8479..8258f087b5872 100644
--- a/x-pack/plugins/infra/public/routers/logs_router.tsx
+++ b/x-pack/plugins/infra/public/routers/logs_router.tsx
@@ -8,7 +8,7 @@ import React from 'react';
import { Route, Router, Switch } from 'react-router-dom';
import { NotFoundPage } from '../pages/404';
-import { LinkToPage } from '../pages/link_to';
+import { LinkToLogsPage } from '../pages/link_to';
import { LogsPage } from '../pages/logs';
import { RedirectWithQueryParams } from '../utils/redirect_with_query_params';
import { useKibana } from '../../../../../src/plugins/kibana_react/public';
@@ -19,7 +19,7 @@ export const LogsRouter: AppRouter = ({ history }) => {
return (
-
+
{uiCapabilities?.logs?.show && (
)}
diff --git a/x-pack/plugins/infra/public/routers/metrics_router.tsx b/x-pack/plugins/infra/public/routers/metrics_router.tsx
index 7c2ebed8463f1..7cb9de65e7291 100644
--- a/x-pack/plugins/infra/public/routers/metrics_router.tsx
+++ b/x-pack/plugins/infra/public/routers/metrics_router.tsx
@@ -9,7 +9,7 @@ import { Route, Router, Switch } from 'react-router-dom';
import { NotFoundPage } from '../pages/404';
import { InfrastructurePage } from '../pages/infrastructure';
-import { LinkToPage } from '../pages/link_to';
+import { LinkToMetricsPage } from '../pages/link_to';
import { MetricDetail } from '../pages/metrics';
import { RedirectWithQueryParams } from '../utils/redirect_with_query_params';
import { useKibana } from '../../../../../src/plugins/kibana_react/public';
@@ -20,7 +20,7 @@ export const MetricsRouter: AppRouter = ({ history }) => {
return (
-
+
{uiCapabilities?.infrastructure?.show && (
)}
diff --git a/x-pack/plugins/infra/server/lib/adapters/log_entries/kibana_log_entries_adapter.ts b/x-pack/plugins/infra/server/lib/adapters/log_entries/kibana_log_entries_adapter.ts
index 3a5dff75f004e..b8513541be7ae 100644
--- a/x-pack/plugins/infra/server/lib/adapters/log_entries/kibana_log_entries_adapter.ts
+++ b/x-pack/plugins/infra/server/lib/adapters/log_entries/kibana_log_entries_adapter.ts
@@ -112,7 +112,7 @@ export class InfraKibanaLogEntriesAdapter implements LogEntriesAdapter {
);
const hits = sortDirection === 'asc' ? esResult.hits.hits : esResult.hits.hits.reverse();
- return mapHitsToLogEntryDocuments(hits, sourceConfiguration.fields.timestamp, fields);
+ return mapHitsToLogEntryDocuments(hits, fields);
}
public async getContainedLogSummaryBuckets(
@@ -226,11 +226,7 @@ export class InfraKibanaLogEntriesAdapter implements LogEntriesAdapter {
}
}
-function mapHitsToLogEntryDocuments(
- hits: SortedSearchHit[],
- timestampField: string,
- fields: string[]
-): LogEntryDocument[] {
+function mapHitsToLogEntryDocuments(hits: SortedSearchHit[], fields: string[]): LogEntryDocument[] {
return hits.map(hit => {
const logFields = fields.reduce<{ [fieldName: string]: JsonValue }>(
(flattenedFields, field) => {
@@ -243,10 +239,8 @@ function mapHitsToLogEntryDocuments(
);
return {
- gid: hit._id,
- // timestamp: hit._source[timestampField],
- // FIXME s/key/cursor/g
- key: { time: hit.sort[0], tiebreaker: hit.sort[1] },
+ id: hit._id,
+ cursor: { time: hit.sort[0], tiebreaker: hit.sort[1] },
fields: logFields,
highlights: hit.highlight || {},
};
diff --git a/x-pack/plugins/infra/server/lib/domains/log_entries_domain/log_entries_domain.ts b/x-pack/plugins/infra/server/lib/domains/log_entries_domain/log_entries_domain.ts
index 9a2631e3c2f76..a88b1d9049c76 100644
--- a/x-pack/plugins/infra/server/lib/domains/log_entries_domain/log_entries_domain.ts
+++ b/x-pack/plugins/infra/server/lib/domains/log_entries_domain/log_entries_domain.ts
@@ -7,7 +7,6 @@
import { sortBy } from 'lodash';
import { RequestHandlerContext } from 'src/core/server';
-import { TimeKey } from '../../../../common/time';
import { JsonObject } from '../../../../common/typed_json';
import {
LogEntriesSummaryBucket,
@@ -56,9 +55,7 @@ export class InfraLogEntriesDomain {
private readonly libs: { sources: InfraSources }
) {}
- /* Name is temporary until we can clean up the GraphQL implementation */
- /* eslint-disable-next-line @typescript-eslint/camelcase */
- public async getLogEntriesAround__new(
+ public async getLogEntriesAround(
requestContext: RequestHandlerContext,
sourceId: string,
params: LogEntriesAroundParams
@@ -133,14 +130,14 @@ export class InfraLogEntriesDomain {
const entries = documents.map(doc => {
return {
- id: doc.gid,
- cursor: doc.key,
+ id: doc.id,
+ cursor: doc.cursor,
columns: configuration.logColumns.map(
(column): LogColumn => {
if ('timestampColumn' in column) {
return {
columnId: column.timestampColumn.id,
- timestamp: doc.key.time,
+ timestamp: doc.cursor.time,
};
} else if ('messageColumn' in column) {
return {
@@ -292,17 +289,17 @@ export interface LogEntriesAdapter {
export type LogEntryQuery = JsonObject;
export interface LogEntryDocument {
+ id: string;
fields: Fields;
- gid: string;
highlights: Highlights;
- key: TimeKey;
+ cursor: LogEntriesCursor;
}
export interface LogSummaryBucket {
entriesCount: number;
start: number;
end: number;
- topEntryKeys: TimeKey[];
+ topEntryKeys: LogEntriesCursor[];
}
const logSummaryBucketHasEntries = (bucket: LogSummaryBucket) =>
diff --git a/x-pack/plugins/infra/server/routes/log_entries/entries.ts b/x-pack/plugins/infra/server/routes/log_entries/entries.ts
index f33dfa71fedcd..2cd889d9c5568 100644
--- a/x-pack/plugins/infra/server/routes/log_entries/entries.ts
+++ b/x-pack/plugins/infra/server/routes/log_entries/entries.ts
@@ -48,7 +48,7 @@ export const initLogEntriesRoute = ({ framework, logEntries }: InfraBackendLibs)
let entries;
if ('center' in payload) {
- entries = await logEntries.getLogEntriesAround__new(requestContext, sourceId, {
+ entries = await logEntries.getLogEntriesAround(requestContext, sourceId, {
startTimestamp,
endTimestamp,
query: parseFilterQuery(query),
diff --git a/x-pack/plugins/infra/server/routes/log_entries/highlights.ts b/x-pack/plugins/infra/server/routes/log_entries/highlights.ts
index 2e581d96cab9c..9a61c8fa5aa9b 100644
--- a/x-pack/plugins/infra/server/routes/log_entries/highlights.ts
+++ b/x-pack/plugins/infra/server/routes/log_entries/highlights.ts
@@ -45,7 +45,7 @@ export const initLogEntriesHighlightsRoute = ({ framework, logEntries }: InfraBa
if ('center' in payload) {
entriesPerHighlightTerm = await Promise.all(
highlightTerms.map(highlightTerm =>
- logEntries.getLogEntriesAround__new(requestContext, sourceId, {
+ logEntries.getLogEntriesAround(requestContext, sourceId, {
startTimestamp,
endTimestamp,
query: parseFilterQuery(query),
diff --git a/x-pack/plugins/ingest_manager/public/plugin.ts b/x-pack/plugins/ingest_manager/public/plugin.ts
index 99dcebd9bfba1..d7be1c1f1fe6e 100644
--- a/x-pack/plugins/ingest_manager/public/plugin.ts
+++ b/x-pack/plugins/ingest_manager/public/plugin.ts
@@ -32,7 +32,9 @@ export interface IngestManagerStartDeps {
data: DataPublicPluginStart;
}
-export class IngestManagerPlugin implements Plugin {
+export class IngestManagerPlugin
+ implements
+ Plugin {
private config: IngestManagerConfigType;
constructor(private readonly initializerContext: PluginInitializerContext) {
@@ -50,7 +52,8 @@ export class IngestManagerPlugin implements Plugin {
async mount(params: AppMountParameters) {
const [coreStart, startDeps] = (await core.getStartServices()) as [
CoreStart,
- IngestManagerStartDeps
+ IngestManagerStartDeps,
+ IngestManagerStart
];
const { renderApp } = await import('./applications/ingest_manager');
return renderApp(coreStart, params, deps, startDeps, config);
diff --git a/x-pack/plugins/lens/kibana.json b/x-pack/plugins/lens/kibana.json
index 867a7454f0448..6abdaad7903be 100644
--- a/x-pack/plugins/lens/kibana.json
+++ b/x-pack/plugins/lens/kibana.json
@@ -4,5 +4,6 @@
"kibanaVersion": "kibana",
"server": true,
"ui": false,
- "optionalPlugins": ["usageCollection", "taskManager"]
+ "optionalPlugins": ["usageCollection", "taskManager"],
+ "configPath": ["xpack", "lens"]
}
diff --git a/x-pack/legacy/plugins/maps/common/data_request_descriptor_types.d.ts b/x-pack/plugins/maps/common/descriptor_types/data_request_descriptor_types.d.ts
similarity index 100%
rename from x-pack/legacy/plugins/maps/common/data_request_descriptor_types.d.ts
rename to x-pack/plugins/maps/common/descriptor_types/data_request_descriptor_types.d.ts
diff --git a/x-pack/legacy/plugins/maps/common/descriptor_types.d.ts b/x-pack/plugins/maps/common/descriptor_types/descriptor_types.d.ts
similarity index 99%
rename from x-pack/legacy/plugins/maps/common/descriptor_types.d.ts
rename to x-pack/plugins/maps/common/descriptor_types/descriptor_types.d.ts
index cfbcb65255ab2..fb49e1aaebe1c 100644
--- a/x-pack/legacy/plugins/maps/common/descriptor_types.d.ts
+++ b/x-pack/plugins/maps/common/descriptor_types/descriptor_types.d.ts
@@ -5,7 +5,7 @@
*/
/* eslint-disable @typescript-eslint/consistent-type-definitions */
-import { AGG_TYPE, GRID_RESOLUTION, RENDER_AS, SORT_ORDER, SCALING_TYPES } from './constants';
+import { AGG_TYPE, GRID_RESOLUTION, RENDER_AS, SORT_ORDER, SCALING_TYPES } from '../constants';
import { VectorStyleDescriptor } from './style_property_descriptor_types';
import { DataRequestDescriptor } from './data_request_descriptor_types';
diff --git a/x-pack/plugins/maps/common/descriptor_types/index.ts b/x-pack/plugins/maps/common/descriptor_types/index.ts
new file mode 100644
index 0000000000000..af0f4487f471b
--- /dev/null
+++ b/x-pack/plugins/maps/common/descriptor_types/index.ts
@@ -0,0 +1,10 @@
+/*
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
+ * or more contributor license agreements. Licensed under the Elastic License;
+ * you may not use this file except in compliance with the Elastic License.
+ */
+
+export * from './data_request_descriptor_types';
+export * from './descriptor_types';
+export * from './map_descriptor';
+export * from './style_property_descriptor_types';
diff --git a/x-pack/legacy/plugins/maps/common/map_descriptor.ts b/x-pack/plugins/maps/common/descriptor_types/map_descriptor.ts
similarity index 100%
rename from x-pack/legacy/plugins/maps/common/map_descriptor.ts
rename to x-pack/plugins/maps/common/descriptor_types/map_descriptor.ts
diff --git a/x-pack/legacy/plugins/maps/common/style_property_descriptor_types.d.ts b/x-pack/plugins/maps/common/descriptor_types/style_property_descriptor_types.d.ts
similarity index 99%
rename from x-pack/legacy/plugins/maps/common/style_property_descriptor_types.d.ts
rename to x-pack/plugins/maps/common/descriptor_types/style_property_descriptor_types.d.ts
index 2fce56339e106..47e56ff96d623 100644
--- a/x-pack/legacy/plugins/maps/common/style_property_descriptor_types.d.ts
+++ b/x-pack/plugins/maps/common/descriptor_types/style_property_descriptor_types.d.ts
@@ -12,7 +12,7 @@ import {
VECTOR_STYLES,
STYLE_TYPE,
LAYER_STYLE_TYPE,
-} from './constants';
+} from '../constants';
// Non-static/dynamic options
export type SymbolizeAsOptions = {
diff --git a/x-pack/plugins/ml/public/index.ts b/x-pack/plugins/ml/public/index.ts
index f9f2be390e05f..8070f94a1264d 100755
--- a/x-pack/plugins/ml/public/index.ts
+++ b/x-pack/plugins/ml/public/index.ts
@@ -6,8 +6,19 @@
import { PluginInitializer } from 'kibana/public';
import './index.scss';
-import { MlPlugin, MlPluginSetup, MlPluginStart } from './plugin';
+import {
+ MlPlugin,
+ MlPluginSetup,
+ MlPluginStart,
+ MlSetupDependencies,
+ MlStartDependencies,
+} from './plugin';
-export const plugin: PluginInitializer = () => new MlPlugin();
+export const plugin: PluginInitializer<
+ MlPluginSetup,
+ MlPluginStart,
+ MlSetupDependencies,
+ MlStartDependencies
+> = () => new MlPlugin();
export { MlPluginSetup, MlPluginStart };
diff --git a/x-pack/plugins/ml/public/plugin.ts b/x-pack/plugins/ml/public/plugin.ts
index d4bec3d617a04..62b60f81b672f 100644
--- a/x-pack/plugins/ml/public/plugin.ts
+++ b/x-pack/plugins/ml/public/plugin.ts
@@ -31,7 +31,7 @@ export interface MlSetupDependencies {
}
export class MlPlugin implements Plugin {
- setup(core: CoreSetup, pluginsSetup: MlSetupDependencies) {
+ setup(core: CoreSetup, pluginsSetup: MlSetupDependencies) {
core.application.register({
id: PLUGIN_ID,
title: i18n.translate('xpack.ml.plugin.title', {
diff --git a/x-pack/plugins/monitoring/server/lib/elasticsearch/nodes/get_nodes/get_nodes.js b/x-pack/plugins/monitoring/server/lib/elasticsearch/nodes/get_nodes/get_nodes.js
index c248ad743e0ec..d431ec47adbcb 100644
--- a/x-pack/plugins/monitoring/server/lib/elasticsearch/nodes/get_nodes/get_nodes.js
+++ b/x-pack/plugins/monitoring/server/lib/elasticsearch/nodes/get_nodes/get_nodes.js
@@ -84,7 +84,7 @@ export async function getNodes(req, esIndexPattern, pageOfNodes, clusterStats, n
by_date: {
date_histogram: {
field: 'timestamp',
- min_doc_count: 1,
+ min_doc_count: 0,
fixed_interval: bucketSize + 's',
},
aggs: getMetricAggs(LISTING_METRICS_NAMES, bucketSize),
diff --git a/x-pack/plugins/monitoring/server/plugin.ts b/x-pack/plugins/monitoring/server/plugin.ts
index d9500284b52dc..24d8bcaa4397c 100644
--- a/x-pack/plugins/monitoring/server/plugin.ts
+++ b/x-pack/plugins/monitoring/server/plugin.ts
@@ -224,7 +224,7 @@ export class Plugin {
this.monitoringCore = this.getLegacyShim(
config,
legacyConfig,
- core.getStartServices as () => Promise<[CoreStart, PluginsStart]>,
+ core.getStartServices as () => Promise<[CoreStart, PluginsStart, {}]>,
this.licenseService,
this.cluster
);
@@ -293,7 +293,7 @@ export class Plugin {
getLegacyShim(
config: MonitoringConfig,
legacyConfig: any,
- getCoreServices: () => Promise<[CoreStart, PluginsStart]>,
+ getCoreServices: () => Promise<[CoreStart, PluginsStart, {}]>,
licenseService: MonitoringLicenseService,
cluster: ICustomClusterClient
): MonitoringCore {
diff --git a/x-pack/plugins/observability/kibana.json b/x-pack/plugins/observability/kibana.json
index 57063ea729ed6..438b9ddea4734 100644
--- a/x-pack/plugins/observability/kibana.json
+++ b/x-pack/plugins/observability/kibana.json
@@ -2,5 +2,6 @@
"id": "observability",
"version": "8.0.0",
"kibanaVersion": "kibana",
+ "configPath": ["xpack", "observability"],
"ui": true
}
diff --git a/x-pack/plugins/oss_telemetry/kibana.json b/x-pack/plugins/oss_telemetry/kibana.json
index d83894f7c44a3..0defee0881e0e 100644
--- a/x-pack/plugins/oss_telemetry/kibana.json
+++ b/x-pack/plugins/oss_telemetry/kibana.json
@@ -4,5 +4,6 @@
"version": "8.0.0",
"kibanaVersion": "kibana",
"requiredPlugins": ["usageCollection", "taskManager"],
+ "configPath": ["xpack", "oss_telemetry"],
"ui": false
}
diff --git a/x-pack/plugins/remote_clusters/common/lib/cluster_serialization.test.ts b/x-pack/plugins/remote_clusters/common/lib/cluster_serialization.test.ts
index 10b3dbbd9b452..7fd8b4a894989 100644
--- a/x-pack/plugins/remote_clusters/common/lib/cluster_serialization.test.ts
+++ b/x-pack/plugins/remote_clusters/common/lib/cluster_serialization.test.ts
@@ -124,6 +124,7 @@ describe('cluster_serialization', () => {
skipUnavailable: false,
transportPingSchedule: '-1',
transportCompress: false,
+ serverName: 'localhost',
});
});
@@ -155,6 +156,38 @@ describe('cluster_serialization', () => {
expect(() => serializeCluster('foo')).toThrowError();
});
+ it('should serialize a cluster that has a deprecated proxy setting', () => {
+ expect(
+ serializeCluster({
+ name: 'test_cluster',
+ proxyAddress: 'localhost:9300',
+ mode: 'proxy',
+ isConnected: true,
+ skipUnavailable: false,
+ proxySocketConnections: 18,
+ serverName: 'localhost',
+ hasDeprecatedProxySetting: true,
+ })
+ ).toEqual({
+ persistent: {
+ cluster: {
+ remote: {
+ test_cluster: {
+ mode: 'proxy',
+ proxy_socket_connections: 18,
+ proxy_address: 'localhost:9300',
+ skip_unavailable: false,
+ server_name: 'localhost',
+ proxy: null,
+ seeds: null,
+ node_connections: null,
+ },
+ },
+ },
+ },
+ });
+ });
+
it('should serialize a complete cluster object to only dynamic properties', () => {
expect(
serializeCluster({
@@ -167,13 +200,14 @@ describe('cluster_serialization', () => {
skipUnavailable: false,
transportPingSchedule: '-1',
transportCompress: false,
+ mode: 'sniff',
})
).toEqual({
persistent: {
cluster: {
remote: {
test_cluster: {
- mode: null,
+ mode: 'sniff',
node_connections: null,
proxy_address: null,
proxy_socket_connections: null,
diff --git a/x-pack/plugins/remote_clusters/common/lib/cluster_serialization.ts b/x-pack/plugins/remote_clusters/common/lib/cluster_serialization.ts
index d0898fda93a41..3d8ffa13b8218 100644
--- a/x-pack/plugins/remote_clusters/common/lib/cluster_serialization.ts
+++ b/x-pack/plugins/remote_clusters/common/lib/cluster_serialization.ts
@@ -6,7 +6,8 @@
import { PROXY_MODE } from '../constants';
-export interface ClusterEs {
+// Values returned from ES GET /_remote/info
+export interface ClusterInfoEs {
seeds?: string[];
mode?: 'proxy' | 'sniff';
connected?: boolean;
@@ -42,19 +43,23 @@ export interface Cluster {
connectedSocketsCount?: number;
hasDeprecatedProxySetting?: boolean;
}
-export interface ClusterPayload {
+
+interface ClusterPayloadEs {
+ skip_unavailable?: boolean | null;
+ mode?: 'sniff' | 'proxy' | null;
+ proxy_address?: string | null;
+ proxy_socket_connections?: number | null;
+ server_name?: string | null;
+ seeds?: string[] | null;
+ node_connections?: number | null;
+ proxy?: null;
+}
+// Payload expected from ES PUT /_cluster/settings
+export interface ClusterSettingsPayloadEs {
persistent: {
cluster: {
remote: {
- [key: string]: {
- skip_unavailable?: boolean | null;
- mode?: 'sniff' | 'proxy' | null;
- proxy_address?: string | null;
- proxy_socket_connections?: number | null;
- server_name?: string | null;
- seeds?: string[] | null;
- node_connections?: number | null;
- };
+ [key: string]: ClusterPayloadEs;
};
};
};
@@ -62,7 +67,7 @@ export interface ClusterPayload {
export function deserializeCluster(
name: string,
- esClusterObject: ClusterEs,
+ esClusterObject: ClusterInfoEs,
deprecatedProxyAddress?: string | undefined
): Cluster {
if (!name || !esClusterObject || typeof esClusterObject !== 'object') {
@@ -112,12 +117,16 @@ export function deserializeCluster(
// If a user has a remote cluster with the deprecated proxy setting,
// we transform the data to support the new implementation and also flag the deprecation
if (deprecatedProxyAddress) {
+ // Create server name (address, without port), since field doesn't exist in deprecated implementation
+ const defaultServerName = deprecatedProxyAddress.split(':')[0];
+
deserializedClusterObject = {
...deserializedClusterObject,
proxyAddress: deprecatedProxyAddress,
seeds: undefined,
hasDeprecatedProxySetting: true,
mode: PROXY_MODE,
+ serverName: defaultServerName,
};
}
@@ -131,7 +140,7 @@ export function deserializeCluster(
return deserializedClusterObject;
}
-export function serializeCluster(deserializedClusterObject: Cluster): ClusterPayload {
+export function serializeCluster(deserializedClusterObject: Cluster): ClusterSettingsPayloadEs {
if (!deserializedClusterObject || typeof deserializedClusterObject !== 'object') {
throw new Error('Unable to serialize cluster');
}
@@ -145,22 +154,31 @@ export function serializeCluster(deserializedClusterObject: Cluster): ClusterPay
proxyAddress,
proxySocketConnections,
serverName,
+ hasDeprecatedProxySetting,
} = deserializedClusterObject;
+ const clusterData: ClusterPayloadEs = {
+ skip_unavailable: typeof skipUnavailable === 'boolean' ? skipUnavailable : null,
+ mode: mode || null,
+ proxy_address: proxyAddress || null,
+ proxy_socket_connections: proxySocketConnections || null,
+ server_name: serverName || null,
+ seeds: seeds || null,
+ node_connections: nodeConnections || null,
+ };
+
+ // This is only applicable in edit mode
+ // In order to "upgrade" an existing remote cluster to use the new proxy mode settings, we need to set the old proxy setting to null
+ if (hasDeprecatedProxySetting) {
+ clusterData.proxy = null;
+ }
+
return {
// Background on why we only save as persistent settings detailed here: https://github.com/elastic/kibana/pull/26067#issuecomment-441848124
persistent: {
cluster: {
remote: {
- [name]: {
- skip_unavailable: typeof skipUnavailable === 'boolean' ? skipUnavailable : null,
- mode: mode || null,
- proxy_address: proxyAddress || null,
- proxy_socket_connections: proxySocketConnections || null,
- server_name: serverName || null,
- seeds: seeds || null,
- node_connections: nodeConnections || null,
- },
+ [name]: clusterData,
},
},
},
diff --git a/x-pack/plugins/remote_clusters/common/lib/index.ts b/x-pack/plugins/remote_clusters/common/lib/index.ts
index 52a0536bfd55b..43cf004becff9 100644
--- a/x-pack/plugins/remote_clusters/common/lib/index.ts
+++ b/x-pack/plugins/remote_clusters/common/lib/index.ts
@@ -4,4 +4,9 @@
* you may not use this file except in compliance with the Elastic License.
*/
-export { deserializeCluster, serializeCluster, Cluster, ClusterEs } from './cluster_serialization';
+export {
+ deserializeCluster,
+ serializeCluster,
+ Cluster,
+ ClusterInfoEs,
+} from './cluster_serialization';
diff --git a/x-pack/plugins/remote_clusters/public/application/sections/components/remote_cluster_form/remote_cluster_form.js b/x-pack/plugins/remote_clusters/public/application/sections/components/remote_cluster_form/remote_cluster_form.js
index 94d6ca4ebb648..7d3ed0708ae54 100644
--- a/x-pack/plugins/remote_clusters/public/application/sections/components/remote_cluster_form/remote_cluster_form.js
+++ b/x-pack/plugins/remote_clusters/public/application/sections/components/remote_cluster_form/remote_cluster_form.js
@@ -135,6 +135,7 @@ export class RemoteClusterForm extends Component {
skipUnavailable,
},
} = this.state;
+ const { fields } = this.props;
let modeSettings;
@@ -155,6 +156,7 @@ export class RemoteClusterForm extends Component {
name,
skipUnavailable,
mode,
+ hasDeprecatedProxySetting: fields.hasDeprecatedProxySetting,
...modeSettings,
};
}
diff --git a/x-pack/plugins/remote_clusters/server/routes/api/delete_route.test.ts b/x-pack/plugins/remote_clusters/server/routes/api/delete_route.test.ts
index cf14f8a67054e..ec14336da08d4 100644
--- a/x-pack/plugins/remote_clusters/server/routes/api/delete_route.test.ts
+++ b/x-pack/plugins/remote_clusters/server/routes/api/delete_route.test.ts
@@ -84,6 +84,20 @@ describe('DELETE remote clusters', () => {
describe('success', () => {
deleteRemoteClustersTest('deletes remote cluster', {
apiResponses: [
+ async () => ({
+ persistent: {
+ cluster: {
+ remote: {
+ test: {
+ seeds: ['127.0.0.1:9300'],
+ skip_unavailable: false,
+ mode: 'sniff',
+ },
+ },
+ },
+ },
+ transient: {},
+ }),
async () => ({
test: {
connected: true,
@@ -143,7 +157,17 @@ describe('DELETE remote clusters', () => {
deleteRemoteClustersTest(
'returns errors array with 404 error if remote cluster does not exist',
{
- apiResponses: [async () => ({})],
+ apiResponses: [
+ async () => ({
+ persistent: {
+ cluster: {
+ remote: {},
+ },
+ },
+ transient: {},
+ }),
+ async () => ({}),
+ ],
params: {
nameOrNames: 'test',
},
@@ -178,6 +202,20 @@ describe('DELETE remote clusters', () => {
'returns errors array with 400 error if ES still returns cluster information',
{
apiResponses: [
+ async () => ({
+ persistent: {
+ cluster: {
+ remote: {
+ test: {
+ seeds: ['127.0.0.1:9300'],
+ skip_unavailable: false,
+ mode: 'sniff',
+ },
+ },
+ },
+ },
+ transient: {},
+ }),
async () => ({
test: {
connected: true,
diff --git a/x-pack/plugins/remote_clusters/server/routes/api/delete_route.ts b/x-pack/plugins/remote_clusters/server/routes/api/delete_route.ts
index 742780ffed309..07b0fa3fd9cd7 100644
--- a/x-pack/plugins/remote_clusters/server/routes/api/delete_route.ts
+++ b/x-pack/plugins/remote_clusters/server/routes/api/delete_route.ts
@@ -37,6 +37,8 @@ export const register = (deps: RouteDependencies): void => {
const itemsDeleted: any[] = [];
const errors: any[] = [];
+ const clusterSettings = await callAsCurrentUser('cluster.getSettings');
+
// Validator that returns an error if the remote cluster does not exist.
const validateClusterDoesExist = async (name: string) => {
try {
@@ -60,9 +62,12 @@ export const register = (deps: RouteDependencies): void => {
};
// Send the request to delete the cluster and return an error if it could not be deleted.
- const sendRequestToDeleteCluster = async (name: string) => {
+ const sendRequestToDeleteCluster = async (
+ name: string,
+ hasDeprecatedProxySetting: boolean
+ ) => {
try {
- const body = serializeCluster({ name });
+ const body = serializeCluster({ name, hasDeprecatedProxySetting });
const updateClusterResponse = await callAsCurrentUser('cluster.putSettings', { body });
const acknowledged = get(updateClusterResponse, 'acknowledged');
const cluster = get(updateClusterResponse, `persistent.cluster.remote.${name}`);
@@ -98,8 +103,12 @@ export const register = (deps: RouteDependencies): void => {
let error: any = await validateClusterDoesExist(clusterName);
if (!error) {
+ // Check if cluster contains deprecated proxy setting
+ const hasDeprecatedProxySetting = Boolean(
+ get(clusterSettings, `persistent.cluster.remote[${clusterName}].proxy`, undefined)
+ );
// Delete the cluster.
- error = await sendRequestToDeleteCluster(clusterName);
+ error = await sendRequestToDeleteCluster(clusterName, hasDeprecatedProxySetting);
}
if (error) {
diff --git a/x-pack/plugins/remote_clusters/server/routes/api/update_route.ts b/x-pack/plugins/remote_clusters/server/routes/api/update_route.ts
index 14b161b6f26b5..47b0d4ad2def2 100644
--- a/x-pack/plugins/remote_clusters/server/routes/api/update_route.ts
+++ b/x-pack/plugins/remote_clusters/server/routes/api/update_route.ts
@@ -10,7 +10,7 @@ import { i18n } from '@kbn/i18n';
import { RequestHandler } from 'src/core/server';
import { API_BASE_PATH, SNIFF_MODE, PROXY_MODE } from '../../../common/constants';
-import { serializeCluster, deserializeCluster, Cluster, ClusterEs } from '../../../common/lib';
+import { serializeCluster, deserializeCluster, Cluster, ClusterInfoEs } from '../../../common/lib';
import { doesClusterExist } from '../../lib/does_cluster_exist';
import { RouteDependencies } from '../../types';
import { licensePreRoutingFactory } from '../../lib/license_pre_routing_factory';
@@ -68,7 +68,10 @@ export const register = (deps: RouteDependencies): void => {
});
const acknowledged = get(updateClusterResponse, 'acknowledged');
- const cluster = get(updateClusterResponse, `persistent.cluster.remote.${name}`) as ClusterEs;
+ const cluster = get(
+ updateClusterResponse,
+ `persistent.cluster.remote.${name}`
+ ) as ClusterInfoEs;
if (acknowledged && cluster) {
const body = {
diff --git a/x-pack/plugins/reporting/kibana.json b/x-pack/plugins/reporting/kibana.json
index a7e2bd288f0b1..3da2d2a094706 100644
--- a/x-pack/plugins/reporting/kibana.json
+++ b/x-pack/plugins/reporting/kibana.json
@@ -2,6 +2,7 @@
"id": "reporting",
"version": "8.0.0",
"kibanaVersion": "kibana",
+ "configPath": ["xpack", "reporting"],
"requiredPlugins": [
"home",
"management",
diff --git a/x-pack/plugins/searchprofiler/kibana.json b/x-pack/plugins/searchprofiler/kibana.json
index 1831308212402..f92083ee9d9fe 100644
--- a/x-pack/plugins/searchprofiler/kibana.json
+++ b/x-pack/plugins/searchprofiler/kibana.json
@@ -3,6 +3,7 @@
"version": "8.0.0",
"kibanaVersion": "kibana",
"requiredPlugins": ["devTools", "home", "licensing"],
+ "configPath": ["xpack", "searchprofiler"],
"server": true,
"ui": true
}
diff --git a/x-pack/plugins/security/public/account_management/account_management_app.test.ts b/x-pack/plugins/security/public/account_management/account_management_app.test.ts
index ad40c61718c73..bac98d5639755 100644
--- a/x-pack/plugins/security/public/account_management/account_management_app.test.ts
+++ b/x-pack/plugins/security/public/account_management/account_management_app.test.ts
@@ -38,7 +38,7 @@ describe('accountManagementApp', () => {
it('properly sets breadcrumbs and renders application', async () => {
const coreSetupMock = coreMock.createSetup();
const coreStartMock = coreMock.createStart();
- coreSetupMock.getStartServices.mockResolvedValue([coreStartMock, {}]);
+ coreSetupMock.getStartServices.mockResolvedValue([coreStartMock, {}, {}]);
const authcMock = securityMock.createSetup().authc;
const containerMock = document.createElement('div');
diff --git a/x-pack/plugins/security/public/authentication/logged_out/logged_out_app.test.ts b/x-pack/plugins/security/public/authentication/logged_out/logged_out_app.test.ts
index c8303ecc940d6..f0c18a3f1408e 100644
--- a/x-pack/plugins/security/public/authentication/logged_out/logged_out_app.test.ts
+++ b/x-pack/plugins/security/public/authentication/logged_out/logged_out_app.test.ts
@@ -35,7 +35,7 @@ describe('loggedOutApp', () => {
it('properly renders application', async () => {
const coreSetupMock = coreMock.createSetup();
const coreStartMock = coreMock.createStart();
- coreSetupMock.getStartServices.mockResolvedValue([coreStartMock, {}]);
+ coreSetupMock.getStartServices.mockResolvedValue([coreStartMock, {}, {}]);
const containerMock = document.createElement('div');
diff --git a/x-pack/plugins/security/public/authentication/login/login_app.test.ts b/x-pack/plugins/security/public/authentication/login/login_app.test.ts
index 2597a935f45df..b7119d179b0b6 100644
--- a/x-pack/plugins/security/public/authentication/login/login_app.test.ts
+++ b/x-pack/plugins/security/public/authentication/login/login_app.test.ts
@@ -38,7 +38,7 @@ describe('loginApp', () => {
it('properly renders application', async () => {
const coreSetupMock = coreMock.createSetup();
const coreStartMock = coreMock.createStart();
- coreSetupMock.getStartServices.mockResolvedValue([coreStartMock, {}]);
+ coreSetupMock.getStartServices.mockResolvedValue([coreStartMock, {}, {}]);
const containerMock = document.createElement('div');
loginApp.create({
diff --git a/x-pack/plugins/security/public/authentication/overwritten_session/overwritten_session_app.test.ts b/x-pack/plugins/security/public/authentication/overwritten_session/overwritten_session_app.test.ts
index 7b15d8c46f6eb..96e72ead22990 100644
--- a/x-pack/plugins/security/public/authentication/overwritten_session/overwritten_session_app.test.ts
+++ b/x-pack/plugins/security/public/authentication/overwritten_session/overwritten_session_app.test.ts
@@ -37,7 +37,7 @@ describe('overwrittenSessionApp', () => {
it('properly sets breadcrumbs and renders application', async () => {
const coreSetupMock = coreMock.createSetup();
const coreStartMock = coreMock.createStart();
- coreSetupMock.getStartServices.mockResolvedValue([coreStartMock, {}]);
+ coreSetupMock.getStartServices.mockResolvedValue([coreStartMock, {}, {}]);
const authcMock = securityMock.createSetup().authc;
const containerMock = document.createElement('div');
diff --git a/x-pack/plugins/security/public/index.ts b/x-pack/plugins/security/public/index.ts
index fdb8b544d61d3..458f7ab801fdf 100644
--- a/x-pack/plugins/security/public/index.ts
+++ b/x-pack/plugins/security/public/index.ts
@@ -6,13 +6,22 @@
import './index.scss';
import { PluginInitializer, PluginInitializerContext } from 'src/core/public';
-import { SecurityPlugin, SecurityPluginSetup, SecurityPluginStart } from './plugin';
+import {
+ SecurityPlugin,
+ SecurityPluginSetup,
+ SecurityPluginStart,
+ PluginSetupDependencies,
+ PluginStartDependencies,
+} from './plugin';
export { SecurityPluginSetup, SecurityPluginStart };
export { SessionInfo } from './types';
export { AuthenticatedUser } from '../common/model';
export { SecurityLicense, SecurityLicenseFeatures } from '../common/licensing';
-export const plugin: PluginInitializer = (
- initializerContext: PluginInitializerContext
-) => new SecurityPlugin(initializerContext);
+export const plugin: PluginInitializer<
+ SecurityPluginSetup,
+ SecurityPluginStart,
+ PluginSetupDependencies,
+ PluginStartDependencies
+> = (initializerContext: PluginInitializerContext) => new SecurityPlugin(initializerContext);
diff --git a/x-pack/plugins/spaces/public/management/spaces_management_app.test.tsx b/x-pack/plugins/spaces/public/management/spaces_management_app.test.tsx
index 7738a440cb5e1..61c872ec9269c 100644
--- a/x-pack/plugins/spaces/public/management/spaces_management_app.test.tsx
+++ b/x-pack/plugins/spaces/public/management/spaces_management_app.test.tsx
@@ -51,7 +51,7 @@ async function mountApp(basePath: string, spaceId?: string) {
.create({
spacesManager,
securityLicense,
- getStartServices: async () => [coreStart, pluginsStart as PluginsStart],
+ getStartServices: async () => [coreStart, pluginsStart as PluginsStart, {}],
})
.mount({ basePath, element: container, setBreadcrumbs });
diff --git a/x-pack/plugins/spaces/server/capabilities/capabilities_switcher.test.ts b/x-pack/plugins/spaces/server/capabilities/capabilities_switcher.test.ts
index 2c1ab26dd3d82..b4489e5700159 100644
--- a/x-pack/plugins/spaces/server/capabilities/capabilities_switcher.test.ts
+++ b/x-pack/plugins/spaces/server/capabilities/capabilities_switcher.test.ts
@@ -103,6 +103,7 @@ const setup = (space: Space) => {
coreSetup.getStartServices.mockResolvedValue([
coreMock.createStart(),
{ features: featuresStart },
+ {},
]);
const spacesService = spacesServiceMock.createSetupContract();
diff --git a/x-pack/plugins/triggers_actions_ui/kibana.json b/x-pack/plugins/triggers_actions_ui/kibana.json
index d11f2b3e51c9d..11cbacee08afc 100644
--- a/x-pack/plugins/triggers_actions_ui/kibana.json
+++ b/x-pack/plugins/triggers_actions_ui/kibana.json
@@ -4,5 +4,6 @@
"server": false,
"ui": true,
"optionalPlugins": ["alerting", "alertingBuiltins"],
- "requiredPlugins": ["management", "charts", "data"]
+ "requiredPlugins": ["management", "charts", "data"],
+ "configPath": ["xpack", "trigger_actions_ui"]
}
diff --git a/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/es_index.tsx b/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/es_index.tsx
index 706d746b92995..8a13c461fb313 100644
--- a/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/es_index.tsx
+++ b/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/es_index.tsx
@@ -193,7 +193,8 @@ const IndexActionConnectorFields: React.FunctionComponent
@@ -224,8 +225,7 @@ const IndexActionConnectorFields: React.FunctionComponent
diff --git a/x-pack/plugins/uptime/kibana.json b/x-pack/plugins/uptime/kibana.json
index 603cfac316b2d..6ec8a755ebea0 100644
--- a/x-pack/plugins/uptime/kibana.json
+++ b/x-pack/plugins/uptime/kibana.json
@@ -1,5 +1,5 @@
{
- "configPath": ["xpack"],
+ "configPath": ["xpack", "uptime"],
"id": "uptime",
"kibanaVersion": "kibana",
"requiredPlugins": ["alerting", "features", "licensing", "usageCollection"],
diff --git a/x-pack/plugins/watcher/kibana.json b/x-pack/plugins/watcher/kibana.json
index 7c02118c58d7a..a0482ad00797c 100644
--- a/x-pack/plugins/watcher/kibana.json
+++ b/x-pack/plugins/watcher/kibana.json
@@ -1,5 +1,6 @@
{
"id": "watcher",
+ "configPath": ["xpack", "watcher"],
"version": "kibana",
"requiredPlugins": [
"home",
diff --git a/x-pack/test/api_integration/apis/ml/calculate_model_memory_limit.ts b/x-pack/test/api_integration/apis/ml/calculate_model_memory_limit.ts
index 5d1a52e3c2c21..61e1763cc9f75 100644
--- a/x-pack/test/api_integration/apis/ml/calculate_model_memory_limit.ts
+++ b/x-pack/test/api_integration/apis/ml/calculate_model_memory_limit.ts
@@ -147,7 +147,8 @@ export default ({ getService }: FtrProviderContext) => {
},
];
- describe('calculate model memory limit', function() {
+ // failing test, see https://github.com/elastic/kibana/issues/61400
+ describe.skip('calculate model memory limit', function() {
before(async () => {
await esArchiver.load('ml/ecommerce');
});
diff --git a/x-pack/test/functional/apps/advanced_settings/feature_controls/advanced_settings_security.ts b/x-pack/test/functional/apps/advanced_settings/feature_controls/advanced_settings_security.ts
index 0d4c6b2c87666..1f22ca59ab2d4 100644
--- a/x-pack/test/functional/apps/advanced_settings/feature_controls/advanced_settings_security.ts
+++ b/x-pack/test/functional/apps/advanced_settings/feature_controls/advanced_settings_security.ts
@@ -138,7 +138,8 @@ export default function({ getPageObjects, getService }: FtrProviderContext) {
});
});
- describe('no advanced_settings privileges', () => {
+ describe('no advanced_settings privileges', function() {
+ this.tags(['skipCoverage']);
before(async () => {
await security.role.create('no_advanced_settings_privileges_role', {
elasticsearch: {
diff --git a/x-pack/test/functional/apps/endpoint/index.ts b/x-pack/test/functional/apps/endpoint/index.ts
index 4d55b3af4956e..3e70a1cc67670 100644
--- a/x-pack/test/functional/apps/endpoint/index.ts
+++ b/x-pack/test/functional/apps/endpoint/index.ts
@@ -14,7 +14,6 @@ export default function({ loadTestFile }: FtrProviderContext) {
loadTestFile(require.resolve('./header_nav'));
loadTestFile(require.resolve('./host_list'));
loadTestFile(require.resolve('./policy_list'));
- loadTestFile(require.resolve('./policy_details'));
loadTestFile(require.resolve('./alerts'));
});
}
diff --git a/x-pack/test/functional/apps/endpoint/policy_details.ts b/x-pack/test/functional/apps/endpoint/policy_details.ts
deleted file mode 100644
index f251dcd93014e..0000000000000
--- a/x-pack/test/functional/apps/endpoint/policy_details.ts
+++ /dev/null
@@ -1,25 +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;
- * you may not use this file except in compliance with the Elastic License.
- */
-import expect from '@kbn/expect';
-import { FtrProviderContext } from '../../ftr_provider_context';
-
-export default function({ getPageObjects, getService }: FtrProviderContext) {
- const pageObjects = getPageObjects(['common', 'endpoint']);
- const testSubjects = getService('testSubjects');
-
- // Skipped until we can figure out how to load data for Ingest
- describe.skip('Endpoint Policy Details', function() {
- this.tags(['ciGroup7']);
-
- it('loads the Policy Details Page', async () => {
- await pageObjects.common.navigateToUrlWithBrowserHistory('endpoint', '/policy/123');
- await testSubjects.existOrFail('policyDetailsViewTitle');
-
- const policyDetailsNotFoundTitle = await testSubjects.getVisibleText('policyDetailsName');
- expect(policyDetailsNotFoundTitle).to.equal('policy with some protections 123');
- });
- });
-}
diff --git a/x-pack/test/functional/apps/infra/link_to.ts b/x-pack/test/functional/apps/infra/link_to.ts
index 7e79f42ac94cb..a287d53d5df0b 100644
--- a/x-pack/test/functional/apps/infra/link_to.ts
+++ b/x-pack/test/functional/apps/infra/link_to.ts
@@ -25,7 +25,7 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => {
it('redirects to the logs app and parses URL search params correctly', async () => {
const location = {
hash: '',
- pathname: '/link-to/logs',
+ pathname: '/link-to',
search: `time=${timestamp}&filter=trace.id:${traceId}`,
state: undefined,
};
diff --git a/x-pack/test/functional/apps/uptime/index.ts b/x-pack/test/functional/apps/uptime/index.ts
index 446f28d182926..3789351263b98 100644
--- a/x-pack/test/functional/apps/uptime/index.ts
+++ b/x-pack/test/functional/apps/uptime/index.ts
@@ -28,10 +28,16 @@ export default ({ loadTestFile, getService }: FtrProviderContext) => {
id: settingsObjectId,
});
} catch (e) {
- // If it's not found that's fine, we just want to ensure
- // this is the default state
- if (e.response?.status !== 404) {
- throw e;
+ // a 404 just means the doc is already missing
+ if (e.response.status !== 404) {
+ const { status, statusText, data, headers, config } = e.response;
+ throw new Error(
+ `error attempting to delete settings:\n${JSON.stringify(
+ { status, statusText, data, headers, config },
+ null,
+ 2
+ )}`
+ );
}
}
});
diff --git a/x-pack/test/functional/apps/uptime/locations.ts b/x-pack/test/functional/apps/uptime/locations.ts
index 96c7fad89a85d..7f6932ab50319 100644
--- a/x-pack/test/functional/apps/uptime/locations.ts
+++ b/x-pack/test/functional/apps/uptime/locations.ts
@@ -10,7 +10,7 @@ import { FtrProviderContext } from '../../ftr_provider_context';
export default ({ getPageObjects, getService }: FtrProviderContext) => {
const pageObjects = getPageObjects(['uptime']);
- describe.skip('location', () => {
+ describe('location', () => {
const start = new Date().toISOString();
const end = new Date().toISOString();
diff --git a/x-pack/test/functional/apps/uptime/settings.ts b/x-pack/test/functional/apps/uptime/settings.ts
index aafb145a1b9b0..477eeb84ae5c3 100644
--- a/x-pack/test/functional/apps/uptime/settings.ts
+++ b/x-pack/test/functional/apps/uptime/settings.ts
@@ -17,7 +17,7 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => {
const es = getService('es');
// Flaky https://github.com/elastic/kibana/issues/60866
- describe.skip('uptime settings page', () => {
+ describe('uptime settings page', () => {
const settingsPage = () => pageObjects.uptime.settings;
beforeEach('navigate to clean app root', async () => {
// make 10 checks
@@ -48,7 +48,7 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => {
});
// Failing: https://github.com/elastic/kibana/issues/60863
- it.skip('changing index pattern setting is reflected elsewhere in UI', async () => {
+ it('changing index pattern setting is reflected elsewhere in UI', async () => {
const originalCount = await pageObjects.uptime.getSnapshotCount();
// We should find 1 monitor up with the default index pattern
expect(originalCount.up).to.eql(1);
diff --git a/x-pack/test/functional/page_objects/gis_page.js b/x-pack/test/functional/page_objects/gis_page.js
index 1d0e231d7dc54..ae037c3954a06 100644
--- a/x-pack/test/functional/page_objects/gis_page.js
+++ b/x-pack/test/functional/page_objects/gis_page.js
@@ -86,8 +86,8 @@ export function GisPageProvider({ getService, getPageObjects }) {
async waitForLayersToLoad() {
log.debug('Wait for layers to load');
- const tableOfContents = await testSubjects.find('mapLayerTOC');
await retry.try(async () => {
+ const tableOfContents = await testSubjects.find('mapLayerTOC');
await tableOfContents.waitForDeletedByCssSelector('.euiLoadingSpinner');
});
}
diff --git a/x-pack/test/functional/services/uptime.ts b/x-pack/test/functional/services/uptime.ts
index f9902d0142b96..5a24a51f967fd 100644
--- a/x-pack/test/functional/services/uptime.ts
+++ b/x-pack/test/functional/services/uptime.ts
@@ -16,14 +16,14 @@ export function UptimeProvider({ getService }: FtrProviderContext) {
await testSubjects.click('settings-page-link', 5000);
},
changeHeartbeatIndicesInput: async (text: string) => {
- const input = await testSubjects.find('heartbeat-indices-input', 5000);
+ const input = await testSubjects.find('heartbeat-indices-input-loaded', 5000);
await input.clearValueWithKeyboard();
await input.type(text);
},
loadFields: async () => {
- const heartbeatIndices = await (
- await testSubjects.find('heartbeat-indices-input', 5000)
- ).getAttribute('value');
+ const input = await testSubjects.find('heartbeat-indices-input-loaded', 5000);
+ const heartbeatIndices = await input.getAttribute('value');
+
return { heartbeatIndices };
},
applyButtonIsDisabled: async () => {
@@ -34,7 +34,7 @@ export function UptimeProvider({ getService }: FtrProviderContext) {
await retry.waitFor('submit to succeed', async () => {
// When the form submit is complete the form will no longer be disabled
const disabled = await (
- await testSubjects.find('heartbeat-indices-input', 5000)
+ await testSubjects.find('heartbeat-indices-input-loaded', 5000)
).getAttribute('disabled');
return disabled === null;
});
diff --git a/x-pack/test/plugin_functional/plugins/resolver_test/public/index.ts b/x-pack/test/plugin_functional/plugins/resolver_test/public/index.ts
index c5f3c0e19138f..51ec5a08b7a39 100644
--- a/x-pack/test/plugin_functional/plugins/resolver_test/public/index.ts
+++ b/x-pack/test/plugin_functional/plugins/resolver_test/public/index.ts
@@ -5,6 +5,15 @@
*/
import { PluginInitializer } from 'kibana/public';
-import { ResolverTestPlugin } from './plugin';
+import {
+ ResolverTestPlugin,
+ ResolverTestPluginSetupDependencies,
+ ResolverTestPluginStartDependencies,
+} from './plugin';
-export const plugin: PluginInitializer = () => new ResolverTestPlugin();
+export const plugin: PluginInitializer<
+ void,
+ void,
+ ResolverTestPluginSetupDependencies,
+ ResolverTestPluginStartDependencies
+> = () => new ResolverTestPlugin();
diff --git a/yarn.lock b/yarn.lock
index 7608fedd705a4..7717ea90f1ee7 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -3726,10 +3726,10 @@
"@types/cp-file" "*"
"@types/glob" "*"
-"@types/cytoscape@^3.8.2":
- version "3.8.2"
- resolved "https://registry.yarnpkg.com/@types/cytoscape/-/cytoscape-3.8.2.tgz#428e85e12fb8dba94b05b1b1a8b04fd6f91b9c2d"
- integrity sha512-b9n8dwMnU+64++Vky7bfab3Fod6JRbhZRrRJgnyKd03sh/vgNYHsq9N3W1MlU32d3AanxWUDH/1+jC+l5V9BeQ==
+"@types/cytoscape@^3.14.0":
+ version "3.14.0"
+ resolved "https://registry.yarnpkg.com/@types/cytoscape/-/cytoscape-3.14.0.tgz#346b5430a7a1533784bcf44fcbe6c5255b948d36"
+ integrity sha512-qOhhZFGb35457vmCu9YHqwjqleraSAEikaIFmMUPWzTC7FrwkS7VR/6ymqRHW7Z8wivHuzsZDYCoePIepd69qg==
"@types/d3-array@^1.2.7":
version "1.2.7"
@@ -8283,14 +8283,6 @@ chalk@2.4.2, chalk@^2.3.2, chalk@^2.4.2, chalk@~2.4.1:
escape-string-regexp "^1.0.5"
supports-color "^5.3.0"
-chalk@3.0.0, chalk@^3.0.0:
- version "3.0.0"
- resolved "https://registry.yarnpkg.com/chalk/-/chalk-3.0.0.tgz#3f73c2bf526591f574cc492c51e2456349f844e4"
- integrity sha512-4D3B6Wf41KOYRFdszmDqMCGq5VV/uMAB273JILmO+3jAlh8X4qDtdtgCR3fxtbLEMzSx22QdhnDcJvu2u1fVwg==
- dependencies:
- ansi-styles "^4.1.0"
- supports-color "^7.1.0"
-
chalk@^1.0.0, chalk@^1.1.1, chalk@^1.1.3:
version "1.1.3"
resolved "https://registry.yarnpkg.com/chalk/-/chalk-1.1.3.tgz#a8115c55e4a702fe4d150abd3872822a7e09fc98"
@@ -8320,6 +8312,14 @@ chalk@^2.3.0:
escape-string-regexp "^1.0.5"
supports-color "^5.2.0"
+chalk@^3.0.0:
+ version "3.0.0"
+ resolved "https://registry.yarnpkg.com/chalk/-/chalk-3.0.0.tgz#3f73c2bf526591f574cc492c51e2456349f844e4"
+ integrity sha512-4D3B6Wf41KOYRFdszmDqMCGq5VV/uMAB273JILmO+3jAlh8X4qDtdtgCR3fxtbLEMzSx22QdhnDcJvu2u1fVwg==
+ dependencies:
+ ansi-styles "^4.1.0"
+ supports-color "^7.1.0"
+
chalk@~0.4.0:
version "0.4.0"
resolved "https://registry.yarnpkg.com/chalk/-/chalk-0.4.0.tgz#5199a3ddcd0c1efe23bc08c1b027b06176e0c64f"
@@ -9213,7 +9213,7 @@ concat-stream@1.6.0, concat-stream@^1.4.7, concat-stream@~1.6.0:
readable-stream "^2.2.2"
typedarray "^0.0.6"
-concat-stream@1.6.2, concat-stream@^1.4.6, concat-stream@^1.5.0, concat-stream@^1.6.0, concat-stream@^1.6.1:
+concat-stream@1.6.2, concat-stream@^1.4.6, concat-stream@^1.5.0, concat-stream@^1.6.0, concat-stream@^1.6.1, concat-stream@^1.6.2:
version "1.6.2"
resolved "https://registry.yarnpkg.com/concat-stream/-/concat-stream-1.6.2.tgz#904bdf194cd3122fc675c77fc4ac3d4ff0fd1a34"
integrity sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw==
@@ -10145,10 +10145,10 @@ cypress-multi-reporters@^1.2.3:
debug "^4.1.1"
lodash "^4.17.11"
-cypress@^4.0.2:
- version "4.0.2"
- resolved "https://registry.yarnpkg.com/cypress/-/cypress-4.0.2.tgz#ede194d7bc73fb449f8de553c9e1db4ca15309ef"
- integrity sha512-WRzxOoSd+TxyXKa7Zi9orz3ii5VW7yhhVYstCU+EpOKfPan9x5Ww2Clucmy4H/W0GHUYAo7GYFZRD33ZCSNBQA==
+cypress@^4.2.0:
+ version "4.2.0"
+ resolved "https://registry.yarnpkg.com/cypress/-/cypress-4.2.0.tgz#45673fb648b1a77b9a78d73e58b89ed05212d243"
+ integrity sha512-8LdreL91S/QiTCLYLNbIjLL8Ht4fJmu/4HGLxUI20Tc7JSfqEfCmXELrRfuPT0kjosJwJJZacdSji9XSRkPKUw==
dependencies:
"@cypress/listr-verbose-renderer" "0.4.1"
"@cypress/xvfb" "1.2.4"
@@ -10156,13 +10156,14 @@ cypress@^4.0.2:
arch "2.1.1"
bluebird "3.7.2"
cachedir "2.3.0"
- chalk "3.0.0"
+ chalk "2.4.2"
check-more-types "2.24.0"
+ cli-table3 "0.5.1"
commander "4.1.0"
common-tags "1.8.0"
debug "4.1.1"
eventemitter2 "4.1.2"
- execa "3.3.0"
+ execa "1.0.0"
executable "4.1.1"
extract-zip "1.6.7"
fs-extra "8.1.0"
@@ -10173,10 +10174,12 @@ cypress@^4.0.2:
listr "0.14.3"
lodash "4.17.15"
log-symbols "3.0.0"
- minimist "1.2.0"
+ minimist "1.2.2"
moment "2.24.0"
+ ospath "1.2.2"
+ pretty-bytes "5.3.0"
ramda "0.26.1"
- request "2.88.0"
+ request cypress-io/request#b5af0d1fa47eec97ba980cde90a13e69a2afcd16
request-progress "3.0.0"
supports-color "7.1.0"
tmp "0.1.0"
@@ -12568,21 +12571,18 @@ exec-sh@^0.3.2:
resolved "https://registry.yarnpkg.com/exec-sh/-/exec-sh-0.3.2.tgz#6738de2eb7c8e671d0366aea0b0db8c6f7d7391b"
integrity sha512-9sLAvzhI5nc8TpuQUh4ahMdCrWT00wPWz7j47/emR5+2qEfoZP5zzUXvx+vdx+H6ohhnsYC31iX04QLYJK8zTg==
-execa@3.3.0:
- version "3.3.0"
- resolved "https://registry.yarnpkg.com/execa/-/execa-3.3.0.tgz#7e348eef129a1937f21ecbbd53390942653522c1"
- integrity sha512-j5Vit5WZR/cbHlqU97+qcnw9WHRCIL4V1SVe75VcHcD1JRBdt8fv0zw89b7CQHQdUHTt2VjuhcF5ibAgVOxqpg==
+execa@1.0.0, execa@^1.0.0:
+ version "1.0.0"
+ resolved "https://registry.yarnpkg.com/execa/-/execa-1.0.0.tgz#c6236a5bb4df6d6f15e88e7f017798216749ddd8"
+ integrity sha512-adbxcyWV46qiHyvSp50TKt05tB4tK3HcmF7/nxfAdhnox83seTDbwnaqKO4sXRy7roHAIFqJP/Rw/AuEbX61LA==
dependencies:
- cross-spawn "^7.0.0"
- get-stream "^5.0.0"
- human-signals "^1.1.1"
- is-stream "^2.0.0"
- merge-stream "^2.0.0"
- npm-run-path "^4.0.0"
- onetime "^5.1.0"
- p-finally "^2.0.0"
- signal-exit "^3.0.2"
- strip-final-newline "^2.0.0"
+ cross-spawn "^6.0.0"
+ get-stream "^4.0.0"
+ is-stream "^1.1.0"
+ npm-run-path "^2.0.0"
+ p-finally "^1.0.0"
+ signal-exit "^3.0.0"
+ strip-eof "^1.0.0"
execa@^0.1.1:
version "0.1.1"
@@ -12644,19 +12644,6 @@ execa@^0.7.0:
signal-exit "^3.0.0"
strip-eof "^1.0.0"
-execa@^1.0.0:
- version "1.0.0"
- resolved "https://registry.yarnpkg.com/execa/-/execa-1.0.0.tgz#c6236a5bb4df6d6f15e88e7f017798216749ddd8"
- integrity sha512-adbxcyWV46qiHyvSp50TKt05tB4tK3HcmF7/nxfAdhnox83seTDbwnaqKO4sXRy7roHAIFqJP/Rw/AuEbX61LA==
- dependencies:
- cross-spawn "^6.0.0"
- get-stream "^4.0.0"
- is-stream "^1.1.0"
- npm-run-path "^2.0.0"
- p-finally "^1.0.0"
- signal-exit "^3.0.0"
- strip-eof "^1.0.0"
-
execa@^4.0.0:
version "4.0.0"
resolved "https://registry.yarnpkg.com/execa/-/execa-4.0.0.tgz#7f37d6ec17f09e6b8fc53288611695b6d12b9daf"
@@ -12959,7 +12946,7 @@ extract-zip@1.6.6:
mkdirp "0.5.0"
yauzl "2.4.1"
-extract-zip@1.6.7, extract-zip@^1.6.6, extract-zip@^1.6.7:
+extract-zip@1.6.7:
version "1.6.7"
resolved "https://registry.yarnpkg.com/extract-zip/-/extract-zip-1.6.7.tgz#a840b4b8af6403264c8db57f4f1a74333ef81fe9"
integrity sha1-qEC0uK9kAyZMjbV/Txp0Mz74H+k=
@@ -12969,6 +12956,16 @@ extract-zip@1.6.7, extract-zip@^1.6.6, extract-zip@^1.6.7:
mkdirp "0.5.1"
yauzl "2.4.1"
+extract-zip@^1.6.6, extract-zip@^1.6.7, extract-zip@^1.7.0:
+ version "1.7.0"
+ resolved "https://registry.yarnpkg.com/extract-zip/-/extract-zip-1.7.0.tgz#556cc3ae9df7f452c493a0cfb51cc30277940927"
+ integrity sha512-xoh5G1W/PB0/27lXgMQyIhP5DSY/LhoCsOyZgb+6iMmRtCwVBo55uKaMoEYrDCKQhWvqEip5ZPKAc6eFNyf/MA==
+ dependencies:
+ concat-stream "^1.6.2"
+ debug "^2.6.9"
+ mkdirp "^0.5.4"
+ yauzl "^2.10.0"
+
extsprintf@1.3.0:
version "1.3.0"
resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.3.0.tgz#96918440e3041a7a414f8c52e3c574eb3c3e1e05"
@@ -15314,7 +15311,7 @@ har-validator@~5.0.3:
ajv "^5.1.0"
har-schema "^2.0.0"
-har-validator@~5.1.0:
+har-validator@~5.1.0, har-validator@~5.1.3:
version "5.1.3"
resolved "https://registry.yarnpkg.com/har-validator/-/har-validator-5.1.3.tgz#1ef89ebd3e4996557675eed9893110dc350fa080"
integrity sha512-sNvOCzEQNr/qrvJgc3UG/kD4QtlHycrzwS+6mfTrrSq97BvaYcPZZI1ZSqGSPR73Cxn4LKTD4PttRwfU7jWq5g==
@@ -20148,6 +20145,11 @@ minimist@1.2.0, minimist@^1.1.0, minimist@^1.1.1, minimist@^1.1.3, minimist@^1.2
resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.0.tgz#a35008b20f41383eec1fb914f4cd5df79a264284"
integrity sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=
+minimist@1.2.2:
+ version "1.2.2"
+ resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.2.tgz#b00a00230a1108c48c169e69a291aafda3aacd63"
+ integrity sha512-rIqbOrKb8GJmx/5bc2M0QchhUouMXSpd1RTclXsB41JdL+VtnojfaJR+h7F9k18/4kHUsBFgk80Uk+q569vjPA==
+
minimist@^0.1.0:
version "0.1.0"
resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.1.0.tgz#99df657a52574c21c9057497df742790b2b4c0de"
@@ -20274,7 +20276,7 @@ mkdirp@0.5.0:
dependencies:
minimist "0.0.8"
-mkdirp@0.5.1, mkdirp@0.5.x, "mkdirp@>=0.5 0", mkdirp@^0.5.0, mkdirp@^0.5.1, mkdirp@~0.5.0, mkdirp@~0.5.1:
+mkdirp@0.5.1:
version "0.5.1"
resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.1.tgz#30057438eac6cf7f8c4767f38648d6697d75c903"
integrity sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=
@@ -20288,6 +20290,13 @@ mkdirp@0.5.3:
dependencies:
minimist "^1.2.5"
+mkdirp@0.5.x, "mkdirp@>=0.5 0", mkdirp@^0.5.0, mkdirp@^0.5.1, mkdirp@^0.5.4, mkdirp@~0.5.0, mkdirp@~0.5.1:
+ version "0.5.4"
+ resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.4.tgz#fd01504a6797ec5c9be81ff43d204961ed64a512"
+ integrity sha512-iG9AK/dJLtJ0XNgTuDbSyNS3zECqDlAhnQW4CsNxBG3LQJBbHmRX1egw39DmtOdCAqY+dKXV+sgPgilNWUKMVw==
+ dependencies:
+ minimist "^1.2.5"
+
mkdirp@^1.0.3:
version "1.0.3"
resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-1.0.3.tgz#4cf2e30ad45959dddea53ad97d518b6c8205e1ea"
@@ -21732,6 +21741,11 @@ osenv@0, osenv@^0.1.0:
os-homedir "^1.0.0"
os-tmpdir "^1.0.0"
+ospath@1.2.2:
+ version "1.2.2"
+ resolved "https://registry.yarnpkg.com/ospath/-/ospath-1.2.2.tgz#1276639774a3f8ef2572f7fe4280e0ea4550c07b"
+ integrity sha1-EnZjl3Sj+O8lcvf+QoDg6kVQwHs=
+
p-all@^2.1.0:
version "2.1.0"
resolved "https://registry.yarnpkg.com/p-all/-/p-all-2.1.0.tgz#91419be56b7dee8fe4c5db875d55e0da084244a0"
@@ -21780,11 +21794,6 @@ p-finally@^1.0.0:
resolved "https://registry.yarnpkg.com/p-finally/-/p-finally-1.0.0.tgz#3fbcfb15b899a44123b34b6dcc18b724336a2cae"
integrity sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4=
-p-finally@^2.0.0:
- version "2.0.1"
- resolved "https://registry.yarnpkg.com/p-finally/-/p-finally-2.0.1.tgz#bd6fcaa9c559a096b680806f4d657b3f0f240561"
- integrity sha512-vpm09aKwq6H9phqRQzecoDpD8TmVyGw70qmWlyq5onxY7tqyTTFVvxMykxQSQKILBSFlbXpypIw2T1Ml7+DDtw==
-
p-is-promise@^1.1.0:
version "1.1.0"
resolved "https://registry.yarnpkg.com/p-is-promise/-/p-is-promise-1.1.0.tgz#9c9456989e9f6588017b0434d56097675c3da05e"
@@ -22812,6 +22821,11 @@ prettier@^1.19.1:
resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.19.1.tgz#f7d7f5ff8a9cd872a7be4ca142095956a60797cb"
integrity sha512-s7PoyDv/II1ObgQunCbB9PdLmUcBZcnWOcxDh7O0N/UwDEsHyqkW+Qh28jW+mVuCdx7gLB0BotYI1Y6uI9iyew==
+pretty-bytes@5.3.0:
+ version "5.3.0"
+ resolved "https://registry.yarnpkg.com/pretty-bytes/-/pretty-bytes-5.3.0.tgz#f2849e27db79fb4d6cfe24764fc4134f165989f2"
+ integrity sha512-hjGrh+P926p4R4WbaB6OckyRtO0F0/lQBiT+0gnxjV+5kjPBrfVBFCsCLbMqVQeydvIoouYTCmmEURiH3R1Bdg==
+
pretty-bytes@^4.0.2:
version "4.0.2"
resolved "https://registry.yarnpkg.com/pretty-bytes/-/pretty-bytes-4.0.2.tgz#b2bf82e7350d65c6c33aa95aaa5a4f6327f61cd9"
@@ -25259,6 +25273,31 @@ request@^2.87.0:
tunnel-agent "^0.6.0"
uuid "^3.1.0"
+request@cypress-io/request#b5af0d1fa47eec97ba980cde90a13e69a2afcd16:
+ version "2.88.1"
+ resolved "https://codeload.github.com/cypress-io/request/tar.gz/b5af0d1fa47eec97ba980cde90a13e69a2afcd16"
+ dependencies:
+ aws-sign2 "~0.7.0"
+ aws4 "^1.8.0"
+ caseless "~0.12.0"
+ combined-stream "~1.0.6"
+ extend "~3.0.2"
+ forever-agent "~0.6.1"
+ form-data "~2.3.2"
+ har-validator "~5.1.3"
+ http-signature "~1.2.0"
+ is-typedarray "~1.0.0"
+ isstream "~0.1.2"
+ json-stringify-safe "~5.0.1"
+ mime-types "~2.1.19"
+ oauth-sign "~0.9.0"
+ performance-now "^2.1.0"
+ qs "~6.5.2"
+ safe-buffer "^5.1.2"
+ tough-cookie "~2.5.0"
+ tunnel-agent "^0.6.0"
+ uuid "^3.3.2"
+
require-ancestors@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/require-ancestors/-/require-ancestors-1.0.0.tgz#807831f8f8081fb12863da81ddb15c8f2a73a004"
@@ -28567,6 +28606,14 @@ tough-cookie@~2.3.0, tough-cookie@~2.3.3:
dependencies:
punycode "^1.4.1"
+tough-cookie@~2.5.0:
+ version "2.5.0"
+ resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-2.5.0.tgz#cd9fb2a0aa1d5a12b473bd9fb96fa3dcff65ade2"
+ integrity sha512-nlLsUzgm1kfLXSXfRZMc1KLAugd4hqJHDTvc2hDIwS3mZAfMEuMbc03SujMF+GEcpaX/qboeycw6iO8JwVv2+g==
+ dependencies:
+ psl "^1.1.28"
+ punycode "^2.1.1"
+
tr46@^1.0.0, tr46@^1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/tr46/-/tr46-1.0.1.tgz#a8b13fd6bfd2489519674ccde55ba3693b706d09"