From 04a3620ec93df31c8e73cffd7e90f2c607c50769 Mon Sep 17 00:00:00 2001 From: spalger Date: Wed, 26 May 2021 11:24:20 -0700 Subject: [PATCH 01/16] enable es client renovate prs for 7.13 (#100645) --- renovate.json5 | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/renovate.json5 b/renovate.json5 index a72d4408478a21..e33a1108afef6d 100644 --- a/renovate.json5 +++ b/renovate.json5 @@ -57,6 +57,14 @@ labels: ['release_note:skip', 'v7.14.0', 'Team:Operations', 'Team:Core', 'backport:skip'], enabled: true, }, + { + groupName: '@elastic/elasticsearch', + packageNames: ['@elastic/elasticsearch'], + reviewers: ['team:kibana-operations'], + matchBaseBranches: ['7.13'], + labels: ['release_note:skip', 'v7.13.0', 'Team:Operations', 'backport:skip'], + enabled: true, + }, { groupName: 'vega related modules', packageNames: ['vega', 'vega-lite', 'vega-schema-url-parser', 'vega-tooltip'], From 58f45eeeb3cf7eb2f89674bd614a54faf0172866 Mon Sep 17 00:00:00 2001 From: spalger Date: Wed, 26 May 2021 11:25:25 -0700 Subject: [PATCH 02/16] include 7.13 as a possible base branch of renovate prs --- renovate.json5 | 1 + 1 file changed, 1 insertion(+) diff --git a/renovate.json5 b/renovate.json5 index e33a1108afef6d..f533eac4796508 100644 --- a/renovate.json5 +++ b/renovate.json5 @@ -12,6 +12,7 @@ baseBranches: [ 'master', '7.x', + '7.13', ], prConcurrentLimit: 0, prHourlyLimit: 0, From e682b55c87358859fc1fddb9c5c754d10a70b428 Mon Sep 17 00:00:00 2001 From: Spencer Date: Wed, 26 May 2021 11:40:02 -0700 Subject: [PATCH 03/16] [ftr] migrate dashboard services to FtrService class (#100519) Co-authored-by: spalger --- .../services/dashboard/add_panel.ts | 452 +++++++------ .../services/dashboard/expectations.ts | 454 ++++++------- test/functional/services/dashboard/index.ts | 10 +- .../services/dashboard/panel_actions.ts | 596 +++++++++--------- .../services/dashboard/replace_panel.ts | 136 ++-- .../services/dashboard/visualizations.ts | 188 +++--- test/functional/services/index.ts | 20 +- 7 files changed, 928 insertions(+), 928 deletions(-) diff --git a/test/functional/services/dashboard/add_panel.ts b/test/functional/services/dashboard/add_panel.ts index a4e0c8b2647dd8..98e947541b52d7 100644 --- a/test/functional/services/dashboard/add_panel.ts +++ b/test/functional/services/dashboard/add_panel.ts @@ -6,235 +6,233 @@ * Side Public License, v 1. */ -import { FtrProviderContext } from '../../ftr_provider_context'; - -export function DashboardAddPanelProvider({ getService, getPageObjects }: FtrProviderContext) { - const log = getService('log'); - const retry = getService('retry'); - const testSubjects = getService('testSubjects'); - const flyout = getService('flyout'); - const PageObjects = getPageObjects(['header', 'common']); - - return new (class DashboardAddPanel { - async clickOpenAddPanel() { - log.debug('DashboardAddPanel.clickOpenAddPanel'); - await testSubjects.click('dashboardAddPanelButton'); - // Give some time for the animation to complete - await PageObjects.common.sleep(500); - } - - async clickCreateNewLink() { - log.debug('DashboardAddPanel.clickAddNewPanelButton'); - await testSubjects.click('dashboardAddNewPanelButton'); - // Give some time for the animation to complete - await PageObjects.common.sleep(500); - } - - async clickQuickButton(visType: string) { - log.debug(`DashboardAddPanel.clickQuickButton${visType}`); - await testSubjects.click(`dashboardQuickButton${visType}`); - } - - async clickMarkdownQuickButton() { - await this.clickQuickButton('markdown'); - } - - async clickMapQuickButton() { - await this.clickQuickButton('map'); - } - - async clickEditorMenuButton() { - log.debug('DashboardAddPanel.clickEditorMenuButton'); - await testSubjects.click('dashboardEditorMenuButton'); - } - - async clickAggBasedVisualizations() { - log.debug('DashboardAddPanel.clickEditorMenuAggBasedMenuItem'); - await testSubjects.click('dashboardEditorAggBasedMenuItem'); - } - - async clickVisType(visType: string) { - log.debug('DashboardAddPanel.clickVisType'); - await testSubjects.click(`visType-${visType}`); - } - - async clickEmbeddableFactoryGroupButton(groupId: string) { - log.debug('DashboardAddPanel.clickEmbeddableFactoryGroupButton'); - await testSubjects.click(`dashboardEditorMenu-${groupId}Group`); - } - - async clickAddNewEmbeddableLink(type: string) { - await testSubjects.click(`createNew-${type}`); - } - - async toggleFilterPopover() { - log.debug('DashboardAddPanel.toggleFilter'); - await testSubjects.click('savedObjectFinderFilterButton'); - } - - async toggleFilter(type: string) { - log.debug(`DashboardAddPanel.addToFilter(${type})`); - await this.waitForListLoading(); - await this.toggleFilterPopover(); - await testSubjects.click(`savedObjectFinderFilter-${type}`); - await this.toggleFilterPopover(); - } - - async addEveryEmbeddableOnCurrentPage() { - log.debug('addEveryEmbeddableOnCurrentPage'); - const itemList = await testSubjects.find('savedObjectFinderItemList'); - const embeddableList: string[] = []; - await retry.try(async () => { - const embeddableRows = await itemList.findAllByCssSelector('li'); - for (let i = 0; i < embeddableRows.length; i++) { - const name = await embeddableRows[i].getVisibleText(); - - if (embeddableList.includes(name)) { - // already added this one - continue; - } - - await embeddableRows[i].click(); - await PageObjects.common.closeToast(); - embeddableList.push(name); +import { FtrService } from '../../ftr_provider_context'; + +export class DashboardAddPanelService extends FtrService { + private readonly log = this.ctx.getService('log'); + private readonly retry = this.ctx.getService('retry'); + private readonly testSubjects = this.ctx.getService('testSubjects'); + private readonly flyout = this.ctx.getService('flyout'); + private readonly PageObjects = this.ctx.getPageObjects(['header', 'common']); + + async clickOpenAddPanel() { + this.log.debug('DashboardAddPanel.clickOpenAddPanel'); + await this.testSubjects.click('dashboardAddPanelButton'); + // Give some time for the animation to complete + await this.PageObjects.common.sleep(500); + } + + async clickCreateNewLink() { + this.log.debug('DashboardAddPanel.clickAddNewPanelButton'); + await this.testSubjects.click('dashboardAddNewPanelButton'); + // Give some time for the animation to complete + await this.PageObjects.common.sleep(500); + } + + async clickQuickButton(visType: string) { + this.log.debug(`DashboardAddPanel.clickQuickButton${visType}`); + await this.testSubjects.click(`dashboardQuickButton${visType}`); + } + + async clickMarkdownQuickButton() { + await this.clickQuickButton('markdown'); + } + + async clickMapQuickButton() { + await this.clickQuickButton('map'); + } + + async clickEditorMenuButton() { + this.log.debug('DashboardAddPanel.clickEditorMenuButton'); + await this.testSubjects.click('dashboardEditorMenuButton'); + } + + async clickAggBasedVisualizations() { + this.log.debug('DashboardAddPanel.clickEditorMenuAggBasedMenuItem'); + await this.testSubjects.click('dashboardEditorAggBasedMenuItem'); + } + + async clickVisType(visType: string) { + this.log.debug('DashboardAddPanel.clickVisType'); + await this.testSubjects.click(`visType-${visType}`); + } + + async clickEmbeddableFactoryGroupButton(groupId: string) { + this.log.debug('DashboardAddPanel.clickEmbeddableFactoryGroupButton'); + await this.testSubjects.click(`dashboardEditorMenu-${groupId}Group`); + } + + async clickAddNewEmbeddableLink(type: string) { + await this.testSubjects.click(`createNew-${type}`); + } + + async toggleFilterPopover() { + this.log.debug('DashboardAddPanel.toggleFilter'); + await this.testSubjects.click('savedObjectFinderFilterButton'); + } + + async toggleFilter(type: string) { + this.log.debug(`DashboardAddPanel.addToFilter(${type})`); + await this.waitForListLoading(); + await this.toggleFilterPopover(); + await this.testSubjects.click(`savedObjectFinderFilter-${type}`); + await this.toggleFilterPopover(); + } + + async addEveryEmbeddableOnCurrentPage() { + this.log.debug('addEveryEmbeddableOnCurrentPage'); + const itemList = await this.testSubjects.find('savedObjectFinderItemList'); + const embeddableList: string[] = []; + await this.retry.try(async () => { + const embeddableRows = await itemList.findAllByCssSelector('li'); + for (let i = 0; i < embeddableRows.length; i++) { + const name = await embeddableRows[i].getVisibleText(); + + if (embeddableList.includes(name)) { + // already added this one + continue; } - }); - log.debug(`Added ${embeddableList.length} embeddables`); - return embeddableList; - } - - async clickPagerNextButton() { - // Clear all toasts that could hide pagination controls - await PageObjects.common.clearAllToasts(); - - const isNext = await testSubjects.exists('pagination-button-next'); - if (!isNext) { - return false; - } - - const pagerNextButton = await testSubjects.find('pagination-button-next'); - - const isDisabled = await pagerNextButton.getAttribute('disabled'); - if (isDisabled != null) { - return false; - } - - await PageObjects.header.waitUntilLoadingHasFinished(); - await pagerNextButton.click(); - await PageObjects.header.waitUntilLoadingHasFinished(); - return true; - } - - async isAddPanelOpen() { - log.debug('DashboardAddPanel.isAddPanelOpen'); - return await testSubjects.exists('dashboardAddPanel'); - } - async ensureAddPanelIsShowing() { - log.debug('DashboardAddPanel.ensureAddPanelIsShowing'); - const isOpen = await this.isAddPanelOpen(); - if (!isOpen) { - await retry.try(async () => { - await this.clickOpenAddPanel(); - const isNowOpen = await this.isAddPanelOpen(); - if (!isNowOpen) { - throw new Error('Add panel still not open, trying again.'); - } - }); + await embeddableRows[i].click(); + await this.PageObjects.common.closeToast(); + embeddableList.push(name); } + }); + this.log.debug(`Added ${embeddableList.length} embeddables`); + return embeddableList; + } + + async clickPagerNextButton() { + // Clear all toasts that could hide pagination controls + await this.PageObjects.common.clearAllToasts(); + + const isNext = await this.testSubjects.exists('pagination-button-next'); + if (!isNext) { + return false; + } + + const pagerNextButton = await this.testSubjects.find('pagination-button-next'); + + const isDisabled = await pagerNextButton.getAttribute('disabled'); + if (isDisabled != null) { + return false; + } + + await this.PageObjects.header.waitUntilLoadingHasFinished(); + await pagerNextButton.click(); + await this.PageObjects.header.waitUntilLoadingHasFinished(); + return true; + } + + async isAddPanelOpen() { + this.log.debug('DashboardAddPanel.isAddPanelOpen'); + return await this.testSubjects.exists('dashboardAddPanel'); + } + + async ensureAddPanelIsShowing() { + this.log.debug('DashboardAddPanel.ensureAddPanelIsShowing'); + const isOpen = await this.isAddPanelOpen(); + if (!isOpen) { + await this.retry.try(async () => { + await this.clickOpenAddPanel(); + const isNowOpen = await this.isAddPanelOpen(); + if (!isNowOpen) { + throw new Error('Add panel still not open, trying again.'); + } + }); } - - async waitForListLoading() { - await testSubjects.waitForDeleted('savedObjectFinderLoadingIndicator'); - } - - async closeAddPanel() { - await flyout.ensureClosed('dashboardAddPanel'); - } - - async addEveryVisualization(filter: string) { - log.debug('DashboardAddPanel.addEveryVisualization'); - await this.ensureAddPanelIsShowing(); - await this.toggleFilter('visualization'); - if (filter) { - await this.filterEmbeddableNames(filter.replace('-', ' ')); - } - let morePages = true; - const vizList: string[][] = []; - while (morePages) { - vizList.push(await this.addEveryEmbeddableOnCurrentPage()); - morePages = await this.clickPagerNextButton(); - } - await this.closeAddPanel(); - return vizList.reduce((acc, list) => [...acc, ...list], []); - } - - async addEverySavedSearch(filter: string) { - log.debug('DashboardAddPanel.addEverySavedSearch'); - await this.ensureAddPanelIsShowing(); - await this.toggleFilter('search'); - const searchList = []; - if (filter) { - await this.filterEmbeddableNames(filter.replace('-', ' ')); - } - let morePages = true; - while (morePages) { - searchList.push(await this.addEveryEmbeddableOnCurrentPage()); - morePages = await this.clickPagerNextButton(); - } - await this.closeAddPanel(); - return searchList.reduce((acc, list) => [...acc, ...list], []); - } - - async addSavedSearch(searchName: string) { - return this.addEmbeddable(searchName, 'search'); - } - - async addSavedSearches(searches: string[]) { - for (const name of searches) { - await this.addSavedSearch(name); - } - } - - async addVisualizations(visualizations: string[]) { - log.debug('DashboardAddPanel.addVisualizations'); - const vizList = []; - for (const vizName of visualizations) { - await this.addVisualization(vizName); - vizList.push(vizName); - } - return vizList; - } - - async addVisualization(vizName: string) { - return this.addEmbeddable(vizName, 'visualization'); - } - - async addEmbeddable(embeddableName: string, embeddableType: string) { - log.debug( - `DashboardAddPanel.addEmbeddable, name: ${embeddableName}, type: ${embeddableType}` - ); - await this.ensureAddPanelIsShowing(); - await this.toggleFilter(embeddableType); - await this.filterEmbeddableNames(`"${embeddableName.replace('-', ' ')}"`); - await testSubjects.click(`savedObjectTitle${embeddableName.split(' ').join('-')}`); - await testSubjects.exists('addObjectToDashboardSuccess'); - await this.closeAddPanel(); - return embeddableName; - } - - async filterEmbeddableNames(name: string) { - // The search input field may be disabled while the table is loading so wait for it - await this.waitForListLoading(); - await testSubjects.setValue('savedObjectFinderSearchInput', name); - await this.waitForListLoading(); - } - - async panelAddLinkExists(name: string) { - log.debug(`DashboardAddPanel.panelAddLinkExists(${name})`); - await this.ensureAddPanelIsShowing(); - await this.filterEmbeddableNames(`"${name}"`); - return await testSubjects.exists(`savedObjectTitle${name.split(' ').join('-')}`); - } - })(); + } + + async waitForListLoading() { + await this.testSubjects.waitForDeleted('savedObjectFinderLoadingIndicator'); + } + + async closeAddPanel() { + await this.flyout.ensureClosed('dashboardAddPanel'); + } + + async addEveryVisualization(filter: string) { + this.log.debug('DashboardAddPanel.addEveryVisualization'); + await this.ensureAddPanelIsShowing(); + await this.toggleFilter('visualization'); + if (filter) { + await this.filterEmbeddableNames(filter.replace('-', ' ')); + } + let morePages = true; + const vizList: string[][] = []; + while (morePages) { + vizList.push(await this.addEveryEmbeddableOnCurrentPage()); + morePages = await this.clickPagerNextButton(); + } + await this.closeAddPanel(); + return vizList.reduce((acc, list) => [...acc, ...list], []); + } + + async addEverySavedSearch(filter: string) { + this.log.debug('DashboardAddPanel.addEverySavedSearch'); + await this.ensureAddPanelIsShowing(); + await this.toggleFilter('search'); + const searchList = []; + if (filter) { + await this.filterEmbeddableNames(filter.replace('-', ' ')); + } + let morePages = true; + while (morePages) { + searchList.push(await this.addEveryEmbeddableOnCurrentPage()); + morePages = await this.clickPagerNextButton(); + } + await this.closeAddPanel(); + return searchList.reduce((acc, list) => [...acc, ...list], []); + } + + async addSavedSearch(searchName: string) { + return this.addEmbeddable(searchName, 'search'); + } + + async addSavedSearches(searches: string[]) { + for (const name of searches) { + await this.addSavedSearch(name); + } + } + + async addVisualizations(visualizations: string[]) { + this.log.debug('DashboardAddPanel.addVisualizations'); + const vizList = []; + for (const vizName of visualizations) { + await this.addVisualization(vizName); + vizList.push(vizName); + } + return vizList; + } + + async addVisualization(vizName: string) { + return this.addEmbeddable(vizName, 'visualization'); + } + + async addEmbeddable(embeddableName: string, embeddableType: string) { + this.log.debug( + `DashboardAddPanel.addEmbeddable, name: ${embeddableName}, type: ${embeddableType}` + ); + await this.ensureAddPanelIsShowing(); + await this.toggleFilter(embeddableType); + await this.filterEmbeddableNames(`"${embeddableName.replace('-', ' ')}"`); + await this.testSubjects.click(`savedObjectTitle${embeddableName.split(' ').join('-')}`); + await this.testSubjects.exists('addObjectToDashboardSuccess'); + await this.closeAddPanel(); + return embeddableName; + } + + async filterEmbeddableNames(name: string) { + // The search input field may be disabled while the table is loading so wait for it + await this.waitForListLoading(); + await this.testSubjects.setValue('savedObjectFinderSearchInput', name); + await this.waitForListLoading(); + } + + async panelAddLinkExists(name: string) { + this.log.debug(`DashboardAddPanel.panelAddLinkExists(${name})`); + await this.ensureAddPanelIsShowing(); + await this.filterEmbeddableNames(`"${name}"`); + return await this.testSubjects.exists(`savedObjectTitle${name.split(' ').join('-')}`); + } } diff --git a/test/functional/services/dashboard/expectations.ts b/test/functional/services/dashboard/expectations.ts index c58fdd4d0305b1..34a4a9de7899a9 100644 --- a/test/functional/services/dashboard/expectations.ts +++ b/test/functional/services/dashboard/expectations.ts @@ -7,263 +7,271 @@ */ import expect from '@kbn/expect'; -import { FtrProviderContext } from '../../ftr_provider_context'; +import { FtrService } from '../../ftr_provider_context'; import { WebElementWrapper } from '../lib/web_element_wrapper'; -export function DashboardExpectProvider({ getService, getPageObjects }: FtrProviderContext) { - const log = getService('log'); - const retry = getService('retry'); - const testSubjects = getService('testSubjects'); - const find = getService('find'); - const filterBar = getService('filterBar'); - const PageObjects = getPageObjects(['dashboard', 'visualize', 'visChart']); - const findTimeout = 2500; +export class DashboardExpectService extends FtrService { + private readonly log = this.ctx.getService('log'); + private readonly retry = this.ctx.getService('retry'); + private readonly testSubjects = this.ctx.getService('testSubjects'); + private readonly find = this.ctx.getService('find'); + private readonly filterBar = this.ctx.getService('filterBar'); + private readonly PageObjects = this.ctx.getPageObjects(['dashboard', 'visualize', 'visChart']); + private readonly findTimeout = 2500; - return new (class DashboardExpect { - async panelCount(expectedCount: number) { - log.debug(`DashboardExpect.panelCount(${expectedCount})`); - await retry.try(async () => { - const panelCount = await PageObjects.dashboard.getPanelCount(); - expect(panelCount).to.be(expectedCount); - }); - } + async panelCount(expectedCount: number) { + this.log.debug(`DashboardExpect.panelCount(${expectedCount})`); + await this.retry.try(async () => { + const panelCount = await this.PageObjects.dashboard.getPanelCount(); + expect(panelCount).to.be(expectedCount); + }); + } - async visualizationsArePresent(vizList: string[]) { - log.debug('Checking all visualisations are present on dashsboard'); - let notLoaded = await PageObjects.dashboard.getNotLoadedVisualizations(vizList); - // TODO: Determine issue occasionally preventing 'geo map' from loading - notLoaded = notLoaded.filter((x) => x !== 'Rendering Test: geo map'); - expect(notLoaded).to.be.empty(); - } + async visualizationsArePresent(vizList: string[]) { + this.log.debug('Checking all visualisations are present on dashsboard'); + let notLoaded = await this.PageObjects.dashboard.getNotLoadedVisualizations(vizList); + // TODO: Determine issue occasionally preventing 'geo map' from loading + notLoaded = notLoaded.filter((x) => x !== 'Rendering Test: geo map'); + expect(notLoaded).to.be.empty(); + } - async selectedLegendColorCount(color: string, expectedCount: number) { - log.debug(`DashboardExpect.selectedLegendColorCount(${color}, ${expectedCount})`); - await retry.try(async () => { - const selectedLegendColor = await testSubjects.findAll( - `legendSelectedColor-${color}`, - findTimeout - ); - expect(selectedLegendColor.length).to.be(expectedCount); - }); - } + async selectedLegendColorCount(color: string, expectedCount: number) { + this.log.debug(`DashboardExpect.selectedLegendColorCount(${color}, ${expectedCount})`); + await this.retry.try(async () => { + const selectedLegendColor = await this.testSubjects.findAll( + `legendSelectedColor-${color}`, + this.findTimeout + ); + expect(selectedLegendColor.length).to.be(expectedCount); + }); + } - async docTableFieldCount(expectedCount: number) { - log.debug(`DashboardExpect.docTableFieldCount(${expectedCount})`); - await retry.try(async () => { - const docTableCells = await testSubjects.findAll('docTableField', findTimeout); - expect(docTableCells.length).to.be(expectedCount); - }); - } + async docTableFieldCount(expectedCount: number) { + this.log.debug(`DashboardExpect.docTableFieldCount(${expectedCount})`); + await this.retry.try(async () => { + const docTableCells = await this.testSubjects.findAll('docTableField', this.findTimeout); + expect(docTableCells.length).to.be(expectedCount); + }); + } - async fieldSuggestions(expectedFields: string[]) { - log.debug(`DashboardExpect.fieldSuggestions(${expectedFields})`); - const fields = await filterBar.getFilterEditorFields(); - expectedFields.forEach((expectedField) => { - expect(fields).to.contain(expectedField); - }); - } + async fieldSuggestions(expectedFields: string[]) { + this.log.debug(`DashboardExpect.fieldSuggestions(${expectedFields})`); + const fields = await this.filterBar.getFilterEditorFields(); + expectedFields.forEach((expectedField) => { + expect(fields).to.contain(expectedField); + }); + } + + async legendValuesToExist(legendValues: string[]) { + this.log.debug(`DashboardExpect.legendValuesToExist(${legendValues})`); + await Promise.all( + legendValues.map(async (legend) => { + await this.retry.try(async () => { + const legendValueExists = await this.testSubjects.exists(`legend-${legend}`); + expect(legendValueExists).to.be(true); + }); + }) + ); + } - async legendValuesToExist(legendValues: string[]) { - log.debug(`DashboardExpect.legendValuesToExist(${legendValues})`); + async textWithinElementsExists(texts: string[], getElementsFn: Function) { + this.log.debug(`DashboardExpect.textWithinElementsExists(${texts})`); + await this.retry.try(async () => { + const elements: WebElementWrapper[] = await getElementsFn(); + const elementTexts: string[] = []; await Promise.all( - legendValues.map(async (legend) => { - await retry.try(async () => { - const legendValueExists = await testSubjects.exists(`legend-${legend}`); - expect(legendValueExists).to.be(true); - }); + elements.map(async (element) => { + elementTexts.push(await element.getVisibleText()); }) ); - } - - async textWithinElementsExists(texts: string[], getElementsFn: Function) { - log.debug(`DashboardExpect.textWithinElementsExists(${texts})`); - await retry.try(async () => { - const elements: WebElementWrapper[] = await getElementsFn(); - const elementTexts: string[] = []; - await Promise.all( - elements.map(async (element) => { - elementTexts.push(await element.getVisibleText()); - }) - ); - log.debug(`Found ${elements.length} elements with values: ${JSON.stringify(elementTexts)}`); - texts.forEach((value) => { - const indexOfValue = elementTexts.indexOf(value); - expect(indexOfValue).to.be.greaterThan(-1); - elementTexts.splice(indexOfValue, 1); - }); + this.log.debug( + `Found ${elements.length} elements with values: ${JSON.stringify(elementTexts)}` + ); + texts.forEach((value) => { + const indexOfValue = elementTexts.indexOf(value); + expect(indexOfValue).to.be.greaterThan(-1); + elementTexts.splice(indexOfValue, 1); }); - } + }); + } - async textWithinTestSubjectsExists(texts: string[], selector: string) { - log.debug(`DashboardExpect.textWithinTestSubjectsExists(${texts})`); - log.debug(`textWithinTestSubjectsExists:(${JSON.stringify(texts)},${selector})`); - await this.textWithinElementsExists(texts, async () => await testSubjects.findAll(selector)); - } + async textWithinTestSubjectsExists(texts: string[], selector: string) { + this.log.debug(`DashboardExpect.textWithinTestSubjectsExists(${texts})`); + this.log.debug(`textWithinTestSubjectsExists:(${JSON.stringify(texts)},${selector})`); + await this.textWithinElementsExists( + texts, + async () => await this.testSubjects.findAll(selector) + ); + } - async textWithinCssElementExists(texts: string[], selector: string) { - log.debug(`DashboardExpect.textWithinCssElementExists(${texts})`); - log.debug(`textWithinCssElementExists:(${JSON.stringify(texts)},${selector})`); - await this.textWithinElementsExists(texts, async () => await find.allByCssSelector(selector)); - } + async textWithinCssElementExists(texts: string[], selector: string) { + this.log.debug(`DashboardExpect.textWithinCssElementExists(${texts})`); + this.log.debug(`textWithinCssElementExists:(${JSON.stringify(texts)},${selector})`); + await this.textWithinElementsExists( + texts, + async () => await this.find.allByCssSelector(selector) + ); + } - async textWithinElementsDoNotExist(texts: string[], getElementsFn: Function) { - log.debug(`DashboardExpect.textWithinElementsDoNotExist(${texts})`); - await retry.try(async () => { - const elements: WebElementWrapper[] = await getElementsFn(); - const elementTexts: string[] = []; - await Promise.all( - elements.map(async (element) => { - elementTexts.push(await element.getVisibleText()); - }) - ); - log.debug(`Found ${elements.length} elements with values: ${JSON.stringify(elementTexts)}`); - texts.forEach((value) => { - const indexOfValue = elementTexts.indexOf(value); - expect(indexOfValue).to.be(-1); - }); + async textWithinElementsDoNotExist(texts: string[], getElementsFn: Function) { + this.log.debug(`DashboardExpect.textWithinElementsDoNotExist(${texts})`); + await this.retry.try(async () => { + const elements: WebElementWrapper[] = await getElementsFn(); + const elementTexts: string[] = []; + await Promise.all( + elements.map(async (element) => { + elementTexts.push(await element.getVisibleText()); + }) + ); + this.log.debug( + `Found ${elements.length} elements with values: ${JSON.stringify(elementTexts)}` + ); + texts.forEach((value) => { + const indexOfValue = elementTexts.indexOf(value); + expect(indexOfValue).to.be(-1); }); - } + }); + } - async textWithinCssElementDoNotExist(texts: string[], selector: string) { - log.debug(`textWithinCssElementExists:(${JSON.stringify(texts)},${selector})`); - await this.textWithinElementsDoNotExist( - texts, - async () => await find.allByCssSelector(selector) - ); - } + async textWithinCssElementDoNotExist(texts: string[], selector: string) { + this.log.debug(`textWithinCssElementExists:(${JSON.stringify(texts)},${selector})`); + await this.textWithinElementsDoNotExist( + texts, + async () => await this.find.allByCssSelector(selector) + ); + } - async timelionLegendCount(expectedCount: number) { - log.debug(`DashboardExpect.timelionLegendCount(${expectedCount})`); - await retry.try(async () => { - const flotLegendLabels = await testSubjects.findAll('flotLegendLabel', findTimeout); - expect(flotLegendLabels.length).to.be(expectedCount); - }); - } + async timelionLegendCount(expectedCount: number) { + this.log.debug(`DashboardExpect.timelionLegendCount(${expectedCount})`); + await this.retry.try(async () => { + const flotLegendLabels = await this.testSubjects.findAll('flotLegendLabel', this.findTimeout); + expect(flotLegendLabels.length).to.be(expectedCount); + }); + } - async emptyTagCloudFound() { - log.debug(`DashboardExpect.emptyTagCloudFound()`); - const tagCloudVisualizations = await testSubjects.findAll('tagCloudVisualization'); - const tagCloudsHaveContent = await Promise.all( - tagCloudVisualizations.map(async (tagCloud) => { - return await find.descendantExistsByCssSelector('text', tagCloud); - }) - ); - expect(tagCloudsHaveContent.indexOf(false)).to.be.greaterThan(-1); - } + async emptyTagCloudFound() { + this.log.debug(`DashboardExpect.emptyTagCloudFound()`); + const tagCloudVisualizations = await this.testSubjects.findAll('tagCloudVisualization'); + const tagCloudsHaveContent = await Promise.all( + tagCloudVisualizations.map(async (tagCloud) => { + return await this.find.descendantExistsByCssSelector('text', tagCloud); + }) + ); + expect(tagCloudsHaveContent.indexOf(false)).to.be.greaterThan(-1); + } - async tagCloudWithValuesFound(values: string[]) { - log.debug(`DashboardExpect.tagCloudWithValuesFound(${values})`); - const tagCloudVisualizations = await testSubjects.findAll('tagCloudVisualization'); - const matches = await Promise.all( - tagCloudVisualizations.map(async (tagCloud) => { - for (let i = 0; i < values.length; i++) { - const valueExists = await testSubjects.descendantExists(values[i], tagCloud); - if (!valueExists) { - return false; - } + async tagCloudWithValuesFound(values: string[]) { + this.log.debug(`DashboardExpect.tagCloudWithValuesFound(${values})`); + const tagCloudVisualizations = await this.testSubjects.findAll('tagCloudVisualization'); + const matches = await Promise.all( + tagCloudVisualizations.map(async (tagCloud) => { + for (let i = 0; i < values.length; i++) { + const valueExists = await this.testSubjects.descendantExists(values[i], tagCloud); + if (!valueExists) { + return false; } - return true; - }) - ); - expect(matches.indexOf(true)).to.be.greaterThan(-1); - } + } + return true; + }) + ); + expect(matches.indexOf(true)).to.be.greaterThan(-1); + } - async goalAndGuageLabelsExist(labels: string[]) { - log.debug(`DashboardExpect.goalAndGuageLabelsExist(${labels})`); - await this.textWithinCssElementExists(labels, '.chart-label'); - } + async goalAndGuageLabelsExist(labels: string[]) { + this.log.debug(`DashboardExpect.goalAndGuageLabelsExist(${labels})`); + await this.textWithinCssElementExists(labels, '.chart-label'); + } - async metricValuesExist(values: string[]) { - log.debug(`DashboardExpect.metricValuesExist(${values})`); - await this.textWithinCssElementExists(values, '.mtrVis__value'); - } + async metricValuesExist(values: string[]) { + this.log.debug(`DashboardExpect.metricValuesExist(${values})`); + await this.textWithinCssElementExists(values, '.mtrVis__value'); + } - async tsvbMetricValuesExist(values: string[]) { - log.debug(`DashboardExpect.tsvbMetricValuesExist(${values})`); - await this.textWithinTestSubjectsExists(values, 'tsvbMetricValue'); - } + async tsvbMetricValuesExist(values: string[]) { + this.log.debug(`DashboardExpect.tsvbMetricValuesExist(${values})`); + await this.textWithinTestSubjectsExists(values, 'tsvbMetricValue'); + } - async tsvbTopNValuesExist(values: string[]) { - log.debug(`DashboardExpect.tsvbTopNValuesExist(${values})`); - await this.textWithinTestSubjectsExists(values, 'tsvbTopNValue'); - } + async tsvbTopNValuesExist(values: string[]) { + this.log.debug(`DashboardExpect.tsvbTopNValuesExist(${values})`); + await this.textWithinTestSubjectsExists(values, 'tsvbTopNValue'); + } - async vegaTextsExist(values: string[]) { - log.debug(`DashboardExpect.vegaTextsExist(${values})`); - await this.textWithinCssElementExists(values, '.vgaVis__view text'); - } + async vegaTextsExist(values: string[]) { + this.log.debug(`DashboardExpect.vegaTextsExist(${values})`); + await this.textWithinCssElementExists(values, '.vgaVis__view text'); + } - async vegaTextsDoNotExist(values: string[]) { - log.debug(`DashboardExpect.vegaTextsDoNotExist(${values})`); - await this.textWithinCssElementDoNotExist(values, '.vgaVis__view text'); - } + async vegaTextsDoNotExist(values: string[]) { + this.log.debug(`DashboardExpect.vegaTextsDoNotExist(${values})`); + await this.textWithinCssElementDoNotExist(values, '.vgaVis__view text'); + } - async tsvbMarkdownWithValuesExists(values: string[]) { - log.debug(`DashboardExpect.tsvbMarkdownWithValuesExists(${values})`); - await this.textWithinTestSubjectsExists(values, 'tsvbMarkdown'); - } + async tsvbMarkdownWithValuesExists(values: string[]) { + this.log.debug(`DashboardExpect.tsvbMarkdownWithValuesExists(${values})`); + await this.textWithinTestSubjectsExists(values, 'tsvbMarkdown'); + } - async markdownWithValuesExists(values: string[]) { - log.debug(`DashboardExpect.markdownWithValuesExists(${values})`); - await this.textWithinTestSubjectsExists(values, 'markdownBody'); - } + async markdownWithValuesExists(values: string[]) { + this.log.debug(`DashboardExpect.markdownWithValuesExists(${values})`); + await this.textWithinTestSubjectsExists(values, 'markdownBody'); + } - async savedSearchRowCount(expectedMinCount: number) { - log.debug(`DashboardExpect.savedSearchRowCount(${expectedMinCount})`); - await retry.try(async () => { - const savedSearchRows = await testSubjects.findAll( - 'docTableExpandToggleColumn', - findTimeout - ); - expect(savedSearchRows.length).to.be.above(expectedMinCount); - }); - } + async savedSearchRowCount(expectedMinCount: number) { + this.log.debug(`DashboardExpect.savedSearchRowCount(${expectedMinCount})`); + await this.retry.try(async () => { + const savedSearchRows = await this.testSubjects.findAll( + 'docTableExpandToggleColumn', + this.findTimeout + ); + expect(savedSearchRows.length).to.be.above(expectedMinCount); + }); + } - async dataTableRowCount(expectedCount: number) { - log.debug(`DashboardExpect.dataTableRowCount(${expectedCount})`); - await retry.try(async () => { - const dataTableRows = await PageObjects.visChart.getTableVisContent(); - expect(dataTableRows.length).to.be(expectedCount); - }); - } + async dataTableRowCount(expectedCount: number) { + this.log.debug(`DashboardExpect.dataTableRowCount(${expectedCount})`); + await this.retry.try(async () => { + const dataTableRows = await this.PageObjects.visChart.getTableVisContent(); + expect(dataTableRows.length).to.be(expectedCount); + }); + } - async dataTableNoResult() { - log.debug(`DashboardExpect.dataTableNoResult`); - await retry.try(async () => { - await PageObjects.visChart.getTableVisNoResult(); - }); - } + async dataTableNoResult() { + this.log.debug(`DashboardExpect.dataTableNoResult`); + await this.retry.try(async () => { + await this.PageObjects.visChart.getTableVisNoResult(); + }); + } - async seriesElementCount(expectedCount: number) { - log.debug(`DashboardExpect.seriesElementCount(${expectedCount})`); - await retry.try(async () => { - const seriesElements = await find.allByCssSelector('.series', findTimeout); - expect(seriesElements.length).to.be(expectedCount); - }); - } + async seriesElementCount(expectedCount: number) { + this.log.debug(`DashboardExpect.seriesElementCount(${expectedCount})`); + await this.retry.try(async () => { + const seriesElements = await this.find.allByCssSelector('.series', this.findTimeout); + expect(seriesElements.length).to.be(expectedCount); + }); + } - async inputControlItemCount(expectedCount: number) { - log.debug(`DashboardExpect.inputControlItemCount(${expectedCount})`); - await retry.try(async () => { - const inputControlItems = await testSubjects.findAll('inputControlItem'); - expect(inputControlItems.length).to.be(expectedCount); - }); - } + async inputControlItemCount(expectedCount: number) { + this.log.debug(`DashboardExpect.inputControlItemCount(${expectedCount})`); + await this.retry.try(async () => { + const inputControlItems = await this.testSubjects.findAll('inputControlItem'); + expect(inputControlItems.length).to.be(expectedCount); + }); + } - async lineChartPointsCount(expectedCount: number) { - log.debug(`DashboardExpect.lineChartPointsCount(${expectedCount})`); - await retry.try(async () => { - const points = await find.allByCssSelector('.points', findTimeout); - expect(points.length).to.be(expectedCount); - }); - } + async lineChartPointsCount(expectedCount: number) { + this.log.debug(`DashboardExpect.lineChartPointsCount(${expectedCount})`); + await this.retry.try(async () => { + const points = await this.find.allByCssSelector('.points', this.findTimeout); + expect(points.length).to.be(expectedCount); + }); + } - async tsvbTableCellCount(expectedCount: number) { - log.debug(`DashboardExpect.tsvbTableCellCount(${expectedCount})`); - await retry.try(async () => { - const tableCells = await testSubjects.findAll('tvbTableVis__value', findTimeout); - expect(tableCells.length).to.be(expectedCount); - }); - } - })(); + async tsvbTableCellCount(expectedCount: number) { + this.log.debug(`DashboardExpect.tsvbTableCellCount(${expectedCount})`); + await this.retry.try(async () => { + const tableCells = await this.testSubjects.findAll('tvbTableVis__value', this.findTimeout); + expect(tableCells.length).to.be(expectedCount); + }); + } } diff --git a/test/functional/services/dashboard/index.ts b/test/functional/services/dashboard/index.ts index 2746718892cf03..0423b66d04102b 100644 --- a/test/functional/services/dashboard/index.ts +++ b/test/functional/services/dashboard/index.ts @@ -6,8 +6,8 @@ * Side Public License, v 1. */ -export { DashboardVisualizationProvider } from './visualizations'; -export { DashboardExpectProvider } from './expectations'; -export { DashboardAddPanelProvider } from './add_panel'; -export { DashboardReplacePanelProvider } from './replace_panel'; -export { DashboardPanelActionsProvider } from './panel_actions'; +export { DashboardVisualizationsService } from './visualizations'; +export { DashboardExpectService } from './expectations'; +export { DashboardAddPanelService } from './add_panel'; +export { DashboardReplacePanelService } from './replace_panel'; +export { DashboardPanelActionsService } from './panel_actions'; diff --git a/test/functional/services/dashboard/panel_actions.ts b/test/functional/services/dashboard/panel_actions.ts index 89790b19f426aa..e7c028acc0e1bf 100644 --- a/test/functional/services/dashboard/panel_actions.ts +++ b/test/functional/services/dashboard/panel_actions.ts @@ -6,8 +6,8 @@ * Side Public License, v 1. */ -import { FtrProviderContext } from '../../ftr_provider_context'; import { WebElementWrapper } from '../lib/web_element_wrapper'; +import { FtrService } from '../../ftr_provider_context'; const REMOVE_PANEL_DATA_TEST_SUBJ = 'embeddablePanelAction-deletePanel'; const EDIT_PANEL_DATA_TEST_SUBJ = 'embeddablePanelAction-editPanel'; @@ -21,320 +21,318 @@ const COPY_PANEL_TO_DATA_TEST_SUBJ = 'embeddablePanelAction-copyToDashboard'; const LIBRARY_NOTIFICATION_TEST_SUBJ = 'embeddablePanelNotification-ACTION_LIBRARY_NOTIFICATION'; const SAVE_TO_LIBRARY_TEST_SUBJ = 'embeddablePanelAction-saveToLibrary'; -export function DashboardPanelActionsProvider({ getService, getPageObjects }: FtrProviderContext) { - const log = getService('log'); - const testSubjects = getService('testSubjects'); - const PageObjects = getPageObjects(['header', 'common', 'dashboard']); - const inspector = getService('inspector'); - - return new (class DashboardPanelActions { - async findContextMenu(parent?: WebElementWrapper) { - return parent - ? await testSubjects.findDescendant(OPEN_CONTEXT_MENU_ICON_DATA_TEST_SUBJ, parent) - : await testSubjects.find(OPEN_CONTEXT_MENU_ICON_DATA_TEST_SUBJ); - } - - async isContextMenuIconVisible() { - log.debug('isContextMenuIconVisible'); - return await testSubjects.exists(OPEN_CONTEXT_MENU_ICON_DATA_TEST_SUBJ); - } - - async toggleContextMenu(parent?: WebElementWrapper) { - log.debug('toggleContextMenu'); - await (parent ? parent.moveMouseTo() : testSubjects.moveMouseTo('dashboardPanelTitle')); - const toggleMenuItem = await this.findContextMenu(parent); - await toggleMenuItem.click(); - } - - async expectContextMenuToBeOpen() { - await testSubjects.existOrFail('embeddablePanelContextMenuOpen'); - } - - async openContextMenu(parent?: WebElementWrapper) { - log.debug(`openContextMenu(${parent}`); - if (await testSubjects.exists('embeddablePanelContextMenuOpen')) return; - await this.toggleContextMenu(parent); - await this.expectContextMenuToBeOpen(); - } - - async hasContextMenuMoreItem() { - return await testSubjects.exists('embeddablePanelMore-mainMenu'); - } - - async clickContextMenuMoreItem() { - const hasMoreSubPanel = await testSubjects.exists('embeddablePanelMore-mainMenu'); - if (hasMoreSubPanel) { - await testSubjects.click('embeddablePanelMore-mainMenu'); - } - } - - async openContextMenuMorePanel(parent?: WebElementWrapper) { - await this.openContextMenu(parent); - await this.clickContextMenuMoreItem(); - } - - async clickEdit() { - log.debug('clickEdit'); +export class DashboardPanelActionsService extends FtrService { + private readonly log = this.ctx.getService('log'); + private readonly testSubjects = this.ctx.getService('testSubjects'); + private readonly inspector = this.ctx.getService('inspector'); + private readonly PageObjects = this.ctx.getPageObjects(['header', 'common', 'dashboard']); + + async findContextMenu(parent?: WebElementWrapper) { + return parent + ? await this.testSubjects.findDescendant(OPEN_CONTEXT_MENU_ICON_DATA_TEST_SUBJ, parent) + : await this.testSubjects.find(OPEN_CONTEXT_MENU_ICON_DATA_TEST_SUBJ); + } + + async isContextMenuIconVisible() { + this.log.debug('isContextMenuIconVisible'); + return await this.testSubjects.exists(OPEN_CONTEXT_MENU_ICON_DATA_TEST_SUBJ); + } + + async toggleContextMenu(parent?: WebElementWrapper) { + this.log.debug('toggleContextMenu'); + await (parent ? parent.moveMouseTo() : this.testSubjects.moveMouseTo('dashboardPanelTitle')); + const toggleMenuItem = await this.findContextMenu(parent); + await toggleMenuItem.click(); + } + + async expectContextMenuToBeOpen() { + await this.testSubjects.existOrFail('embeddablePanelContextMenuOpen'); + } + + async openContextMenu(parent?: WebElementWrapper) { + this.log.debug(`openContextMenu(${parent}`); + if (await this.testSubjects.exists('embeddablePanelContextMenuOpen')) return; + await this.toggleContextMenu(parent); + await this.expectContextMenuToBeOpen(); + } + + async hasContextMenuMoreItem() { + return await this.testSubjects.exists('embeddablePanelMore-mainMenu'); + } + + async clickContextMenuMoreItem() { + const hasMoreSubPanel = await this.testSubjects.exists('embeddablePanelMore-mainMenu'); + if (hasMoreSubPanel) { + await this.testSubjects.click('embeddablePanelMore-mainMenu'); + } + } + + async openContextMenuMorePanel(parent?: WebElementWrapper) { + await this.openContextMenu(parent); + await this.clickContextMenuMoreItem(); + } + + async clickEdit() { + this.log.debug('clickEdit'); + await this.openContextMenu(); + const isActionVisible = await this.testSubjects.exists(EDIT_PANEL_DATA_TEST_SUBJ); + if (!isActionVisible) await this.clickContextMenuMoreItem(); + await this.testSubjects.clickWhenNotDisabled(EDIT_PANEL_DATA_TEST_SUBJ); + await this.PageObjects.header.waitUntilLoadingHasFinished(); + await this.PageObjects.common.waitForTopNavToBeVisible(); + } + + async editPanelByTitle(title?: string) { + this.log.debug(`editPanelByTitle(${title})`); + if (title) { + const panelOptions = await this.getPanelHeading(title); + await this.openContextMenu(panelOptions); + } else { await this.openContextMenu(); - const isActionVisible = await testSubjects.exists(EDIT_PANEL_DATA_TEST_SUBJ); - if (!isActionVisible) await this.clickContextMenuMoreItem(); - await testSubjects.clickWhenNotDisabled(EDIT_PANEL_DATA_TEST_SUBJ); - await PageObjects.header.waitUntilLoadingHasFinished(); - await PageObjects.common.waitForTopNavToBeVisible(); - } - - async editPanelByTitle(title?: string) { - log.debug(`editPanelByTitle(${title})`); - if (title) { - const panelOptions = await this.getPanelHeading(title); - await this.openContextMenu(panelOptions); - } else { - await this.openContextMenu(); - } - await testSubjects.clickWhenNotDisabled(EDIT_PANEL_DATA_TEST_SUBJ); } - - async clickExpandPanelToggle() { - log.debug(`clickExpandPanelToggle`); + await this.testSubjects.clickWhenNotDisabled(EDIT_PANEL_DATA_TEST_SUBJ); + } + + async clickExpandPanelToggle() { + this.log.debug(`clickExpandPanelToggle`); + await this.openContextMenu(); + const isActionVisible = await this.testSubjects.exists(TOGGLE_EXPAND_PANEL_DATA_TEST_SUBJ); + if (!isActionVisible) await this.clickContextMenuMoreItem(); + await this.testSubjects.click(TOGGLE_EXPAND_PANEL_DATA_TEST_SUBJ); + } + + async removePanel(parent?: WebElementWrapper) { + this.log.debug('removePanel'); + await this.openContextMenu(parent); + const isActionVisible = await this.testSubjects.exists(REMOVE_PANEL_DATA_TEST_SUBJ); + if (!isActionVisible) await this.clickContextMenuMoreItem(); + const isPanelActionVisible = await this.testSubjects.exists(REMOVE_PANEL_DATA_TEST_SUBJ); + if (!isPanelActionVisible) await this.clickContextMenuMoreItem(); + await this.testSubjects.click(REMOVE_PANEL_DATA_TEST_SUBJ); + } + + async removePanelByTitle(title: string) { + const header = await this.getPanelHeading(title); + this.log.debug('found header? ', Boolean(header)); + await this.removePanel(header); + } + + async customizePanel(parent?: WebElementWrapper) { + await this.openContextMenu(parent); + await this.testSubjects.click(CUSTOMIZE_PANEL_DATA_TEST_SUBJ); + } + + async replacePanelByTitle(title?: string) { + this.log.debug(`replacePanel(${title})`); + if (title) { + const panelOptions = await this.getPanelHeading(title); + await this.openContextMenu(panelOptions); + } else { await this.openContextMenu(); - const isActionVisible = await testSubjects.exists(TOGGLE_EXPAND_PANEL_DATA_TEST_SUBJ); - if (!isActionVisible) await this.clickContextMenuMoreItem(); - await testSubjects.click(TOGGLE_EXPAND_PANEL_DATA_TEST_SUBJ); - } - - async removePanel(parent?: WebElementWrapper) { - log.debug('removePanel'); - await this.openContextMenu(parent); - const isActionVisible = await testSubjects.exists(REMOVE_PANEL_DATA_TEST_SUBJ); - if (!isActionVisible) await this.clickContextMenuMoreItem(); - const isPanelActionVisible = await testSubjects.exists(REMOVE_PANEL_DATA_TEST_SUBJ); - if (!isPanelActionVisible) await this.clickContextMenuMoreItem(); - await testSubjects.click(REMOVE_PANEL_DATA_TEST_SUBJ); - } - - async removePanelByTitle(title: string) { - const header = await this.getPanelHeading(title); - log.debug('found header? ', Boolean(header)); - await this.removePanel(header); - } - - async customizePanel(parent?: WebElementWrapper) { - await this.openContextMenu(parent); - await testSubjects.click(CUSTOMIZE_PANEL_DATA_TEST_SUBJ); - } - - async replacePanelByTitle(title?: string) { - log.debug(`replacePanel(${title})`); - if (title) { - const panelOptions = await this.getPanelHeading(title); - await this.openContextMenu(panelOptions); - } else { - await this.openContextMenu(); - } - const actionExists = await testSubjects.exists(REPLACE_PANEL_DATA_TEST_SUBJ); - if (!actionExists) { - await this.clickContextMenuMoreItem(); - } - await testSubjects.click(REPLACE_PANEL_DATA_TEST_SUBJ); - } - - async clonePanelByTitle(title?: string) { - log.debug(`clonePanel(${title})`); - if (title) { - const panelOptions = await this.getPanelHeading(title); - await this.openContextMenu(panelOptions); - } else { - await this.openContextMenu(); - } - await testSubjects.click(CLONE_PANEL_DATA_TEST_SUBJ); - await PageObjects.dashboard.waitForRenderComplete(); - } - - async openCopyToModalByTitle(title?: string) { - log.debug(`copyPanelTo(${title})`); - if (title) { - const panelOptions = await this.getPanelHeading(title); - await this.openContextMenu(panelOptions); - } else { - await this.openContextMenu(); - } - const isActionVisible = await testSubjects.exists(COPY_PANEL_TO_DATA_TEST_SUBJ); - if (!isActionVisible) await this.clickContextMenuMoreItem(); - await testSubjects.click(COPY_PANEL_TO_DATA_TEST_SUBJ); - } - - async openInspectorByTitle(title: string) { - const header = await this.getPanelHeading(title); - await this.openInspector(header); - } - - async getSearchSessionIdByTitle(title: string) { - await this.openInspectorByTitle(title); - await inspector.openInspectorRequestsView(); - const searchSessionId = await ( - await testSubjects.find('inspectorRequestSearchSessionId') - ).getAttribute('data-search-session-id'); - await inspector.close(); - return searchSessionId; } - - async openInspector(parent?: WebElementWrapper) { - await this.openContextMenu(parent); - const exists = await testSubjects.exists(OPEN_INSPECTOR_TEST_SUBJ); - if (!exists) { - await this.clickContextMenuMoreItem(); - } - await testSubjects.click(OPEN_INSPECTOR_TEST_SUBJ); - } - - async unlinkFromLibary(parent?: WebElementWrapper) { - log.debug('unlinkFromLibrary'); - const libraryNotification = parent - ? await testSubjects.findDescendant(LIBRARY_NOTIFICATION_TEST_SUBJ, parent) - : await testSubjects.find(LIBRARY_NOTIFICATION_TEST_SUBJ); - await libraryNotification.click(); - await testSubjects.click('libraryNotificationUnlinkButton'); - } - - async saveToLibrary(newTitle: string, parent?: WebElementWrapper) { - log.debug('saveToLibrary'); - await this.openContextMenu(parent); - const exists = await testSubjects.exists(SAVE_TO_LIBRARY_TEST_SUBJ); - if (!exists) { - await this.clickContextMenuMoreItem(); - } - await testSubjects.click(SAVE_TO_LIBRARY_TEST_SUBJ); - await testSubjects.setValue('savedObjectTitle', newTitle, { - clearWithKeyboard: true, - }); - await testSubjects.click('confirmSaveSavedObjectButton'); - } - - async expectExistsRemovePanelAction() { - log.debug('expectExistsRemovePanelAction'); - await this.expectExistsPanelAction(REMOVE_PANEL_DATA_TEST_SUBJ); + const actionExists = await this.testSubjects.exists(REPLACE_PANEL_DATA_TEST_SUBJ); + if (!actionExists) { + await this.clickContextMenuMoreItem(); } + await this.testSubjects.click(REPLACE_PANEL_DATA_TEST_SUBJ); + } - async expectExistsPanelAction(testSubject: string) { - log.debug('expectExistsPanelAction', testSubject); + async clonePanelByTitle(title?: string) { + this.log.debug(`clonePanel(${title})`); + if (title) { + const panelOptions = await this.getPanelHeading(title); + await this.openContextMenu(panelOptions); + } else { await this.openContextMenu(); - if (await testSubjects.exists(CLONE_PANEL_DATA_TEST_SUBJ)) return; - if (await this.hasContextMenuMoreItem()) { - await this.clickContextMenuMoreItem(); - } - await testSubjects.existOrFail(CLONE_PANEL_DATA_TEST_SUBJ); - await this.toggleContextMenu(); } + await this.testSubjects.click(CLONE_PANEL_DATA_TEST_SUBJ); + await this.PageObjects.dashboard.waitForRenderComplete(); + } - async expectMissingPanelAction(testSubject: string) { - log.debug('expectMissingPanelAction', testSubject); + async openCopyToModalByTitle(title?: string) { + this.log.debug(`copyPanelTo(${title})`); + if (title) { + const panelOptions = await this.getPanelHeading(title); + await this.openContextMenu(panelOptions); + } else { await this.openContextMenu(); - await testSubjects.missingOrFail(testSubject); - if (await this.hasContextMenuMoreItem()) { - await this.clickContextMenuMoreItem(); - await testSubjects.missingOrFail(testSubject); - } - await this.toggleContextMenu(); - } - - async expectExistsEditPanelAction() { - log.debug('expectExistsEditPanelAction'); - await this.expectExistsPanelAction(EDIT_PANEL_DATA_TEST_SUBJ); - } - - async expectExistsReplacePanelAction() { - log.debug('expectExistsReplacePanelAction'); - await this.expectExistsPanelAction(REPLACE_PANEL_DATA_TEST_SUBJ); } - - async expectExistsClonePanelAction() { - log.debug('expectExistsClonePanelAction'); - await this.expectExistsPanelAction(CLONE_PANEL_DATA_TEST_SUBJ); - } - - async expectMissingEditPanelAction() { - log.debug('expectMissingEditPanelAction'); - await this.expectMissingPanelAction(EDIT_PANEL_DATA_TEST_SUBJ); - } - - async expectMissingReplacePanelAction() { - log.debug('expectMissingReplacePanelAction'); - await this.expectMissingPanelAction(REPLACE_PANEL_DATA_TEST_SUBJ); - } - - async expectMissingDuplicatePanelAction() { - log.debug('expectMissingDuplicatePanelAction'); - await this.expectMissingPanelAction(CLONE_PANEL_DATA_TEST_SUBJ); - } - - async expectMissingRemovePanelAction() { - log.debug('expectMissingRemovePanelAction'); - await this.expectMissingPanelAction(REMOVE_PANEL_DATA_TEST_SUBJ); - } - - async expectExistsToggleExpandAction() { - log.debug('expectExistsToggleExpandAction'); - await this.expectExistsPanelAction(TOGGLE_EXPAND_PANEL_DATA_TEST_SUBJ); - } - - async getPanelHeading(title: string) { - return await testSubjects.find(`embeddablePanelHeading-${title.replace(/\s/g, '')}`); + const isActionVisible = await this.testSubjects.exists(COPY_PANEL_TO_DATA_TEST_SUBJ); + if (!isActionVisible) await this.clickContextMenuMoreItem(); + await this.testSubjects.click(COPY_PANEL_TO_DATA_TEST_SUBJ); + } + + async openInspectorByTitle(title: string) { + const header = await this.getPanelHeading(title); + await this.openInspector(header); + } + + async getSearchSessionIdByTitle(title: string) { + await this.openInspectorByTitle(title); + await this.inspector.openInspectorRequestsView(); + const searchSessionId = await ( + await this.testSubjects.find('inspectorRequestSearchSessionId') + ).getAttribute('data-search-session-id'); + await this.inspector.close(); + return searchSessionId; + } + + async openInspector(parent?: WebElementWrapper) { + await this.openContextMenu(parent); + const exists = await this.testSubjects.exists(OPEN_INSPECTOR_TEST_SUBJ); + if (!exists) { + await this.clickContextMenuMoreItem(); } - - async clickHidePanelTitleToggle() { - await testSubjects.click('customizePanelHideTitle'); + await this.testSubjects.click(OPEN_INSPECTOR_TEST_SUBJ); + } + + async unlinkFromLibary(parent?: WebElementWrapper) { + this.log.debug('unlinkFromLibrary'); + const libraryNotification = parent + ? await this.testSubjects.findDescendant(LIBRARY_NOTIFICATION_TEST_SUBJ, parent) + : await this.testSubjects.find(LIBRARY_NOTIFICATION_TEST_SUBJ); + await libraryNotification.click(); + await this.testSubjects.click('libraryNotificationUnlinkButton'); + } + + async saveToLibrary(newTitle: string, parent?: WebElementWrapper) { + this.log.debug('saveToLibrary'); + await this.openContextMenu(parent); + const exists = await this.testSubjects.exists(SAVE_TO_LIBRARY_TEST_SUBJ); + if (!exists) { + await this.clickContextMenuMoreItem(); } - - async toggleHidePanelTitle(originalTitle?: string) { - log.debug(`hidePanelTitle(${originalTitle})`); - if (originalTitle) { - const panelOptions = await this.getPanelHeading(originalTitle); - await this.customizePanel(panelOptions); - } else { - await this.customizePanel(); - } - await this.clickHidePanelTitleToggle(); - await testSubjects.click('saveNewTitleButton'); + await this.testSubjects.click(SAVE_TO_LIBRARY_TEST_SUBJ); + await this.testSubjects.setValue('savedObjectTitle', newTitle, { + clearWithKeyboard: true, + }); + await this.testSubjects.click('confirmSaveSavedObjectButton'); + } + + async expectExistsRemovePanelAction() { + this.log.debug('expectExistsRemovePanelAction'); + await this.expectExistsPanelAction(REMOVE_PANEL_DATA_TEST_SUBJ); + } + + async expectExistsPanelAction(testSubject: string) { + this.log.debug('expectExistsPanelAction', testSubject); + await this.openContextMenu(); + if (await this.testSubjects.exists(CLONE_PANEL_DATA_TEST_SUBJ)) return; + if (await this.hasContextMenuMoreItem()) { + await this.clickContextMenuMoreItem(); } + await this.testSubjects.existOrFail(CLONE_PANEL_DATA_TEST_SUBJ); + await this.toggleContextMenu(); + } - /** - * - * @param customTitle - * @param originalTitle - optional to specify which panel to change the title on. - * @return {Promise} - */ - async setCustomPanelTitle(customTitle: string, originalTitle?: string) { - log.debug(`setCustomPanelTitle(${customTitle}, ${originalTitle})`); - if (originalTitle) { - const panelOptions = await this.getPanelHeading(originalTitle); - await this.customizePanel(panelOptions); - } else { - await this.customizePanel(); + async expectMissingPanelAction(testSubject: string) { + this.log.debug('expectMissingPanelAction', testSubject); + await this.openContextMenu(); + await this.testSubjects.missingOrFail(testSubject); + if (await this.hasContextMenuMoreItem()) { + await this.clickContextMenuMoreItem(); + await this.testSubjects.missingOrFail(testSubject); + } + await this.toggleContextMenu(); + } + + async expectExistsEditPanelAction() { + this.log.debug('expectExistsEditPanelAction'); + await this.expectExistsPanelAction(EDIT_PANEL_DATA_TEST_SUBJ); + } + + async expectExistsReplacePanelAction() { + this.log.debug('expectExistsReplacePanelAction'); + await this.expectExistsPanelAction(REPLACE_PANEL_DATA_TEST_SUBJ); + } + + async expectExistsClonePanelAction() { + this.log.debug('expectExistsClonePanelAction'); + await this.expectExistsPanelAction(CLONE_PANEL_DATA_TEST_SUBJ); + } + + async expectMissingEditPanelAction() { + this.log.debug('expectMissingEditPanelAction'); + await this.expectMissingPanelAction(EDIT_PANEL_DATA_TEST_SUBJ); + } + + async expectMissingReplacePanelAction() { + this.log.debug('expectMissingReplacePanelAction'); + await this.expectMissingPanelAction(REPLACE_PANEL_DATA_TEST_SUBJ); + } + + async expectMissingDuplicatePanelAction() { + this.log.debug('expectMissingDuplicatePanelAction'); + await this.expectMissingPanelAction(CLONE_PANEL_DATA_TEST_SUBJ); + } + + async expectMissingRemovePanelAction() { + this.log.debug('expectMissingRemovePanelAction'); + await this.expectMissingPanelAction(REMOVE_PANEL_DATA_TEST_SUBJ); + } + + async expectExistsToggleExpandAction() { + this.log.debug('expectExistsToggleExpandAction'); + await this.expectExistsPanelAction(TOGGLE_EXPAND_PANEL_DATA_TEST_SUBJ); + } + + async getPanelHeading(title: string) { + return await this.testSubjects.find(`embeddablePanelHeading-${title.replace(/\s/g, '')}`); + } + + async clickHidePanelTitleToggle() { + await this.testSubjects.click('customizePanelHideTitle'); + } + + async toggleHidePanelTitle(originalTitle?: string) { + this.log.debug(`hidePanelTitle(${originalTitle})`); + if (originalTitle) { + const panelOptions = await this.getPanelHeading(originalTitle); + await this.customizePanel(panelOptions); + } else { + await this.customizePanel(); + } + await this.clickHidePanelTitleToggle(); + await this.testSubjects.click('saveNewTitleButton'); + } + + /** + * + * @param customTitle + * @param originalTitle - optional to specify which panel to change the title on. + * @return {Promise} + */ + async setCustomPanelTitle(customTitle: string, originalTitle?: string) { + this.log.debug(`setCustomPanelTitle(${customTitle}, ${originalTitle})`); + if (originalTitle) { + const panelOptions = await this.getPanelHeading(originalTitle); + await this.customizePanel(panelOptions); + } else { + await this.customizePanel(); + } + await this.testSubjects.setValue('customEmbeddablePanelTitleInput', customTitle); + await this.testSubjects.click('saveNewTitleButton'); + } + + async resetCustomPanelTitle(panel?: WebElementWrapper) { + this.log.debug('resetCustomPanelTitle'); + await this.customizePanel(panel); + await this.testSubjects.click('resetCustomEmbeddablePanelTitle'); + await this.testSubjects.click('saveNewTitleButton'); + await this.toggleContextMenu(panel); + } + + async getActionWebElementByText(text: string): Promise { + this.log.debug(`getActionWebElement: "${text}"`); + const menu = await this.testSubjects.find('multipleActionsContextMenu'); + const items = await menu.findAllByCssSelector('[data-test-subj*="embeddablePanelAction-"]'); + for (const item of items) { + const currentText = await item.getVisibleText(); + if (currentText === text) { + return item; } - await testSubjects.setValue('customEmbeddablePanelTitleInput', customTitle); - await testSubjects.click('saveNewTitleButton'); } - async resetCustomPanelTitle(panel?: WebElementWrapper) { - log.debug('resetCustomPanelTitle'); - await this.customizePanel(panel); - await testSubjects.click('resetCustomEmbeddablePanelTitle'); - await testSubjects.click('saveNewTitleButton'); - await this.toggleContextMenu(panel); - } - - async getActionWebElementByText(text: string): Promise { - log.debug(`getActionWebElement: "${text}"`); - const menu = await testSubjects.find('multipleActionsContextMenu'); - const items = await menu.findAllByCssSelector('[data-test-subj*="embeddablePanelAction-"]'); - for (const item of items) { - const currentText = await item.getVisibleText(); - if (currentText === text) { - return item; - } - } - - throw new Error(`No action matching text "${text}"`); - } - })(); + throw new Error(`No action matching text "${text}"`); + } } diff --git a/test/functional/services/dashboard/replace_panel.ts b/test/functional/services/dashboard/replace_panel.ts index 3b33b5cd4f6a65..8f8f680b839bf3 100644 --- a/test/functional/services/dashboard/replace_panel.ts +++ b/test/functional/services/dashboard/replace_panel.ts @@ -6,89 +6,87 @@ * Side Public License, v 1. */ -import { FtrProviderContext } from '../../ftr_provider_context'; +import { FtrService } from '../../ftr_provider_context'; -export function DashboardReplacePanelProvider({ getService }: FtrProviderContext) { - const log = getService('log'); - const testSubjects = getService('testSubjects'); - const flyout = getService('flyout'); +export class DashboardReplacePanelService extends FtrService { + private readonly log = this.ctx.getService('log'); + private readonly testSubjects = this.ctx.getService('testSubjects'); + private readonly flyout = this.ctx.getService('flyout'); - return new (class DashboardReplacePanel { - async toggleFilterPopover() { - log.debug('DashboardReplacePanel.toggleFilter'); - await testSubjects.click('savedObjectFinderFilterButton'); - } + async toggleFilterPopover() { + this.log.debug('DashboardReplacePanel.toggleFilter'); + await this.testSubjects.click('savedObjectFinderFilterButton'); + } - async toggleFilter(type: string) { - log.debug(`DashboardReplacePanel.replaceToFilter(${type})`); - await this.waitForListLoading(); - await this.toggleFilterPopover(); - await testSubjects.click(`savedObjectFinderFilter-${type}`); - await this.toggleFilterPopover(); - } + async toggleFilter(type: string) { + this.log.debug(`DashboardReplacePanel.replaceToFilter(${type})`); + await this.waitForListLoading(); + await this.toggleFilterPopover(); + await this.testSubjects.click(`savedObjectFinderFilter-${type}`); + await this.toggleFilterPopover(); + } - async isReplacePanelOpen() { - log.debug('DashboardReplacePanel.isReplacePanelOpen'); - return await testSubjects.exists('dashboardReplacePanel'); - } + async isReplacePanelOpen() { + this.log.debug('DashboardReplacePanel.isReplacePanelOpen'); + return await this.testSubjects.exists('dashboardReplacePanel'); + } - async ensureReplacePanelIsShowing() { - log.debug('DashboardReplacePanel.ensureReplacePanelIsShowing'); - const isOpen = await this.isReplacePanelOpen(); - if (!isOpen) { - throw new Error('Replace panel is not open, trying again.'); - } + async ensureReplacePanelIsShowing() { + this.log.debug('DashboardReplacePanel.ensureReplacePanelIsShowing'); + const isOpen = await this.isReplacePanelOpen(); + if (!isOpen) { + throw new Error('Replace panel is not open, trying again.'); } + } - async waitForListLoading() { - await testSubjects.waitForDeleted('savedObjectFinderLoadingIndicator'); - } + async waitForListLoading() { + await this.testSubjects.waitForDeleted('savedObjectFinderLoadingIndicator'); + } - async closeReplacePanel() { - await flyout.ensureClosed('dashboardReplacePanel'); - } + async closeReplacePanel() { + await this.flyout.ensureClosed('dashboardReplacePanel'); + } - async replaceSavedSearch(searchName: string) { - return this.replaceEmbeddable(searchName, 'search'); - } + async replaceSavedSearch(searchName: string) { + return this.replaceEmbeddable(searchName, 'search'); + } - async replaceSavedSearches(searches: string[]) { - for (const name of searches) { - await this.replaceSavedSearch(name); - } + async replaceSavedSearches(searches: string[]) { + for (const name of searches) { + await this.replaceSavedSearch(name); } + } - async replaceVisualization(vizName: string) { - return this.replaceEmbeddable(vizName, 'visualization'); - } + async replaceVisualization(vizName: string) { + return this.replaceEmbeddable(vizName, 'visualization'); + } - async replaceEmbeddable(embeddableName: string, embeddableType?: string) { - log.debug( - `DashboardReplacePanel.replaceEmbeddable, name: ${embeddableName}, type: ${embeddableType}` - ); - await this.ensureReplacePanelIsShowing(); - if (embeddableType) { - await this.toggleFilter(embeddableType); - } - await this.filterEmbeddableNames(`"${embeddableName.replace('-', ' ')}"`); - await testSubjects.click(`savedObjectTitle${embeddableName.split(' ').join('-')}`); - await testSubjects.exists('addObjectToDashboardSuccess'); - await this.closeReplacePanel(); - return embeddableName; + async replaceEmbeddable(embeddableName: string, embeddableType?: string) { + this.log.debug( + `DashboardReplacePanel.replaceEmbeddable, name: ${embeddableName}, type: ${embeddableType}` + ); + await this.ensureReplacePanelIsShowing(); + if (embeddableType) { + await this.toggleFilter(embeddableType); } + await this.filterEmbeddableNames(`"${embeddableName.replace('-', ' ')}"`); + await this.testSubjects.click(`savedObjectTitle${embeddableName.split(' ').join('-')}`); + await this.testSubjects.exists('addObjectToDashboardSuccess'); + await this.closeReplacePanel(); + return embeddableName; + } - async filterEmbeddableNames(name: string) { - // The search input field may be disabled while the table is loading so wait for it - await this.waitForListLoading(); - await testSubjects.setValue('savedObjectFinderSearchInput', name); - await this.waitForListLoading(); - } + async filterEmbeddableNames(name: string) { + // The search input field may be disabled while the table is loading so wait for it + await this.waitForListLoading(); + await this.testSubjects.setValue('savedObjectFinderSearchInput', name); + await this.waitForListLoading(); + } - async panelReplaceLinkExists(name: string) { - log.debug(`DashboardReplacePanel.panelReplaceLinkExists(${name})`); - await this.ensureReplacePanelIsShowing(); - await this.filterEmbeddableNames(`"${name}"`); - return await testSubjects.exists(`savedObjectTitle${name.split(' ').join('-')}`); - } - })(); + async panelReplaceLinkExists(name: string) { + this.log.debug(`DashboardReplacePanel.panelReplaceLinkExists(${name})`); + await this.ensureReplacePanelIsShowing(); + await this.filterEmbeddableNames(`"${name}"`); + return await this.testSubjects.exists(`savedObjectTitle${name.split(' ').join('-')}`); + } } diff --git a/test/functional/services/dashboard/visualizations.ts b/test/functional/services/dashboard/visualizations.ts index 2bf7458ff9c5f4..a6b88802d7b814 100644 --- a/test/functional/services/dashboard/visualizations.ts +++ b/test/functional/services/dashboard/visualizations.ts @@ -6,14 +6,14 @@ * Side Public License, v 1. */ -import { FtrProviderContext } from '../../ftr_provider_context'; +import { FtrService } from '../../ftr_provider_context'; -export function DashboardVisualizationProvider({ getService, getPageObjects }: FtrProviderContext) { - const log = getService('log'); - const queryBar = getService('queryBar'); - const testSubjects = getService('testSubjects'); - const dashboardAddPanel = getService('dashboardAddPanel'); - const PageObjects = getPageObjects([ +export class DashboardVisualizationsService extends FtrService { + private readonly log = this.ctx.getService('log'); + private readonly queryBar = this.ctx.getService('queryBar'); + private readonly testSubjects = this.ctx.getService('testSubjects'); + private readonly dashboardAddPanel = this.ctx.getService('dashboardAddPanel'); + private readonly PageObjects = this.ctx.getPageObjects([ 'dashboard', 'visualize', 'visEditor', @@ -22,108 +22,106 @@ export function DashboardVisualizationProvider({ getService, getPageObjects }: F 'timePicker', ]); - return new (class DashboardVisualizations { - async createAndAddTSVBVisualization(name: string) { - log.debug(`createAndAddTSVBVisualization(${name})`); - const inViewMode = await PageObjects.dashboard.getIsInViewMode(); - if (inViewMode) { - await PageObjects.dashboard.switchToEditMode(); - } - await dashboardAddPanel.clickEditorMenuButton(); - await dashboardAddPanel.clickAddNewEmbeddableLink('metrics'); - await PageObjects.visualize.clickVisualBuilder(); - await PageObjects.visualize.saveVisualizationExpectSuccess(name); + async createAndAddTSVBVisualization(name: string) { + this.log.debug(`createAndAddTSVBVisualization(${name})`); + const inViewMode = await this.PageObjects.dashboard.getIsInViewMode(); + if (inViewMode) { + await this.PageObjects.dashboard.switchToEditMode(); } + await this.dashboardAddPanel.clickEditorMenuButton(); + await this.dashboardAddPanel.clickAddNewEmbeddableLink('metrics'); + await this.PageObjects.visualize.clickVisualBuilder(); + await this.PageObjects.visualize.saveVisualizationExpectSuccess(name); + } - async createSavedSearch({ - name, - query, - fields, - }: { - name: string; - query?: string; - fields?: string[]; - }) { - log.debug(`createSavedSearch(${name})`); - await PageObjects.header.clickDiscover(true); - await PageObjects.timePicker.setHistoricalDataRange(); + async createSavedSearch({ + name, + query, + fields, + }: { + name: string; + query?: string; + fields?: string[]; + }) { + this.log.debug(`createSavedSearch(${name})`); + await this.PageObjects.header.clickDiscover(true); + await this.PageObjects.timePicker.setHistoricalDataRange(); - if (query) { - await queryBar.setQuery(query); - await queryBar.submitQuery(); - } + if (query) { + await this.queryBar.setQuery(query); + await this.queryBar.submitQuery(); + } - if (fields) { - for (let i = 0; i < fields.length; i++) { - await PageObjects.discover.clickFieldListItemAdd(fields[i]); - } + if (fields) { + for (let i = 0; i < fields.length; i++) { + await this.PageObjects.discover.clickFieldListItemAdd(fields[i]); } - - await PageObjects.discover.saveSearch(name); - await PageObjects.header.waitUntilLoadingHasFinished(); - await testSubjects.exists('saveSearchSuccess'); } - async createAndAddSavedSearch({ - name, - query, - fields, - }: { - name: string; - query?: string; - fields?: string[]; - }) { - log.debug(`createAndAddSavedSearch(${name})`); - await this.createSavedSearch({ name, query, fields }); + await this.PageObjects.discover.saveSearch(name); + await this.PageObjects.header.waitUntilLoadingHasFinished(); + await this.testSubjects.exists('saveSearchSuccess'); + } - await PageObjects.header.clickDashboard(); + async createAndAddSavedSearch({ + name, + query, + fields, + }: { + name: string; + query?: string; + fields?: string[]; + }) { + this.log.debug(`createAndAddSavedSearch(${name})`); + await this.createSavedSearch({ name, query, fields }); - const inViewMode = await PageObjects.dashboard.getIsInViewMode(); - if (inViewMode) { - await PageObjects.dashboard.switchToEditMode(); - } - await dashboardAddPanel.addSavedSearch(name); + await this.PageObjects.header.clickDashboard(); + + const inViewMode = await this.PageObjects.dashboard.getIsInViewMode(); + if (inViewMode) { + await this.PageObjects.dashboard.switchToEditMode(); } + await this.dashboardAddPanel.addSavedSearch(name); + } - async createAndAddMarkdown({ name, markdown }: { name: string; markdown: string }) { - log.debug(`createAndAddMarkdown(${markdown})`); - const inViewMode = await PageObjects.dashboard.getIsInViewMode(); - if (inViewMode) { - await PageObjects.dashboard.switchToEditMode(); - } - await dashboardAddPanel.clickMarkdownQuickButton(); - await PageObjects.visEditor.setMarkdownTxt(markdown); - await PageObjects.visEditor.clickGo(); - await PageObjects.visualize.saveVisualizationExpectSuccess(name, { - saveAsNew: false, - redirectToOrigin: true, - }); + async createAndAddMarkdown({ name, markdown }: { name: string; markdown: string }) { + this.log.debug(`createAndAddMarkdown(${markdown})`); + const inViewMode = await this.PageObjects.dashboard.getIsInViewMode(); + if (inViewMode) { + await this.PageObjects.dashboard.switchToEditMode(); } + await this.dashboardAddPanel.clickMarkdownQuickButton(); + await this.PageObjects.visEditor.setMarkdownTxt(markdown); + await this.PageObjects.visEditor.clickGo(); + await this.PageObjects.visualize.saveVisualizationExpectSuccess(name, { + saveAsNew: false, + redirectToOrigin: true, + }); + } - async createAndEmbedMetric(name: string) { - log.debug(`createAndEmbedMetric(${name})`); - const inViewMode = await PageObjects.dashboard.getIsInViewMode(); - if (inViewMode) { - await PageObjects.dashboard.switchToEditMode(); - } - await dashboardAddPanel.clickEditorMenuButton(); - await dashboardAddPanel.clickAggBasedVisualizations(); - await dashboardAddPanel.clickVisType('metric'); - await testSubjects.click('savedObjectTitlelogstash-*'); - await testSubjects.exists('visualizesaveAndReturnButton'); - await testSubjects.click('visualizesaveAndReturnButton'); + async createAndEmbedMetric(name: string) { + this.log.debug(`createAndEmbedMetric(${name})`); + const inViewMode = await this.PageObjects.dashboard.getIsInViewMode(); + if (inViewMode) { + await this.PageObjects.dashboard.switchToEditMode(); } + await this.dashboardAddPanel.clickEditorMenuButton(); + await this.dashboardAddPanel.clickAggBasedVisualizations(); + await this.dashboardAddPanel.clickVisType('metric'); + await this.testSubjects.click('savedObjectTitlelogstash-*'); + await this.testSubjects.exists('visualizesaveAndReturnButton'); + await this.testSubjects.click('visualizesaveAndReturnButton'); + } - async createAndEmbedMarkdown({ name, markdown }: { name: string; markdown: string }) { - log.debug(`createAndEmbedMarkdown(${markdown})`); - const inViewMode = await PageObjects.dashboard.getIsInViewMode(); - if (inViewMode) { - await PageObjects.dashboard.switchToEditMode(); - } - await dashboardAddPanel.clickMarkdownQuickButton(); - await PageObjects.visEditor.setMarkdownTxt(markdown); - await PageObjects.visEditor.clickGo(); - await testSubjects.click('visualizesaveAndReturnButton'); + async createAndEmbedMarkdown({ name, markdown }: { name: string; markdown: string }) { + this.log.debug(`createAndEmbedMarkdown(${markdown})`); + const inViewMode = await this.PageObjects.dashboard.getIsInViewMode(); + if (inViewMode) { + await this.PageObjects.dashboard.switchToEditMode(); } - })(); + await this.dashboardAddPanel.clickMarkdownQuickButton(); + await this.PageObjects.visEditor.setMarkdownTxt(markdown); + await this.PageObjects.visEditor.clickGo(); + await this.testSubjects.click('visualizesaveAndReturnButton'); + } } diff --git a/test/functional/services/index.ts b/test/functional/services/index.ts index 819b8a3981e261..d9cadb1169a667 100644 --- a/test/functional/services/index.ts +++ b/test/functional/services/index.ts @@ -19,11 +19,11 @@ import { } from './common'; import { ComboBoxProvider } from './combo_box'; import { - DashboardAddPanelProvider, - DashboardReplacePanelProvider, - DashboardExpectProvider, - DashboardPanelActionsProvider, - DashboardVisualizationProvider, + DashboardAddPanelService, + DashboardReplacePanelService, + DashboardExpectService, + DashboardPanelActionsService, + DashboardVisualizationsService, } from './dashboard'; import { DocTableService } from './doc_table'; import { EmbeddingProvider } from './embedding'; @@ -60,13 +60,13 @@ export const services = { docTable: DocTableService, screenshots: ScreenshotsService, snapshots: SnapshotsService, - dashboardVisualizations: DashboardVisualizationProvider, - dashboardExpect: DashboardExpectProvider, failureDebugging: FailureDebuggingProvider, listingTable: ListingTableService, - dashboardAddPanel: DashboardAddPanelProvider, - dashboardReplacePanel: DashboardReplacePanelProvider, - dashboardPanelActions: DashboardPanelActionsProvider, + dashboardVisualizations: DashboardVisualizationsService, + dashboardExpect: DashboardExpectService, + dashboardAddPanel: DashboardAddPanelService, + dashboardReplacePanel: DashboardReplacePanelService, + dashboardPanelActions: DashboardPanelActionsService, flyout: FlyoutProvider, comboBox: ComboBoxProvider, dataGrid: DataGridService, From c166dae31e4fde7e1ba83413b3fbc2fa6e3e3f99 Mon Sep 17 00:00:00 2001 From: Spencer Date: Wed, 26 May 2021 12:01:31 -0700 Subject: [PATCH 04/16] [ftr] migrate visualizations service to FtrService classes (#100522) Co-authored-by: spalger --- test/functional/apps/visualize/_vega_chart.ts | 20 +- test/functional/services/index.ts | 12 +- .../services/visualizations/elastic_chart.ts | 186 ++++++++-------- .../services/visualizations/index.ts | 6 +- .../services/visualizations/pie_chart.ts | 208 +++++++++--------- .../visualizations/vega_debug_inspector.ts | 72 +++--- 6 files changed, 248 insertions(+), 256 deletions(-) diff --git a/test/functional/apps/visualize/_vega_chart.ts b/test/functional/apps/visualize/_vega_chart.ts index da33b390925a4e..b2692c2a00d781 100644 --- a/test/functional/apps/visualize/_vega_chart.ts +++ b/test/functional/apps/visualize/_vega_chart.ts @@ -118,12 +118,12 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) { await inspector.openInspectorRequestsView(); for (const getFn of [ - inspector.getOpenRequestDetailRequestButton, - inspector.getOpenRequestDetailResponseButton, - inspector.getOpenRequestStatisticButton, - ]) { + 'getOpenRequestDetailRequestButton', + 'getOpenRequestDetailResponseButton', + 'getOpenRequestStatisticButton', + ] as const) { await retry.try(async () => { - const requestStatisticTab = await getFn(); + const requestStatisticTab = await inspector[getFn](); expect(await requestStatisticTab.isEnabled()).to.be(true); }); @@ -159,12 +159,12 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) { await vegaDebugInspectorView.openVegaDebugInspectorView(); for (const getFn of [ - vegaDebugInspectorView.getOpenDataViewerButton, - vegaDebugInspectorView.getOpenSignalViewerButton, - vegaDebugInspectorView.getOpenSpecViewerButton, - ]) { + 'getOpenDataViewerButton', + 'getOpenSignalViewerButton', + 'getOpenSpecViewerButton', + ] as const) { await retry.try(async () => { - const requestStatisticTab = await getFn(); + const requestStatisticTab = await vegaDebugInspectorView[getFn](); expect(await requestStatisticTab.isEnabled()).to.be(true); }); diff --git a/test/functional/services/index.ts b/test/functional/services/index.ts index d9cadb1169a667..a483dd4f21ba9f 100644 --- a/test/functional/services/index.ts +++ b/test/functional/services/index.ts @@ -39,9 +39,9 @@ import { RenderableProvider } from './renderable'; import { ToastsProvider } from './toasts'; import { DataGridService } from './data_grid'; import { - PieChartProvider, - ElasticChartProvider, - VegaDebugInspectorViewProvider, + PieChartService, + ElasticChartService, + VegaDebugInspectorViewService, } from './visualizations'; import { ListingTableService } from './listing_table'; import { SavedQueryManagementComponentProvider } from './saved_query_management_component'; @@ -73,15 +73,15 @@ export const services = { embedding: EmbeddingProvider, renderable: RenderableProvider, browser: BrowserProvider, - pieChart: PieChartProvider, + pieChart: PieChartService, inspector: InspectorProvider, fieldEditor: FieldEditorService, - vegaDebugInspector: VegaDebugInspectorViewProvider, + vegaDebugInspector: VegaDebugInspectorViewService, appsMenu: AppsMenuProvider, globalNav: GlobalNavService, toasts: ToastsProvider, savedQueryManagementComponent: SavedQueryManagementComponentProvider, - elasticChart: ElasticChartProvider, + elasticChart: ElasticChartService, supertest: KibanaSupertestProvider, managementMenu: ManagementMenuProvider, monacoEditor: MonacoEditorProvider, diff --git a/test/functional/services/visualizations/elastic_chart.ts b/test/functional/services/visualizations/elastic_chart.ts index 80483100a06dd3..b954b4ba03616e 100644 --- a/test/functional/services/visualizations/elastic_chart.ts +++ b/test/functional/services/visualizations/elastic_chart.ts @@ -9,7 +9,7 @@ import { DebugState } from '@elastic/charts'; import expect from '@kbn/expect'; -import { FtrProviderContext } from '../../ftr_provider_context'; +import { FtrService } from '../../ftr_provider_context'; import { WebElementWrapper } from '../lib/web_element_wrapper'; declare global { @@ -21,115 +21,111 @@ declare global { } } -export function ElasticChartProvider({ getService }: FtrProviderContext) { - const testSubjects = getService('testSubjects'); - const find = getService('find'); - const retry = getService('retry'); - const log = getService('log'); - const browser = getService('browser'); - - class ElasticChart { - public async getCanvas(dataTestSubj?: string) { - if (dataTestSubj) { - const chart = await this.getChart(dataTestSubj); - return await chart.findByClassName('echCanvasRenderer'); - } - return await find.byCssSelector('.echChart canvas:last-of-type'); - } +export class ElasticChartService extends FtrService { + private readonly testSubjects = this.ctx.getService('testSubjects'); + private readonly find = this.ctx.getService('find'); + private readonly retry = this.ctx.getService('retry'); + private readonly log = this.ctx.getService('log'); + private readonly browser = this.ctx.getService('browser'); - public async canvasExists() { - return await find.existsByCssSelector('.echChart canvas:last-of-type'); - } - - public async waitForRenderComplete(dataTestSubj?: string) { + public async getCanvas(dataTestSubj?: string) { + if (dataTestSubj) { const chart = await this.getChart(dataTestSubj); - const rendered = await chart.findAllByCssSelector( - '.echChartStatus[data-ech-render-complete=true]' - ); - expect(rendered.length).to.equal(1); + return await chart.findByClassName('echCanvasRenderer'); } + return await this.find.byCssSelector('.echChart canvas:last-of-type'); + } - public async getVisualizationRenderingCount(dataTestSubj?: string) { - const chart = await this.getChart(dataTestSubj); - const visContainer = await chart.findByCssSelector('.echChartStatus'); - const renderingCount = await visContainer.getAttribute('data-ech-render-count'); - return Number(renderingCount); - } + public async canvasExists() { + return await this.find.existsByCssSelector('.echChart canvas:last-of-type'); + } - public async waitForRenderingCount(minimumCount: number, dataTestSubj?: string) { - await retry.waitFor(`rendering count to be equal to [${minimumCount}]`, async () => { - const currentRenderingCount = await this.getVisualizationRenderingCount(dataTestSubj); - log.debug(`-- currentRenderingCount=${currentRenderingCount}`); - return currentRenderingCount >= minimumCount; - }); - } + public async waitForRenderComplete(dataTestSubj?: string) { + const chart = await this.getChart(dataTestSubj); + const rendered = await chart.findAllByCssSelector( + '.echChartStatus[data-ech-render-complete=true]' + ); + expect(rendered.length).to.equal(1); + } - public async hasChart(dataTestSubj?: string, timeout?: number): Promise { - if (dataTestSubj) { - return await testSubjects.exists(dataTestSubj, { timeout }); - } else { - const charts = await this.getAllCharts(timeout); + public async getVisualizationRenderingCount(dataTestSubj?: string) { + const chart = await this.getChart(dataTestSubj); + const visContainer = await chart.findByCssSelector('.echChartStatus'); + const renderingCount = await visContainer.getAttribute('data-ech-render-count'); + return Number(renderingCount); + } - return charts.length > 0; - } - } + public async waitForRenderingCount(minimumCount: number, dataTestSubj?: string) { + await this.retry.waitFor(`rendering count to be equal to [${minimumCount}]`, async () => { + const currentRenderingCount = await this.getVisualizationRenderingCount(dataTestSubj); + this.log.debug(`-- currentRenderingCount=${currentRenderingCount}`); + return currentRenderingCount >= minimumCount; + }); + } - private async getChart( - dataTestSubj?: string, - timeout?: number, - match: number = 0 - ): Promise { - if (dataTestSubj) { - if (!(await testSubjects.exists(dataTestSubj, { timeout }))) { - throw Error(`Failed to find an elastic-chart with testSubject '${dataTestSubj}'`); - } - - return (await testSubjects.findAll(dataTestSubj))[match]; - } else { - const charts = await this.getAllCharts(timeout); - if (charts.length === 0) { - throw Error(`Failed to find any elastic-charts on the page`); - } else { - return charts[match]; - } - } - } + public async hasChart(dataTestSubj?: string, timeout?: number): Promise { + if (dataTestSubj) { + return await this.testSubjects.exists(dataTestSubj, { timeout }); + } else { + const charts = await this.getAllCharts(timeout); - private async getAllCharts(timeout?: number) { - return await find.allByCssSelector('.echChart', timeout); + return charts.length > 0; } + } - /** - * used to get chart data from `@elastic/charts` - * requires `window._echDebugStateFlag` to be true - */ - public async getChartDebugData( - dataTestSubj?: string, - match: number = 0 - ): Promise { - const chart = await this.getChart(dataTestSubj, undefined, match); - - try { - const visContainer = await chart.findByCssSelector('.echChartStatus'); - const debugDataString: string | undefined = await visContainer.getAttribute( - 'data-ech-debug-state' - ); - return debugDataString ? JSON.parse(debugDataString) : null; - } catch (error) { - throw Error('Elastic charts debugState not found'); + private async getChart( + dataTestSubj?: string, + timeout?: number, + match: number = 0 + ): Promise { + if (dataTestSubj) { + if (!(await this.testSubjects.exists(dataTestSubj, { timeout }))) { + throw Error(`Failed to find an elastic-chart with testSubject '${dataTestSubj}'`); + } + + return (await this.testSubjects.findAll(dataTestSubj))[match]; + } else { + const charts = await this.getAllCharts(timeout); + if (charts.length === 0) { + throw Error(`Failed to find any elastic-charts on the page`); + } else { + return charts[match]; } } + } - /** - * Used to set a flag on the window to trigger debug state on elastic charts - * @param value - */ - public async setNewChartUiDebugFlag(value = true) { - await browser.execute<[boolean], void>((v) => { - window._echDebugStateFlag = v; - }, value); + private async getAllCharts(timeout?: number) { + return await this.find.allByCssSelector('.echChart', timeout); + } + + /** + * used to get chart data from `@elastic/charts` + * requires `window._echDebugStateFlag` to be true + */ + public async getChartDebugData( + dataTestSubj?: string, + match: number = 0 + ): Promise { + const chart = await this.getChart(dataTestSubj, undefined, match); + + try { + const visContainer = await chart.findByCssSelector('.echChartStatus'); + const debugDataString: string | undefined = await visContainer.getAttribute( + 'data-ech-debug-state' + ); + return debugDataString ? JSON.parse(debugDataString) : null; + } catch (error) { + throw Error('Elastic charts debugState not found'); } } - return new ElasticChart(); + /** + * Used to set a flag on the window to trigger debug state on elastic charts + * @param value + */ + public async setNewChartUiDebugFlag(value = true) { + await this.browser.execute<[boolean], void>((v) => { + window._echDebugStateFlag = v; + }, value); + } } diff --git a/test/functional/services/visualizations/index.ts b/test/functional/services/visualizations/index.ts index 9c43a1be83de85..22c06f3821a309 100644 --- a/test/functional/services/visualizations/index.ts +++ b/test/functional/services/visualizations/index.ts @@ -6,6 +6,6 @@ * Side Public License, v 1. */ -export { PieChartProvider } from './pie_chart'; -export { ElasticChartProvider } from './elastic_chart'; -export { VegaDebugInspectorViewProvider } from './vega_debug_inspector'; +export { PieChartService } from './pie_chart'; +export { ElasticChartService } from './elastic_chart'; +export { VegaDebugInspectorViewService } from './vega_debug_inspector'; diff --git a/test/functional/services/visualizations/pie_chart.ts b/test/functional/services/visualizations/pie_chart.ts index bdf26ab8a5b448..cac4e8fe64c5e2 100644 --- a/test/functional/services/visualizations/pie_chart.ts +++ b/test/functional/services/visualizations/pie_chart.ts @@ -7,111 +7,111 @@ */ import expect from '@kbn/expect'; -import { FtrProviderContext } from '../../ftr_provider_context'; - -export function PieChartProvider({ getService }: FtrProviderContext) { - const log = getService('log'); - const retry = getService('retry'); - const config = getService('config'); - const inspector = getService('inspector'); - const testSubjects = getService('testSubjects'); - const find = getService('find'); - const defaultFindTimeout = config.get('timeouts.find'); - const panelActions = getService('dashboardPanelActions'); - - return new (class PieChart { - private readonly filterActionText = 'Apply filter to current view'; - - async clickOnPieSlice(name?: string) { - log.debug(`PieChart.clickOnPieSlice(${name})`); - if (name) { - await testSubjects.click(`pieSlice-${name.split(' ').join('-')}`); - } else { - // If no pie slice has been provided, find the first one available. - await retry.try(async () => { - const slices = await find.allByCssSelector('svg > g > g.arcs > path.slice'); - log.debug('Slices found:' + slices.length); - return slices[0].click(); - }); - } - } - - async filterOnPieSlice(name?: string) { - log.debug(`PieChart.filterOnPieSlice(${name})`); - await this.clickOnPieSlice(name); - const hasUiActionsPopup = await testSubjects.exists('multipleActionsContextMenu'); - if (hasUiActionsPopup) { - const actionElement = await panelActions.getActionWebElementByText(this.filterActionText); - await actionElement.click(); - } - } - - async filterByLegendItem(label: string) { - log.debug(`PieChart.filterByLegendItem(${label})`); - await testSubjects.click(`legend-${label}`); - await testSubjects.click(`legend-${label}-filterIn`); - } - - async getPieSlice(name: string) { - return await testSubjects.find(`pieSlice-${name.split(' ').join('-')}`); - } - - async getAllPieSlices(name: string) { - return await testSubjects.findAll(`pieSlice-${name.split(' ').join('-')}`); - } - - async getPieSliceStyle(name: string) { - log.debug(`VisualizePage.getPieSliceStyle(${name})`); - const pieSlice = await this.getPieSlice(name); - return await pieSlice.getAttribute('style'); - } - - async getAllPieSliceStyles(name: string) { - log.debug(`VisualizePage.getAllPieSliceStyles(${name})`); - const pieSlices = await this.getAllPieSlices(name); - return await Promise.all( - pieSlices.map(async (pieSlice) => await pieSlice.getAttribute('style')) - ); - } - - async getPieChartData() { - const chartTypes = await find.allByCssSelector('path.slice', defaultFindTimeout * 2); - return await Promise.all(chartTypes.map(async (chart) => await chart.getAttribute('d'))); - } - - async expectPieChartTableData(expectedTableData: Array<[]>) { - await inspector.open(); - await inspector.setTablePageSize(50); - await inspector.expectTableData(expectedTableData); - } - - async getPieChartLabels() { - const chartTypes = await find.allByCssSelector('path.slice', defaultFindTimeout * 2); - return await Promise.all( - chartTypes.map(async (chart) => await chart.getAttribute('data-label')) - ); - } - - async getPieSliceCount() { - log.debug('PieChart.getPieSliceCount'); - const slices = await find.allByCssSelector('svg > g > g.arcs > path.slice'); - return slices.length; - } - - async expectPieSliceCount(expectedCount: number) { - log.debug(`PieChart.expectPieSliceCount(${expectedCount})`); - await retry.try(async () => { - const slicesCount = await this.getPieSliceCount(); - expect(slicesCount).to.be(expectedCount); +import { FtrService } from '../../ftr_provider_context'; + +export class PieChartService extends FtrService { + private readonly log = this.ctx.getService('log'); + private readonly retry = this.ctx.getService('retry'); + private readonly config = this.ctx.getService('config'); + private readonly inspector = this.ctx.getService('inspector'); + private readonly testSubjects = this.ctx.getService('testSubjects'); + private readonly find = this.ctx.getService('find'); + private readonly panelActions = this.ctx.getService('dashboardPanelActions'); + private readonly defaultFindTimeout = this.config.get('timeouts.find'); + + private readonly filterActionText = 'Apply filter to current view'; + + async clickOnPieSlice(name?: string) { + this.log.debug(`PieChart.clickOnPieSlice(${name})`); + if (name) { + await this.testSubjects.click(`pieSlice-${name.split(' ').join('-')}`); + } else { + // If no pie slice has been provided, find the first one available. + await this.retry.try(async () => { + const slices = await this.find.allByCssSelector('svg > g > g.arcs > path.slice'); + this.log.debug('Slices found:' + slices.length); + return slices[0].click(); }); } - - async expectPieChartLabels(expectedLabels: string[]) { - log.debug(`PieChart.expectPieChartLabels(${expectedLabels.join(',')})`); - await retry.try(async () => { - const pieData = await this.getPieChartLabels(); - expect(pieData).to.eql(expectedLabels); - }); + } + + async filterOnPieSlice(name?: string) { + this.log.debug(`PieChart.filterOnPieSlice(${name})`); + await this.clickOnPieSlice(name); + const hasUiActionsPopup = await this.testSubjects.exists('multipleActionsContextMenu'); + if (hasUiActionsPopup) { + const actionElement = await this.panelActions.getActionWebElementByText( + this.filterActionText + ); + await actionElement.click(); } - })(); + } + + async filterByLegendItem(label: string) { + this.log.debug(`PieChart.filterByLegendItem(${label})`); + await this.testSubjects.click(`legend-${label}`); + await this.testSubjects.click(`legend-${label}-filterIn`); + } + + async getPieSlice(name: string) { + return await this.testSubjects.find(`pieSlice-${name.split(' ').join('-')}`); + } + + async getAllPieSlices(name: string) { + return await this.testSubjects.findAll(`pieSlice-${name.split(' ').join('-')}`); + } + + async getPieSliceStyle(name: string) { + this.log.debug(`VisualizePage.getPieSliceStyle(${name})`); + const pieSlice = await this.getPieSlice(name); + return await pieSlice.getAttribute('style'); + } + + async getAllPieSliceStyles(name: string) { + this.log.debug(`VisualizePage.getAllPieSliceStyles(${name})`); + const pieSlices = await this.getAllPieSlices(name); + return await Promise.all( + pieSlices.map(async (pieSlice) => await pieSlice.getAttribute('style')) + ); + } + + async getPieChartData() { + const chartTypes = await this.find.allByCssSelector('path.slice', this.defaultFindTimeout * 2); + return await Promise.all(chartTypes.map(async (chart) => await chart.getAttribute('d'))); + } + + async expectPieChartTableData(expectedTableData: Array<[]>) { + await this.inspector.open(); + await this.inspector.setTablePageSize(50); + await this.inspector.expectTableData(expectedTableData); + } + + async getPieChartLabels() { + const chartTypes = await this.find.allByCssSelector('path.slice', this.defaultFindTimeout * 2); + return await Promise.all( + chartTypes.map(async (chart) => await chart.getAttribute('data-label')) + ); + } + + async getPieSliceCount() { + this.log.debug('PieChart.getPieSliceCount'); + const slices = await this.find.allByCssSelector('svg > g > g.arcs > path.slice'); + return slices.length; + } + + async expectPieSliceCount(expectedCount: number) { + this.log.debug(`PieChart.expectPieSliceCount(${expectedCount})`); + await this.retry.try(async () => { + const slicesCount = await this.getPieSliceCount(); + expect(slicesCount).to.be(expectedCount); + }); + } + + async expectPieChartLabels(expectedLabels: string[]) { + this.log.debug(`PieChart.expectPieChartLabels(${expectedLabels.join(',')})`); + await this.retry.try(async () => { + const pieData = await this.getPieChartLabels(); + expect(pieData).to.eql(expectedLabels); + }); + } } diff --git a/test/functional/services/visualizations/vega_debug_inspector.ts b/test/functional/services/visualizations/vega_debug_inspector.ts index af61a5aee4dea9..f85d1d51107eb3 100644 --- a/test/functional/services/visualizations/vega_debug_inspector.ts +++ b/test/functional/services/visualizations/vega_debug_inspector.ts @@ -6,53 +6,49 @@ * Side Public License, v 1. */ -import { FtrProviderContext } from '../../ftr_provider_context'; +import { FtrService } from '../../ftr_provider_context'; -export function VegaDebugInspectorViewProvider({ getService }: FtrProviderContext) { - const testSubjects = getService('testSubjects'); - const inspector = getService('inspector'); - const dataGrid = getService('dataGrid'); +export class VegaDebugInspectorViewService extends FtrService { + private readonly testSubjects = this.ctx.getService('testSubjects'); + private readonly inspector = this.ctx.getService('inspector'); + private readonly dataGrid = this.ctx.getService('dataGrid'); - class VegaDebugInspectorView { - async openVegaDebugInspectorView() { - await inspector.openInspectorView('inspectorViewChooserVega debug'); - } - - public getOpenDataViewerButton() { - return testSubjects.find('vegaDataInspectorDataViewerButton'); - } + async openVegaDebugInspectorView() { + await this.inspector.openInspectorView('inspectorViewChooserVega debug'); + } - public getOpenSignalViewerButton() { - return testSubjects.find('vegaDataInspectorSignalViewerButton'); - } + public getOpenDataViewerButton() { + return this.testSubjects.find('vegaDataInspectorDataViewerButton'); + } - public getOpenSpecViewerButton() { - return testSubjects.find('vegaDataInspectorSpecViewerButton'); - } + public getOpenSignalViewerButton() { + return this.testSubjects.find('vegaDataInspectorSignalViewerButton'); + } - public getCopyClipboardButton() { - return testSubjects.find('vegaDataInspectorCopyClipboardButton'); - } + public getOpenSpecViewerButton() { + return this.testSubjects.find('vegaDataInspectorSpecViewerButton'); + } - public getGridTableData() { - return dataGrid.getDataGridTableData(); - } + public getCopyClipboardButton() { + return this.testSubjects.find('vegaDataInspectorCopyClipboardButton'); + } - public async navigateToDataViewerTab() { - const dataViewerButton = await this.getOpenDataViewerButton(); - await dataViewerButton.click(); - } + public getGridTableData() { + return this.dataGrid.getDataGridTableData(); + } - public async navigateToSignalViewerTab() { - const signalViewerButton = await this.getOpenSignalViewerButton(); - await signalViewerButton.click(); - } + public async navigateToDataViewerTab() { + const dataViewerButton = await this.getOpenDataViewerButton(); + await dataViewerButton.click(); + } - public async navigateToSpecViewerTab() { - const specViewerButton = await this.getOpenSpecViewerButton(); - await specViewerButton.click(); - } + public async navigateToSignalViewerTab() { + const signalViewerButton = await this.getOpenSignalViewerButton(); + await signalViewerButton.click(); } - return new VegaDebugInspectorView(); + public async navigateToSpecViewerTab() { + const specViewerButton = await this.getOpenSpecViewerButton(); + await specViewerButton.click(); + } } From 7270c3bf40b1c1c5f302de8fb910a61aa0979321 Mon Sep 17 00:00:00 2001 From: Spencer Date: Wed, 26 May 2021 12:10:14 -0700 Subject: [PATCH 05/16] [ftr] migrate management services to FtrService class (#100521) Co-authored-by: spalger --- test/functional/services/index.ts | 4 +- test/functional/services/management/index.ts | 2 +- .../services/management/management_menu.ts | 44 +++++++++---------- 3 files changed, 23 insertions(+), 27 deletions(-) diff --git a/test/functional/services/index.ts b/test/functional/services/index.ts index a483dd4f21ba9f..b2e0a3e0f473e7 100644 --- a/test/functional/services/index.ts +++ b/test/functional/services/index.ts @@ -32,7 +32,7 @@ import { FlyoutProvider } from './flyout'; import { GlobalNavService } from './global_nav'; import { InspectorProvider } from './inspector'; import { FieldEditorService } from './field_editor'; -import { ManagementMenuProvider } from './management'; +import { ManagementMenuService } from './management'; import { QueryBarProvider } from './query_bar'; import { RemoteProvider } from './remote'; import { RenderableProvider } from './renderable'; @@ -83,7 +83,7 @@ export const services = { savedQueryManagementComponent: SavedQueryManagementComponentProvider, elasticChart: ElasticChartService, supertest: KibanaSupertestProvider, - managementMenu: ManagementMenuProvider, + managementMenu: ManagementMenuService, monacoEditor: MonacoEditorProvider, MenuToggle: MenuToggleProvider, }; diff --git a/test/functional/services/management/index.ts b/test/functional/services/management/index.ts index 988ac06f1ca18e..8fc1a88ee5892a 100644 --- a/test/functional/services/management/index.ts +++ b/test/functional/services/management/index.ts @@ -6,4 +6,4 @@ * Side Public License, v 1. */ -export { ManagementMenuProvider } from './management_menu'; +export { ManagementMenuService } from './management_menu'; diff --git a/test/functional/services/management/management_menu.ts b/test/functional/services/management/management_menu.ts index eb8c6901ffa665..738a8d55439ece 100644 --- a/test/functional/services/management/management_menu.ts +++ b/test/functional/services/management/management_menu.ts @@ -6,35 +6,31 @@ * Side Public License, v 1. */ -import { FtrProviderContext } from 'test/functional/ftr_provider_context'; +import { FtrService } from '../../ftr_provider_context'; -export function ManagementMenuProvider({ getService }: FtrProviderContext) { - const find = getService('find'); +export class ManagementMenuService extends FtrService { + private readonly find = this.ctx.getService('find'); - class ManagementMenu { - public async getSections() { - const sectionsElements = await find.allByCssSelector( - '.mgtSideBarNav > .euiSideNav__content > .euiSideNavItem' - ); - - const sections = []; + public async getSections() { + const sectionsElements = await this.find.allByCssSelector( + '.mgtSideBarNav > .euiSideNav__content > .euiSideNavItem' + ); - for (const el of sectionsElements) { - const sectionId = await (await el.findByClassName('euiSideNavItemButton')).getAttribute( - 'data-test-subj' - ); - const sectionLinks = await Promise.all( - (await el.findAllByCssSelector('.euiSideNavItem > a.euiSideNavItemButton')).map((item) => - item.getAttribute('data-test-subj') - ) - ); + const sections = []; - sections.push({ sectionId, sectionLinks }); - } + for (const el of sectionsElements) { + const sectionId = await (await el.findByClassName('euiSideNavItemButton')).getAttribute( + 'data-test-subj' + ); + const sectionLinks = await Promise.all( + (await el.findAllByCssSelector('.euiSideNavItem > a.euiSideNavItemButton')).map((item) => + item.getAttribute('data-test-subj') + ) + ); - return sections; + sections.push({ sectionId, sectionLinks }); } - } - return new ManagementMenu(); + return sections; + } } From b189d05bc3304ad6180787b8e48f78a352814ffc Mon Sep 17 00:00:00 2001 From: Justin Kambic Date: Wed, 26 May 2021 15:31:15 -0400 Subject: [PATCH 06/16] [Uptime] Move uptime actions to Header Actions Menu (#100298) * Move uptime actions to Kibana's HeaderActionsMenu. * Delete a comment. * Extract ActionMenu content to dedicated component to make testing easier. * Add tests. * Use `EuiHeaderLinks` instead of `EuiFlexItem`. * Clean up tests. * Prefer `getByRole` for a test. * Fix copy mistake. * Fix a test broken by the previous commit. * Prefer `EuiHeaderSectionItem` over `EuiHeaderSectionLink` to avoid nesting `button`s within `buttons`. * Reverse "Settings" and "Alerts" menu options to make them uniform with APM. Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> --- .../components/common/header/action_menu.tsx | 72 ++----------- .../header/action_menu_content.test.tsx | 55 ++++++++++ .../common/header/action_menu_content.tsx | 101 ++++++++++++++++++ .../components/common/header/page_header.tsx | 4 - .../common/header/page_tabs.test.tsx | 5 - .../components/common/header/page_tabs.tsx | 17 +-- 6 files changed, 166 insertions(+), 88 deletions(-) create mode 100644 x-pack/plugins/uptime/public/components/common/header/action_menu_content.test.tsx create mode 100644 x-pack/plugins/uptime/public/components/common/header/action_menu_content.tsx diff --git a/x-pack/plugins/uptime/public/components/common/header/action_menu.tsx b/x-pack/plugins/uptime/public/components/common/header/action_menu.tsx index 1d5a375acedee1..6186d6f38b9685 100644 --- a/x-pack/plugins/uptime/public/components/common/header/action_menu.tsx +++ b/x-pack/plugins/uptime/public/components/common/header/action_menu.tsx @@ -6,70 +6,12 @@ */ import React from 'react'; -import { EuiButtonEmpty, EuiFlexGroup, EuiFlexItem, EuiToolTip } from '@elastic/eui'; -import { i18n } from '@kbn/i18n'; -import { useKibana } from '../../../../../../../src/plugins/kibana_react/public'; -import { - createExploratoryViewUrl, - HeaderMenuPortal, - SeriesUrl, -} from '../../../../../observability/public'; +import { HeaderMenuPortal } from '../../../../../observability/public'; import { AppMountParameters } from '../../../../../../../src/core/public'; -import { useUptimeSettingsContext } from '../../../contexts/uptime_settings_context'; -import { useGetUrlParams } from '../../../hooks'; +import { ActionMenuContent } from './action_menu_content'; -const ADD_DATA_LABEL = i18n.translate('xpack.uptime.addDataButtonLabel', { - defaultMessage: 'Add data', -}); - -const ANALYZE_DATA = i18n.translate('xpack.uptime.analyzeDataButtonLabel', { - defaultMessage: 'Analyze data', -}); - -const ANALYZE_MESSAGE = i18n.translate('xpack.uptime.analyzeDataButtonLabel.message', { - defaultMessage: - 'EXPERIMENTAL - Analyze Data allows you to select and filter result data in any dimension and look for the cause or impact of performance problems.', -}); - -export const ActionMenu = ({ appMountParameters }: { appMountParameters: AppMountParameters }) => { - const kibana = useKibana(); - const { basePath } = useUptimeSettingsContext(); - const { dateRangeStart, dateRangeEnd } = useGetUrlParams(); - - const syntheticExploratoryViewLink = createExploratoryViewUrl( - { - 'synthetics-series': { - dataType: 'synthetics', - time: { from: dateRangeStart, to: dateRangeEnd }, - } as SeriesUrl, - }, - basePath - ); - - return ( - - - - {ANALYZE_MESSAGE}

}> - - {ANALYZE_DATA} - -
-
- - - {ADD_DATA_LABEL} - - -
-
- ); -}; +export const ActionMenu = ({ appMountParameters }: { appMountParameters: AppMountParameters }) => ( + + + +); diff --git a/x-pack/plugins/uptime/public/components/common/header/action_menu_content.test.tsx b/x-pack/plugins/uptime/public/components/common/header/action_menu_content.test.tsx new file mode 100644 index 00000000000000..bc5eab6f92111e --- /dev/null +++ b/x-pack/plugins/uptime/public/components/common/header/action_menu_content.test.tsx @@ -0,0 +1,55 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import React from 'react'; +import { fireEvent, waitFor } from '@testing-library/react'; +import { render } from '../../../lib/helper/rtl_helpers'; +import { ActionMenuContent } from './action_menu_content'; + +describe('ActionMenuContent', () => { + it('renders alerts dropdown', async () => { + const { getByLabelText, getByText } = render(); + + const alertsDropdown = getByLabelText('Open alert context menu'); + fireEvent.click(alertsDropdown); + + await waitFor(() => { + expect(getByText('Create alert')); + expect(getByText('Manage alerts')); + }); + }); + + it('renders settings link', () => { + const { getByRole, getByText } = render(); + + const settingsAnchor = getByRole('link', { name: 'Navigate to the Uptime settings page' }); + expect(settingsAnchor.getAttribute('href')).toBe('/settings'); + expect(getByText('Settings')); + }); + + it('renders exploratory view link', () => { + const { getByLabelText, getByText } = render(); + + const analyzeAnchor = getByLabelText( + 'Navigate to the "Analyze Data" view to visualize Synthetics/User data' + ); + + expect(analyzeAnchor.getAttribute('href')).toContain('/app/observability/exploratory-view'); + expect(getByText('Analyze data')); + }); + + it('renders Add Data link', () => { + const { getByLabelText, getByText } = render(); + + const addDataAnchor = getByLabelText('Navigate to a tutorial about adding Uptime data'); + + // this href value is mocked, so it doesn't correspond to the real link + // that Kibana core services will provide + expect(addDataAnchor.getAttribute('href')).toBe('/app/uptime'); + expect(getByText('Add data')); + }); +}); diff --git a/x-pack/plugins/uptime/public/components/common/header/action_menu_content.tsx b/x-pack/plugins/uptime/public/components/common/header/action_menu_content.tsx new file mode 100644 index 00000000000000..ac7c8ae0a95c65 --- /dev/null +++ b/x-pack/plugins/uptime/public/components/common/header/action_menu_content.tsx @@ -0,0 +1,101 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import React from 'react'; +import { EuiButtonEmpty, EuiHeaderLinks, EuiHeaderSectionItem, EuiToolTip } from '@elastic/eui'; +import { i18n } from '@kbn/i18n'; +import { FormattedMessage } from '@kbn/i18n/react'; +import { useHistory } from 'react-router-dom'; +import { createExploratoryViewUrl, SeriesUrl } from '../../../../../observability/public'; +import { useKibana } from '../../../../../../../src/plugins/kibana_react/public'; +import { useUptimeSettingsContext } from '../../../contexts/uptime_settings_context'; +import { useGetUrlParams } from '../../../hooks'; +import { ToggleAlertFlyoutButton } from '../../overview/alerts/alerts_containers'; +import { SETTINGS_ROUTE } from '../../../../common/constants'; +import { stringifyUrlParams } from '../../../lib/helper/stringify_url_params'; + +const ADD_DATA_LABEL = i18n.translate('xpack.uptime.addDataButtonLabel', { + defaultMessage: 'Add data', +}); + +const ANALYZE_DATA = i18n.translate('xpack.uptime.analyzeDataButtonLabel', { + defaultMessage: 'Analyze data', +}); + +const ANALYZE_MESSAGE = i18n.translate('xpack.uptime.analyzeDataButtonLabel.message', { + defaultMessage: + 'EXPERIMENTAL - Analyze Data allows you to select and filter result data in any dimension and look for the cause or impact of performance problems.', +}); + +export function ActionMenuContent(): React.ReactElement { + const kibana = useKibana(); + const { basePath } = useUptimeSettingsContext(); + const params = useGetUrlParams(); + const { dateRangeStart, dateRangeEnd } = params; + const history = useHistory(); + + const syntheticExploratoryViewLink = createExploratoryViewUrl( + { + 'synthetics-series': { + dataType: 'synthetics', + time: { from: dateRangeStart, to: dateRangeEnd }, + } as SeriesUrl, + }, + basePath + ); + + return ( + + + + + + + + + + + {ANALYZE_MESSAGE}

}> + + {ANALYZE_DATA} + +
+
+ + + {ADD_DATA_LABEL} + + +
+ ); +} diff --git a/x-pack/plugins/uptime/public/components/common/header/page_header.tsx b/x-pack/plugins/uptime/public/components/common/header/page_header.tsx index 753ce267d141ce..28a133698ae8b3 100644 --- a/x-pack/plugins/uptime/public/components/common/header/page_header.tsx +++ b/x-pack/plugins/uptime/public/components/common/header/page_header.tsx @@ -12,7 +12,6 @@ import { UptimeDatePicker } from '../uptime_date_picker'; import { SyntheticsCallout } from '../../overview/synthetics_callout'; import { PageTabs } from './page_tabs'; import { CertRefreshBtn } from '../../certificates/cert_refresh_btn'; -import { ToggleAlertFlyoutButton } from '../../overview/alerts/alerts_containers'; import { MonitorPageTitle } from '../../monitor/monitor_title'; export interface Props { @@ -52,9 +51,6 @@ export const PageHeader = ({ {showMonitorTitle && } {showTabs && } - - - {showCertificateRefreshBtn && } {showDatePicker && ( diff --git a/x-pack/plugins/uptime/public/components/common/header/page_tabs.test.tsx b/x-pack/plugins/uptime/public/components/common/header/page_tabs.test.tsx index edb1b56668b15c..2870006dc20be9 100644 --- a/x-pack/plugins/uptime/public/components/common/header/page_tabs.test.tsx +++ b/x-pack/plugins/uptime/public/components/common/header/page_tabs.test.tsx @@ -15,7 +15,6 @@ describe('PageTabs', () => { const { getByText } = render(); expect(getByText('Overview')).toBeInTheDocument(); expect(getByText('Certificates')).toBeInTheDocument(); - expect(getByText('Settings')).toBeInTheDocument(); }); it('it keep params while switching', () => { @@ -32,10 +31,6 @@ describe('PageTabs', () => { 'href', '/certificates?dateRangeStart=now-10m' ); - expect(getByTestId('settings-page-link')).toHaveAttribute( - 'href', - '/settings?dateRangeStart=now-10m' - ); }); it('it resets params on overview if already on overview', () => { diff --git a/x-pack/plugins/uptime/public/components/common/header/page_tabs.tsx b/x-pack/plugins/uptime/public/components/common/header/page_tabs.tsx index 263351d4ea4d0b..74b037971c1261 100644 --- a/x-pack/plugins/uptime/public/components/common/header/page_tabs.tsx +++ b/x-pack/plugins/uptime/public/components/common/header/page_tabs.tsx @@ -10,7 +10,7 @@ import React, { useEffect, useState } from 'react'; import { EuiTabs, EuiTab } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; import { useHistory, useRouteMatch } from 'react-router-dom'; -import { CERTIFICATES_ROUTE, OVERVIEW_ROUTE, SETTINGS_ROUTE } from '../../../../common/constants'; +import { CERTIFICATES_ROUTE, OVERVIEW_ROUTE } from '../../../../common/constants'; import { useGetUrlParams } from '../../../hooks'; import { stringifyUrlParams } from '../../../lib/helper/stringify_url_params'; @@ -28,13 +28,6 @@ const tabs = [ name: 'Certificates', dataTestSubj: 'uptimeCertificatesLink', }, - { - id: SETTINGS_ROUTE, - dataTestSubj: 'settings-page-link', - name: i18n.translate('xpack.uptime.page_header.settingsLink', { - defaultMessage: 'Settings', - }), - }, ]; export const PageTabs = () => { @@ -45,7 +38,6 @@ export const PageTabs = () => { const params = useGetUrlParams(); const isOverView = useRouteMatch(OVERVIEW_ROUTE); - const isSettings = useRouteMatch(SETTINGS_ROUTE); const isCerts = useRouteMatch(CERTIFICATES_ROUTE); useEffect(() => { @@ -55,13 +47,10 @@ export const PageTabs = () => { if (isCerts) { setSelectedTabId(CERTIFICATES_ROUTE); } - if (isSettings) { - setSelectedTabId(SETTINGS_ROUTE); - } - if (!isOverView?.isExact && !isCerts && !isSettings) { + if (!isOverView?.isExact && !isCerts) { setSelectedTabId(null); } - }, [isCerts, isSettings, isOverView]); + }, [isCerts, isOverView]); const createHrefForTab = (id: string) => { if (selectedTabId === OVERVIEW_ROUTE && id === OVERVIEW_ROUTE) { From dbd0ce761ad8f06cc8494827ef69df0a621cf5a6 Mon Sep 17 00:00:00 2001 From: Spencer Date: Wed, 26 May 2021 12:41:05 -0700 Subject: [PATCH 07/16] [ftr] migrate "toasts" service to FtrService class (#100613) Co-authored-by: spalger --- test/functional/services/index.ts | 4 +- test/functional/services/toasts.ts | 116 ++++++++++++++--------------- 2 files changed, 58 insertions(+), 62 deletions(-) diff --git a/test/functional/services/index.ts b/test/functional/services/index.ts index b2e0a3e0f473e7..93026af6766bd9 100644 --- a/test/functional/services/index.ts +++ b/test/functional/services/index.ts @@ -36,7 +36,7 @@ import { ManagementMenuService } from './management'; import { QueryBarProvider } from './query_bar'; import { RemoteProvider } from './remote'; import { RenderableProvider } from './renderable'; -import { ToastsProvider } from './toasts'; +import { ToastsService } from './toasts'; import { DataGridService } from './data_grid'; import { PieChartService, @@ -79,7 +79,7 @@ export const services = { vegaDebugInspector: VegaDebugInspectorViewService, appsMenu: AppsMenuProvider, globalNav: GlobalNavService, - toasts: ToastsProvider, + toasts: ToastsService, savedQueryManagementComponent: SavedQueryManagementComponentProvider, elasticChart: ElasticChartService, supertest: KibanaSupertestProvider, diff --git a/test/functional/services/toasts.ts b/test/functional/services/toasts.ts index aeaf79e75574a1..d71d66e399785e 100644 --- a/test/functional/services/toasts.ts +++ b/test/functional/services/toasts.ts @@ -6,78 +6,74 @@ * Side Public License, v 1. */ -import { FtrProviderContext } from '../ftr_provider_context'; +import { FtrService } from '../ftr_provider_context'; -export function ToastsProvider({ getService }: FtrProviderContext) { - const testSubjects = getService('testSubjects'); +export class ToastsService extends FtrService { + private readonly testSubjects = this.ctx.getService('testSubjects'); - class Toasts { - /** - * Returns the title and message of a specific error toast. - * This method is specific to toasts created via `.addError` since they contain - * an additional button, that should not be part of the message. - * - * @param index The index of the toast (1-based, NOT 0-based!) of the toast. Use first by default. - * @returns The title and message of the specified error toast.https://github.com/elastic/kibana/issues/17087 - */ - public async getErrorToast(index: number = 1) { - const toast = await this.getToastElement(index); - const titleElement = await testSubjects.findDescendant('euiToastHeader', toast); - const title: string = await titleElement.getVisibleText(); - const messageElement = await testSubjects.findDescendant('errorToastMessage', toast); - const message: string = await messageElement.getVisibleText(); - return { title, message }; - } + /** + * Returns the title and message of a specific error toast. + * This method is specific to toasts created via `.addError` since they contain + * an additional button, that should not be part of the message. + * + * @param index The index of the toast (1-based, NOT 0-based!) of the toast. Use first by default. + * @returns The title and message of the specified error toast.https://github.com/elastic/kibana/issues/17087 + */ + public async getErrorToast(index: number = 1) { + const toast = await this.getToastElement(index); + const titleElement = await this.testSubjects.findDescendant('euiToastHeader', toast); + const title: string = await titleElement.getVisibleText(); + const messageElement = await this.testSubjects.findDescendant('errorToastMessage', toast); + const message: string = await messageElement.getVisibleText(); + return { title, message }; + } - /** - * Dismiss a specific toast from the toast list. Since toasts usually should time out themselves, - * you only need to call this for permanent toasts (e.g. error toasts). - * - * @param index The 1-based index of the toast to dismiss. Use first by default. - */ - public async dismissToast(index: number = 1) { - const toast = await this.getToastElement(index); - await toast.moveMouseTo(); - const dismissButton = await testSubjects.findDescendant('toastCloseButton', toast); - await dismissButton.click(); - } + /** + * Dismiss a specific toast from the toast list. Since toasts usually should time out themselves, + * you only need to call this for permanent toasts (e.g. error toasts). + * + * @param index The 1-based index of the toast to dismiss. Use first by default. + */ + public async dismissToast(index: number = 1) { + const toast = await this.getToastElement(index); + await toast.moveMouseTo(); + const dismissButton = await this.testSubjects.findDescendant('toastCloseButton', toast); + await dismissButton.click(); + } - public async dismissAllToasts() { - const list = await this.getGlobalToastList(); - const toasts = await list.findAllByCssSelector(`.euiToast`); + public async dismissAllToasts() { + const list = await this.getGlobalToastList(); + const toasts = await list.findAllByCssSelector(`.euiToast`); - if (toasts.length === 0) return; + if (toasts.length === 0) return; - for (const toast of toasts) { - await toast.moveMouseTo(); + for (const toast of toasts) { + await toast.moveMouseTo(); - if (await testSubjects.descendantExists('toastCloseButton', toast)) { - try { - const dismissButton = await testSubjects.findDescendant('toastCloseButton', toast); - await dismissButton.click(); - } catch (err) { - // ignore errors - // toasts are finnicky because they can dismiss themselves right before you close them - } + if (await this.testSubjects.descendantExists('toastCloseButton', toast)) { + try { + const dismissButton = await this.testSubjects.findDescendant('toastCloseButton', toast); + await dismissButton.click(); + } catch (err) { + // ignore errors + // toasts are finnicky because they can dismiss themselves right before you close them } } } + } - public async getToastElement(index: number) { - const list = await this.getGlobalToastList(); - return await list.findByCssSelector(`.euiToast:nth-child(${index})`); - } - - private async getGlobalToastList() { - return await testSubjects.find('globalToastList'); - } + public async getToastElement(index: number) { + const list = await this.getGlobalToastList(); + return await list.findByCssSelector(`.euiToast:nth-child(${index})`); + } - public async getToastCount() { - const list = await this.getGlobalToastList(); - const toasts = await list.findAllByCssSelector(`.euiToast`); - return toasts.length; - } + private async getGlobalToastList() { + return await this.testSubjects.find('globalToastList'); } - return new Toasts(); + public async getToastCount() { + const list = await this.getGlobalToastList(); + const toasts = await list.findAllByCssSelector(`.euiToast`); + return toasts.length; + } } From 881d89fba7cc8b7f963fcd5230a60b1f23ac8259 Mon Sep 17 00:00:00 2001 From: Mikhail Shustov Date: Wed, 26 May 2021 22:01:33 +0200 Subject: [PATCH 08/16] remove src/legacy and src/optimizer from configs (#100538) * cleanup removed dirs * delete removed folders from other places in the repo Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> --- .i18nrc.json | 2 -- packages/kbn-test/src/jest/run_check_jest_configs_cli.ts | 2 +- src/dev/precommit_hook/casing_check_config.js | 1 - tsconfig.json | 2 -- x-pack/plugins/canvas/shareable_runtime/webpack.config.js | 1 - x-pack/plugins/canvas/storybook/webpack.dll.config.js | 7 ------- 6 files changed, 1 insertion(+), 14 deletions(-) diff --git a/.i18nrc.json b/.i18nrc.json index 1e07d662c057a6..dc01a10b6a686b 100644 --- a/.i18nrc.json +++ b/.i18nrc.json @@ -1,6 +1,5 @@ { "paths": { - "common.ui": "src/legacy/ui", "console": "src/plugins/console", "core": "src/core", "discover": "src/plugins/discover", @@ -61,6 +60,5 @@ "apmOss": "src/plugins/apm_oss", "usageCollection": "src/plugins/usage_collection" }, - "exclude": ["src/legacy/ui/ui_render/ui_render_mixin.js"], "translations": [] } diff --git a/packages/kbn-test/src/jest/run_check_jest_configs_cli.ts b/packages/kbn-test/src/jest/run_check_jest_configs_cli.ts index 3ce38733dfd249..5895ef193fbfe2 100644 --- a/packages/kbn-test/src/jest/run_check_jest_configs_cli.ts +++ b/packages/kbn-test/src/jest/run_check_jest_configs_cli.ts @@ -26,7 +26,7 @@ const template: string = `module.exports = { }; `; -const roots: string[] = ['x-pack/plugins', 'packages', 'src/legacy', 'src/plugins', 'test', 'src']; +const roots: string[] = ['x-pack/plugins', 'packages', 'src/plugins', 'test', 'src']; export async function runCheckJestConfigsCli() { run( diff --git a/src/dev/precommit_hook/casing_check_config.js b/src/dev/precommit_hook/casing_check_config.js index 3aed49b5015bb6..0d5ecab40fbc4e 100644 --- a/src/dev/precommit_hook/casing_check_config.js +++ b/src/dev/precommit_hook/casing_check_config.js @@ -94,7 +94,6 @@ export const IGNORE_DIRECTORY_GLOBS = [ ...KEBAB_CASE_DIRECTORY_GLOBS, 'src/babel-*', 'packages/*', - 'src/legacy/ui/public/flot-charts', 'test/functional/fixtures/es_archiver/visualize_source-filters', 'packages/kbn-pm/src/utils/__fixtures__/*', 'x-pack/dev-tools', diff --git a/tsconfig.json b/tsconfig.json index c56d4c6b8dc329..ceb03107076c2f 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -10,8 +10,6 @@ "src/cli/**/*", "src/dev/**/*", "src/fixtures/**/*", - "src/legacy/**/*", - "src/optimize/**/*", "x-pack/tasks/**/*", ], diff --git a/x-pack/plugins/canvas/shareable_runtime/webpack.config.js b/x-pack/plugins/canvas/shareable_runtime/webpack.config.js index 34fade58ffc8dd..e85840e8734308 100644 --- a/x-pack/plugins/canvas/shareable_runtime/webpack.config.js +++ b/x-pack/plugins/canvas/shareable_runtime/webpack.config.js @@ -33,7 +33,6 @@ module.exports = { // Include a require alias for legacy UI code and styles resolve: { alias: { - ui: path.resolve(KIBANA_ROOT, 'src/legacy/ui/public'), 'data/interpreter': path.resolve( KIBANA_ROOT, 'src/plugins/data/public/expressions/interpreter' diff --git a/x-pack/plugins/canvas/storybook/webpack.dll.config.js b/x-pack/plugins/canvas/storybook/webpack.dll.config.js index 3051bbebdaf0c8..c13fabe9989219 100644 --- a/x-pack/plugins/canvas/storybook/webpack.dll.config.js +++ b/x-pack/plugins/canvas/storybook/webpack.dll.config.js @@ -77,13 +77,6 @@ module.exports = { filename: 'dll.js', library: DLL_NAME, }, - // Include a require alias for legacy UI code and styles - resolve: { - alias: { - ui: path.resolve(KIBANA_ROOT, 'src/legacy/ui/public'), - }, - symlinks: false, - }, module: { rules: [ { From af59f68e8ba60d0919742f9a5fb0fb052295dcc7 Mon Sep 17 00:00:00 2001 From: Spencer Date: Wed, 26 May 2021 13:55:04 -0700 Subject: [PATCH 09/16] [ftr] migrate "flyout" and "inspector" services to FtrService class (#100602) Co-authored-by: spalger --- test/functional/services/flyout.ts | 74 +++-- test/functional/services/index.ts | 8 +- test/functional/services/inspector.ts | 414 +++++++++++++------------- 3 files changed, 244 insertions(+), 252 deletions(-) diff --git a/test/functional/services/flyout.ts b/test/functional/services/flyout.ts index 2e10bf757ac7a6..e7b57dc0fb66bf 100644 --- a/test/functional/services/flyout.ts +++ b/test/functional/services/flyout.ts @@ -6,50 +6,46 @@ * Side Public License, v 1. */ -import { FtrProviderContext } from '../ftr_provider_context'; - -export function FlyoutProvider({ getService }: FtrProviderContext) { - const testSubjects = getService('testSubjects'); - const find = getService('find'); - const log = getService('log'); - const retry = getService('retry'); - - class Flyout { - public async close(dataTestSubj: string): Promise { - log.debug('Closing flyout', dataTestSubj); - const flyoutElement = await testSubjects.find(dataTestSubj); - const closeBtn = await flyoutElement.findByCssSelector('[aria-label*="Close"]'); - await closeBtn.click(); - await retry.waitFor( - 'flyout closed', - async () => !(await testSubjects.exists(dataTestSubj, { timeout: 1000 })) - ); - } +import { FtrService } from '../ftr_provider_context'; + +export class FlyoutService extends FtrService { + private readonly testSubjects = this.ctx.getService('testSubjects'); + private readonly find = this.ctx.getService('find'); + private readonly log = this.ctx.getService('log'); + private readonly retry = this.ctx.getService('retry'); + + public async close(dataTestSubj: string): Promise { + this.log.debug('Closing flyout', dataTestSubj); + const flyoutElement = await this.testSubjects.find(dataTestSubj); + const closeBtn = await flyoutElement.findByCssSelector('[aria-label*="Close"]'); + await closeBtn.click(); + await this.retry.waitFor( + 'flyout closed', + async () => !(await this.testSubjects.exists(dataTestSubj, { timeout: 1000 })) + ); + } - public async ensureClosed(dataTestSubj: string): Promise { - if (await testSubjects.exists(dataTestSubj, { timeout: 1000 })) { - await this.close(dataTestSubj); - } + public async ensureClosed(dataTestSubj: string): Promise { + if (await this.testSubjects.exists(dataTestSubj, { timeout: 1000 })) { + await this.close(dataTestSubj); } + } - public async ensureAllClosed(): Promise { - const flyoutElements = await find.allByCssSelector('.euiFlyout'); - - if (!flyoutElements.length) { - return; - } + public async ensureAllClosed(): Promise { + const flyoutElements = await this.find.allByCssSelector('.euiFlyout'); - for (let i = 0; i < flyoutElements.length; i++) { - const closeBtn = await flyoutElements[i].findByCssSelector('[aria-label*="Close"]'); - await closeBtn.click(); - } + if (!flyoutElements.length) { + return; + } - await retry.waitFor( - 'all flyouts to be closed', - async () => (await find.allByCssSelector('.euiFlyout')).length === 0 - ); + for (let i = 0; i < flyoutElements.length; i++) { + const closeBtn = await flyoutElements[i].findByCssSelector('[aria-label*="Close"]'); + await closeBtn.click(); } - } - return new Flyout(); + await this.retry.waitFor( + 'all flyouts to be closed', + async () => (await this.find.allByCssSelector('.euiFlyout')).length === 0 + ); + } } diff --git a/test/functional/services/index.ts b/test/functional/services/index.ts index 93026af6766bd9..8dcefcba55d6dd 100644 --- a/test/functional/services/index.ts +++ b/test/functional/services/index.ts @@ -28,9 +28,9 @@ import { import { DocTableService } from './doc_table'; import { EmbeddingProvider } from './embedding'; import { FilterBarService } from './filter_bar'; -import { FlyoutProvider } from './flyout'; +import { FlyoutService } from './flyout'; import { GlobalNavService } from './global_nav'; -import { InspectorProvider } from './inspector'; +import { InspectorService } from './inspector'; import { FieldEditorService } from './field_editor'; import { ManagementMenuService } from './management'; import { QueryBarProvider } from './query_bar'; @@ -67,14 +67,14 @@ export const services = { dashboardAddPanel: DashboardAddPanelService, dashboardReplacePanel: DashboardReplacePanelService, dashboardPanelActions: DashboardPanelActionsService, - flyout: FlyoutProvider, + flyout: FlyoutService, comboBox: ComboBoxProvider, dataGrid: DataGridService, embedding: EmbeddingProvider, renderable: RenderableProvider, browser: BrowserProvider, pieChart: PieChartService, - inspector: InspectorProvider, + inspector: InspectorService, fieldEditor: FieldEditorService, vegaDebugInspector: VegaDebugInspectorViewService, appsMenu: AppsMenuProvider, diff --git a/test/functional/services/inspector.ts b/test/functional/services/inspector.ts index c9cf159d0d38e1..dc46db458501bf 100644 --- a/test/functional/services/inspector.ts +++ b/test/functional/services/inspector.ts @@ -7,234 +7,230 @@ */ import expect from '@kbn/expect'; -import { FtrProviderContext } from '../ftr_provider_context'; - -export function InspectorProvider({ getService }: FtrProviderContext) { - const log = getService('log'); - const retry = getService('retry'); - const renderable = getService('renderable'); - const flyout = getService('flyout'); - const testSubjects = getService('testSubjects'); - const find = getService('find'); - - class Inspector { - private async getIsEnabled(): Promise { - const ariaDisabled = await testSubjects.getAttribute('openInspectorButton', 'disabled'); - return ariaDisabled !== 'true'; - } - - /** - * Asserts that inspector is enabled - */ - public async expectIsEnabled(): Promise { - await retry.try(async () => { - const isEnabled = await this.getIsEnabled(); - expect(isEnabled).to.be(true); - }); - } +import { FtrService } from '../ftr_provider_context'; + +export class InspectorService extends FtrService { + private readonly log = this.ctx.getService('log'); + private readonly retry = this.ctx.getService('retry'); + private readonly renderable = this.ctx.getService('renderable'); + private readonly flyout = this.ctx.getService('flyout'); + private readonly testSubjects = this.ctx.getService('testSubjects'); + private readonly find = this.ctx.getService('find'); + + private async getIsEnabled(): Promise { + const ariaDisabled = await this.testSubjects.getAttribute('openInspectorButton', 'disabled'); + return ariaDisabled !== 'true'; + } - /** - * Asserts that inspector is disabled - */ - public async expectIsNotEnabled(): Promise { - await retry.try(async () => { - const isEnabled = await this.getIsEnabled(); - expect(isEnabled).to.be(false); - }); - } + /** + * Asserts that inspector is enabled + */ + public async expectIsEnabled(): Promise { + await this.retry.try(async () => { + const isEnabled = await this.getIsEnabled(); + expect(isEnabled).to.be(true); + }); + } - /** - * Opens inspector panel - */ - public async open(): Promise { - log.debug('Inspector.open'); - const isOpen = await testSubjects.exists('inspectorPanel'); - if (!isOpen) { - await retry.try(async () => { - await testSubjects.click('openInspectorButton'); - await testSubjects.exists('inspectorPanel'); - }); - } - } + /** + * Asserts that inspector is disabled + */ + public async expectIsNotEnabled(): Promise { + await this.retry.try(async () => { + const isEnabled = await this.getIsEnabled(); + expect(isEnabled).to.be(false); + }); + } - /** - * Closes inspector panel - */ - public async close(): Promise { - log.debug('Close Inspector'); - let isOpen = await testSubjects.exists('inspectorPanel'); - if (isOpen) { - await retry.try(async () => { - await flyout.close('inspectorPanel'); - isOpen = await testSubjects.exists('inspectorPanel'); - if (isOpen) { - throw new Error('Failed to close inspector'); - } - }); - } + /** + * Opens inspector panel + */ + public async open(): Promise { + this.log.debug('Inspector.open'); + const isOpen = await this.testSubjects.exists('inspectorPanel'); + if (!isOpen) { + await this.retry.try(async () => { + await this.testSubjects.click('openInspectorButton'); + await this.testSubjects.exists('inspectorPanel'); + }); } + } - /** - * Asserts data on inspector panel - * @param expectedData - */ - public async expectTableData(expectedData: string[][]): Promise { - log.debug(`Inspector.expectTableData(${expectedData.join(',')})`); - const data = await this.getTableData(); - expect(data).to.eql(expectedData); + /** + * Closes inspector panel + */ + public async close(): Promise { + this.log.debug('Close Inspector'); + let isOpen = await this.testSubjects.exists('inspectorPanel'); + if (isOpen) { + await this.retry.try(async () => { + await this.flyout.close('inspectorPanel'); + isOpen = await this.testSubjects.exists('inspectorPanel'); + if (isOpen) { + throw new Error('Failed to close inspector'); + } + }); } + } - /** - * Sets table page size - * @param size rows count - */ - public async setTablePageSize(size: number): Promise { - const panel = await testSubjects.find('inspectorPanel'); - await find.clickByButtonText('Rows per page: 20', panel); - // The buttons for setting table page size are in a popover element. This popover - // element appears as if it's part of the inspectorPanel but it's really attached - // to the body element by a portal. - const tableSizesPopover = await find.byCssSelector('.euiPanel .euiContextMenuPanel'); - await find.clickByButtonText(`${size} rows`, tableSizesPopover); - } + /** + * Asserts data on inspector panel + * @param expectedData + */ + public async expectTableData(expectedData: string[][]): Promise { + this.log.debug(`Inspector.expectTableData(${expectedData.join(',')})`); + const data = await this.getTableData(); + expect(data).to.eql(expectedData); + } - /** - * Returns table data in nested array format - */ - public async getTableData(): Promise { - // TODO: we should use datat-test-subj=inspectorTable as soon as EUI supports it - const inspectorPanel = await testSubjects.find('inspectorPanel'); - const tableBody = await retry.try(async () => inspectorPanel.findByTagName('tbody')); - const $ = await tableBody.parseDomContent(); - return $('tr') - .toArray() - .map((tr) => { - return $(tr) - .find('td') - .toArray() - .map((cell) => { - // if this is an EUI table, filter down to the specific cell content - // otherwise this will include mobile-specific header information - const euiTableCellContent = $(cell).find('.euiTableCellContent'); - - if (euiTableCellContent.length > 0) { - return $(cell).find('.euiTableCellContent').text().trim(); - } else { - return $(cell).text().trim(); - } - }); - }); - } + /** + * Sets table page size + * @param size rows count + */ + public async setTablePageSize(size: number): Promise { + const panel = await this.testSubjects.find('inspectorPanel'); + await this.find.clickByButtonText('Rows per page: 20', panel); + // The buttons for setting table page size are in a popover element. This popover + // element appears as if it's part of the inspectorPanel but it's really attached + // to the body element by a portal. + const tableSizesPopover = await this.find.byCssSelector('.euiPanel .euiContextMenuPanel'); + await this.find.clickByButtonText(`${size} rows`, tableSizesPopover); + } - /** - * Returns table headers - */ - public async getTableHeaders(): Promise { - log.debug('Inspector.getTableHeaders'); - // TODO: we should use datat-test-subj=inspectorTable as soon as EUI supports it - const dataTableHeader = await retry.try(async () => { - const inspectorPanel = await testSubjects.find('inspectorPanel'); - return await inspectorPanel.findByTagName('thead'); + /** + * Returns table data in nested array format + */ + public async getTableData(): Promise { + // TODO: we should use datat-test-subj=inspectorTable as soon as EUI supports it + const inspectorPanel = await this.testSubjects.find('inspectorPanel'); + const tableBody = await this.retry.try(async () => inspectorPanel.findByTagName('tbody')); + const $ = await tableBody.parseDomContent(); + return $('tr') + .toArray() + .map((tr) => { + return $(tr) + .find('td') + .toArray() + .map((cell) => { + // if this is an EUI table, filter down to the specific cell content + // otherwise this will include mobile-specific header information + const euiTableCellContent = $(cell).find('.euiTableCellContent'); + + if (euiTableCellContent.length > 0) { + return $(cell).find('.euiTableCellContent').text().trim(); + } else { + return $(cell).text().trim(); + } + }); }); - const $ = await dataTableHeader.parseDomContent(); - return $('th span.euiTableCellContent__text') - .toArray() - .map((cell) => $(cell).text().trim()); - } + } - /** - * Asserts table headers - * @param expected expected headers - */ - public async expectTableHeaders(expected: string[]): Promise { - await retry.try(async () => { - const headers = await this.getTableHeaders(); - expect(headers).to.eql(expected); - }); - } + /** + * Returns table headers + */ + public async getTableHeaders(): Promise { + this.log.debug('Inspector.getTableHeaders'); + // TODO: we should use datat-test-subj=inspectorTable as soon as EUI supports it + const dataTableHeader = await this.retry.try(async () => { + const inspectorPanel = await this.testSubjects.find('inspectorPanel'); + return await inspectorPanel.findByTagName('thead'); + }); + const $ = await dataTableHeader.parseDomContent(); + return $('th span.euiTableCellContent__text') + .toArray() + .map((cell) => $(cell).text().trim()); + } - /** - * Filters table for value by clicking specified cell - * @param column column index - * @param row row index - */ - public async filterForTableCell(column: string | number, row: string | number): Promise { - await retry.try(async () => { - const table = await testSubjects.find('inspectorTable'); - const cell = await table.findByCssSelector( - `tbody tr:nth-child(${row}) td:nth-child(${column})` - ); - await cell.moveMouseTo(); - const filterBtn = await testSubjects.findDescendant('filterForInspectorCellValue', cell); - await filterBtn.click(); - }); - await renderable.waitForRender(); - } + /** + * Asserts table headers + * @param expected expected headers + */ + public async expectTableHeaders(expected: string[]): Promise { + await this.retry.try(async () => { + const headers = await this.getTableHeaders(); + expect(headers).to.eql(expected); + }); + } - /** - * Filters out table by clicking specified cell - * @param column column index - * @param row row index - */ - public async filterOutTableCell(column: string | number, row: string | number): Promise { - await retry.try(async () => { - const table = await testSubjects.find('inspectorTable'); - const cell = await table.findByCssSelector( - `tbody tr:nth-child(${row}) td:nth-child(${column})` - ); - await cell.moveMouseTo(); - const filterBtn = await testSubjects.findDescendant('filterOutInspectorCellValue', cell); - await filterBtn.click(); - }); - await renderable.waitForRender(); - } + /** + * Filters table for value by clicking specified cell + * @param column column index + * @param row row index + */ + public async filterForTableCell(column: string | number, row: string | number): Promise { + await this.retry.try(async () => { + const table = await this.testSubjects.find('inspectorTable'); + const cell = await table.findByCssSelector( + `tbody tr:nth-child(${row}) td:nth-child(${column})` + ); + await cell.moveMouseTo(); + const filterBtn = await this.testSubjects.findDescendant('filterForInspectorCellValue', cell); + await filterBtn.click(); + }); + await this.renderable.waitForRender(); + } - /** - * Opens inspector view - * @param viewId - */ - public async openInspectorView(viewId: string): Promise { - log.debug(`Open Inspector view ${viewId}`); - await testSubjects.click('inspectorViewChooser'); - await testSubjects.click(viewId); - } + /** + * Filters out table by clicking specified cell + * @param column column index + * @param row row index + */ + public async filterOutTableCell(column: string | number, row: string | number): Promise { + await this.retry.try(async () => { + const table = await this.testSubjects.find('inspectorTable'); + const cell = await table.findByCssSelector( + `tbody tr:nth-child(${row}) td:nth-child(${column})` + ); + await cell.moveMouseTo(); + const filterBtn = await this.testSubjects.findDescendant('filterOutInspectorCellValue', cell); + await filterBtn.click(); + }); + await this.renderable.waitForRender(); + } - /** - * Opens inspector requests view - */ - public async openInspectorRequestsView(): Promise { - await this.openInspectorView('inspectorViewChooserRequests'); - } + /** + * Opens inspector view + * @param viewId + */ + public async openInspectorView(viewId: string): Promise { + this.log.debug(`Open Inspector view ${viewId}`); + await this.testSubjects.click('inspectorViewChooser'); + await this.testSubjects.click(viewId); + } - /** - * Returns request name as the comma-separated string - */ - public async getRequestNames(): Promise { - await this.openInspectorRequestsView(); - const requestChooserExists = await testSubjects.exists('inspectorRequestChooser'); - if (requestChooserExists) { - await testSubjects.click('inspectorRequestChooser'); - const menu = await testSubjects.find('inspectorRequestChooserMenuPanel'); - const requestNames = await menu.getVisibleText(); - return requestNames.trim().split('\n').join(','); - } - - const singleRequest = await testSubjects.find('inspectorRequestName'); - return await singleRequest.getVisibleText(); - } + /** + * Opens inspector requests view + */ + public async openInspectorRequestsView(): Promise { + await this.openInspectorView('inspectorViewChooserRequests'); + } - public getOpenRequestStatisticButton() { - return testSubjects.find('inspectorRequestDetailStatistics'); - } + /** + * Returns request name as the comma-separated string + */ + public async getRequestNames(): Promise { + await this.openInspectorRequestsView(); + const requestChooserExists = await this.testSubjects.exists('inspectorRequestChooser'); + if (requestChooserExists) { + await this.testSubjects.click('inspectorRequestChooser'); + const menu = await this.testSubjects.find('inspectorRequestChooserMenuPanel'); + const requestNames = await menu.getVisibleText(); + return requestNames.trim().split('\n').join(','); + } + + const singleRequest = await this.testSubjects.find('inspectorRequestName'); + return await singleRequest.getVisibleText(); + } - public getOpenRequestDetailRequestButton() { - return testSubjects.find('inspectorRequestDetailRequest'); - } + public getOpenRequestStatisticButton() { + return this.testSubjects.find('inspectorRequestDetailStatistics'); + } - public getOpenRequestDetailResponseButton() { - return testSubjects.find('inspectorRequestDetailResponse'); - } + public getOpenRequestDetailRequestButton() { + return this.testSubjects.find('inspectorRequestDetailRequest'); } - return new Inspector(); + public getOpenRequestDetailResponseButton() { + return this.testSubjects.find('inspectorRequestDetailResponse'); + } } From b6d595268eab40d0184eb0ec0193974f2b8d46c1 Mon Sep 17 00:00:00 2001 From: Joe Portner <5295965+jportner@users.noreply.github.com> Date: Wed, 26 May 2021 17:10:55 -0400 Subject: [PATCH 10/16] Bump dependencies (#100724) --- packages/kbn-pm/dist/index.js | 52 ++++++++++++----------------------- yarn.lock | 6 ++-- 2 files changed, 20 insertions(+), 38 deletions(-) diff --git a/packages/kbn-pm/dist/index.js b/packages/kbn-pm/dist/index.js index c0afb92b859cd2..29c0457c316f06 100644 --- a/packages/kbn-pm/dist/index.js +++ b/packages/kbn-pm/dist/index.js @@ -30541,29 +30541,14 @@ module.exports = function nodeModulesPaths(start, opts, request) { var isWindows = process.platform === 'win32'; -// Regex to split a windows path into three parts: [*, device, slash, -// tail] windows-only -var splitDeviceRe = - /^([a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?([\\\/])?([\s\S]*?)$/; - -// Regex to split the tail part of the above into [*, dir, basename, ext] -var splitTailRe = - /^([\s\S]*?)((?:\.{1,2}|[^\\\/]+?|)(\.[^.\/\\]*|))(?:[\\\/]*)$/; +// Regex to split a windows path into into [dir, root, basename, name, ext] +var splitWindowsRe = + /^(((?:[a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?[\\\/]?)(?:[^\\\/]*[\\\/])*)((\.{1,2}|[^\\\/]+?|)(\.[^.\/\\]*|))[\\\/]*$/; var win32 = {}; -// Function to split a filename into [root, dir, basename, ext] function win32SplitPath(filename) { - // Separate device+slash from tail - var result = splitDeviceRe.exec(filename), - device = (result[1] || '') + (result[2] || ''), - tail = result[3] || ''; - // Split the tail into dir, basename and extension - var result2 = splitTailRe.exec(tail), - dir = result2[1], - basename = result2[2], - ext = result2[3]; - return [device, dir, basename, ext]; + return splitWindowsRe.exec(filename).slice(1); } win32.parse = function(pathString) { @@ -30573,24 +30558,24 @@ win32.parse = function(pathString) { ); } var allParts = win32SplitPath(pathString); - if (!allParts || allParts.length !== 4) { + if (!allParts || allParts.length !== 5) { throw new TypeError("Invalid path '" + pathString + "'"); } return { - root: allParts[0], - dir: allParts[0] + allParts[1].slice(0, -1), + root: allParts[1], + dir: allParts[0] === allParts[1] ? allParts[0] : allParts[0].slice(0, -1), base: allParts[2], - ext: allParts[3], - name: allParts[2].slice(0, allParts[2].length - allParts[3].length) + ext: allParts[4], + name: allParts[3] }; }; -// Split a filename into [root, dir, basename, ext], unix version +// Split a filename into [dir, root, basename, name, ext], unix version // 'root' is just a slash, or nothing. var splitPathRe = - /^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/; + /^((\/?)(?:[^\/]*\/)*)((\.{1,2}|[^\/]+?|)(\.[^.\/]*|))[\/]*$/; var posix = {}; @@ -30606,19 +30591,16 @@ posix.parse = function(pathString) { ); } var allParts = posixSplitPath(pathString); - if (!allParts || allParts.length !== 4) { + if (!allParts || allParts.length !== 5) { throw new TypeError("Invalid path '" + pathString + "'"); } - allParts[1] = allParts[1] || ''; - allParts[2] = allParts[2] || ''; - allParts[3] = allParts[3] || ''; - + return { - root: allParts[0], - dir: allParts[0] + allParts[1].slice(0, -1), + root: allParts[1], + dir: allParts[0].slice(0, -1), base: allParts[2], - ext: allParts[3], - name: allParts[2].slice(0, allParts[2].length - allParts[3].length) + ext: allParts[4], + name: allParts[3], }; }; diff --git a/yarn.lock b/yarn.lock index 1f09ede5e7900b..9f7db552a3f53c 100644 --- a/yarn.lock +++ b/yarn.lock @@ -21264,9 +21264,9 @@ path-key@^3.0.0, path-key@^3.1.0: integrity sha512-8cChqz0RP6SHJkMt48FW0A7+qUOn+OsnOsVtzI59tZ8m+5bCSk7hzwET0pulwOM2YMn9J1efb07KB9l9f30SGg== path-parse@^1.0.5, path-parse@^1.0.6: - version "1.0.6" - resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.6.tgz#d62dbb5679405d72c4737ec58600e9ddcf06d24c" - integrity sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw== + version "1.0.7" + resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.7.tgz#fbc114b60ca42b30d9daf5858e4bd68bbedb6735" + integrity sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw== path-platform@~0.11.15: version "0.11.15" From f3c846cc4fc7de58fc710a592f85923b6890b582 Mon Sep 17 00:00:00 2001 From: Spencer Date: Wed, 26 May 2021 14:39:10 -0700 Subject: [PATCH 11/16] [ftr] migrate AppsMenuService to FtrService class (#100588) Co-authored-by: spalger Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> --- test/functional/services/apps_menu.ts | 219 +++++++++++++------------- test/functional/services/index.ts | 4 +- 2 files changed, 111 insertions(+), 112 deletions(-) diff --git a/test/functional/services/apps_menu.ts b/test/functional/services/apps_menu.ts index f9c80a6450c2fc..9fb8e36476f3ee 100644 --- a/test/functional/services/apps_menu.ts +++ b/test/functional/services/apps_menu.ts @@ -6,133 +6,132 @@ * Side Public License, v 1. */ -import { FtrProviderContext } from '../ftr_provider_context'; +import { FtrService } from '../ftr_provider_context'; -export function AppsMenuProvider({ getService, getPageObjects }: FtrProviderContext) { - const testSubjects = getService('testSubjects'); - const log = getService('log'); - const config = getService('config'); - const defaultFindTimeout = config.get('timeouts.find'); - const find = getService('find'); +export class AppsMenuService extends FtrService { + private readonly testSubjects = this.ctx.getService('testSubjects'); + private readonly log = this.ctx.getService('log'); + private readonly config = this.ctx.getService('config'); + private readonly find = this.ctx.getService('find'); - return new (class AppsMenu { - private async waitUntilLoadingHasFinished() { - try { - await this.isGlobalLoadingIndicatorVisible(); - } catch (exception) { - if (exception.name === 'ElementNotVisible') { - // selenium might just have been too slow to catch it - } else { - throw exception; - } + private readonly defaultFindTimeout = this.config.get('timeouts.find'); + + private async waitUntilLoadingHasFinished() { + try { + await this.isGlobalLoadingIndicatorVisible(); + } catch (exception) { + if (exception.name === 'ElementNotVisible') { + // selenium might just have been too slow to catch it + } else { + throw exception; } - await this.awaitGlobalLoadingIndicatorHidden(); } + await this.awaitGlobalLoadingIndicatorHidden(); + } - private async isGlobalLoadingIndicatorVisible() { - log.debug('isGlobalLoadingIndicatorVisible'); - return await testSubjects.exists('globalLoadingIndicator', { timeout: 1500 }); - } + private async isGlobalLoadingIndicatorVisible() { + this.log.debug('isGlobalLoadingIndicatorVisible'); + return await this.testSubjects.exists('globalLoadingIndicator', { timeout: 1500 }); + } - private async awaitGlobalLoadingIndicatorHidden() { - await testSubjects.existOrFail('globalLoadingIndicator-hidden', { - allowHidden: true, - timeout: defaultFindTimeout * 10, - }); - } - /** - * Close the collapsible nav - * TODO #64541 can replace with a data-test-subj - */ - public async closeCollapsibleNav() { - const CLOSE_BUTTON = '[data-test-subj=collapsibleNav] > button'; - if (await find.existsByCssSelector(CLOSE_BUTTON)) { - // Close button is only visible when focused - const button = await find.byCssSelector(CLOSE_BUTTON); - await button.focus(); + private async awaitGlobalLoadingIndicatorHidden() { + await this.testSubjects.existOrFail('globalLoadingIndicator-hidden', { + allowHidden: true, + timeout: this.defaultFindTimeout * 10, + }); + } + /** + * Close the collapsible nav + * TODO #64541 can replace with a data-test-subj + */ + public async closeCollapsibleNav() { + const CLOSE_BUTTON = '[data-test-subj=collapsibleNav] > button'; + if (await this.find.existsByCssSelector(CLOSE_BUTTON)) { + // Close button is only visible when focused + const button = await this.find.byCssSelector(CLOSE_BUTTON); + await button.focus(); - await find.clickByCssSelector(CLOSE_BUTTON); - } + await this.find.clickByCssSelector(CLOSE_BUTTON); } + } - public async openCollapsibleNav() { - if (!(await testSubjects.exists('collapsibleNav'))) { - await testSubjects.click('toggleNavButton'); - } + public async openCollapsibleNav() { + if (!(await this.testSubjects.exists('collapsibleNav'))) { + await this.testSubjects.click('toggleNavButton'); } + } - /** - * Get the attributes from each of the links in the apps menu - */ - public async readLinks() { - // wait for the chrome to finish initializing - await this.waitUntilLoadingHasFinished(); - await this.openCollapsibleNav(); - const appMenu = await testSubjects.find('collapsibleNav'); - const $ = await appMenu.parseDomContent(); - const links = $.findTestSubjects('collapsibleNavAppLink') - .toArray() - .map((link) => { - return { - text: $(link).text(), - href: $(link).attr('href'), - disabled: $(link).attr('disabled') != null, - }; - }); + /** + * Get the attributes from each of the links in the apps menu + */ + public async readLinks() { + // wait for the chrome to finish initializing + await this.waitUntilLoadingHasFinished(); + await this.openCollapsibleNav(); + const appMenu = await this.testSubjects.find('collapsibleNav'); + const $ = await appMenu.parseDomContent(); + const links = $.findTestSubjects('collapsibleNavAppLink') + .toArray() + .map((link) => { + return { + text: $(link).text(), + href: $(link).attr('href'), + disabled: $(link).attr('disabled') != null, + }; + }); - await this.closeCollapsibleNav(); + await this.closeCollapsibleNav(); - return links; - } + return links; + } - /** - * Get the attributes from the link with the given name. - * @param name - */ - public async getLink(name: string) { - return (await this.readLinks()).find((nl) => nl.text === name); - } + /** + * Get the attributes from the link with the given name. + * @param name + */ + public async getLink(name: string) { + return (await this.readLinks()).find((nl) => nl.text === name); + } - /** - * Determine if an app link with the given name exists - * @param name - */ - public async linkExists(name: string) { - return (await this.readLinks()).some((nl) => nl.text === name); - } + /** + * Determine if an app link with the given name exists + * @param name + */ + public async linkExists(name: string) { + return (await this.readLinks()).some((nl) => nl.text === name); + } - /** - * Click the app link within the app menu that has the given name - * @param name - * @param options.closeCollapsibleNav - * @param options.category - optional field to ensure that a link is clicked in a particular category - * helpful when there may be a recent link with the same name as an app - */ - public async clickLink( - name: string, - { - closeCollapsibleNav = true, - category, - }: { closeCollapsibleNav?: boolean; category?: string } = {} - ) { - try { - log.debug(`click "${name}" app link`); - await this.openCollapsibleNav(); - let nav; - if (typeof category === 'string') { - nav = await testSubjects.find(`collapsibleNavGroup-${category}`); - } else { - nav = await testSubjects.find('collapsibleNav'); - } - const link = await nav.findByPartialLinkText(name); - await link.click(); + /** + * Click the app link within the app menu that has the given name + * @param name + * @param options.closeCollapsibleNav + * @param options.category - optional field to ensure that a link is clicked in a particular category + * helpful when there may be a recent link with the same name as an app + */ + public async clickLink( + name: string, + { + closeCollapsibleNav = true, + category, + }: { closeCollapsibleNav?: boolean; category?: string } = {} + ) { + try { + this.log.debug(`click "${name}" app link`); + await this.openCollapsibleNav(); + let nav; + if (typeof category === 'string') { + nav = await this.testSubjects.find(`collapsibleNavGroup-${category}`); + } else { + nav = await this.testSubjects.find('collapsibleNav'); + } + const link = await nav.findByPartialLinkText(name); + await link.click(); - if (closeCollapsibleNav) { - await this.closeCollapsibleNav(); - } - } finally { - // Intentionally empty + if (closeCollapsibleNav) { + await this.closeCollapsibleNav(); } + } finally { + // Intentionally empty } - })(); + } } diff --git a/test/functional/services/index.ts b/test/functional/services/index.ts index 8dcefcba55d6dd..294b68c5488658 100644 --- a/test/functional/services/index.ts +++ b/test/functional/services/index.ts @@ -8,7 +8,7 @@ import { services as commonServiceProviders } from '../../common/services'; -import { AppsMenuProvider } from './apps_menu'; +import { AppsMenuService } from './apps_menu'; import { BrowserProvider, FailureDebuggingProvider, @@ -77,7 +77,7 @@ export const services = { inspector: InspectorService, fieldEditor: FieldEditorService, vegaDebugInspector: VegaDebugInspectorViewService, - appsMenu: AppsMenuProvider, + appsMenu: AppsMenuService, globalNav: GlobalNavService, toasts: ToastsService, savedQueryManagementComponent: SavedQueryManagementComponentProvider, From 417c06b9a1e71a1a07feb158fb5082bd66b60f48 Mon Sep 17 00:00:00 2001 From: Tim Sullivan Date: Wed, 26 May 2021 17:31:55 -0700 Subject: [PATCH 12/16] [Reporting] Use the deprecations service to advise critical config changes (#100427) Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> --- .../reporting/server/config/index.test.ts | 2 +- .../plugins/reporting/server/config/index.ts | 4 +- x-pack/plugins/reporting/server/core.ts | 14 +-- .../reporting/server/deprecations.test.ts | 107 ++++++++++++++++++ .../plugins/reporting/server/deprecations.ts | 52 +++++++++ x-pack/plugins/reporting/server/plugin.ts | 11 +- 6 files changed, 174 insertions(+), 16 deletions(-) create mode 100644 x-pack/plugins/reporting/server/deprecations.test.ts create mode 100644 x-pack/plugins/reporting/server/deprecations.ts diff --git a/x-pack/plugins/reporting/server/config/index.test.ts b/x-pack/plugins/reporting/server/config/index.test.ts index 8f13fe8b538108..327b03d679caed 100644 --- a/x-pack/plugins/reporting/server/config/index.test.ts +++ b/x-pack/plugins/reporting/server/config/index.test.ts @@ -45,7 +45,7 @@ describe('deprecations', () => { const { messages } = applyReportingDeprecations({ roles: { enabled: true } }); expect(messages).toMatchInlineSnapshot(` Array [ - "\\"xpack.reporting.roles\\" is deprecated. Granting reporting privilege through a \\"reporting_user\\" role will not be supported starting in 8.0. Please set 'xpack.reporting.roles.enabled' to 'false' and grant reporting privilege to users through feature controls in Management > Security > Roles", + "\\"xpack.reporting.roles\\" is deprecated. Granting reporting privilege through a \\"reporting_user\\" role will not be supported starting in 8.0. Please set 'xpack.reporting.roles.enabled' to 'false' and grant reporting privileges to users using Kibana application privileges **Management > Security > Roles**.", ] `); }); diff --git a/x-pack/plugins/reporting/server/config/index.ts b/x-pack/plugins/reporting/server/config/index.ts index 10d7ba5059f837..8927bd8ee94d50 100644 --- a/x-pack/plugins/reporting/server/config/index.ts +++ b/x-pack/plugins/reporting/server/config/index.ts @@ -35,8 +35,8 @@ export const config: PluginConfigDescriptor = { addDeprecation({ message: `"${fromPath}.roles" is deprecated. Granting reporting privilege through a "reporting_user" role will not be supported ` + - `starting in 8.0. Please set 'xpack.reporting.roles.enabled' to 'false' and grant reporting privilege to users ` + - `through feature controls in Management > Security > Roles`, + `starting in 8.0. Please set 'xpack.reporting.roles.enabled' to 'false' and grant reporting privileges to users ` + + `using Kibana application privileges **Management > Security > Roles**.`, }); } }, diff --git a/x-pack/plugins/reporting/server/core.ts b/x-pack/plugins/reporting/server/core.ts index 2d55a4aa7fa6da..b7f3ebe9dcfa8b 100644 --- a/x-pack/plugins/reporting/server/core.ts +++ b/x-pack/plugins/reporting/server/core.ts @@ -25,14 +25,14 @@ import { SecurityPluginSetup } from '../../security/server'; import { DEFAULT_SPACE_ID } from '../../spaces/common/constants'; import { SpacesPluginSetup } from '../../spaces/server'; import { TaskManagerSetupContract, TaskManagerStartContract } from '../../task_manager/server'; -import { ReportingConfig } from './'; +import { ReportingConfig, ReportingSetup } from './'; import { HeadlessChromiumDriverFactory } from './browsers/chromium/driver_factory'; import { ReportingConfigType } from './config'; import { checkLicense, getExportTypesRegistry, LevelLogger } from './lib'; import { screenshotsObservableFactory, ScreenshotsObservableFn } from './lib/screenshots'; import { ReportingStore } from './lib/store'; import { ExecuteReportTask, MonitorReportsTask, ReportTaskParams } from './lib/tasks'; -import { ReportingPluginRouter, ReportingStart } from './types'; +import { ReportingPluginRouter } from './types'; export interface ReportingInternalSetup { basePath: Pick; @@ -69,7 +69,7 @@ export class ReportingCore { private config?: ReportingConfig; // final config, includes dynamic values based on OS type private executing: Set; - public getStartContract: () => ReportingStart; + public getContract: () => ReportingSetup; constructor(private logger: LevelLogger, context: PluginInitializerContext) { const syncConfig = context.config.get(); @@ -77,11 +77,9 @@ export class ReportingCore { this.executeTask = new ExecuteReportTask(this, syncConfig, this.logger); this.monitorTask = new MonitorReportsTask(this, syncConfig, this.logger); - this.getStartContract = (): ReportingStart => { - return { - usesUiCapabilities: () => syncConfig.roles.enabled === false, - }; - }; + this.getContract = () => ({ + usesUiCapabilities: () => syncConfig.roles.enabled === false, + }); this.executing = new Set(); } diff --git a/x-pack/plugins/reporting/server/deprecations.test.ts b/x-pack/plugins/reporting/server/deprecations.test.ts new file mode 100644 index 00000000000000..cce4721b941a0a --- /dev/null +++ b/x-pack/plugins/reporting/server/deprecations.test.ts @@ -0,0 +1,107 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { ReportingCore } from '.'; +import { registerDeprecations } from './deprecations'; +import { createMockConfigSchema, createMockReportingCore } from './test_helpers'; +import { coreMock, elasticsearchServiceMock } from 'src/core/server/mocks'; +import { GetDeprecationsContext, IScopedClusterClient } from 'kibana/server'; + +let reportingCore: ReportingCore; +let context: GetDeprecationsContext; +let esClient: jest.Mocked; + +beforeEach(async () => { + const mockReportingConfig = createMockConfigSchema({ roles: { enabled: false } }); + reportingCore = await createMockReportingCore(mockReportingConfig); + esClient = elasticsearchServiceMock.createScopedClusterClient(); + esClient.asCurrentUser.security.getUser = jest.fn().mockResolvedValue({ + body: { xyz: { username: 'normal_user', roles: ['data_analyst'] } }, + }); + context = ({ esClient } as unknown) as GetDeprecationsContext; +}); + +test('logs no deprecations when setup has no issues', async () => { + const { getDeprecations } = await registerDeprecations(reportingCore, coreMock.createSetup()); + expect(await getDeprecations(context)).toMatchInlineSnapshot(`Array []`); +}); + +test('logs a plain message when only a reporting_user role issue is found', async () => { + esClient.asCurrentUser.security.getUser = jest.fn().mockResolvedValue({ + body: { reportron: { username: 'reportron', roles: ['kibana_admin', 'reporting_user'] } }, + }); + + const { getDeprecations } = await registerDeprecations(reportingCore, coreMock.createSetup()); + expect(await getDeprecations(context)).toMatchInlineSnapshot(` + Array [ + Object { + "correctiveActions": Object { + "manualSteps": Array [ + "Create one or more custom roles that provide Kibana application privileges to reporting features in **Management > Security > Roles**.", + "Assign the custom role(s) as desired, and remove the \\"reporting_user\\" role from the user(s).", + ], + }, + "documentationUrl": "https://www.elastic.co/guide/en/kibana/current/secure-reporting.html", + "level": "critical", + "message": "The deprecated \\"reporting_user\\" role has been found for 1 user(s): \\"reportron\\"", + }, + ] + `); +}); + +test('logs multiple entries when multiple reporting_user role issues are found', async () => { + esClient.asCurrentUser.security.getUser = jest.fn().mockResolvedValue({ + body: { + reportron: { username: 'reportron', roles: ['kibana_admin', 'reporting_user'] }, + supercooluser: { username: 'supercooluser', roles: ['kibana_admin', 'reporting_user'] }, + }, + }); + + const { getDeprecations } = await registerDeprecations(reportingCore, coreMock.createSetup()); + expect(await getDeprecations(context)).toMatchInlineSnapshot(` + Array [ + Object { + "correctiveActions": Object { + "manualSteps": Array [ + "Create one or more custom roles that provide Kibana application privileges to reporting features in **Management > Security > Roles**.", + "Assign the custom role(s) as desired, and remove the \\"reporting_user\\" role from the user(s).", + ], + }, + "documentationUrl": "https://www.elastic.co/guide/en/kibana/current/secure-reporting.html", + "level": "critical", + "message": "The deprecated \\"reporting_user\\" role has been found for 2 user(s): \\"reportron\\", \\"supercooluser\\"", + }, + ] + `); +}); + +test('logs an expanded message when a config issue and a reporting_user role issue is found', async () => { + esClient.asCurrentUser.security.getUser = jest.fn().mockResolvedValue({ + body: { reportron: { username: 'reportron', roles: ['kibana_admin', 'reporting_user'] } }, + }); + + const mockReportingConfig = createMockConfigSchema({ roles: { enabled: true } }); + reportingCore = await createMockReportingCore(mockReportingConfig); + + const { getDeprecations } = await registerDeprecations(reportingCore, coreMock.createSetup()); + expect(await getDeprecations(context)).toMatchInlineSnapshot(` + Array [ + Object { + "correctiveActions": Object { + "manualSteps": Array [ + "Set \\"xpack.reporting.roles.enabled: false\\" in kibana.yml", + "Create one or more custom roles that provide Kibana application privileges to reporting features in **Management > Security > Roles**.", + "Assign the custom role(s) as desired, and remove the \\"reporting_user\\" role from the user(s).", + ], + }, + "documentationUrl": "https://www.elastic.co/guide/en/kibana/current/secure-reporting.html", + "level": "critical", + "message": "The deprecated \\"reporting_user\\" role has been found for 1 user(s): \\"reportron\\"", + }, + ] + `); +}); diff --git a/x-pack/plugins/reporting/server/deprecations.ts b/x-pack/plugins/reporting/server/deprecations.ts new file mode 100644 index 00000000000000..61074fff012a24 --- /dev/null +++ b/x-pack/plugins/reporting/server/deprecations.ts @@ -0,0 +1,52 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import type { CoreSetup, DeprecationsDetails, RegisterDeprecationsConfig } from 'src/core/server'; +import { ReportingCore } from '.'; + +const deprecatedRole = 'reporting_user'; +const upgradableConfig = 'xpack.reporting.roles.enabled: false'; + +export async function registerDeprecations( + reporting: ReportingCore, + { deprecations: deprecationsService }: CoreSetup +) { + const deprecationsConfig: RegisterDeprecationsConfig = { + getDeprecations: async ({ esClient }) => { + const usingDeprecatedConfig = !reporting.getContract().usesUiCapabilities(); + const deprecations: DeprecationsDetails[] = []; + const { body: users } = await esClient.asCurrentUser.security.getUser(); + + const reportingUsers = Object.entries(users) + .filter(([username, user]) => user.roles.includes(deprecatedRole)) + .map(([, user]) => user.username); + const numReportingUsers = reportingUsers.length; + + if (numReportingUsers > 0) { + const usernames = reportingUsers.join('", "'); + deprecations.push({ + message: `The deprecated "${deprecatedRole}" role has been found for ${numReportingUsers} user(s): "${usernames}"`, + documentationUrl: 'https://www.elastic.co/guide/en/kibana/current/secure-reporting.html', + level: 'critical', + correctiveActions: { + manualSteps: [ + ...(usingDeprecatedConfig ? [`Set "${upgradableConfig}" in kibana.yml`] : []), + `Create one or more custom roles that provide Kibana application privileges to reporting features in **Management > Security > Roles**.`, + `Assign the custom role(s) as desired, and remove the "${deprecatedRole}" role from the user(s).`, + ], + }, + }); + } + + return deprecations; + }, + }; + + deprecationsService.registerDeprecations(deprecationsConfig); + + return deprecationsConfig; +} diff --git a/x-pack/plugins/reporting/server/plugin.ts b/x-pack/plugins/reporting/server/plugin.ts index efe1d9450bef31..dc0ddf27a53b36 100644 --- a/x-pack/plugins/reporting/server/plugin.ts +++ b/x-pack/plugins/reporting/server/plugin.ts @@ -10,6 +10,7 @@ import { PLUGIN_ID } from '../common/constants'; import { ReportingCore } from './'; import { initializeBrowserDriverFactory } from './browsers'; import { buildConfig, registerUiSettings, ReportingConfigType } from './config'; +import { registerDeprecations } from './deprecations'; import { LevelLogger, ReportingStore } from './lib'; import { registerRoutes } from './routes'; import { setFieldFormats } from './services'; @@ -38,15 +39,13 @@ export class ReportingPlugin // @ts-expect-error null is not assignable to object. use a boolean property to ensure reporting API is enabled. core.http.registerRouteHandlerContext(PLUGIN_ID, () => { if (reportingCore.pluginIsStarted()) { - return reportingCore.getStartContract(); + return reportingCore.getContract(); } else { this.logger.error(`Reporting features are not yet ready`); return null; } }); - registerUiSettings(core); - const { http } = core; const { screenshotMode, features, licensing, security, spaces, taskManager } = plugins; @@ -65,6 +64,8 @@ export class ReportingPlugin logger: this.logger, }); + registerUiSettings(core); + registerDeprecations(reportingCore, core); registerReportingUsageCollector(reportingCore, plugins); registerRoutes(reportingCore, this.logger); @@ -81,7 +82,7 @@ export class ReportingPlugin }); this.reportingCore = reportingCore; - return reportingCore.getStartContract(); + return reportingCore.getContract(); } public start(core: CoreStart, plugins: ReportingStartDeps) { @@ -116,6 +117,6 @@ export class ReportingPlugin this.logger.error(e); }); - return reportingCore.getStartContract(); + return reportingCore.getContract(); } } From aa32903440b58d1e7cd10199e7cac5cb0735552f Mon Sep 17 00:00:00 2001 From: ymao1 Date: Wed, 26 May 2021 20:57:40 -0400 Subject: [PATCH 13/16] [Alerting] Link to action config settings from connector docs (#100358) * wip * Adding section about connector networking config to all connectors * Updating wording * Changing header size * Updating links * Apply suggestions from code review Co-authored-by: gchaps <33642766+gchaps@users.noreply.github.com> Co-authored-by: gchaps <33642766+gchaps@users.noreply.github.com> Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> --- docs/management/action-types.asciidoc | 7 ++++++- docs/management/connectors/action-types/email.asciidoc | 6 ++++++ docs/management/connectors/action-types/jira.asciidoc | 6 ++++++ docs/management/connectors/action-types/pagerduty.asciidoc | 6 ++++++ docs/management/connectors/action-types/resilient.asciidoc | 6 ++++++ .../management/connectors/action-types/servicenow.asciidoc | 6 ++++++ docs/management/connectors/action-types/slack.asciidoc | 6 ++++++ docs/management/connectors/action-types/teams.asciidoc | 6 ++++++ docs/management/connectors/action-types/webhook.asciidoc | 6 ++++++ 9 files changed, 54 insertions(+), 1 deletion(-) diff --git a/docs/management/action-types.asciidoc b/docs/management/action-types.asciidoc index ec5677bd04a6e2..65b600d4b7281f 100644 --- a/docs/management/action-types.asciidoc +++ b/docs/management/action-types.asciidoc @@ -71,6 +71,11 @@ image::images/connector-listing.png[Example connector listing in the Rules and C Access to connectors is granted based on your privileges to alerting-enabled features. See <> for more information. +[float] +=== Connector networking configuration + +Use the <> to customize connector networking configurations, such as proxies, certificates, or TLS settings. You can set configurations that apply to all your connectors or use `xpack.actions.customHostSettings` to set per-host configurations. + [float] [[connectors-list]] === Connector list @@ -110,7 +115,7 @@ image::images/connector-select-type.png[Connector select type] [[importing-and-exporting-connectors]] === Importing and exporting connectors -To import and export rules, use the <>. +To import and export connectors, use the <>. After a successful import, the proper banner is displayed: [role="screenshot"] image::images/coonectors-import-banner.png[Connectors import banner, width=50%] diff --git a/docs/management/connectors/action-types/email.asciidoc b/docs/management/connectors/action-types/email.asciidoc index 1c2f9212b48871..719d00c16c932a 100644 --- a/docs/management/connectors/action-types/email.asciidoc +++ b/docs/management/connectors/action-types/email.asciidoc @@ -24,6 +24,12 @@ Require authentication:: If true, a username and password for login type authent Username:: Username for login type authentication. Password:: Password for login type authentication. +[float] +[[email-connector-networking-configuration]] +==== Connector networking configuration + +Use the <> to customize connector networking configurations, such as proxies, certificates, or TLS settings. You can set configurations that apply to all your connectors or use `xpack.actions.customHostSettings` to set per-host configurations. + [float] [[preconfigured-email-configuration]] ==== Preconfigured connector type diff --git a/docs/management/connectors/action-types/jira.asciidoc b/docs/management/connectors/action-types/jira.asciidoc index a5e629887d5c6e..368b11225654c3 100644 --- a/docs/management/connectors/action-types/jira.asciidoc +++ b/docs/management/connectors/action-types/jira.asciidoc @@ -19,6 +19,12 @@ Project key:: Jira project key. Email (or username):: The account email (or username) for HTTP Basic authentication. API token (or password):: Jira API authentication token (or password) for HTTP Basic authentication. +[float] +[[jira-connector-networking-configuration]] +==== Connector networking configuration + +Use the <> to customize connector networking configurations, such as proxies, certificates, or TLS settings. You can set configurations that apply to all your connectors or use `xpack.actions.customHostSettings` to set per-host configurations. + [float] [[Preconfigured-jira-configuration]] ==== Preconfigured connector type diff --git a/docs/management/connectors/action-types/pagerduty.asciidoc b/docs/management/connectors/action-types/pagerduty.asciidoc index 25cba050105480..db1c4e3932d148 100644 --- a/docs/management/connectors/action-types/pagerduty.asciidoc +++ b/docs/management/connectors/action-types/pagerduty.asciidoc @@ -17,6 +17,12 @@ Name:: The name of the connector. The name is used to identify a connector API URL:: An optional PagerDuty event URL. Defaults to `https://events.pagerduty.com/v2/enqueue`. If you are using the <> setting, make sure the hostname is added to the allowed hosts. Integration Key:: A 32 character PagerDuty Integration Key for an integration on a service, also referred to as the routing key. +[float] +[[pagerduty-connector-networking-configuration]] +==== Connector networking configuration + +Use the <> to customize connector networking configurations, such as proxies, certificates, or TLS settings. You can set configurations that apply to all your connectors or use `xpack.actions.customHostSettings` to set per-host configurations. + [float] [[Preconfigured-pagerduty-configuration]] ==== Preconfigured connector type diff --git a/docs/management/connectors/action-types/resilient.asciidoc b/docs/management/connectors/action-types/resilient.asciidoc index 454ae145bbc579..ef8196bea0aabc 100644 --- a/docs/management/connectors/action-types/resilient.asciidoc +++ b/docs/management/connectors/action-types/resilient.asciidoc @@ -19,6 +19,12 @@ Organization ID:: IBM Resilient organization ID. API key ID:: The authentication key ID for HTTP Basic authentication. API key secret:: The authentication key secret for HTTP Basic authentication. +[float] +[[resilient-connector-networking-configuration]] +==== Connector networking configuration + +Use the <> to customize connector networking configurations, such as proxies, certificates, or TLS settings. You can set configurations that apply to all your connectors or use `xpack.actions.customHostSettings` to set per-host configurations. + [float] [[Preconfigured-resilient-configuration]] ==== Preconfigured connector type diff --git a/docs/management/connectors/action-types/servicenow.asciidoc b/docs/management/connectors/action-types/servicenow.asciidoc index 24892c62e804b2..dfac22cb23c6c3 100644 --- a/docs/management/connectors/action-types/servicenow.asciidoc +++ b/docs/management/connectors/action-types/servicenow.asciidoc @@ -18,6 +18,12 @@ URL:: ServiceNow instance URL. Username:: Username for HTTP Basic authentication. Password:: Password for HTTP Basic authentication. +[float] +[[servicenow-connector-networking-configuration]] +==== Connector networking configuration + +Use the <> to customize connector networking configurations, such as proxies, certificates, or TLS settings. You can set configurations that apply to all your connectors or use `xpack.actions.customHostSettings` to set per-host configurations. + [float] [[Preconfigured-servicenow-configuration]] ==== Preconfigured connector type diff --git a/docs/management/connectors/action-types/slack.asciidoc b/docs/management/connectors/action-types/slack.asciidoc index da0bf321f9ade7..6dffebd9d9354e 100644 --- a/docs/management/connectors/action-types/slack.asciidoc +++ b/docs/management/connectors/action-types/slack.asciidoc @@ -16,6 +16,12 @@ Slack connectors have the following configuration properties. Name:: The name of the connector. The name is used to identify a connector in the management UI connector listing, or in the connector list when configuring an action. Webhook URL:: The URL of the incoming webhook. See https://api.slack.com/messaging/webhooks#getting_started[Slack Incoming Webhooks] for instructions on generating this URL. If you are using the <> setting, make sure the hostname is added to the allowed hosts. +[float] +[[slack-connector-networking-configuration]] +==== Connector networking configuration + +Use the <> to customize connector networking configurations, such as proxies, certificates, or TLS settings. You can set configurations that apply to all your connectors or use `xpack.actions.customHostSettings` to set per-host configurations. + [float] [[Preconfigured-slack-configuration]] ==== Preconfigured connector type diff --git a/docs/management/connectors/action-types/teams.asciidoc b/docs/management/connectors/action-types/teams.asciidoc index ba723a6f33c860..32cfaaf801d70e 100644 --- a/docs/management/connectors/action-types/teams.asciidoc +++ b/docs/management/connectors/action-types/teams.asciidoc @@ -16,6 +16,12 @@ Microsoft Teams connectors have the following configuration properties. Name:: The name of the connector. The name is used to identify a connector in the management UI connector listing, or in the connector list when configuring an action. Webhook URL:: The URL of the incoming webhook. See https://docs.microsoft.com/en-us/microsoftteams/platform/webhooks-and-connectors/how-to/add-incoming-webhook#add-an-incoming-webhook-to-a-teams-channel[Add Incoming Webhooks] for instructions on generating this URL. If you are using the <> setting, make sure the hostname is added to the allowed hosts. +[float] +[[teams-connector-networking-configuration]] +==== Connector networking configuration + +Use the <> to customize connector networking configurations, such as proxies, certificates, or TLS settings. You can set configurations that apply to all your connectors or use `xpack.actions.customHostSettings` to set per-host configurations. + [float] [[Preconfigured-teams-configuration]] ==== Preconfigured connector type diff --git a/docs/management/connectors/action-types/webhook.asciidoc b/docs/management/connectors/action-types/webhook.asciidoc index a2024b9457a1c5..aa52e8a3bdb433 100644 --- a/docs/management/connectors/action-types/webhook.asciidoc +++ b/docs/management/connectors/action-types/webhook.asciidoc @@ -21,6 +21,12 @@ Require authentication:: If true, a username and password for login type authent Username:: Username for HTTP basic authentication. Password:: Password for HTTP basic authentication. +[float] +[[webhook-connector-networking-configuration]] +==== Connector networking configuration + +Use the <> to customize connector networking configurations, such as proxies, certificates, or TLS settings. You can set configurations that apply to all your connectors or use `xpack.actions.customHostSettings` to set per-host configurations. + [float] [[Preconfigured-webhook-configuration]] ==== Preconfigured connector type From 5da329a809a9a57be9616ae263f747c19103ef3f Mon Sep 17 00:00:00 2001 From: Thomas Neirynck Date: Wed, 26 May 2021 21:09:38 -0400 Subject: [PATCH 14/16] [Maps] Isolate mapbox-gl types and align downstream package versions. (#100610) --- package.json | 8 +- packages/kbn-mapbox-gl/src/index.ts | 38 +++- .../vega_view/vega_map_view/constants.ts | 2 +- .../vega_view/vega_map_view/layers/types.ts | 2 +- .../vega_map_view/layers/vega_layer.ts | 2 +- .../public/vega_view/vega_map_view/view.ts | 2 +- .../layers/heatmap_layer/heatmap_layer.ts | 2 +- .../maps/public/classes/layers/layer.tsx | 2 +- .../tiled_vector_layer/tiled_vector_layer.tsx | 4 +- .../classes/layers/vector_layer/utils.tsx | 2 +- .../layers/vector_layer/vector_layer.tsx | 6 +- .../classes/styles/heatmap/heatmap_style.tsx | 2 +- .../properties/dynamic_color_property.tsx | 2 +- .../properties/dynamic_icon_property.tsx | 2 +- .../dynamic_orientation_property.ts | 2 +- .../properties/dynamic_size_property.test.tsx | 2 +- .../properties/dynamic_size_property.tsx | 2 +- .../properties/dynamic_style_property.tsx | 2 +- .../properties/dynamic_text_property.test.tsx | 2 +- .../properties/dynamic_text_property.ts | 2 +- .../properties/label_border_size_property.ts | 2 +- .../properties/static_color_property.ts | 2 +- .../vector/properties/static_icon_property.ts | 2 +- .../properties/static_orientation_property.ts | 2 +- .../vector/properties/static_size_property.ts | 2 +- .../properties/static_text_property.test.ts | 2 +- .../vector/properties/static_text_property.ts | 2 +- .../classes/styles/vector/vector_style.tsx | 2 +- .../mb_map/draw_control/draw_control.tsx | 2 +- .../draw_filter_control.tsx | 2 +- .../mb_map/draw_control/draw_tooltip.tsx | 2 +- .../connected_components/mb_map/mb_map.tsx | 2 +- .../scale_control/scale_control.test.tsx | 2 +- .../mb_map/scale_control/scale_control.tsx | 2 +- .../mb_map/sort_layers.test.ts | 2 +- .../mb_map/sort_layers.ts | 2 +- .../mb_map/tile_status_tracker.test.ts | 2 +- .../mb_map/tile_status_tracker.ts | 2 +- .../tooltip_control/tooltip_control.test.tsx | 2 +- .../tooltip_control/tooltip_control.tsx | 2 +- .../tooltip_control/tooltip_popover.test.tsx | 2 +- .../tooltip_control/tooltip_popover.tsx | 2 +- yarn.lock | 185 +++++------------- 43 files changed, 132 insertions(+), 185 deletions(-) diff --git a/package.json b/package.json index 3cdde5e52584af..936f985498ab17 100644 --- a/package.json +++ b/package.json @@ -158,8 +158,8 @@ "@loaders.gl/core": "^2.3.1", "@loaders.gl/json": "^2.3.1", "@mapbox/geojson-rewind": "^0.5.0", - "@mapbox/mapbox-gl-draw": "^1.2.0", - "@mapbox/mapbox-gl-rtl-text": "^0.2.3", + "@mapbox/mapbox-gl-draw": "1.3.0", + "@mapbox/mapbox-gl-rtl-text": "0.2.3", "@mapbox/vector-tile": "1.3.1", "@scant/router": "^0.1.1", "@slack/webhook": "^5.0.4", @@ -285,7 +285,7 @@ "lru-cache": "^4.1.5", "lz-string": "^1.4.4", "mapbox-gl": "1.13.1", - "mapbox-gl-draw-rectangle-mode": "^1.0.4", + "mapbox-gl-draw-rectangle-mode": "1.0.4", "markdown-it": "^10.0.0", "md5": "^2.1.0", "memoize-one": "^5.0.0", @@ -562,7 +562,7 @@ "@types/loader-utils": "^1.1.3", "@types/lodash": "^4.14.159", "@types/lru-cache": "^5.1.0", - "@types/mapbox-gl": "^1.9.1", + "@types/mapbox-gl": "1.13.1", "@types/markdown-it": "^0.0.7", "@types/md5": "^2.2.0", "@types/memoize-one": "^4.1.0", diff --git a/packages/kbn-mapbox-gl/src/index.ts b/packages/kbn-mapbox-gl/src/index.ts index 117b874a28ffbd..404684af780310 100644 --- a/packages/kbn-mapbox-gl/src/index.ts +++ b/packages/kbn-mapbox-gl/src/index.ts @@ -7,6 +7,24 @@ */ import './typings'; +import type { + Map, + GeoJSONSource, + VectorSource, + Layer, + AnyLayer, + FeatureIdentifier, + Style, + MapboxOptions, + MapMouseEvent, + MapSourceDataEvent, + LngLat, + LngLatBounds, + PointLike, + MapboxGeoJSONFeature, + Point, + CustomLayerInterface, +} from 'mapbox-gl'; import mapboxgl from 'mapbox-gl/dist/mapbox-gl-csp'; // @ts-expect-error import mbRtlPlugin from '!!file-loader!@mapbox/mapbox-gl-rtl-text/mapbox-gl-rtl-text.min.js'; @@ -17,4 +35,22 @@ import 'mapbox-gl/dist/mapbox-gl.css'; mapboxgl.workerUrl = mbWorkerUrl; mapboxgl.setRTLTextPlugin(mbRtlPlugin); -export { mapboxgl }; +export { + mapboxgl, + Map, + GeoJSONSource, + VectorSource, + Layer, + AnyLayer, + FeatureIdentifier, + Style, + MapboxOptions, + MapMouseEvent, + MapSourceDataEvent, + LngLat, + LngLatBounds, + PointLike, + MapboxGeoJSONFeature, + Point, + CustomLayerInterface, +}; diff --git a/src/plugins/vis_type_vega/public/vega_view/vega_map_view/constants.ts b/src/plugins/vis_type_vega/public/vega_view/vega_map_view/constants.ts index 75e3b66a784b3d..04957fda5b8ffb 100644 --- a/src/plugins/vis_type_vega/public/vega_view/vega_map_view/constants.ts +++ b/src/plugins/vis_type_vega/public/vega_view/vega_map_view/constants.ts @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -import type { Style } from 'mapbox-gl'; +import type { Style } from '@kbn/mapbox-gl'; import { TMS_IN_YML_ID } from '../../../../maps_ems/public'; export const vegaLayerId = 'vega'; diff --git a/src/plugins/vis_type_vega/public/vega_view/vega_map_view/layers/types.ts b/src/plugins/vis_type_vega/public/vega_view/vega_map_view/layers/types.ts index d3e8bc3f5ab331..428910cbf2d389 100644 --- a/src/plugins/vis_type_vega/public/vega_view/vega_map_view/layers/types.ts +++ b/src/plugins/vis_type_vega/public/vega_view/vega_map_view/layers/types.ts @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -import type { Map } from 'mapbox-gl'; +import type { Map } from '@kbn/mapbox-gl'; export interface LayerParameters = {}> { id: string; diff --git a/src/plugins/vis_type_vega/public/vega_view/vega_map_view/layers/vega_layer.ts b/src/plugins/vis_type_vega/public/vega_view/vega_map_view/layers/vega_layer.ts index 8972b80cb99c59..b6bac1e842926e 100644 --- a/src/plugins/vis_type_vega/public/vega_view/vega_map_view/layers/vega_layer.ts +++ b/src/plugins/vis_type_vega/public/vega_view/vega_map_view/layers/vega_layer.ts @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -import type { Map, CustomLayerInterface } from 'mapbox-gl'; +import type { Map, CustomLayerInterface } from '@kbn/mapbox-gl'; import type { View } from 'vega'; import type { LayerParameters } from './types'; diff --git a/src/plugins/vis_type_vega/public/vega_view/vega_map_view/view.ts b/src/plugins/vis_type_vega/public/vega_view/vega_map_view/view.ts index 835ac36ceee471..f4104a0f2457c4 100644 --- a/src/plugins/vis_type_vega/public/vega_view/vega_map_view/view.ts +++ b/src/plugins/vis_type_vega/public/vega_view/vega_map_view/view.ts @@ -7,7 +7,7 @@ */ import { i18n } from '@kbn/i18n'; -import type { Map, Style, MapboxOptions } from 'mapbox-gl'; +import type { Map, Style, MapboxOptions } from '@kbn/mapbox-gl'; import { View, parse } from 'vega'; diff --git a/x-pack/plugins/maps/public/classes/layers/heatmap_layer/heatmap_layer.ts b/x-pack/plugins/maps/public/classes/layers/heatmap_layer/heatmap_layer.ts index 96c7fcedaf3d9c..368ff8bebcdd10 100644 --- a/x-pack/plugins/maps/public/classes/layers/heatmap_layer/heatmap_layer.ts +++ b/x-pack/plugins/maps/public/classes/layers/heatmap_layer/heatmap_layer.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { Map as MbMap, GeoJSONSource as MbGeoJSONSource } from 'mapbox-gl'; +import type { Map as MbMap, GeoJSONSource as MbGeoJSONSource } from '@kbn/mapbox-gl'; import { FeatureCollection } from 'geojson'; import { AbstractLayer } from '../layer'; import { HeatmapStyle } from '../../styles/heatmap/heatmap_style'; diff --git a/x-pack/plugins/maps/public/classes/layers/layer.tsx b/x-pack/plugins/maps/public/classes/layers/layer.tsx index 1c1e29ca485fff..be113ab4cc2c9a 100644 --- a/x-pack/plugins/maps/public/classes/layers/layer.tsx +++ b/x-pack/plugins/maps/public/classes/layers/layer.tsx @@ -7,7 +7,7 @@ /* eslint-disable @typescript-eslint/consistent-type-definitions */ -import { Map as MbMap } from 'mapbox-gl'; +import type { Map as MbMap } from '@kbn/mapbox-gl'; import { Query } from 'src/plugins/data/public'; import _ from 'lodash'; import React, { ReactElement, ReactNode } from 'react'; diff --git a/x-pack/plugins/maps/public/classes/layers/tiled_vector_layer/tiled_vector_layer.tsx b/x-pack/plugins/maps/public/classes/layers/tiled_vector_layer/tiled_vector_layer.tsx index d452096250576d..6dba935ccc87d9 100644 --- a/x-pack/plugins/maps/public/classes/layers/tiled_vector_layer/tiled_vector_layer.tsx +++ b/x-pack/plugins/maps/public/classes/layers/tiled_vector_layer/tiled_vector_layer.tsx @@ -6,11 +6,11 @@ */ import React from 'react'; -import { +import type { Map as MbMap, GeoJSONSource as MbGeoJSONSource, VectorSource as MbVectorSource, -} from 'mapbox-gl'; +} from '@kbn/mapbox-gl'; import { EuiIcon } from '@elastic/eui'; import { Feature } from 'geojson'; import uuid from 'uuid/v4'; diff --git a/x-pack/plugins/maps/public/classes/layers/vector_layer/utils.tsx b/x-pack/plugins/maps/public/classes/layers/vector_layer/utils.tsx index e49339b6250b48..a7ac9dd9cfb6af 100644 --- a/x-pack/plugins/maps/public/classes/layers/vector_layer/utils.tsx +++ b/x-pack/plugins/maps/public/classes/layers/vector_layer/utils.tsx @@ -6,7 +6,7 @@ */ import { FeatureCollection } from 'geojson'; -import { Map as MbMap } from 'mapbox-gl'; +import type { Map as MbMap } from '@kbn/mapbox-gl'; import { EMPTY_FEATURE_COLLECTION, SOURCE_BOUNDS_DATA_REQUEST_ID, diff --git a/x-pack/plugins/maps/public/classes/layers/vector_layer/vector_layer.tsx b/x-pack/plugins/maps/public/classes/layers/vector_layer/vector_layer.tsx index a4d913979cf1b5..ca171f10207e16 100644 --- a/x-pack/plugins/maps/public/classes/layers/vector_layer/vector_layer.tsx +++ b/x-pack/plugins/maps/public/classes/layers/vector_layer/vector_layer.tsx @@ -6,7 +6,11 @@ */ import React from 'react'; -import { Map as MbMap, Layer as MbLayer, GeoJSONSource as MbGeoJSONSource } from 'mapbox-gl'; +import type { + Map as MbMap, + AnyLayer as MbLayer, + GeoJSONSource as MbGeoJSONSource, +} from '@kbn/mapbox-gl'; import { Feature, FeatureCollection, GeoJsonProperties } from 'geojson'; import _ from 'lodash'; import { EuiIcon } from '@elastic/eui'; diff --git a/x-pack/plugins/maps/public/classes/styles/heatmap/heatmap_style.tsx b/x-pack/plugins/maps/public/classes/styles/heatmap/heatmap_style.tsx index fe581a1807b28b..723390ff236762 100644 --- a/x-pack/plugins/maps/public/classes/styles/heatmap/heatmap_style.tsx +++ b/x-pack/plugins/maps/public/classes/styles/heatmap/heatmap_style.tsx @@ -6,7 +6,7 @@ */ import React from 'react'; -import { Map as MbMap } from 'mapbox-gl'; +import type { Map as MbMap } from '@kbn/mapbox-gl'; import { i18n } from '@kbn/i18n'; import { EuiIcon } from '@elastic/eui'; import { IStyle } from '../style'; diff --git a/x-pack/plugins/maps/public/classes/styles/vector/properties/dynamic_color_property.tsx b/x-pack/plugins/maps/public/classes/styles/vector/properties/dynamic_color_property.tsx index d654cdc6bff514..73f8736750656e 100644 --- a/x-pack/plugins/maps/public/classes/styles/vector/properties/dynamic_color_property.tsx +++ b/x-pack/plugins/maps/public/classes/styles/vector/properties/dynamic_color_property.tsx @@ -5,7 +5,7 @@ * 2.0. */ -import { Map as MbMap } from 'mapbox-gl'; +import type { Map as MbMap } from '@kbn/mapbox-gl'; import React from 'react'; import { EuiTextColor } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; diff --git a/x-pack/plugins/maps/public/classes/styles/vector/properties/dynamic_icon_property.tsx b/x-pack/plugins/maps/public/classes/styles/vector/properties/dynamic_icon_property.tsx index ad87b43c8e4a51..56d7c8597e1511 100644 --- a/x-pack/plugins/maps/public/classes/styles/vector/properties/dynamic_icon_property.tsx +++ b/x-pack/plugins/maps/public/classes/styles/vector/properties/dynamic_icon_property.tsx @@ -8,7 +8,7 @@ import _ from 'lodash'; import React from 'react'; import { EuiTextColor } from '@elastic/eui'; -import { Map as MbMap } from 'mapbox-gl'; +import type { Map as MbMap } from '@kbn/mapbox-gl'; import { DynamicStyleProperty } from './dynamic_style_property'; // @ts-expect-error import { getIconPalette, getMakiIconId, getMakiSymbolAnchor } from '../symbol_utils'; diff --git a/x-pack/plugins/maps/public/classes/styles/vector/properties/dynamic_orientation_property.ts b/x-pack/plugins/maps/public/classes/styles/vector/properties/dynamic_orientation_property.ts index e72b411909e825..afa034b4d395c1 100644 --- a/x-pack/plugins/maps/public/classes/styles/vector/properties/dynamic_orientation_property.ts +++ b/x-pack/plugins/maps/public/classes/styles/vector/properties/dynamic_orientation_property.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { Map as MbMap } from 'mapbox-gl'; +import type { Map as MbMap } from '@kbn/mapbox-gl'; import { DynamicStyleProperty, getNumericalMbFeatureStateValue } from './dynamic_style_property'; import { OrientationDynamicOptions } from '../../../../../common/descriptor_types'; import { RawValue } from '../../../../../common/constants'; diff --git a/x-pack/plugins/maps/public/classes/styles/vector/properties/dynamic_size_property.test.tsx b/x-pack/plugins/maps/public/classes/styles/vector/properties/dynamic_size_property.test.tsx index 64a3e0cf0e322d..e1a92fdcad08a8 100644 --- a/x-pack/plugins/maps/public/classes/styles/vector/properties/dynamic_size_property.test.tsx +++ b/x-pack/plugins/maps/public/classes/styles/vector/properties/dynamic_size_property.test.tsx @@ -18,7 +18,7 @@ import { shallow } from 'enzyme'; import { DynamicSizeProperty } from './dynamic_size_property'; import { RawValue, VECTOR_STYLES } from '../../../../../common/constants'; import { IField } from '../../../fields/field'; -import { Map as MbMap } from 'mapbox-gl'; +import type { Map as MbMap } from '@kbn/mapbox-gl'; import { SizeDynamicOptions } from '../../../../../common/descriptor_types'; import { mockField, MockLayer, MockStyle } from './test_helpers/test_util'; import { IVectorLayer } from '../../../layers/vector_layer'; diff --git a/x-pack/plugins/maps/public/classes/styles/vector/properties/dynamic_size_property.tsx b/x-pack/plugins/maps/public/classes/styles/vector/properties/dynamic_size_property.tsx index 7076775dcce31f..8599adef33f011 100644 --- a/x-pack/plugins/maps/public/classes/styles/vector/properties/dynamic_size_property.tsx +++ b/x-pack/plugins/maps/public/classes/styles/vector/properties/dynamic_size_property.tsx @@ -7,7 +7,7 @@ import _ from 'lodash'; import React from 'react'; -import { Map as MbMap } from 'mapbox-gl'; +import type { Map as MbMap } from '@kbn/mapbox-gl'; import { DynamicStyleProperty } from './dynamic_style_property'; import { OrdinalLegend } from '../components/legend/ordinal_legend'; import { makeMbClampedNumberExpression } from '../style_util'; diff --git a/x-pack/plugins/maps/public/classes/styles/vector/properties/dynamic_style_property.tsx b/x-pack/plugins/maps/public/classes/styles/vector/properties/dynamic_style_property.tsx index 9ffd9a0f1b3459..0841bb7546d9e7 100644 --- a/x-pack/plugins/maps/public/classes/styles/vector/properties/dynamic_style_property.tsx +++ b/x-pack/plugins/maps/public/classes/styles/vector/properties/dynamic_style_property.tsx @@ -8,7 +8,7 @@ import _ from 'lodash'; import React from 'react'; import { Feature, FeatureCollection } from 'geojson'; -import { FeatureIdentifier, Map as MbMap } from 'mapbox-gl'; +import type { FeatureIdentifier, Map as MbMap } from '@kbn/mapbox-gl'; import { AbstractStyleProperty, IStyleProperty } from './style_property'; import { DEFAULT_SIGMA } from '../vector_style_defaults'; import { diff --git a/x-pack/plugins/maps/public/classes/styles/vector/properties/dynamic_text_property.test.tsx b/x-pack/plugins/maps/public/classes/styles/vector/properties/dynamic_text_property.test.tsx index 4550a27ac2d9a5..b5872773fdce63 100644 --- a/x-pack/plugins/maps/public/classes/styles/vector/properties/dynamic_text_property.test.tsx +++ b/x-pack/plugins/maps/public/classes/styles/vector/properties/dynamic_text_property.test.tsx @@ -17,7 +17,7 @@ import React from 'react'; import { DynamicTextProperty } from './dynamic_text_property'; import { RawValue, VECTOR_STYLES } from '../../../../../common/constants'; import { IField } from '../../../fields/field'; -import { Map as MbMap } from 'mapbox-gl'; +import type { Map as MbMap } from '@kbn/mapbox-gl'; import { mockField, MockLayer, MockStyle } from './test_helpers/test_util'; import { IVectorLayer } from '../../../layers/vector_layer'; diff --git a/x-pack/plugins/maps/public/classes/styles/vector/properties/dynamic_text_property.ts b/x-pack/plugins/maps/public/classes/styles/vector/properties/dynamic_text_property.ts index e8612388a5ae16..c59d7207983718 100644 --- a/x-pack/plugins/maps/public/classes/styles/vector/properties/dynamic_text_property.ts +++ b/x-pack/plugins/maps/public/classes/styles/vector/properties/dynamic_text_property.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { Map as MbMap } from 'mapbox-gl'; +import type { Map as MbMap } from '@kbn/mapbox-gl'; import { DynamicStyleProperty } from './dynamic_style_property'; import { LabelDynamicOptions } from '../../../../../common/descriptor_types'; import { RawValue } from '../../../../../common/constants'; diff --git a/x-pack/plugins/maps/public/classes/styles/vector/properties/label_border_size_property.ts b/x-pack/plugins/maps/public/classes/styles/vector/properties/label_border_size_property.ts index 4d9473a9adced9..5d4425a9d4995a 100644 --- a/x-pack/plugins/maps/public/classes/styles/vector/properties/label_border_size_property.ts +++ b/x-pack/plugins/maps/public/classes/styles/vector/properties/label_border_size_property.ts @@ -6,7 +6,7 @@ */ import _ from 'lodash'; -import { Map as MbMap } from 'mapbox-gl'; +import type { Map as MbMap } from '@kbn/mapbox-gl'; import { AbstractStyleProperty } from './style_property'; import { DEFAULT_LABEL_SIZE } from '../vector_style_defaults'; import { LABEL_BORDER_SIZES } from '../../../../../common/constants'; diff --git a/x-pack/plugins/maps/public/classes/styles/vector/properties/static_color_property.ts b/x-pack/plugins/maps/public/classes/styles/vector/properties/static_color_property.ts index dae983c4ae4fe0..c8a80b5ee28dc6 100644 --- a/x-pack/plugins/maps/public/classes/styles/vector/properties/static_color_property.ts +++ b/x-pack/plugins/maps/public/classes/styles/vector/properties/static_color_property.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { Map as MbMap } from 'mapbox-gl'; +import type { Map as MbMap } from '@kbn/mapbox-gl'; import { StaticStyleProperty } from './static_style_property'; import { ColorStaticOptions } from '../../../../../common/descriptor_types'; diff --git a/x-pack/plugins/maps/public/classes/styles/vector/properties/static_icon_property.ts b/x-pack/plugins/maps/public/classes/styles/vector/properties/static_icon_property.ts index 887f16a1760482..3a61e1a0748680 100644 --- a/x-pack/plugins/maps/public/classes/styles/vector/properties/static_icon_property.ts +++ b/x-pack/plugins/maps/public/classes/styles/vector/properties/static_icon_property.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { Map as MbMap } from 'mapbox-gl'; +import type { Map as MbMap } from '@kbn/mapbox-gl'; import { StaticStyleProperty } from './static_style_property'; // @ts-expect-error import { getMakiSymbolAnchor, getMakiIconId } from '../symbol_utils'; diff --git a/x-pack/plugins/maps/public/classes/styles/vector/properties/static_orientation_property.ts b/x-pack/plugins/maps/public/classes/styles/vector/properties/static_orientation_property.ts index 329088fdb160d7..48a52f641dfc72 100644 --- a/x-pack/plugins/maps/public/classes/styles/vector/properties/static_orientation_property.ts +++ b/x-pack/plugins/maps/public/classes/styles/vector/properties/static_orientation_property.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { Map as MbMap } from 'mapbox-gl'; +import type { Map as MbMap } from '@kbn/mapbox-gl'; import { StaticStyleProperty } from './static_style_property'; import { VECTOR_STYLES } from '../../../../../common/constants'; import { OrientationStaticOptions } from '../../../../../common/descriptor_types'; diff --git a/x-pack/plugins/maps/public/classes/styles/vector/properties/static_size_property.ts b/x-pack/plugins/maps/public/classes/styles/vector/properties/static_size_property.ts index 3dd706043d1584..de71d07aa71673 100644 --- a/x-pack/plugins/maps/public/classes/styles/vector/properties/static_size_property.ts +++ b/x-pack/plugins/maps/public/classes/styles/vector/properties/static_size_property.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { Map as MbMap } from 'mapbox-gl'; +import type { Map as MbMap } from '@kbn/mapbox-gl'; import { StaticStyleProperty } from './static_style_property'; import { VECTOR_STYLES } from '../../../../../common/constants'; import { diff --git a/x-pack/plugins/maps/public/classes/styles/vector/properties/static_text_property.test.ts b/x-pack/plugins/maps/public/classes/styles/vector/properties/static_text_property.test.ts index 70c7721e760b64..498ad2fc4ea176 100644 --- a/x-pack/plugins/maps/public/classes/styles/vector/properties/static_text_property.test.ts +++ b/x-pack/plugins/maps/public/classes/styles/vector/properties/static_text_property.test.ts @@ -7,7 +7,7 @@ import { StaticTextProperty } from './static_text_property'; import { VECTOR_STYLES } from '../../../../../common/constants'; -import { Map as MbMap } from 'mapbox-gl'; +import type { Map as MbMap } from '@kbn/mapbox-gl'; export class MockMbMap { _paintPropertyCalls: unknown[]; diff --git a/x-pack/plugins/maps/public/classes/styles/vector/properties/static_text_property.ts b/x-pack/plugins/maps/public/classes/styles/vector/properties/static_text_property.ts index fb05fa052db21e..083d091aaefe54 100644 --- a/x-pack/plugins/maps/public/classes/styles/vector/properties/static_text_property.ts +++ b/x-pack/plugins/maps/public/classes/styles/vector/properties/static_text_property.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { Map as MbMap } from 'mapbox-gl'; +import type { Map as MbMap } from '@kbn/mapbox-gl'; import { StaticStyleProperty } from './static_style_property'; import { LabelStaticOptions } from '../../../../../common/descriptor_types'; diff --git a/x-pack/plugins/maps/public/classes/styles/vector/vector_style.tsx b/x-pack/plugins/maps/public/classes/styles/vector/vector_style.tsx index 692be08d07bc6a..7578695d7ac6fa 100644 --- a/x-pack/plugins/maps/public/classes/styles/vector/vector_style.tsx +++ b/x-pack/plugins/maps/public/classes/styles/vector/vector_style.tsx @@ -7,7 +7,7 @@ import _ from 'lodash'; import React, { ReactElement } from 'react'; -import { FeatureIdentifier, Map as MbMap } from 'mapbox-gl'; +import { FeatureIdentifier, Map as MbMap } from '@kbn/mapbox-gl'; import { FeatureCollection } from 'geojson'; import { StyleProperties, VectorStyleEditor } from './components/vector_style_editor'; import { getDefaultStaticProperties, LINE_STYLES, POLYGON_STYLES } from './vector_style_defaults'; diff --git a/x-pack/plugins/maps/public/connected_components/mb_map/draw_control/draw_control.tsx b/x-pack/plugins/maps/public/connected_components/mb_map/draw_control/draw_control.tsx index a1bea4a8e93dcd..4f8182963a185f 100644 --- a/x-pack/plugins/maps/public/connected_components/mb_map/draw_control/draw_control.tsx +++ b/x-pack/plugins/maps/public/connected_components/mb_map/draw_control/draw_control.tsx @@ -11,7 +11,7 @@ import React, { Component } from 'react'; import MapboxDraw from '@mapbox/mapbox-gl-draw'; // @ts-expect-error import DrawRectangle from 'mapbox-gl-draw-rectangle-mode'; -import { Map as MbMap } from 'mapbox-gl'; +import type { Map as MbMap } from '@kbn/mapbox-gl'; import { Feature } from 'geojson'; import { DRAW_TYPE } from '../../../../common/constants'; import { DrawCircle } from './draw_circle'; diff --git a/x-pack/plugins/maps/public/connected_components/mb_map/draw_control/draw_filter_control/draw_filter_control.tsx b/x-pack/plugins/maps/public/connected_components/mb_map/draw_control/draw_filter_control/draw_filter_control.tsx index e6359394cd741a..5fad291a5367fd 100644 --- a/x-pack/plugins/maps/public/connected_components/mb_map/draw_control/draw_filter_control/draw_filter_control.tsx +++ b/x-pack/plugins/maps/public/connected_components/mb_map/draw_control/draw_filter_control/draw_filter_control.tsx @@ -7,7 +7,7 @@ import _ from 'lodash'; import React, { Component } from 'react'; -import { Map as MbMap } from 'mapbox-gl'; +import type { Map as MbMap } from '@kbn/mapbox-gl'; import { i18n } from '@kbn/i18n'; import { Filter } from 'src/plugins/data/public'; import { Feature, Polygon } from 'geojson'; diff --git a/x-pack/plugins/maps/public/connected_components/mb_map/draw_control/draw_tooltip.tsx b/x-pack/plugins/maps/public/connected_components/mb_map/draw_control/draw_tooltip.tsx index df650d5dfe4100..38d3bab6cd129c 100644 --- a/x-pack/plugins/maps/public/connected_components/mb_map/draw_control/draw_tooltip.tsx +++ b/x-pack/plugins/maps/public/connected_components/mb_map/draw_control/draw_tooltip.tsx @@ -9,7 +9,7 @@ import _ from 'lodash'; import React, { Component, RefObject } from 'react'; import { EuiPopover, EuiText } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { Map as MbMap } from 'mapbox-gl'; +import type { Map as MbMap } from '@kbn/mapbox-gl'; import { DRAW_TYPE } from '../../../../common/constants'; const noop = () => {}; diff --git a/x-pack/plugins/maps/public/connected_components/mb_map/mb_map.tsx b/x-pack/plugins/maps/public/connected_components/mb_map/mb_map.tsx index ce36ec811df408..877de10e113834 100644 --- a/x-pack/plugins/maps/public/connected_components/mb_map/mb_map.tsx +++ b/x-pack/plugins/maps/public/connected_components/mb_map/mb_map.tsx @@ -7,7 +7,7 @@ import _ from 'lodash'; import React, { Component } from 'react'; -import type { Map as MapboxMap, MapboxOptions, MapMouseEvent } from 'mapbox-gl'; +import type { Map as MapboxMap, MapboxOptions, MapMouseEvent } from '@kbn/mapbox-gl'; // @ts-expect-error import { spritesheet } from '@elastic/maki'; diff --git a/x-pack/plugins/maps/public/connected_components/mb_map/scale_control/scale_control.test.tsx b/x-pack/plugins/maps/public/connected_components/mb_map/scale_control/scale_control.test.tsx index bd735d5cd5183a..0eb3ff2de16e8d 100644 --- a/x-pack/plugins/maps/public/connected_components/mb_map/scale_control/scale_control.test.tsx +++ b/x-pack/plugins/maps/public/connected_components/mb_map/scale_control/scale_control.test.tsx @@ -8,7 +8,7 @@ import React from 'react'; import { mount, shallow } from 'enzyme'; import { ScaleControl } from './scale_control'; -import { LngLat, LngLatBounds, Map as MapboxMap, PointLike } from 'mapbox-gl'; +import type { LngLat, LngLatBounds, Map as MapboxMap, PointLike } from '@kbn/mapbox-gl'; const CLIENT_HEIGHT_PIXELS = 1200; const DISTANCE_METERS = 87653; diff --git a/x-pack/plugins/maps/public/connected_components/mb_map/scale_control/scale_control.tsx b/x-pack/plugins/maps/public/connected_components/mb_map/scale_control/scale_control.tsx index 68f37721bdb1f0..d762f17b9b8982 100644 --- a/x-pack/plugins/maps/public/connected_components/mb_map/scale_control/scale_control.tsx +++ b/x-pack/plugins/maps/public/connected_components/mb_map/scale_control/scale_control.tsx @@ -8,7 +8,7 @@ import { i18n } from '@kbn/i18n'; import classNames from 'classnames'; import React, { Component } from 'react'; -import { Map as MapboxMap } from 'mapbox-gl'; +import type { Map as MapboxMap } from '@kbn/mapbox-gl'; const MAX_WIDTH = 110; interface Props { diff --git a/x-pack/plugins/maps/public/connected_components/mb_map/sort_layers.test.ts b/x-pack/plugins/maps/public/connected_components/mb_map/sort_layers.test.ts index 6be53cfb1349a1..596ba793db708f 100644 --- a/x-pack/plugins/maps/public/connected_components/mb_map/sort_layers.test.ts +++ b/x-pack/plugins/maps/public/connected_components/mb_map/sort_layers.test.ts @@ -8,7 +8,7 @@ /* eslint-disable max-classes-per-file */ import _ from 'lodash'; -import { Map as MbMap, Layer as MbLayer, Style as MbStyle } from 'mapbox-gl'; +import type { Map as MbMap, AnyLayer as MbLayer, Style as MbStyle } from '@kbn/mapbox-gl'; import { getIsTextLayer, syncLayerOrder } from './sort_layers'; import { SPATIAL_FILTERS_LAYER_ID } from '../../../common/constants'; import { ILayer } from '../../classes/layers/layer'; diff --git a/x-pack/plugins/maps/public/connected_components/mb_map/sort_layers.ts b/x-pack/plugins/maps/public/connected_components/mb_map/sort_layers.ts index 8c16c13bfcc90e..927c6819351c27 100644 --- a/x-pack/plugins/maps/public/connected_components/mb_map/sort_layers.ts +++ b/x-pack/plugins/maps/public/connected_components/mb_map/sort_layers.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { Map as MbMap, Layer as MbLayer } from 'mapbox-gl'; +import type { Map as MbMap, Layer as MbLayer } from '@kbn/mapbox-gl'; import { ILayer } from '../../classes/layers/layer'; // "Layer" is overloaded and can mean the following diff --git a/x-pack/plugins/maps/public/connected_components/mb_map/tile_status_tracker.test.ts b/x-pack/plugins/maps/public/connected_components/mb_map/tile_status_tracker.test.ts index 223efae6576012..6b47fe3e6e650f 100644 --- a/x-pack/plugins/maps/public/connected_components/mb_map/tile_status_tracker.test.ts +++ b/x-pack/plugins/maps/public/connected_components/mb_map/tile_status_tracker.test.ts @@ -7,7 +7,7 @@ // eslint-disable-next-line max-classes-per-file import { TileStatusTracker } from './tile_status_tracker'; -import { Map as MbMap } from 'mapbox-gl'; +import type { Map as MbMap } from '@kbn/mapbox-gl'; import { ILayer } from '../../classes/layers/layer'; class MockMbMap { diff --git a/x-pack/plugins/maps/public/connected_components/mb_map/tile_status_tracker.ts b/x-pack/plugins/maps/public/connected_components/mb_map/tile_status_tracker.ts index be946a12fe225c..fc99cd3067d0b9 100644 --- a/x-pack/plugins/maps/public/connected_components/mb_map/tile_status_tracker.ts +++ b/x-pack/plugins/maps/public/connected_components/mb_map/tile_status_tracker.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { Map as MapboxMap, MapSourceDataEvent } from 'mapbox-gl'; +import type { Map as MapboxMap, MapSourceDataEvent } from '@kbn/mapbox-gl'; import _ from 'lodash'; import { ILayer } from '../../classes/layers/layer'; import { SPATIAL_FILTERS_LAYER_ID } from '../../../common/constants'; diff --git a/x-pack/plugins/maps/public/connected_components/mb_map/tooltip_control/tooltip_control.test.tsx b/x-pack/plugins/maps/public/connected_components/mb_map/tooltip_control/tooltip_control.test.tsx index 451150fabb064c..ac6e3cfcccf4e6 100644 --- a/x-pack/plugins/maps/public/connected_components/mb_map/tooltip_control/tooltip_control.test.tsx +++ b/x-pack/plugins/maps/public/connected_components/mb_map/tooltip_control/tooltip_control.test.tsx @@ -14,7 +14,7 @@ jest.mock('./tooltip_popover', () => ({ import sinon from 'sinon'; import React from 'react'; import { mount, shallow } from 'enzyme'; -import { Map as MbMap, MapMouseEvent, MapboxGeoJSONFeature } from 'mapbox-gl'; +import type { Map as MbMap, MapMouseEvent, MapboxGeoJSONFeature } from '@kbn/mapbox-gl'; import { TooltipControl } from './tooltip_control'; import { IVectorLayer } from '../../../classes/layers/vector_layer'; diff --git a/x-pack/plugins/maps/public/connected_components/mb_map/tooltip_control/tooltip_control.tsx b/x-pack/plugins/maps/public/connected_components/mb_map/tooltip_control/tooltip_control.tsx index e8c3a46430cb93..09dd9ee4f51d90 100644 --- a/x-pack/plugins/maps/public/connected_components/mb_map/tooltip_control/tooltip_control.tsx +++ b/x-pack/plugins/maps/public/connected_components/mb_map/tooltip_control/tooltip_control.tsx @@ -14,7 +14,7 @@ import { MapboxGeoJSONFeature, MapMouseEvent, Point as MbPoint, -} from 'mapbox-gl'; +} from '@kbn/mapbox-gl'; import uuid from 'uuid/v4'; import { Geometry } from 'geojson'; import { Filter } from 'src/plugins/data/public'; diff --git a/x-pack/plugins/maps/public/connected_components/mb_map/tooltip_control/tooltip_popover.test.tsx b/x-pack/plugins/maps/public/connected_components/mb_map/tooltip_control/tooltip_popover.test.tsx index 22223df3660116..002ec09e68c2fc 100644 --- a/x-pack/plugins/maps/public/connected_components/mb_map/tooltip_control/tooltip_popover.test.tsx +++ b/x-pack/plugins/maps/public/connected_components/mb_map/tooltip_control/tooltip_popover.test.tsx @@ -14,7 +14,7 @@ jest.mock('./features_tooltip/features_tooltip', () => ({ import sinon from 'sinon'; import React from 'react'; import { mount, shallow } from 'enzyme'; -import { Map as MbMap } from 'mapbox-gl'; +import type { Map as MbMap } from '@kbn/mapbox-gl'; import { TooltipPopover } from './tooltip_popover'; // mutable map state diff --git a/x-pack/plugins/maps/public/connected_components/mb_map/tooltip_control/tooltip_popover.tsx b/x-pack/plugins/maps/public/connected_components/mb_map/tooltip_control/tooltip_popover.tsx index a3fcc0ea6a07a6..0b7ba3468d30ce 100644 --- a/x-pack/plugins/maps/public/connected_components/mb_map/tooltip_control/tooltip_popover.tsx +++ b/x-pack/plugins/maps/public/connected_components/mb_map/tooltip_control/tooltip_popover.tsx @@ -7,7 +7,7 @@ import React, { Component, RefObject } from 'react'; import { EuiPopover, EuiText } from '@elastic/eui'; -import { Map as MbMap } from 'mapbox-gl'; +import type { Map as MbMap } from '@kbn/mapbox-gl'; import { GeoJsonProperties, Geometry } from 'geojson'; import { Filter } from 'src/plugins/data/public'; import { ActionExecutionContext, Action } from 'src/plugins/ui_actions/public'; diff --git a/yarn.lock b/yarn.lock index 9f7db552a3f53c..24f80c7dcb7b52 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2854,32 +2854,32 @@ resolved "https://registry.yarnpkg.com/@mapbox/extent/-/extent-0.4.0.tgz#3e591f32e1f0c3981c864239f7b0ac06e610f8a9" integrity sha1-PlkfMuHww5gchkI597CsBuYQ+Kk= -"@mapbox/geojson-area@^0.2.1": +"@mapbox/geojson-area@^0.2.2": version "0.2.2" resolved "https://registry.yarnpkg.com/@mapbox/geojson-area/-/geojson-area-0.2.2.tgz#18d7814aa36bf23fbbcc379f8e26a22927debf10" integrity sha1-GNeBSqNr8j+7zDefjiaiKSfevxA= dependencies: wgs84 "0.0.0" -"@mapbox/geojson-coords@0.0.0": - version "0.0.0" - resolved "https://registry.yarnpkg.com/@mapbox/geojson-coords/-/geojson-coords-0.0.0.tgz#4847a5b96059666e527a2139e75e35d84fd58f50" - integrity sha1-SEeluWBZZm5SeiE551412E/Vj1A= +"@mapbox/geojson-coords@0.0.1": + version "0.0.1" + resolved "https://registry.yarnpkg.com/@mapbox/geojson-coords/-/geojson-coords-0.0.1.tgz#31338ac5bc7b2e663409fb129643257ce715594f" + integrity sha512-cdMlqmDl1vzAl2E0XC2zIuqM74vdet0Dq2el49haJEVbGpC8se40j5UcsnBK/gsvZzrume30fon1u/aSYMXG4Q== dependencies: "@mapbox/geojson-normalize" "0.0.1" - geojson-flatten "~0.2.1" + geojson-flatten "^1.0.4" -"@mapbox/geojson-extent@^0.3.2": - version "0.3.2" - resolved "https://registry.yarnpkg.com/@mapbox/geojson-extent/-/geojson-extent-0.3.2.tgz#a1bdb2015afd0e031c18c3f29f7eb229e4e1950f" - integrity sha1-ob2yAVr9DgMcGMPyn36yKeThlQ8= +"@mapbox/geojson-extent@^1.0.0": + version "1.0.0" + resolved "https://registry.yarnpkg.com/@mapbox/geojson-extent/-/geojson-extent-1.0.0.tgz#cc1db1ca5f28e7a3a2d71dcfc86c9ef3486e1558" + integrity sha512-OWW/Tw7OkKHoogXjQJNILjLd2d4JZzO/elc5Qr08VNwFSIPpSnJgyaEGO2xRPqNuWDLr4RocuqmC0FcQWPgeOA== dependencies: "@mapbox/extent" "0.4.0" - "@mapbox/geojson-coords" "0.0.0" + "@mapbox/geojson-coords" "0.0.1" rw "~0.1.4" traverse "~0.6.6" -"@mapbox/geojson-normalize@0.0.1": +"@mapbox/geojson-normalize@0.0.1", "@mapbox/geojson-normalize@^0.0.1": version "0.0.1" resolved "https://registry.yarnpkg.com/@mapbox/geojson-normalize/-/geojson-normalize-0.0.1.tgz#1da1e6b3a7add3ad29909b30f438f60581b7cd80" integrity sha1-HaHms6et060pkJsw9Dj2BYG3zYA= @@ -2897,17 +2897,6 @@ resolved "https://registry.yarnpkg.com/@mapbox/geojson-types/-/geojson-types-1.0.2.tgz#9aecf642cb00eab1080a57c4f949a65b4a5846d6" integrity sha512-e9EBqHHv3EORHrSfbR9DqecPNn+AmuAoQxV6aL8Xu30bJMJR1o8PZLZzpk1Wq7/NfCbuhmakHTPYRhoqLsXRnw== -"@mapbox/geojsonhint@3.0.0": - version "3.0.0" - resolved "https://registry.yarnpkg.com/@mapbox/geojsonhint/-/geojsonhint-3.0.0.tgz#42448232ce4236cb89c1b69c36b0cadeac99e02e" - integrity sha512-zHcyh1rDHYnEBd6NvOWoeHLuvazlDkIjvz9MJx4cKwcKTlfrqgxVnTv1QLnVJnsSU5neJnhQJcgscR/Zl4uYgw== - dependencies: - concat-stream "^1.6.1" - jsonlint-lines "1.7.1" - minimist "1.2.0" - vfile "^4.0.0" - vfile-reporter "^5.1.1" - "@mapbox/hast-util-table-cell-style@^0.1.3": version "0.1.3" resolved "https://registry.yarnpkg.com/@mapbox/hast-util-table-cell-style/-/hast-util-table-cell-style-0.1.3.tgz#5b7166ae01297d72216932b245e4b2f0b642dca6" @@ -2920,22 +2909,20 @@ resolved "https://registry.yarnpkg.com/@mapbox/jsonlint-lines-primitives/-/jsonlint-lines-primitives-2.0.2.tgz#ce56e539f83552b58d10d672ea4d6fc9adc7b234" integrity sha1-zlblOfg1UrWNENZy6k1vya3HsjQ= -"@mapbox/mapbox-gl-draw@^1.2.0": - version "1.2.0" - resolved "https://registry.yarnpkg.com/@mapbox/mapbox-gl-draw/-/mapbox-gl-draw-1.2.0.tgz#b6e5278afef65bd5d7d92366034997768e478ad9" - integrity sha512-gMrP2zn8PzDtrs72FMJTPytCumX5vUn9R7IK38qBOVy9UfqbdWr56KYuNA/2X+jKn4FIOpmWf8CWkKpOaQkv7w== +"@mapbox/mapbox-gl-draw@1.3.0": + version "1.3.0" + resolved "https://registry.yarnpkg.com/@mapbox/mapbox-gl-draw/-/mapbox-gl-draw-1.3.0.tgz#7a30fb99488cb47a32c25e99c3c62413b04bbaed" + integrity sha512-B+KWK+dAgzLHMNyKVuuMRfjeSlQ77MhNLdfpQQpbp3pkhnrdmydDe3ixto1Ua78hktNut0WTrAaD8gYu4PVcjA== dependencies: - "@mapbox/geojson-area" "^0.2.1" - "@mapbox/geojson-extent" "^0.3.2" - "@mapbox/geojson-normalize" "0.0.1" - "@mapbox/geojsonhint" "3.0.0" - "@mapbox/point-geometry" "0.1.0" - eslint-plugin-import "^2.19.1" + "@mapbox/geojson-area" "^0.2.2" + "@mapbox/geojson-extent" "^1.0.0" + "@mapbox/geojson-normalize" "^0.0.1" + "@mapbox/point-geometry" "^0.1.0" hat "0.0.3" - lodash.isequal "^4.2.0" - xtend "^4.0.1" + lodash.isequal "^4.5.0" + xtend "^4.0.2" -"@mapbox/mapbox-gl-rtl-text@^0.2.3": +"@mapbox/mapbox-gl-rtl-text@0.2.3": version "0.2.3" resolved "https://registry.yarnpkg.com/@mapbox/mapbox-gl-rtl-text/-/mapbox-gl-rtl-text-0.2.3.tgz#a26ecfb3f0061456d93ee8570dd9587d226ea8bd" integrity sha512-RaCYfnxULUUUxNwcUimV9C/o2295ktTyLEUzD/+VWkqXqvaVfFcZ5slytGzb2Sd/Jj4MlbxD0DCZbfa6CzcmMw== @@ -5349,10 +5336,10 @@ resolved "https://registry.yarnpkg.com/@types/lru-cache/-/lru-cache-5.1.0.tgz#57f228f2b80c046b4a1bd5cac031f81f207f4f03" integrity sha512-RaE0B+14ToE4l6UqdarKPnXwVDuigfFv+5j9Dze/Nqr23yyuqdNvzcZi3xB+3Agvi5R4EOgAksfv3lXX4vBt9w== -"@types/mapbox-gl@^1.9.1": - version "1.9.1" - resolved "https://registry.yarnpkg.com/@types/mapbox-gl/-/mapbox-gl-1.9.1.tgz#78b62f8a1ead78bc525a4c1db84bb71fa0fcc579" - integrity sha512-5LS/fljbGjCPfjtOK5+pz8TT0PL4bBXTnN/PDbPtTQMqQdY/KWTWE4jRPuo0fL5wctd543DCptEUTydn+JK+gA== +"@types/mapbox-gl@1.13.1": + version "1.13.1" + resolved "https://registry.yarnpkg.com/@types/mapbox-gl/-/mapbox-gl-1.13.1.tgz#bd8108f912f32c895117e2970b6d4fbbecbe42a1" + integrity sha512-Yqv1eFAzG2gdecc94higNC8KE+BR6t8QhFgbQGGEpKr3OgSVVtr2qaBNBPaGlIAtCoKDF6JGB2haOhvijYC4Bg== dependencies: "@types/geojson" "*" @@ -6470,11 +6457,6 @@ JSONStream@1.3.5, JSONStream@^1.0.3: jsonparse "^1.2.0" through ">=2.2.7 <3" -"JSV@>= 4.0.x": - version "4.0.2" - resolved "https://registry.yarnpkg.com/JSV/-/JSV-4.0.2.tgz#d077f6825571f82132f9dffaed587b4029feff57" - integrity sha1-0Hf2glVx+CEy+d/67Vh7QCn+/1c= - abab@^2.0.0, abab@^2.0.3, abab@^2.0.4: version "2.0.5" resolved "https://registry.yarnpkg.com/abab/-/abab-2.0.5.tgz#c0b678fb32d60fc1219c784d6a826fe385aeb79a" @@ -6871,11 +6853,6 @@ ansi-styles@^4.0.0, ansi-styles@^4.1.0: "@types/color-name" "^1.1.1" color-convert "^2.0.1" -ansi-styles@~1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-1.0.0.tgz#cb102df1c56f5123eab8b67cd7b98027a0279178" - integrity sha1-yxAt8cVvUSPquLZ817mAJ6AnkXg= - ansi-to-html@^0.6.11: version "0.6.13" resolved "https://registry.yarnpkg.com/ansi-to-html/-/ansi-to-html-0.6.13.tgz#c72eae8b63e5ca0643aab11bfc6e6f2217425833" @@ -9141,15 +9118,6 @@ chalk@^4.0.0, chalk@^4.1.0, chalk@~4.1.0: 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" - integrity sha1-UZmj3c0MHv4jvAjBsCewYXbgxk8= - dependencies: - ansi-styles "~1.0.0" - has-color "~0.1.0" - strip-ansi "~0.1.0" - chalk@~0.5.1: version "0.5.1" resolved "https://registry.yarnpkg.com/chalk/-/chalk-0.5.1.tgz#663b3a648b68b55d04690d49167aa837858f2174" @@ -12649,7 +12617,7 @@ eslint-formatter-pretty@^4.0.0: string-width "^4.2.0" supports-hyperlinks "^2.0.0" -eslint-import-resolver-node@0.3.2, eslint-import-resolver-node@^0.3.2: +eslint-import-resolver-node@0.3.2: version "0.3.2" resolved "https://registry.yarnpkg.com/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.2.tgz#58f15fb839b8d0576ca980413476aab2472db66a" integrity sha512-sfmTqJfPSizWu4aymbPr4Iidp5yKm8yDkHp+Ir3YiTHiiDfxh69mOUsmiqW6RZ9zRXFaF64GtYmN7e+8GHBv6Q== @@ -12681,7 +12649,7 @@ eslint-import-resolver-webpack@0.11.1: resolve "^1.10.0" semver "^5.3.0" -eslint-module-utils@2.5.0, eslint-module-utils@^2.4.1: +eslint-module-utils@2.5.0: version "2.5.0" resolved "https://registry.yarnpkg.com/eslint-module-utils/-/eslint-module-utils-2.5.0.tgz#cdf0b40d623032274ccd2abd7e64c4e524d6e19c" integrity sha512-kCo8pZaNz2dsAW7nCUjuVoI11EBXXpIzfNxmaoLhXoRDOnqXLC4iSGVRdZPhOitfbdEfMEfKOiENaK6wDPZEGw== @@ -12734,24 +12702,6 @@ eslint-plugin-eslint-comments@^3.2.0: escape-string-regexp "^1.0.5" ignore "^5.0.5" -eslint-plugin-import@^2.19.1: - version "2.19.1" - resolved "https://registry.yarnpkg.com/eslint-plugin-import/-/eslint-plugin-import-2.19.1.tgz#5654e10b7839d064dd0d46cd1b88ec2133a11448" - integrity sha512-x68131aKoCZlCae7rDXKSAQmbT5DQuManyXo2sK6fJJ0aK5CWAkv6A6HJZGgqC8IhjQxYPgo6/IY4Oz8AFsbBw== - dependencies: - array-includes "^3.0.3" - array.prototype.flat "^1.2.1" - contains-path "^0.1.0" - debug "^2.6.9" - doctrine "1.5.0" - eslint-import-resolver-node "^0.3.2" - eslint-module-utils "^2.4.1" - has "^1.0.3" - minimatch "^3.0.4" - object.values "^1.1.0" - read-pkg-up "^2.0.0" - resolve "^1.12.0" - eslint-plugin-import@^2.22.1: version "2.22.1" resolved "https://registry.yarnpkg.com/eslint-plugin-import/-/eslint-plugin-import-2.22.1.tgz#0896c7e6a0cf44109a2d97b95903c2bb689d7702" @@ -14232,13 +14182,13 @@ gensync@^1.0.0-beta.1: resolved "https://registry.yarnpkg.com/gensync/-/gensync-1.0.0-beta.1.tgz#58f4361ff987e5ff6e1e7a210827aa371eaac269" integrity sha512-r8EC6NO1sngH/zdD9fiRDLdcgnbayXah+mLgManTaIZJqEC1MZstmnox8KpnI2/fxQwrp5OpCOYWLp4rBl4Jcg== -geojson-flatten@~0.2.1: - version "0.2.4" - resolved "https://registry.yarnpkg.com/geojson-flatten/-/geojson-flatten-0.2.4.tgz#8f3396f31a0f5b747e39c9e6a14088f43ba4ecfb" - integrity sha512-LiX6Jmot8adiIdZ/fthbcKKPOfWjTQchX/ggHnwMZ2e4b0I243N1ANUos0LvnzepTEsj0+D4fIJ5bKhBrWnAHA== +geojson-flatten@^1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/geojson-flatten/-/geojson-flatten-1.0.4.tgz#cdfef2e9042996fcaa14fe658db6d88c99c20930" + integrity sha512-PpscUXxO6dvvhZxtwuqiI5v+1C/IQYPJRMWoQeaF2oohJgfGYSHKVAe8L+yUqF34PH/hmq9JlwmO+juPw+95/Q== dependencies: - get-stdin "^6.0.0" - minimist "1.2.0" + get-stdin "^7.0.0" + minimist "^1.2.5" geojson-vt@^3.2.1: version "3.2.1" @@ -14311,6 +14261,11 @@ get-stdin@^6.0.0: resolved "https://registry.yarnpkg.com/get-stdin/-/get-stdin-6.0.0.tgz#9e09bf712b360ab9225e812048f71fde9c89657b" integrity sha512-jp4tHawyV7+fkkSKyvjuLZswblUtz+SQKzSWnBbii16BuZksJlU1wuBYXY75r+duh/llF1ur6oNwi+2ZzjKZ7g== +get-stdin@^7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/get-stdin/-/get-stdin-7.0.0.tgz#8d5de98f15171a125c5e516643c7a6d0ea8a96f6" + integrity sha512-zRKcywvrXlXsA0v0i9Io4KDRaAw7+a1ZpjRwl9Wox8PFlVCCHra7E9c4kqXCoCM9nR5tBkaTTZRBoCm60bFqTQ== + get-stdin@^8.0.0: version "8.0.0" resolved "https://registry.yarnpkg.com/get-stdin/-/get-stdin-8.0.0.tgz#cbad6a73feb75f6eeb22ba9e01f89aa28aa97a53" @@ -15056,11 +15011,6 @@ has-bigints@^1.0.1: resolved "https://registry.yarnpkg.com/has-bigints/-/has-bigints-1.0.1.tgz#64fe6acb020673e3b78db035a5af69aa9d07b113" integrity sha512-LSBS2LjbNBTf6287JEbEzvJgftkF5qFkmCo9hDRpAzKhUOlJ+hx8dd4USs00SgsUNwc4617J9ki5YtEClM2ffA== -has-color@~0.1.0: - version "0.1.7" - resolved "https://registry.yarnpkg.com/has-color/-/has-color-0.1.7.tgz#67144a5260c34fc3cca677d041daf52fe7b78b2f" - integrity sha1-ZxRKUmDDT8PMpnfQQdr1L+e3iy8= - has-flag@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-2.0.0.tgz#e8207af1cc7b30d446cc70b734b5e8be18f88d51" @@ -17749,14 +17699,6 @@ jsonify@~0.0.0: resolved "https://registry.yarnpkg.com/jsonify/-/jsonify-0.0.0.tgz#2c74b6ee41d93ca51b7b5aaee8f503631d252a73" integrity sha1-LHS27kHZPKUbe1qu6PUDYx0lKnM= -jsonlint-lines@1.7.1: - version "1.7.1" - resolved "https://registry.yarnpkg.com/jsonlint-lines/-/jsonlint-lines-1.7.1.tgz#507de680d3fb8c4be1641cc57d6f679f29f178ff" - integrity sha1-UH3mgNP7jEvhZBzFfW9nnynxeP8= - dependencies: - JSV ">= 4.0.x" - nomnom ">= 1.5.x" - jsonparse@^1.2.0: version "1.3.1" resolved "https://registry.yarnpkg.com/jsonparse/-/jsonparse-1.3.1.tgz#3f4dae4a91fac315f71062f8521cc239f1366280" @@ -18452,7 +18394,7 @@ lodash.isempty@^4.4.0: resolved "https://registry.yarnpkg.com/lodash.isempty/-/lodash.isempty-4.4.0.tgz#6f86cbedd8be4ec987be9aaf33c9684db1b31e7e" integrity sha1-b4bL7di+TsmHvpqvM8loTbGzHn4= -lodash.isequal@^4.0.0, lodash.isequal@^4.1.1, lodash.isequal@^4.2.0, lodash.isequal@^4.5.0: +lodash.isequal@^4.0.0, lodash.isequal@^4.1.1, lodash.isequal@^4.5.0: version "4.5.0" resolved "https://registry.yarnpkg.com/lodash.isequal/-/lodash.isequal-4.5.0.tgz#415c4478f2bcc30120c22ce10ed3226f7d3e18e0" integrity sha1-QVxEePK8wwEgwizhDtMib30+GOA= @@ -18815,7 +18757,7 @@ map-visit@^1.0.0: dependencies: object-visit "^1.0.0" -mapbox-gl-draw-rectangle-mode@^1.0.4: +mapbox-gl-draw-rectangle-mode@1.0.4: version "1.0.4" resolved "https://registry.yarnpkg.com/mapbox-gl-draw-rectangle-mode/-/mapbox-gl-draw-rectangle-mode-1.0.4.tgz#42987d68872a5fb5cc5d76d3375ee20cd8bab8f7" integrity sha512-BdF6nwEK2p8n9LQoMPzBO8LhddW1fe+d5vK8HQIei+4VcRnUbKNsEj7Z15FsJxCHzsc2BQKXbESx5GaE8x0imQ== @@ -19367,7 +19309,7 @@ minimist-options@4.1.0, minimist-options@^4.0.2: is-plain-obj "^1.1.0" kind-of "^6.0.3" -minimist@0.0.8, minimist@1.2.0, minimist@^1.1.0, minimist@^1.1.1, minimist@^1.1.3, minimist@^1.2.0, minimist@^1.2.5, minimist@~1.2.0: +minimist@0.0.8, minimist@^1.1.0, minimist@^1.1.1, minimist@^1.1.3, minimist@^1.2.0, minimist@^1.2.5, minimist@~1.2.0: version "1.2.5" resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.5.tgz#67d66014b66a6a8aaa0c083c5fd58df4e4e97602" integrity sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw== @@ -20214,14 +20156,6 @@ nodemon@^2.0.4: undefsafe "^2.0.3" update-notifier "^4.1.0" -"nomnom@>= 1.5.x": - version "1.8.1" - resolved "https://registry.yarnpkg.com/nomnom/-/nomnom-1.8.1.tgz#2151f722472ba79e50a76fc125bb8c8f2e4dc2a7" - integrity sha1-IVH3Ikcrp55Qp2/BJbuMjy5Nwqc= - dependencies: - chalk "~0.4.0" - underscore "~1.6.0" - "nopt@2 || 3", nopt@~3.0.6: version "3.0.6" resolved "https://registry.yarnpkg.com/nopt/-/nopt-3.0.6.tgz#c6465dbf08abcd4db359317f79ac68a646b28ff9" @@ -24097,7 +24031,7 @@ repeat-element@^1.1.2: resolved "https://registry.yarnpkg.com/repeat-element/-/repeat-element-1.1.2.tgz#ef089a178d1483baae4d93eb98b4f9e4e11d990a" integrity sha1-7wiaF40Ug7quTZPrmLT55OEdmQo= -repeat-string@^1.0.0, repeat-string@^1.5.0, repeat-string@^1.5.2, repeat-string@^1.5.4, repeat-string@^1.6.1: +repeat-string@^1.0.0, repeat-string@^1.5.2, repeat-string@^1.5.4, repeat-string@^1.6.1: version "1.6.1" resolved "https://registry.yarnpkg.com/repeat-string/-/repeat-string-1.6.1.tgz#8dcae470e1c88abc2d600fff4a776286da75e637" integrity sha1-jcrkcOHIirwtYA//Sndihtp15jc= @@ -25879,7 +25813,7 @@ string-width@^1.0.1, string-width@^1.0.2: is-fullwidth-code-point "^1.0.0" strip-ansi "^3.0.0" -"string-width@^1.0.2 || 2", string-width@^2.0.0, string-width@^2.1.1: +"string-width@^1.0.2 || 2", string-width@^2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/string-width/-/string-width-2.1.1.tgz#ab93f27a8dc13d28cac815c462143a6d9012ae9e" integrity sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw== @@ -26027,11 +25961,6 @@ strip-ansi@^4.0.0: dependencies: ansi-regex "^3.0.0" -strip-ansi@~0.1.0: - version "0.1.1" - resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-0.1.1.tgz#39e8a98d044d150660abe4a6808acf70bb7bc991" - integrity sha1-OeipjQRNFQZgq+SmgIrPcLt7yZE= - strip-bom-string@1.X: version "1.0.0" resolved "https://registry.yarnpkg.com/strip-bom-string/-/strip-bom-string-1.0.0.tgz#e5211e9224369fbb81d633a2f00044dc8cedad92" @@ -27486,7 +27415,7 @@ underscore.string@~3.3.5: sprintf-js "^1.0.3" util-deprecate "^1.0.2" -underscore@^1.13.1, underscore@^1.8.3, underscore@~1.6.0: +underscore@^1.13.1, underscore@^1.8.3: version "1.13.1" resolved "https://registry.yarnpkg.com/underscore/-/underscore-1.13.1.tgz#0c1c6bd2df54b6b69f2314066d65b6cde6fcf9d1" integrity sha512-hzSoAVtJF+3ZtiFX0VgfFPHEDRm7Y/QPjGyNo4TVdnDTdft3tr8hEkD25a1jC+TjTuE7tkHGKkhwCgs9dgBB2g== @@ -28618,28 +28547,6 @@ vfile-message@^1.0.0: dependencies: unist-util-stringify-position "^1.1.1" -vfile-reporter@^5.1.1: - version "5.1.1" - resolved "https://registry.yarnpkg.com/vfile-reporter/-/vfile-reporter-5.1.1.tgz#419688c7e9dcaf65ba81bfdb0ad443e9e0248e09" - integrity sha512-A/cfKvfVmeEmAKx1yyOWggCjC/k184Vkl5pVJAw5CEdppHd5FHBVcdyJ1JBSqIdJjJqyhZY4ZD3JycHr/uwmlA== - dependencies: - repeat-string "^1.5.0" - string-width "^2.0.0" - supports-color "^5.4.0" - unist-util-stringify-position "^1.0.0" - vfile-sort "^2.1.2" - vfile-statistics "^1.1.0" - -vfile-sort@^2.1.2: - version "2.2.0" - resolved "https://registry.yarnpkg.com/vfile-sort/-/vfile-sort-2.2.0.tgz#383a8727ec4c5daf37c05683684a5eb686366d39" - integrity sha512-RgxLXVWrJBWb2GuP8FsSkqK7HmbjXjnI8qx3nD6NTWhsWaelaKvJuxfh1F1d1lkCPD7imo4zzi8cf6IOMgaTnQ== - -vfile-statistics@^1.1.0: - version "1.1.2" - resolved "https://registry.yarnpkg.com/vfile-statistics/-/vfile-statistics-1.1.2.tgz#c50132627e4669a3afa07c64ff1e7aa7695e8151" - integrity sha512-16wAC9eEGXdsD35LX9m/iXCRIZyX5LIrDgDtAF92rbATSqsBRbC4n05e0Rj5vt3XRpcKu0UJeWnTxWsSyvNZ+w== - vfile@^2.0.0: version "2.3.0" resolved "https://registry.yarnpkg.com/vfile/-/vfile-2.3.0.tgz#e62d8e72b20e83c324bc6c67278ee272488bf84a" From 83e5b6c689a221fa92db1bbd1d71e7c8f19dd627 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alejandro=20Fern=C3=A1ndez=20G=C3=B3mez?= Date: Thu, 27 May 2021 11:30:15 +0200 Subject: [PATCH 15/16] [Fleet] Remove beats management plugin (#99789) --- .github/CODEOWNERS | 3 - api_docs/alerting.json | 22 +- api_docs/beats_management.json | 72 - api_docs/beats_management.mdx | 21 - api_docs/core.json | 338 ++- api_docs/core_application.json | 388 ++- api_docs/core_chrome.json | 144 +- api_docs/data.json | 2444 ++++++++--------- api_docs/data_index_patterns.json | 1730 ++++++------ api_docs/data_search.json | 81 +- api_docs/deprecations.mdx | 136 +- api_docs/features.json | 14 - api_docs/fleet.json | 24 +- api_docs/home.json | 14 +- api_docs/kibana_utils.json | 4 +- api_docs/licensing.json | 411 ++- api_docs/lists.json | 1359 +-------- api_docs/lists.mdx | 14 - api_docs/management.json | 53 +- api_docs/ml.json | 2 +- api_docs/saved_objects.json | 48 +- api_docs/security.json | 49 +- api_docs/spaces.json | 28 +- docs/developer/plugin-list.asciidoc | 5 - docs/management/managing-beats.asciidoc | 108 - docs/user/management.asciidoc | 6 - packages/kbn-optimizer/limits.yml | 1 - tsconfig.json | 1 - tsconfig.refs.json | 1 - x-pack/.i18nrc.json | 1 - .../beats_management/common/config_schemas.ts | 384 --- .../common/config_schemas_translations_map.ts | 243 -- .../common/constants/configuration_blocks.ts | 8 - .../common/constants/index.ts | 13 - .../common/constants/index_names.ts | 16 - .../common/constants/plugin.ts | 12 - .../common/constants/security.ts | 18 - .../common/constants/table.ts | 13 - .../beats_management/common/domain_types.ts | 136 - .../plugins/beats_management/common/index.ts | 23 - .../beats_management/common/io_ts_types.ts | 34 - .../beats_management/common/return_types.ts | 106 - .../plugins/beats_management/jest.config.js | 12 - x-pack/plugins/beats_management/kibana.json | 16 - .../beats_management/public/application.tsx | 89 - .../beats_management/public/bootstrap.tsx | 69 - .../components/autocomplete_field/index.tsx | 290 -- .../autocomplete_field/suggestion_item.tsx | 119 - .../public/components/config_list.tsx | 117 - .../public/components/enroll_beats.tsx | 292 -- .../public/components/inputs/code_editor.tsx | 114 - .../public/components/inputs/index.ts | 12 - .../public/components/inputs/input.tsx | 120 - .../public/components/inputs/multi_input.tsx | 122 - .../components/inputs/password_input.tsx | 114 - .../public/components/inputs/select.tsx | 125 - .../public/components/layouts/background.tsx | 12 - .../public/components/layouts/no_data.tsx | 31 - .../public/components/layouts/primary.tsx | 84 - .../public/components/layouts/walkthrough.tsx | 49 - .../public/components/loading.tsx | 17 - .../navigation/breadcrumb/breadcrumb.tsx | 64 - .../navigation/breadcrumb/consumer.tsx | 8 - .../navigation/breadcrumb/context.tsx | 19 - .../components/navigation/breadcrumb/index.ts | 10 - .../navigation/breadcrumb/provider.tsx | 73 - .../navigation/breadcrumb/types.d.ts | 16 - .../components/navigation/child_routes.tsx | 40 - .../components/navigation/connected_link.tsx | 46 - .../public/components/table/action_schema.ts | 101 - .../table/controls/action_control.tsx | 97 - .../public/components/table/controls/index.ts | 8 - .../table/controls/option_control.tsx | 58 - .../table/controls/tag_badge_list.tsx | 110 - .../public/components/table/index.ts | 16 - .../public/components/table/table.tsx | 160 -- .../components/table/table_type_configs.tsx | 345 --- .../tag/config_view/config_form.tsx | 216 -- .../components/tag/config_view/index.tsx | 189 -- .../public/components/tag/index.ts | 9 - .../public/components/tag/tag_badge.tsx | 48 - .../public/components/tag/tag_edit.tsx | 238 -- .../public/containers/beats.ts | 104 - .../public/containers/tags.ts | 54 - .../containers/with_kuery_autocompletion.tsx | 89 - .../public/containers/with_url_state.tsx | 101 - .../public/frontend_types.d.ts | 36 - .../plugins/beats_management/public/index.ts | 40 - .../beats_management/public/kbn_services.ts | 26 - .../lib/adapters/beats/adapter_types.ts | 38 - .../adapters/beats/memory_beats_adapter.ts | 109 - .../lib/adapters/beats/rest_beats_adapter.ts | 80 - .../configuration_blocks/adapter_types.ts | 15 - .../memory_config_blocks_adapter.ts | 42 - .../rest_config_blocks_adapter.ts | 36 - .../adapters/elasticsearch/adapter_types.ts | 14 - .../lib/adapters/elasticsearch/memory.ts | 27 - .../public/lib/adapters/elasticsearch/rest.ts | 66 - .../lib/adapters/framework/adapter_types.ts | 54 - .../framework/kibana_framework_adapter.ts | 160 -- .../framework/testing_framework_adapter.ts | 46 - .../lib/adapters/rest_api/adapter_types.ts | 15 - .../rest_api/axios_rest_api_adapter.ts | 79 - .../rest_api/node_axios_api_adapter.ts | 93 - .../public/lib/adapters/tags/adapter_types.ts | 16 - .../lib/adapters/tags/memory_tags_adapter.ts | 44 - .../lib/adapters/tags/rest_tags_adapter.ts | 66 - .../lib/adapters/tokens/adapter_types.ts | 10 - .../adapters/tokens/memory_tokens_adapter.ts | 14 - .../adapters/tokens/rest_tokens_adapter.ts | 23 - .../beats_management/public/lib/beats.ts | 66 - .../public/lib/compose/kibana.ts | 81 - .../public/lib/compose/scripts.ts | 79 - .../public/lib/config_blocks.test.ts | 149 - .../public/lib/configuration_blocks.ts | 123 - .../public/lib/elasticsearch.ts | 70 - .../beats_management/public/lib/framework.ts | 61 - .../beats_management/public/lib/tags.ts | 48 - .../beats_management/public/lib/types.ts | 60 - .../beats_management/public/pages/__404.tsx | 22 - .../public/pages/beat/details.tsx | 201 -- .../public/pages/beat/index.tsx | 201 -- .../public/pages/beat/tags.tsx | 76 - .../public/pages/error/enforce_security.tsx | 27 - .../public/pages/error/invalid_license.tsx | 28 - .../public/pages/error/no_access.tsx | 29 - .../beats_management/public/pages/index.ts | 56 - .../pages/overview/configuration_tags.tsx | 118 - .../public/pages/overview/enrolled_beats.tsx | 355 --- .../public/pages/overview/index.tsx | 110 - .../public/pages/tag/create.tsx | 160 -- .../public/pages/tag/edit.tsx | 203 -- .../public/pages/walkthrough/initial/beat.tsx | 65 - .../pages/walkthrough/initial/finish.tsx | 136 - .../pages/walkthrough/initial/index.tsx | 97 - .../public/pages/walkthrough/initial/tag.tsx | 137 - .../beats_management/public/router.tsx | 132 - .../public/utils/random_eui_color.ts | 26 - .../public/utils/typed_react.ts | 21 - x-pack/plugins/beats_management/readme.md | 39 - .../beats_management/scripts/enroll.js | 42 - .../beats_management/scripts/fake_env.ts | 158 -- .../plugins/beats_management/server/index.ts | 22 - .../index_templates/beats_template.json | 137 - .../index_templates/events_template.json | 45 - .../server/index_templates/index.ts | 11 - .../lib/adapters/beats/adapter_types.ts | 46 - .../beats/elasticsearch_beats_adapter.ts | 245 -- .../configuration_blocks/adapter_types.ts | 28 - ...asticsearch_configuration_block_adapter.ts | 168 -- .../lib/adapters/database/adapter_types.ts | 302 -- .../database/kibana_database_adapter.ts | 118 - .../lib/adapters/framework/adapter_types.ts | 115 - .../framework/kibana_framework_adapter.ts | 116 - .../server/lib/adapters/tags/adapter_types.ts | 17 - .../tags/elasticsearch_tags_adapter.ts | 180 -- .../lib/adapters/tokens/adapter_types.ts | 19 - .../tokens/elasticsearch_tokens_adapter.ts | 76 - .../server/lib/beat_events.ts | 59 - .../beats_management/server/lib/beats.ts | 260 -- .../server/lib/compose/kibana.ts | 85 - .../server/lib/configuration_blocks.ts | 77 - .../beats_management/server/lib/framework.ts | 54 - .../beats_management/server/lib/tags.ts | 62 - .../beats_management/server/lib/tokens.ts | 144 - .../beats_management/server/lib/types.ts | 61 - .../plugins/beats_management/server/plugin.ts | 89 - .../server/routes/beats/configuration.ts | 83 - .../server/routes/beats/enroll.ts | 90 - .../server/routes/beats/events.ts | 67 - .../server/routes/beats/get.ts | 60 - .../server/routes/beats/index.ts | 15 - .../server/routes/beats/list.ts | 70 - .../server/routes/beats/tag_assignment.ts | 69 - .../server/routes/beats/tag_removal.ts | 67 - .../server/routes/beats/update.ts | 105 - .../server/routes/configurations/delete.ts | 48 - .../server/routes/configurations/get.ts | 53 - .../server/routes/configurations/index.ts | 10 - .../server/routes/configurations/upsert.ts | 73 - .../beats_management/server/routes/index.ts | 55 - .../server/routes/tags/assignable.ts | 51 - .../server/routes/tags/delete.ts | 48 - .../server/routes/tags/get.ts | 46 - .../server/routes/tags/index.ts | 12 - .../server/routes/tags/list.ts | 53 - .../server/routes/tags/set.ts | 63 - .../server/routes/tokens/create.ts | 58 - .../server/routes/tokens/index.ts | 8 - .../server/routes/wrap_route_with_security.ts | 70 - x-pack/plugins/beats_management/tsconfig.json | 26 - .../beats_management/types/formsy.d.ts | 49 - .../translations/translations/ja-JP.json | 179 -- .../translations/translations/zh-CN.json | 183 -- .../apis/beats/assign_tags_to_beats.js | 254 -- .../api_integration/apis/beats/constants.js | 8 - .../apis/beats/create_enrollment_tokens.js | 88 - .../api_integration/apis/beats/enroll_beat.js | 184 -- .../api_integration/apis/beats/get_beat.js | 87 - .../test/api_integration/apis/beats/index.js | 31 - .../api_integration/apis/beats/list_beats.js | 39 - .../apis/beats/remove_tags_from_beats.js | 218 -- .../api_integration/apis/beats/set_config.js | 246 -- .../api_integration/apis/beats/set_tag.js | 67 - .../api_integration/apis/beats/update_beat.js | 122 - x-pack/test/api_integration/apis/index.ts | 1 - x-pack/test/tsconfig.json | 1 - 207 files changed, 2938 insertions(+), 19531 deletions(-) delete mode 100644 api_docs/beats_management.json delete mode 100644 api_docs/beats_management.mdx delete mode 100644 docs/management/managing-beats.asciidoc delete mode 100644 x-pack/plugins/beats_management/common/config_schemas.ts delete mode 100644 x-pack/plugins/beats_management/common/config_schemas_translations_map.ts delete mode 100644 x-pack/plugins/beats_management/common/constants/configuration_blocks.ts delete mode 100644 x-pack/plugins/beats_management/common/constants/index.ts delete mode 100644 x-pack/plugins/beats_management/common/constants/index_names.ts delete mode 100644 x-pack/plugins/beats_management/common/constants/plugin.ts delete mode 100644 x-pack/plugins/beats_management/common/constants/security.ts delete mode 100644 x-pack/plugins/beats_management/common/constants/table.ts delete mode 100644 x-pack/plugins/beats_management/common/domain_types.ts delete mode 100644 x-pack/plugins/beats_management/common/index.ts delete mode 100644 x-pack/plugins/beats_management/common/io_ts_types.ts delete mode 100644 x-pack/plugins/beats_management/common/return_types.ts delete mode 100644 x-pack/plugins/beats_management/jest.config.js delete mode 100644 x-pack/plugins/beats_management/kibana.json delete mode 100644 x-pack/plugins/beats_management/public/application.tsx delete mode 100644 x-pack/plugins/beats_management/public/bootstrap.tsx delete mode 100644 x-pack/plugins/beats_management/public/components/autocomplete_field/index.tsx delete mode 100644 x-pack/plugins/beats_management/public/components/autocomplete_field/suggestion_item.tsx delete mode 100644 x-pack/plugins/beats_management/public/components/config_list.tsx delete mode 100644 x-pack/plugins/beats_management/public/components/enroll_beats.tsx delete mode 100644 x-pack/plugins/beats_management/public/components/inputs/code_editor.tsx delete mode 100644 x-pack/plugins/beats_management/public/components/inputs/index.ts delete mode 100644 x-pack/plugins/beats_management/public/components/inputs/input.tsx delete mode 100644 x-pack/plugins/beats_management/public/components/inputs/multi_input.tsx delete mode 100644 x-pack/plugins/beats_management/public/components/inputs/password_input.tsx delete mode 100644 x-pack/plugins/beats_management/public/components/inputs/select.tsx delete mode 100644 x-pack/plugins/beats_management/public/components/layouts/background.tsx delete mode 100644 x-pack/plugins/beats_management/public/components/layouts/no_data.tsx delete mode 100644 x-pack/plugins/beats_management/public/components/layouts/primary.tsx delete mode 100644 x-pack/plugins/beats_management/public/components/layouts/walkthrough.tsx delete mode 100644 x-pack/plugins/beats_management/public/components/loading.tsx delete mode 100644 x-pack/plugins/beats_management/public/components/navigation/breadcrumb/breadcrumb.tsx delete mode 100644 x-pack/plugins/beats_management/public/components/navigation/breadcrumb/consumer.tsx delete mode 100644 x-pack/plugins/beats_management/public/components/navigation/breadcrumb/context.tsx delete mode 100644 x-pack/plugins/beats_management/public/components/navigation/breadcrumb/index.ts delete mode 100644 x-pack/plugins/beats_management/public/components/navigation/breadcrumb/provider.tsx delete mode 100644 x-pack/plugins/beats_management/public/components/navigation/breadcrumb/types.d.ts delete mode 100644 x-pack/plugins/beats_management/public/components/navigation/child_routes.tsx delete mode 100644 x-pack/plugins/beats_management/public/components/navigation/connected_link.tsx delete mode 100644 x-pack/plugins/beats_management/public/components/table/action_schema.ts delete mode 100644 x-pack/plugins/beats_management/public/components/table/controls/action_control.tsx delete mode 100644 x-pack/plugins/beats_management/public/components/table/controls/index.ts delete mode 100644 x-pack/plugins/beats_management/public/components/table/controls/option_control.tsx delete mode 100644 x-pack/plugins/beats_management/public/components/table/controls/tag_badge_list.tsx delete mode 100644 x-pack/plugins/beats_management/public/components/table/index.ts delete mode 100644 x-pack/plugins/beats_management/public/components/table/table.tsx delete mode 100644 x-pack/plugins/beats_management/public/components/table/table_type_configs.tsx delete mode 100644 x-pack/plugins/beats_management/public/components/tag/config_view/config_form.tsx delete mode 100644 x-pack/plugins/beats_management/public/components/tag/config_view/index.tsx delete mode 100644 x-pack/plugins/beats_management/public/components/tag/index.ts delete mode 100644 x-pack/plugins/beats_management/public/components/tag/tag_badge.tsx delete mode 100644 x-pack/plugins/beats_management/public/components/tag/tag_edit.tsx delete mode 100644 x-pack/plugins/beats_management/public/containers/beats.ts delete mode 100644 x-pack/plugins/beats_management/public/containers/tags.ts delete mode 100644 x-pack/plugins/beats_management/public/containers/with_kuery_autocompletion.tsx delete mode 100644 x-pack/plugins/beats_management/public/containers/with_url_state.tsx delete mode 100644 x-pack/plugins/beats_management/public/frontend_types.d.ts delete mode 100644 x-pack/plugins/beats_management/public/index.ts delete mode 100644 x-pack/plugins/beats_management/public/kbn_services.ts delete mode 100644 x-pack/plugins/beats_management/public/lib/adapters/beats/adapter_types.ts delete mode 100644 x-pack/plugins/beats_management/public/lib/adapters/beats/memory_beats_adapter.ts delete mode 100644 x-pack/plugins/beats_management/public/lib/adapters/beats/rest_beats_adapter.ts delete mode 100644 x-pack/plugins/beats_management/public/lib/adapters/configuration_blocks/adapter_types.ts delete mode 100644 x-pack/plugins/beats_management/public/lib/adapters/configuration_blocks/memory_config_blocks_adapter.ts delete mode 100644 x-pack/plugins/beats_management/public/lib/adapters/configuration_blocks/rest_config_blocks_adapter.ts delete mode 100644 x-pack/plugins/beats_management/public/lib/adapters/elasticsearch/adapter_types.ts delete mode 100644 x-pack/plugins/beats_management/public/lib/adapters/elasticsearch/memory.ts delete mode 100644 x-pack/plugins/beats_management/public/lib/adapters/elasticsearch/rest.ts delete mode 100644 x-pack/plugins/beats_management/public/lib/adapters/framework/adapter_types.ts delete mode 100644 x-pack/plugins/beats_management/public/lib/adapters/framework/kibana_framework_adapter.ts delete mode 100644 x-pack/plugins/beats_management/public/lib/adapters/framework/testing_framework_adapter.ts delete mode 100644 x-pack/plugins/beats_management/public/lib/adapters/rest_api/adapter_types.ts delete mode 100644 x-pack/plugins/beats_management/public/lib/adapters/rest_api/axios_rest_api_adapter.ts delete mode 100644 x-pack/plugins/beats_management/public/lib/adapters/rest_api/node_axios_api_adapter.ts delete mode 100644 x-pack/plugins/beats_management/public/lib/adapters/tags/adapter_types.ts delete mode 100644 x-pack/plugins/beats_management/public/lib/adapters/tags/memory_tags_adapter.ts delete mode 100644 x-pack/plugins/beats_management/public/lib/adapters/tags/rest_tags_adapter.ts delete mode 100644 x-pack/plugins/beats_management/public/lib/adapters/tokens/adapter_types.ts delete mode 100644 x-pack/plugins/beats_management/public/lib/adapters/tokens/memory_tokens_adapter.ts delete mode 100644 x-pack/plugins/beats_management/public/lib/adapters/tokens/rest_tokens_adapter.ts delete mode 100644 x-pack/plugins/beats_management/public/lib/beats.ts delete mode 100644 x-pack/plugins/beats_management/public/lib/compose/kibana.ts delete mode 100644 x-pack/plugins/beats_management/public/lib/compose/scripts.ts delete mode 100644 x-pack/plugins/beats_management/public/lib/config_blocks.test.ts delete mode 100644 x-pack/plugins/beats_management/public/lib/configuration_blocks.ts delete mode 100644 x-pack/plugins/beats_management/public/lib/elasticsearch.ts delete mode 100644 x-pack/plugins/beats_management/public/lib/framework.ts delete mode 100644 x-pack/plugins/beats_management/public/lib/tags.ts delete mode 100644 x-pack/plugins/beats_management/public/lib/types.ts delete mode 100644 x-pack/plugins/beats_management/public/pages/__404.tsx delete mode 100644 x-pack/plugins/beats_management/public/pages/beat/details.tsx delete mode 100644 x-pack/plugins/beats_management/public/pages/beat/index.tsx delete mode 100644 x-pack/plugins/beats_management/public/pages/beat/tags.tsx delete mode 100644 x-pack/plugins/beats_management/public/pages/error/enforce_security.tsx delete mode 100644 x-pack/plugins/beats_management/public/pages/error/invalid_license.tsx delete mode 100644 x-pack/plugins/beats_management/public/pages/error/no_access.tsx delete mode 100644 x-pack/plugins/beats_management/public/pages/index.ts delete mode 100644 x-pack/plugins/beats_management/public/pages/overview/configuration_tags.tsx delete mode 100644 x-pack/plugins/beats_management/public/pages/overview/enrolled_beats.tsx delete mode 100644 x-pack/plugins/beats_management/public/pages/overview/index.tsx delete mode 100644 x-pack/plugins/beats_management/public/pages/tag/create.tsx delete mode 100644 x-pack/plugins/beats_management/public/pages/tag/edit.tsx delete mode 100644 x-pack/plugins/beats_management/public/pages/walkthrough/initial/beat.tsx delete mode 100644 x-pack/plugins/beats_management/public/pages/walkthrough/initial/finish.tsx delete mode 100644 x-pack/plugins/beats_management/public/pages/walkthrough/initial/index.tsx delete mode 100644 x-pack/plugins/beats_management/public/pages/walkthrough/initial/tag.tsx delete mode 100644 x-pack/plugins/beats_management/public/router.tsx delete mode 100644 x-pack/plugins/beats_management/public/utils/random_eui_color.ts delete mode 100644 x-pack/plugins/beats_management/public/utils/typed_react.ts delete mode 100644 x-pack/plugins/beats_management/readme.md delete mode 100644 x-pack/plugins/beats_management/scripts/enroll.js delete mode 100644 x-pack/plugins/beats_management/scripts/fake_env.ts delete mode 100644 x-pack/plugins/beats_management/server/index.ts delete mode 100644 x-pack/plugins/beats_management/server/index_templates/beats_template.json delete mode 100644 x-pack/plugins/beats_management/server/index_templates/events_template.json delete mode 100644 x-pack/plugins/beats_management/server/index_templates/index.ts delete mode 100644 x-pack/plugins/beats_management/server/lib/adapters/beats/adapter_types.ts delete mode 100644 x-pack/plugins/beats_management/server/lib/adapters/beats/elasticsearch_beats_adapter.ts delete mode 100644 x-pack/plugins/beats_management/server/lib/adapters/configuration_blocks/adapter_types.ts delete mode 100644 x-pack/plugins/beats_management/server/lib/adapters/configuration_blocks/elasticsearch_configuration_block_adapter.ts delete mode 100644 x-pack/plugins/beats_management/server/lib/adapters/database/adapter_types.ts delete mode 100644 x-pack/plugins/beats_management/server/lib/adapters/database/kibana_database_adapter.ts delete mode 100644 x-pack/plugins/beats_management/server/lib/adapters/framework/adapter_types.ts delete mode 100644 x-pack/plugins/beats_management/server/lib/adapters/framework/kibana_framework_adapter.ts delete mode 100644 x-pack/plugins/beats_management/server/lib/adapters/tags/adapter_types.ts delete mode 100644 x-pack/plugins/beats_management/server/lib/adapters/tags/elasticsearch_tags_adapter.ts delete mode 100644 x-pack/plugins/beats_management/server/lib/adapters/tokens/adapter_types.ts delete mode 100644 x-pack/plugins/beats_management/server/lib/adapters/tokens/elasticsearch_tokens_adapter.ts delete mode 100644 x-pack/plugins/beats_management/server/lib/beat_events.ts delete mode 100644 x-pack/plugins/beats_management/server/lib/beats.ts delete mode 100644 x-pack/plugins/beats_management/server/lib/compose/kibana.ts delete mode 100644 x-pack/plugins/beats_management/server/lib/configuration_blocks.ts delete mode 100644 x-pack/plugins/beats_management/server/lib/framework.ts delete mode 100644 x-pack/plugins/beats_management/server/lib/tags.ts delete mode 100644 x-pack/plugins/beats_management/server/lib/tokens.ts delete mode 100644 x-pack/plugins/beats_management/server/lib/types.ts delete mode 100644 x-pack/plugins/beats_management/server/plugin.ts delete mode 100644 x-pack/plugins/beats_management/server/routes/beats/configuration.ts delete mode 100644 x-pack/plugins/beats_management/server/routes/beats/enroll.ts delete mode 100644 x-pack/plugins/beats_management/server/routes/beats/events.ts delete mode 100644 x-pack/plugins/beats_management/server/routes/beats/get.ts delete mode 100644 x-pack/plugins/beats_management/server/routes/beats/index.ts delete mode 100644 x-pack/plugins/beats_management/server/routes/beats/list.ts delete mode 100644 x-pack/plugins/beats_management/server/routes/beats/tag_assignment.ts delete mode 100644 x-pack/plugins/beats_management/server/routes/beats/tag_removal.ts delete mode 100644 x-pack/plugins/beats_management/server/routes/beats/update.ts delete mode 100644 x-pack/plugins/beats_management/server/routes/configurations/delete.ts delete mode 100644 x-pack/plugins/beats_management/server/routes/configurations/get.ts delete mode 100644 x-pack/plugins/beats_management/server/routes/configurations/index.ts delete mode 100644 x-pack/plugins/beats_management/server/routes/configurations/upsert.ts delete mode 100644 x-pack/plugins/beats_management/server/routes/index.ts delete mode 100644 x-pack/plugins/beats_management/server/routes/tags/assignable.ts delete mode 100644 x-pack/plugins/beats_management/server/routes/tags/delete.ts delete mode 100644 x-pack/plugins/beats_management/server/routes/tags/get.ts delete mode 100644 x-pack/plugins/beats_management/server/routes/tags/index.ts delete mode 100644 x-pack/plugins/beats_management/server/routes/tags/list.ts delete mode 100644 x-pack/plugins/beats_management/server/routes/tags/set.ts delete mode 100644 x-pack/plugins/beats_management/server/routes/tokens/create.ts delete mode 100644 x-pack/plugins/beats_management/server/routes/tokens/index.ts delete mode 100644 x-pack/plugins/beats_management/server/routes/wrap_route_with_security.ts delete mode 100644 x-pack/plugins/beats_management/tsconfig.json delete mode 100644 x-pack/plugins/beats_management/types/formsy.d.ts delete mode 100644 x-pack/test/api_integration/apis/beats/assign_tags_to_beats.js delete mode 100644 x-pack/test/api_integration/apis/beats/constants.js delete mode 100644 x-pack/test/api_integration/apis/beats/create_enrollment_tokens.js delete mode 100644 x-pack/test/api_integration/apis/beats/enroll_beat.js delete mode 100644 x-pack/test/api_integration/apis/beats/get_beat.js delete mode 100644 x-pack/test/api_integration/apis/beats/index.js delete mode 100644 x-pack/test/api_integration/apis/beats/list_beats.js delete mode 100644 x-pack/test/api_integration/apis/beats/remove_tags_from_beats.js delete mode 100644 x-pack/test/api_integration/apis/beats/set_config.js delete mode 100644 x-pack/test/api_integration/apis/beats/set_tag.js delete mode 100644 x-pack/test/api_integration/apis/beats/update_beat.js diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 39daa5780436f3..df7dc1040907cc 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -94,9 +94,6 @@ /x-pack/plugins/apm/server/projections/rum_page_load_transactions.ts @elastic/uptime /x-pack/test/apm_api_integration/tests/csm/ @elastic/uptime -# Beats -/x-pack/plugins/beats_management/ @elastic/beats -#CC# /x-pack/plugins/beats_management/ @elastic/beats # Presentation /src/plugins/dashboard/ @elastic/kibana-presentation diff --git a/api_docs/alerting.json b/api_docs/alerting.json index ddb92f5aff9bb1..13a150d0af00da 100644 --- a/api_docs/alerting.json +++ b/api_docs/alerting.json @@ -516,13 +516,15 @@ "label": "rule", "description": [], "signature": [ + "Pick, \"enabled\" | \"id\" | \"name\" | \"params\" | \"actions\" | \"tags\" | \"alertTypeId\" | \"consumer\" | \"schedule\" | \"scheduledTaskId\" | \"createdBy\" | \"updatedBy\" | \"createdAt\" | \"updatedAt\" | \"apiKeyOwner\" | \"throttle\" | \"notifyWhen\" | \"muteAll\" | \"mutedInstanceIds\" | \"executionStatus\">, \"enabled\" | \"name\" | \"actions\" | \"tags\" | \"consumer\" | \"schedule\" | \"createdBy\" | \"updatedBy\" | \"createdAt\" | \"updatedAt\" | \"throttle\" | \"notifyWhen\"> & { producer: string; ruleTypeId: string; ruleTypeName: string; }" ], "source": { "path": "x-pack/plugins/alerting/server/types.ts", @@ -840,7 +842,7 @@ "description": [], "source": { "path": "x-pack/plugins/alerting/server/types.ts", - "lineNumber": 75 + "lineNumber": 76 }, "deprecated": false } @@ -1030,7 +1032,7 @@ ], "source": { "path": "x-pack/plugins/alerting/server/types.ts", - "lineNumber": 107 + "lineNumber": 109 }, "deprecated": false } @@ -3913,7 +3915,15 @@ "label": "SanitizedRuleConfig", "description": [], "signature": [ - "Pick, \"enabled\" | \"id\" | \"name\" | \"params\" | \"actions\" | \"tags\" | \"muteAll\" | \"alertTypeId\" | \"consumer\" | \"schedule\" | \"scheduledTaskId\" | \"createdBy\" | \"updatedBy\" | \"createdAt\" | \"updatedAt\" | \"apiKeyOwner\" | \"throttle\" | \"notifyWhen\" | \"mutedInstanceIds\" | \"executionStatus\">, \"enabled\" | \"name\" | \"actions\" | \"tags\" | \"consumer\" | \"schedule\" | \"createdBy\" | \"updatedBy\" | \"createdAt\" | \"updatedAt\" | \"throttle\" | \"notifyWhen\"> & { producer: string; ruleTypeId: string; ruleTypeName: string; }" + "Pick, \"enabled\" | \"id\" | \"name\" | \"params\" | \"actions\" | \"tags\" | \"alertTypeId\" | \"consumer\" | \"schedule\" | \"scheduledTaskId\" | \"createdBy\" | \"updatedBy\" | \"createdAt\" | \"updatedAt\" | \"apiKeyOwner\" | \"throttle\" | \"notifyWhen\" | \"muteAll\" | \"mutedInstanceIds\" | \"executionStatus\">, \"enabled\" | \"name\" | \"actions\" | \"tags\" | \"consumer\" | \"schedule\" | \"createdBy\" | \"updatedBy\" | \"createdAt\" | \"updatedAt\" | \"throttle\" | \"notifyWhen\"> & { producer: string; ruleTypeId: string; ruleTypeName: string; }" ], "source": { "path": "x-pack/plugins/alerting/common/alert.ts", diff --git a/api_docs/beats_management.json b/api_docs/beats_management.json deleted file mode 100644 index c8f0f6af96ce8a..00000000000000 --- a/api_docs/beats_management.json +++ /dev/null @@ -1,72 +0,0 @@ -{ - "id": "beatsManagement", - "client": { - "classes": [], - "functions": [], - "interfaces": [], - "enums": [], - "misc": [], - "objects": [] - }, - "server": { - "classes": [], - "functions": [], - "interfaces": [], - "enums": [], - "misc": [], - "objects": [] - }, - "common": { - "classes": [], - "functions": [], - "interfaces": [], - "enums": [], - "misc": [ - { - "parentPluginId": "beatsManagement", - "id": "def-common.BeatsManagementConfigType", - "type": "Type", - "tags": [], - "label": "BeatsManagementConfigType", - "description": [], - "signature": [ - "{ readonly enabled: boolean; readonly defaultUserRoles: string[]; readonly encryptionKey: string; readonly enrollmentTokensTtlInSeconds: number; }" - ], - "source": { - "path": "x-pack/plugins/beats_management/common/index.ts", - "lineNumber": 23 - }, - "deprecated": false, - "initialIsOpen": false - } - ], - "objects": [ - { - "parentPluginId": "beatsManagement", - "id": "def-common.beatsManagementConfigSchema", - "type": "Object", - "tags": [], - "label": "beatsManagementConfigSchema", - "description": [], - "signature": [ - "ObjectType", - "<{ enabled: ", - "Type", - "; defaultUserRoles: ", - "Type", - "; encryptionKey: ", - "Type", - "; enrollmentTokensTtlInSeconds: ", - "Type", - "; }>" - ], - "source": { - "path": "x-pack/plugins/beats_management/common/index.ts", - "lineNumber": 12 - }, - "deprecated": false, - "initialIsOpen": false - } - ] - } -} \ No newline at end of file diff --git a/api_docs/beats_management.mdx b/api_docs/beats_management.mdx deleted file mode 100644 index 9d712c102a1a29..00000000000000 --- a/api_docs/beats_management.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -id: kibBeatsManagementPluginApi -slug: /kibana-dev-docs/beatsManagementPluginApi -title: beatsManagement -image: https://source.unsplash.com/400x175/?github -summary: API docs for the beatsManagement plugin -date: 2020-11-16 -tags: ['contributor', 'dev', 'apidocs', 'kibana', 'beatsManagement'] -warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. ---- - -import beatsManagementObj from './beats_management.json'; - -## Common - -### Objects - - -### Consts, variables and types - - diff --git a/api_docs/core.json b/api_docs/core.json index fbf766cad30b38..ee4fe9b10b145e 100644 --- a/api_docs/core.json +++ b/api_docs/core.json @@ -1112,7 +1112,7 @@ ], "source": { "path": "src/core/public/index.ts", - "lineNumber": 206 + "lineNumber": 203 }, "deprecated": false, "children": [ @@ -1136,7 +1136,7 @@ ], "source": { "path": "src/core/public/index.ts", - "lineNumber": 208 + "lineNumber": 205 }, "deprecated": false }, @@ -1160,7 +1160,7 @@ ], "source": { "path": "src/core/public/index.ts", - "lineNumber": 210 + "lineNumber": 207 }, "deprecated": false }, @@ -1184,7 +1184,7 @@ ], "source": { "path": "src/core/public/index.ts", - "lineNumber": 212 + "lineNumber": 209 }, "deprecated": false }, @@ -1208,7 +1208,7 @@ ], "source": { "path": "src/core/public/index.ts", - "lineNumber": 214 + "lineNumber": 211 }, "deprecated": false }, @@ -1232,7 +1232,7 @@ ], "source": { "path": "src/core/public/index.ts", - "lineNumber": 216 + "lineNumber": 213 }, "deprecated": false }, @@ -1252,7 +1252,7 @@ ], "source": { "path": "src/core/public/index.ts", - "lineNumber": 223 + "lineNumber": 220 }, "deprecated": true, "references": [] @@ -1279,7 +1279,7 @@ ], "source": { "path": "src/core/public/index.ts", - "lineNumber": 227 + "lineNumber": 224 }, "deprecated": false, "returnComment": [], @@ -1299,7 +1299,7 @@ ], "source": { "path": "src/core/public/index.ts", - "lineNumber": 251 + "lineNumber": 248 }, "deprecated": false, "children": [ @@ -1323,7 +1323,7 @@ ], "source": { "path": "src/core/public/index.ts", - "lineNumber": 253 + "lineNumber": 250 }, "deprecated": false }, @@ -1347,7 +1347,7 @@ ], "source": { "path": "src/core/public/index.ts", - "lineNumber": 255 + "lineNumber": 252 }, "deprecated": false }, @@ -1371,7 +1371,7 @@ ], "source": { "path": "src/core/public/index.ts", - "lineNumber": 257 + "lineNumber": 254 }, "deprecated": false }, @@ -1395,7 +1395,7 @@ ], "source": { "path": "src/core/public/index.ts", - "lineNumber": 259 + "lineNumber": 256 }, "deprecated": false }, @@ -1419,7 +1419,7 @@ ], "source": { "path": "src/core/public/index.ts", - "lineNumber": 261 + "lineNumber": 258 }, "deprecated": false }, @@ -1443,7 +1443,7 @@ ], "source": { "path": "src/core/public/index.ts", - "lineNumber": 263 + "lineNumber": 260 }, "deprecated": false }, @@ -1467,7 +1467,7 @@ ], "source": { "path": "src/core/public/index.ts", - "lineNumber": 265 + "lineNumber": 262 }, "deprecated": false }, @@ -1491,7 +1491,7 @@ ], "source": { "path": "src/core/public/index.ts", - "lineNumber": 267 + "lineNumber": 264 }, "deprecated": false }, @@ -1515,7 +1515,7 @@ ], "source": { "path": "src/core/public/index.ts", - "lineNumber": 269 + "lineNumber": 266 }, "deprecated": false }, @@ -1539,7 +1539,7 @@ ], "source": { "path": "src/core/public/index.ts", - "lineNumber": 271 + "lineNumber": 268 }, "deprecated": false }, @@ -1563,7 +1563,7 @@ ], "source": { "path": "src/core/public/index.ts", - "lineNumber": 273 + "lineNumber": 270 }, "deprecated": false }, @@ -1583,7 +1583,7 @@ ], "source": { "path": "src/core/public/index.ts", - "lineNumber": 280 + "lineNumber": 277 }, "deprecated": true, "references": [ @@ -7427,7 +7427,7 @@ ], "source": { "path": "src/core/public/index.ts", - "lineNumber": 237 + "lineNumber": 234 }, "deprecated": false, "initialIsOpen": false @@ -8545,45 +8545,38 @@ } }, { - "plugin": "securitySolution", + "plugin": "monitoring", "link": { - "path": "x-pack/plugins/security_solution/server/lib/telemetry/sender.ts", - "lineNumber": 125 + "path": "x-pack/plugins/monitoring/server/kibana_monitoring/collectors/get_usage_collector.ts", + "lineNumber": 107 } }, { - "plugin": "securitySolution", + "plugin": "monitoring", "link": { - "path": "x-pack/plugins/security_solution/server/lib/telemetry/sender.ts", - "lineNumber": 218 + "path": "x-pack/plugins/monitoring/server/telemetry_collection/register_monitoring_telemetry_collection.ts", + "lineNumber": 148 } }, { "plugin": "securitySolution", "link": { "path": "x-pack/plugins/security_solution/server/lib/telemetry/sender.ts", - "lineNumber": 235 - } - }, - { - "plugin": "beatsManagement", - "link": { - "path": "x-pack/plugins/beats_management/server/lib/adapters/database/kibana_database_adapter.ts", - "lineNumber": 113 + "lineNumber": 125 } }, { - "plugin": "monitoring", + "plugin": "securitySolution", "link": { - "path": "x-pack/plugins/monitoring/server/kibana_monitoring/collectors/get_usage_collector.ts", - "lineNumber": 107 + "path": "x-pack/plugins/security_solution/server/lib/telemetry/sender.ts", + "lineNumber": 218 } }, { - "plugin": "monitoring", + "plugin": "securitySolution", "link": { - "path": "x-pack/plugins/monitoring/server/telemetry_collection/register_monitoring_telemetry_collection.ts", - "lineNumber": 148 + "path": "x-pack/plugins/security_solution/server/lib/telemetry/sender.ts", + "lineNumber": 235 } }, { @@ -9387,55 +9380,6 @@ "lineNumber": 67 } }, - { - "plugin": "lists", - "link": { - "path": "x-pack/plugins/lists/server/routes/read_privileges_route.ts", - "lineNumber": 31 - } - }, - { - "plugin": "lists", - "link": { - "path": "x-pack/plugins/lists/server/routes/read_privileges_route.ts", - "lineNumber": 35 - } - }, - { - "plugin": "securitySolution", - "link": { - "path": "x-pack/plugins/security_solution/server/lib/framework/kibana_framework_adapter.ts", - "lineNumber": 34 - } - }, - { - "plugin": "securitySolution", - "link": { - "path": "x-pack/plugins/security_solution/server/lib/detection_engine/routes/signals/query_signals_route.ts", - "lineNumber": 52 - } - }, - { - "plugin": "securitySolution", - "link": { - "path": "x-pack/plugins/security_solution/server/lib/detection_engine/routes/signals/open_close_signals_route.ts", - "lineNumber": 60 - } - }, - { - "plugin": "securitySolution", - "link": { - "path": "x-pack/plugins/security_solution/server/lib/detection_engine/routes/privileges/read_privileges_route.ts", - "lineNumber": 41 - } - }, - { - "plugin": "beatsManagement", - "link": { - "path": "x-pack/plugins/beats_management/server/lib/adapters/database/kibana_database_adapter.ts", - "lineNumber": 111 - } - }, { "plugin": "canvas", "link": { @@ -9821,6 +9765,20 @@ "lineNumber": 420 } }, + { + "plugin": "lists", + "link": { + "path": "x-pack/plugins/lists/server/routes/read_privileges_route.ts", + "lineNumber": 31 + } + }, + { + "plugin": "lists", + "link": { + "path": "x-pack/plugins/lists/server/routes/read_privileges_route.ts", + "lineNumber": 35 + } + }, { "plugin": "monitoring", "link": { @@ -9842,6 +9800,34 @@ "lineNumber": 356 } }, + { + "plugin": "securitySolution", + "link": { + "path": "x-pack/plugins/security_solution/server/lib/framework/kibana_framework_adapter.ts", + "lineNumber": 34 + } + }, + { + "plugin": "securitySolution", + "link": { + "path": "x-pack/plugins/security_solution/server/lib/detection_engine/routes/signals/query_signals_route.ts", + "lineNumber": 52 + } + }, + { + "plugin": "securitySolution", + "link": { + "path": "x-pack/plugins/security_solution/server/lib/detection_engine/routes/signals/open_close_signals_route.ts", + "lineNumber": 60 + } + }, + { + "plugin": "securitySolution", + "link": { + "path": "x-pack/plugins/security_solution/server/lib/detection_engine/routes/privileges/read_privileges_route.ts", + "lineNumber": 41 + } + }, { "plugin": "canvas", "link": { @@ -12712,34 +12698,6 @@ "lineNumber": 117 } }, - { - "plugin": "securitySolution", - "link": { - "path": "x-pack/plugins/security_solution/server/lib/telemetry/sender.ts", - "lineNumber": 125 - } - }, - { - "plugin": "securitySolution", - "link": { - "path": "x-pack/plugins/security_solution/server/lib/telemetry/sender.ts", - "lineNumber": 218 - } - }, - { - "plugin": "securitySolution", - "link": { - "path": "x-pack/plugins/security_solution/server/lib/telemetry/sender.ts", - "lineNumber": 235 - } - }, - { - "plugin": "beatsManagement", - "link": { - "path": "x-pack/plugins/beats_management/server/lib/adapters/database/kibana_database_adapter.ts", - "lineNumber": 31 - } - }, { "plugin": "indexManagement", "link": { @@ -12768,6 +12726,27 @@ "lineNumber": 41 } }, + { + "plugin": "securitySolution", + "link": { + "path": "x-pack/plugins/security_solution/server/lib/telemetry/sender.ts", + "lineNumber": 125 + } + }, + { + "plugin": "securitySolution", + "link": { + "path": "x-pack/plugins/security_solution/server/lib/telemetry/sender.ts", + "lineNumber": 218 + } + }, + { + "plugin": "securitySolution", + "link": { + "path": "x-pack/plugins/security_solution/server/lib/telemetry/sender.ts", + "lineNumber": 235 + } + }, { "plugin": "licensing", "link": { @@ -15940,48 +15919,6 @@ "deprecated": true, "removeBy": "7.16", "references": [ - { - "plugin": "lists", - "link": { - "path": "x-pack/plugins/lists/server/schemas/common/get_call_cluster.mock.ts", - "lineNumber": 9 - } - }, - { - "plugin": "lists", - "link": { - "path": "x-pack/plugins/lists/server/schemas/common/get_call_cluster.mock.ts", - "lineNumber": 27 - } - }, - { - "plugin": "lists", - "link": { - "path": "x-pack/plugins/lists/server/schemas/common/get_call_cluster.mock.ts", - "lineNumber": 31 - } - }, - { - "plugin": "securitySolution", - "link": { - "path": "x-pack/plugins/security_solution/server/lib/telemetry/sender.ts", - "lineNumber": 10 - } - }, - { - "plugin": "securitySolution", - "link": { - "path": "x-pack/plugins/security_solution/server/lib/telemetry/sender.ts", - "lineNumber": 447 - } - }, - { - "plugin": "securitySolution", - "link": { - "path": "x-pack/plugins/security_solution/server/lib/telemetry/sender.ts", - "lineNumber": 466 - } - }, { "plugin": "canvas", "link": { @@ -16269,6 +16206,48 @@ "lineNumber": 35 } }, + { + "plugin": "securitySolution", + "link": { + "path": "x-pack/plugins/security_solution/server/lib/telemetry/sender.ts", + "lineNumber": 10 + } + }, + { + "plugin": "securitySolution", + "link": { + "path": "x-pack/plugins/security_solution/server/lib/telemetry/sender.ts", + "lineNumber": 447 + } + }, + { + "plugin": "securitySolution", + "link": { + "path": "x-pack/plugins/security_solution/server/lib/telemetry/sender.ts", + "lineNumber": 466 + } + }, + { + "plugin": "lists", + "link": { + "path": "x-pack/plugins/lists/server/schemas/common/get_call_cluster.mock.ts", + "lineNumber": 9 + } + }, + { + "plugin": "lists", + "link": { + "path": "x-pack/plugins/lists/server/schemas/common/get_call_cluster.mock.ts", + "lineNumber": 27 + } + }, + { + "plugin": "lists", + "link": { + "path": "x-pack/plugins/lists/server/schemas/common/get_call_cluster.mock.ts", + "lineNumber": 31 + } + }, { "plugin": "monitoring", "link": { @@ -16458,6 +16437,27 @@ "lineNumber": 20 } }, + { + "plugin": "lists", + "link": { + "path": "x-pack/plugins/lists/target/types/server/schemas/common/get_call_cluster.mock.d.ts", + "lineNumber": 2 + } + }, + { + "plugin": "lists", + "link": { + "path": "x-pack/plugins/lists/target/types/server/schemas/common/get_call_cluster.mock.d.ts", + "lineNumber": 4 + } + }, + { + "plugin": "lists", + "link": { + "path": "x-pack/plugins/lists/target/types/server/schemas/common/get_call_cluster.mock.d.ts", + "lineNumber": 5 + } + }, { "plugin": "monitoring", "link": { @@ -19544,7 +19544,7 @@ "The os platform" ], "signature": [ - "\"linux\" | \"aix\" | \"android\" | \"darwin\" | \"freebsd\" | \"openbsd\" | \"sunos\" | \"win32\" | \"cygwin\" | \"netbsd\"" + "\"linux\" | \"aix\" | \"android\" | \"darwin\" | \"freebsd\" | \"openbsd\" | \"sunos\" | \"win32\" | \"cygwin\"" ], "source": { "path": "src/core/server/metrics/collectors/types.ts", @@ -23173,20 +23173,6 @@ "lineNumber": 180 } }, - { - "plugin": "beatsManagement", - "link": { - "path": "x-pack/plugins/beats_management/server/lib/adapters/database/kibana_database_adapter.ts", - "lineNumber": 8 - } - }, - { - "plugin": "beatsManagement", - "link": { - "path": "x-pack/plugins/beats_management/server/lib/adapters/database/kibana_database_adapter.ts", - "lineNumber": 28 - } - }, { "plugin": "licensing", "link": { diff --git a/api_docs/core_application.json b/api_docs/core_application.json index 3141bf16a93498..13b110900ab530 100644 --- a/api_docs/core_application.json +++ b/api_docs/core_application.json @@ -886,7 +886,7 @@ ], "source": { "path": "src/core/public/application/types.ts", - "lineNumber": 339 + "lineNumber": 326 }, "deprecated": false } @@ -930,26 +930,44 @@ }, { "parentPluginId": "core", - "id": "def-public.App.meta", - "type": "Object", + "id": "def-public.App.keywords", + "type": "Array", + "tags": [], + "label": "keywords", + "description": [ + "Optional keywords to match with in deep links search. Omit if this part of the hierarchy does not have a page URL." + ], + "signature": [ + "string[] | undefined" + ], + "source": { + "path": "src/core/public/application/types.ts", + "lineNumber": 215 + }, + "deprecated": false + }, + { + "parentPluginId": "core", + "id": "def-public.App.deepLinks", + "type": "Array", "tags": [], - "label": "meta", + "label": "deepLinks", "description": [ - "\nMeta data for an application that represent additional information for the app.\nSee {@link AppMeta}\n" + "\nInput type for registering secondary in-app locations for an application.\n\nDeep links must include at least one of `path` or `deepLinks`. A deep link that does not have a `path`\nrepresents a topological level in the application's hierarchy, but does not have a destination URL that is\nuser-accessible.\n" ], "signature": [ { "pluginId": "core", "scope": "public", "docId": "kibCoreApplicationPluginApi", - "section": "def-public.AppMeta", - "text": "AppMeta" + "section": "def-public.AppDeepLink", + "text": "AppDeepLink" }, - " | undefined" + "[] | undefined" ], "source": { "path": "src/core/public/application/types.ts", - "lineNumber": 244 + "lineNumber": 254 }, "deprecated": false } @@ -967,7 +985,7 @@ ], "source": { "path": "src/core/public/application/types.ts", - "lineNumber": 565 + "lineNumber": 552 }, "deprecated": false, "children": [ @@ -990,7 +1008,7 @@ ], "source": { "path": "src/core/public/application/types.ts", - "lineNumber": 566 + "lineNumber": 553 }, "deprecated": false }, @@ -1003,7 +1021,7 @@ "description": [], "source": { "path": "src/core/public/application/types.ts", - "lineNumber": 567 + "lineNumber": 554 }, "deprecated": false }, @@ -1019,7 +1037,7 @@ ], "source": { "path": "src/core/public/application/types.ts", - "lineNumber": 568 + "lineNumber": 555 }, "deprecated": false }, @@ -1035,7 +1053,7 @@ ], "source": { "path": "src/core/public/application/types.ts", - "lineNumber": 569 + "lineNumber": 556 }, "deprecated": false } @@ -1053,7 +1071,7 @@ ], "source": { "path": "src/core/public/application/types.ts", - "lineNumber": 553 + "lineNumber": 540 }, "deprecated": false, "children": [ @@ -1076,7 +1094,7 @@ ], "source": { "path": "src/core/public/application/types.ts", - "lineNumber": 554 + "lineNumber": 541 }, "deprecated": false } @@ -1092,7 +1110,7 @@ "description": [], "source": { "path": "src/core/public/application/types.ts", - "lineNumber": 620 + "lineNumber": 607 }, "deprecated": false, "children": [ @@ -1118,7 +1136,7 @@ ], "source": { "path": "src/core/public/application/types.ts", - "lineNumber": 626 + "lineNumber": 613 }, "deprecated": false, "children": [ @@ -1143,7 +1161,7 @@ ], "source": { "path": "src/core/public/application/types.ts", - "lineNumber": 626 + "lineNumber": 613 }, "deprecated": false, "isRequired": true @@ -1175,7 +1193,7 @@ ], "source": { "path": "src/core/public/application/types.ts", - "lineNumber": 655 + "lineNumber": 642 }, "deprecated": false, "children": [ @@ -1200,7 +1218,7 @@ ], "source": { "path": "src/core/public/application/types.ts", - "lineNumber": 655 + "lineNumber": 642 }, "deprecated": false, "isRequired": true @@ -1220,7 +1238,7 @@ "description": [], "source": { "path": "src/core/public/application/types.ts", - "lineNumber": 696 + "lineNumber": 683 }, "deprecated": false, "children": [ @@ -1238,7 +1256,7 @@ ], "source": { "path": "src/core/public/application/types.ts", - "lineNumber": 700 + "lineNumber": 687 }, "deprecated": false }, @@ -1265,7 +1283,7 @@ ], "source": { "path": "src/core/public/application/types.ts", - "lineNumber": 709 + "lineNumber": 696 }, "deprecated": false }, @@ -1291,7 +1309,7 @@ ], "source": { "path": "src/core/public/application/types.ts", - "lineNumber": 717 + "lineNumber": 704 }, "deprecated": false, "children": [ @@ -1307,7 +1325,7 @@ ], "source": { "path": "src/core/public/application/types.ts", - "lineNumber": 717 + "lineNumber": 704 }, "deprecated": false, "isRequired": true @@ -1333,7 +1351,7 @@ ], "source": { "path": "src/core/public/application/types.ts", - "lineNumber": 717 + "lineNumber": 704 }, "deprecated": false, "isRequired": false @@ -1355,7 +1373,7 @@ ], "source": { "path": "src/core/public/application/types.ts", - "lineNumber": 755 + "lineNumber": 742 }, "deprecated": false, "children": [ @@ -1373,7 +1391,7 @@ ], "source": { "path": "src/core/public/application/types.ts", - "lineNumber": 755 + "lineNumber": 742 }, "deprecated": false, "isRequired": true @@ -1395,7 +1413,7 @@ ], "source": { "path": "src/core/public/application/types.ts", - "lineNumber": 769 + "lineNumber": 756 }, "deprecated": false, "children": [ @@ -1411,7 +1429,7 @@ ], "source": { "path": "src/core/public/application/types.ts", - "lineNumber": 769 + "lineNumber": 756 }, "deprecated": false, "isRequired": true @@ -1425,7 +1443,7 @@ "description": [], "source": { "path": "src/core/public/application/types.ts", - "lineNumber": 769 + "lineNumber": 756 }, "deprecated": false, "children": [ @@ -1441,7 +1459,7 @@ ], "source": { "path": "src/core/public/application/types.ts", - "lineNumber": 769 + "lineNumber": 756 }, "deprecated": false }, @@ -1457,7 +1475,7 @@ ], "source": { "path": "src/core/public/application/types.ts", - "lineNumber": 769 + "lineNumber": 756 }, "deprecated": false } @@ -1481,68 +1499,7 @@ ], "source": { "path": "src/core/public/application/types.ts", - "lineNumber": 774 - }, - "deprecated": false - } - ], - "initialIsOpen": false - }, - { - "parentPluginId": "core", - "id": "def-public.AppMeta", - "type": "Interface", - "tags": [], - "label": "AppMeta", - "description": [ - "\nInput type for meta data for an application.\n\nMeta fields include `keywords` and `searchDeepLinks`\nKeywords is an array of string with which to associate the app, must include at least one unique string as an array.\n`searchDeepLinks` is an array of links that represent secondary in-app locations for the app." - ], - "source": { - "path": "src/core/public/application/types.ts", - "lineNumber": 255 - }, - "deprecated": false, - "children": [ - { - "parentPluginId": "core", - "id": "def-public.AppMeta.keywords", - "type": "Array", - "tags": [], - "label": "keywords", - "description": [ - "Keywords to represent this application" - ], - "signature": [ - "string[] | undefined" - ], - "source": { - "path": "src/core/public/application/types.ts", - "lineNumber": 257 - }, - "deprecated": false - }, - { - "parentPluginId": "core", - "id": "def-public.AppMeta.searchDeepLinks", - "type": "Array", - "tags": [], - "label": "searchDeepLinks", - "description": [ - "Array of links that represent secondary in-app locations for the app." - ], - "signature": [ - { - "pluginId": "core", - "scope": "public", - "docId": "kibCoreApplicationPluginApi", - "section": "def-public.AppSearchDeepLink", - "text": "AppSearchDeepLink" - }, - "[] | undefined" - ], - "source": { - "path": "src/core/public/application/types.ts", - "lineNumber": 259 + "lineNumber": 761 }, "deprecated": false } @@ -1568,7 +1525,7 @@ ], "source": { "path": "src/core/public/application/types.ts", - "lineNumber": 349 + "lineNumber": 336 }, "deprecated": false, "children": [ @@ -1586,7 +1543,7 @@ ], "source": { "path": "src/core/public/application/types.ts", - "lineNumber": 353 + "lineNumber": 340 }, "deprecated": false }, @@ -1611,7 +1568,7 @@ ], "source": { "path": "src/core/public/application/types.ts", - "lineNumber": 399 + "lineNumber": 386 }, "deprecated": false }, @@ -1628,7 +1585,7 @@ ], "source": { "path": "src/core/public/application/types.ts", - "lineNumber": 449 + "lineNumber": 436 }, "deprecated": true, "references": [ @@ -1721,7 +1678,7 @@ ], "source": { "path": "src/core/public/application/types.ts", - "lineNumber": 484 + "lineNumber": 471 }, "deprecated": true, "references": [ @@ -1746,20 +1703,6 @@ "lineNumber": 298 } }, - { - "plugin": "lens", - "link": { - "path": "x-pack/plugins/lens/public/app_plugin/types.ts", - "lineNumber": 71 - } - }, - { - "plugin": "lens", - "link": { - "path": "x-pack/plugins/lens/public/app_plugin/mounter.tsx", - "lineNumber": 171 - } - }, { "plugin": "maps", "link": { @@ -1781,6 +1724,20 @@ "lineNumber": 19 } }, + { + "plugin": "lens", + "link": { + "path": "x-pack/plugins/lens/public/app_plugin/types.ts", + "lineNumber": 71 + } + }, + { + "plugin": "lens", + "link": { + "path": "x-pack/plugins/lens/public/app_plugin/mounter.tsx", + "lineNumber": 171 + } + }, { "plugin": "ml", "link": { @@ -1882,7 +1839,7 @@ ], "source": { "path": "src/core/public/application/types.ts", - "lineNumber": 484 + "lineNumber": 471 }, "deprecated": false } @@ -1910,7 +1867,7 @@ ], "source": { "path": "src/core/public/application/types.ts", - "lineNumber": 515 + "lineNumber": 502 }, "deprecated": false, "returnComment": [], @@ -1934,7 +1891,7 @@ ], "source": { "path": "src/core/public/application/types.ts", - "lineNumber": 515 + "lineNumber": 502 }, "deprecated": false } @@ -1954,7 +1911,7 @@ ], "source": { "path": "src/core/public/application/types.ts", - "lineNumber": 674 + "lineNumber": 661 }, "deprecated": false, "children": [ @@ -1972,7 +1929,7 @@ ], "source": { "path": "src/core/public/application/types.ts", - "lineNumber": 679 + "lineNumber": 666 }, "deprecated": false }, @@ -1990,7 +1947,7 @@ ], "source": { "path": "src/core/public/application/types.ts", - "lineNumber": 683 + "lineNumber": 670 }, "deprecated": false }, @@ -2008,7 +1965,7 @@ ], "source": { "path": "src/core/public/application/types.ts", - "lineNumber": 687 + "lineNumber": 674 }, "deprecated": false }, @@ -2026,7 +1983,7 @@ ], "source": { "path": "src/core/public/application/types.ts", - "lineNumber": 692 + "lineNumber": 679 }, "deprecated": false } @@ -2046,7 +2003,7 @@ ], "source": { "path": "src/core/public/application/types.ts", - "lineNumber": 540 + "lineNumber": 527 }, "deprecated": false, "initialIsOpen": false @@ -2085,6 +2042,57 @@ } ], "misc": [ + { + "parentPluginId": "core", + "id": "def-public.AppDeepLink", + "type": "Type", + "tags": [], + "label": "AppDeepLink", + "description": [ + "\nInput type for registering secondary in-app locations for an application.\n\nDeep links must include at least one of `path` or `deepLinks`. A deep link that does not have a `path`\nrepresents a topological level in the application's hierarchy, but does not have a destination URL that is\nuser-accessible." + ], + "signature": [ + "({ id: string; title: string; keywords?: string[] | undefined; navLinkStatus?: ", + { + "pluginId": "core", + "scope": "public", + "docId": "kibCoreApplicationPluginApi", + "section": "def-public.AppNavLinkStatus", + "text": "AppNavLinkStatus" + }, + " | undefined; } & { path: string; deepLinks?: ", + { + "pluginId": "core", + "scope": "public", + "docId": "kibCoreApplicationPluginApi", + "section": "def-public.AppDeepLink", + "text": "AppDeepLink" + }, + "[] | undefined; }) | ({ id: string; title: string; keywords?: string[] | undefined; navLinkStatus?: ", + { + "pluginId": "core", + "scope": "public", + "docId": "kibCoreApplicationPluginApi", + "section": "def-public.AppNavLinkStatus", + "text": "AppNavLinkStatus" + }, + " | undefined; } & { path?: string | undefined; deepLinks: ", + { + "pluginId": "core", + "scope": "public", + "docId": "kibCoreApplicationPluginApi", + "section": "def-public.AppDeepLink", + "text": "AppDeepLink" + }, + "[]; })" + ], + "source": { + "path": "src/core/public/application/types.ts", + "lineNumber": 279 + }, + "deprecated": false, + "initialIsOpen": false + }, { "parentPluginId": "core", "id": "def-public.AppLeaveAction", @@ -2113,7 +2121,7 @@ ], "source": { "path": "src/core/public/application/types.ts", - "lineNumber": 579 + "lineNumber": 566 }, "deprecated": false, "initialIsOpen": false @@ -2143,7 +2151,7 @@ ], "source": { "path": "src/core/public/application/types.ts", - "lineNumber": 530 + "lineNumber": 517 }, "deprecated": true, "references": [ @@ -2251,42 +2259,7 @@ ], "source": { "path": "src/core/public/application/types.ts", - "lineNumber": 338 - }, - "deprecated": false, - "initialIsOpen": false - }, - { - "parentPluginId": "core", - "id": "def-public.AppSearchDeepLink", - "type": "Type", - "tags": [], - "label": "AppSearchDeepLink", - "description": [ - "\nInput type for registering secondary in-app locations for an application.\n\nDeep links must include at least one of `path` or `searchDeepLinks`. A deep link that does not have a `path`\nrepresents a topological level in the application's hierarchy, but does not have a destination URL that is\nuser-accessible." - ], - "signature": [ - "({ id: string; title: string; } & { path: string; searchDeepLinks?: ", - { - "pluginId": "core", - "scope": "public", - "docId": "kibCoreApplicationPluginApi", - "section": "def-public.AppSearchDeepLink", - "text": "AppSearchDeepLink" - }, - "[] | undefined; keywords?: string[] | undefined; }) | ({ id: string; title: string; } & { path?: string | undefined; searchDeepLinks: ", - { - "pluginId": "core", - "scope": "public", - "docId": "kibCoreApplicationPluginApi", - "section": "def-public.AppSearchDeepLink", - "text": "AppSearchDeepLink" - }, - "[]; keywords?: string[] | undefined; })" - ], - "source": { - "path": "src/core/public/application/types.ts", - "lineNumber": 293 + "lineNumber": 325 }, "deprecated": false, "initialIsOpen": false @@ -2305,7 +2278,7 @@ ], "source": { "path": "src/core/public/application/types.ts", - "lineNumber": 346 + "lineNumber": 333 }, "deprecated": false, "initialIsOpen": false @@ -2328,15 +2301,15 @@ "section": "def-public.AppStatus", "text": "AppStatus" }, - " | undefined; meta?: ", + " | undefined; deepLinks?: ", { "pluginId": "core", "scope": "public", "docId": "kibCoreApplicationPluginApi", - "section": "def-public.AppMeta", - "text": "AppMeta" + "section": "def-public.AppDeepLink", + "text": "AppDeepLink" }, - " | undefined; navLinkStatus?: ", + "[] | undefined; navLinkStatus?: ", { "pluginId": "core", "scope": "public", @@ -2379,7 +2352,7 @@ "section": "def-public.App", "text": "App" }, - ", \"status\" | \"meta\" | \"navLinkStatus\" | \"defaultPath\" | \"tooltip\">> | undefined" + ", \"status\" | \"deepLinks\" | \"navLinkStatus\" | \"defaultPath\" | \"tooltip\">> | undefined" ], "source": { "path": "src/core/public/application/types.ts", @@ -2390,12 +2363,12 @@ }, { "parentPluginId": "core", - "id": "def-public.PublicAppInfo", + "id": "def-public.PublicAppDeepLinkInfo", "type": "Type", "tags": [], - "label": "PublicAppInfo", + "label": "PublicAppDeepLinkInfo", "description": [ - "\nPublic information about a registered {@link App | application}\n" + "\nPublic information about a registered app's {@link AppDeepLink | deepLinks}\n" ], "signature": [ "Pick<", @@ -2403,18 +2376,18 @@ "pluginId": "core", "scope": "public", "docId": "kibCoreApplicationPluginApi", - "section": "def-public.App", - "text": "App" + "section": "def-public.AppDeepLink", + "text": "AppDeepLink" }, - ", \"status\" | \"title\" | \"id\" | \"order\" | \"category\" | \"navLinkStatus\" | \"defaultPath\" | \"tooltip\" | \"euiIconType\" | \"icon\" | \"capabilities\" | \"chromeless\" | \"appRoute\" | \"exactRoute\"> & { status: ", + ", \"title\" | \"id\" | \"path\"> & { deepLinks: ", { "pluginId": "core", "scope": "public", "docId": "kibCoreApplicationPluginApi", - "section": "def-public.AppStatus", - "text": "AppStatus" + "section": "def-public.PublicAppDeepLinkInfo", + "text": "PublicAppDeepLinkInfo" }, - "; navLinkStatus: ", + "[]; keywords: string[]; navLinkStatus: ", { "pluginId": "core", "scope": "public", @@ -2422,31 +2395,23 @@ "section": "def-public.AppNavLinkStatus", "text": "AppNavLinkStatus" }, - "; appRoute: string; meta: ", - { - "pluginId": "core", - "scope": "public", - "docId": "kibCoreApplicationPluginApi", - "section": "def-public.PublicAppMetaInfo", - "text": "PublicAppMetaInfo" - }, "; }" ], "source": { "path": "src/core/public/application/types.ts", - "lineNumber": 322 + "lineNumber": 262 }, "deprecated": false, "initialIsOpen": false }, { "parentPluginId": "core", - "id": "def-public.PublicAppMetaInfo", + "id": "def-public.PublicAppInfo", "type": "Type", "tags": [], - "label": "PublicAppMetaInfo", + "label": "PublicAppInfo", "description": [ - "\nPublic information about a registered app's {@link AppMeta | keywords }\n" + "\nPublic information about a registered {@link App | application}\n" ], "signature": [ "Pick<", @@ -2454,57 +2419,38 @@ "pluginId": "core", "scope": "public", "docId": "kibCoreApplicationPluginApi", - "section": "def-public.AppMeta", - "text": "AppMeta" + "section": "def-public.App", + "text": "App" }, - ", never> & { keywords: string[]; searchDeepLinks: ", + ", \"status\" | \"title\" | \"id\" | \"order\" | \"category\" | \"navLinkStatus\" | \"defaultPath\" | \"tooltip\" | \"euiIconType\" | \"icon\" | \"capabilities\" | \"chromeless\" | \"appRoute\" | \"exactRoute\"> & { status: ", { "pluginId": "core", "scope": "public", "docId": "kibCoreApplicationPluginApi", - "section": "def-public.PublicAppSearchDeepLinkInfo", - "text": "PublicAppSearchDeepLinkInfo" + "section": "def-public.AppStatus", + "text": "AppStatus" }, - "[]; }" - ], - "source": { - "path": "src/core/public/application/types.ts", - "lineNumber": 267 - }, - "deprecated": false, - "initialIsOpen": false - }, - { - "parentPluginId": "core", - "id": "def-public.PublicAppSearchDeepLinkInfo", - "type": "Type", - "tags": [], - "label": "PublicAppSearchDeepLinkInfo", - "description": [ - "\nPublic information about a registered app's {@link AppSearchDeepLink | searchDeepLinks}\n" - ], - "signature": [ - "Pick<", + "; navLinkStatus: ", { "pluginId": "core", "scope": "public", "docId": "kibCoreApplicationPluginApi", - "section": "def-public.AppSearchDeepLink", - "text": "AppSearchDeepLink" + "section": "def-public.AppNavLinkStatus", + "text": "AppNavLinkStatus" }, - ", \"title\" | \"id\" | \"path\"> & { searchDeepLinks: ", + "; appRoute: string; keywords: string[]; deepLinks: ", { "pluginId": "core", "scope": "public", "docId": "kibCoreApplicationPluginApi", - "section": "def-public.PublicAppSearchDeepLinkInfo", - "text": "PublicAppSearchDeepLinkInfo" + "section": "def-public.PublicAppDeepLinkInfo", + "text": "PublicAppDeepLinkInfo" }, - "[]; keywords: string[]; }" + "[]; }" ], "source": { "path": "src/core/public/application/types.ts", - "lineNumber": 277 + "lineNumber": 308 }, "deprecated": false, "initialIsOpen": false diff --git a/api_docs/core_chrome.json b/api_docs/core_chrome.json index d6ec4b0d3f640b..fae65ff62c9714 100644 --- a/api_docs/core_chrome.json +++ b/api_docs/core_chrome.json @@ -890,7 +890,7 @@ "description": [], "source": { "path": "src/core/public/chrome/nav_links/nav_link.ts", - "lineNumber": 15 + "lineNumber": 14 }, "deprecated": false, "children": [ @@ -905,7 +905,7 @@ ], "source": { "path": "src/core/public/chrome/nav_links/nav_link.ts", - "lineNumber": 19 + "lineNumber": 18 }, "deprecated": false }, @@ -920,7 +920,7 @@ ], "source": { "path": "src/core/public/chrome/nav_links/nav_link.ts", - "lineNumber": 24 + "lineNumber": 23 }, "deprecated": false }, @@ -939,7 +939,7 @@ ], "source": { "path": "src/core/public/chrome/nav_links/nav_link.ts", - "lineNumber": 29 + "lineNumber": 28 }, "deprecated": false }, @@ -954,7 +954,7 @@ ], "source": { "path": "src/core/public/chrome/nav_links/nav_link.ts", - "lineNumber": 34 + "lineNumber": 33 }, "deprecated": false }, @@ -972,7 +972,7 @@ ], "source": { "path": "src/core/public/chrome/nav_links/nav_link.ts", - "lineNumber": 40 + "lineNumber": 39 }, "deprecated": false }, @@ -990,7 +990,7 @@ ], "source": { "path": "src/core/public/chrome/nav_links/nav_link.ts", - "lineNumber": 45 + "lineNumber": 44 }, "deprecated": false }, @@ -1008,7 +1008,7 @@ ], "source": { "path": "src/core/public/chrome/nav_links/nav_link.ts", - "lineNumber": 50 + "lineNumber": 49 }, "deprecated": false }, @@ -1026,7 +1026,7 @@ ], "source": { "path": "src/core/public/chrome/nav_links/nav_link.ts", - "lineNumber": 56 + "lineNumber": 55 }, "deprecated": false }, @@ -1044,7 +1044,7 @@ ], "source": { "path": "src/core/public/chrome/nav_links/nav_link.ts", - "lineNumber": 62 + "lineNumber": 61 }, "deprecated": false }, @@ -1059,7 +1059,7 @@ ], "source": { "path": "src/core/public/chrome/nav_links/nav_link.ts", - "lineNumber": 67 + "lineNumber": 66 }, "deprecated": false }, @@ -1077,7 +1077,7 @@ ], "source": { "path": "src/core/public/chrome/nav_links/nav_link.ts", - "lineNumber": 76 + "lineNumber": 75 }, "deprecated": false }, @@ -1095,7 +1095,7 @@ ], "source": { "path": "src/core/public/chrome/nav_links/nav_link.ts", - "lineNumber": 81 + "lineNumber": 80 }, "deprecated": false } @@ -1297,103 +1297,6 @@ ], "returnComment": [] }, - { - "parentPluginId": "core", - "id": "def-public.ChromeNavLinks.update", - "type": "Function", - "tags": [ - "deprecated" - ], - "label": "update", - "description": [ - "\nUpdate the navlink for the given id with the updated attributes.\nReturns the updated navlink or `undefined` if it does not exist.\n" - ], - "signature": [ - "(id: string, values: Partial>) => ", - { - "pluginId": "core", - "scope": "public", - "docId": "kibCoreChromePluginApi", - "section": "def-public.ChromeNavLink", - "text": "ChromeNavLink" - }, - " | undefined" - ], - "source": { - "path": "src/core/public/chrome/nav_links/nav_links_service.ts", - "lineNumber": 71 - }, - "deprecated": true, - "references": [ - { - "plugin": "apm", - "link": { - "path": "x-pack/plugins/apm/public/toggleAppLinkInNav.ts", - "lineNumber": 13 - } - }, - { - "plugin": "graph", - "link": { - "path": "x-pack/plugins/graph/public/services/toggle_nav_link.ts", - "lineNumber": 26 - } - } - ], - "children": [ - { - "parentPluginId": "core", - "id": "def-public.ChromeNavLinks.update.$1", - "type": "string", - "tags": [], - "label": "id", - "description": [], - "signature": [ - "string" - ], - "source": { - "path": "src/core/public/chrome/nav_links/nav_links_service.ts", - "lineNumber": 71 - }, - "deprecated": false, - "isRequired": true - }, - { - "parentPluginId": "core", - "id": "def-public.ChromeNavLinks.update.$2", - "type": "Object", - "tags": [], - "label": "values", - "description": [], - "signature": [ - "Partial>" - ], - "source": { - "path": "src/core/public/chrome/nav_links/nav_links_service.ts", - "lineNumber": 71 - }, - "deprecated": false, - "isRequired": true - } - ], - "returnComment": [] - }, { "parentPluginId": "core", "id": "def-public.ChromeNavLinks.enableForcedAppSwitcherNavigation", @@ -1408,7 +1311,7 @@ ], "source": { "path": "src/core/public/chrome/nav_links/nav_links_service.ts", - "lineNumber": 85 + "lineNumber": 73 }, "deprecated": false, "children": [], @@ -1430,7 +1333,7 @@ ], "source": { "path": "src/core/public/chrome/nav_links/nav_links_service.ts", - "lineNumber": 90 + "lineNumber": 78 }, "deprecated": false, "children": [], @@ -2678,23 +2581,6 @@ "deprecated": false, "initialIsOpen": false }, - { - "parentPluginId": "core", - "id": "def-public.ChromeNavLinkUpdateableFields", - "type": "Type", - "tags": [], - "label": "ChromeNavLinkUpdateableFields", - "description": [], - "signature": [ - "{ readonly hidden?: boolean | undefined; readonly url?: string | undefined; readonly disabled?: boolean | undefined; readonly href?: string | undefined; }" - ], - "source": { - "path": "src/core/public/chrome/nav_links/nav_link.ts", - "lineNumber": 85 - }, - "deprecated": false, - "initialIsOpen": false - }, { "parentPluginId": "core", "id": "def-public.NavType", diff --git a/api_docs/data.json b/api_docs/data.json index 77d26811db5bf4..ab5196934d855b 100644 --- a/api_docs/data.json +++ b/api_docs/data.json @@ -11486,111 +11486,6 @@ "lineNumber": 58 } }, - { - "plugin": "fleet", - "link": { - "path": "x-pack/plugins/fleet/public/applications/fleet/components/search_bar.tsx", - "lineNumber": 10 - } - }, - { - "plugin": "fleet", - "link": { - "path": "x-pack/plugins/fleet/public/applications/fleet/components/search_bar.tsx", - "lineNumber": 33 - } - }, - { - "plugin": "fleet", - "link": { - "path": "x-pack/plugins/fleet/public/applications/fleet/components/search_bar.tsx", - "lineNumber": 51 - } - }, - { - "plugin": "indexPatternManagement", - "link": { - "path": "src/plugins/index_pattern_management/public/service/list/config.ts", - "lineNumber": 10 - } - }, - { - "plugin": "indexPatternManagement", - "link": { - "path": "src/plugins/index_pattern_management/public/service/list/config.ts", - "lineNumber": 42 - } - }, - { - "plugin": "indexPatternManagement", - "link": { - "path": "src/plugins/index_pattern_management/public/service/list/manager.ts", - "lineNumber": 9 - } - }, - { - "plugin": "indexPatternManagement", - "link": { - "path": "src/plugins/index_pattern_management/public/service/list/manager.ts", - "lineNumber": 43 - } - }, - { - "plugin": "indexPatternManagement", - "link": { - "path": "src/plugins/index_pattern_management/public/components/create_index_pattern_wizard/lib/extract_time_fields.ts", - "lineNumber": 10 - } - }, - { - "plugin": "indexPatternManagement", - "link": { - "path": "src/plugins/index_pattern_management/public/components/create_index_pattern_wizard/lib/extract_time_fields.ts", - "lineNumber": 12 - } - }, - { - "plugin": "indexPatternManagement", - "link": { - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/indexed_fields_table/types.ts", - "lineNumber": 9 - } - }, - { - "plugin": "indexPatternManagement", - "link": { - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/indexed_fields_table/types.ts", - "lineNumber": 11 - } - }, - { - "plugin": "indexPatternManagement", - "link": { - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/indexed_fields_table/indexed_fields_table.tsx", - "lineNumber": 11 - } - }, - { - "plugin": "indexPatternManagement", - "link": { - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/indexed_fields_table/indexed_fields_table.tsx", - "lineNumber": 23 - } - }, - { - "plugin": "indexPatternManagement", - "link": { - "path": "src/plugins/index_pattern_management/public/components/field_editor/field_editor.tsx", - "lineNumber": 45 - } - }, - { - "plugin": "indexPatternManagement", - "link": { - "path": "src/plugins/index_pattern_management/public/components/field_editor/field_editor.tsx", - "lineNumber": 148 - } - }, { "plugin": "maps", "link": { @@ -11955,6 +11850,90 @@ "lineNumber": 66 } }, + { + "plugin": "indexPatternManagement", + "link": { + "path": "src/plugins/index_pattern_management/public/service/list/config.ts", + "lineNumber": 10 + } + }, + { + "plugin": "indexPatternManagement", + "link": { + "path": "src/plugins/index_pattern_management/public/service/list/config.ts", + "lineNumber": 42 + } + }, + { + "plugin": "indexPatternManagement", + "link": { + "path": "src/plugins/index_pattern_management/public/service/list/manager.ts", + "lineNumber": 9 + } + }, + { + "plugin": "indexPatternManagement", + "link": { + "path": "src/plugins/index_pattern_management/public/service/list/manager.ts", + "lineNumber": 43 + } + }, + { + "plugin": "indexPatternManagement", + "link": { + "path": "src/plugins/index_pattern_management/public/components/create_index_pattern_wizard/lib/extract_time_fields.ts", + "lineNumber": 10 + } + }, + { + "plugin": "indexPatternManagement", + "link": { + "path": "src/plugins/index_pattern_management/public/components/create_index_pattern_wizard/lib/extract_time_fields.ts", + "lineNumber": 12 + } + }, + { + "plugin": "indexPatternManagement", + "link": { + "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/indexed_fields_table/types.ts", + "lineNumber": 9 + } + }, + { + "plugin": "indexPatternManagement", + "link": { + "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/indexed_fields_table/types.ts", + "lineNumber": 11 + } + }, + { + "plugin": "indexPatternManagement", + "link": { + "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/indexed_fields_table/indexed_fields_table.tsx", + "lineNumber": 11 + } + }, + { + "plugin": "indexPatternManagement", + "link": { + "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/indexed_fields_table/indexed_fields_table.tsx", + "lineNumber": 23 + } + }, + { + "plugin": "indexPatternManagement", + "link": { + "path": "src/plugins/index_pattern_management/public/components/field_editor/field_editor.tsx", + "lineNumber": 45 + } + }, + { + "plugin": "indexPatternManagement", + "link": { + "path": "src/plugins/index_pattern_management/public/components/field_editor/field_editor.tsx", + "lineNumber": 148 + } + }, { "plugin": "ml", "link": { @@ -12207,6 +12186,27 @@ "lineNumber": 21 } }, + { + "plugin": "fleet", + "link": { + "path": "x-pack/plugins/fleet/public/applications/fleet/components/search_bar.tsx", + "lineNumber": 10 + } + }, + { + "plugin": "fleet", + "link": { + "path": "x-pack/plugins/fleet/public/applications/fleet/components/search_bar.tsx", + "lineNumber": 33 + } + }, + { + "plugin": "fleet", + "link": { + "path": "x-pack/plugins/fleet/public/applications/fleet/components/search_bar.tsx", + "lineNumber": 51 + } + }, { "plugin": "fleet", "link": { @@ -12747,409 +12747,346 @@ } }, { - "plugin": "lists", + "plugin": "maps", "link": { - "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/helpers.ts", - "lineNumber": 19 + "path": "x-pack/plugins/maps/common/elasticsearch_util/es_agg_utils.ts", + "lineNumber": 10 } }, { - "plugin": "lists", + "plugin": "maps", "link": { - "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/helpers.ts", - "lineNumber": 30 + "path": "x-pack/plugins/maps/common/elasticsearch_util/es_agg_utils.ts", + "lineNumber": 16 } }, { - "plugin": "lists", + "plugin": "maps", "link": { - "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/helpers.ts", - "lineNumber": 54 + "path": "x-pack/plugins/maps/common/elasticsearch_util/es_agg_utils.ts", + "lineNumber": 29 } }, { - "plugin": "lists", + "plugin": "maps", "link": { - "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/helpers.ts", - "lineNumber": 84 + "path": "x-pack/plugins/maps/public/components/geo_field_select.tsx", + "lineNumber": 12 } }, { - "plugin": "lists", + "plugin": "maps", "link": { - "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/helpers.ts", - "lineNumber": 150 + "path": "x-pack/plugins/maps/public/components/geo_field_select.tsx", + "lineNumber": 16 } }, { - "plugin": "lists", + "plugin": "maps", "link": { - "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/field.tsx", - "lineNumber": 11 + "path": "x-pack/plugins/maps/public/classes/sources/es_search_source/top_hits/create_source_editor.tsx", + "lineNumber": 18 } }, { - "plugin": "lists", + "plugin": "maps", "link": { - "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/field.tsx", - "lineNumber": 26 + "path": "x-pack/plugins/maps/public/classes/sources/es_search_source/top_hits/create_source_editor.tsx", + "lineNumber": 30 } }, { - "plugin": "lists", + "plugin": "maps", "link": { - "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/field.tsx", - "lineNumber": 28 + "path": "x-pack/plugins/maps/public/classes/sources/es_search_source/top_hits/create_source_editor.tsx", + "lineNumber": 33 } }, { - "plugin": "lists", + "plugin": "maps", "link": { - "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/field.tsx", - "lineNumber": 57 + "path": "x-pack/plugins/maps/public/classes/sources/es_search_source/top_hits/create_source_editor.tsx", + "lineNumber": 35 } }, { - "plugin": "lists", + "plugin": "lens", "link": { - "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/field.tsx", - "lineNumber": 95 + "path": "x-pack/plugins/lens/public/indexpattern_datasource/types.ts", + "lineNumber": 8 } }, { - "plugin": "lists", + "plugin": "lens", "link": { - "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/field.tsx", - "lineNumber": 96 + "path": "x-pack/plugins/lens/public/indexpattern_datasource/types.ts", + "lineNumber": 57 } }, { - "plugin": "lists", + "plugin": "lens", "link": { - "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/field.tsx", - "lineNumber": 101 + "path": "x-pack/plugins/lens/server/routes/field_stats.ts", + "lineNumber": 11 } }, { - "plugin": "lists", + "plugin": "lens", "link": { - "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/field.tsx", - "lineNumber": 114 + "path": "x-pack/plugins/lens/server/routes/field_stats.ts", + "lineNumber": 139 } }, { - "plugin": "lists", + "plugin": "lens", "link": { - "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/field.tsx", - "lineNumber": 121 + "path": "x-pack/plugins/lens/server/routes/field_stats.ts", + "lineNumber": 248 } }, { - "plugin": "lists", + "plugin": "lens", "link": { - "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/field.tsx", - "lineNumber": 125 + "path": "x-pack/plugins/lens/server/routes/field_stats.ts", + "lineNumber": 287 } }, { - "plugin": "lists", + "plugin": "lens", "link": { - "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/field.tsx", - "lineNumber": 125 + "path": "x-pack/plugins/lens/server/routes/field_stats.ts", + "lineNumber": 329 } }, { "plugin": "lists", "link": { - "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/field.tsx", - "lineNumber": 130 + "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/helpers.ts", + "lineNumber": 19 } }, { "plugin": "lists", "link": { - "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/field.tsx", - "lineNumber": 131 + "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/helpers.ts", + "lineNumber": 30 } }, { "plugin": "lists", "link": { - "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/field.tsx", - "lineNumber": 133 + "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/helpers.ts", + "lineNumber": 54 } }, { "plugin": "lists", "link": { - "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/field.tsx", - "lineNumber": 134 + "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/helpers.ts", + "lineNumber": 84 } }, { "plugin": "lists", "link": { - "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/operator.tsx", - "lineNumber": 11 + "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/helpers.ts", + "lineNumber": 150 } }, { "plugin": "lists", "link": { - "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/operator.tsx", - "lineNumber": 27 + "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/field.tsx", + "lineNumber": 11 } }, { "plugin": "lists", "link": { - "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/hooks/use_field_value_autocomplete.ts", - "lineNumber": 13 + "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/field.tsx", + "lineNumber": 26 } }, { "plugin": "lists", "link": { - "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/hooks/use_field_value_autocomplete.ts", - "lineNumber": 16 + "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/field.tsx", + "lineNumber": 28 } }, { "plugin": "lists", "link": { - "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/hooks/use_field_value_autocomplete.ts", - "lineNumber": 32 + "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/field.tsx", + "lineNumber": 57 } }, { "plugin": "lists", "link": { - "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/field_value_match.tsx", - "lineNumber": 19 + "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/field.tsx", + "lineNumber": 95 } }, { "plugin": "lists", "link": { - "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/field_value_match.tsx", - "lineNumber": 36 + "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/field.tsx", + "lineNumber": 96 } }, { "plugin": "lists", "link": { - "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/field_value_match_any.tsx", - "lineNumber": 13 + "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/field.tsx", + "lineNumber": 101 } }, { "plugin": "lists", "link": { - "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/field_value_match_any.tsx", - "lineNumber": 23 + "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/field.tsx", + "lineNumber": 114 } }, { "plugin": "lists", "link": { - "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/field_value_lists.tsx", - "lineNumber": 13 + "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/field.tsx", + "lineNumber": 121 } }, { "plugin": "lists", "link": { - "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/field_value_lists.tsx", - "lineNumber": 29 + "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/field.tsx", + "lineNumber": 125 } }, { "plugin": "lists", "link": { - "path": "x-pack/plugins/lists/public/exceptions/components/builder/entry_renderer.tsx", - "lineNumber": 31 + "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/field.tsx", + "lineNumber": 125 } }, { "plugin": "lists", "link": { - "path": "x-pack/plugins/lists/public/exceptions/components/builder/entry_renderer.tsx", - "lineNumber": 91 + "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/field.tsx", + "lineNumber": 130 } }, { "plugin": "lists", "link": { - "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/helpers.test.ts", - "lineNumber": 19 + "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/field.tsx", + "lineNumber": 131 } }, { "plugin": "lists", "link": { - "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/helpers.test.ts", - "lineNumber": 333 + "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/field.tsx", + "lineNumber": 133 } }, { "plugin": "lists", "link": { - "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/helpers.test.ts", - "lineNumber": 339 + "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/field.tsx", + "lineNumber": 134 } }, { "plugin": "lists", "link": { - "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/helpers.test.ts", - "lineNumber": 347 + "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/operator.tsx", + "lineNumber": 11 } }, { "plugin": "lists", "link": { - "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/helpers.test.ts", - "lineNumber": 355 + "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/operator.tsx", + "lineNumber": 27 } }, { "plugin": "lists", "link": { - "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/helpers.test.ts", - "lineNumber": 363 + "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/hooks/use_field_value_autocomplete.ts", + "lineNumber": 13 } }, { "plugin": "lists", "link": { - "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/helpers.test.ts", - "lineNumber": 371 + "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/hooks/use_field_value_autocomplete.ts", + "lineNumber": 16 } }, { "plugin": "lists", "link": { - "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/helpers.test.ts", - "lineNumber": 380 + "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/hooks/use_field_value_autocomplete.ts", + "lineNumber": 32 } }, { "plugin": "lists", "link": { - "path": "x-pack/plugins/lists/public/exceptions/components/builder/helpers.test.ts", - "lineNumber": 62 + "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/field_value_match.tsx", + "lineNumber": 19 } }, { "plugin": "lists", "link": { - "path": "x-pack/plugins/lists/public/exceptions/components/builder/helpers.test.ts", - "lineNumber": 166 + "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/field_value_match.tsx", + "lineNumber": 36 } }, { "plugin": "lists", "link": { - "path": "x-pack/plugins/lists/public/exceptions/components/builder/helpers.test.ts", - "lineNumber": 167 + "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/field_value_match_any.tsx", + "lineNumber": 13 } }, { "plugin": "lists", "link": { - "path": "x-pack/plugins/lists/public/exceptions/components/builder/helpers.test.ts", - "lineNumber": 629 + "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/field_value_match_any.tsx", + "lineNumber": 23 } }, { "plugin": "lists", "link": { - "path": "x-pack/plugins/lists/public/exceptions/components/builder/helpers.test.ts", - "lineNumber": 666 + "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/field_value_lists.tsx", + "lineNumber": 14 } }, { "plugin": "lists", "link": { - "path": "x-pack/plugins/lists/public/exceptions/components/builder/helpers.test.ts", - "lineNumber": 691 - } - }, - { - "plugin": "lens", - "link": { - "path": "x-pack/plugins/lens/public/indexpattern_datasource/types.ts", - "lineNumber": 8 - } - }, - { - "plugin": "lens", - "link": { - "path": "x-pack/plugins/lens/public/indexpattern_datasource/types.ts", - "lineNumber": 57 - } - }, - { - "plugin": "maps", - "link": { - "path": "x-pack/plugins/maps/common/elasticsearch_util/es_agg_utils.ts", - "lineNumber": 10 - } - }, - { - "plugin": "maps", - "link": { - "path": "x-pack/plugins/maps/common/elasticsearch_util/es_agg_utils.ts", - "lineNumber": 16 - } - }, - { - "plugin": "maps", - "link": { - "path": "x-pack/plugins/maps/common/elasticsearch_util/es_agg_utils.ts", + "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/field_value_lists.tsx", "lineNumber": 29 } }, { - "plugin": "maps", - "link": { - "path": "x-pack/plugins/maps/public/components/geo_field_select.tsx", - "lineNumber": 12 - } - }, - { - "plugin": "maps", - "link": { - "path": "x-pack/plugins/maps/public/components/geo_field_select.tsx", - "lineNumber": 16 - } - }, - { - "plugin": "maps", - "link": { - "path": "x-pack/plugins/maps/public/classes/sources/es_search_source/top_hits/create_source_editor.tsx", - "lineNumber": 18 - } - }, - { - "plugin": "maps", - "link": { - "path": "x-pack/plugins/maps/public/classes/sources/es_search_source/top_hits/create_source_editor.tsx", - "lineNumber": 30 - } - }, - { - "plugin": "maps", + "plugin": "lists", "link": { - "path": "x-pack/plugins/maps/public/classes/sources/es_search_source/top_hits/create_source_editor.tsx", - "lineNumber": 33 + "path": "x-pack/plugins/lists/public/exceptions/components/builder/entry_renderer.tsx", + "lineNumber": 31 } }, { - "plugin": "maps", + "plugin": "lists", "link": { - "path": "x-pack/plugins/maps/public/classes/sources/es_search_source/top_hits/create_source_editor.tsx", - "lineNumber": 35 + "path": "x-pack/plugins/lists/public/exceptions/components/builder/entry_renderer.tsx", + "lineNumber": 91 } }, { @@ -13391,192 +13328,213 @@ } }, { - "plugin": "securitySolution", + "plugin": "lens", "link": { - "path": "x-pack/plugins/security_solution/public/common/components/autocomplete/field_value_lists.tsx", - "lineNumber": 12 + "path": "x-pack/plugins/lens/target/types/public/indexpattern_datasource/types.d.ts", + "lineNumber": 1 } }, { - "plugin": "securitySolution", + "plugin": "lens", "link": { - "path": "x-pack/plugins/security_solution/public/common/components/autocomplete/field_value_lists.tsx", - "lineNumber": 20 - } + "path": "x-pack/plugins/lens/target/types/public/indexpattern_datasource/types.d.ts", + "lineNumber": 22 + } }, { - "plugin": "securitySolution", + "plugin": "lens", "link": { - "path": "x-pack/plugins/security_solution/public/common/components/autocomplete/field_value_match_any.tsx", - "lineNumber": 13 + "path": "x-pack/plugins/lens/target/types/server/routes/field_stats.d.ts", + "lineNumber": 3 } }, { - "plugin": "securitySolution", + "plugin": "lens", "link": { - "path": "x-pack/plugins/security_solution/public/common/components/autocomplete/field_value_match_any.tsx", - "lineNumber": 22 + "path": "x-pack/plugins/lens/target/types/server/routes/field_stats.d.ts", + "lineNumber": 7 } }, { - "plugin": "securitySolution", + "plugin": "lens", "link": { - "path": "x-pack/plugins/security_solution/public/common/components/autocomplete/helpers.test.ts", - "lineNumber": 11 + "path": "x-pack/plugins/lens/target/types/server/routes/field_stats.d.ts", + "lineNumber": 8 } }, { - "plugin": "securitySolution", + "plugin": "lens", "link": { - "path": "x-pack/plugins/security_solution/public/common/components/autocomplete/helpers.test.ts", + "path": "x-pack/plugins/lens/target/types/server/routes/field_stats.d.ts", + "lineNumber": 9 + } + }, + { + "plugin": "lists", + "link": { + "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/helpers.test.ts", + "lineNumber": 19 + } + }, + { + "plugin": "lists", + "link": { + "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/helpers.test.ts", "lineNumber": 333 } }, { - "plugin": "securitySolution", + "plugin": "lists", "link": { - "path": "x-pack/plugins/security_solution/public/common/components/autocomplete/helpers.test.ts", + "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/helpers.test.ts", "lineNumber": 339 } }, { - "plugin": "securitySolution", + "plugin": "lists", "link": { - "path": "x-pack/plugins/security_solution/public/common/components/autocomplete/helpers.test.ts", + "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/helpers.test.ts", "lineNumber": 347 } }, { - "plugin": "securitySolution", + "plugin": "lists", "link": { - "path": "x-pack/plugins/security_solution/public/common/components/autocomplete/helpers.test.ts", + "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/helpers.test.ts", "lineNumber": 355 } }, { - "plugin": "securitySolution", + "plugin": "lists", "link": { - "path": "x-pack/plugins/security_solution/public/common/components/autocomplete/helpers.test.ts", + "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/helpers.test.ts", "lineNumber": 363 } }, { - "plugin": "securitySolution", + "plugin": "lists", "link": { - "path": "x-pack/plugins/security_solution/public/common/components/autocomplete/helpers.test.ts", + "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/helpers.test.ts", "lineNumber": 371 } }, { - "plugin": "securitySolution", + "plugin": "lists", "link": { - "path": "x-pack/plugins/security_solution/public/common/components/autocomplete/helpers.test.ts", + "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/helpers.test.ts", "lineNumber": 380 } }, { - "plugin": "securitySolution", + "plugin": "lists", "link": { - "path": "x-pack/plugins/security_solution/public/common/components/autocomplete/operator.tsx", - "lineNumber": 11 + "path": "x-pack/plugins/lists/public/exceptions/components/builder/helpers.test.ts", + "lineNumber": 62 } }, { - "plugin": "securitySolution", + "plugin": "lists", "link": { - "path": "x-pack/plugins/security_solution/public/common/components/autocomplete/operator.tsx", - "lineNumber": 17 + "path": "x-pack/plugins/lists/public/exceptions/components/builder/helpers.test.ts", + "lineNumber": 166 } }, { - "plugin": "securitySolution", + "plugin": "lists", "link": { - "path": "x-pack/plugins/security_solution/public/common/components/exceptions/helpers.test.tsx", - "lineNumber": 43 + "path": "x-pack/plugins/lists/public/exceptions/components/builder/helpers.test.ts", + "lineNumber": 167 } }, { - "plugin": "securitySolution", + "plugin": "lists", "link": { - "path": "x-pack/plugins/security_solution/public/common/components/exceptions/helpers.test.tsx", - "lineNumber": 104 + "path": "x-pack/plugins/lists/public/exceptions/components/builder/helpers.test.ts", + "lineNumber": 629 } }, { - "plugin": "lens", + "plugin": "lists", "link": { - "path": "x-pack/plugins/lens/server/routes/field_stats.ts", - "lineNumber": 11 + "path": "x-pack/plugins/lists/public/exceptions/components/builder/helpers.test.ts", + "lineNumber": 666 } }, { - "plugin": "lens", + "plugin": "lists", "link": { - "path": "x-pack/plugins/lens/server/routes/field_stats.ts", - "lineNumber": 139 + "path": "x-pack/plugins/lists/public/exceptions/components/builder/helpers.test.ts", + "lineNumber": 691 } }, { - "plugin": "lens", + "plugin": "securitySolution", "link": { - "path": "x-pack/plugins/lens/server/routes/field_stats.ts", - "lineNumber": 248 + "path": "x-pack/plugins/security_solution/public/common/components/autocomplete/helpers.test.ts", + "lineNumber": 11 } }, { - "plugin": "lens", + "plugin": "securitySolution", "link": { - "path": "x-pack/plugins/lens/server/routes/field_stats.ts", - "lineNumber": 287 + "path": "x-pack/plugins/security_solution/public/common/components/autocomplete/helpers.test.ts", + "lineNumber": 333 } }, { - "plugin": "lens", + "plugin": "securitySolution", "link": { - "path": "x-pack/plugins/lens/server/routes/field_stats.ts", - "lineNumber": 329 + "path": "x-pack/plugins/security_solution/public/common/components/autocomplete/helpers.test.ts", + "lineNumber": 339 } }, { - "plugin": "lens", + "plugin": "securitySolution", "link": { - "path": "x-pack/plugins/lens/target/types/public/indexpattern_datasource/types.d.ts", - "lineNumber": 1 + "path": "x-pack/plugins/security_solution/public/common/components/autocomplete/helpers.test.ts", + "lineNumber": 347 } }, { - "plugin": "lens", + "plugin": "securitySolution", "link": { - "path": "x-pack/plugins/lens/target/types/public/indexpattern_datasource/types.d.ts", - "lineNumber": 22 + "path": "x-pack/plugins/security_solution/public/common/components/autocomplete/helpers.test.ts", + "lineNumber": 355 } }, { - "plugin": "lens", + "plugin": "securitySolution", "link": { - "path": "x-pack/plugins/lens/target/types/server/routes/field_stats.d.ts", - "lineNumber": 3 + "path": "x-pack/plugins/security_solution/public/common/components/autocomplete/helpers.test.ts", + "lineNumber": 363 } }, { - "plugin": "lens", + "plugin": "securitySolution", "link": { - "path": "x-pack/plugins/lens/target/types/server/routes/field_stats.d.ts", - "lineNumber": 7 + "path": "x-pack/plugins/security_solution/public/common/components/autocomplete/helpers.test.ts", + "lineNumber": 371 } }, { - "plugin": "lens", + "plugin": "securitySolution", "link": { - "path": "x-pack/plugins/lens/target/types/server/routes/field_stats.d.ts", - "lineNumber": 8 + "path": "x-pack/plugins/security_solution/public/common/components/autocomplete/helpers.test.ts", + "lineNumber": 380 } }, { - "plugin": "lens", + "plugin": "securitySolution", "link": { - "path": "x-pack/plugins/lens/target/types/server/routes/field_stats.d.ts", - "lineNumber": 9 + "path": "x-pack/plugins/security_solution/target/types/public/common/components/exceptions/helpers.test.d.ts", + "lineNumber": 1 + } + }, + { + "plugin": "securitySolution", + "link": { + "path": "x-pack/plugins/security_solution/target/types/public/common/components/exceptions/helpers.test.d.ts", + "lineNumber": 2 } }, { @@ -14103,48 +14061,6 @@ }, "deprecated": true, "references": [ - { - "plugin": "lists", - "link": { - "path": "x-pack/plugins/lists/public/exceptions/components/builder/exception_items_renderer.tsx", - "lineNumber": 34 - } - }, - { - "plugin": "lists", - "link": { - "path": "x-pack/plugins/lists/public/exceptions/components/builder/exception_items_renderer.tsx", - "lineNumber": 78 - } - }, - { - "plugin": "lists", - "link": { - "path": "x-pack/plugins/lists/public/exceptions/components/builder/exception_items_renderer.tsx", - "lineNumber": 86 - } - }, - { - "plugin": "lists", - "link": { - "path": "x-pack/plugins/lists/public/exceptions/components/builder/exception_items_renderer.tsx", - "lineNumber": 88 - } - }, - { - "plugin": "securitySolution", - "link": { - "path": "x-pack/plugins/security_solution/common/search_strategy/index_fields/index.ts", - "lineNumber": 8 - } - }, - { - "plugin": "securitySolution", - "link": { - "path": "x-pack/plugins/security_solution/common/search_strategy/index_fields/index.ts", - "lineNumber": 86 - } - }, { "plugin": "savedObjects", "link": { @@ -14237,206 +14153,178 @@ } }, { - "plugin": "savedObjectsManagement", + "plugin": "indexPatternManagement", "link": { - "path": "src/plugins/saved_objects_management/public/management_section/objects_table/components/flyout.tsx", - "lineNumber": 37 + "path": "src/plugins/index_pattern_management/public/service/list/config.ts", + "lineNumber": 10 } }, { - "plugin": "savedObjectsManagement", + "plugin": "indexPatternManagement", "link": { - "path": "src/plugins/saved_objects_management/public/management_section/objects_table/components/flyout.tsx", - "lineNumber": 89 + "path": "src/plugins/index_pattern_management/public/service/list/config.ts", + "lineNumber": 29 } }, { - "plugin": "infra", + "plugin": "indexPatternManagement", "link": { - "path": "x-pack/plugins/infra/public/containers/with_kuery_autocompletion.tsx", - "lineNumber": 9 + "path": "src/plugins/index_pattern_management/public/service/list/config.ts", + "lineNumber": 29 } }, { - "plugin": "infra", + "plugin": "indexPatternManagement", "link": { - "path": "x-pack/plugins/infra/public/containers/with_kuery_autocompletion.tsx", - "lineNumber": 24 + "path": "src/plugins/index_pattern_management/public/service/list/config.ts", + "lineNumber": 42 } }, { - "plugin": "infra", + "plugin": "indexPatternManagement", "link": { - "path": "x-pack/plugins/infra/public/pages/metrics/metrics_explorer/components/kuery_bar.tsx", - "lineNumber": 15 + "path": "src/plugins/index_pattern_management/public/service/list/config.ts", + "lineNumber": 46 } }, { - "plugin": "infra", + "plugin": "indexPatternManagement", "link": { - "path": "x-pack/plugins/infra/public/pages/metrics/metrics_explorer/components/kuery_bar.tsx", - "lineNumber": 28 + "path": "src/plugins/index_pattern_management/public/service/list/manager.ts", + "lineNumber": 9 } }, { - "plugin": "lens", + "plugin": "indexPatternManagement", "link": { - "path": "x-pack/plugins/lens/public/editor_frame_service/embeddable/embeddable.tsx", - "lineNumber": 14 + "path": "src/plugins/index_pattern_management/public/service/list/manager.ts", + "lineNumber": 32 } }, { - "plugin": "lens", + "plugin": "indexPatternManagement", "link": { - "path": "x-pack/plugins/lens/public/editor_frame_service/embeddable/embeddable.tsx", - "lineNumber": 85 + "path": "src/plugins/index_pattern_management/public/service/list/manager.ts", + "lineNumber": 32 } }, { - "plugin": "lens", + "plugin": "indexPatternManagement", "link": { - "path": "x-pack/plugins/lens/public/indexpattern_datasource/field_item.tsx", - "lineNumber": 47 + "path": "src/plugins/index_pattern_management/public/service/list/manager.ts", + "lineNumber": 43 } }, { - "plugin": "lens", + "plugin": "indexPatternManagement", "link": { - "path": "x-pack/plugins/lens/public/indexpattern_datasource/field_item.tsx", - "lineNumber": 172 + "path": "src/plugins/index_pattern_management/public/service/list/manager.ts", + "lineNumber": 50 } }, { - "plugin": "lens", + "plugin": "indexPatternManagement", "link": { - "path": "x-pack/plugins/lens/public/indexpattern_datasource/datapanel.tsx", - "lineNumber": 42 - } - }, - { - "plugin": "lens", - "link": { - "path": "x-pack/plugins/lens/public/indexpattern_datasource/datapanel.tsx", - "lineNumber": 96 - } - }, - { - "plugin": "lens", - "link": { - "path": "x-pack/plugins/lens/public/indexpattern_datasource/datapanel.tsx", - "lineNumber": 166 - } - }, - { - "plugin": "indexPatternManagement", - "link": { - "path": "src/plugins/index_pattern_management/public/service/list/config.ts", - "lineNumber": 10 - } - }, - { - "plugin": "indexPatternManagement", - "link": { - "path": "src/plugins/index_pattern_management/public/service/list/config.ts", - "lineNumber": 29 + "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/indexed_fields_table/components/table/table.tsx", + "lineNumber": 22 } }, { "plugin": "indexPatternManagement", "link": { - "path": "src/plugins/index_pattern_management/public/service/list/config.ts", - "lineNumber": 29 + "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/indexed_fields_table/components/table/table.tsx", + "lineNumber": 171 } }, { "plugin": "indexPatternManagement", "link": { - "path": "src/plugins/index_pattern_management/public/service/list/config.ts", - "lineNumber": 42 + "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/scripted_fields_table/components/table/table.tsx", + "lineNumber": 15 } }, { "plugin": "indexPatternManagement", "link": { - "path": "src/plugins/index_pattern_management/public/service/list/config.ts", - "lineNumber": 46 + "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/scripted_fields_table/components/table/table.tsx", + "lineNumber": 18 } }, { "plugin": "indexPatternManagement", "link": { - "path": "src/plugins/index_pattern_management/public/service/list/manager.ts", - "lineNumber": 9 + "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/index_header/index_header.tsx", + "lineNumber": 12 } }, { "plugin": "indexPatternManagement", "link": { - "path": "src/plugins/index_pattern_management/public/service/list/manager.ts", - "lineNumber": 32 + "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/index_header/index_header.tsx", + "lineNumber": 15 } }, { - "plugin": "indexPatternManagement", + "plugin": "savedObjectsManagement", "link": { - "path": "src/plugins/index_pattern_management/public/service/list/manager.ts", - "lineNumber": 32 + "path": "src/plugins/saved_objects_management/public/management_section/objects_table/components/flyout.tsx", + "lineNumber": 37 } }, { - "plugin": "indexPatternManagement", + "plugin": "savedObjectsManagement", "link": { - "path": "src/plugins/index_pattern_management/public/service/list/manager.ts", - "lineNumber": 43 + "path": "src/plugins/saved_objects_management/public/management_section/objects_table/components/flyout.tsx", + "lineNumber": 89 } }, { - "plugin": "indexPatternManagement", + "plugin": "lens", "link": { - "path": "src/plugins/index_pattern_management/public/service/list/manager.ts", - "lineNumber": 50 + "path": "x-pack/plugins/lens/public/editor_frame_service/embeddable/embeddable.tsx", + "lineNumber": 14 } }, { - "plugin": "indexPatternManagement", + "plugin": "lens", "link": { - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/indexed_fields_table/components/table/table.tsx", - "lineNumber": 22 + "path": "x-pack/plugins/lens/public/editor_frame_service/embeddable/embeddable.tsx", + "lineNumber": 85 } }, { - "plugin": "indexPatternManagement", + "plugin": "lens", "link": { - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/indexed_fields_table/components/table/table.tsx", - "lineNumber": 171 + "path": "x-pack/plugins/lens/public/indexpattern_datasource/field_item.tsx", + "lineNumber": 47 } }, { - "plugin": "indexPatternManagement", + "plugin": "lens", "link": { - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/scripted_fields_table/components/table/table.tsx", - "lineNumber": 15 + "path": "x-pack/plugins/lens/public/indexpattern_datasource/field_item.tsx", + "lineNumber": 172 } }, { - "plugin": "indexPatternManagement", + "plugin": "lens", "link": { - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/scripted_fields_table/components/table/table.tsx", - "lineNumber": 18 + "path": "x-pack/plugins/lens/public/indexpattern_datasource/datapanel.tsx", + "lineNumber": 42 } }, { - "plugin": "indexPatternManagement", + "plugin": "lens", "link": { - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/index_header/index_header.tsx", - "lineNumber": 12 + "path": "x-pack/plugins/lens/public/indexpattern_datasource/datapanel.tsx", + "lineNumber": 96 } }, { - "plugin": "indexPatternManagement", + "plugin": "lens", "link": { - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/index_header/index_header.tsx", - "lineNumber": 15 + "path": "x-pack/plugins/lens/public/indexpattern_datasource/datapanel.tsx", + "lineNumber": 166 } }, { @@ -14509,6 +14397,48 @@ "lineNumber": 30 } }, + { + "plugin": "apm", + "link": { + "path": "x-pack/plugins/apm/public/components/shared/KueryBar/index.tsx", + "lineNumber": 14 + } + }, + { + "plugin": "apm", + "link": { + "path": "x-pack/plugins/apm/public/components/shared/KueryBar/index.tsx", + "lineNumber": 31 + } + }, + { + "plugin": "infra", + "link": { + "path": "x-pack/plugins/infra/public/containers/with_kuery_autocompletion.tsx", + "lineNumber": 9 + } + }, + { + "plugin": "infra", + "link": { + "path": "x-pack/plugins/infra/public/containers/with_kuery_autocompletion.tsx", + "lineNumber": 24 + } + }, + { + "plugin": "infra", + "link": { + "path": "x-pack/plugins/infra/public/pages/metrics/metrics_explorer/components/kuery_bar.tsx", + "lineNumber": 15 + } + }, + { + "plugin": "infra", + "link": { + "path": "x-pack/plugins/infra/public/pages/metrics/metrics_explorer/components/kuery_bar.tsx", + "lineNumber": 28 + } + }, { "plugin": "infra", "link": { @@ -14649,32 +14579,74 @@ "lineNumber": 23 } }, + { + "plugin": "lists", + "link": { + "path": "x-pack/plugins/lists/public/exceptions/components/builder/exception_items_renderer.tsx", + "lineNumber": 34 + } + }, + { + "plugin": "lists", + "link": { + "path": "x-pack/plugins/lists/public/exceptions/components/builder/exception_items_renderer.tsx", + "lineNumber": 78 + } + }, + { + "plugin": "lists", + "link": { + "path": "x-pack/plugins/lists/public/exceptions/components/builder/exception_items_renderer.tsx", + "lineNumber": 86 + } + }, + { + "plugin": "lists", + "link": { + "path": "x-pack/plugins/lists/public/exceptions/components/builder/exception_items_renderer.tsx", + "lineNumber": 88 + } + }, { "plugin": "securitySolution", "link": { "path": "x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/types.ts", - "lineNumber": 20 + "lineNumber": 21 } }, { "plugin": "securitySolution", "link": { "path": "x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/types.ts", - "lineNumber": 64 + "lineNumber": 66 } }, { "plugin": "securitySolution", "link": { "path": "x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/store/action.ts", - "lineNumber": 17 + "lineNumber": 19 } }, { "plugin": "securitySolution", "link": { "path": "x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/store/action.ts", - "lineNumber": 98 + "lineNumber": 100 + } + }, + { + "plugin": "securitySolution", + "link": { + "path": "x-pack/plugins/security_solution/common/search_strategy/index_fields/index.ts", + "lineNumber": 8 + } + }, + { + "plugin": "securitySolution", + "link": { + "path": "x-pack/plugins/security_solution/common/search_strategy/index_fields/index.ts", + "lineNumber": 86 } }, { @@ -14912,21 +14884,21 @@ "plugin": "securitySolution", "link": { "path": "x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/store/middleware.ts", - "lineNumber": 32 + "lineNumber": 40 } }, { "plugin": "securitySolution", "link": { "path": "x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/store/middleware.ts", - "lineNumber": 38 + "lineNumber": 55 } }, { "plugin": "securitySolution", "link": { "path": "x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/store/middleware.ts", - "lineNumber": 43 + "lineNumber": 60 } }, { @@ -15013,34 +14985,6 @@ "lineNumber": 33 } }, - { - "plugin": "securitySolution", - "link": { - "path": "x-pack/plugins/security_solution/public/common/containers/kuery_autocompletion/index.tsx", - "lineNumber": 9 - } - }, - { - "plugin": "securitySolution", - "link": { - "path": "x-pack/plugins/security_solution/public/common/containers/kuery_autocompletion/index.tsx", - "lineNumber": 21 - } - }, - { - "plugin": "apm", - "link": { - "path": "x-pack/plugins/apm/public/components/shared/KueryBar/index.tsx", - "lineNumber": 14 - } - }, - { - "plugin": "apm", - "link": { - "path": "x-pack/plugins/apm/public/components/shared/KueryBar/index.tsx", - "lineNumber": 31 - } - }, { "plugin": "uptime", "link": { @@ -15083,6 +15027,20 @@ "lineNumber": 36 } }, + { + "plugin": "securitySolution", + "link": { + "path": "x-pack/plugins/security_solution/target/types/common/search_strategy/index_fields/index.d.ts", + "lineNumber": 1 + } + }, + { + "plugin": "securitySolution", + "link": { + "path": "x-pack/plugins/security_solution/target/types/common/search_strategy/index_fields/index.d.ts", + "lineNumber": 66 + } + }, { "plugin": "infra", "link": { @@ -15126,486 +15084,444 @@ } }, { - "plugin": "infra", + "plugin": "securitySolution", "link": { - "path": "x-pack/plugins/infra/target/types/public/alerting/metric_threshold/components/expression_chart.d.ts", - "lineNumber": 2 + "path": "x-pack/plugins/security_solution/target/types/public/common/containers/source/index.d.ts", + "lineNumber": 1 } }, { - "plugin": "infra", + "plugin": "securitySolution", "link": { - "path": "x-pack/plugins/infra/target/types/public/alerting/metric_threshold/components/expression_chart.d.ts", - "lineNumber": 7 + "path": "x-pack/plugins/security_solution/target/types/public/common/containers/source/index.d.ts", + "lineNumber": 10 } }, { - "plugin": "infra", + "plugin": "securitySolution", "link": { - "path": "x-pack/plugins/infra/target/types/public/alerting/metric_threshold/hooks/use_metrics_explorer_chart_data.d.ts", - "lineNumber": 1 - } - }, - { - "plugin": "infra", - "link": { - "path": "x-pack/plugins/infra/target/types/public/alerting/metric_threshold/hooks/use_metrics_explorer_chart_data.d.ts", - "lineNumber": 4 + "path": "x-pack/plugins/security_solution/target/types/public/common/containers/source/index.d.ts", + "lineNumber": 23 } }, { "plugin": "infra", "link": { - "path": "x-pack/plugins/infra/target/types/public/pages/metrics/metrics_explorer/index.d.ts", - "lineNumber": 1 + "path": "x-pack/plugins/infra/target/types/public/alerting/metric_threshold/components/expression_chart.d.ts", + "lineNumber": 2 } }, { "plugin": "infra", "link": { - "path": "x-pack/plugins/infra/target/types/public/pages/metrics/metrics_explorer/index.d.ts", - "lineNumber": 5 + "path": "x-pack/plugins/infra/target/types/public/alerting/metric_threshold/components/expression_chart.d.ts", + "lineNumber": 7 } }, { "plugin": "infra", "link": { - "path": "x-pack/plugins/infra/target/types/public/pages/metrics/metrics_explorer/hooks/use_metric_explorer_state.d.ts", + "path": "x-pack/plugins/infra/target/types/public/alerting/metric_threshold/hooks/use_metrics_explorer_chart_data.d.ts", "lineNumber": 1 } }, { "plugin": "infra", "link": { - "path": "x-pack/plugins/infra/target/types/public/pages/metrics/metrics_explorer/hooks/use_metric_explorer_state.d.ts", - "lineNumber": 11 + "path": "x-pack/plugins/infra/target/types/public/alerting/metric_threshold/hooks/use_metrics_explorer_chart_data.d.ts", + "lineNumber": 4 } }, { "plugin": "infra", "link": { - "path": "x-pack/plugins/infra/target/types/public/pages/metrics/metrics_explorer/hooks/use_metrics_explorer_data.d.ts", + "path": "x-pack/plugins/infra/target/types/public/pages/metrics/metrics_explorer/index.d.ts", "lineNumber": 1 } }, { "plugin": "infra", "link": { - "path": "x-pack/plugins/infra/target/types/public/pages/metrics/metrics_explorer/hooks/use_metrics_explorer_data.d.ts", - "lineNumber": 4 + "path": "x-pack/plugins/infra/target/types/public/pages/metrics/metrics_explorer/index.d.ts", + "lineNumber": 5 } }, { - "plugin": "ml", + "plugin": "securitySolution", "link": { - "path": "x-pack/plugins/ml/target/types/public/application/jobs/new_job/common/index_pattern_context.d.ts", - "lineNumber": 2 + "path": "x-pack/plugins/security_solution/target/types/public/common/components/url_state/types.d.ts", + "lineNumber": 3 } }, { - "plugin": "ml", + "plugin": "securitySolution", "link": { - "path": "x-pack/plugins/ml/target/types/public/application/jobs/new_job/common/index_pattern_context.d.ts", - "lineNumber": 3 + "path": "x-pack/plugins/security_solution/target/types/public/common/components/url_state/types.d.ts", + "lineNumber": 25 } }, { - "plugin": "ml", + "plugin": "securitySolution", "link": { - "path": "x-pack/plugins/ml/target/types/public/application/jobs/new_job/common/index_pattern_context.d.ts", - "lineNumber": 4 + "path": "x-pack/plugins/security_solution/target/types/public/common/components/url_state/types.d.ts", + "lineNumber": 55 } }, { - "plugin": "lists", + "plugin": "securitySolution", "link": { - "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/field.tsx", - "lineNumber": 11 + "path": "x-pack/plugins/security_solution/target/types/public/network/components/network_top_countries_table/columns.d.ts", + "lineNumber": 1 } }, { - "plugin": "lists", + "plugin": "securitySolution", "link": { - "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/field.tsx", - "lineNumber": 21 + "path": "x-pack/plugins/security_solution/target/types/public/network/components/network_top_countries_table/columns.d.ts", + "lineNumber": 20 } }, { - "plugin": "lists", + "plugin": "securitySolution", "link": { - "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/field.tsx", - "lineNumber": 100 + "path": "x-pack/plugins/security_solution/target/types/public/network/components/network_top_countries_table/columns.d.ts", + "lineNumber": 21 } }, { - "plugin": "lists", + "plugin": "securitySolution", "link": { - "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/field.tsx", - "lineNumber": 121 + "path": "x-pack/plugins/security_solution/target/types/public/common/components/search_bar/index.d.ts", + "lineNumber": 3 } }, { - "plugin": "lists", + "plugin": "securitySolution", "link": { - "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/hooks/use_field_value_autocomplete.ts", - "lineNumber": 13 + "path": "x-pack/plugins/security_solution/target/types/public/common/components/search_bar/index.d.ts", + "lineNumber": 9 } }, { - "plugin": "lists", + "plugin": "securitySolution", "link": { - "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/hooks/use_field_value_autocomplete.ts", - "lineNumber": 17 + "path": "x-pack/plugins/security_solution/target/types/public/hosts/pages/details/types.d.ts", + "lineNumber": 2 } }, { - "plugin": "lists", + "plugin": "securitySolution", "link": { - "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/hooks/use_field_value_autocomplete.ts", - "lineNumber": 29 + "path": "x-pack/plugins/security_solution/target/types/public/hosts/pages/details/types.d.ts", + "lineNumber": 40 } }, { - "plugin": "lists", + "plugin": "securitySolution", "link": { - "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/field_value_match.tsx", - "lineNumber": 19 + "path": "x-pack/plugins/security_solution/target/types/public/network/components/network_top_countries_table/index.d.ts", + "lineNumber": 2 } }, { - "plugin": "lists", + "plugin": "securitySolution", "link": { - "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/field_value_match.tsx", - "lineNumber": 38 + "path": "x-pack/plugins/security_solution/target/types/public/network/components/network_top_countries_table/index.d.ts", + "lineNumber": 10 } }, { - "plugin": "lists", + "plugin": "securitySolution", "link": { - "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/field_value_match_any.tsx", - "lineNumber": 13 + "path": "x-pack/plugins/security_solution/target/types/public/network/pages/details/types.d.ts", + "lineNumber": 1 } }, { - "plugin": "lists", + "plugin": "securitySolution", "link": { - "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/field_value_match_any.tsx", + "path": "x-pack/plugins/security_solution/target/types/public/network/pages/details/types.d.ts", "lineNumber": 25 } }, { - "plugin": "lists", + "plugin": "infra", "link": { - "path": "x-pack/plugins/lists/public/exceptions/components/builder/entry_renderer.tsx", - "lineNumber": 31 + "path": "x-pack/plugins/infra/target/types/public/pages/metrics/metrics_explorer/hooks/use_metric_explorer_state.d.ts", + "lineNumber": 1 } }, { - "plugin": "lists", + "plugin": "infra", "link": { - "path": "x-pack/plugins/lists/public/exceptions/components/builder/entry_renderer.tsx", - "lineNumber": 53 + "path": "x-pack/plugins/infra/target/types/public/pages/metrics/metrics_explorer/hooks/use_metric_explorer_state.d.ts", + "lineNumber": 11 } }, { - "plugin": "lists", + "plugin": "infra", "link": { - "path": "x-pack/plugins/lists/public/exceptions/components/builder/entry_renderer.tsx", - "lineNumber": 58 + "path": "x-pack/plugins/infra/target/types/public/pages/metrics/metrics_explorer/hooks/use_metrics_explorer_data.d.ts", + "lineNumber": 1 } }, { - "plugin": "lists", + "plugin": "infra", "link": { - "path": "x-pack/plugins/lists/public/exceptions/components/builder/entry_renderer.tsx", - "lineNumber": 61 + "path": "x-pack/plugins/infra/target/types/public/pages/metrics/metrics_explorer/hooks/use_metrics_explorer_data.d.ts", + "lineNumber": 4 } }, { - "plugin": "lists", + "plugin": "ml", "link": { - "path": "x-pack/plugins/lists/public/exceptions/components/builder/exception_item_renderer.tsx", - "lineNumber": 22 + "path": "x-pack/plugins/ml/target/types/public/application/jobs/new_job/common/index_pattern_context.d.ts", + "lineNumber": 2 } }, { - "plugin": "lists", + "plugin": "ml", "link": { - "path": "x-pack/plugins/lists/public/exceptions/components/builder/exception_item_renderer.tsx", - "lineNumber": 50 + "path": "x-pack/plugins/ml/target/types/public/application/jobs/new_job/common/index_pattern_context.d.ts", + "lineNumber": 3 } }, { - "plugin": "lists", + "plugin": "ml", "link": { - "path": "x-pack/plugins/lists/public/exceptions/components/builder/exception_item_renderer.tsx", - "lineNumber": 55 + "path": "x-pack/plugins/ml/target/types/public/application/jobs/new_job/common/index_pattern_context.d.ts", + "lineNumber": 4 } }, { - "plugin": "lists", + "plugin": "ml", "link": { - "path": "x-pack/plugins/lists/public/exceptions/components/builder/exception_item_renderer.tsx", - "lineNumber": 58 + "path": "x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components/action_clone/clone_action_name.tsx", + "lineNumber": 12 } }, { - "plugin": "lists", + "plugin": "ml", "link": { - "path": "x-pack/plugins/lists/public/exceptions/components/builder/helpers.test.ts", - "lineNumber": 62 + "path": "x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components/action_clone/clone_action_name.tsx", + "lineNumber": 412 } }, { - "plugin": "lists", + "plugin": "ml", "link": { - "path": "x-pack/plugins/lists/public/exceptions/components/builder/helpers.test.ts", - "lineNumber": 96 + "path": "x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components/action_delete/use_delete_action.tsx", + "lineNumber": 12 } }, { - "plugin": "lists", + "plugin": "ml", "link": { - "path": "x-pack/plugins/lists/public/exceptions/components/builder/helpers.test.ts", - "lineNumber": 169 + "path": "x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components/action_delete/use_delete_action.tsx", + "lineNumber": 60 } }, { - "plugin": "lists", + "plugin": "ml", "link": { - "path": "x-pack/plugins/lists/public/exceptions/components/builder/helpers.test.ts", - "lineNumber": 169 + "path": "x-pack/plugins/ml/public/application/jobs/components/custom_url_editor/utils.d.ts", + "lineNumber": 8 } }, { - "plugin": "lists", + "plugin": "ml", "link": { - "path": "x-pack/plugins/lists/public/exceptions/components/builder/helpers.test.ts", - "lineNumber": 184 + "path": "x-pack/plugins/ml/public/application/jobs/components/custom_url_editor/utils.d.ts", + "lineNumber": 37 } }, { - "plugin": "lists", + "plugin": "ml", "link": { - "path": "x-pack/plugins/lists/public/exceptions/components/builder/helpers.test.ts", - "lineNumber": 187 + "path": "x-pack/plugins/ml/public/application/jobs/jobs_list/components/edit_job_flyout/edit_utils.d.ts", + "lineNumber": 8 } }, { - "plugin": "lists", + "plugin": "ml", "link": { - "path": "x-pack/plugins/lists/public/exceptions/components/builder/helpers.test.ts", - "lineNumber": 196 + "path": "x-pack/plugins/ml/public/application/jobs/jobs_list/components/edit_job_flyout/edit_utils.d.ts", + "lineNumber": 11 } }, { - "plugin": "lists", + "plugin": "ml", "link": { - "path": "x-pack/plugins/lists/public/exceptions/components/builder/helpers.test.ts", - "lineNumber": 199 + "path": "x-pack/plugins/ml/public/application/datavisualizer/index_based/components/actions_panel/actions_panel.tsx", + "lineNumber": 25 } }, { - "plugin": "lists", + "plugin": "ml", "link": { - "path": "x-pack/plugins/lists/public/exceptions/components/builder/helpers.test.ts", - "lineNumber": 208 + "path": "x-pack/plugins/ml/public/application/datavisualizer/index_based/components/actions_panel/actions_panel.tsx", + "lineNumber": 28 } }, { - "plugin": "lists", + "plugin": "infra", "link": { - "path": "x-pack/plugins/lists/public/exceptions/components/builder/helpers.test.ts", - "lineNumber": 214 + "path": "x-pack/plugins/infra/public/pages/metrics/index.tsx", + "lineNumber": 14 } }, { - "plugin": "lists", + "plugin": "infra", "link": { - "path": "x-pack/plugins/lists/public/exceptions/components/builder/helpers.test.ts", - "lineNumber": 226 + "path": "x-pack/plugins/infra/public/pages/metrics/index.tsx", + "lineNumber": 193 } }, { - "plugin": "lists", + "plugin": "visTypeTimeseries", "link": { - "path": "x-pack/plugins/lists/public/exceptions/components/builder/helpers.test.ts", - "lineNumber": 229 + "path": "src/plugins/vis_type_timeseries/common/index_patterns_utils.ts", + "lineNumber": 11 } }, { - "plugin": "lists", + "plugin": "visTypeTimeseries", "link": { - "path": "x-pack/plugins/lists/public/exceptions/components/builder/helpers.test.ts", - "lineNumber": 239 + "path": "src/plugins/vis_type_timeseries/common/index_patterns_utils.ts", + "lineNumber": 20 } }, { "plugin": "lists", "link": { - "path": "x-pack/plugins/lists/public/exceptions/components/builder/helpers.test.ts", - "lineNumber": 267 + "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/field.tsx", + "lineNumber": 11 } }, { "plugin": "lists", "link": { - "path": "x-pack/plugins/lists/public/exceptions/components/builder/helpers.test.ts", - "lineNumber": 285 + "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/field.tsx", + "lineNumber": 21 } }, { "plugin": "lists", "link": { - "path": "x-pack/plugins/lists/public/exceptions/components/builder/helpers.test.ts", - "lineNumber": 320 + "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/field.tsx", + "lineNumber": 100 } }, { "plugin": "lists", "link": { - "path": "x-pack/plugins/lists/public/exceptions/components/builder/helpers.test.ts", - "lineNumber": 336 + "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/field.tsx", + "lineNumber": 121 } }, { "plugin": "lists", "link": { - "path": "x-pack/plugins/lists/public/exceptions/components/builder/helpers.test.ts", - "lineNumber": 1026 + "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/hooks/use_field_value_autocomplete.ts", + "lineNumber": 13 } }, { "plugin": "lists", "link": { - "path": "x-pack/plugins/lists/public/exceptions/components/builder/helpers.test.ts", - "lineNumber": 1045 + "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/hooks/use_field_value_autocomplete.ts", + "lineNumber": 17 } }, { "plugin": "lists", "link": { - "path": "x-pack/plugins/lists/public/exceptions/components/builder/helpers.test.ts", - "lineNumber": 1095 + "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/hooks/use_field_value_autocomplete.ts", + "lineNumber": 29 } }, { "plugin": "lists", "link": { - "path": "x-pack/plugins/lists/public/exceptions/components/builder/helpers.test.ts", - "lineNumber": 1251 + "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/field_value_match.tsx", + "lineNumber": 19 } }, { "plugin": "lists", "link": { - "path": "x-pack/plugins/lists/public/exceptions/components/builder/helpers.test.ts", - "lineNumber": 1302 + "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/field_value_match.tsx", + "lineNumber": 38 } }, { "plugin": "lists", "link": { - "path": "x-pack/plugins/lists/public/exceptions/components/builder/helpers.test.ts", - "lineNumber": 1352 + "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/field_value_match_any.tsx", + "lineNumber": 13 } }, { - "plugin": "securitySolution", + "plugin": "lists", "link": { - "path": "x-pack/plugins/security_solution/common/detection_engine/get_query_filter.ts", - "lineNumber": 15 + "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/field_value_match_any.tsx", + "lineNumber": 25 } }, { - "plugin": "securitySolution", + "plugin": "lists", "link": { - "path": "x-pack/plugins/security_solution/common/detection_engine/get_query_filter.ts", + "path": "x-pack/plugins/lists/public/exceptions/components/builder/entry_renderer.tsx", "lineNumber": 31 } }, { - "plugin": "ml", - "link": { - "path": "x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components/action_clone/clone_action_name.tsx", - "lineNumber": 12 - } - }, - { - "plugin": "ml", - "link": { - "path": "x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components/action_clone/clone_action_name.tsx", - "lineNumber": 412 - } - }, - { - "plugin": "ml", - "link": { - "path": "x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components/action_delete/use_delete_action.tsx", - "lineNumber": 12 - } - }, - { - "plugin": "ml", - "link": { - "path": "x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components/action_delete/use_delete_action.tsx", - "lineNumber": 60 - } - }, - { - "plugin": "ml", - "link": { - "path": "x-pack/plugins/ml/public/application/jobs/components/custom_url_editor/utils.d.ts", - "lineNumber": 8 - } - }, - { - "plugin": "ml", + "plugin": "lists", "link": { - "path": "x-pack/plugins/ml/public/application/jobs/components/custom_url_editor/utils.d.ts", - "lineNumber": 37 + "path": "x-pack/plugins/lists/public/exceptions/components/builder/entry_renderer.tsx", + "lineNumber": 53 } }, { - "plugin": "ml", + "plugin": "lists", "link": { - "path": "x-pack/plugins/ml/public/application/jobs/jobs_list/components/edit_job_flyout/edit_utils.d.ts", - "lineNumber": 8 + "path": "x-pack/plugins/lists/public/exceptions/components/builder/entry_renderer.tsx", + "lineNumber": 58 } }, { - "plugin": "ml", + "plugin": "lists", "link": { - "path": "x-pack/plugins/ml/public/application/jobs/jobs_list/components/edit_job_flyout/edit_utils.d.ts", - "lineNumber": 11 + "path": "x-pack/plugins/lists/public/exceptions/components/builder/entry_renderer.tsx", + "lineNumber": 61 } }, { - "plugin": "ml", + "plugin": "lists", "link": { - "path": "x-pack/plugins/ml/public/application/datavisualizer/index_based/components/actions_panel/actions_panel.tsx", - "lineNumber": 25 + "path": "x-pack/plugins/lists/public/exceptions/components/builder/exception_item_renderer.tsx", + "lineNumber": 22 } }, { - "plugin": "ml", + "plugin": "lists", "link": { - "path": "x-pack/plugins/ml/public/application/datavisualizer/index_based/components/actions_panel/actions_panel.tsx", - "lineNumber": 28 + "path": "x-pack/plugins/lists/public/exceptions/components/builder/exception_item_renderer.tsx", + "lineNumber": 50 } }, { - "plugin": "infra", + "plugin": "lists", "link": { - "path": "x-pack/plugins/infra/public/pages/metrics/index.tsx", - "lineNumber": 14 + "path": "x-pack/plugins/lists/public/exceptions/components/builder/exception_item_renderer.tsx", + "lineNumber": 55 } }, { - "plugin": "infra", + "plugin": "lists", "link": { - "path": "x-pack/plugins/infra/public/pages/metrics/index.tsx", - "lineNumber": 193 + "path": "x-pack/plugins/lists/public/exceptions/components/builder/exception_item_renderer.tsx", + "lineNumber": 58 } }, { @@ -15629,6 +15545,20 @@ "lineNumber": 53 } }, + { + "plugin": "securitySolution", + "link": { + "path": "x-pack/plugins/security_solution/common/detection_engine/get_query_filter.ts", + "lineNumber": 16 + } + }, + { + "plugin": "securitySolution", + "link": { + "path": "x-pack/plugins/security_solution/common/detection_engine/get_query_filter.ts", + "lineNumber": 31 + } + }, { "plugin": "securitySolution", "link": { @@ -15756,164 +15686,220 @@ } }, { - "plugin": "securitySolution", + "plugin": "stackAlerts", "link": { - "path": "x-pack/plugins/security_solution/public/common/components/autocomplete/field_value_match_any.tsx", + "path": "x-pack/plugins/stack_alerts/server/alert_types/geo_containment/es_query_builder.ts", "lineNumber": 13 } }, { - "plugin": "securitySolution", + "plugin": "stackAlerts", "link": { - "path": "x-pack/plugins/security_solution/public/common/components/autocomplete/field_value_match_any.tsx", - "lineNumber": 24 + "path": "x-pack/plugins/stack_alerts/server/alert_types/geo_containment/es_query_builder.ts", + "lineNumber": 25 } }, { - "plugin": "securitySolution", + "plugin": "infra", "link": { - "path": "x-pack/plugins/security_solution/public/common/components/exceptions/helpers.test.tsx", - "lineNumber": 43 + "path": "x-pack/plugins/infra/common/dependency_mocks/index_patterns.ts", + "lineNumber": 13 } }, { - "plugin": "securitySolution", + "plugin": "infra", "link": { - "path": "x-pack/plugins/security_solution/public/common/components/exceptions/helpers.test.tsx", - "lineNumber": 49 + "path": "x-pack/plugins/infra/common/dependency_mocks/index_patterns.ts", + "lineNumber": 30 } }, { - "plugin": "securitySolution", + "plugin": "infra", "link": { - "path": "x-pack/plugins/security_solution/public/common/components/exceptions/helpers.test.tsx", - "lineNumber": 368 + "path": "x-pack/plugins/infra/target/types/common/dependency_mocks/index_patterns.d.ts", + "lineNumber": 1 } }, { - "plugin": "visTypeTimeseries", + "plugin": "infra", "link": { - "path": "src/plugins/vis_type_timeseries/common/index_patterns_utils.ts", - "lineNumber": 11 + "path": "x-pack/plugins/infra/target/types/common/dependency_mocks/index_patterns.d.ts", + "lineNumber": 3 } }, { - "plugin": "visTypeTimeseries", + "plugin": "lists", "link": { - "path": "src/plugins/vis_type_timeseries/common/index_patterns_utils.ts", - "lineNumber": 20 + "path": "x-pack/plugins/lists/public/exceptions/components/builder/helpers.test.ts", + "lineNumber": 62 } }, { - "plugin": "stackAlerts", + "plugin": "lists", "link": { - "path": "x-pack/plugins/stack_alerts/server/alert_types/geo_containment/es_query_builder.ts", - "lineNumber": 13 + "path": "x-pack/plugins/lists/public/exceptions/components/builder/helpers.test.ts", + "lineNumber": 96 } }, { - "plugin": "stackAlerts", + "plugin": "lists", "link": { - "path": "x-pack/plugins/stack_alerts/server/alert_types/geo_containment/es_query_builder.ts", - "lineNumber": 25 + "path": "x-pack/plugins/lists/public/exceptions/components/builder/helpers.test.ts", + "lineNumber": 169 } }, { - "plugin": "infra", + "plugin": "lists", "link": { - "path": "x-pack/plugins/infra/common/dependency_mocks/index_patterns.ts", - "lineNumber": 13 + "path": "x-pack/plugins/lists/public/exceptions/components/builder/helpers.test.ts", + "lineNumber": 169 } }, { - "plugin": "infra", + "plugin": "lists", "link": { - "path": "x-pack/plugins/infra/common/dependency_mocks/index_patterns.ts", - "lineNumber": 30 + "path": "x-pack/plugins/lists/public/exceptions/components/builder/helpers.test.ts", + "lineNumber": 184 } }, { - "plugin": "infra", + "plugin": "lists", "link": { - "path": "x-pack/plugins/infra/target/types/common/dependency_mocks/index_patterns.d.ts", - "lineNumber": 1 + "path": "x-pack/plugins/lists/public/exceptions/components/builder/helpers.test.ts", + "lineNumber": 187 } }, { - "plugin": "infra", + "plugin": "lists", "link": { - "path": "x-pack/plugins/infra/target/types/common/dependency_mocks/index_patterns.d.ts", - "lineNumber": 3 + "path": "x-pack/plugins/lists/public/exceptions/components/builder/helpers.test.ts", + "lineNumber": 196 } }, { - "plugin": "discover", + "plugin": "lists", "link": { - "path": "src/plugins/discover/public/application/components/context_app/context_app_legacy.tsx", - "lineNumber": 17 + "path": "x-pack/plugins/lists/public/exceptions/components/builder/helpers.test.ts", + "lineNumber": 199 } }, { - "plugin": "discover", + "plugin": "lists", "link": { - "path": "src/plugins/discover/public/application/components/context_app/context_app_legacy.tsx", - "lineNumber": 26 + "path": "x-pack/plugins/lists/public/exceptions/components/builder/helpers.test.ts", + "lineNumber": 208 } }, { - "plugin": "observability", + "plugin": "lists", "link": { - "path": "x-pack/plugins/observability/public/components/shared/exploratory_view/types.ts", - "lineNumber": 18 + "path": "x-pack/plugins/lists/public/exceptions/components/builder/helpers.test.ts", + "lineNumber": 214 } }, { - "plugin": "observability", + "plugin": "lists", "link": { - "path": "x-pack/plugins/observability/public/components/shared/exploratory_view/types.ts", - "lineNumber": 95 + "path": "x-pack/plugins/lists/public/exceptions/components/builder/helpers.test.ts", + "lineNumber": 226 } }, { - "plugin": "observability", + "plugin": "lists", "link": { - "path": "x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/utils.ts", - "lineNumber": 10 + "path": "x-pack/plugins/lists/public/exceptions/components/builder/helpers.test.ts", + "lineNumber": 229 } }, { - "plugin": "observability", + "plugin": "lists", "link": { - "path": "x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/utils.ts", - "lineNumber": 53 + "path": "x-pack/plugins/lists/public/exceptions/components/builder/helpers.test.ts", + "lineNumber": 239 } }, { - "plugin": "observability", + "plugin": "lists", "link": { - "path": "x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/utils.ts", - "lineNumber": 61 + "path": "x-pack/plugins/lists/public/exceptions/components/builder/helpers.test.ts", + "lineNumber": 267 } }, { - "plugin": "observability", + "plugin": "lists", "link": { - "path": "x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/utils.ts", - "lineNumber": 69 + "path": "x-pack/plugins/lists/public/exceptions/components/builder/helpers.test.ts", + "lineNumber": 285 } }, { - "plugin": "observability", + "plugin": "lists", "link": { - "path": "x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/default_configs.ts", - "lineNumber": 19 + "path": "x-pack/plugins/lists/public/exceptions/components/builder/helpers.test.ts", + "lineNumber": 320 } }, { - "plugin": "observability", + "plugin": "lists", "link": { - "path": "x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/default_configs.ts", - "lineNumber": 24 + "path": "x-pack/plugins/lists/public/exceptions/components/builder/helpers.test.ts", + "lineNumber": 336 + } + }, + { + "plugin": "lists", + "link": { + "path": "x-pack/plugins/lists/public/exceptions/components/builder/helpers.test.ts", + "lineNumber": 1026 + } + }, + { + "plugin": "lists", + "link": { + "path": "x-pack/plugins/lists/public/exceptions/components/builder/helpers.test.ts", + "lineNumber": 1045 + } + }, + { + "plugin": "lists", + "link": { + "path": "x-pack/plugins/lists/public/exceptions/components/builder/helpers.test.ts", + "lineNumber": 1095 + } + }, + { + "plugin": "lists", + "link": { + "path": "x-pack/plugins/lists/public/exceptions/components/builder/helpers.test.ts", + "lineNumber": 1251 + } + }, + { + "plugin": "lists", + "link": { + "path": "x-pack/plugins/lists/public/exceptions/components/builder/helpers.test.ts", + "lineNumber": 1302 + } + }, + { + "plugin": "lists", + "link": { + "path": "x-pack/plugins/lists/public/exceptions/components/builder/helpers.test.ts", + "lineNumber": 1352 + } + }, + { + "plugin": "discover", + "link": { + "path": "src/plugins/discover/public/application/components/context_app/context_app_legacy.tsx", + "lineNumber": 17 + } + }, + { + "plugin": "discover", + "link": { + "path": "src/plugins/discover/public/application/components/context_app/context_app_legacy.tsx", + "lineNumber": 26 } }, { @@ -15980,52 +15966,108 @@ } }, { - "plugin": "ml", + "plugin": "ml", + "link": { + "path": "x-pack/plugins/ml/public/application/jobs/jobs_list/components/edit_job_flyout/tabs/custom_urls.tsx", + "lineNumber": 57 + } + }, + { + "plugin": "ml", + "link": { + "path": "x-pack/plugins/ml/public/application/datavisualizer/index_based/components/field_data_row/action_menu/lens_utils.ts", + "lineNumber": 14 + } + }, + { + "plugin": "ml", + "link": { + "path": "x-pack/plugins/ml/public/application/datavisualizer/index_based/components/field_data_row/action_menu/lens_utils.ts", + "lineNumber": 27 + } + }, + { + "plugin": "ml", + "link": { + "path": "x-pack/plugins/ml/public/application/datavisualizer/index_based/components/field_data_row/action_menu/lens_utils.ts", + "lineNumber": 213 + } + }, + { + "plugin": "ml", + "link": { + "path": "x-pack/plugins/ml/public/application/datavisualizer/index_based/components/field_data_row/action_menu/lens_utils.ts", + "lineNumber": 234 + } + }, + { + "plugin": "ml", + "link": { + "path": "x-pack/plugins/ml/public/application/datavisualizer/index_based/components/field_data_row/action_menu/actions.ts", + "lineNumber": 12 + } + }, + { + "plugin": "ml", + "link": { + "path": "x-pack/plugins/ml/public/application/datavisualizer/index_based/components/field_data_row/action_menu/actions.ts", + "lineNumber": 17 + } + }, + { + "plugin": "observability", + "link": { + "path": "x-pack/plugins/observability/public/components/shared/exploratory_view/types.ts", + "lineNumber": 18 + } + }, + { + "plugin": "observability", "link": { - "path": "x-pack/plugins/ml/public/application/jobs/jobs_list/components/edit_job_flyout/tabs/custom_urls.tsx", - "lineNumber": 57 + "path": "x-pack/plugins/observability/public/components/shared/exploratory_view/types.ts", + "lineNumber": 95 } }, { - "plugin": "ml", + "plugin": "observability", "link": { - "path": "x-pack/plugins/ml/public/application/datavisualizer/index_based/components/field_data_row/action_menu/lens_utils.ts", - "lineNumber": 14 + "path": "x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/utils.ts", + "lineNumber": 10 } }, { - "plugin": "ml", + "plugin": "observability", "link": { - "path": "x-pack/plugins/ml/public/application/datavisualizer/index_based/components/field_data_row/action_menu/lens_utils.ts", - "lineNumber": 27 + "path": "x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/utils.ts", + "lineNumber": 53 } }, { - "plugin": "ml", + "plugin": "observability", "link": { - "path": "x-pack/plugins/ml/public/application/datavisualizer/index_based/components/field_data_row/action_menu/lens_utils.ts", - "lineNumber": 213 + "path": "x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/utils.ts", + "lineNumber": 61 } }, { - "plugin": "ml", + "plugin": "observability", "link": { - "path": "x-pack/plugins/ml/public/application/datavisualizer/index_based/components/field_data_row/action_menu/lens_utils.ts", - "lineNumber": 234 + "path": "x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/utils.ts", + "lineNumber": 69 } }, { - "plugin": "ml", + "plugin": "observability", "link": { - "path": "x-pack/plugins/ml/public/application/datavisualizer/index_based/components/field_data_row/action_menu/actions.ts", - "lineNumber": 12 + "path": "x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/default_configs.ts", + "lineNumber": 19 } }, { - "plugin": "ml", + "plugin": "observability", "link": { - "path": "x-pack/plugins/ml/public/application/datavisualizer/index_based/components/field_data_row/action_menu/actions.ts", - "lineNumber": 17 + "path": "x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/default_configs.ts", + "lineNumber": 24 } }, { @@ -16098,20 +16140,6 @@ "lineNumber": 19 } }, - { - "plugin": "securitySolution", - "link": { - "path": "x-pack/plugins/security_solution/public/common/mock/index_pattern.ts", - "lineNumber": 8 - } - }, - { - "plugin": "securitySolution", - "link": { - "path": "x-pack/plugins/security_solution/public/common/mock/index_pattern.ts", - "lineNumber": 10 - } - }, { "plugin": "stackAlerts", "link": { @@ -16231,6 +16259,20 @@ "lineNumber": 13 } }, + { + "plugin": "securitySolution", + "link": { + "path": "x-pack/plugins/security_solution/public/common/mock/index_pattern.ts", + "lineNumber": 8 + } + }, + { + "plugin": "securitySolution", + "link": { + "path": "x-pack/plugins/security_solution/public/common/mock/index_pattern.ts", + "lineNumber": 10 + } + }, { "plugin": "ml", "link": { @@ -33252,111 +33294,6 @@ "lineNumber": 58 } }, - { - "plugin": "fleet", - "link": { - "path": "x-pack/plugins/fleet/public/applications/fleet/components/search_bar.tsx", - "lineNumber": 10 - } - }, - { - "plugin": "fleet", - "link": { - "path": "x-pack/plugins/fleet/public/applications/fleet/components/search_bar.tsx", - "lineNumber": 33 - } - }, - { - "plugin": "fleet", - "link": { - "path": "x-pack/plugins/fleet/public/applications/fleet/components/search_bar.tsx", - "lineNumber": 51 - } - }, - { - "plugin": "indexPatternManagement", - "link": { - "path": "src/plugins/index_pattern_management/public/service/list/config.ts", - "lineNumber": 10 - } - }, - { - "plugin": "indexPatternManagement", - "link": { - "path": "src/plugins/index_pattern_management/public/service/list/config.ts", - "lineNumber": 42 - } - }, - { - "plugin": "indexPatternManagement", - "link": { - "path": "src/plugins/index_pattern_management/public/service/list/manager.ts", - "lineNumber": 9 - } - }, - { - "plugin": "indexPatternManagement", - "link": { - "path": "src/plugins/index_pattern_management/public/service/list/manager.ts", - "lineNumber": 43 - } - }, - { - "plugin": "indexPatternManagement", - "link": { - "path": "src/plugins/index_pattern_management/public/components/create_index_pattern_wizard/lib/extract_time_fields.ts", - "lineNumber": 10 - } - }, - { - "plugin": "indexPatternManagement", - "link": { - "path": "src/plugins/index_pattern_management/public/components/create_index_pattern_wizard/lib/extract_time_fields.ts", - "lineNumber": 12 - } - }, - { - "plugin": "indexPatternManagement", - "link": { - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/indexed_fields_table/types.ts", - "lineNumber": 9 - } - }, - { - "plugin": "indexPatternManagement", - "link": { - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/indexed_fields_table/types.ts", - "lineNumber": 11 - } - }, - { - "plugin": "indexPatternManagement", - "link": { - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/indexed_fields_table/indexed_fields_table.tsx", - "lineNumber": 11 - } - }, - { - "plugin": "indexPatternManagement", - "link": { - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/indexed_fields_table/indexed_fields_table.tsx", - "lineNumber": 23 - } - }, - { - "plugin": "indexPatternManagement", - "link": { - "path": "src/plugins/index_pattern_management/public/components/field_editor/field_editor.tsx", - "lineNumber": 45 - } - }, - { - "plugin": "indexPatternManagement", - "link": { - "path": "src/plugins/index_pattern_management/public/components/field_editor/field_editor.tsx", - "lineNumber": 148 - } - }, { "plugin": "maps", "link": { @@ -33701,24 +33638,108 @@ } }, { - "plugin": "maps", + "plugin": "maps", + "link": { + "path": "x-pack/plugins/maps/public/classes/layers/choropleth_layer_wizard/layer_template.tsx", + "lineNumber": 59 + } + }, + { + "plugin": "maps", + "link": { + "path": "x-pack/plugins/maps/public/classes/layers/choropleth_layer_wizard/layer_template.tsx", + "lineNumber": 60 + } + }, + { + "plugin": "maps", + "link": { + "path": "x-pack/plugins/maps/public/classes/layers/choropleth_layer_wizard/layer_template.tsx", + "lineNumber": 66 + } + }, + { + "plugin": "indexPatternManagement", + "link": { + "path": "src/plugins/index_pattern_management/public/service/list/config.ts", + "lineNumber": 10 + } + }, + { + "plugin": "indexPatternManagement", + "link": { + "path": "src/plugins/index_pattern_management/public/service/list/config.ts", + "lineNumber": 42 + } + }, + { + "plugin": "indexPatternManagement", + "link": { + "path": "src/plugins/index_pattern_management/public/service/list/manager.ts", + "lineNumber": 9 + } + }, + { + "plugin": "indexPatternManagement", + "link": { + "path": "src/plugins/index_pattern_management/public/service/list/manager.ts", + "lineNumber": 43 + } + }, + { + "plugin": "indexPatternManagement", + "link": { + "path": "src/plugins/index_pattern_management/public/components/create_index_pattern_wizard/lib/extract_time_fields.ts", + "lineNumber": 10 + } + }, + { + "plugin": "indexPatternManagement", + "link": { + "path": "src/plugins/index_pattern_management/public/components/create_index_pattern_wizard/lib/extract_time_fields.ts", + "lineNumber": 12 + } + }, + { + "plugin": "indexPatternManagement", + "link": { + "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/indexed_fields_table/types.ts", + "lineNumber": 9 + } + }, + { + "plugin": "indexPatternManagement", + "link": { + "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/indexed_fields_table/types.ts", + "lineNumber": 11 + } + }, + { + "plugin": "indexPatternManagement", + "link": { + "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/indexed_fields_table/indexed_fields_table.tsx", + "lineNumber": 11 + } + }, + { + "plugin": "indexPatternManagement", "link": { - "path": "x-pack/plugins/maps/public/classes/layers/choropleth_layer_wizard/layer_template.tsx", - "lineNumber": 59 + "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/indexed_fields_table/indexed_fields_table.tsx", + "lineNumber": 23 } }, { - "plugin": "maps", + "plugin": "indexPatternManagement", "link": { - "path": "x-pack/plugins/maps/public/classes/layers/choropleth_layer_wizard/layer_template.tsx", - "lineNumber": 60 + "path": "src/plugins/index_pattern_management/public/components/field_editor/field_editor.tsx", + "lineNumber": 45 } }, { - "plugin": "maps", + "plugin": "indexPatternManagement", "link": { - "path": "x-pack/plugins/maps/public/classes/layers/choropleth_layer_wizard/layer_template.tsx", - "lineNumber": 66 + "path": "src/plugins/index_pattern_management/public/components/field_editor/field_editor.tsx", + "lineNumber": 148 } }, { @@ -33973,6 +33994,27 @@ "lineNumber": 21 } }, + { + "plugin": "fleet", + "link": { + "path": "x-pack/plugins/fleet/public/applications/fleet/components/search_bar.tsx", + "lineNumber": 10 + } + }, + { + "plugin": "fleet", + "link": { + "path": "x-pack/plugins/fleet/public/applications/fleet/components/search_bar.tsx", + "lineNumber": 33 + } + }, + { + "plugin": "fleet", + "link": { + "path": "x-pack/plugins/fleet/public/applications/fleet/components/search_bar.tsx", + "lineNumber": 51 + } + }, { "plugin": "fleet", "link": { @@ -34513,409 +34555,346 @@ } }, { - "plugin": "lists", - "link": { - "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/helpers.ts", - "lineNumber": 19 - } - }, - { - "plugin": "lists", - "link": { - "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/helpers.ts", - "lineNumber": 30 - } - }, - { - "plugin": "lists", - "link": { - "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/helpers.ts", - "lineNumber": 54 - } - }, - { - "plugin": "lists", - "link": { - "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/helpers.ts", - "lineNumber": 84 - } - }, - { - "plugin": "lists", - "link": { - "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/helpers.ts", - "lineNumber": 150 - } - }, - { - "plugin": "lists", - "link": { - "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/field.tsx", - "lineNumber": 11 - } - }, - { - "plugin": "lists", - "link": { - "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/field.tsx", - "lineNumber": 26 - } - }, - { - "plugin": "lists", - "link": { - "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/field.tsx", - "lineNumber": 28 - } - }, - { - "plugin": "lists", - "link": { - "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/field.tsx", - "lineNumber": 57 - } - }, - { - "plugin": "lists", + "plugin": "maps", "link": { - "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/field.tsx", - "lineNumber": 95 + "path": "x-pack/plugins/maps/common/elasticsearch_util/es_agg_utils.ts", + "lineNumber": 10 } }, { - "plugin": "lists", + "plugin": "maps", "link": { - "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/field.tsx", - "lineNumber": 96 + "path": "x-pack/plugins/maps/common/elasticsearch_util/es_agg_utils.ts", + "lineNumber": 16 } }, { - "plugin": "lists", + "plugin": "maps", "link": { - "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/field.tsx", - "lineNumber": 101 + "path": "x-pack/plugins/maps/common/elasticsearch_util/es_agg_utils.ts", + "lineNumber": 29 } }, { - "plugin": "lists", + "plugin": "maps", "link": { - "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/field.tsx", - "lineNumber": 114 + "path": "x-pack/plugins/maps/public/components/geo_field_select.tsx", + "lineNumber": 12 } }, { - "plugin": "lists", + "plugin": "maps", "link": { - "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/field.tsx", - "lineNumber": 121 + "path": "x-pack/plugins/maps/public/components/geo_field_select.tsx", + "lineNumber": 16 } }, { - "plugin": "lists", + "plugin": "maps", "link": { - "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/field.tsx", - "lineNumber": 125 + "path": "x-pack/plugins/maps/public/classes/sources/es_search_source/top_hits/create_source_editor.tsx", + "lineNumber": 18 } }, { - "plugin": "lists", + "plugin": "maps", "link": { - "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/field.tsx", - "lineNumber": 125 + "path": "x-pack/plugins/maps/public/classes/sources/es_search_source/top_hits/create_source_editor.tsx", + "lineNumber": 30 } }, { - "plugin": "lists", + "plugin": "maps", "link": { - "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/field.tsx", - "lineNumber": 130 + "path": "x-pack/plugins/maps/public/classes/sources/es_search_source/top_hits/create_source_editor.tsx", + "lineNumber": 33 } }, { - "plugin": "lists", + "plugin": "maps", "link": { - "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/field.tsx", - "lineNumber": 131 + "path": "x-pack/plugins/maps/public/classes/sources/es_search_source/top_hits/create_source_editor.tsx", + "lineNumber": 35 } }, { - "plugin": "lists", + "plugin": "lens", "link": { - "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/field.tsx", - "lineNumber": 133 + "path": "x-pack/plugins/lens/public/indexpattern_datasource/types.ts", + "lineNumber": 8 } }, { - "plugin": "lists", + "plugin": "lens", "link": { - "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/field.tsx", - "lineNumber": 134 + "path": "x-pack/plugins/lens/public/indexpattern_datasource/types.ts", + "lineNumber": 57 } }, { - "plugin": "lists", + "plugin": "lens", "link": { - "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/operator.tsx", + "path": "x-pack/plugins/lens/server/routes/field_stats.ts", "lineNumber": 11 } }, { - "plugin": "lists", + "plugin": "lens", "link": { - "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/operator.tsx", - "lineNumber": 27 + "path": "x-pack/plugins/lens/server/routes/field_stats.ts", + "lineNumber": 139 } }, { - "plugin": "lists", + "plugin": "lens", "link": { - "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/hooks/use_field_value_autocomplete.ts", - "lineNumber": 13 + "path": "x-pack/plugins/lens/server/routes/field_stats.ts", + "lineNumber": 248 } }, { - "plugin": "lists", + "plugin": "lens", "link": { - "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/hooks/use_field_value_autocomplete.ts", - "lineNumber": 16 + "path": "x-pack/plugins/lens/server/routes/field_stats.ts", + "lineNumber": 287 } }, { - "plugin": "lists", + "plugin": "lens", "link": { - "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/hooks/use_field_value_autocomplete.ts", - "lineNumber": 32 + "path": "x-pack/plugins/lens/server/routes/field_stats.ts", + "lineNumber": 329 } }, { "plugin": "lists", "link": { - "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/field_value_match.tsx", + "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/helpers.ts", "lineNumber": 19 } }, { "plugin": "lists", "link": { - "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/field_value_match.tsx", - "lineNumber": 36 + "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/helpers.ts", + "lineNumber": 30 } }, { "plugin": "lists", "link": { - "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/field_value_match_any.tsx", - "lineNumber": 13 + "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/helpers.ts", + "lineNumber": 54 } }, { "plugin": "lists", "link": { - "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/field_value_match_any.tsx", - "lineNumber": 23 + "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/helpers.ts", + "lineNumber": 84 } }, { "plugin": "lists", "link": { - "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/field_value_lists.tsx", - "lineNumber": 13 + "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/helpers.ts", + "lineNumber": 150 } }, { "plugin": "lists", "link": { - "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/field_value_lists.tsx", - "lineNumber": 29 + "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/field.tsx", + "lineNumber": 11 } }, { "plugin": "lists", "link": { - "path": "x-pack/plugins/lists/public/exceptions/components/builder/entry_renderer.tsx", - "lineNumber": 31 + "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/field.tsx", + "lineNumber": 26 } }, { "plugin": "lists", "link": { - "path": "x-pack/plugins/lists/public/exceptions/components/builder/entry_renderer.tsx", - "lineNumber": 91 + "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/field.tsx", + "lineNumber": 28 } }, { "plugin": "lists", "link": { - "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/helpers.test.ts", - "lineNumber": 19 + "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/field.tsx", + "lineNumber": 57 } }, { "plugin": "lists", "link": { - "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/helpers.test.ts", - "lineNumber": 333 + "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/field.tsx", + "lineNumber": 95 } }, { "plugin": "lists", "link": { - "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/helpers.test.ts", - "lineNumber": 339 + "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/field.tsx", + "lineNumber": 96 } }, { "plugin": "lists", "link": { - "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/helpers.test.ts", - "lineNumber": 347 + "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/field.tsx", + "lineNumber": 101 } }, { "plugin": "lists", "link": { - "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/helpers.test.ts", - "lineNumber": 355 + "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/field.tsx", + "lineNumber": 114 } }, { "plugin": "lists", "link": { - "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/helpers.test.ts", - "lineNumber": 363 + "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/field.tsx", + "lineNumber": 121 } }, { "plugin": "lists", - "link": { - "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/helpers.test.ts", - "lineNumber": 371 + "link": { + "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/field.tsx", + "lineNumber": 125 } }, { "plugin": "lists", "link": { - "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/helpers.test.ts", - "lineNumber": 380 + "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/field.tsx", + "lineNumber": 125 } }, { "plugin": "lists", "link": { - "path": "x-pack/plugins/lists/public/exceptions/components/builder/helpers.test.ts", - "lineNumber": 62 + "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/field.tsx", + "lineNumber": 130 } }, { "plugin": "lists", "link": { - "path": "x-pack/plugins/lists/public/exceptions/components/builder/helpers.test.ts", - "lineNumber": 166 + "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/field.tsx", + "lineNumber": 131 } }, { "plugin": "lists", "link": { - "path": "x-pack/plugins/lists/public/exceptions/components/builder/helpers.test.ts", - "lineNumber": 167 + "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/field.tsx", + "lineNumber": 133 } }, { "plugin": "lists", "link": { - "path": "x-pack/plugins/lists/public/exceptions/components/builder/helpers.test.ts", - "lineNumber": 629 + "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/field.tsx", + "lineNumber": 134 } }, { "plugin": "lists", "link": { - "path": "x-pack/plugins/lists/public/exceptions/components/builder/helpers.test.ts", - "lineNumber": 666 + "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/operator.tsx", + "lineNumber": 11 } }, { "plugin": "lists", "link": { - "path": "x-pack/plugins/lists/public/exceptions/components/builder/helpers.test.ts", - "lineNumber": 691 + "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/operator.tsx", + "lineNumber": 27 } }, { - "plugin": "lens", + "plugin": "lists", "link": { - "path": "x-pack/plugins/lens/public/indexpattern_datasource/types.ts", - "lineNumber": 8 + "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/hooks/use_field_value_autocomplete.ts", + "lineNumber": 13 } }, { - "plugin": "lens", + "plugin": "lists", "link": { - "path": "x-pack/plugins/lens/public/indexpattern_datasource/types.ts", - "lineNumber": 57 + "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/hooks/use_field_value_autocomplete.ts", + "lineNumber": 16 } }, { - "plugin": "maps", + "plugin": "lists", "link": { - "path": "x-pack/plugins/maps/common/elasticsearch_util/es_agg_utils.ts", - "lineNumber": 10 + "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/hooks/use_field_value_autocomplete.ts", + "lineNumber": 32 } }, { - "plugin": "maps", + "plugin": "lists", "link": { - "path": "x-pack/plugins/maps/common/elasticsearch_util/es_agg_utils.ts", - "lineNumber": 16 + "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/field_value_match.tsx", + "lineNumber": 19 } }, { - "plugin": "maps", + "plugin": "lists", "link": { - "path": "x-pack/plugins/maps/common/elasticsearch_util/es_agg_utils.ts", - "lineNumber": 29 + "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/field_value_match.tsx", + "lineNumber": 36 } }, { - "plugin": "maps", + "plugin": "lists", "link": { - "path": "x-pack/plugins/maps/public/components/geo_field_select.tsx", - "lineNumber": 12 + "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/field_value_match_any.tsx", + "lineNumber": 13 } }, { - "plugin": "maps", + "plugin": "lists", "link": { - "path": "x-pack/plugins/maps/public/components/geo_field_select.tsx", - "lineNumber": 16 + "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/field_value_match_any.tsx", + "lineNumber": 23 } }, { - "plugin": "maps", + "plugin": "lists", "link": { - "path": "x-pack/plugins/maps/public/classes/sources/es_search_source/top_hits/create_source_editor.tsx", - "lineNumber": 18 + "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/field_value_lists.tsx", + "lineNumber": 14 } }, { - "plugin": "maps", + "plugin": "lists", "link": { - "path": "x-pack/plugins/maps/public/classes/sources/es_search_source/top_hits/create_source_editor.tsx", - "lineNumber": 30 + "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/field_value_lists.tsx", + "lineNumber": 29 } }, { - "plugin": "maps", + "plugin": "lists", "link": { - "path": "x-pack/plugins/maps/public/classes/sources/es_search_source/top_hits/create_source_editor.tsx", - "lineNumber": 33 + "path": "x-pack/plugins/lists/public/exceptions/components/builder/entry_renderer.tsx", + "lineNumber": 31 } }, { - "plugin": "maps", + "plugin": "lists", "link": { - "path": "x-pack/plugins/maps/public/classes/sources/es_search_source/top_hits/create_source_editor.tsx", - "lineNumber": 35 + "path": "x-pack/plugins/lists/public/exceptions/components/builder/entry_renderer.tsx", + "lineNumber": 91 } }, { @@ -35157,192 +35136,213 @@ } }, { - "plugin": "securitySolution", + "plugin": "lens", "link": { - "path": "x-pack/plugins/security_solution/public/common/components/autocomplete/field_value_lists.tsx", - "lineNumber": 12 + "path": "x-pack/plugins/lens/target/types/public/indexpattern_datasource/types.d.ts", + "lineNumber": 1 } }, { - "plugin": "securitySolution", + "plugin": "lens", "link": { - "path": "x-pack/plugins/security_solution/public/common/components/autocomplete/field_value_lists.tsx", - "lineNumber": 20 + "path": "x-pack/plugins/lens/target/types/public/indexpattern_datasource/types.d.ts", + "lineNumber": 22 } }, { - "plugin": "securitySolution", + "plugin": "lens", "link": { - "path": "x-pack/plugins/security_solution/public/common/components/autocomplete/field_value_match_any.tsx", - "lineNumber": 13 + "path": "x-pack/plugins/lens/target/types/server/routes/field_stats.d.ts", + "lineNumber": 3 } }, { - "plugin": "securitySolution", + "plugin": "lens", "link": { - "path": "x-pack/plugins/security_solution/public/common/components/autocomplete/field_value_match_any.tsx", - "lineNumber": 22 + "path": "x-pack/plugins/lens/target/types/server/routes/field_stats.d.ts", + "lineNumber": 7 } }, { - "plugin": "securitySolution", + "plugin": "lens", "link": { - "path": "x-pack/plugins/security_solution/public/common/components/autocomplete/helpers.test.ts", - "lineNumber": 11 + "path": "x-pack/plugins/lens/target/types/server/routes/field_stats.d.ts", + "lineNumber": 8 } }, { - "plugin": "securitySolution", + "plugin": "lens", "link": { - "path": "x-pack/plugins/security_solution/public/common/components/autocomplete/helpers.test.ts", + "path": "x-pack/plugins/lens/target/types/server/routes/field_stats.d.ts", + "lineNumber": 9 + } + }, + { + "plugin": "lists", + "link": { + "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/helpers.test.ts", + "lineNumber": 19 + } + }, + { + "plugin": "lists", + "link": { + "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/helpers.test.ts", "lineNumber": 333 } }, { - "plugin": "securitySolution", + "plugin": "lists", "link": { - "path": "x-pack/plugins/security_solution/public/common/components/autocomplete/helpers.test.ts", + "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/helpers.test.ts", "lineNumber": 339 } }, { - "plugin": "securitySolution", + "plugin": "lists", "link": { - "path": "x-pack/plugins/security_solution/public/common/components/autocomplete/helpers.test.ts", + "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/helpers.test.ts", "lineNumber": 347 } }, { - "plugin": "securitySolution", + "plugin": "lists", "link": { - "path": "x-pack/plugins/security_solution/public/common/components/autocomplete/helpers.test.ts", + "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/helpers.test.ts", "lineNumber": 355 } }, { - "plugin": "securitySolution", + "plugin": "lists", "link": { - "path": "x-pack/plugins/security_solution/public/common/components/autocomplete/helpers.test.ts", + "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/helpers.test.ts", "lineNumber": 363 } }, { - "plugin": "securitySolution", + "plugin": "lists", "link": { - "path": "x-pack/plugins/security_solution/public/common/components/autocomplete/helpers.test.ts", + "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/helpers.test.ts", "lineNumber": 371 } }, { - "plugin": "securitySolution", + "plugin": "lists", "link": { - "path": "x-pack/plugins/security_solution/public/common/components/autocomplete/helpers.test.ts", + "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/helpers.test.ts", "lineNumber": 380 } }, { - "plugin": "securitySolution", + "plugin": "lists", "link": { - "path": "x-pack/plugins/security_solution/public/common/components/autocomplete/operator.tsx", - "lineNumber": 11 + "path": "x-pack/plugins/lists/public/exceptions/components/builder/helpers.test.ts", + "lineNumber": 62 } }, { - "plugin": "securitySolution", + "plugin": "lists", "link": { - "path": "x-pack/plugins/security_solution/public/common/components/autocomplete/operator.tsx", - "lineNumber": 17 + "path": "x-pack/plugins/lists/public/exceptions/components/builder/helpers.test.ts", + "lineNumber": 166 } }, { - "plugin": "securitySolution", + "plugin": "lists", "link": { - "path": "x-pack/plugins/security_solution/public/common/components/exceptions/helpers.test.tsx", - "lineNumber": 43 + "path": "x-pack/plugins/lists/public/exceptions/components/builder/helpers.test.ts", + "lineNumber": 167 } }, { - "plugin": "securitySolution", + "plugin": "lists", "link": { - "path": "x-pack/plugins/security_solution/public/common/components/exceptions/helpers.test.tsx", - "lineNumber": 104 + "path": "x-pack/plugins/lists/public/exceptions/components/builder/helpers.test.ts", + "lineNumber": 629 } }, { - "plugin": "lens", + "plugin": "lists", "link": { - "path": "x-pack/plugins/lens/server/routes/field_stats.ts", - "lineNumber": 11 + "path": "x-pack/plugins/lists/public/exceptions/components/builder/helpers.test.ts", + "lineNumber": 666 } }, { - "plugin": "lens", + "plugin": "lists", "link": { - "path": "x-pack/plugins/lens/server/routes/field_stats.ts", - "lineNumber": 139 + "path": "x-pack/plugins/lists/public/exceptions/components/builder/helpers.test.ts", + "lineNumber": 691 } }, { - "plugin": "lens", + "plugin": "securitySolution", "link": { - "path": "x-pack/plugins/lens/server/routes/field_stats.ts", - "lineNumber": 248 + "path": "x-pack/plugins/security_solution/public/common/components/autocomplete/helpers.test.ts", + "lineNumber": 11 } }, { - "plugin": "lens", + "plugin": "securitySolution", "link": { - "path": "x-pack/plugins/lens/server/routes/field_stats.ts", - "lineNumber": 287 + "path": "x-pack/plugins/security_solution/public/common/components/autocomplete/helpers.test.ts", + "lineNumber": 333 } }, { - "plugin": "lens", + "plugin": "securitySolution", "link": { - "path": "x-pack/plugins/lens/server/routes/field_stats.ts", - "lineNumber": 329 + "path": "x-pack/plugins/security_solution/public/common/components/autocomplete/helpers.test.ts", + "lineNumber": 339 } }, { - "plugin": "lens", + "plugin": "securitySolution", "link": { - "path": "x-pack/plugins/lens/target/types/public/indexpattern_datasource/types.d.ts", - "lineNumber": 1 + "path": "x-pack/plugins/security_solution/public/common/components/autocomplete/helpers.test.ts", + "lineNumber": 347 } }, { - "plugin": "lens", + "plugin": "securitySolution", "link": { - "path": "x-pack/plugins/lens/target/types/public/indexpattern_datasource/types.d.ts", - "lineNumber": 22 + "path": "x-pack/plugins/security_solution/public/common/components/autocomplete/helpers.test.ts", + "lineNumber": 355 } }, { - "plugin": "lens", + "plugin": "securitySolution", "link": { - "path": "x-pack/plugins/lens/target/types/server/routes/field_stats.d.ts", - "lineNumber": 3 + "path": "x-pack/plugins/security_solution/public/common/components/autocomplete/helpers.test.ts", + "lineNumber": 363 } }, { - "plugin": "lens", + "plugin": "securitySolution", "link": { - "path": "x-pack/plugins/lens/target/types/server/routes/field_stats.d.ts", - "lineNumber": 7 + "path": "x-pack/plugins/security_solution/public/common/components/autocomplete/helpers.test.ts", + "lineNumber": 371 } }, { - "plugin": "lens", + "plugin": "securitySolution", "link": { - "path": "x-pack/plugins/lens/target/types/server/routes/field_stats.d.ts", - "lineNumber": 8 + "path": "x-pack/plugins/security_solution/public/common/components/autocomplete/helpers.test.ts", + "lineNumber": 380 } }, { - "plugin": "lens", + "plugin": "securitySolution", "link": { - "path": "x-pack/plugins/lens/target/types/server/routes/field_stats.d.ts", - "lineNumber": 9 + "path": "x-pack/plugins/security_solution/target/types/public/common/components/exceptions/helpers.test.d.ts", + "lineNumber": 1 + } + }, + { + "plugin": "securitySolution", + "link": { + "path": "x-pack/plugins/security_solution/target/types/public/common/components/exceptions/helpers.test.d.ts", + "lineNumber": 2 } }, { diff --git a/api_docs/data_index_patterns.json b/api_docs/data_index_patterns.json index 08c47437faa56c..6d9230cfb6a877 100644 --- a/api_docs/data_index_patterns.json +++ b/api_docs/data_index_patterns.json @@ -5513,111 +5513,6 @@ "lineNumber": 58 } }, - { - "plugin": "fleet", - "link": { - "path": "x-pack/plugins/fleet/public/applications/fleet/components/search_bar.tsx", - "lineNumber": 10 - } - }, - { - "plugin": "fleet", - "link": { - "path": "x-pack/plugins/fleet/public/applications/fleet/components/search_bar.tsx", - "lineNumber": 33 - } - }, - { - "plugin": "fleet", - "link": { - "path": "x-pack/plugins/fleet/public/applications/fleet/components/search_bar.tsx", - "lineNumber": 51 - } - }, - { - "plugin": "indexPatternManagement", - "link": { - "path": "src/plugins/index_pattern_management/public/service/list/config.ts", - "lineNumber": 10 - } - }, - { - "plugin": "indexPatternManagement", - "link": { - "path": "src/plugins/index_pattern_management/public/service/list/config.ts", - "lineNumber": 42 - } - }, - { - "plugin": "indexPatternManagement", - "link": { - "path": "src/plugins/index_pattern_management/public/service/list/manager.ts", - "lineNumber": 9 - } - }, - { - "plugin": "indexPatternManagement", - "link": { - "path": "src/plugins/index_pattern_management/public/service/list/manager.ts", - "lineNumber": 43 - } - }, - { - "plugin": "indexPatternManagement", - "link": { - "path": "src/plugins/index_pattern_management/public/components/create_index_pattern_wizard/lib/extract_time_fields.ts", - "lineNumber": 10 - } - }, - { - "plugin": "indexPatternManagement", - "link": { - "path": "src/plugins/index_pattern_management/public/components/create_index_pattern_wizard/lib/extract_time_fields.ts", - "lineNumber": 12 - } - }, - { - "plugin": "indexPatternManagement", - "link": { - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/indexed_fields_table/types.ts", - "lineNumber": 9 - } - }, - { - "plugin": "indexPatternManagement", - "link": { - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/indexed_fields_table/types.ts", - "lineNumber": 11 - } - }, - { - "plugin": "indexPatternManagement", - "link": { - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/indexed_fields_table/indexed_fields_table.tsx", - "lineNumber": 11 - } - }, - { - "plugin": "indexPatternManagement", - "link": { - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/indexed_fields_table/indexed_fields_table.tsx", - "lineNumber": 23 - } - }, - { - "plugin": "indexPatternManagement", - "link": { - "path": "src/plugins/index_pattern_management/public/components/field_editor/field_editor.tsx", - "lineNumber": 45 - } - }, - { - "plugin": "indexPatternManagement", - "link": { - "path": "src/plugins/index_pattern_management/public/components/field_editor/field_editor.tsx", - "lineNumber": 148 - } - }, { "plugin": "maps", "link": { @@ -5982,6 +5877,90 @@ "lineNumber": 66 } }, + { + "plugin": "indexPatternManagement", + "link": { + "path": "src/plugins/index_pattern_management/public/service/list/config.ts", + "lineNumber": 10 + } + }, + { + "plugin": "indexPatternManagement", + "link": { + "path": "src/plugins/index_pattern_management/public/service/list/config.ts", + "lineNumber": 42 + } + }, + { + "plugin": "indexPatternManagement", + "link": { + "path": "src/plugins/index_pattern_management/public/service/list/manager.ts", + "lineNumber": 9 + } + }, + { + "plugin": "indexPatternManagement", + "link": { + "path": "src/plugins/index_pattern_management/public/service/list/manager.ts", + "lineNumber": 43 + } + }, + { + "plugin": "indexPatternManagement", + "link": { + "path": "src/plugins/index_pattern_management/public/components/create_index_pattern_wizard/lib/extract_time_fields.ts", + "lineNumber": 10 + } + }, + { + "plugin": "indexPatternManagement", + "link": { + "path": "src/plugins/index_pattern_management/public/components/create_index_pattern_wizard/lib/extract_time_fields.ts", + "lineNumber": 12 + } + }, + { + "plugin": "indexPatternManagement", + "link": { + "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/indexed_fields_table/types.ts", + "lineNumber": 9 + } + }, + { + "plugin": "indexPatternManagement", + "link": { + "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/indexed_fields_table/types.ts", + "lineNumber": 11 + } + }, + { + "plugin": "indexPatternManagement", + "link": { + "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/indexed_fields_table/indexed_fields_table.tsx", + "lineNumber": 11 + } + }, + { + "plugin": "indexPatternManagement", + "link": { + "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/indexed_fields_table/indexed_fields_table.tsx", + "lineNumber": 23 + } + }, + { + "plugin": "indexPatternManagement", + "link": { + "path": "src/plugins/index_pattern_management/public/components/field_editor/field_editor.tsx", + "lineNumber": 45 + } + }, + { + "plugin": "indexPatternManagement", + "link": { + "path": "src/plugins/index_pattern_management/public/components/field_editor/field_editor.tsx", + "lineNumber": 148 + } + }, { "plugin": "ml", "link": { @@ -6234,6 +6213,27 @@ "lineNumber": 21 } }, + { + "plugin": "fleet", + "link": { + "path": "x-pack/plugins/fleet/public/applications/fleet/components/search_bar.tsx", + "lineNumber": 10 + } + }, + { + "plugin": "fleet", + "link": { + "path": "x-pack/plugins/fleet/public/applications/fleet/components/search_bar.tsx", + "lineNumber": 33 + } + }, + { + "plugin": "fleet", + "link": { + "path": "x-pack/plugins/fleet/public/applications/fleet/components/search_bar.tsx", + "lineNumber": 51 + } + }, { "plugin": "fleet", "link": { @@ -6774,409 +6774,346 @@ } }, { - "plugin": "lists", + "plugin": "maps", "link": { - "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/helpers.ts", - "lineNumber": 19 + "path": "x-pack/plugins/maps/common/elasticsearch_util/es_agg_utils.ts", + "lineNumber": 10 } }, { - "plugin": "lists", + "plugin": "maps", "link": { - "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/helpers.ts", - "lineNumber": 30 + "path": "x-pack/plugins/maps/common/elasticsearch_util/es_agg_utils.ts", + "lineNumber": 16 } }, { - "plugin": "lists", + "plugin": "maps", "link": { - "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/helpers.ts", - "lineNumber": 54 + "path": "x-pack/plugins/maps/common/elasticsearch_util/es_agg_utils.ts", + "lineNumber": 29 } }, { - "plugin": "lists", + "plugin": "maps", "link": { - "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/helpers.ts", - "lineNumber": 84 + "path": "x-pack/plugins/maps/public/components/geo_field_select.tsx", + "lineNumber": 12 } }, { - "plugin": "lists", + "plugin": "maps", "link": { - "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/helpers.ts", - "lineNumber": 150 + "path": "x-pack/plugins/maps/public/components/geo_field_select.tsx", + "lineNumber": 16 } }, { - "plugin": "lists", + "plugin": "maps", "link": { - "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/field.tsx", - "lineNumber": 11 + "path": "x-pack/plugins/maps/public/classes/sources/es_search_source/top_hits/create_source_editor.tsx", + "lineNumber": 18 } }, { - "plugin": "lists", + "plugin": "maps", "link": { - "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/field.tsx", - "lineNumber": 26 + "path": "x-pack/plugins/maps/public/classes/sources/es_search_source/top_hits/create_source_editor.tsx", + "lineNumber": 30 } }, { - "plugin": "lists", + "plugin": "maps", "link": { - "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/field.tsx", - "lineNumber": 28 + "path": "x-pack/plugins/maps/public/classes/sources/es_search_source/top_hits/create_source_editor.tsx", + "lineNumber": 33 } }, { - "plugin": "lists", + "plugin": "maps", "link": { - "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/field.tsx", - "lineNumber": 57 + "path": "x-pack/plugins/maps/public/classes/sources/es_search_source/top_hits/create_source_editor.tsx", + "lineNumber": 35 } }, { - "plugin": "lists", + "plugin": "lens", "link": { - "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/field.tsx", - "lineNumber": 95 + "path": "x-pack/plugins/lens/public/indexpattern_datasource/types.ts", + "lineNumber": 8 } }, { - "plugin": "lists", + "plugin": "lens", "link": { - "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/field.tsx", - "lineNumber": 96 + "path": "x-pack/plugins/lens/public/indexpattern_datasource/types.ts", + "lineNumber": 57 } }, { - "plugin": "lists", + "plugin": "lens", "link": { - "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/field.tsx", - "lineNumber": 101 + "path": "x-pack/plugins/lens/server/routes/field_stats.ts", + "lineNumber": 11 } }, { - "plugin": "lists", + "plugin": "lens", "link": { - "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/field.tsx", - "lineNumber": 114 + "path": "x-pack/plugins/lens/server/routes/field_stats.ts", + "lineNumber": 139 } }, { - "plugin": "lists", + "plugin": "lens", "link": { - "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/field.tsx", - "lineNumber": 121 + "path": "x-pack/plugins/lens/server/routes/field_stats.ts", + "lineNumber": 248 } }, { - "plugin": "lists", + "plugin": "lens", "link": { - "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/field.tsx", - "lineNumber": 125 + "path": "x-pack/plugins/lens/server/routes/field_stats.ts", + "lineNumber": 287 } }, { - "plugin": "lists", + "plugin": "lens", "link": { - "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/field.tsx", - "lineNumber": 125 + "path": "x-pack/plugins/lens/server/routes/field_stats.ts", + "lineNumber": 329 } }, { "plugin": "lists", "link": { - "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/field.tsx", - "lineNumber": 130 + "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/helpers.ts", + "lineNumber": 19 } }, { "plugin": "lists", "link": { - "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/field.tsx", - "lineNumber": 131 + "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/helpers.ts", + "lineNumber": 30 } }, { "plugin": "lists", "link": { - "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/field.tsx", - "lineNumber": 133 + "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/helpers.ts", + "lineNumber": 54 } }, { "plugin": "lists", "link": { - "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/field.tsx", - "lineNumber": 134 + "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/helpers.ts", + "lineNumber": 84 } }, { "plugin": "lists", "link": { - "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/operator.tsx", - "lineNumber": 11 + "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/helpers.ts", + "lineNumber": 150 } }, { "plugin": "lists", "link": { - "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/operator.tsx", - "lineNumber": 27 + "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/field.tsx", + "lineNumber": 11 } }, { "plugin": "lists", "link": { - "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/hooks/use_field_value_autocomplete.ts", - "lineNumber": 13 + "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/field.tsx", + "lineNumber": 26 } }, { "plugin": "lists", "link": { - "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/hooks/use_field_value_autocomplete.ts", - "lineNumber": 16 + "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/field.tsx", + "lineNumber": 28 } }, { "plugin": "lists", "link": { - "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/hooks/use_field_value_autocomplete.ts", - "lineNumber": 32 + "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/field.tsx", + "lineNumber": 57 } }, { "plugin": "lists", "link": { - "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/field_value_match.tsx", - "lineNumber": 19 + "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/field.tsx", + "lineNumber": 95 } }, { "plugin": "lists", "link": { - "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/field_value_match.tsx", - "lineNumber": 36 + "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/field.tsx", + "lineNumber": 96 } }, { "plugin": "lists", "link": { - "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/field_value_match_any.tsx", - "lineNumber": 13 + "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/field.tsx", + "lineNumber": 101 } }, { "plugin": "lists", "link": { - "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/field_value_match_any.tsx", - "lineNumber": 23 + "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/field.tsx", + "lineNumber": 114 } }, { "plugin": "lists", "link": { - "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/field_value_lists.tsx", - "lineNumber": 13 + "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/field.tsx", + "lineNumber": 121 } }, { "plugin": "lists", "link": { - "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/field_value_lists.tsx", - "lineNumber": 29 + "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/field.tsx", + "lineNumber": 125 } }, { "plugin": "lists", "link": { - "path": "x-pack/plugins/lists/public/exceptions/components/builder/entry_renderer.tsx", - "lineNumber": 31 + "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/field.tsx", + "lineNumber": 125 } }, { "plugin": "lists", "link": { - "path": "x-pack/plugins/lists/public/exceptions/components/builder/entry_renderer.tsx", - "lineNumber": 91 + "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/field.tsx", + "lineNumber": 130 } }, { "plugin": "lists", "link": { - "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/helpers.test.ts", - "lineNumber": 19 + "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/field.tsx", + "lineNumber": 131 } }, { "plugin": "lists", "link": { - "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/helpers.test.ts", - "lineNumber": 333 + "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/field.tsx", + "lineNumber": 133 } }, { "plugin": "lists", "link": { - "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/helpers.test.ts", - "lineNumber": 339 + "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/field.tsx", + "lineNumber": 134 } }, { "plugin": "lists", "link": { - "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/helpers.test.ts", - "lineNumber": 347 + "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/operator.tsx", + "lineNumber": 11 } }, { "plugin": "lists", "link": { - "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/helpers.test.ts", - "lineNumber": 355 + "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/operator.tsx", + "lineNumber": 27 } }, { "plugin": "lists", "link": { - "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/helpers.test.ts", - "lineNumber": 363 + "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/hooks/use_field_value_autocomplete.ts", + "lineNumber": 13 } }, { "plugin": "lists", "link": { - "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/helpers.test.ts", - "lineNumber": 371 + "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/hooks/use_field_value_autocomplete.ts", + "lineNumber": 16 } }, { "plugin": "lists", "link": { - "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/helpers.test.ts", - "lineNumber": 380 + "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/hooks/use_field_value_autocomplete.ts", + "lineNumber": 32 } }, { "plugin": "lists", "link": { - "path": "x-pack/plugins/lists/public/exceptions/components/builder/helpers.test.ts", - "lineNumber": 62 + "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/field_value_match.tsx", + "lineNumber": 19 } }, { "plugin": "lists", "link": { - "path": "x-pack/plugins/lists/public/exceptions/components/builder/helpers.test.ts", - "lineNumber": 166 + "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/field_value_match.tsx", + "lineNumber": 36 } }, { "plugin": "lists", "link": { - "path": "x-pack/plugins/lists/public/exceptions/components/builder/helpers.test.ts", - "lineNumber": 167 + "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/field_value_match_any.tsx", + "lineNumber": 13 } }, { "plugin": "lists", "link": { - "path": "x-pack/plugins/lists/public/exceptions/components/builder/helpers.test.ts", - "lineNumber": 629 + "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/field_value_match_any.tsx", + "lineNumber": 23 } }, { "plugin": "lists", "link": { - "path": "x-pack/plugins/lists/public/exceptions/components/builder/helpers.test.ts", - "lineNumber": 666 + "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/field_value_lists.tsx", + "lineNumber": 14 } }, { "plugin": "lists", "link": { - "path": "x-pack/plugins/lists/public/exceptions/components/builder/helpers.test.ts", - "lineNumber": 691 - } - }, - { - "plugin": "lens", - "link": { - "path": "x-pack/plugins/lens/public/indexpattern_datasource/types.ts", - "lineNumber": 8 - } - }, - { - "plugin": "lens", - "link": { - "path": "x-pack/plugins/lens/public/indexpattern_datasource/types.ts", - "lineNumber": 57 - } - }, - { - "plugin": "maps", - "link": { - "path": "x-pack/plugins/maps/common/elasticsearch_util/es_agg_utils.ts", - "lineNumber": 10 - } - }, - { - "plugin": "maps", - "link": { - "path": "x-pack/plugins/maps/common/elasticsearch_util/es_agg_utils.ts", - "lineNumber": 16 - } - }, - { - "plugin": "maps", - "link": { - "path": "x-pack/plugins/maps/common/elasticsearch_util/es_agg_utils.ts", + "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/field_value_lists.tsx", "lineNumber": 29 } }, { - "plugin": "maps", - "link": { - "path": "x-pack/plugins/maps/public/components/geo_field_select.tsx", - "lineNumber": 12 - } - }, - { - "plugin": "maps", - "link": { - "path": "x-pack/plugins/maps/public/components/geo_field_select.tsx", - "lineNumber": 16 - } - }, - { - "plugin": "maps", - "link": { - "path": "x-pack/plugins/maps/public/classes/sources/es_search_source/top_hits/create_source_editor.tsx", - "lineNumber": 18 - } - }, - { - "plugin": "maps", - "link": { - "path": "x-pack/plugins/maps/public/classes/sources/es_search_source/top_hits/create_source_editor.tsx", - "lineNumber": 30 - } - }, - { - "plugin": "maps", + "plugin": "lists", "link": { - "path": "x-pack/plugins/maps/public/classes/sources/es_search_source/top_hits/create_source_editor.tsx", - "lineNumber": 33 + "path": "x-pack/plugins/lists/public/exceptions/components/builder/entry_renderer.tsx", + "lineNumber": 31 } }, { - "plugin": "maps", + "plugin": "lists", "link": { - "path": "x-pack/plugins/maps/public/classes/sources/es_search_source/top_hits/create_source_editor.tsx", - "lineNumber": 35 + "path": "x-pack/plugins/lists/public/exceptions/components/builder/entry_renderer.tsx", + "lineNumber": 91 } }, { @@ -7418,192 +7355,213 @@ } }, { - "plugin": "securitySolution", + "plugin": "lens", "link": { - "path": "x-pack/plugins/security_solution/public/common/components/autocomplete/field_value_lists.tsx", - "lineNumber": 12 + "path": "x-pack/plugins/lens/target/types/public/indexpattern_datasource/types.d.ts", + "lineNumber": 1 } }, { - "plugin": "securitySolution", + "plugin": "lens", "link": { - "path": "x-pack/plugins/security_solution/public/common/components/autocomplete/field_value_lists.tsx", - "lineNumber": 20 - } + "path": "x-pack/plugins/lens/target/types/public/indexpattern_datasource/types.d.ts", + "lineNumber": 22 + } }, { - "plugin": "securitySolution", + "plugin": "lens", "link": { - "path": "x-pack/plugins/security_solution/public/common/components/autocomplete/field_value_match_any.tsx", - "lineNumber": 13 + "path": "x-pack/plugins/lens/target/types/server/routes/field_stats.d.ts", + "lineNumber": 3 } }, { - "plugin": "securitySolution", + "plugin": "lens", "link": { - "path": "x-pack/plugins/security_solution/public/common/components/autocomplete/field_value_match_any.tsx", - "lineNumber": 22 + "path": "x-pack/plugins/lens/target/types/server/routes/field_stats.d.ts", + "lineNumber": 7 } }, { - "plugin": "securitySolution", + "plugin": "lens", "link": { - "path": "x-pack/plugins/security_solution/public/common/components/autocomplete/helpers.test.ts", - "lineNumber": 11 + "path": "x-pack/plugins/lens/target/types/server/routes/field_stats.d.ts", + "lineNumber": 8 } }, { - "plugin": "securitySolution", + "plugin": "lens", "link": { - "path": "x-pack/plugins/security_solution/public/common/components/autocomplete/helpers.test.ts", + "path": "x-pack/plugins/lens/target/types/server/routes/field_stats.d.ts", + "lineNumber": 9 + } + }, + { + "plugin": "lists", + "link": { + "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/helpers.test.ts", + "lineNumber": 19 + } + }, + { + "plugin": "lists", + "link": { + "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/helpers.test.ts", "lineNumber": 333 } }, { - "plugin": "securitySolution", + "plugin": "lists", "link": { - "path": "x-pack/plugins/security_solution/public/common/components/autocomplete/helpers.test.ts", + "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/helpers.test.ts", "lineNumber": 339 } }, { - "plugin": "securitySolution", + "plugin": "lists", "link": { - "path": "x-pack/plugins/security_solution/public/common/components/autocomplete/helpers.test.ts", + "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/helpers.test.ts", "lineNumber": 347 } }, { - "plugin": "securitySolution", + "plugin": "lists", "link": { - "path": "x-pack/plugins/security_solution/public/common/components/autocomplete/helpers.test.ts", + "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/helpers.test.ts", "lineNumber": 355 } }, { - "plugin": "securitySolution", + "plugin": "lists", "link": { - "path": "x-pack/plugins/security_solution/public/common/components/autocomplete/helpers.test.ts", + "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/helpers.test.ts", "lineNumber": 363 } }, { - "plugin": "securitySolution", + "plugin": "lists", "link": { - "path": "x-pack/plugins/security_solution/public/common/components/autocomplete/helpers.test.ts", + "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/helpers.test.ts", "lineNumber": 371 } }, { - "plugin": "securitySolution", + "plugin": "lists", "link": { - "path": "x-pack/plugins/security_solution/public/common/components/autocomplete/helpers.test.ts", + "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/helpers.test.ts", "lineNumber": 380 } }, { - "plugin": "securitySolution", + "plugin": "lists", "link": { - "path": "x-pack/plugins/security_solution/public/common/components/autocomplete/operator.tsx", - "lineNumber": 11 + "path": "x-pack/plugins/lists/public/exceptions/components/builder/helpers.test.ts", + "lineNumber": 62 } }, { - "plugin": "securitySolution", + "plugin": "lists", "link": { - "path": "x-pack/plugins/security_solution/public/common/components/autocomplete/operator.tsx", - "lineNumber": 17 + "path": "x-pack/plugins/lists/public/exceptions/components/builder/helpers.test.ts", + "lineNumber": 166 } }, { - "plugin": "securitySolution", + "plugin": "lists", "link": { - "path": "x-pack/plugins/security_solution/public/common/components/exceptions/helpers.test.tsx", - "lineNumber": 43 + "path": "x-pack/plugins/lists/public/exceptions/components/builder/helpers.test.ts", + "lineNumber": 167 } }, { - "plugin": "securitySolution", + "plugin": "lists", "link": { - "path": "x-pack/plugins/security_solution/public/common/components/exceptions/helpers.test.tsx", - "lineNumber": 104 + "path": "x-pack/plugins/lists/public/exceptions/components/builder/helpers.test.ts", + "lineNumber": 629 } }, { - "plugin": "lens", + "plugin": "lists", "link": { - "path": "x-pack/plugins/lens/server/routes/field_stats.ts", - "lineNumber": 11 + "path": "x-pack/plugins/lists/public/exceptions/components/builder/helpers.test.ts", + "lineNumber": 666 } }, { - "plugin": "lens", + "plugin": "lists", "link": { - "path": "x-pack/plugins/lens/server/routes/field_stats.ts", - "lineNumber": 139 + "path": "x-pack/plugins/lists/public/exceptions/components/builder/helpers.test.ts", + "lineNumber": 691 } }, { - "plugin": "lens", + "plugin": "securitySolution", "link": { - "path": "x-pack/plugins/lens/server/routes/field_stats.ts", - "lineNumber": 248 + "path": "x-pack/plugins/security_solution/public/common/components/autocomplete/helpers.test.ts", + "lineNumber": 11 } }, { - "plugin": "lens", + "plugin": "securitySolution", "link": { - "path": "x-pack/plugins/lens/server/routes/field_stats.ts", - "lineNumber": 287 + "path": "x-pack/plugins/security_solution/public/common/components/autocomplete/helpers.test.ts", + "lineNumber": 333 } }, { - "plugin": "lens", + "plugin": "securitySolution", "link": { - "path": "x-pack/plugins/lens/server/routes/field_stats.ts", - "lineNumber": 329 + "path": "x-pack/plugins/security_solution/public/common/components/autocomplete/helpers.test.ts", + "lineNumber": 339 } }, { - "plugin": "lens", + "plugin": "securitySolution", "link": { - "path": "x-pack/plugins/lens/target/types/public/indexpattern_datasource/types.d.ts", - "lineNumber": 1 + "path": "x-pack/plugins/security_solution/public/common/components/autocomplete/helpers.test.ts", + "lineNumber": 347 } }, { - "plugin": "lens", + "plugin": "securitySolution", "link": { - "path": "x-pack/plugins/lens/target/types/public/indexpattern_datasource/types.d.ts", - "lineNumber": 22 + "path": "x-pack/plugins/security_solution/public/common/components/autocomplete/helpers.test.ts", + "lineNumber": 355 } }, { - "plugin": "lens", + "plugin": "securitySolution", "link": { - "path": "x-pack/plugins/lens/target/types/server/routes/field_stats.d.ts", - "lineNumber": 3 + "path": "x-pack/plugins/security_solution/public/common/components/autocomplete/helpers.test.ts", + "lineNumber": 363 } }, { - "plugin": "lens", + "plugin": "securitySolution", "link": { - "path": "x-pack/plugins/lens/target/types/server/routes/field_stats.d.ts", - "lineNumber": 7 + "path": "x-pack/plugins/security_solution/public/common/components/autocomplete/helpers.test.ts", + "lineNumber": 371 } }, { - "plugin": "lens", + "plugin": "securitySolution", "link": { - "path": "x-pack/plugins/lens/target/types/server/routes/field_stats.d.ts", - "lineNumber": 8 + "path": "x-pack/plugins/security_solution/public/common/components/autocomplete/helpers.test.ts", + "lineNumber": 380 } }, { - "plugin": "lens", + "plugin": "securitySolution", "link": { - "path": "x-pack/plugins/lens/target/types/server/routes/field_stats.d.ts", - "lineNumber": 9 + "path": "x-pack/plugins/security_solution/target/types/public/common/components/exceptions/helpers.test.d.ts", + "lineNumber": 1 + } + }, + { + "plugin": "securitySolution", + "link": { + "path": "x-pack/plugins/security_solution/target/types/public/common/components/exceptions/helpers.test.d.ts", + "lineNumber": 2 } }, { @@ -8130,48 +8088,6 @@ }, "deprecated": true, "references": [ - { - "plugin": "lists", - "link": { - "path": "x-pack/plugins/lists/public/exceptions/components/builder/exception_items_renderer.tsx", - "lineNumber": 34 - } - }, - { - "plugin": "lists", - "link": { - "path": "x-pack/plugins/lists/public/exceptions/components/builder/exception_items_renderer.tsx", - "lineNumber": 78 - } - }, - { - "plugin": "lists", - "link": { - "path": "x-pack/plugins/lists/public/exceptions/components/builder/exception_items_renderer.tsx", - "lineNumber": 86 - } - }, - { - "plugin": "lists", - "link": { - "path": "x-pack/plugins/lists/public/exceptions/components/builder/exception_items_renderer.tsx", - "lineNumber": 88 - } - }, - { - "plugin": "securitySolution", - "link": { - "path": "x-pack/plugins/security_solution/common/search_strategy/index_fields/index.ts", - "lineNumber": 8 - } - }, - { - "plugin": "securitySolution", - "link": { - "path": "x-pack/plugins/security_solution/common/search_strategy/index_fields/index.ts", - "lineNumber": 86 - } - }, { "plugin": "savedObjects", "link": { @@ -8264,206 +8180,178 @@ } }, { - "plugin": "savedObjectsManagement", + "plugin": "indexPatternManagement", "link": { - "path": "src/plugins/saved_objects_management/public/management_section/objects_table/components/flyout.tsx", - "lineNumber": 37 + "path": "src/plugins/index_pattern_management/public/service/list/config.ts", + "lineNumber": 10 } }, { - "plugin": "savedObjectsManagement", + "plugin": "indexPatternManagement", "link": { - "path": "src/plugins/saved_objects_management/public/management_section/objects_table/components/flyout.tsx", - "lineNumber": 89 + "path": "src/plugins/index_pattern_management/public/service/list/config.ts", + "lineNumber": 29 } }, { - "plugin": "infra", + "plugin": "indexPatternManagement", "link": { - "path": "x-pack/plugins/infra/public/containers/with_kuery_autocompletion.tsx", - "lineNumber": 9 + "path": "src/plugins/index_pattern_management/public/service/list/config.ts", + "lineNumber": 29 } }, { - "plugin": "infra", + "plugin": "indexPatternManagement", "link": { - "path": "x-pack/plugins/infra/public/containers/with_kuery_autocompletion.tsx", - "lineNumber": 24 + "path": "src/plugins/index_pattern_management/public/service/list/config.ts", + "lineNumber": 42 } }, { - "plugin": "infra", + "plugin": "indexPatternManagement", "link": { - "path": "x-pack/plugins/infra/public/pages/metrics/metrics_explorer/components/kuery_bar.tsx", - "lineNumber": 15 + "path": "src/plugins/index_pattern_management/public/service/list/config.ts", + "lineNumber": 46 } }, { - "plugin": "infra", + "plugin": "indexPatternManagement", "link": { - "path": "x-pack/plugins/infra/public/pages/metrics/metrics_explorer/components/kuery_bar.tsx", - "lineNumber": 28 + "path": "src/plugins/index_pattern_management/public/service/list/manager.ts", + "lineNumber": 9 } }, { - "plugin": "lens", + "plugin": "indexPatternManagement", "link": { - "path": "x-pack/plugins/lens/public/editor_frame_service/embeddable/embeddable.tsx", - "lineNumber": 14 + "path": "src/plugins/index_pattern_management/public/service/list/manager.ts", + "lineNumber": 32 } }, { - "plugin": "lens", + "plugin": "indexPatternManagement", "link": { - "path": "x-pack/plugins/lens/public/editor_frame_service/embeddable/embeddable.tsx", - "lineNumber": 85 + "path": "src/plugins/index_pattern_management/public/service/list/manager.ts", + "lineNumber": 32 } }, { - "plugin": "lens", + "plugin": "indexPatternManagement", "link": { - "path": "x-pack/plugins/lens/public/indexpattern_datasource/field_item.tsx", - "lineNumber": 47 + "path": "src/plugins/index_pattern_management/public/service/list/manager.ts", + "lineNumber": 43 } }, { - "plugin": "lens", + "plugin": "indexPatternManagement", "link": { - "path": "x-pack/plugins/lens/public/indexpattern_datasource/field_item.tsx", - "lineNumber": 172 + "path": "src/plugins/index_pattern_management/public/service/list/manager.ts", + "lineNumber": 50 } }, { - "plugin": "lens", + "plugin": "indexPatternManagement", "link": { - "path": "x-pack/plugins/lens/public/indexpattern_datasource/datapanel.tsx", - "lineNumber": 42 - } - }, - { - "plugin": "lens", - "link": { - "path": "x-pack/plugins/lens/public/indexpattern_datasource/datapanel.tsx", - "lineNumber": 96 - } - }, - { - "plugin": "lens", - "link": { - "path": "x-pack/plugins/lens/public/indexpattern_datasource/datapanel.tsx", - "lineNumber": 166 - } - }, - { - "plugin": "indexPatternManagement", - "link": { - "path": "src/plugins/index_pattern_management/public/service/list/config.ts", - "lineNumber": 10 - } - }, - { - "plugin": "indexPatternManagement", - "link": { - "path": "src/plugins/index_pattern_management/public/service/list/config.ts", - "lineNumber": 29 + "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/indexed_fields_table/components/table/table.tsx", + "lineNumber": 22 } }, { "plugin": "indexPatternManagement", "link": { - "path": "src/plugins/index_pattern_management/public/service/list/config.ts", - "lineNumber": 29 + "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/indexed_fields_table/components/table/table.tsx", + "lineNumber": 171 } }, { "plugin": "indexPatternManagement", "link": { - "path": "src/plugins/index_pattern_management/public/service/list/config.ts", - "lineNumber": 42 + "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/scripted_fields_table/components/table/table.tsx", + "lineNumber": 15 } }, { "plugin": "indexPatternManagement", "link": { - "path": "src/plugins/index_pattern_management/public/service/list/config.ts", - "lineNumber": 46 + "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/scripted_fields_table/components/table/table.tsx", + "lineNumber": 18 } }, { "plugin": "indexPatternManagement", "link": { - "path": "src/plugins/index_pattern_management/public/service/list/manager.ts", - "lineNumber": 9 + "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/index_header/index_header.tsx", + "lineNumber": 12 } }, { "plugin": "indexPatternManagement", "link": { - "path": "src/plugins/index_pattern_management/public/service/list/manager.ts", - "lineNumber": 32 + "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/index_header/index_header.tsx", + "lineNumber": 15 } }, { - "plugin": "indexPatternManagement", + "plugin": "savedObjectsManagement", "link": { - "path": "src/plugins/index_pattern_management/public/service/list/manager.ts", - "lineNumber": 32 + "path": "src/plugins/saved_objects_management/public/management_section/objects_table/components/flyout.tsx", + "lineNumber": 37 } }, { - "plugin": "indexPatternManagement", + "plugin": "savedObjectsManagement", "link": { - "path": "src/plugins/index_pattern_management/public/service/list/manager.ts", - "lineNumber": 43 + "path": "src/plugins/saved_objects_management/public/management_section/objects_table/components/flyout.tsx", + "lineNumber": 89 } }, { - "plugin": "indexPatternManagement", + "plugin": "lens", "link": { - "path": "src/plugins/index_pattern_management/public/service/list/manager.ts", - "lineNumber": 50 + "path": "x-pack/plugins/lens/public/editor_frame_service/embeddable/embeddable.tsx", + "lineNumber": 14 } }, { - "plugin": "indexPatternManagement", + "plugin": "lens", "link": { - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/indexed_fields_table/components/table/table.tsx", - "lineNumber": 22 + "path": "x-pack/plugins/lens/public/editor_frame_service/embeddable/embeddable.tsx", + "lineNumber": 85 } }, { - "plugin": "indexPatternManagement", + "plugin": "lens", "link": { - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/indexed_fields_table/components/table/table.tsx", - "lineNumber": 171 + "path": "x-pack/plugins/lens/public/indexpattern_datasource/field_item.tsx", + "lineNumber": 47 } }, { - "plugin": "indexPatternManagement", + "plugin": "lens", "link": { - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/scripted_fields_table/components/table/table.tsx", - "lineNumber": 15 + "path": "x-pack/plugins/lens/public/indexpattern_datasource/field_item.tsx", + "lineNumber": 172 } }, { - "plugin": "indexPatternManagement", + "plugin": "lens", "link": { - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/scripted_fields_table/components/table/table.tsx", - "lineNumber": 18 + "path": "x-pack/plugins/lens/public/indexpattern_datasource/datapanel.tsx", + "lineNumber": 42 } }, { - "plugin": "indexPatternManagement", + "plugin": "lens", "link": { - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/index_header/index_header.tsx", - "lineNumber": 12 + "path": "x-pack/plugins/lens/public/indexpattern_datasource/datapanel.tsx", + "lineNumber": 96 } }, { - "plugin": "indexPatternManagement", + "plugin": "lens", "link": { - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/index_header/index_header.tsx", - "lineNumber": 15 + "path": "x-pack/plugins/lens/public/indexpattern_datasource/datapanel.tsx", + "lineNumber": 166 } }, { @@ -8536,6 +8424,48 @@ "lineNumber": 30 } }, + { + "plugin": "apm", + "link": { + "path": "x-pack/plugins/apm/public/components/shared/KueryBar/index.tsx", + "lineNumber": 14 + } + }, + { + "plugin": "apm", + "link": { + "path": "x-pack/plugins/apm/public/components/shared/KueryBar/index.tsx", + "lineNumber": 31 + } + }, + { + "plugin": "infra", + "link": { + "path": "x-pack/plugins/infra/public/containers/with_kuery_autocompletion.tsx", + "lineNumber": 9 + } + }, + { + "plugin": "infra", + "link": { + "path": "x-pack/plugins/infra/public/containers/with_kuery_autocompletion.tsx", + "lineNumber": 24 + } + }, + { + "plugin": "infra", + "link": { + "path": "x-pack/plugins/infra/public/pages/metrics/metrics_explorer/components/kuery_bar.tsx", + "lineNumber": 15 + } + }, + { + "plugin": "infra", + "link": { + "path": "x-pack/plugins/infra/public/pages/metrics/metrics_explorer/components/kuery_bar.tsx", + "lineNumber": 28 + } + }, { "plugin": "infra", "link": { @@ -8676,32 +8606,74 @@ "lineNumber": 23 } }, + { + "plugin": "lists", + "link": { + "path": "x-pack/plugins/lists/public/exceptions/components/builder/exception_items_renderer.tsx", + "lineNumber": 34 + } + }, + { + "plugin": "lists", + "link": { + "path": "x-pack/plugins/lists/public/exceptions/components/builder/exception_items_renderer.tsx", + "lineNumber": 78 + } + }, + { + "plugin": "lists", + "link": { + "path": "x-pack/plugins/lists/public/exceptions/components/builder/exception_items_renderer.tsx", + "lineNumber": 86 + } + }, + { + "plugin": "lists", + "link": { + "path": "x-pack/plugins/lists/public/exceptions/components/builder/exception_items_renderer.tsx", + "lineNumber": 88 + } + }, { "plugin": "securitySolution", "link": { "path": "x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/types.ts", - "lineNumber": 20 + "lineNumber": 21 } }, { "plugin": "securitySolution", "link": { "path": "x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/types.ts", - "lineNumber": 64 + "lineNumber": 66 } }, { "plugin": "securitySolution", "link": { "path": "x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/store/action.ts", - "lineNumber": 17 + "lineNumber": 19 } }, { "plugin": "securitySolution", "link": { "path": "x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/store/action.ts", - "lineNumber": 98 + "lineNumber": 100 + } + }, + { + "plugin": "securitySolution", + "link": { + "path": "x-pack/plugins/security_solution/common/search_strategy/index_fields/index.ts", + "lineNumber": 8 + } + }, + { + "plugin": "securitySolution", + "link": { + "path": "x-pack/plugins/security_solution/common/search_strategy/index_fields/index.ts", + "lineNumber": 86 } }, { @@ -8939,21 +8911,21 @@ "plugin": "securitySolution", "link": { "path": "x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/store/middleware.ts", - "lineNumber": 32 + "lineNumber": 40 } }, { "plugin": "securitySolution", "link": { "path": "x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/store/middleware.ts", - "lineNumber": 38 + "lineNumber": 55 } }, { "plugin": "securitySolution", "link": { "path": "x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/store/middleware.ts", - "lineNumber": 43 + "lineNumber": 60 } }, { @@ -9040,34 +9012,6 @@ "lineNumber": 33 } }, - { - "plugin": "securitySolution", - "link": { - "path": "x-pack/plugins/security_solution/public/common/containers/kuery_autocompletion/index.tsx", - "lineNumber": 9 - } - }, - { - "plugin": "securitySolution", - "link": { - "path": "x-pack/plugins/security_solution/public/common/containers/kuery_autocompletion/index.tsx", - "lineNumber": 21 - } - }, - { - "plugin": "apm", - "link": { - "path": "x-pack/plugins/apm/public/components/shared/KueryBar/index.tsx", - "lineNumber": 14 - } - }, - { - "plugin": "apm", - "link": { - "path": "x-pack/plugins/apm/public/components/shared/KueryBar/index.tsx", - "lineNumber": 31 - } - }, { "plugin": "uptime", "link": { @@ -9110,6 +9054,20 @@ "lineNumber": 36 } }, + { + "plugin": "securitySolution", + "link": { + "path": "x-pack/plugins/security_solution/target/types/common/search_strategy/index_fields/index.d.ts", + "lineNumber": 1 + } + }, + { + "plugin": "securitySolution", + "link": { + "path": "x-pack/plugins/security_solution/target/types/common/search_strategy/index_fields/index.d.ts", + "lineNumber": 66 + } + }, { "plugin": "infra", "link": { @@ -9153,507 +9111,479 @@ } }, { - "plugin": "infra", + "plugin": "securitySolution", "link": { - "path": "x-pack/plugins/infra/target/types/public/alerting/metric_threshold/components/expression_chart.d.ts", - "lineNumber": 2 + "path": "x-pack/plugins/security_solution/target/types/public/common/containers/source/index.d.ts", + "lineNumber": 1 } }, { - "plugin": "infra", + "plugin": "securitySolution", "link": { - "path": "x-pack/plugins/infra/target/types/public/alerting/metric_threshold/components/expression_chart.d.ts", - "lineNumber": 7 + "path": "x-pack/plugins/security_solution/target/types/public/common/containers/source/index.d.ts", + "lineNumber": 10 } }, { - "plugin": "infra", + "plugin": "securitySolution", "link": { - "path": "x-pack/plugins/infra/target/types/public/alerting/metric_threshold/hooks/use_metrics_explorer_chart_data.d.ts", - "lineNumber": 1 - } - }, - { - "plugin": "infra", - "link": { - "path": "x-pack/plugins/infra/target/types/public/alerting/metric_threshold/hooks/use_metrics_explorer_chart_data.d.ts", - "lineNumber": 4 + "path": "x-pack/plugins/security_solution/target/types/public/common/containers/source/index.d.ts", + "lineNumber": 23 } }, { "plugin": "infra", "link": { - "path": "x-pack/plugins/infra/target/types/public/pages/metrics/metrics_explorer/index.d.ts", - "lineNumber": 1 + "path": "x-pack/plugins/infra/target/types/public/alerting/metric_threshold/components/expression_chart.d.ts", + "lineNumber": 2 } }, { "plugin": "infra", "link": { - "path": "x-pack/plugins/infra/target/types/public/pages/metrics/metrics_explorer/index.d.ts", - "lineNumber": 5 + "path": "x-pack/plugins/infra/target/types/public/alerting/metric_threshold/components/expression_chart.d.ts", + "lineNumber": 7 } }, { "plugin": "infra", "link": { - "path": "x-pack/plugins/infra/target/types/public/pages/metrics/metrics_explorer/hooks/use_metric_explorer_state.d.ts", + "path": "x-pack/plugins/infra/target/types/public/alerting/metric_threshold/hooks/use_metrics_explorer_chart_data.d.ts", "lineNumber": 1 } }, { "plugin": "infra", "link": { - "path": "x-pack/plugins/infra/target/types/public/pages/metrics/metrics_explorer/hooks/use_metric_explorer_state.d.ts", - "lineNumber": 11 + "path": "x-pack/plugins/infra/target/types/public/alerting/metric_threshold/hooks/use_metrics_explorer_chart_data.d.ts", + "lineNumber": 4 } }, { "plugin": "infra", "link": { - "path": "x-pack/plugins/infra/target/types/public/pages/metrics/metrics_explorer/hooks/use_metrics_explorer_data.d.ts", + "path": "x-pack/plugins/infra/target/types/public/pages/metrics/metrics_explorer/index.d.ts", "lineNumber": 1 } }, { "plugin": "infra", "link": { - "path": "x-pack/plugins/infra/target/types/public/pages/metrics/metrics_explorer/hooks/use_metrics_explorer_data.d.ts", - "lineNumber": 4 + "path": "x-pack/plugins/infra/target/types/public/pages/metrics/metrics_explorer/index.d.ts", + "lineNumber": 5 } }, { - "plugin": "ml", + "plugin": "securitySolution", "link": { - "path": "x-pack/plugins/ml/target/types/public/application/jobs/new_job/common/index_pattern_context.d.ts", - "lineNumber": 2 + "path": "x-pack/plugins/security_solution/target/types/public/common/components/url_state/types.d.ts", + "lineNumber": 3 } }, { - "plugin": "ml", + "plugin": "securitySolution", "link": { - "path": "x-pack/plugins/ml/target/types/public/application/jobs/new_job/common/index_pattern_context.d.ts", - "lineNumber": 3 + "path": "x-pack/plugins/security_solution/target/types/public/common/components/url_state/types.d.ts", + "lineNumber": 25 } }, { - "plugin": "ml", + "plugin": "securitySolution", "link": { - "path": "x-pack/plugins/ml/target/types/public/application/jobs/new_job/common/index_pattern_context.d.ts", - "lineNumber": 4 + "path": "x-pack/plugins/security_solution/target/types/public/common/components/url_state/types.d.ts", + "lineNumber": 55 } }, { - "plugin": "lists", + "plugin": "securitySolution", "link": { - "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/field.tsx", - "lineNumber": 11 + "path": "x-pack/plugins/security_solution/target/types/public/network/components/network_top_countries_table/columns.d.ts", + "lineNumber": 1 } }, { - "plugin": "lists", + "plugin": "securitySolution", "link": { - "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/field.tsx", - "lineNumber": 21 + "path": "x-pack/plugins/security_solution/target/types/public/network/components/network_top_countries_table/columns.d.ts", + "lineNumber": 20 } }, { - "plugin": "lists", + "plugin": "securitySolution", "link": { - "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/field.tsx", - "lineNumber": 100 + "path": "x-pack/plugins/security_solution/target/types/public/network/components/network_top_countries_table/columns.d.ts", + "lineNumber": 21 } }, { - "plugin": "lists", + "plugin": "securitySolution", "link": { - "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/field.tsx", - "lineNumber": 121 + "path": "x-pack/plugins/security_solution/target/types/public/common/components/search_bar/index.d.ts", + "lineNumber": 3 } }, { - "plugin": "lists", + "plugin": "securitySolution", "link": { - "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/hooks/use_field_value_autocomplete.ts", - "lineNumber": 13 + "path": "x-pack/plugins/security_solution/target/types/public/common/components/search_bar/index.d.ts", + "lineNumber": 9 } }, { - "plugin": "lists", + "plugin": "securitySolution", "link": { - "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/hooks/use_field_value_autocomplete.ts", - "lineNumber": 17 + "path": "x-pack/plugins/security_solution/target/types/public/hosts/pages/details/types.d.ts", + "lineNumber": 2 } }, { - "plugin": "lists", + "plugin": "securitySolution", "link": { - "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/hooks/use_field_value_autocomplete.ts", - "lineNumber": 29 + "path": "x-pack/plugins/security_solution/target/types/public/hosts/pages/details/types.d.ts", + "lineNumber": 40 } }, { - "plugin": "lists", + "plugin": "securitySolution", "link": { - "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/field_value_match.tsx", - "lineNumber": 19 + "path": "x-pack/plugins/security_solution/target/types/public/network/components/network_top_countries_table/index.d.ts", + "lineNumber": 2 } }, { - "plugin": "lists", + "plugin": "securitySolution", "link": { - "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/field_value_match.tsx", - "lineNumber": 38 + "path": "x-pack/plugins/security_solution/target/types/public/network/components/network_top_countries_table/index.d.ts", + "lineNumber": 10 } }, { - "plugin": "lists", + "plugin": "securitySolution", "link": { - "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/field_value_match_any.tsx", - "lineNumber": 13 + "path": "x-pack/plugins/security_solution/target/types/public/network/pages/details/types.d.ts", + "lineNumber": 1 } }, { - "plugin": "lists", + "plugin": "securitySolution", "link": { - "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/field_value_match_any.tsx", + "path": "x-pack/plugins/security_solution/target/types/public/network/pages/details/types.d.ts", "lineNumber": 25 } }, { - "plugin": "lists", + "plugin": "infra", "link": { - "path": "x-pack/plugins/lists/public/exceptions/components/builder/entry_renderer.tsx", - "lineNumber": 31 + "path": "x-pack/plugins/infra/target/types/public/pages/metrics/metrics_explorer/hooks/use_metric_explorer_state.d.ts", + "lineNumber": 1 } }, { - "plugin": "lists", + "plugin": "infra", "link": { - "path": "x-pack/plugins/lists/public/exceptions/components/builder/entry_renderer.tsx", - "lineNumber": 53 + "path": "x-pack/plugins/infra/target/types/public/pages/metrics/metrics_explorer/hooks/use_metric_explorer_state.d.ts", + "lineNumber": 11 } }, { - "plugin": "lists", + "plugin": "infra", "link": { - "path": "x-pack/plugins/lists/public/exceptions/components/builder/entry_renderer.tsx", - "lineNumber": 58 + "path": "x-pack/plugins/infra/target/types/public/pages/metrics/metrics_explorer/hooks/use_metrics_explorer_data.d.ts", + "lineNumber": 1 } }, { - "plugin": "lists", + "plugin": "infra", "link": { - "path": "x-pack/plugins/lists/public/exceptions/components/builder/entry_renderer.tsx", - "lineNumber": 61 + "path": "x-pack/plugins/infra/target/types/public/pages/metrics/metrics_explorer/hooks/use_metrics_explorer_data.d.ts", + "lineNumber": 4 } }, { - "plugin": "lists", + "plugin": "ml", "link": { - "path": "x-pack/plugins/lists/public/exceptions/components/builder/exception_item_renderer.tsx", - "lineNumber": 22 + "path": "x-pack/plugins/ml/target/types/public/application/jobs/new_job/common/index_pattern_context.d.ts", + "lineNumber": 2 } }, { - "plugin": "lists", + "plugin": "ml", "link": { - "path": "x-pack/plugins/lists/public/exceptions/components/builder/exception_item_renderer.tsx", - "lineNumber": 50 + "path": "x-pack/plugins/ml/target/types/public/application/jobs/new_job/common/index_pattern_context.d.ts", + "lineNumber": 3 } }, { - "plugin": "lists", + "plugin": "ml", "link": { - "path": "x-pack/plugins/lists/public/exceptions/components/builder/exception_item_renderer.tsx", - "lineNumber": 55 + "path": "x-pack/plugins/ml/target/types/public/application/jobs/new_job/common/index_pattern_context.d.ts", + "lineNumber": 4 } }, { - "plugin": "lists", + "plugin": "ml", "link": { - "path": "x-pack/plugins/lists/public/exceptions/components/builder/exception_item_renderer.tsx", - "lineNumber": 58 + "path": "x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components/action_clone/clone_action_name.tsx", + "lineNumber": 12 } }, { - "plugin": "lists", + "plugin": "ml", "link": { - "path": "x-pack/plugins/lists/public/exceptions/components/builder/helpers.test.ts", - "lineNumber": 62 + "path": "x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components/action_clone/clone_action_name.tsx", + "lineNumber": 412 } }, { - "plugin": "lists", + "plugin": "ml", "link": { - "path": "x-pack/plugins/lists/public/exceptions/components/builder/helpers.test.ts", - "lineNumber": 96 + "path": "x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components/action_delete/use_delete_action.tsx", + "lineNumber": 12 } }, { - "plugin": "lists", + "plugin": "ml", "link": { - "path": "x-pack/plugins/lists/public/exceptions/components/builder/helpers.test.ts", - "lineNumber": 169 + "path": "x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components/action_delete/use_delete_action.tsx", + "lineNumber": 60 } }, { - "plugin": "lists", + "plugin": "ml", "link": { - "path": "x-pack/plugins/lists/public/exceptions/components/builder/helpers.test.ts", - "lineNumber": 169 + "path": "x-pack/plugins/ml/public/application/jobs/components/custom_url_editor/utils.d.ts", + "lineNumber": 8 } }, { - "plugin": "lists", + "plugin": "ml", "link": { - "path": "x-pack/plugins/lists/public/exceptions/components/builder/helpers.test.ts", - "lineNumber": 184 + "path": "x-pack/plugins/ml/public/application/jobs/components/custom_url_editor/utils.d.ts", + "lineNumber": 37 } }, { - "plugin": "lists", + "plugin": "ml", "link": { - "path": "x-pack/plugins/lists/public/exceptions/components/builder/helpers.test.ts", - "lineNumber": 187 + "path": "x-pack/plugins/ml/public/application/jobs/jobs_list/components/edit_job_flyout/edit_utils.d.ts", + "lineNumber": 8 } }, { - "plugin": "lists", + "plugin": "ml", "link": { - "path": "x-pack/plugins/lists/public/exceptions/components/builder/helpers.test.ts", - "lineNumber": 196 + "path": "x-pack/plugins/ml/public/application/jobs/jobs_list/components/edit_job_flyout/edit_utils.d.ts", + "lineNumber": 11 } }, { - "plugin": "lists", + "plugin": "ml", "link": { - "path": "x-pack/plugins/lists/public/exceptions/components/builder/helpers.test.ts", - "lineNumber": 199 + "path": "x-pack/plugins/ml/public/application/datavisualizer/index_based/components/actions_panel/actions_panel.tsx", + "lineNumber": 25 } }, { - "plugin": "lists", + "plugin": "ml", "link": { - "path": "x-pack/plugins/lists/public/exceptions/components/builder/helpers.test.ts", - "lineNumber": 208 + "path": "x-pack/plugins/ml/public/application/datavisualizer/index_based/components/actions_panel/actions_panel.tsx", + "lineNumber": 28 } }, { - "plugin": "lists", + "plugin": "infra", "link": { - "path": "x-pack/plugins/lists/public/exceptions/components/builder/helpers.test.ts", - "lineNumber": 214 + "path": "x-pack/plugins/infra/public/pages/metrics/index.tsx", + "lineNumber": 14 } }, { - "plugin": "lists", + "plugin": "infra", "link": { - "path": "x-pack/plugins/lists/public/exceptions/components/builder/helpers.test.ts", - "lineNumber": 226 + "path": "x-pack/plugins/infra/public/pages/metrics/index.tsx", + "lineNumber": 193 } }, { - "plugin": "lists", + "plugin": "visTypeTimeseries", "link": { - "path": "x-pack/plugins/lists/public/exceptions/components/builder/helpers.test.ts", - "lineNumber": 229 + "path": "src/plugins/vis_type_timeseries/common/index_patterns_utils.ts", + "lineNumber": 11 } }, { - "plugin": "lists", + "plugin": "visTypeTimeseries", "link": { - "path": "x-pack/plugins/lists/public/exceptions/components/builder/helpers.test.ts", - "lineNumber": 239 + "path": "src/plugins/vis_type_timeseries/common/index_patterns_utils.ts", + "lineNumber": 20 } }, { "plugin": "lists", "link": { - "path": "x-pack/plugins/lists/public/exceptions/components/builder/helpers.test.ts", - "lineNumber": 267 + "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/field.tsx", + "lineNumber": 11 } }, { "plugin": "lists", "link": { - "path": "x-pack/plugins/lists/public/exceptions/components/builder/helpers.test.ts", - "lineNumber": 285 + "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/field.tsx", + "lineNumber": 21 } }, { "plugin": "lists", "link": { - "path": "x-pack/plugins/lists/public/exceptions/components/builder/helpers.test.ts", - "lineNumber": 320 + "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/field.tsx", + "lineNumber": 100 } }, { "plugin": "lists", "link": { - "path": "x-pack/plugins/lists/public/exceptions/components/builder/helpers.test.ts", - "lineNumber": 336 + "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/field.tsx", + "lineNumber": 121 } }, { "plugin": "lists", "link": { - "path": "x-pack/plugins/lists/public/exceptions/components/builder/helpers.test.ts", - "lineNumber": 1026 + "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/hooks/use_field_value_autocomplete.ts", + "lineNumber": 13 } }, { "plugin": "lists", "link": { - "path": "x-pack/plugins/lists/public/exceptions/components/builder/helpers.test.ts", - "lineNumber": 1045 + "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/hooks/use_field_value_autocomplete.ts", + "lineNumber": 17 } }, { "plugin": "lists", "link": { - "path": "x-pack/plugins/lists/public/exceptions/components/builder/helpers.test.ts", - "lineNumber": 1095 + "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/hooks/use_field_value_autocomplete.ts", + "lineNumber": 29 } }, { "plugin": "lists", "link": { - "path": "x-pack/plugins/lists/public/exceptions/components/builder/helpers.test.ts", - "lineNumber": 1251 + "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/field_value_match.tsx", + "lineNumber": 19 } }, { "plugin": "lists", "link": { - "path": "x-pack/plugins/lists/public/exceptions/components/builder/helpers.test.ts", - "lineNumber": 1302 + "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/field_value_match.tsx", + "lineNumber": 38 } }, { "plugin": "lists", "link": { - "path": "x-pack/plugins/lists/public/exceptions/components/builder/helpers.test.ts", - "lineNumber": 1352 + "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/field_value_match_any.tsx", + "lineNumber": 13 } }, { - "plugin": "securitySolution", + "plugin": "lists", "link": { - "path": "x-pack/plugins/security_solution/common/detection_engine/get_query_filter.ts", - "lineNumber": 15 + "path": "x-pack/plugins/lists/public/exceptions/components/autocomplete/field_value_match_any.tsx", + "lineNumber": 25 } }, { - "plugin": "securitySolution", + "plugin": "lists", "link": { - "path": "x-pack/plugins/security_solution/common/detection_engine/get_query_filter.ts", + "path": "x-pack/plugins/lists/public/exceptions/components/builder/entry_renderer.tsx", "lineNumber": 31 } }, { - "plugin": "ml", - "link": { - "path": "x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components/action_clone/clone_action_name.tsx", - "lineNumber": 12 - } - }, - { - "plugin": "ml", - "link": { - "path": "x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components/action_clone/clone_action_name.tsx", - "lineNumber": 412 - } - }, - { - "plugin": "ml", - "link": { - "path": "x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components/action_delete/use_delete_action.tsx", - "lineNumber": 12 - } - }, - { - "plugin": "ml", + "plugin": "lists", "link": { - "path": "x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components/action_delete/use_delete_action.tsx", - "lineNumber": 60 + "path": "x-pack/plugins/lists/public/exceptions/components/builder/entry_renderer.tsx", + "lineNumber": 53 } }, { - "plugin": "ml", + "plugin": "lists", "link": { - "path": "x-pack/plugins/ml/public/application/jobs/components/custom_url_editor/utils.d.ts", - "lineNumber": 8 + "path": "x-pack/plugins/lists/public/exceptions/components/builder/entry_renderer.tsx", + "lineNumber": 58 } }, { - "plugin": "ml", + "plugin": "lists", "link": { - "path": "x-pack/plugins/ml/public/application/jobs/components/custom_url_editor/utils.d.ts", - "lineNumber": 37 + "path": "x-pack/plugins/lists/public/exceptions/components/builder/entry_renderer.tsx", + "lineNumber": 61 } }, { - "plugin": "ml", + "plugin": "lists", "link": { - "path": "x-pack/plugins/ml/public/application/jobs/jobs_list/components/edit_job_flyout/edit_utils.d.ts", - "lineNumber": 8 + "path": "x-pack/plugins/lists/public/exceptions/components/builder/exception_item_renderer.tsx", + "lineNumber": 22 } }, { - "plugin": "ml", + "plugin": "lists", "link": { - "path": "x-pack/plugins/ml/public/application/jobs/jobs_list/components/edit_job_flyout/edit_utils.d.ts", - "lineNumber": 11 + "path": "x-pack/plugins/lists/public/exceptions/components/builder/exception_item_renderer.tsx", + "lineNumber": 50 } }, { - "plugin": "ml", + "plugin": "lists", "link": { - "path": "x-pack/plugins/ml/public/application/datavisualizer/index_based/components/actions_panel/actions_panel.tsx", - "lineNumber": 25 + "path": "x-pack/plugins/lists/public/exceptions/components/builder/exception_item_renderer.tsx", + "lineNumber": 55 } }, { - "plugin": "ml", + "plugin": "lists", "link": { - "path": "x-pack/plugins/ml/public/application/datavisualizer/index_based/components/actions_panel/actions_panel.tsx", - "lineNumber": 28 + "path": "x-pack/plugins/lists/public/exceptions/components/builder/exception_item_renderer.tsx", + "lineNumber": 58 } }, { - "plugin": "infra", + "plugin": "securitySolution", "link": { - "path": "x-pack/plugins/infra/public/pages/metrics/index.tsx", - "lineNumber": 14 + "path": "x-pack/plugins/security_solution/public/network/pages/navigation/types.ts", + "lineNumber": 9 } }, { - "plugin": "infra", + "plugin": "securitySolution", "link": { - "path": "x-pack/plugins/infra/public/pages/metrics/index.tsx", - "lineNumber": 193 + "path": "x-pack/plugins/security_solution/public/network/pages/navigation/types.ts", + "lineNumber": 35 } }, { "plugin": "securitySolution", "link": { "path": "x-pack/plugins/security_solution/public/network/pages/navigation/types.ts", - "lineNumber": 9 + "lineNumber": 53 } }, { "plugin": "securitySolution", "link": { - "path": "x-pack/plugins/security_solution/public/network/pages/navigation/types.ts", - "lineNumber": 35 + "path": "x-pack/plugins/security_solution/common/detection_engine/get_query_filter.ts", + "lineNumber": 16 } }, { "plugin": "securitySolution", "link": { - "path": "x-pack/plugins/security_solution/public/network/pages/navigation/types.ts", - "lineNumber": 53 + "path": "x-pack/plugins/security_solution/common/detection_engine/get_query_filter.ts", + "lineNumber": 31 } }, { @@ -9736,211 +9666,267 @@ { "plugin": "securitySolution", "link": { - "path": "x-pack/plugins/security_solution/public/common/components/autocomplete/field.tsx", - "lineNumber": 93 + "path": "x-pack/plugins/security_solution/public/common/components/autocomplete/field.tsx", + "lineNumber": 93 + } + }, + { + "plugin": "securitySolution", + "link": { + "path": "x-pack/plugins/security_solution/public/common/components/autocomplete/field.tsx", + "lineNumber": 114 + } + }, + { + "plugin": "securitySolution", + "link": { + "path": "x-pack/plugins/security_solution/public/common/components/autocomplete/hooks/use_field_value_autocomplete.ts", + "lineNumber": 12 + } + }, + { + "plugin": "securitySolution", + "link": { + "path": "x-pack/plugins/security_solution/public/common/components/autocomplete/hooks/use_field_value_autocomplete.ts", + "lineNumber": 19 + } + }, + { + "plugin": "securitySolution", + "link": { + "path": "x-pack/plugins/security_solution/public/common/components/autocomplete/hooks/use_field_value_autocomplete.ts", + "lineNumber": 31 + } + }, + { + "plugin": "securitySolution", + "link": { + "path": "x-pack/plugins/security_solution/public/common/components/autocomplete/field_value_match.tsx", + "lineNumber": 19 + } + }, + { + "plugin": "securitySolution", + "link": { + "path": "x-pack/plugins/security_solution/public/common/components/autocomplete/field_value_match.tsx", + "lineNumber": 30 + } + }, + { + "plugin": "stackAlerts", + "link": { + "path": "x-pack/plugins/stack_alerts/server/alert_types/geo_containment/es_query_builder.ts", + "lineNumber": 13 + } + }, + { + "plugin": "stackAlerts", + "link": { + "path": "x-pack/plugins/stack_alerts/server/alert_types/geo_containment/es_query_builder.ts", + "lineNumber": 25 } }, { - "plugin": "securitySolution", + "plugin": "infra", "link": { - "path": "x-pack/plugins/security_solution/public/common/components/autocomplete/field.tsx", - "lineNumber": 114 + "path": "x-pack/plugins/infra/common/dependency_mocks/index_patterns.ts", + "lineNumber": 13 } }, { - "plugin": "securitySolution", + "plugin": "infra", "link": { - "path": "x-pack/plugins/security_solution/public/common/components/autocomplete/hooks/use_field_value_autocomplete.ts", - "lineNumber": 12 + "path": "x-pack/plugins/infra/common/dependency_mocks/index_patterns.ts", + "lineNumber": 30 } }, { - "plugin": "securitySolution", + "plugin": "infra", "link": { - "path": "x-pack/plugins/security_solution/public/common/components/autocomplete/hooks/use_field_value_autocomplete.ts", - "lineNumber": 19 + "path": "x-pack/plugins/infra/target/types/common/dependency_mocks/index_patterns.d.ts", + "lineNumber": 1 } }, { - "plugin": "securitySolution", + "plugin": "infra", "link": { - "path": "x-pack/plugins/security_solution/public/common/components/autocomplete/hooks/use_field_value_autocomplete.ts", - "lineNumber": 31 + "path": "x-pack/plugins/infra/target/types/common/dependency_mocks/index_patterns.d.ts", + "lineNumber": 3 } }, { - "plugin": "securitySolution", + "plugin": "lists", "link": { - "path": "x-pack/plugins/security_solution/public/common/components/autocomplete/field_value_match.tsx", - "lineNumber": 19 + "path": "x-pack/plugins/lists/public/exceptions/components/builder/helpers.test.ts", + "lineNumber": 62 } }, { - "plugin": "securitySolution", + "plugin": "lists", "link": { - "path": "x-pack/plugins/security_solution/public/common/components/autocomplete/field_value_match.tsx", - "lineNumber": 30 + "path": "x-pack/plugins/lists/public/exceptions/components/builder/helpers.test.ts", + "lineNumber": 96 } }, { - "plugin": "securitySolution", + "plugin": "lists", "link": { - "path": "x-pack/plugins/security_solution/public/common/components/autocomplete/field_value_match_any.tsx", - "lineNumber": 13 + "path": "x-pack/plugins/lists/public/exceptions/components/builder/helpers.test.ts", + "lineNumber": 169 } }, { - "plugin": "securitySolution", + "plugin": "lists", "link": { - "path": "x-pack/plugins/security_solution/public/common/components/autocomplete/field_value_match_any.tsx", - "lineNumber": 24 + "path": "x-pack/plugins/lists/public/exceptions/components/builder/helpers.test.ts", + "lineNumber": 169 } }, { - "plugin": "securitySolution", + "plugin": "lists", "link": { - "path": "x-pack/plugins/security_solution/public/common/components/exceptions/helpers.test.tsx", - "lineNumber": 43 + "path": "x-pack/plugins/lists/public/exceptions/components/builder/helpers.test.ts", + "lineNumber": 184 } }, { - "plugin": "securitySolution", + "plugin": "lists", "link": { - "path": "x-pack/plugins/security_solution/public/common/components/exceptions/helpers.test.tsx", - "lineNumber": 49 + "path": "x-pack/plugins/lists/public/exceptions/components/builder/helpers.test.ts", + "lineNumber": 187 } }, { - "plugin": "securitySolution", + "plugin": "lists", "link": { - "path": "x-pack/plugins/security_solution/public/common/components/exceptions/helpers.test.tsx", - "lineNumber": 368 + "path": "x-pack/plugins/lists/public/exceptions/components/builder/helpers.test.ts", + "lineNumber": 196 } }, { - "plugin": "visTypeTimeseries", + "plugin": "lists", "link": { - "path": "src/plugins/vis_type_timeseries/common/index_patterns_utils.ts", - "lineNumber": 11 + "path": "x-pack/plugins/lists/public/exceptions/components/builder/helpers.test.ts", + "lineNumber": 199 } }, { - "plugin": "visTypeTimeseries", + "plugin": "lists", "link": { - "path": "src/plugins/vis_type_timeseries/common/index_patterns_utils.ts", - "lineNumber": 20 + "path": "x-pack/plugins/lists/public/exceptions/components/builder/helpers.test.ts", + "lineNumber": 208 } }, { - "plugin": "stackAlerts", + "plugin": "lists", "link": { - "path": "x-pack/plugins/stack_alerts/server/alert_types/geo_containment/es_query_builder.ts", - "lineNumber": 13 + "path": "x-pack/plugins/lists/public/exceptions/components/builder/helpers.test.ts", + "lineNumber": 214 } }, { - "plugin": "stackAlerts", + "plugin": "lists", "link": { - "path": "x-pack/plugins/stack_alerts/server/alert_types/geo_containment/es_query_builder.ts", - "lineNumber": 25 + "path": "x-pack/plugins/lists/public/exceptions/components/builder/helpers.test.ts", + "lineNumber": 226 } }, { - "plugin": "infra", + "plugin": "lists", "link": { - "path": "x-pack/plugins/infra/common/dependency_mocks/index_patterns.ts", - "lineNumber": 13 + "path": "x-pack/plugins/lists/public/exceptions/components/builder/helpers.test.ts", + "lineNumber": 229 } }, { - "plugin": "infra", + "plugin": "lists", "link": { - "path": "x-pack/plugins/infra/common/dependency_mocks/index_patterns.ts", - "lineNumber": 30 + "path": "x-pack/plugins/lists/public/exceptions/components/builder/helpers.test.ts", + "lineNumber": 239 } }, { - "plugin": "infra", + "plugin": "lists", "link": { - "path": "x-pack/plugins/infra/target/types/common/dependency_mocks/index_patterns.d.ts", - "lineNumber": 1 + "path": "x-pack/plugins/lists/public/exceptions/components/builder/helpers.test.ts", + "lineNumber": 267 } }, { - "plugin": "infra", + "plugin": "lists", "link": { - "path": "x-pack/plugins/infra/target/types/common/dependency_mocks/index_patterns.d.ts", - "lineNumber": 3 + "path": "x-pack/plugins/lists/public/exceptions/components/builder/helpers.test.ts", + "lineNumber": 285 } }, { - "plugin": "discover", + "plugin": "lists", "link": { - "path": "src/plugins/discover/public/application/components/context_app/context_app_legacy.tsx", - "lineNumber": 17 + "path": "x-pack/plugins/lists/public/exceptions/components/builder/helpers.test.ts", + "lineNumber": 320 } }, { - "plugin": "discover", + "plugin": "lists", "link": { - "path": "src/plugins/discover/public/application/components/context_app/context_app_legacy.tsx", - "lineNumber": 26 + "path": "x-pack/plugins/lists/public/exceptions/components/builder/helpers.test.ts", + "lineNumber": 336 } }, { - "plugin": "observability", + "plugin": "lists", "link": { - "path": "x-pack/plugins/observability/public/components/shared/exploratory_view/types.ts", - "lineNumber": 18 + "path": "x-pack/plugins/lists/public/exceptions/components/builder/helpers.test.ts", + "lineNumber": 1026 } }, { - "plugin": "observability", + "plugin": "lists", "link": { - "path": "x-pack/plugins/observability/public/components/shared/exploratory_view/types.ts", - "lineNumber": 95 + "path": "x-pack/plugins/lists/public/exceptions/components/builder/helpers.test.ts", + "lineNumber": 1045 } }, { - "plugin": "observability", + "plugin": "lists", "link": { - "path": "x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/utils.ts", - "lineNumber": 10 + "path": "x-pack/plugins/lists/public/exceptions/components/builder/helpers.test.ts", + "lineNumber": 1095 } }, { - "plugin": "observability", + "plugin": "lists", "link": { - "path": "x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/utils.ts", - "lineNumber": 53 + "path": "x-pack/plugins/lists/public/exceptions/components/builder/helpers.test.ts", + "lineNumber": 1251 } }, { - "plugin": "observability", + "plugin": "lists", "link": { - "path": "x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/utils.ts", - "lineNumber": 61 + "path": "x-pack/plugins/lists/public/exceptions/components/builder/helpers.test.ts", + "lineNumber": 1302 } }, { - "plugin": "observability", + "plugin": "lists", "link": { - "path": "x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/utils.ts", - "lineNumber": 69 + "path": "x-pack/plugins/lists/public/exceptions/components/builder/helpers.test.ts", + "lineNumber": 1352 } }, { - "plugin": "observability", + "plugin": "discover", "link": { - "path": "x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/default_configs.ts", - "lineNumber": 19 + "path": "src/plugins/discover/public/application/components/context_app/context_app_legacy.tsx", + "lineNumber": 17 } }, { - "plugin": "observability", + "plugin": "discover", "link": { - "path": "x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/default_configs.ts", - "lineNumber": 24 + "path": "src/plugins/discover/public/application/components/context_app/context_app_legacy.tsx", + "lineNumber": 26 } }, { @@ -10055,6 +10041,62 @@ "lineNumber": 17 } }, + { + "plugin": "observability", + "link": { + "path": "x-pack/plugins/observability/public/components/shared/exploratory_view/types.ts", + "lineNumber": 18 + } + }, + { + "plugin": "observability", + "link": { + "path": "x-pack/plugins/observability/public/components/shared/exploratory_view/types.ts", + "lineNumber": 95 + } + }, + { + "plugin": "observability", + "link": { + "path": "x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/utils.ts", + "lineNumber": 10 + } + }, + { + "plugin": "observability", + "link": { + "path": "x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/utils.ts", + "lineNumber": 53 + } + }, + { + "plugin": "observability", + "link": { + "path": "x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/utils.ts", + "lineNumber": 61 + } + }, + { + "plugin": "observability", + "link": { + "path": "x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/utils.ts", + "lineNumber": 69 + } + }, + { + "plugin": "observability", + "link": { + "path": "x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/default_configs.ts", + "lineNumber": 19 + } + }, + { + "plugin": "observability", + "link": { + "path": "x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/default_configs.ts", + "lineNumber": 24 + } + }, { "plugin": "securitySolution", "link": { @@ -10125,20 +10167,6 @@ "lineNumber": 19 } }, - { - "plugin": "securitySolution", - "link": { - "path": "x-pack/plugins/security_solution/public/common/mock/index_pattern.ts", - "lineNumber": 8 - } - }, - { - "plugin": "securitySolution", - "link": { - "path": "x-pack/plugins/security_solution/public/common/mock/index_pattern.ts", - "lineNumber": 10 - } - }, { "plugin": "stackAlerts", "link": { @@ -10258,6 +10286,20 @@ "lineNumber": 13 } }, + { + "plugin": "securitySolution", + "link": { + "path": "x-pack/plugins/security_solution/public/common/mock/index_pattern.ts", + "lineNumber": 8 + } + }, + { + "plugin": "securitySolution", + "link": { + "path": "x-pack/plugins/security_solution/public/common/mock/index_pattern.ts", + "lineNumber": 10 + } + }, { "plugin": "ml", "link": { diff --git a/api_docs/data_search.json b/api_docs/data_search.json index a82a2ca24d899e..082553e94dcf42 100644 --- a/api_docs/data_search.json +++ b/api_docs/data_search.json @@ -2690,7 +2690,7 @@ ], "source": { "path": "src/plugins/data/server/search/types.ts", - "lineNumber": 89 + "lineNumber": 90 }, "deprecated": false, "children": [ @@ -2708,7 +2708,7 @@ ], "source": { "path": "src/plugins/data/server/search/types.ts", - "lineNumber": 90 + "lineNumber": 91 }, "deprecated": false, "returnComment": [], @@ -2758,7 +2758,7 @@ ], "source": { "path": "src/plugins/data/server/search/types.ts", - "lineNumber": 91 + "lineNumber": 92 }, "deprecated": false, "returnComment": [], @@ -2806,7 +2806,7 @@ ], "source": { "path": "src/plugins/data/server/search/types.ts", - "lineNumber": 92 + "lineNumber": 93 }, "deprecated": false, "returnComment": [], @@ -2875,7 +2875,7 @@ ], "source": { "path": "src/plugins/data/server/search/types.ts", - "lineNumber": 93 + "lineNumber": 94 }, "deprecated": false, "returnComment": [], @@ -2923,7 +2923,7 @@ ], "source": { "path": "src/plugins/data/server/search/types.ts", - "lineNumber": 94 + "lineNumber": 95 }, "deprecated": false, "returnComment": [], @@ -2955,7 +2955,7 @@ ], "source": { "path": "src/plugins/data/server/search/types.ts", - "lineNumber": 95 + "lineNumber": 96 }, "deprecated": false, "returnComment": [], @@ -2995,7 +2995,7 @@ ], "source": { "path": "src/plugins/data/server/search/types.ts", - "lineNumber": 96 + "lineNumber": 97 }, "deprecated": false, "returnComment": [], @@ -3128,7 +3128,7 @@ "description": [], "source": { "path": "src/plugins/data/server/search/types.ts", - "lineNumber": 42 + "lineNumber": 43 }, "deprecated": false, "children": [ @@ -3144,7 +3144,7 @@ ], "source": { "path": "src/plugins/data/server/search/types.ts", - "lineNumber": 43 + "lineNumber": 44 }, "deprecated": false }, @@ -3202,7 +3202,7 @@ ], "source": { "path": "src/plugins/data/server/search/types.ts", - "lineNumber": 48 + "lineNumber": 49 }, "deprecated": false, "returnComment": [], @@ -3216,7 +3216,7 @@ "description": [], "source": { "path": "src/plugins/data/server/search/types.ts", - "lineNumber": 52 + "lineNumber": 53 }, "deprecated": false }, @@ -3239,7 +3239,7 @@ ], "source": { "path": "src/plugins/data/server/search/types.ts", - "lineNumber": 53 + "lineNumber": 54 }, "deprecated": false } @@ -3266,7 +3266,7 @@ ], "source": { "path": "src/plugins/data/server/search/types.ts", - "lineNumber": 59 + "lineNumber": 60 }, "deprecated": false } @@ -3292,7 +3292,7 @@ ], "source": { "path": "src/plugins/data/server/search/types.ts", - "lineNumber": 99 + "lineNumber": 100 }, "deprecated": false, "children": [ @@ -3308,7 +3308,7 @@ ], "source": { "path": "src/plugins/data/server/search/types.ts", - "lineNumber": 103 + "lineNumber": 104 }, "deprecated": false }, @@ -3334,7 +3334,7 @@ ], "source": { "path": "src/plugins/data/server/search/types.ts", - "lineNumber": 109 + "lineNumber": 110 }, "deprecated": false, "returnComment": [], @@ -3351,7 +3351,7 @@ ], "source": { "path": "src/plugins/data/server/search/types.ts", - "lineNumber": 110 + "lineNumber": 111 }, "deprecated": false } @@ -3384,7 +3384,7 @@ ], "source": { "path": "src/plugins/data/server/search/types.ts", - "lineNumber": 112 + "lineNumber": 113 }, "deprecated": false, "returnComment": [], @@ -3408,7 +3408,7 @@ ], "source": { "path": "src/plugins/data/server/search/types.ts", - "lineNumber": 112 + "lineNumber": 113 }, "deprecated": false } @@ -3442,7 +3442,7 @@ ], "source": { "path": "src/plugins/data/server/search/types.ts", - "lineNumber": 113 + "lineNumber": 114 }, "deprecated": false } @@ -3470,7 +3470,7 @@ ], "source": { "path": "src/plugins/data/server/search/types.ts", - "lineNumber": 71 + "lineNumber": 72 }, "deprecated": false, "children": [ @@ -3504,7 +3504,7 @@ ], "source": { "path": "src/plugins/data/server/search/types.ts", - "lineNumber": 75 + "lineNumber": 76 }, "deprecated": false, "returnComment": [], @@ -3521,7 +3521,7 @@ ], "source": { "path": "src/plugins/data/server/search/types.ts", - "lineNumber": 76 + "lineNumber": 77 }, "deprecated": false }, @@ -3543,7 +3543,7 @@ ], "source": { "path": "src/plugins/data/server/search/types.ts", - "lineNumber": 77 + "lineNumber": 78 }, "deprecated": false }, @@ -3565,7 +3565,7 @@ ], "source": { "path": "src/plugins/data/server/search/types.ts", - "lineNumber": 78 + "lineNumber": 79 }, "deprecated": false } @@ -3599,7 +3599,7 @@ ], "source": { "path": "src/plugins/data/server/search/types.ts", - "lineNumber": 80 + "lineNumber": 81 }, "deprecated": false }, @@ -3631,7 +3631,7 @@ ], "source": { "path": "src/plugins/data/server/search/types.ts", - "lineNumber": 81 + "lineNumber": 82 }, "deprecated": false } @@ -4027,6 +4027,29 @@ "lineNumber": 39 }, "deprecated": false + }, + { + "parentPluginId": "data", + "id": "def-server.SearchStrategyDependencies.request", + "type": "Object", + "tags": [], + "label": "request", + "description": [], + "signature": [ + { + "pluginId": "core", + "scope": "server", + "docId": "kibCoreHttpPluginApi", + "section": "def-server.KibanaRequest", + "text": "KibanaRequest" + }, + "" + ], + "source": { + "path": "src/plugins/data/server/search/types.ts", + "lineNumber": 40 + }, + "deprecated": false } ], "initialIsOpen": false @@ -4122,7 +4145,7 @@ ], "source": { "path": "src/plugins/data/server/search/types.ts", - "lineNumber": 118 + "lineNumber": 119 }, "deprecated": false, "initialIsOpen": false diff --git a/api_docs/deprecations.mdx b/api_docs/deprecations.mdx index 7d6df4965c7120..9eee6d51d84ab9 100644 --- a/api_docs/deprecations.mdx +++ b/api_docs/deprecations.mdx @@ -42,15 +42,6 @@ warning: This document is auto-generated and is meant to be viewed inside our ex -## beatsManagement - -| Deprecated API | Reference location | Remove By | -| ---------------|-----------|-----------| -| | [kibana_database_adapter.ts#L8](https://github.com/elastic/kibana/tree/master/x-pack/plugins/beats_management/server/lib/adapters/database/kibana_database_adapter.ts#L8) | 7.16 | -| | [kibana_database_adapter.ts#L28](https://github.com/elastic/kibana/tree/master/x-pack/plugins/beats_management/server/lib/adapters/database/kibana_database_adapter.ts#L28) | 7.16 | - - - ## canvas | Deprecated API | Reference location | Remove By | @@ -783,7 +774,7 @@ warning: This document is auto-generated and is meant to be viewed inside our ex | | [field_value_match.tsx#L36](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lists/public/exceptions/components/autocomplete/field_value_match.tsx#L36) | - | | | [field_value_match_any.tsx#L13](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lists/public/exceptions/components/autocomplete/field_value_match_any.tsx#L13) | - | | | [field_value_match_any.tsx#L23](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lists/public/exceptions/components/autocomplete/field_value_match_any.tsx#L23) | - | -| | [field_value_lists.tsx#L13](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lists/public/exceptions/components/autocomplete/field_value_lists.tsx#L13) | - | +| | [field_value_lists.tsx#L14](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lists/public/exceptions/components/autocomplete/field_value_lists.tsx#L14) | - | | | [field_value_lists.tsx#L29](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lists/public/exceptions/components/autocomplete/field_value_lists.tsx#L29) | - | | | [entry_renderer.tsx#L31](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lists/public/exceptions/components/builder/entry_renderer.tsx#L31) | - | | | [entry_renderer.tsx#L91](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lists/public/exceptions/components/builder/entry_renderer.tsx#L91) | - | @@ -830,7 +821,7 @@ warning: This document is auto-generated and is meant to be viewed inside our ex | | [field_value_match.tsx#L36](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lists/public/exceptions/components/autocomplete/field_value_match.tsx#L36) | - | | | [field_value_match_any.tsx#L13](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lists/public/exceptions/components/autocomplete/field_value_match_any.tsx#L13) | - | | | [field_value_match_any.tsx#L23](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lists/public/exceptions/components/autocomplete/field_value_match_any.tsx#L23) | - | -| | [field_value_lists.tsx#L13](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lists/public/exceptions/components/autocomplete/field_value_lists.tsx#L13) | - | +| | [field_value_lists.tsx#L14](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lists/public/exceptions/components/autocomplete/field_value_lists.tsx#L14) | - | | | [field_value_lists.tsx#L29](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lists/public/exceptions/components/autocomplete/field_value_lists.tsx#L29) | - | | | [entry_renderer.tsx#L31](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lists/public/exceptions/components/builder/entry_renderer.tsx#L31) | - | | | [entry_renderer.tsx#L91](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lists/public/exceptions/components/builder/entry_renderer.tsx#L91) | - | @@ -923,7 +914,7 @@ warning: This document is auto-generated and is meant to be viewed inside our ex | | [field_value_match.tsx#L36](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lists/public/exceptions/components/autocomplete/field_value_match.tsx#L36) | - | | | [field_value_match_any.tsx#L13](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lists/public/exceptions/components/autocomplete/field_value_match_any.tsx#L13) | - | | | [field_value_match_any.tsx#L23](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lists/public/exceptions/components/autocomplete/field_value_match_any.tsx#L23) | - | -| | [field_value_lists.tsx#L13](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lists/public/exceptions/components/autocomplete/field_value_lists.tsx#L13) | - | +| | [field_value_lists.tsx#L14](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lists/public/exceptions/components/autocomplete/field_value_lists.tsx#L14) | - | | | [field_value_lists.tsx#L29](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lists/public/exceptions/components/autocomplete/field_value_lists.tsx#L29) | - | | | [entry_renderer.tsx#L31](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lists/public/exceptions/components/builder/entry_renderer.tsx#L31) | - | | | [entry_renderer.tsx#L91](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lists/public/exceptions/components/builder/entry_renderer.tsx#L91) | - | @@ -944,6 +935,9 @@ warning: This document is auto-generated and is meant to be viewed inside our ex | | [get_call_cluster.mock.ts#L9](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lists/server/schemas/common/get_call_cluster.mock.ts#L9) | 7.16 | | | [get_call_cluster.mock.ts#L27](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lists/server/schemas/common/get_call_cluster.mock.ts#L27) | 7.16 | | | [get_call_cluster.mock.ts#L31](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lists/server/schemas/common/get_call_cluster.mock.ts#L31) | 7.16 | +| | [get_call_cluster.mock.d.ts#L2](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lists/target/types/server/schemas/common/get_call_cluster.mock.d.ts#L2) | 7.16 | +| | [get_call_cluster.mock.d.ts#L4](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lists/target/types/server/schemas/common/get_call_cluster.mock.d.ts#L4) | 7.16 | +| | [get_call_cluster.mock.d.ts#L5](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lists/target/types/server/schemas/common/get_call_cluster.mock.d.ts#L5) | 7.16 | @@ -1579,12 +1573,12 @@ warning: This document is auto-generated and is meant to be viewed inside our ex | Deprecated API | Reference location | Remove By | | ---------------|-----------|-----------| +| | [types.ts#L21](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/types.ts#L21) | - | +| | [types.ts#L66](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/types.ts#L66) | - | +| | [action.ts#L19](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/store/action.ts#L19) | - | +| | [action.ts#L100](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/store/action.ts#L100) | - | | | [index.ts#L8](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/common/search_strategy/index_fields/index.ts#L8) | - | | | [index.ts#L86](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/common/search_strategy/index_fields/index.ts#L86) | - | -| | [types.ts#L20](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/types.ts#L20) | - | -| | [types.ts#L64](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/types.ts#L64) | - | -| | [action.ts#L17](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/store/action.ts#L17) | - | -| | [action.ts#L98](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/store/action.ts#L98) | - | | | [index.tsx#L12](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/containers/source/index.tsx#L12) | - | | | [index.tsx#L48](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/containers/source/index.tsx#L48) | - | | | [index.tsx#L122](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/containers/source/index.tsx#L122) | - | @@ -1618,9 +1612,9 @@ warning: This document is auto-generated and is meant to be viewed inside our ex | | [types.ts#L41](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/network/pages/details/types.ts#L41) | - | | | [index.tsx#L12](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/network/components/network_top_countries_table/index.tsx#L12) | - | | | [index.tsx#L34](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/network/components/network_top_countries_table/index.tsx#L34) | - | -| | [middleware.ts#L32](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/store/middleware.ts#L32) | - | -| | [middleware.ts#L38](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/store/middleware.ts#L38) | - | -| | [middleware.ts#L43](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/store/middleware.ts#L43) | - | +| | [middleware.ts#L40](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/store/middleware.ts#L40) | - | +| | [middleware.ts#L55](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/store/middleware.ts#L55) | - | +| | [middleware.ts#L60](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/store/middleware.ts#L60) | - | | | [types.ts#L12](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/detections/components/rules/description_step/types.ts#L12) | - | | | [types.ts#L28](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/detections/components/rules/description_step/types.ts#L28) | - | | | [index.tsx#L15](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/detections/components/rules/description_step/index.tsx#L15) | - | @@ -1633,13 +1627,30 @@ warning: This document is auto-generated and is meant to be viewed inside our ex | | [index.tsx#L44](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/overview/components/alerts_by_category/index.tsx#L44) | - | | | [index.tsx#L21](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/overview/components/event_counts/index.tsx#L21) | - | | | [index.tsx#L33](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/overview/components/event_counts/index.tsx#L33) | - | -| | [index.tsx#L9](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/containers/kuery_autocompletion/index.tsx#L9) | - | -| | [index.tsx#L21](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/containers/kuery_autocompletion/index.tsx#L21) | - | -| | [get_query_filter.ts#L15](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/common/detection_engine/get_query_filter.ts#L15) | - | -| | [get_query_filter.ts#L31](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/common/detection_engine/get_query_filter.ts#L31) | - | +| | [index.d.ts#L1](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/target/types/common/search_strategy/index_fields/index.d.ts#L1) | - | +| | [index.d.ts#L66](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/target/types/common/search_strategy/index_fields/index.d.ts#L66) | - | +| | [index.d.ts#L1](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/target/types/public/common/containers/source/index.d.ts#L1) | - | +| | [index.d.ts#L10](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/target/types/public/common/containers/source/index.d.ts#L10) | - | +| | [index.d.ts#L23](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/target/types/public/common/containers/source/index.d.ts#L23) | - | +| | [types.d.ts#L3](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/target/types/public/common/components/url_state/types.d.ts#L3) | - | +| | [types.d.ts#L25](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/target/types/public/common/components/url_state/types.d.ts#L25) | - | +| | [types.d.ts#L55](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/target/types/public/common/components/url_state/types.d.ts#L55) | - | +| | [columns.d.ts#L1](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/target/types/public/network/components/network_top_countries_table/columns.d.ts#L1) | - | +| | [columns.d.ts#L20](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/target/types/public/network/components/network_top_countries_table/columns.d.ts#L20) | - | +| | [columns.d.ts#L21](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/target/types/public/network/components/network_top_countries_table/columns.d.ts#L21) | - | +| | [index.d.ts#L3](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/target/types/public/common/components/search_bar/index.d.ts#L3) | - | +| | [index.d.ts#L9](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/target/types/public/common/components/search_bar/index.d.ts#L9) | - | +| | [types.d.ts#L2](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/target/types/public/hosts/pages/details/types.d.ts#L2) | - | +| | [types.d.ts#L40](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/target/types/public/hosts/pages/details/types.d.ts#L40) | - | +| | [index.d.ts#L2](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/target/types/public/network/components/network_top_countries_table/index.d.ts#L2) | - | +| | [index.d.ts#L10](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/target/types/public/network/components/network_top_countries_table/index.d.ts#L10) | - | +| | [types.d.ts#L1](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/target/types/public/network/pages/details/types.d.ts#L1) | - | +| | [types.d.ts#L25](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/target/types/public/network/pages/details/types.d.ts#L25) | - | | | [types.ts#L9](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/network/pages/navigation/types.ts#L9) | - | | | [types.ts#L35](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/network/pages/navigation/types.ts#L35) | - | | | [types.ts#L53](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/network/pages/navigation/types.ts#L53) | - | +| | [get_query_filter.ts#L16](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/common/detection_engine/get_query_filter.ts#L16) | - | +| | [get_query_filter.ts#L31](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/common/detection_engine/get_query_filter.ts#L31) | - | | | [helpers.tsx#L39](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/components/exceptions/helpers.tsx#L39) | - | | | [helpers.tsx#L49](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/components/exceptions/helpers.tsx#L49) | - | | | [helpers.tsx#L52](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/components/exceptions/helpers.tsx#L52) | - | @@ -1658,11 +1669,6 @@ warning: This document is auto-generated and is meant to be viewed inside our ex | | [use_field_value_autocomplete.ts#L31](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/components/autocomplete/hooks/use_field_value_autocomplete.ts#L31) | - | | | [field_value_match.tsx#L19](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/components/autocomplete/field_value_match.tsx#L19) | - | | | [field_value_match.tsx#L30](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/components/autocomplete/field_value_match.tsx#L30) | - | -| | [field_value_match_any.tsx#L13](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/components/autocomplete/field_value_match_any.tsx#L13) | - | -| | [field_value_match_any.tsx#L24](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/components/autocomplete/field_value_match_any.tsx#L24) | - | -| | [helpers.test.tsx#L43](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/components/exceptions/helpers.test.tsx#L43) | - | -| | [helpers.test.tsx#L49](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/components/exceptions/helpers.test.tsx#L49) | - | -| | [helpers.test.tsx#L368](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/components/exceptions/helpers.test.tsx#L368) | - | | | [model.ts#L8](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/store/sourcerer/model.ts#L8) | - | | | [model.ts#L30](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/store/sourcerer/model.ts#L30) | - | | | [index.tsx#L33](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/detections/components/rules/severity_mapping/index.tsx#L33) | - | @@ -1709,10 +1715,6 @@ warning: This document is auto-generated and is meant to be viewed inside our ex | | [use_field_value_autocomplete.ts#L27](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/components/autocomplete/hooks/use_field_value_autocomplete.ts#L27) | - | | | [field_value_match.tsx#L19](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/components/autocomplete/field_value_match.tsx#L19) | - | | | [field_value_match.tsx#L28](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/components/autocomplete/field_value_match.tsx#L28) | - | -| | [field_value_lists.tsx#L12](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/components/autocomplete/field_value_lists.tsx#L12) | - | -| | [field_value_lists.tsx#L20](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/components/autocomplete/field_value_lists.tsx#L20) | - | -| | [field_value_match_any.tsx#L13](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/components/autocomplete/field_value_match_any.tsx#L13) | - | -| | [field_value_match_any.tsx#L22](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/components/autocomplete/field_value_match_any.tsx#L22) | - | | | [helpers.test.ts#L11](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/components/autocomplete/helpers.test.ts#L11) | - | | | [helpers.test.ts#L333](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/components/autocomplete/helpers.test.ts#L333) | - | | | [helpers.test.ts#L339](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/components/autocomplete/helpers.test.ts#L339) | - | @@ -1721,10 +1723,8 @@ warning: This document is auto-generated and is meant to be viewed inside our ex | | [helpers.test.ts#L363](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/components/autocomplete/helpers.test.ts#L363) | - | | | [helpers.test.ts#L371](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/components/autocomplete/helpers.test.ts#L371) | - | | | [helpers.test.ts#L380](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/components/autocomplete/helpers.test.ts#L380) | - | -| | [operator.tsx#L11](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/components/autocomplete/operator.tsx#L11) | - | -| | [operator.tsx#L17](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/components/autocomplete/operator.tsx#L17) | - | -| | [helpers.test.tsx#L43](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/components/exceptions/helpers.test.tsx#L43) | - | -| | [helpers.test.tsx#L104](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/components/exceptions/helpers.test.tsx#L104) | - | +| | [helpers.test.d.ts#L1](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/target/types/public/common/components/exceptions/helpers.test.d.ts#L1) | - | +| | [helpers.test.d.ts#L2](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/target/types/public/common/components/exceptions/helpers.test.d.ts#L2) | - | | | [index.tsx#L32](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/detections/components/rules/severity_mapping/index.tsx#L32) | - | | | [index.tsx#L86](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/detections/components/rules/severity_mapping/index.tsx#L86) | - | | | [index.tsx#L305](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/detections/components/rules/severity_mapping/index.tsx#L305) | - | @@ -1767,10 +1767,6 @@ warning: This document is auto-generated and is meant to be viewed inside our ex | | [use_field_value_autocomplete.ts#L27](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/components/autocomplete/hooks/use_field_value_autocomplete.ts#L27) | - | | | [field_value_match.tsx#L19](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/components/autocomplete/field_value_match.tsx#L19) | - | | | [field_value_match.tsx#L28](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/components/autocomplete/field_value_match.tsx#L28) | - | -| | [field_value_lists.tsx#L12](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/components/autocomplete/field_value_lists.tsx#L12) | - | -| | [field_value_lists.tsx#L20](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/components/autocomplete/field_value_lists.tsx#L20) | - | -| | [field_value_match_any.tsx#L13](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/components/autocomplete/field_value_match_any.tsx#L13) | - | -| | [field_value_match_any.tsx#L22](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/components/autocomplete/field_value_match_any.tsx#L22) | - | | | [helpers.test.ts#L11](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/components/autocomplete/helpers.test.ts#L11) | - | | | [helpers.test.ts#L333](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/components/autocomplete/helpers.test.ts#L333) | - | | | [helpers.test.ts#L339](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/components/autocomplete/helpers.test.ts#L339) | - | @@ -1779,10 +1775,8 @@ warning: This document is auto-generated and is meant to be viewed inside our ex | | [helpers.test.ts#L363](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/components/autocomplete/helpers.test.ts#L363) | - | | | [helpers.test.ts#L371](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/components/autocomplete/helpers.test.ts#L371) | - | | | [helpers.test.ts#L380](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/components/autocomplete/helpers.test.ts#L380) | - | -| | [operator.tsx#L11](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/components/autocomplete/operator.tsx#L11) | - | -| | [operator.tsx#L17](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/components/autocomplete/operator.tsx#L17) | - | -| | [helpers.test.tsx#L43](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/components/exceptions/helpers.test.tsx#L43) | - | -| | [helpers.test.tsx#L104](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/components/exceptions/helpers.test.tsx#L104) | - | +| | [helpers.test.d.ts#L1](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/target/types/public/common/components/exceptions/helpers.test.d.ts#L1) | - | +| | [helpers.test.d.ts#L2](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/target/types/public/common/components/exceptions/helpers.test.d.ts#L2) | - | | | [index.tsx#L32](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/detections/components/rules/severity_mapping/index.tsx#L32) | - | | | [index.tsx#L86](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/detections/components/rules/severity_mapping/index.tsx#L86) | - | | | [index.tsx#L305](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/detections/components/rules/severity_mapping/index.tsx#L305) | - | @@ -1791,12 +1785,12 @@ warning: This document is auto-generated and is meant to be viewed inside our ex | | [index.tsx#L242](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/detections/components/rules/risk_score_mapping/index.tsx#L242) | - | | | [index.tsx#L12](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/detections/components/rules/autocomplete_field/index.tsx#L12) | - | | | [index.tsx#L35](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/detections/components/rules/autocomplete_field/index.tsx#L35) | - | +| | [types.ts#L21](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/types.ts#L21) | - | +| | [types.ts#L66](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/types.ts#L66) | - | +| | [action.ts#L19](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/store/action.ts#L19) | - | +| | [action.ts#L100](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/store/action.ts#L100) | - | | | [index.ts#L8](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/common/search_strategy/index_fields/index.ts#L8) | - | | | [index.ts#L86](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/common/search_strategy/index_fields/index.ts#L86) | - | -| | [types.ts#L20](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/types.ts#L20) | - | -| | [types.ts#L64](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/types.ts#L64) | - | -| | [action.ts#L17](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/store/action.ts#L17) | - | -| | [action.ts#L98](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/store/action.ts#L98) | - | | | [index.tsx#L12](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/containers/source/index.tsx#L12) | - | | | [index.tsx#L48](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/containers/source/index.tsx#L48) | - | | | [index.tsx#L122](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/containers/source/index.tsx#L122) | - | @@ -1830,9 +1824,9 @@ warning: This document is auto-generated and is meant to be viewed inside our ex | | [types.ts#L41](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/network/pages/details/types.ts#L41) | - | | | [index.tsx#L12](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/network/components/network_top_countries_table/index.tsx#L12) | - | | | [index.tsx#L34](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/network/components/network_top_countries_table/index.tsx#L34) | - | -| | [middleware.ts#L32](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/store/middleware.ts#L32) | - | -| | [middleware.ts#L38](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/store/middleware.ts#L38) | - | -| | [middleware.ts#L43](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/store/middleware.ts#L43) | - | +| | [middleware.ts#L40](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/store/middleware.ts#L40) | - | +| | [middleware.ts#L55](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/store/middleware.ts#L55) | - | +| | [middleware.ts#L60](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/store/middleware.ts#L60) | - | | | [types.ts#L12](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/detections/components/rules/description_step/types.ts#L12) | - | | | [types.ts#L28](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/detections/components/rules/description_step/types.ts#L28) | - | | | [index.tsx#L15](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/detections/components/rules/description_step/index.tsx#L15) | - | @@ -1845,13 +1839,30 @@ warning: This document is auto-generated and is meant to be viewed inside our ex | | [index.tsx#L44](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/overview/components/alerts_by_category/index.tsx#L44) | - | | | [index.tsx#L21](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/overview/components/event_counts/index.tsx#L21) | - | | | [index.tsx#L33](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/overview/components/event_counts/index.tsx#L33) | - | -| | [index.tsx#L9](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/containers/kuery_autocompletion/index.tsx#L9) | - | -| | [index.tsx#L21](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/containers/kuery_autocompletion/index.tsx#L21) | - | -| | [get_query_filter.ts#L15](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/common/detection_engine/get_query_filter.ts#L15) | - | -| | [get_query_filter.ts#L31](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/common/detection_engine/get_query_filter.ts#L31) | - | +| | [index.d.ts#L1](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/target/types/common/search_strategy/index_fields/index.d.ts#L1) | - | +| | [index.d.ts#L66](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/target/types/common/search_strategy/index_fields/index.d.ts#L66) | - | +| | [index.d.ts#L1](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/target/types/public/common/containers/source/index.d.ts#L1) | - | +| | [index.d.ts#L10](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/target/types/public/common/containers/source/index.d.ts#L10) | - | +| | [index.d.ts#L23](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/target/types/public/common/containers/source/index.d.ts#L23) | - | +| | [types.d.ts#L3](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/target/types/public/common/components/url_state/types.d.ts#L3) | - | +| | [types.d.ts#L25](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/target/types/public/common/components/url_state/types.d.ts#L25) | - | +| | [types.d.ts#L55](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/target/types/public/common/components/url_state/types.d.ts#L55) | - | +| | [columns.d.ts#L1](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/target/types/public/network/components/network_top_countries_table/columns.d.ts#L1) | - | +| | [columns.d.ts#L20](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/target/types/public/network/components/network_top_countries_table/columns.d.ts#L20) | - | +| | [columns.d.ts#L21](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/target/types/public/network/components/network_top_countries_table/columns.d.ts#L21) | - | +| | [index.d.ts#L3](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/target/types/public/common/components/search_bar/index.d.ts#L3) | - | +| | [index.d.ts#L9](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/target/types/public/common/components/search_bar/index.d.ts#L9) | - | +| | [types.d.ts#L2](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/target/types/public/hosts/pages/details/types.d.ts#L2) | - | +| | [types.d.ts#L40](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/target/types/public/hosts/pages/details/types.d.ts#L40) | - | +| | [index.d.ts#L2](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/target/types/public/network/components/network_top_countries_table/index.d.ts#L2) | - | +| | [index.d.ts#L10](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/target/types/public/network/components/network_top_countries_table/index.d.ts#L10) | - | +| | [types.d.ts#L1](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/target/types/public/network/pages/details/types.d.ts#L1) | - | +| | [types.d.ts#L25](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/target/types/public/network/pages/details/types.d.ts#L25) | - | | | [types.ts#L9](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/network/pages/navigation/types.ts#L9) | - | | | [types.ts#L35](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/network/pages/navigation/types.ts#L35) | - | | | [types.ts#L53](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/network/pages/navigation/types.ts#L53) | - | +| | [get_query_filter.ts#L16](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/common/detection_engine/get_query_filter.ts#L16) | - | +| | [get_query_filter.ts#L31](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/common/detection_engine/get_query_filter.ts#L31) | - | | | [helpers.tsx#L39](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/components/exceptions/helpers.tsx#L39) | - | | | [helpers.tsx#L49](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/components/exceptions/helpers.tsx#L49) | - | | | [helpers.tsx#L52](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/components/exceptions/helpers.tsx#L52) | - | @@ -1870,11 +1881,6 @@ warning: This document is auto-generated and is meant to be viewed inside our ex | | [use_field_value_autocomplete.ts#L31](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/components/autocomplete/hooks/use_field_value_autocomplete.ts#L31) | - | | | [field_value_match.tsx#L19](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/components/autocomplete/field_value_match.tsx#L19) | - | | | [field_value_match.tsx#L30](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/components/autocomplete/field_value_match.tsx#L30) | - | -| | [field_value_match_any.tsx#L13](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/components/autocomplete/field_value_match_any.tsx#L13) | - | -| | [field_value_match_any.tsx#L24](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/components/autocomplete/field_value_match_any.tsx#L24) | - | -| | [helpers.test.tsx#L43](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/components/exceptions/helpers.test.tsx#L43) | - | -| | [helpers.test.tsx#L49](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/components/exceptions/helpers.test.tsx#L49) | - | -| | [helpers.test.tsx#L368](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/components/exceptions/helpers.test.tsx#L368) | - | | | [model.ts#L8](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/store/sourcerer/model.ts#L8) | - | | | [model.ts#L30](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/store/sourcerer/model.ts#L30) | - | | | [index.tsx#L33](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/detections/components/rules/severity_mapping/index.tsx#L33) | - | @@ -1921,10 +1927,6 @@ warning: This document is auto-generated and is meant to be viewed inside our ex | | [use_field_value_autocomplete.ts#L27](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/components/autocomplete/hooks/use_field_value_autocomplete.ts#L27) | - | | | [field_value_match.tsx#L19](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/components/autocomplete/field_value_match.tsx#L19) | - | | | [field_value_match.tsx#L28](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/components/autocomplete/field_value_match.tsx#L28) | - | -| | [field_value_lists.tsx#L12](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/components/autocomplete/field_value_lists.tsx#L12) | - | -| | [field_value_lists.tsx#L20](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/components/autocomplete/field_value_lists.tsx#L20) | - | -| | [field_value_match_any.tsx#L13](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/components/autocomplete/field_value_match_any.tsx#L13) | - | -| | [field_value_match_any.tsx#L22](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/components/autocomplete/field_value_match_any.tsx#L22) | - | | | [helpers.test.ts#L11](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/components/autocomplete/helpers.test.ts#L11) | - | | | [helpers.test.ts#L333](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/components/autocomplete/helpers.test.ts#L333) | - | | | [helpers.test.ts#L339](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/components/autocomplete/helpers.test.ts#L339) | - | @@ -1933,10 +1935,8 @@ warning: This document is auto-generated and is meant to be viewed inside our ex | | [helpers.test.ts#L363](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/components/autocomplete/helpers.test.ts#L363) | - | | | [helpers.test.ts#L371](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/components/autocomplete/helpers.test.ts#L371) | - | | | [helpers.test.ts#L380](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/components/autocomplete/helpers.test.ts#L380) | - | -| | [operator.tsx#L11](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/components/autocomplete/operator.tsx#L11) | - | -| | [operator.tsx#L17](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/components/autocomplete/operator.tsx#L17) | - | -| | [helpers.test.tsx#L43](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/components/exceptions/helpers.test.tsx#L43) | - | -| | [helpers.test.tsx#L104](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/components/exceptions/helpers.test.tsx#L104) | - | +| | [helpers.test.d.ts#L1](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/target/types/public/common/components/exceptions/helpers.test.d.ts#L1) | - | +| | [helpers.test.d.ts#L2](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/target/types/public/common/components/exceptions/helpers.test.d.ts#L2) | - | | | [index.tsx#L32](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/detections/components/rules/severity_mapping/index.tsx#L32) | - | | | [index.tsx#L86](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/detections/components/rules/severity_mapping/index.tsx#L86) | - | | | [index.tsx#L305](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/detections/components/rules/severity_mapping/index.tsx#L305) | - | diff --git a/api_docs/features.json b/api_docs/features.json index 6881b65061fac9..63c3ebe3a92dec 100644 --- a/api_docs/features.json +++ b/api_docs/features.json @@ -1599,13 +1599,6 @@ "path": "x-pack/plugins/security/server/authorization/disable_ui_capabilities.ts", "lineNumber": 311 } - }, - { - "plugin": "beatsManagement", - "link": { - "path": "x-pack/plugins/beats_management/server/plugin.ts", - "lineNumber": 61 - } } ] }, @@ -3298,13 +3291,6 @@ "path": "x-pack/plugins/security/server/authorization/disable_ui_capabilities.ts", "lineNumber": 311 } - }, - { - "plugin": "beatsManagement", - "link": { - "path": "x-pack/plugins/beats_management/server/plugin.ts", - "lineNumber": 61 - } } ] }, diff --git a/api_docs/fleet.json b/api_docs/fleet.json index 94f2acc12adf7e..389a56cccefc5b 100644 --- a/api_docs/fleet.json +++ b/api_docs/fleet.json @@ -8837,7 +8837,7 @@ ], "source": { "path": "x-pack/plugins/fleet/common/types/models/agent_policy.ts", - "lineNumber": 113 + "lineNumber": 114 }, "deprecated": false, "children": [ @@ -8855,7 +8855,7 @@ ], "source": { "path": "x-pack/plugins/fleet/common/types/models/agent_policy.ts", - "lineNumber": 117 + "lineNumber": 118 }, "deprecated": false }, @@ -8870,7 +8870,7 @@ ], "source": { "path": "x-pack/plugins/fleet/common/types/models/agent_policy.ts", - "lineNumber": 121 + "lineNumber": 122 }, "deprecated": false }, @@ -8885,7 +8885,7 @@ ], "source": { "path": "x-pack/plugins/fleet/common/types/models/agent_policy.ts", - "lineNumber": 125 + "lineNumber": 126 }, "deprecated": false }, @@ -8900,7 +8900,7 @@ ], "source": { "path": "x-pack/plugins/fleet/common/types/models/agent_policy.ts", - "lineNumber": 129 + "lineNumber": 130 }, "deprecated": false }, @@ -8918,7 +8918,7 @@ ], "source": { "path": "x-pack/plugins/fleet/common/types/models/agent_policy.ts", - "lineNumber": 133 + "lineNumber": 134 }, "deprecated": false }, @@ -8933,7 +8933,7 @@ ], "source": { "path": "x-pack/plugins/fleet/common/types/models/agent_policy.ts", - "lineNumber": 139 + "lineNumber": 140 }, "deprecated": false } @@ -9085,7 +9085,7 @@ "label": "agent", "description": [], "signature": [ - "{ monitoring: { use_output?: string | undefined; enabled: boolean; metrics: boolean; logs: boolean; }; } | undefined" + "{ monitoring: { namespace?: string | undefined; use_output?: string | undefined; enabled: boolean; metrics: boolean; logs: boolean; }; } | undefined" ], "source": { "path": "x-pack/plugins/fleet/common/types/models/agent_policy.ts", @@ -9326,7 +9326,7 @@ "description": [], "source": { "path": "x-pack/plugins/fleet/common/types/models/agent_policy.ts", - "lineNumber": 102 + "lineNumber": 103 }, "deprecated": false, "children": [ @@ -9342,7 +9342,7 @@ ], "source": { "path": "x-pack/plugins/fleet/common/types/models/agent_policy.ts", - "lineNumber": 103 + "lineNumber": 104 }, "deprecated": false }, @@ -9355,7 +9355,7 @@ "description": [], "source": { "path": "x-pack/plugins/fleet/common/types/models/agent_policy.ts", - "lineNumber": 104 + "lineNumber": 105 }, "deprecated": false }, @@ -9371,7 +9371,7 @@ ], "source": { "path": "x-pack/plugins/fleet/common/types/models/agent_policy.ts", - "lineNumber": 105 + "lineNumber": 106 }, "deprecated": false } diff --git a/api_docs/home.json b/api_docs/home.json index bc99a31a09c302..2aa23c1b756dfa 100644 --- a/api_docs/home.json +++ b/api_docs/home.json @@ -953,13 +953,6 @@ }, "deprecated": true, "references": [ - { - "plugin": "cloud", - "link": { - "path": "x-pack/plugins/cloud/public/plugin.ts", - "lineNumber": 66 - } - }, { "plugin": "ml", "link": { @@ -973,6 +966,13 @@ "path": "x-pack/plugins/apm/public/plugin.ts", "lineNumber": 82 } + }, + { + "plugin": "cloud", + "link": { + "path": "x-pack/plugins/cloud/public/plugin.ts", + "lineNumber": 66 + } } ] } diff --git a/api_docs/kibana_utils.json b/api_docs/kibana_utils.json index ade7a843a68413..173348ea2f2638 100644 --- a/api_docs/kibana_utils.json +++ b/api_docs/kibana_utils.json @@ -3799,7 +3799,7 @@ "description": [], "source": { "path": "src/core/public/application/types.ts", - "lineNumber": 717 + "lineNumber": 704 }, "deprecated": false }, @@ -3822,7 +3822,7 @@ ], "source": { "path": "src/core/public/application/types.ts", - "lineNumber": 717 + "lineNumber": 704 }, "deprecated": false } diff --git a/api_docs/licensing.json b/api_docs/licensing.json index f3ec50895547f6..873f40bd301a1c 100644 --- a/api_docs/licensing.json +++ b/api_docs/licensing.json @@ -554,192 +554,192 @@ "deprecated": true, "references": [ { - "plugin": "securitySolution", + "plugin": "apm", "link": { - "path": "x-pack/plugins/security_solution/common/license/policy_config.test.ts", - "lineNumber": 22 + "path": "x-pack/plugins/apm/common/license_check.test.ts", + "lineNumber": 19 } }, { - "plugin": "securitySolution", + "plugin": "apm", "link": { - "path": "x-pack/plugins/security_solution/common/license/policy_config.test.ts", - "lineNumber": 23 + "path": "x-pack/plugins/apm/common/license_check.test.ts", + "lineNumber": 36 } }, { - "plugin": "securitySolution", + "plugin": "apm", "link": { - "path": "x-pack/plugins/security_solution/common/license/policy_config.test.ts", - "lineNumber": 24 + "path": "x-pack/plugins/apm/common/license_check.test.ts", + "lineNumber": 53 } }, { - "plugin": "securitySolution", + "plugin": "apm", "link": { - "path": "x-pack/plugins/security_solution/public/management/pages/policy/store/policy_details/index.test.ts", - "lineNumber": 159 + "path": "x-pack/plugins/apm/common/license_check.test.ts", + "lineNumber": 70 } }, { - "plugin": "securitySolution", + "plugin": "apm", "link": { - "path": "x-pack/plugins/security_solution/public/management/pages/policy/store/policy_details/index.test.ts", - "lineNumber": 161 + "path": "x-pack/plugins/apm/common/license_check.test.ts", + "lineNumber": 87 } }, { - "plugin": "securitySolution", + "plugin": "apm", "link": { - "path": "x-pack/plugins/security_solution/server/endpoint/lib/policy/license_watch.test.ts", - "lineNumber": 42 + "path": "x-pack/plugins/apm/common/license_check.test.ts", + "lineNumber": 104 } }, { - "plugin": "securitySolution", + "plugin": "apm", "link": { - "path": "x-pack/plugins/security_solution/server/endpoint/lib/policy/license_watch.test.ts", - "lineNumber": 43 + "path": "x-pack/plugins/apm/common/license_check.test.ts", + "lineNumber": 122 } }, { - "plugin": "securitySolution", + "plugin": "apm", "link": { - "path": "x-pack/plugins/security_solution/server/endpoint/lib/policy/license_watch.test.ts", - "lineNumber": 44 + "path": "x-pack/plugins/apm/common/license_check.test.ts", + "lineNumber": 139 } }, { - "plugin": "securitySolution", + "plugin": "apm", "link": { - "path": "x-pack/plugins/security_solution/server/endpoint/routes/actions/isolation.test.ts", - "lineNumber": 54 + "path": "x-pack/plugins/apm/common/license_check.test.ts", + "lineNumber": 156 } }, { - "plugin": "securitySolution", + "plugin": "apm", "link": { - "path": "x-pack/plugins/security_solution/server/endpoint/routes/actions/isolation.test.ts", - "lineNumber": 55 + "path": "x-pack/plugins/apm/common/license_check.test.ts", + "lineNumber": 173 } }, { - "plugin": "securitySolution", + "plugin": "apm", "link": { - "path": "x-pack/plugins/security_solution/server/fleet_integration/fleet_integration.test.ts", - "lineNumber": 47 + "path": "x-pack/plugins/apm/common/license_check.test.ts", + "lineNumber": 190 } }, { - "plugin": "securitySolution", + "plugin": "apm", "link": { - "path": "x-pack/plugins/security_solution/server/fleet_integration/fleet_integration.test.ts", - "lineNumber": 48 + "path": "x-pack/plugins/apm/common/license_check.test.ts", + "lineNumber": 207 } }, { - "plugin": "apm", + "plugin": "security", "link": { - "path": "x-pack/plugins/apm/common/license_check.test.ts", - "lineNumber": 19 + "path": "x-pack/plugins/security/common/licensing/license_service.test.ts", + "lineNumber": 169 } }, { - "plugin": "apm", + "plugin": "security", "link": { - "path": "x-pack/plugins/apm/common/license_check.test.ts", - "lineNumber": 36 + "path": "x-pack/plugins/security/common/licensing/license_service.test.ts", + "lineNumber": 194 } }, { - "plugin": "apm", + "plugin": "security", "link": { - "path": "x-pack/plugins/apm/common/license_check.test.ts", - "lineNumber": 53 + "path": "x-pack/plugins/security/common/licensing/license_service.test.ts", + "lineNumber": 219 } }, { - "plugin": "apm", + "plugin": "securitySolution", "link": { - "path": "x-pack/plugins/apm/common/license_check.test.ts", - "lineNumber": 70 + "path": "x-pack/plugins/security_solution/common/license/policy_config.test.ts", + "lineNumber": 22 } }, { - "plugin": "apm", + "plugin": "securitySolution", "link": { - "path": "x-pack/plugins/apm/common/license_check.test.ts", - "lineNumber": 87 + "path": "x-pack/plugins/security_solution/common/license/policy_config.test.ts", + "lineNumber": 23 } }, { - "plugin": "apm", + "plugin": "securitySolution", "link": { - "path": "x-pack/plugins/apm/common/license_check.test.ts", - "lineNumber": 104 + "path": "x-pack/plugins/security_solution/common/license/policy_config.test.ts", + "lineNumber": 24 } }, { - "plugin": "apm", + "plugin": "securitySolution", "link": { - "path": "x-pack/plugins/apm/common/license_check.test.ts", - "lineNumber": 122 + "path": "x-pack/plugins/security_solution/server/fleet_integration/fleet_integration.test.ts", + "lineNumber": 47 } }, { - "plugin": "apm", + "plugin": "securitySolution", "link": { - "path": "x-pack/plugins/apm/common/license_check.test.ts", - "lineNumber": 139 + "path": "x-pack/plugins/security_solution/server/fleet_integration/fleet_integration.test.ts", + "lineNumber": 48 } }, { - "plugin": "apm", + "plugin": "securitySolution", "link": { - "path": "x-pack/plugins/apm/common/license_check.test.ts", - "lineNumber": 156 + "path": "x-pack/plugins/security_solution/server/endpoint/lib/policy/license_watch.test.ts", + "lineNumber": 42 } }, { - "plugin": "apm", + "plugin": "securitySolution", "link": { - "path": "x-pack/plugins/apm/common/license_check.test.ts", - "lineNumber": 173 + "path": "x-pack/plugins/security_solution/server/endpoint/lib/policy/license_watch.test.ts", + "lineNumber": 43 } }, { - "plugin": "apm", + "plugin": "securitySolution", "link": { - "path": "x-pack/plugins/apm/common/license_check.test.ts", - "lineNumber": 190 + "path": "x-pack/plugins/security_solution/server/endpoint/lib/policy/license_watch.test.ts", + "lineNumber": 44 } }, { - "plugin": "apm", + "plugin": "securitySolution", "link": { - "path": "x-pack/plugins/apm/common/license_check.test.ts", - "lineNumber": 207 + "path": "x-pack/plugins/security_solution/server/endpoint/routes/actions/isolation.test.ts", + "lineNumber": 54 } }, { - "plugin": "security", + "plugin": "securitySolution", "link": { - "path": "x-pack/plugins/security/common/licensing/license_service.test.ts", - "lineNumber": 169 + "path": "x-pack/plugins/security_solution/server/endpoint/routes/actions/isolation.test.ts", + "lineNumber": 55 } }, { - "plugin": "security", + "plugin": "securitySolution", "link": { - "path": "x-pack/plugins/security/common/licensing/license_service.test.ts", - "lineNumber": 194 + "path": "x-pack/plugins/security_solution/public/management/pages/policy/store/policy_details/index.test.ts", + "lineNumber": 159 } }, { - "plugin": "security", + "plugin": "securitySolution", "link": { - "path": "x-pack/plugins/security/common/licensing/license_service.test.ts", - "lineNumber": 219 + "path": "x-pack/plugins/security_solution/public/management/pages/policy/store/policy_details/index.test.ts", + "lineNumber": 161 } } ] @@ -942,73 +942,66 @@ "deprecated": true, "references": [ { - "plugin": "security", - "link": { - "path": "x-pack/plugins/security/public/plugin.tsx", - "lineNumber": 82 - } - }, - { - "plugin": "licenseManagement", + "plugin": "reporting", "link": { - "path": "x-pack/plugins/license_management/public/plugin.ts", - "lineNumber": 61 + "path": "x-pack/plugins/reporting/public/panel_actions/get_csv_panel_action.tsx", + "lineNumber": 40 } }, { - "plugin": "ml", + "plugin": "reporting", "link": { - "path": "x-pack/plugins/ml/public/application/license/check_license.tsx", - "lineNumber": 26 + "path": "x-pack/plugins/reporting/public/share_context_menu/register_csv_reporting.tsx", + "lineNumber": 33 } }, { - "plugin": "ml", + "plugin": "reporting", "link": { - "path": "x-pack/plugins/ml/public/plugin.ts", - "lineNumber": 136 + "path": "x-pack/plugins/reporting/public/share_context_menu/register_pdf_png_reporting.tsx", + "lineNumber": 81 } }, { - "plugin": "fleet", + "plugin": "reporting", "link": { - "path": "x-pack/plugins/fleet/public/plugin.ts", - "lineNumber": 97 + "path": "x-pack/plugins/reporting/public/plugin.ts", + "lineNumber": 116 } }, { "plugin": "reporting", "link": { - "path": "x-pack/plugins/reporting/public/panel_actions/get_csv_panel_action.tsx", - "lineNumber": 40 + "path": "x-pack/plugins/reporting/public/components/report_listing.tsx", + "lineNumber": 61 } }, { - "plugin": "reporting", + "plugin": "licenseManagement", "link": { - "path": "x-pack/plugins/reporting/public/share_context_menu/register_csv_reporting.tsx", - "lineNumber": 33 + "path": "x-pack/plugins/license_management/public/plugin.ts", + "lineNumber": 61 } }, { - "plugin": "reporting", + "plugin": "security", "link": { - "path": "x-pack/plugins/reporting/public/share_context_menu/register_pdf_png_reporting.tsx", - "lineNumber": 81 + "path": "x-pack/plugins/security/public/plugin.tsx", + "lineNumber": 82 } }, { - "plugin": "reporting", + "plugin": "ml", "link": { - "path": "x-pack/plugins/reporting/public/plugin.ts", - "lineNumber": 116 + "path": "x-pack/plugins/ml/public/application/license/check_license.tsx", + "lineNumber": 26 } }, { - "plugin": "reporting", + "plugin": "ml", "link": { - "path": "x-pack/plugins/reporting/public/components/report_listing.tsx", - "lineNumber": 61 + "path": "x-pack/plugins/ml/public/plugin.ts", + "lineNumber": 136 } }, { @@ -1019,17 +1012,17 @@ } }, { - "plugin": "beatsManagement", + "plugin": "crossClusterReplication", "link": { - "path": "x-pack/plugins/beats_management/public/lib/adapters/framework/kibana_framework_adapter.ts", - "lineNumber": 65 + "path": "x-pack/plugins/cross_cluster_replication/public/plugin.ts", + "lineNumber": 75 } }, { - "plugin": "crossClusterReplication", + "plugin": "fleet", "link": { - "path": "x-pack/plugins/cross_cluster_replication/public/plugin.ts", - "lineNumber": 75 + "path": "x-pack/plugins/fleet/public/plugin.ts", + "lineNumber": 97 } }, { @@ -2650,192 +2643,192 @@ "deprecated": true, "references": [ { - "plugin": "securitySolution", + "plugin": "apm", "link": { - "path": "x-pack/plugins/security_solution/common/license/policy_config.test.ts", - "lineNumber": 22 + "path": "x-pack/plugins/apm/common/license_check.test.ts", + "lineNumber": 19 } }, { - "plugin": "securitySolution", + "plugin": "apm", "link": { - "path": "x-pack/plugins/security_solution/common/license/policy_config.test.ts", - "lineNumber": 23 + "path": "x-pack/plugins/apm/common/license_check.test.ts", + "lineNumber": 36 } }, { - "plugin": "securitySolution", + "plugin": "apm", "link": { - "path": "x-pack/plugins/security_solution/common/license/policy_config.test.ts", - "lineNumber": 24 + "path": "x-pack/plugins/apm/common/license_check.test.ts", + "lineNumber": 53 } }, { - "plugin": "securitySolution", + "plugin": "apm", "link": { - "path": "x-pack/plugins/security_solution/public/management/pages/policy/store/policy_details/index.test.ts", - "lineNumber": 159 + "path": "x-pack/plugins/apm/common/license_check.test.ts", + "lineNumber": 70 } }, { - "plugin": "securitySolution", + "plugin": "apm", "link": { - "path": "x-pack/plugins/security_solution/public/management/pages/policy/store/policy_details/index.test.ts", - "lineNumber": 161 + "path": "x-pack/plugins/apm/common/license_check.test.ts", + "lineNumber": 87 } }, { - "plugin": "securitySolution", + "plugin": "apm", "link": { - "path": "x-pack/plugins/security_solution/server/endpoint/lib/policy/license_watch.test.ts", - "lineNumber": 42 + "path": "x-pack/plugins/apm/common/license_check.test.ts", + "lineNumber": 104 } }, { - "plugin": "securitySolution", + "plugin": "apm", "link": { - "path": "x-pack/plugins/security_solution/server/endpoint/lib/policy/license_watch.test.ts", - "lineNumber": 43 + "path": "x-pack/plugins/apm/common/license_check.test.ts", + "lineNumber": 122 } }, { - "plugin": "securitySolution", + "plugin": "apm", "link": { - "path": "x-pack/plugins/security_solution/server/endpoint/lib/policy/license_watch.test.ts", - "lineNumber": 44 + "path": "x-pack/plugins/apm/common/license_check.test.ts", + "lineNumber": 139 } }, { - "plugin": "securitySolution", + "plugin": "apm", "link": { - "path": "x-pack/plugins/security_solution/server/endpoint/routes/actions/isolation.test.ts", - "lineNumber": 54 + "path": "x-pack/plugins/apm/common/license_check.test.ts", + "lineNumber": 156 } }, { - "plugin": "securitySolution", + "plugin": "apm", "link": { - "path": "x-pack/plugins/security_solution/server/endpoint/routes/actions/isolation.test.ts", - "lineNumber": 55 + "path": "x-pack/plugins/apm/common/license_check.test.ts", + "lineNumber": 173 } }, { - "plugin": "securitySolution", + "plugin": "apm", "link": { - "path": "x-pack/plugins/security_solution/server/fleet_integration/fleet_integration.test.ts", - "lineNumber": 47 + "path": "x-pack/plugins/apm/common/license_check.test.ts", + "lineNumber": 190 } }, { - "plugin": "securitySolution", + "plugin": "apm", "link": { - "path": "x-pack/plugins/security_solution/server/fleet_integration/fleet_integration.test.ts", - "lineNumber": 48 + "path": "x-pack/plugins/apm/common/license_check.test.ts", + "lineNumber": 207 } }, { - "plugin": "apm", + "plugin": "security", "link": { - "path": "x-pack/plugins/apm/common/license_check.test.ts", - "lineNumber": 19 + "path": "x-pack/plugins/security/common/licensing/license_service.test.ts", + "lineNumber": 169 } }, { - "plugin": "apm", + "plugin": "security", "link": { - "path": "x-pack/plugins/apm/common/license_check.test.ts", - "lineNumber": 36 + "path": "x-pack/plugins/security/common/licensing/license_service.test.ts", + "lineNumber": 194 } }, { - "plugin": "apm", + "plugin": "security", "link": { - "path": "x-pack/plugins/apm/common/license_check.test.ts", - "lineNumber": 53 + "path": "x-pack/plugins/security/common/licensing/license_service.test.ts", + "lineNumber": 219 } }, { - "plugin": "apm", + "plugin": "securitySolution", "link": { - "path": "x-pack/plugins/apm/common/license_check.test.ts", - "lineNumber": 70 + "path": "x-pack/plugins/security_solution/common/license/policy_config.test.ts", + "lineNumber": 22 } }, { - "plugin": "apm", + "plugin": "securitySolution", "link": { - "path": "x-pack/plugins/apm/common/license_check.test.ts", - "lineNumber": 87 + "path": "x-pack/plugins/security_solution/common/license/policy_config.test.ts", + "lineNumber": 23 } }, { - "plugin": "apm", + "plugin": "securitySolution", "link": { - "path": "x-pack/plugins/apm/common/license_check.test.ts", - "lineNumber": 104 + "path": "x-pack/plugins/security_solution/common/license/policy_config.test.ts", + "lineNumber": 24 } }, { - "plugin": "apm", + "plugin": "securitySolution", "link": { - "path": "x-pack/plugins/apm/common/license_check.test.ts", - "lineNumber": 122 + "path": "x-pack/plugins/security_solution/server/fleet_integration/fleet_integration.test.ts", + "lineNumber": 47 } }, { - "plugin": "apm", + "plugin": "securitySolution", "link": { - "path": "x-pack/plugins/apm/common/license_check.test.ts", - "lineNumber": 139 + "path": "x-pack/plugins/security_solution/server/fleet_integration/fleet_integration.test.ts", + "lineNumber": 48 } }, { - "plugin": "apm", + "plugin": "securitySolution", "link": { - "path": "x-pack/plugins/apm/common/license_check.test.ts", - "lineNumber": 156 + "path": "x-pack/plugins/security_solution/server/endpoint/lib/policy/license_watch.test.ts", + "lineNumber": 42 } }, { - "plugin": "apm", + "plugin": "securitySolution", "link": { - "path": "x-pack/plugins/apm/common/license_check.test.ts", - "lineNumber": 173 + "path": "x-pack/plugins/security_solution/server/endpoint/lib/policy/license_watch.test.ts", + "lineNumber": 43 } }, { - "plugin": "apm", + "plugin": "securitySolution", "link": { - "path": "x-pack/plugins/apm/common/license_check.test.ts", - "lineNumber": 190 + "path": "x-pack/plugins/security_solution/server/endpoint/lib/policy/license_watch.test.ts", + "lineNumber": 44 } }, { - "plugin": "apm", + "plugin": "securitySolution", "link": { - "path": "x-pack/plugins/apm/common/license_check.test.ts", - "lineNumber": 207 + "path": "x-pack/plugins/security_solution/server/endpoint/routes/actions/isolation.test.ts", + "lineNumber": 54 } }, { - "plugin": "security", + "plugin": "securitySolution", "link": { - "path": "x-pack/plugins/security/common/licensing/license_service.test.ts", - "lineNumber": 169 + "path": "x-pack/plugins/security_solution/server/endpoint/routes/actions/isolation.test.ts", + "lineNumber": 55 } }, { - "plugin": "security", + "plugin": "securitySolution", "link": { - "path": "x-pack/plugins/security/common/licensing/license_service.test.ts", - "lineNumber": 194 + "path": "x-pack/plugins/security_solution/public/management/pages/policy/store/policy_details/index.test.ts", + "lineNumber": 159 } }, { - "plugin": "security", + "plugin": "securitySolution", "link": { - "path": "x-pack/plugins/security/common/licensing/license_service.test.ts", - "lineNumber": 219 + "path": "x-pack/plugins/security_solution/public/management/pages/policy/store/policy_details/index.test.ts", + "lineNumber": 161 } } ] @@ -3060,7 +3053,7 @@ "plugin": "spaces", "link": { "path": "x-pack/plugins/spaces/server/usage_collection/spaces_usage_collector.ts", - "lineNumber": 442 + "lineNumber": 431 } }, { @@ -3126,13 +3119,6 @@ "lineNumber": 139 } }, - { - "plugin": "fleet", - "link": { - "path": "x-pack/plugins/fleet/server/plugin.ts", - "lineNumber": 213 - } - }, { "plugin": "indexManagement", "link": { @@ -3147,6 +3133,13 @@ "lineNumber": 73 } }, + { + "plugin": "fleet", + "link": { + "path": "x-pack/plugins/fleet/server/plugin.ts", + "lineNumber": 213 + } + }, { "plugin": "graph", "link": { diff --git a/api_docs/lists.json b/api_docs/lists.json index 8932650bdff76a..90f5cd726287b9 100644 --- a/api_docs/lists.json +++ b/api_docs/lists.json @@ -273,1055 +273,8 @@ "initialIsOpen": false } ], - "functions": [ - { - "parentPluginId": "lists", - "id": "def-public.addEndpointExceptionListWithValidation", - "type": "Function", - "tags": [], - "label": "addEndpointExceptionListWithValidation", - "description": [], - "signature": [ - "({ http, signal, }: ", - "AddEndpointExceptionListProps", - ") => Promise<{ _version: string | undefined; created_at: string; created_by: string; description: string; id: string; immutable: boolean; list_id: string; meta: object | undefined; name: string; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; tags: string[]; tie_breaker_id: string; type: \"endpoint\" | \"detection\" | \"endpoint_events\"; updated_at: string; updated_by: string; version: number; } | {}>" - ], - "source": { - "path": "x-pack/plugins/lists/public/exceptions/api.ts", - "lineNumber": 532 - }, - "deprecated": false, - "children": [ - { - "parentPluginId": "lists", - "id": "def-public.addEndpointExceptionListWithValidation.$1", - "type": "Object", - "tags": [], - "label": "{\n http,\n signal,\n}", - "description": [], - "signature": [ - "AddEndpointExceptionListProps" - ], - "source": { - "path": "x-pack/plugins/lists/public/exceptions/api.ts", - "lineNumber": 532 - }, - "deprecated": false, - "isRequired": true - } - ], - "returnComment": [], - "initialIsOpen": false - }, - { - "parentPluginId": "lists", - "id": "def-public.addExceptionListWithValidation", - "type": "Function", - "tags": [], - "label": "addExceptionListWithValidation", - "description": [], - "signature": [ - "({ http, list, signal, }: ", - "AddExceptionListProps", - ") => Promise<{ _version: string | undefined; created_at: string; created_by: string; description: string; id: string; immutable: boolean; list_id: string; meta: object | undefined; name: string; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; tags: string[]; tie_breaker_id: string; type: \"endpoint\" | \"detection\" | \"endpoint_events\"; updated_at: string; updated_by: string; version: number; }>" - ], - "source": { - "path": "x-pack/plugins/lists/public/exceptions/api.ts", - "lineNumber": 66 - }, - "deprecated": false, - "children": [ - { - "parentPluginId": "lists", - "id": "def-public.addExceptionListWithValidation.$1", - "type": "Object", - "tags": [], - "label": "{\n http,\n list,\n signal,\n}", - "description": [], - "signature": [ - "AddExceptionListProps" - ], - "source": { - "path": "x-pack/plugins/lists/public/exceptions/api.ts", - "lineNumber": 66 - }, - "deprecated": false, - "isRequired": true - } - ], - "returnComment": [], - "initialIsOpen": false - }, - { - "parentPluginId": "lists", - "id": "def-public.exportListWithValidation", - "type": "Function", - "tags": [], - "label": "exportListWithValidation", - "description": [], - "signature": [ - "({ http, listId, signal, }: ", - "ExportListParams", - ") => Promise" - ], - "source": { - "path": "x-pack/plugins/lists/public/lists/api.ts", - "lineNumber": 174 - }, - "deprecated": false, - "children": [ - { - "parentPluginId": "lists", - "id": "def-public.exportListWithValidation.$1", - "type": "Object", - "tags": [], - "label": "{\n http,\n listId,\n signal,\n}", - "description": [], - "signature": [ - "ExportListParams" - ], - "source": { - "path": "x-pack/plugins/lists/public/lists/api.ts", - "lineNumber": 174 - }, - "deprecated": false, - "isRequired": true - } - ], - "returnComment": [], - "initialIsOpen": false - }, - { - "parentPluginId": "lists", - "id": "def-public.fetchExceptionListByIdWithValidation", - "type": "Function", - "tags": [], - "label": "fetchExceptionListByIdWithValidation", - "description": [], - "signature": [ - "({ http, id, namespaceType, signal, }: ", - "ApiCallByIdProps", - ") => Promise<{ _version: string | undefined; created_at: string; created_by: string; description: string; id: string; immutable: boolean; list_id: string; meta: object | undefined; name: string; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; tags: string[]; tie_breaker_id: string; type: \"endpoint\" | \"detection\" | \"endpoint_events\"; updated_at: string; updated_by: string; version: number; }>" - ], - "source": { - "path": "x-pack/plugins/lists/public/exceptions/api.ts", - "lineNumber": 299 - }, - "deprecated": false, - "children": [ - { - "parentPluginId": "lists", - "id": "def-public.fetchExceptionListByIdWithValidation.$1", - "type": "Object", - "tags": [], - "label": "{\n http,\n id,\n namespaceType,\n signal,\n}", - "description": [], - "signature": [ - "ApiCallByIdProps" - ], - "source": { - "path": "x-pack/plugins/lists/public/exceptions/api.ts", - "lineNumber": 299 - }, - "deprecated": false, - "isRequired": true - } - ], - "returnComment": [], - "initialIsOpen": false - }, - { - "parentPluginId": "lists", - "id": "def-public.transformNewItemOutput", - "type": "Function", - "tags": [], - "label": "transformNewItemOutput", - "description": [], - "signature": [ - "(exceptionItem: { description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"text\" | \"keyword\" | \"long\" | \"double\" | \"ip\" | \"date_nanos\" | \"geo_point\" | \"geo_shape\" | \"binary\" | \"short\" | \"date_range\" | \"ip_range\" | \"shape\" | \"integer\" | \"byte\" | \"float\" | \"half_float\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; })[]; list_id: string; name: string; type: \"simple\"; } & { comments?: { comment: string; }[] | undefined; item_id?: string | undefined; meta?: object | undefined; namespace_type?: \"single\" | \"agnostic\" | undefined; os_types?: (\"windows\" | \"linux\" | \"macos\")[] | undefined; tags?: string[] | undefined; }) => { description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"text\" | \"keyword\" | \"long\" | \"double\" | \"ip\" | \"date_nanos\" | \"geo_point\" | \"geo_shape\" | \"binary\" | \"short\" | \"date_range\" | \"ip_range\" | \"shape\" | \"integer\" | \"byte\" | \"float\" | \"half_float\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; })[]; list_id: string; name: string; type: \"simple\"; } & { comments?: { comment: string; }[] | undefined; item_id?: string | undefined; meta?: object | undefined; namespace_type?: \"single\" | \"agnostic\" | undefined; os_types?: (\"windows\" | \"linux\" | \"macos\")[] | undefined; tags?: string[] | undefined; }" - ], - "source": { - "path": "x-pack/plugins/lists/public/exceptions/transforms.ts", - "lineNumber": 40 - }, - "deprecated": false, - "children": [ - { - "parentPluginId": "lists", - "id": "def-public.transformNewItemOutput.$1", - "type": "CompoundType", - "tags": [], - "label": "exceptionItem", - "description": [], - "signature": [ - "{ description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"text\" | \"keyword\" | \"long\" | \"double\" | \"ip\" | \"date_nanos\" | \"geo_point\" | \"geo_shape\" | \"binary\" | \"short\" | \"date_range\" | \"ip_range\" | \"shape\" | \"integer\" | \"byte\" | \"float\" | \"half_float\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; })[]; list_id: string; name: string; type: \"simple\"; } & { comments?: { comment: string; }[] | undefined; item_id?: string | undefined; meta?: object | undefined; namespace_type?: \"single\" | \"agnostic\" | undefined; os_types?: (\"windows\" | \"linux\" | \"macos\")[] | undefined; tags?: string[] | undefined; }" - ], - "source": { - "path": "x-pack/plugins/lists/public/exceptions/transforms.ts", - "lineNumber": 41 - }, - "deprecated": false, - "isRequired": true - } - ], - "returnComment": [], - "initialIsOpen": false - }, - { - "parentPluginId": "lists", - "id": "def-public.transformOutput", - "type": "Function", - "tags": [], - "label": "transformOutput", - "description": [ - "\nTransforms the output of exception items to compensate for technical debt or UI concerns such as\nReactJS preferences for having ids within arrays if the data is not modeled that way.\n\nIf you add a new transform of the output called \"myNewTransform\" do it\nin the form of:\nflow(removeIdFromExceptionItemsEntries, myNewTransform)(exceptionItem)\n" - ], - "signature": [ - "(exceptionItem: { _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"text\" | \"keyword\" | \"long\" | \"double\" | \"ip\" | \"date_nanos\" | \"geo_point\" | \"geo_shape\" | \"binary\" | \"short\" | \"date_range\" | \"ip_range\" | \"shape\" | \"integer\" | \"byte\" | \"float\" | \"half_float\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]; id: string; item_id: string; list_id: string; meta: object | undefined; name: string; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; tags: string[]; tie_breaker_id: string; type: \"simple\"; updated_at: string; updated_by: string; } | ({ description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"text\" | \"keyword\" | \"long\" | \"double\" | \"ip\" | \"date_nanos\" | \"geo_point\" | \"geo_shape\" | \"binary\" | \"short\" | \"date_range\" | \"ip_range\" | \"shape\" | \"integer\" | \"byte\" | \"float\" | \"half_float\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; })[]; name: string; type: \"simple\"; } & { _version?: string | undefined; comments?: ({ comment: string; } & { id?: string | undefined; })[] | undefined; id?: string | undefined; item_id?: string | undefined; meta?: object | undefined; namespace_type?: \"single\" | \"agnostic\" | undefined; os_types?: (\"windows\" | \"linux\" | \"macos\")[] | undefined; tags?: string[] | undefined; })) => { _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"text\" | \"keyword\" | \"long\" | \"double\" | \"ip\" | \"date_nanos\" | \"geo_point\" | \"geo_shape\" | \"binary\" | \"short\" | \"date_range\" | \"ip_range\" | \"shape\" | \"integer\" | \"byte\" | \"float\" | \"half_float\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]; id: string; item_id: string; list_id: string; meta: object | undefined; name: string; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; tags: string[]; tie_breaker_id: string; type: \"simple\"; updated_at: string; updated_by: string; } | ({ description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"text\" | \"keyword\" | \"long\" | \"double\" | \"ip\" | \"date_nanos\" | \"geo_point\" | \"geo_shape\" | \"binary\" | \"short\" | \"date_range\" | \"ip_range\" | \"shape\" | \"integer\" | \"byte\" | \"float\" | \"half_float\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; })[]; name: string; type: \"simple\"; } & { _version?: string | undefined; comments?: ({ comment: string; } & { id?: string | undefined; })[] | undefined; id?: string | undefined; item_id?: string | undefined; meta?: object | undefined; namespace_type?: \"single\" | \"agnostic\" | undefined; os_types?: (\"windows\" | \"linux\" | \"macos\")[] | undefined; tags?: string[] | undefined; })" - ], - "source": { - "path": "x-pack/plugins/lists/public/exceptions/transforms.ts", - "lineNumber": 35 - }, - "deprecated": false, - "children": [ - { - "parentPluginId": "lists", - "id": "def-public.transformOutput.$1", - "type": "CompoundType", - "tags": [], - "label": "exceptionItem", - "description": [], - "signature": [ - "{ _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"text\" | \"keyword\" | \"long\" | \"double\" | \"ip\" | \"date_nanos\" | \"geo_point\" | \"geo_shape\" | \"binary\" | \"short\" | \"date_range\" | \"ip_range\" | \"shape\" | \"integer\" | \"byte\" | \"float\" | \"half_float\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]; id: string; item_id: string; list_id: string; meta: object | undefined; name: string; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; tags: string[]; tie_breaker_id: string; type: \"simple\"; updated_at: string; updated_by: string; } | ({ description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"text\" | \"keyword\" | \"long\" | \"double\" | \"ip\" | \"date_nanos\" | \"geo_point\" | \"geo_shape\" | \"binary\" | \"short\" | \"date_range\" | \"ip_range\" | \"shape\" | \"integer\" | \"byte\" | \"float\" | \"half_float\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; })[]; name: string; type: \"simple\"; } & { _version?: string | undefined; comments?: ({ comment: string; } & { id?: string | undefined; })[] | undefined; id?: string | undefined; item_id?: string | undefined; meta?: object | undefined; namespace_type?: \"single\" | \"agnostic\" | undefined; os_types?: (\"windows\" | \"linux\" | \"macos\")[] | undefined; tags?: string[] | undefined; })" - ], - "source": { - "path": "x-pack/plugins/lists/public/exceptions/transforms.ts", - "lineNumber": 36 - }, - "deprecated": false, - "isRequired": true - } - ], - "returnComment": [ - "The exceptionItem transformed from the output" - ], - "initialIsOpen": false - }, - { - "parentPluginId": "lists", - "id": "def-public.useApi", - "type": "Function", - "tags": [], - "label": "useApi", - "description": [], - "signature": [ - "(http: ", - { - "pluginId": "core", - "scope": "public", - "docId": "kibCoreHttpPluginApi", - "section": "def-public.HttpSetup", - "text": "HttpSetup" - }, - ") => ", - "ExceptionsApi" - ], - "source": { - "path": "x-pack/plugins/lists/public/exceptions/hooks/use_api.ts", - "lineNumber": 41 - }, - "deprecated": false, - "children": [ - { - "parentPluginId": "lists", - "id": "def-public.useApi.$1", - "type": "Object", - "tags": [], - "label": "http", - "description": [], - "signature": [ - { - "pluginId": "core", - "scope": "public", - "docId": "kibCoreHttpPluginApi", - "section": "def-public.HttpSetup", - "text": "HttpSetup" - } - ], - "source": { - "path": "x-pack/plugins/lists/public/exceptions/hooks/use_api.ts", - "lineNumber": 41 - }, - "deprecated": false, - "isRequired": true - } - ], - "returnComment": [], - "initialIsOpen": false - }, - { - "parentPluginId": "lists", - "id": "def-public.useAsync", - "type": "Function", - "tags": [], - "label": "useAsync", - "description": [ - "\n" - ], - "signature": [ - "(fn: (...args: Args) => Promise) => ", - "Async", - "" - ], - "source": { - "path": "x-pack/plugins/lists/public/common/hooks/use_async.ts", - "lineNumber": 25 - }, - "deprecated": false, - "children": [ - { - "parentPluginId": "lists", - "id": "def-public.useAsync.$1", - "type": "Function", - "tags": [], - "label": "fn", - "description": [], - "signature": [ - "(...args: Args) => Promise" - ], - "source": { - "path": "x-pack/plugins/lists/public/common/hooks/use_async.ts", - "lineNumber": 26 - }, - "deprecated": false, - "isRequired": true - } - ], - "returnComment": [ - "An {@link AsyncTask} containing the underlying task's state along with a start callback" - ], - "initialIsOpen": false - }, - { - "parentPluginId": "lists", - "id": "def-public.useCreateListIndex", - "type": "Function", - "tags": [], - "label": "useCreateListIndex", - "description": [], - "signature": [ - "() => ", - "Async", - "<[args: ", - "OptionalSignalArgs", - "<", - "ApiParams", - ">], { acknowledged: boolean; }>" - ], - "source": { - "path": "x-pack/plugins/lists/public/lists/hooks/use_create_list_index.ts", - "lineNumber": 15 - }, - "deprecated": false, - "children": [], - "returnComment": [], - "initialIsOpen": false - }, - { - "parentPluginId": "lists", - "id": "def-public.useCursor", - "type": "Function", - "tags": [], - "label": "useCursor", - "description": [], - "signature": [ - "({ pageIndex, pageSize }: ", - "UseCursorProps", - ") => [string | undefined, SetCursor]" - ], - "source": { - "path": "x-pack/plugins/lists/public/common/hooks/use_cursor.ts", - "lineNumber": 20 - }, - "deprecated": false, - "children": [ - { - "parentPluginId": "lists", - "id": "def-public.useCursor.$1", - "type": "Object", - "tags": [], - "label": "{ pageIndex, pageSize }", - "description": [], - "signature": [ - "UseCursorProps" - ], - "source": { - "path": "x-pack/plugins/lists/public/common/hooks/use_cursor.ts", - "lineNumber": 20 - }, - "deprecated": false, - "isRequired": true - } - ], - "returnComment": [], - "initialIsOpen": false - }, - { - "parentPluginId": "lists", - "id": "def-public.useDeleteList", - "type": "Function", - "tags": [], - "label": "useDeleteList", - "description": [], - "signature": [ - "() => ", - "Async", - "<[args: ", - "OptionalSignalArgs", - "<", - "DeleteListParams", - ">], { _version: string | undefined; created_at: string; created_by: string; description: string; deserializer: string | undefined; id: string; immutable: boolean; meta: object | undefined; name: string; serializer: string | undefined; tie_breaker_id: string; type: \"boolean\" | \"date\" | \"text\" | \"keyword\" | \"long\" | \"double\" | \"ip\" | \"date_nanos\" | \"geo_point\" | \"geo_shape\" | \"binary\" | \"short\" | \"date_range\" | \"ip_range\" | \"shape\" | \"integer\" | \"byte\" | \"float\" | \"half_float\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\"; updated_at: string; updated_by: string; version: number; }>" - ], - "source": { - "path": "x-pack/plugins/lists/public/lists/hooks/use_delete_list.ts", - "lineNumber": 15 - }, - "deprecated": false, - "children": [], - "returnComment": [], - "initialIsOpen": false - }, - { - "parentPluginId": "lists", - "id": "def-public.useExceptionListItems", - "type": "Function", - "tags": [], - "label": "useExceptionListItems", - "description": [ - "\nHook for using to get an ExceptionList and it's ExceptionListItems\n" - ], - "signature": [ - "({ http, lists, pagination, filterOptions, showDetectionsListsOnly, showEndpointListsOnly, matchFilters, onError, onSuccess, }: ", - "UseExceptionListProps", - ") => ", - "ReturnExceptionListAndItems" - ], - "source": { - "path": "x-pack/plugins/lists/public/exceptions/hooks/use_exception_list_items.ts", - "lineNumber": 39 - }, - "deprecated": false, - "children": [ - { - "parentPluginId": "lists", - "id": "def-public.useExceptionListItems.$1", - "type": "Object", - "tags": [], - "label": "{\n http,\n lists,\n pagination = {\n page: 1,\n perPage: 20,\n total: 0,\n },\n filterOptions,\n showDetectionsListsOnly,\n showEndpointListsOnly,\n matchFilters,\n onError,\n onSuccess,\n}", - "description": [], - "signature": [ - "UseExceptionListProps" - ], - "source": { - "path": "x-pack/plugins/lists/public/exceptions/hooks/use_exception_list_items.ts", - "lineNumber": 39 - }, - "deprecated": false, - "isRequired": true - } - ], - "returnComment": [], - "initialIsOpen": false - }, - { - "parentPluginId": "lists", - "id": "def-public.useExceptionLists", - "type": "Function", - "tags": [], - "label": "useExceptionLists", - "description": [ - "\nHook for fetching ExceptionLists\n" - ], - "signature": [ - "({ errorMessage, http, pagination, filterOptions, namespaceTypes, notifications, showTrustedApps, }: ", - "UseExceptionListsProps", - ") => ", - "ReturnExceptionLists" - ], - "source": { - "path": "x-pack/plugins/lists/public/exceptions/hooks/use_exception_lists.ts", - "lineNumber": 30 - }, - "deprecated": false, - "children": [ - { - "parentPluginId": "lists", - "id": "def-public.useExceptionLists.$1", - "type": "Object", - "tags": [], - "label": "{\n errorMessage,\n http,\n pagination = {\n page: 1,\n perPage: 20,\n total: 0,\n },\n filterOptions = {},\n namespaceTypes,\n notifications,\n showTrustedApps = false,\n}", - "description": [], - "signature": [ - "UseExceptionListsProps" - ], - "source": { - "path": "x-pack/plugins/lists/public/exceptions/hooks/use_exception_lists.ts", - "lineNumber": 30 - }, - "deprecated": false, - "isRequired": true - } - ], - "returnComment": [], - "initialIsOpen": false - }, - { - "parentPluginId": "lists", - "id": "def-public.useExportList", - "type": "Function", - "tags": [], - "label": "useExportList", - "description": [], - "signature": [ - "() => ", - "Async", - "<[args: ", - "OptionalSignalArgs", - "<", - "ExportListParams", - ">], Blob>" - ], - "source": { - "path": "x-pack/plugins/lists/public/lists/hooks/use_export_list.ts", - "lineNumber": 15 - }, - "deprecated": false, - "children": [], - "returnComment": [], - "initialIsOpen": false - }, - { - "parentPluginId": "lists", - "id": "def-public.useFindLists", - "type": "Function", - "tags": [], - "label": "useFindLists", - "description": [], - "signature": [ - "() => ", - "Async", - "<[args: ", - "OptionalSignalArgs", - "<", - "FindListsParams", - ">], { cursor: string; data: { _version: string | undefined; created_at: string; created_by: string; description: string; deserializer: string | undefined; id: string; immutable: boolean; meta: object | undefined; name: string; serializer: string | undefined; tie_breaker_id: string; type: \"boolean\" | \"date\" | \"text\" | \"keyword\" | \"long\" | \"double\" | \"ip\" | \"date_nanos\" | \"geo_point\" | \"geo_shape\" | \"binary\" | \"short\" | \"date_range\" | \"ip_range\" | \"shape\" | \"integer\" | \"byte\" | \"float\" | \"half_float\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\"; updated_at: string; updated_by: string; version: number; }[]; page: number; per_page: number; total: number; }>" - ], - "source": { - "path": "x-pack/plugins/lists/public/lists/hooks/use_find_lists.ts", - "lineNumber": 15 - }, - "deprecated": false, - "children": [], - "returnComment": [], - "initialIsOpen": false - }, - { - "parentPluginId": "lists", - "id": "def-public.useImportList", - "type": "Function", - "tags": [], - "label": "useImportList", - "description": [], - "signature": [ - "() => ", - "Async", - "<[args: ", - "OptionalSignalArgs", - "<", - "ImportListParams", - ">], { _version: string | undefined; created_at: string; created_by: string; description: string; deserializer: string | undefined; id: string; immutable: boolean; meta: object | undefined; name: string; serializer: string | undefined; tie_breaker_id: string; type: \"boolean\" | \"date\" | \"text\" | \"keyword\" | \"long\" | \"double\" | \"ip\" | \"date_nanos\" | \"geo_point\" | \"geo_shape\" | \"binary\" | \"short\" | \"date_range\" | \"ip_range\" | \"shape\" | \"integer\" | \"byte\" | \"float\" | \"half_float\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\"; updated_at: string; updated_by: string; version: number; }>" - ], - "source": { - "path": "x-pack/plugins/lists/public/lists/hooks/use_import_list.ts", - "lineNumber": 15 - }, - "deprecated": false, - "children": [], - "returnComment": [], - "initialIsOpen": false - }, - { - "parentPluginId": "lists", - "id": "def-public.useReadListIndex", - "type": "Function", - "tags": [], - "label": "useReadListIndex", - "description": [], - "signature": [ - "() => ", - "Async", - "<[args: ", - "OptionalSignalArgs", - "<", - "ApiParams", - ">], { list_index: boolean; list_item_index: boolean; }>" - ], - "source": { - "path": "x-pack/plugins/lists/public/lists/hooks/use_read_list_index.ts", - "lineNumber": 15 - }, - "deprecated": false, - "children": [], - "returnComment": [], - "initialIsOpen": false - }, - { - "parentPluginId": "lists", - "id": "def-public.useReadListPrivileges", - "type": "Function", - "tags": [], - "label": "useReadListPrivileges", - "description": [], - "signature": [ - "() => ", - "Async", - "<[args: ", - "OptionalSignalArgs", - "<", - "ApiParams", - ">], unknown>" - ], - "source": { - "path": "x-pack/plugins/lists/public/lists/hooks/use_read_list_privileges.ts", - "lineNumber": 15 - }, - "deprecated": false, - "children": [], - "returnComment": [], - "initialIsOpen": false - }, - { - "parentPluginId": "lists", - "id": "def-public.withOptionalSignal", - "type": "Function", - "tags": [], - "label": "withOptionalSignal", - "description": [ - "\n" - ], - "signature": [ - "(fn: (args: Args) => Result) => (args: ", - "OptionalSignalArgs", - ") => Result" - ], - "source": { - "path": "x-pack/plugins/lists/public/common/with_optional_signal.ts", - "lineNumber": 20 - }, - "deprecated": false, - "children": [ - { - "parentPluginId": "lists", - "id": "def-public.withOptionalSignal.$1", - "type": "Function", - "tags": [], - "label": "fn", - "description": [], - "signature": [ - "(args: Args) => Result" - ], - "source": { - "path": "x-pack/plugins/lists/public/common/with_optional_signal.ts", - "lineNumber": 20 - }, - "deprecated": false, - "isRequired": true - } - ], - "returnComment": [ - "An async function where the AbortSignal argument is optional" - ], - "initialIsOpen": false - } - ], - "interfaces": [ - { - "parentPluginId": "lists", - "id": "def-public.ExceptionList", - "type": "Interface", - "tags": [], - "label": "ExceptionList", - "description": [], - "signature": [ - { - "pluginId": "lists", - "scope": "public", - "docId": "kibListsPluginApi", - "section": "def-public.ExceptionList", - "text": "ExceptionList" - }, - " extends { _version: string | undefined; created_at: string; created_by: string; description: string; id: string; immutable: boolean; list_id: string; meta: object | undefined; name: string; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; tags: string[]; tie_breaker_id: string; type: \"endpoint\" | \"detection\" | \"endpoint_events\"; updated_at: string; updated_by: string; version: number; }" - ], - "source": { - "path": "x-pack/plugins/lists/public/exceptions/types.ts", - "lineNumber": 42 - }, - "deprecated": false, - "children": [ - { - "parentPluginId": "lists", - "id": "def-public.ExceptionList.totalItems", - "type": "number", - "tags": [], - "label": "totalItems", - "description": [], - "source": { - "path": "x-pack/plugins/lists/public/exceptions/types.ts", - "lineNumber": 43 - }, - "deprecated": false - } - ], - "initialIsOpen": false - }, - { - "parentPluginId": "lists", - "id": "def-public.ExceptionListFilter", - "type": "Interface", - "tags": [], - "label": "ExceptionListFilter", - "description": [], - "source": { - "path": "x-pack/plugins/lists/public/exceptions/types.ts", - "lineNumber": 126 - }, - "deprecated": false, - "children": [ - { - "parentPluginId": "lists", - "id": "def-public.ExceptionListFilter.name", - "type": "CompoundType", - "tags": [], - "label": "name", - "description": [], - "signature": [ - "string | null | undefined" - ], - "source": { - "path": "x-pack/plugins/lists/public/exceptions/types.ts", - "lineNumber": 127 - }, - "deprecated": false - }, - { - "parentPluginId": "lists", - "id": "def-public.ExceptionListFilter.list_id", - "type": "CompoundType", - "tags": [], - "label": "list_id", - "description": [], - "signature": [ - "string | null | undefined" - ], - "source": { - "path": "x-pack/plugins/lists/public/exceptions/types.ts", - "lineNumber": 128 - }, - "deprecated": false - }, - { - "parentPluginId": "lists", - "id": "def-public.ExceptionListFilter.created_by", - "type": "CompoundType", - "tags": [], - "label": "created_by", - "description": [], - "signature": [ - "string | null | undefined" - ], - "source": { - "path": "x-pack/plugins/lists/public/exceptions/types.ts", - "lineNumber": 129 - }, - "deprecated": false - }, - { - "parentPluginId": "lists", - "id": "def-public.ExceptionListFilter.type", - "type": "CompoundType", - "tags": [], - "label": "type", - "description": [], - "signature": [ - "string | null | undefined" - ], - "source": { - "path": "x-pack/plugins/lists/public/exceptions/types.ts", - "lineNumber": 130 - }, - "deprecated": false - }, - { - "parentPluginId": "lists", - "id": "def-public.ExceptionListFilter.tags", - "type": "CompoundType", - "tags": [], - "label": "tags", - "description": [], - "signature": [ - "string | null | undefined" - ], - "source": { - "path": "x-pack/plugins/lists/public/exceptions/types.ts", - "lineNumber": 131 - }, - "deprecated": false - } - ], - "initialIsOpen": false - }, - { - "parentPluginId": "lists", - "id": "def-public.ExceptionListIdentifiers", - "type": "Interface", - "tags": [], - "label": "ExceptionListIdentifiers", - "description": [], - "source": { - "path": "x-pack/plugins/lists/public/exceptions/types.ts", - "lineNumber": 63 - }, - "deprecated": false, - "children": [ - { - "parentPluginId": "lists", - "id": "def-public.ExceptionListIdentifiers.id", - "type": "string", - "tags": [], - "label": "id", - "description": [], - "source": { - "path": "x-pack/plugins/lists/public/exceptions/types.ts", - "lineNumber": 64 - }, - "deprecated": false - }, - { - "parentPluginId": "lists", - "id": "def-public.ExceptionListIdentifiers.listId", - "type": "string", - "tags": [], - "label": "listId", - "description": [], - "source": { - "path": "x-pack/plugins/lists/public/exceptions/types.ts", - "lineNumber": 65 - }, - "deprecated": false - }, - { - "parentPluginId": "lists", - "id": "def-public.ExceptionListIdentifiers.namespaceType", - "type": "CompoundType", - "tags": [], - "label": "namespaceType", - "description": [], - "signature": [ - "\"single\" | \"agnostic\"" - ], - "source": { - "path": "x-pack/plugins/lists/public/exceptions/types.ts", - "lineNumber": 66 - }, - "deprecated": false - }, - { - "parentPluginId": "lists", - "id": "def-public.ExceptionListIdentifiers.type", - "type": "CompoundType", - "tags": [], - "label": "type", - "description": [], - "signature": [ - "\"endpoint\" | \"detection\" | \"endpoint_events\"" - ], - "source": { - "path": "x-pack/plugins/lists/public/exceptions/types.ts", - "lineNumber": 67 - }, - "deprecated": false - } - ], - "initialIsOpen": false - }, - { - "parentPluginId": "lists", - "id": "def-public.Pagination", - "type": "Interface", - "tags": [], - "label": "Pagination", - "description": [], - "source": { - "path": "x-pack/plugins/lists/public/exceptions/types.ts", - "lineNumber": 29 - }, - "deprecated": false, - "children": [ - { - "parentPluginId": "lists", - "id": "def-public.Pagination.page", - "type": "number", - "tags": [], - "label": "page", - "description": [], - "source": { - "path": "x-pack/plugins/lists/public/exceptions/types.ts", - "lineNumber": 30 - }, - "deprecated": false - }, - { - "parentPluginId": "lists", - "id": "def-public.Pagination.perPage", - "type": "number", - "tags": [], - "label": "perPage", - "description": [], - "source": { - "path": "x-pack/plugins/lists/public/exceptions/types.ts", - "lineNumber": 31 - }, - "deprecated": false - }, - { - "parentPluginId": "lists", - "id": "def-public.Pagination.total", - "type": "number", - "tags": [], - "label": "total", - "description": [], - "signature": [ - "number | undefined" - ], - "source": { - "path": "x-pack/plugins/lists/public/exceptions/types.ts", - "lineNumber": 32 - }, - "deprecated": false - } - ], - "initialIsOpen": false - }, - { - "parentPluginId": "lists", - "id": "def-public.UseExceptionListItemsSuccess", - "type": "Interface", - "tags": [], - "label": "UseExceptionListItemsSuccess", - "description": [], - "source": { - "path": "x-pack/plugins/lists/public/exceptions/types.ts", - "lineNumber": 46 - }, - "deprecated": false, - "children": [ - { - "parentPluginId": "lists", - "id": "def-public.UseExceptionListItemsSuccess.exceptions", - "type": "Array", - "tags": [], - "label": "exceptions", - "description": [], - "signature": [ - "{ _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"text\" | \"keyword\" | \"long\" | \"double\" | \"ip\" | \"date_nanos\" | \"geo_point\" | \"geo_shape\" | \"binary\" | \"short\" | \"date_range\" | \"ip_range\" | \"shape\" | \"integer\" | \"byte\" | \"float\" | \"half_float\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]; id: string; item_id: string; list_id: string; meta: object | undefined; name: string; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; tags: string[]; tie_breaker_id: string; type: \"simple\"; updated_at: string; updated_by: string; }[]" - ], - "source": { - "path": "x-pack/plugins/lists/public/exceptions/types.ts", - "lineNumber": 47 - }, - "deprecated": false - }, - { - "parentPluginId": "lists", - "id": "def-public.UseExceptionListItemsSuccess.pagination", - "type": "Object", - "tags": [], - "label": "pagination", - "description": [], - "signature": [ - { - "pluginId": "lists", - "scope": "public", - "docId": "kibListsPluginApi", - "section": "def-public.Pagination", - "text": "Pagination" - } - ], - "source": { - "path": "x-pack/plugins/lists/public/exceptions/types.ts", - "lineNumber": 48 - }, - "deprecated": false - } - ], - "initialIsOpen": false - }, - { - "parentPluginId": "lists", - "id": "def-public.UseExceptionListsSuccess", - "type": "Interface", - "tags": [], - "label": "UseExceptionListsSuccess", - "description": [], - "source": { - "path": "x-pack/plugins/lists/public/exceptions/types.ts", - "lineNumber": 121 - }, - "deprecated": false, - "children": [ - { - "parentPluginId": "lists", - "id": "def-public.UseExceptionListsSuccess.exceptions", - "type": "Array", - "tags": [], - "label": "exceptions", - "description": [], - "signature": [ - "{ _version: string | undefined; created_at: string; created_by: string; description: string; id: string; immutable: boolean; list_id: string; meta: object | undefined; name: string; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; tags: string[]; tie_breaker_id: string; type: \"endpoint\" | \"detection\" | \"endpoint_events\"; updated_at: string; updated_by: string; version: number; }[]" - ], - "source": { - "path": "x-pack/plugins/lists/public/exceptions/types.ts", - "lineNumber": 122 - }, - "deprecated": false - }, - { - "parentPluginId": "lists", - "id": "def-public.UseExceptionListsSuccess.pagination", - "type": "Object", - "tags": [], - "label": "pagination", - "description": [], - "signature": [ - { - "pluginId": "lists", - "scope": "public", - "docId": "kibListsPluginApi", - "section": "def-public.Pagination", - "text": "Pagination" - } - ], - "source": { - "path": "x-pack/plugins/lists/public/exceptions/types.ts", - "lineNumber": 123 - }, - "deprecated": false - } - ], - "initialIsOpen": false - } - ], + "functions": [], + "interfaces": [], "enums": [], "misc": [], "objects": [ @@ -1338,7 +291,7 @@ ], "source": { "path": "x-pack/plugins/lists/public/shared_exports.ts", - "lineNumber": 36 + "lineNumber": 10 }, "deprecated": false, "initialIsOpen": false @@ -1388,7 +341,7 @@ "description": [], "source": { "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client.ts", - "lineNumber": 57 + "lineNumber": 56 }, "deprecated": false, "children": [ @@ -1404,7 +357,7 @@ ], "source": { "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client.ts", - "lineNumber": 62 + "lineNumber": 61 }, "deprecated": false, "children": [ @@ -1420,7 +373,7 @@ ], "source": { "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client.ts", - "lineNumber": 62 + "lineNumber": 61 }, "deprecated": false, "isRequired": true @@ -1442,7 +395,7 @@ ], "source": { "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client.ts", - "lineNumber": 67 + "lineNumber": 66 }, "deprecated": false, "children": [ @@ -1458,7 +411,7 @@ ], "source": { "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client.ts", - "lineNumber": 67 + "lineNumber": 66 }, "deprecated": false, "isRequired": true @@ -1480,7 +433,7 @@ ], "source": { "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client.ts", - "lineNumber": 76 + "lineNumber": 75 }, "deprecated": false, "children": [ @@ -1496,7 +449,7 @@ ], "source": { "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client.ts", - "lineNumber": 76 + "lineNumber": 75 }, "deprecated": false, "isRequired": true @@ -1518,7 +471,7 @@ ], "source": { "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client.ts", - "lineNumber": 91 + "lineNumber": 90 }, "deprecated": false, "children": [], @@ -1540,7 +493,7 @@ ], "source": { "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client.ts", - "lineNumber": 103 + "lineNumber": 102 }, "deprecated": false, "children": [], @@ -1560,7 +513,7 @@ ], "source": { "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client.ts", - "lineNumber": 115 + "lineNumber": 114 }, "deprecated": false, "children": [], @@ -1582,7 +535,7 @@ ], "source": { "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client.ts", - "lineNumber": 129 + "lineNumber": 128 }, "deprecated": false, "children": [ @@ -1598,7 +551,7 @@ ], "source": { "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client.ts", - "lineNumber": 129 + "lineNumber": 128 }, "deprecated": false, "isRequired": true @@ -1622,7 +575,7 @@ ], "source": { "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client.ts", - "lineNumber": 165 + "lineNumber": 164 }, "deprecated": false, "children": [ @@ -1638,7 +591,7 @@ ], "source": { "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client.ts", - "lineNumber": 165 + "lineNumber": 164 }, "deprecated": false, "isRequired": true @@ -1662,7 +615,7 @@ ], "source": { "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client.ts", - "lineNumber": 201 + "lineNumber": 200 }, "deprecated": false, "children": [ @@ -1678,7 +631,7 @@ ], "source": { "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client.ts", - "lineNumber": 201 + "lineNumber": 200 }, "deprecated": false, "isRequired": true @@ -1700,7 +653,7 @@ ], "source": { "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client.ts", - "lineNumber": 209 + "lineNumber": 208 }, "deprecated": false, "children": [ @@ -1716,7 +669,7 @@ ], "source": { "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client.ts", - "lineNumber": 209 + "lineNumber": 208 }, "deprecated": false, "isRequired": true @@ -1738,7 +691,7 @@ ], "source": { "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client.ts", - "lineNumber": 236 + "lineNumber": 235 }, "deprecated": false, "children": [ @@ -1754,7 +707,7 @@ ], "source": { "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client.ts", - "lineNumber": 236 + "lineNumber": 235 }, "deprecated": false, "isRequired": true @@ -1776,7 +729,7 @@ ], "source": { "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client.ts", - "lineNumber": 267 + "lineNumber": 266 }, "deprecated": false, "children": [ @@ -1792,7 +745,7 @@ ], "source": { "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client.ts", - "lineNumber": 267 + "lineNumber": 266 }, "deprecated": false, "isRequired": true @@ -1820,7 +773,7 @@ ], "source": { "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client.ts", - "lineNumber": 281 + "lineNumber": 280 }, "deprecated": false, "children": [ @@ -1842,7 +795,7 @@ ], "source": { "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client.ts", - "lineNumber": 281 + "lineNumber": 280 }, "deprecated": false, "isRequired": true @@ -1870,7 +823,7 @@ ], "source": { "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client.ts", - "lineNumber": 312 + "lineNumber": 311 }, "deprecated": false, "children": [ @@ -1892,7 +845,7 @@ ], "source": { "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client.ts", - "lineNumber": 312 + "lineNumber": 311 }, "deprecated": false, "isRequired": true @@ -1914,7 +867,7 @@ ], "source": { "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client.ts", - "lineNumber": 345 + "lineNumber": 344 }, "deprecated": false, "children": [ @@ -1930,7 +883,7 @@ ], "source": { "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client.ts", - "lineNumber": 345 + "lineNumber": 344 }, "deprecated": false, "isRequired": true @@ -1952,7 +905,7 @@ ], "source": { "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client.ts", - "lineNumber": 359 + "lineNumber": 358 }, "deprecated": false, "children": [ @@ -1968,7 +921,7 @@ ], "source": { "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client.ts", - "lineNumber": 359 + "lineNumber": 358 }, "deprecated": false, "isRequired": true @@ -1992,7 +945,7 @@ ], "source": { "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client.ts", - "lineNumber": 374 + "lineNumber": 373 }, "deprecated": false, "children": [ @@ -2008,7 +961,7 @@ ], "source": { "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client.ts", - "lineNumber": 374 + "lineNumber": 373 }, "deprecated": false, "isRequired": true @@ -2030,7 +983,7 @@ ], "source": { "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client.ts", - "lineNumber": 387 + "lineNumber": 386 }, "deprecated": false, "children": [ @@ -2046,7 +999,7 @@ ], "source": { "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client.ts", - "lineNumber": 387 + "lineNumber": 386 }, "deprecated": false, "isRequired": true @@ -2068,7 +1021,7 @@ ], "source": { "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client.ts", - "lineNumber": 409 + "lineNumber": 408 }, "deprecated": false, "children": [ @@ -2084,7 +1037,7 @@ ], "source": { "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client.ts", - "lineNumber": 409 + "lineNumber": 408 }, "deprecated": false, "isRequired": true @@ -2106,7 +1059,7 @@ ], "source": { "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client.ts", - "lineNumber": 431 + "lineNumber": 430 }, "deprecated": false, "children": [ @@ -2122,7 +1075,7 @@ ], "source": { "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client.ts", - "lineNumber": 431 + "lineNumber": 430 }, "deprecated": false, "isRequired": true @@ -2144,7 +1097,7 @@ ], "source": { "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client.ts", - "lineNumber": 449 + "lineNumber": 448 }, "deprecated": false, "children": [ @@ -2160,7 +1113,7 @@ ], "source": { "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client.ts", - "lineNumber": 449 + "lineNumber": 448 }, "deprecated": false, "isRequired": true @@ -2184,7 +1137,7 @@ ], "source": { "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client.ts", - "lineNumber": 477 + "lineNumber": 476 }, "deprecated": false, "children": [ @@ -2200,7 +1153,7 @@ ], "source": { "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client.ts", - "lineNumber": 477 + "lineNumber": 476 }, "deprecated": false, "isRequired": true @@ -4234,228 +3187,10 @@ }, "common": { "classes": [], - "functions": [ - { - "parentPluginId": "lists", - "id": "def-common.buildExceptionFilter", - "type": "Function", - "tags": [], - "label": "buildExceptionFilter", - "description": [], - "signature": [ - "({ lists, excludeExceptions, chunkSize, }: { lists: ({ _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"text\" | \"keyword\" | \"long\" | \"double\" | \"ip\" | \"date_nanos\" | \"geo_point\" | \"geo_shape\" | \"binary\" | \"short\" | \"date_range\" | \"ip_range\" | \"shape\" | \"integer\" | \"byte\" | \"float\" | \"half_float\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]; id: string; item_id: string; list_id: string; meta: object | undefined; name: string; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; tags: string[]; tie_breaker_id: string; type: \"simple\"; updated_at: string; updated_by: string; } | ({ description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"text\" | \"keyword\" | \"long\" | \"double\" | \"ip\" | \"date_nanos\" | \"geo_point\" | \"geo_shape\" | \"binary\" | \"short\" | \"date_range\" | \"ip_range\" | \"shape\" | \"integer\" | \"byte\" | \"float\" | \"half_float\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; })[]; list_id: string; name: string; type: \"simple\"; } & { comments?: { comment: string; }[] | undefined; item_id?: string | undefined; meta?: object | undefined; namespace_type?: \"single\" | \"agnostic\" | undefined; os_types?: (\"windows\" | \"linux\" | \"macos\")[] | undefined; tags?: string[] | undefined; }))[]; excludeExceptions: boolean; chunkSize: number; }) => ", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataPluginApi", - "section": "def-common.Filter", - "text": "Filter" - }, - " | undefined" - ], - "source": { - "path": "x-pack/plugins/lists/common/exceptions/build_exceptions_filter.ts", - "lineNumber": 69 - }, - "deprecated": false, - "children": [ - { - "parentPluginId": "lists", - "id": "def-common.buildExceptionFilter.$1.listsexcludeExceptionschunkSize", - "type": "Object", - "tags": [], - "label": "{\n lists,\n excludeExceptions,\n chunkSize,\n}", - "description": [], - "source": { - "path": "x-pack/plugins/lists/common/exceptions/build_exceptions_filter.ts", - "lineNumber": 73 - }, - "deprecated": false, - "children": [ - { - "parentPluginId": "lists", - "id": "def-common.buildExceptionFilter.$1.listsexcludeExceptionschunkSize.lists", - "type": "Array", - "tags": [], - "label": "lists", - "description": [], - "signature": [ - "({ _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"text\" | \"keyword\" | \"long\" | \"double\" | \"ip\" | \"date_nanos\" | \"geo_point\" | \"geo_shape\" | \"binary\" | \"short\" | \"date_range\" | \"ip_range\" | \"shape\" | \"integer\" | \"byte\" | \"float\" | \"half_float\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]; id: string; item_id: string; list_id: string; meta: object | undefined; name: string; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; tags: string[]; tie_breaker_id: string; type: \"simple\"; updated_at: string; updated_by: string; } | ({ description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"text\" | \"keyword\" | \"long\" | \"double\" | \"ip\" | \"date_nanos\" | \"geo_point\" | \"geo_shape\" | \"binary\" | \"short\" | \"date_range\" | \"ip_range\" | \"shape\" | \"integer\" | \"byte\" | \"float\" | \"half_float\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; })[]; list_id: string; name: string; type: \"simple\"; } & { comments?: { comment: string; }[] | undefined; item_id?: string | undefined; meta?: object | undefined; namespace_type?: \"single\" | \"agnostic\" | undefined; os_types?: (\"windows\" | \"linux\" | \"macos\")[] | undefined; tags?: string[] | undefined; }))[]" - ], - "source": { - "path": "x-pack/plugins/lists/common/exceptions/build_exceptions_filter.ts", - "lineNumber": 74 - }, - "deprecated": false - }, - { - "parentPluginId": "lists", - "id": "def-common.buildExceptionFilter.$1.listsexcludeExceptionschunkSize.excludeExceptions", - "type": "boolean", - "tags": [], - "label": "excludeExceptions", - "description": [], - "source": { - "path": "x-pack/plugins/lists/common/exceptions/build_exceptions_filter.ts", - "lineNumber": 75 - }, - "deprecated": false - }, - { - "parentPluginId": "lists", - "id": "def-common.buildExceptionFilter.$1.listsexcludeExceptionschunkSize.chunkSize", - "type": "number", - "tags": [], - "label": "chunkSize", - "description": [], - "source": { - "path": "x-pack/plugins/lists/common/exceptions/build_exceptions_filter.ts", - "lineNumber": 76 - }, - "deprecated": false - } - ] - } - ], - "returnComment": [], - "initialIsOpen": false - } - ], + "functions": [], "interfaces": [], "enums": [], - "misc": [ - { - "parentPluginId": "lists", - "id": "def-common.ENDPOINT_EVENT_FILTERS_LIST_DESCRIPTION", - "type": "string", - "tags": [], - "label": "ENDPOINT_EVENT_FILTERS_LIST_DESCRIPTION", - "description": [ - "Description of event filters agnostic list" - ], - "signature": [ - "\"Endpoint Security Event Filters List\"" - ], - "source": { - "path": "x-pack/plugins/lists/common/constants.ts", - "lineNumber": 71 - }, - "deprecated": false, - "initialIsOpen": false - }, - { - "parentPluginId": "lists", - "id": "def-common.ENDPOINT_EVENT_FILTERS_LIST_ID", - "type": "string", - "tags": [], - "label": "ENDPOINT_EVENT_FILTERS_LIST_ID", - "description": [ - "ID of event filters agnostic list" - ], - "signature": [ - "\"endpoint_event_filters\"" - ], - "source": { - "path": "x-pack/plugins/lists/common/constants.ts", - "lineNumber": 65 - }, - "deprecated": false, - "initialIsOpen": false - }, - { - "parentPluginId": "lists", - "id": "def-common.ENDPOINT_EVENT_FILTERS_LIST_NAME", - "type": "string", - "tags": [], - "label": "ENDPOINT_EVENT_FILTERS_LIST_NAME", - "description": [ - "Name of event filters agnostic list" - ], - "signature": [ - "\"Endpoint Security Event Filters List\"" - ], - "source": { - "path": "x-pack/plugins/lists/common/constants.ts", - "lineNumber": 68 - }, - "deprecated": false, - "initialIsOpen": false - }, - { - "parentPluginId": "lists", - "id": "def-common.ENDPOINT_LIST_ID", - "type": "string", - "tags": [], - "label": "ENDPOINT_LIST_ID", - "description": [ - "\nThis ID is used for _both_ the Saved Object ID and for the list_id\nfor the single global space agnostic endpoint list" - ], - "signature": [ - "\"endpoint_list\"" - ], - "source": { - "path": "x-pack/plugins/lists/common/constants.ts", - "lineNumber": 45 - }, - "deprecated": false, - "initialIsOpen": false - }, - { - "parentPluginId": "lists", - "id": "def-common.ENDPOINT_TRUSTED_APPS_LIST_ID", - "type": "string", - "tags": [], - "label": "ENDPOINT_TRUSTED_APPS_LIST_ID", - "description": [ - "ID of trusted apps agnostic list" - ], - "signature": [ - "\"endpoint_trusted_apps\"" - ], - "source": { - "path": "x-pack/plugins/lists/common/constants.ts", - "lineNumber": 56 - }, - "deprecated": false, - "initialIsOpen": false - }, - { - "parentPluginId": "lists", - "id": "def-common.EXCEPTION_LIST_ITEM_URL", - "type": "string", - "tags": [], - "label": "EXCEPTION_LIST_ITEM_URL", - "description": [], - "signature": [ - "\"/api/exception_lists/items\"" - ], - "source": { - "path": "x-pack/plugins/lists/common/constants.ts", - "lineNumber": 20 - }, - "deprecated": false, - "initialIsOpen": false - }, - { - "parentPluginId": "lists", - "id": "def-common.EXCEPTION_LIST_URL", - "type": "string", - "tags": [], - "label": "EXCEPTION_LIST_URL", - "description": [ - "\nException list routes" - ], - "signature": [ - "\"/api/exception_lists\"" - ], - "source": { - "path": "x-pack/plugins/lists/common/constants.ts", - "lineNumber": 19 - }, - "deprecated": false, - "initialIsOpen": false - } - ], + "misc": [], "objects": [] } } \ No newline at end of file diff --git a/api_docs/lists.mdx b/api_docs/lists.mdx index 1fe986ef4a06b3..8ef77a85fb548e 100644 --- a/api_docs/lists.mdx +++ b/api_docs/lists.mdx @@ -22,15 +22,9 @@ import listsObj from './lists.json'; ### Objects -### Functions - - ### Classes -### Interfaces - - ## Server ### Classes @@ -39,11 +33,3 @@ import listsObj from './lists.json'; ### Interfaces -## Common - -### Functions - - -### Consts, variables and types - - diff --git a/api_docs/management.json b/api_docs/management.json index 2a3bb7e3cb1eb3..41801e2f2bafc7 100644 --- a/api_docs/management.json +++ b/api_docs/management.json @@ -22,7 +22,7 @@ ], "source": { "path": "src/plugins/management/public/utils/management_app.ts", - "lineNumber": 19 + "lineNumber": 18 }, "deprecated": false, "children": [ @@ -50,7 +50,7 @@ ], "source": { "path": "src/plugins/management/public/utils/management_app.ts", - "lineNumber": 20 + "lineNumber": 19 }, "deprecated": false, "returnComment": [], @@ -88,29 +88,23 @@ "description": [], "source": { "path": "src/plugins/management/public/utils/management_app.ts", - "lineNumber": 21 + "lineNumber": 20 }, "deprecated": false }, { "parentPluginId": "management", - "id": "def-public.ManagementApp.meta", - "type": "Object", + "id": "def-public.ManagementApp.keywords", + "type": "Array", "tags": [], - "label": "meta", + "label": "keywords", "description": [], "signature": [ - { - "pluginId": "core", - "scope": "public", - "docId": "kibCoreApplicationPluginApi", - "section": "def-public.AppMeta", - "text": "AppMeta" - } + "string[]" ], "source": { "path": "src/plugins/management/public/utils/management_app.ts", - "lineNumber": 22 + "lineNumber": 21 }, "deprecated": false }, @@ -126,7 +120,7 @@ ], "source": { "path": "src/plugins/management/public/utils/management_app.ts", - "lineNumber": 24 + "lineNumber": 23 }, "deprecated": false, "children": [ @@ -148,7 +142,7 @@ ], "source": { "path": "src/plugins/management/public/utils/management_app.ts", - "lineNumber": 24 + "lineNumber": 23 }, "deprecated": false, "isRequired": true @@ -260,7 +254,7 @@ "section": "def-public.RegisterManagementAppArgs", "text": "RegisterManagementAppArgs" }, - ", \"title\" | \"id\" | \"meta\" | \"order\" | \"mount\" | \"euiIconType\" | \"icon\" | \"tip\">) => ", + ", \"title\" | \"id\" | \"order\" | \"mount\" | \"keywords\" | \"euiIconType\" | \"icon\" | \"tip\">) => ", { "pluginId": "management", "scope": "public", @@ -291,7 +285,7 @@ "section": "def-public.RegisterManagementAppArgs", "text": "RegisterManagementAppArgs" }, - ", \"title\" | \"id\" | \"meta\" | \"order\" | \"mount\" | \"euiIconType\" | \"icon\" | \"tip\">" + ", \"title\" | \"id\" | \"order\" | \"mount\" | \"keywords\" | \"euiIconType\" | \"icon\" | \"tip\">" ], "source": { "path": "src/plugins/management/public/utils/management_section.ts", @@ -653,7 +647,7 @@ ], "source": { "path": "src/plugins/management/public/utils/management_app.ts", - "lineNumber": 13 + "lineNumber": 12 }, "deprecated": false, "children": [ @@ -681,7 +675,7 @@ ], "source": { "path": "src/plugins/management/public/utils/management_app.ts", - "lineNumber": 14 + "lineNumber": 13 }, "deprecated": false, "returnComment": [], @@ -719,30 +713,23 @@ "description": [], "source": { "path": "src/plugins/management/public/utils/management_app.ts", - "lineNumber": 15 + "lineNumber": 14 }, "deprecated": false }, { "parentPluginId": "management", - "id": "def-public.RegisterManagementAppArgs.meta", - "type": "Object", + "id": "def-public.RegisterManagementAppArgs.keywords", + "type": "Array", "tags": [], - "label": "meta", + "label": "keywords", "description": [], "signature": [ - { - "pluginId": "core", - "scope": "public", - "docId": "kibCoreApplicationPluginApi", - "section": "def-public.AppMeta", - "text": "AppMeta" - }, - " | undefined" + "string[] | undefined" ], "source": { "path": "src/plugins/management/public/utils/management_app.ts", - "lineNumber": 16 + "lineNumber": 15 }, "deprecated": false } diff --git a/api_docs/ml.json b/api_docs/ml.json index 51a5608578026a..dee66858b9be94 100644 --- a/api_docs/ml.json +++ b/api_docs/ml.json @@ -1320,7 +1320,7 @@ }, " extends Pick<", "UseDataGridReturnType", - ", \"status\" | \"errorMessage\" | \"baseline\" | \"pagination\" | \"chartsVisible\" | \"chartsButtonVisible\" | \"ccsWarning\" | \"columnsWithCharts\" | \"invalidSortingColumnns\" | \"noDataMessage\" | \"onChangeItemsPerPage\" | \"onChangePage\" | \"onSort\" | \"setPagination\" | \"setVisibleColumns\" | \"rowCount\" | \"rowCountRelation\" | \"sortingColumns\" | \"tableItems\" | \"toggleChartVisibility\" | \"visibleColumns\" | \"predictionFieldName\" | \"resultsField\">" + ", \"status\" | \"errorMessage\" | \"baseline\" | \"chartsVisible\" | \"chartsButtonVisible\" | \"ccsWarning\" | \"columnsWithCharts\" | \"invalidSortingColumnns\" | \"noDataMessage\" | \"onChangeItemsPerPage\" | \"onChangePage\" | \"onSort\" | \"pagination\" | \"setPagination\" | \"setVisibleColumns\" | \"rowCount\" | \"rowCountRelation\" | \"sortingColumns\" | \"tableItems\" | \"toggleChartVisibility\" | \"visibleColumns\" | \"predictionFieldName\" | \"resultsField\">" ], "source": { "path": "x-pack/plugins/ml/public/application/components/data_grid/types.ts", diff --git a/api_docs/saved_objects.json b/api_docs/saved_objects.json index 566e0e9a14ae99..48579ca8e589e0 100644 --- a/api_docs/saved_objects.json +++ b/api_docs/saved_objects.json @@ -680,20 +680,6 @@ }, "deprecated": true, "references": [ - { - "plugin": "visualizations", - "link": { - "path": "src/plugins/visualizations/public/saved_visualizations/find_list_items.ts", - "lineNumber": 16 - } - }, - { - "plugin": "visualizations", - "link": { - "path": "src/plugins/visualizations/public/saved_visualizations/find_list_items.ts", - "lineNumber": 35 - } - }, { "plugin": "discover", "link": { @@ -722,6 +708,20 @@ "lineNumber": 88 } }, + { + "plugin": "visualizations", + "link": { + "path": "src/plugins/visualizations/public/saved_visualizations/find_list_items.ts", + "lineNumber": 16 + } + }, + { + "plugin": "visualizations", + "link": { + "path": "src/plugins/visualizations/public/saved_visualizations/find_list_items.ts", + "lineNumber": 35 + } + }, { "plugin": "visualizations", "link": { @@ -2569,31 +2569,31 @@ } }, { - "plugin": "visualizations", + "plugin": "discover", "link": { - "path": "src/plugins/visualizations/public/types.ts", + "path": "src/plugins/discover/public/saved_searches/_saved_search.ts", "lineNumber": 9 } }, { - "plugin": "visualizations", + "plugin": "discover", "link": { - "path": "src/plugins/visualizations/public/types.ts", - "lineNumber": 41 + "path": "src/plugins/discover/public/saved_searches/_saved_search.ts", + "lineNumber": 61 } }, { - "plugin": "discover", + "plugin": "visualizations", "link": { - "path": "src/plugins/discover/public/saved_searches/_saved_search.ts", + "path": "src/plugins/visualizations/public/types.ts", "lineNumber": 9 } }, { - "plugin": "discover", + "plugin": "visualizations", "link": { - "path": "src/plugins/discover/public/saved_searches/_saved_search.ts", - "lineNumber": 61 + "path": "src/plugins/visualizations/public/types.ts", + "lineNumber": 41 } }, { diff --git a/api_docs/security.json b/api_docs/security.json index 6cc84bc75f0090..7e28ad2a222bb3 100644 --- a/api_docs/security.json +++ b/api_docs/security.json @@ -1306,13 +1306,6 @@ "lineNumber": 444 } }, - { - "plugin": "cases", - "link": { - "path": "x-pack/plugins/cases/server/plugin.ts", - "lineNumber": 89 - } - }, { "plugin": "ml", "link": { @@ -1321,52 +1314,52 @@ } }, { - "plugin": "securitySolution", + "plugin": "cases", "link": { - "path": "x-pack/plugins/security_solution/server/lib/detection_engine/routes/signals/create_signals_migration_route.ts", - "lineNumber": 48 + "path": "x-pack/plugins/cases/server/plugin.ts", + "lineNumber": 89 } }, { - "plugin": "securitySolution", + "plugin": "dashboardMode", "link": { - "path": "x-pack/plugins/security_solution/server/lib/detection_engine/routes/signals/delete_signals_migration_route.ts", - "lineNumber": 45 + "path": "x-pack/plugins/dashboard_mode/server/interceptors/dashboard_mode_request_interceptor.ts", + "lineNumber": 33 } }, { - "plugin": "securitySolution", + "plugin": "dataEnhanced", "link": { - "path": "x-pack/plugins/security_solution/server/lib/detection_engine/routes/signals/finalize_signals_migration_route.ts", - "lineNumber": 45 + "path": "x-pack/plugins/data_enhanced/server/search/session/session_service.ts", + "lineNumber": 448 } }, { - "plugin": "beatsManagement", + "plugin": "logstash", "link": { - "path": "x-pack/plugins/beats_management/server/lib/adapters/framework/kibana_framework_adapter.ts", - "lineNumber": 44 + "path": "x-pack/plugins/logstash/server/routes/pipeline/save.ts", + "lineNumber": 41 } }, { - "plugin": "dashboardMode", + "plugin": "securitySolution", "link": { - "path": "x-pack/plugins/dashboard_mode/server/interceptors/dashboard_mode_request_interceptor.ts", - "lineNumber": 33 + "path": "x-pack/plugins/security_solution/server/lib/detection_engine/routes/signals/create_signals_migration_route.ts", + "lineNumber": 48 } }, { - "plugin": "dataEnhanced", + "plugin": "securitySolution", "link": { - "path": "x-pack/plugins/data_enhanced/server/search/session/session_service.ts", - "lineNumber": 448 + "path": "x-pack/plugins/security_solution/server/lib/detection_engine/routes/signals/delete_signals_migration_route.ts", + "lineNumber": 45 } }, { - "plugin": "logstash", + "plugin": "securitySolution", "link": { - "path": "x-pack/plugins/logstash/server/routes/pipeline/save.ts", - "lineNumber": 41 + "path": "x-pack/plugins/security_solution/server/lib/detection_engine/routes/signals/finalize_signals_migration_route.ts", + "lineNumber": 45 } }, { diff --git a/api_docs/spaces.json b/api_docs/spaces.json index aa4e651b9477ba..5225e8cebbeb5a 100644 --- a/api_docs/spaces.json +++ b/api_docs/spaces.json @@ -1213,13 +1213,6 @@ "lineNumber": 271 } }, - { - "plugin": "securitySolution", - "link": { - "path": "x-pack/plugins/security_solution/server/plugin.ts", - "lineNumber": 194 - } - }, { "plugin": "apm", "link": { @@ -1248,6 +1241,13 @@ "lineNumber": 153 } }, + { + "plugin": "securitySolution", + "link": { + "path": "x-pack/plugins/security_solution/server/plugin.ts", + "lineNumber": 194 + } + }, { "plugin": "security", "link": { @@ -2047,13 +2047,6 @@ "lineNumber": 303 } }, - { - "plugin": "securitySolution", - "link": { - "path": "x-pack/plugins/security_solution/server/plugin.ts", - "lineNumber": 194 - } - }, { "plugin": "apm", "link": { @@ -2088,6 +2081,13 @@ "path": "x-pack/plugins/infra/server/plugin.ts", "lineNumber": 153 } + }, + { + "plugin": "securitySolution", + "link": { + "path": "x-pack/plugins/security_solution/server/plugin.ts", + "lineNumber": 194 + } } ] }, diff --git a/docs/developer/plugin-list.asciidoc b/docs/developer/plugin-list.asciidoc index 94384024e09357..087626240ff337 100644 --- a/docs/developer/plugin-list.asciidoc +++ b/docs/developer/plugin-list.asciidoc @@ -332,11 +332,6 @@ which will load the visualization's editor. |Allow to add a header banner that will be displayed on every page of the Kibana application -|{kib-repo}blob/{branch}/x-pack/plugins/beats_management/readme.md[beatsManagement] -|Notes: -Failure to have auth enabled in Kibana will make for a broken UI. UI-based errors not yet in place - - |{kib-repo}blob/{branch}/x-pack/plugins/canvas/README.md[canvas] |"Never look back. The past is done. The future is a blank canvas." ― Suzy Kassem, Rise Up and Salute the Sun diff --git a/docs/management/managing-beats.asciidoc b/docs/management/managing-beats.asciidoc deleted file mode 100644 index 232efb60cadd3e..00000000000000 --- a/docs/management/managing-beats.asciidoc +++ /dev/null @@ -1,108 +0,0 @@ -[[managing-beats]] -[role="xpack"] -== {beats} Central Management - -include::{asciidoc-dir}/../../shared/discontinued.asciidoc[tag=cm-discontinued] - -To use {beats} Central Management, open the main menu, click *Stack Management > -{beats} Central Management*, then define and -manage configurations in a central location in {kib} and quickly deploy -configuration changes to all {beats} running across your enterprise. For more -about central management, see the related {beats} documentation: - -* {filebeat-ref}/configuration-central-management.html[{filebeat} documentation] -* {metricbeat-ref}/configuration-central-management.html[{metricbeat} documentation] - -[NOTE] -==== -This feature requires an Elastic license that includes {beats} central -management. - -Don't have a license? You can start a 30-day trial. Open the main menu, then -click *Stack Management > License Management*. At the end of the trial -period, you can purchase a subscription to keep using central management. For -more information, see https://www.elastic.co/subscriptions and -<>. -==== - -{kib} makes it easy for you to use central management by walking you through the -enrollment and configuration process step by step the first time you use the -Central Management UI. - -[float] -=== Required permissions - -You must have the `beats_admin` role assigned to use **{beats} Central Management** - -To assign the role, open the menu, then click *Stack Management > Users*. - - -[float] -=== Enroll {beats} - -You need to enroll {beats} to register them in central management and establish -trust. Enrolled {beats} will have the credentials needed to retrieve -configurations from {kib}. - -[float] -=== Create configuration tags - -A _configuration tag_ is a group of configuration blocks that you can apply to -one or more {beats}. For example, you can create a tag called `development` to -group configurations for {beats} running in your development environment. - -The first time you walk through the enrollment process, you'll create a -configuration tag that's applied to the {beats} instance you're enrolling. - -After that, under *Configuration tags*, you can create additional tags and -apply them to any enrolled {beats}, and the {beats} will use the configurations -defined in the tag. - -[float] -=== Add configuration blocks - -Add one or more configuration blocks to the tag. A tag can have configuration -blocks for different types of {beats}. When the enrolled {beats} run, they will -use the configuration blocks that are valid for their type. - -Central management supports configuration settings for: - -* {filebeat} modules -* {metricbeat} modules -* {filebeat} inputs -* {filebeat} and {metricbeat} outputs - -NOTE: Central management supports the following outputs only: {es}, {ls}, Kafka, -and Redis. Other output types are not supported for {beats} that are enrolled in -central management. - -Use the Central Management UI to define and manage settings for supported -configuration blocks. You cannot define those settings in local {beats} -configuration files. For configuration blocks that are not supported by central -management, configure the settings in the local configuration file after -enrolling the Beat in central management. - -[float] -=== Manage enrolled {beats} - -Under *Enrolled {beats}*, you can view the list of enrolled {beats} to see -details, including the type, applied tags, configuration status, and the last -configuration update. Click the *Beat name* or *Type* column heading to sort the -list. To filter the list, enter a search string. If there are errors in a -configuration, you’ll see an Error status in the Central Management UI and need -to look at {beats} logs to troubleshoot the problem. - -You can add or remove tags, and the configuration changes are automatically -deployed to all {beats} that have the tag. Avoid applying tags with conflicting -configurations. Because the configurations for all assigned tags are merged, -conflicting configurations result in errors. - -You can unenroll {beats} to remove them from central management. - -[float] -=== Manage tags - -Under *Configuration tags*, you can select tags and delete them, or you can -drill down into a tag to add, modify, or remove configuration blocks from the -tag. When you change the configuration blocks or remove tags, the configuration -changes are automatically deployed to all {beats} that have the tag. diff --git a/docs/user/management.asciidoc b/docs/user/management.asciidoc index 397ab1717183b8..c5fabb15dc4de2 100644 --- a/docs/user/management.asciidoc +++ b/docs/user/management.asciidoc @@ -24,10 +24,6 @@ and enrichments on your data. | {logstash-ref}/logstash-centralized-pipeline-management.html[Logstash Pipelines] | Create, edit, and delete your Logstash pipeline configurations. -| <> -| Manage your Beats configurations in a central location and -quickly deploy configuration changes to all Beats running across your enterprise. - |=== @@ -182,8 +178,6 @@ next major version of {es}, and then reindex, if needed. include::{kib-repo-dir}/management/advanced-options.asciidoc[] -include::{kib-repo-dir}/management/managing-beats.asciidoc[] - include::{kib-repo-dir}/management/action-types.asciidoc[] include::{kib-repo-dir}/management/managing-licenses.asciidoc[] diff --git a/packages/kbn-optimizer/limits.yml b/packages/kbn-optimizer/limits.yml index 2e76c26dd7b389..c28fd835919602 100644 --- a/packages/kbn-optimizer/limits.yml +++ b/packages/kbn-optimizer/limits.yml @@ -3,7 +3,6 @@ pageLoadAssetSize: alerting: 106936 apm: 64385 apmOss: 18996 - beatsManagement: 188135 bfetch: 41874 canvas: 1066647 charts: 195358 diff --git a/tsconfig.json b/tsconfig.json index ceb03107076c2f..37fc9ee05a29b0 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -73,7 +73,6 @@ { "path": "./x-pack/plugins/actions/tsconfig.json" }, { "path": "./x-pack/plugins/alerting/tsconfig.json" }, { "path": "./x-pack/plugins/apm/tsconfig.json" }, - { "path": "./x-pack/plugins/beats_management/tsconfig.json" }, { "path": "./x-pack/plugins/canvas/tsconfig.json" }, { "path": "./x-pack/plugins/cases/tsconfig.json" }, { "path": "./x-pack/plugins/cloud/tsconfig.json" }, diff --git a/tsconfig.refs.json b/tsconfig.refs.json index 7343165e4a4ad9..1b8a76d601e38c 100644 --- a/tsconfig.refs.json +++ b/tsconfig.refs.json @@ -58,7 +58,6 @@ { "path": "./x-pack/plugins/actions/tsconfig.json" }, { "path": "./x-pack/plugins/alerting/tsconfig.json" }, { "path": "./x-pack/plugins/apm/tsconfig.json" }, - { "path": "./x-pack/plugins/beats_management/tsconfig.json" }, { "path": "./x-pack/plugins/canvas/tsconfig.json" }, { "path": "./x-pack/plugins/cases/tsconfig.json" }, { "path": "./x-pack/plugins/cloud/tsconfig.json" }, diff --git a/x-pack/.i18nrc.json b/x-pack/.i18nrc.json index 2db2f31ae09c3d..b2c3a36ae34144 100644 --- a/x-pack/.i18nrc.json +++ b/x-pack/.i18nrc.json @@ -7,7 +7,6 @@ "xpack.eventLog": "plugins/event_log", "xpack.stackAlerts": "plugins/stack_alerts", "xpack.apm": "plugins/apm", - "xpack.beatsManagement": "plugins/beats_management", "xpack.canvas": "plugins/canvas", "xpack.cases": "plugins/cases", "xpack.cloud": "plugins/cloud", diff --git a/x-pack/plugins/beats_management/common/config_schemas.ts b/x-pack/plugins/beats_management/common/config_schemas.ts deleted file mode 100644 index 95330655a77967..00000000000000 --- a/x-pack/plugins/beats_management/common/config_schemas.ts +++ /dev/null @@ -1,384 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -// Note: importing this is a temp thing. This file will be replaced with JSON from Beats/ES at some point -import { ConfigBlockSchema } from './domain_types'; - -export const configBlockSchemas: ConfigBlockSchema[] = [ - { - id: 'filebeat.inputs', - name: 'Filebeat Input', - version: 6.7, - allowOtherConfigs: true, - configs: [ - { - id: 'paths', - ui: { - label: 'Paths', - labelId: 'filebeatInputConfig.paths.ui.label', - type: 'multi-input', - helpText: 'filebeatInputConfig.paths.ui.helpText', - helpTextId: 'filebeatInputConfig.paths.ui.helpText', - placeholder: `first/path/to/file.json second/path/to/otherfile.json`, - }, - validation: 'isPaths', - error: 'filebeatInputConfig.paths.error', - errorId: 'filebeatInputConfig.paths.error', - required: true, - }, - ], - }, - { - id: 'filebeat.modules', - name: 'Filebeat Modules', - version: 6.7, - allowOtherConfigs: true, - configs: [ - { - id: '_sub_type', - ui: { - label: 'filebeatModuleConfig.module.ui.label', - labelId: 'filebeatModuleConfig.module.ui.label', - type: 'select', - }, - options: [ - { - value: 'apache2', - text: 'apache2', - }, - { - value: 'auditd', - text: 'auditd', - }, - { - value: 'elasticsearch', - text: 'elasticsearch', - }, - { - value: 'haproxy', - text: 'haproxy', - }, - { - value: 'icinga', - text: 'icinga', - }, - { - value: 'iis', - text: 'iis', - }, - { - value: 'kafka', - text: 'kafka', - }, - { - value: 'kibana', - text: 'kibana', - }, - { - value: 'logstash', - text: 'logstash', - }, - { - value: 'mongodb', - text: 'mongodb', - }, - { - value: 'mysql', - text: 'mysql', - }, - { - value: 'nginx', - text: 'nginx', - }, - { - value: 'osquery', - text: 'osquery', - }, - { - value: 'postgresql', - text: 'postgresql', - }, - { - value: 'redis', - text: 'redis', - }, - { - value: 'system', - text: 'system', - }, - { - value: 'traefik', - text: 'traefik', - }, - ], - error: 'filebeatModuleConfig.module.error', - errorId: 'filebeatModuleConfig.module.error', - required: true, - }, - ], - }, - { - id: 'metricbeat.modules', - name: 'Metricbeat Modules', - version: 6.7, - allowOtherConfigs: true, - configs: [ - { - id: '_sub_type', - ui: { - label: 'metricbeatModuleConfig.module.ui.label', - labelId: 'metricbeatModuleConfig.module.ui.label', - type: 'select', - }, - options: [ - { - value: 'aerospike', - text: 'aerospike', - }, - { - value: 'apache', - text: 'apache', - }, - { - value: 'ceph', - text: 'ceph', - }, - { - value: 'couchbase', - text: 'couchbase', - }, - { - value: 'docker', - text: 'docker', - }, - { - value: 'dropwizard', - text: 'dropwizard', - }, - { - value: 'elasticsearch', - text: 'elasticsearch', - }, - { - value: 'envoyproxy', - text: 'envoyproxy', - }, - { - value: 'etcd', - text: 'etcd', - }, - { - value: 'golang', - text: 'golang', - }, - { - value: 'graphite', - text: 'graphite', - }, - { - value: 'haproxy', - text: 'haproxy', - }, - { - value: 'http', - text: 'http', - }, - { - value: 'jolokia', - text: 'jolokia', - }, - { - value: 'kafka', - text: 'kafka', - }, - { - value: 'kibana', - text: 'kibana', - }, - { - value: 'kubernetes', - text: 'kubernetes', - }, - { - value: 'kvm', - text: 'kvm', - }, - { - value: 'logstash', - text: 'logstash', - }, - { - value: 'memcached', - text: 'memcached', - }, - { - value: 'mongodb', - text: 'mongodb', - }, - { - value: 'munin', - text: 'munin', - }, - { - value: 'mysql', - text: 'mysql', - }, - { - value: 'nginx', - text: 'nginx', - }, - { - value: 'php_fpm', - text: 'php_fpm', - }, - { - value: 'postgresql', - text: 'postgresql', - }, - { - value: 'prometheus', - text: 'prometheus', - }, - { - value: 'rabbitmq', - text: 'rabbitmq', - }, - { - value: 'redis', - text: 'redis', - }, - { - value: 'system', - text: 'system', - }, - { - value: 'traefik', - text: 'traefik', - }, - { - value: 'uwsgi', - text: 'uwsgi', - }, - { - value: 'vsphere', - text: 'vsphere', - }, - { - value: 'windows', - text: 'windows', - }, - { - value: 'zookeeper', - text: 'zookeeper', - }, - ], - error: 'metricbeatModuleConfig.module.error', - errorId: 'metricbeatModuleConfig.module.error', - required: true, - }, - { - id: 'hosts', - ui: { - label: 'metricbeatModuleConfig.hosts.ui.label', - labelId: 'metricbeatModuleConfig.hosts.ui.label', - type: 'multi-input', - helpText: 'metricbeatModuleConfig.hosts.ui.helpText', - helpTextId: 'metricbeatModuleConfig.hosts.ui.helpText', - placeholder: `somehost.local otherhost.local`, - }, - validation: 'isHosts', - error: 'metricbeatModuleConfig.hosts.error', - errorId: 'metricbeatModuleConfig.hosts.error', - required: false, - }, - { - id: 'period', - ui: { - label: 'metricbeatModuleConfig.period.ui.label', - labelId: 'metricbeatModuleConfig.period.ui.label', - type: 'input', - }, - defaultValue: '10s', - validation: 'isPeriod', - error: 'metricbeatModuleConfig.period.error', - errorId: 'metricbeatModuleConfig.period.error', - required: true, - }, - ], - }, - { - id: 'output', - name: 'Outputs', - allowOtherConfigs: true, - version: 6.7, - configs: [ - { - id: '_sub_type', - ui: { - label: 'outputConfig.output.ui.label', - labelId: 'outputConfig.output.ui.label', - type: 'select', - }, - options: [ - { - value: 'elasticsearch', - text: 'Elasticsearch', - }, - { - value: 'logstash', - text: 'Logstash', - }, - { - value: 'kafka', - text: 'Kafka', - }, - { - value: 'redis', - text: 'Redis', - }, - ], - error: 'outputConfig.output.error', - errorId: 'outputConfig.output.error', - required: true, - }, - { - id: 'hosts', - ui: { - label: 'outputConfig.hosts.ui.label', - labelId: 'outputConfig.hosts.ui.label', - type: 'multi-input', - }, - validation: 'isHosts', - error: 'outputConfig.hosts.error', - errorId: 'outputConfig.hosts.error', - parseValidResult: (v) => v.split('\n'), - }, - { - id: 'username', - ui: { - label: 'outputConfig.username.ui.label', - labelId: 'outputConfig.username.ui.label', - type: 'input', - }, - validation: 'isString', - error: 'outputConfig.username.error', - errorId: 'outputConfig.username.error', - }, - { - id: 'password', - ui: { - label: 'outputConfig.password.ui.label', - labelId: 'outputConfig.password.ui.label', - type: 'password', - }, - validation: 'isString', - error: 'outputConfig.password.error', - errorId: 'outputConfig.password.error', - }, - ], - }, -]; diff --git a/x-pack/plugins/beats_management/common/config_schemas_translations_map.ts b/x-pack/plugins/beats_management/common/config_schemas_translations_map.ts deleted file mode 100644 index ca2d48998ee062..00000000000000 --- a/x-pack/plugins/beats_management/common/config_schemas_translations_map.ts +++ /dev/null @@ -1,243 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { i18n } from '@kbn/i18n'; -import { ConfigBlockSchema } from './domain_types'; - -const supportedConfigLabelsMap = new Map([ - [ - 'filebeatInputConfig.paths.ui.label', - i18n.translate('xpack.beatsManagement.filebeatInputConfig.pathsLabel', { - defaultMessage: 'Paths', - }), - ], - [ - 'filebeatInputConfig.paths.ui.helpText', - i18n.translate('xpack.beatsManagement.filebeatInputConfig.pathsDescription', { - defaultMessage: 'Put each of the paths on a separate line', - }), - ], - [ - 'filebeatInputConfig.paths.error', - i18n.translate('xpack.beatsManagement.filebeatInputConfig.pathsErrorMessage', { - defaultMessage: 'One file path per line', - }), - ], - [ - 'filebeatInputConfig.other.ui.label', - i18n.translate('xpack.beatsManagement.filebeatInputConfig.otherConfigLabel', { - defaultMessage: 'Other Config', - }), - ], - [ - 'filebeatInputConfig.other.ui.helpText', - i18n.translate('xpack.beatsManagement.filebeatInputConfig.otherConfigDescription', { - defaultMessage: 'Use YAML format to specify other settings for the Filebeat Input', - }), - ], - [ - 'filebeatInputConfig.other.error', - i18n.translate('xpack.beatsManagement.filebeatInputConfig.otherConfigErrorMessage', { - defaultMessage: 'Use valid YAML format', - }), - ], - [ - 'filebeatModuleConfig.module.ui.label', - i18n.translate('xpack.beatsManagement.filebeatModuleConfig.moduleLabel', { - defaultMessage: 'Module', - }), - ], - [ - 'filebeatModuleConfig.module.error', - i18n.translate('xpack.beatsManagement.filebeatModuleConfig.moduleErrorMessage', { - defaultMessage: 'Please select a module', - }), - ], - [ - 'filebeatModuleConfig.other.ui.label', - i18n.translate('xpack.beatsManagement.filebeatModuleConfig.otherConfigLabel', { - defaultMessage: 'Other Config', - }), - ], - [ - 'filebeatModuleConfig.other.ui.helpText', - i18n.translate('xpack.beatsManagement.filebeatModuleConfig.moduleDescription', { - defaultMessage: 'Use YAML format to specify other settings for the Filebeat Module', - }), - ], - [ - 'filebeatModuleConfig.other.error', - i18n.translate('xpack.beatsManagement.filebeatModuleConfig.otherConfigErrorMessage', { - defaultMessage: 'Use valid YAML format', - }), - ], - - [ - 'metricbeatModuleConfig.module.ui.label', - i18n.translate('xpack.beatsManagement.metricbeatModuleConfig.moduleLabel', { - defaultMessage: 'Module', - }), - ], - [ - 'metricbeatModuleConfig.module.error', - i18n.translate('xpack.beatsManagement.metricbeatModuleConfig.moduleErrorMessage', { - defaultMessage: 'Please select a module', - }), - ], - [ - 'metricbeatModuleConfig.hosts.ui.label', - i18n.translate('xpack.beatsManagement.metricbeatModuleConfig.hostsLabel', { - defaultMessage: 'Hosts', - }), - ], - [ - 'metricbeatModuleConfig.hosts.ui.helpText', - i18n.translate('xpack.beatsManagement.metricbeatModuleConfig.hostsDescription', { - defaultMessage: 'Put each of the paths on a seperate line', - }), - ], - [ - 'metricbeatModuleConfig.hosts.error', - i18n.translate('xpack.beatsManagement.metricbeatModuleConfig.hostsErrorMessage', { - defaultMessage: 'One file host per line', - }), - ], - [ - 'metricbeatModuleConfig.period.ui.label', - i18n.translate('xpack.beatsManagement.metricbeatModuleConfig.periodLabel', { - defaultMessage: 'Period', - }), - ], - [ - 'metricbeatModuleConfig.period.error', - i18n.translate('xpack.beatsManagement.metricbeatModuleConfig.periodErrorMessage', { - defaultMessage: 'Invalid Period, must be formatted as `10s` for 10 seconds', - }), - ], - [ - 'metricbeatModuleConfig.other.ui.label', - i18n.translate('xpack.beatsManagement.metricbeatModuleConfig.otherConfigLabel', { - defaultMessage: 'Other Config', - }), - ], - [ - 'metricbeatModuleConfig.other.ui.helpText', - i18n.translate('xpack.beatsManagement.metricbeatModuleConfig.otherConfigDescription', { - defaultMessage: 'Use YAML format to specify other settings for the Metricbeat Module', - }), - ], - [ - 'metricbeatModuleConfig.other.error', - i18n.translate('xpack.beatsManagement.metricbeatModuleConfig.otherConfigErrorMessage', { - defaultMessage: 'Use valid YAML format', - }), - ], - - [ - 'outputConfig.output.ui.label', - i18n.translate('xpack.beatsManagement.outputConfig.outputTypeLabel', { - defaultMessage: 'Output Type', - }), - ], - [ - 'outputConfig.output.error', - i18n.translate('xpack.beatsManagement.outputConfig.outputTypeErrorMessage', { - defaultMessage: 'Please select an output type', - }), - ], - [ - 'outputConfig.hosts.ui.label', - i18n.translate('xpack.beatsManagement.outputConfig.hostsLabel', { - defaultMessage: 'Hosts', - }), - ], - [ - 'outputConfig.hosts.error', - i18n.translate('xpack.beatsManagement.outputConfig.hostsErrorMessage', { - defaultMessage: 'One file host per line', - }), - ], - [ - 'outputConfig.username.ui.label', - i18n.translate('xpack.beatsManagement.outputConfig.usernameLabel', { - defaultMessage: 'Username', - }), - ], - [ - 'outputConfig.username.error', - i18n.translate('xpack.beatsManagement.outputConfig.usernameErrorMessage', { - defaultMessage: 'Unprocessable username', - }), - ], - [ - 'outputConfig.password.ui.label', - i18n.translate('xpack.beatsManagement.outputConfig.passwordLabel', { - defaultMessage: 'Password', - }), - ], - [ - 'outputConfig.password.error', - i18n.translate('xpack.beatsManagement.outputConfig.passwordErrorMessage', { - defaultMessage: 'Unprocessable password', - }), - ], - - [ - 'supportedConfigs.filebeat.input.text', - i18n.translate('xpack.beatsManagement.tagConfig.filebeatInputLabel', { - defaultMessage: 'Filebeat Input', - }), - ], - [ - 'supportedConfigs.filebeat.modules.text', - i18n.translate('xpack.beatsManagement.tagConfig.filebeatModuleLabel', { - defaultMessage: 'Filebeat Module', - }), - ], - [ - 'supportedConfigs.metricbeatModule.text', - i18n.translate('xpack.beatsManagement.tagConfig.metricbeatModuleLabel', { - defaultMessage: 'Metricbeat Module', - }), - ], - [ - 'supportedConfigs.output.text', - i18n.translate('xpack.beatsManagement.tagConfig.outputLabel', { - defaultMessage: 'Output', - }), - ], -]); - -export let translatedConfigs: ConfigBlockSchema[]; -export const translateConfigSchema = (schemas: ConfigBlockSchema[]) => { - if (translatedConfigs) { - return translatedConfigs; - } - - translatedConfigs = schemas.map((schema) => { - schema.name = supportedConfigLabelsMap.get(`supportedConfigs.${schema.id}.text`) || schema.name; - - schema.configs = schema.configs.map((configBlock) => { - if (configBlock.ui.label) { - configBlock.ui.label = - supportedConfigLabelsMap.get(configBlock.ui.labelId || '') || configBlock.ui.label; - } - if (configBlock.ui.helpText) { - configBlock.ui.helpText = - supportedConfigLabelsMap.get(configBlock.ui.helpTextId || '') || configBlock.ui.helpText; - } - if (configBlock.error) { - configBlock.error = - supportedConfigLabelsMap.get(configBlock.errorId || '') || configBlock.error; - } - return configBlock; - }); - return schema; - }); - - return translatedConfigs; -}; diff --git a/x-pack/plugins/beats_management/common/constants/configuration_blocks.ts b/x-pack/plugins/beats_management/common/constants/configuration_blocks.ts deleted file mode 100644 index 7f0a1442a374ef..00000000000000 --- a/x-pack/plugins/beats_management/common/constants/configuration_blocks.ts +++ /dev/null @@ -1,8 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -export const UNIQUENESS_ENFORCING_TYPES = ['output']; diff --git a/x-pack/plugins/beats_management/common/constants/index.ts b/x-pack/plugins/beats_management/common/constants/index.ts deleted file mode 100644 index ac4f89b639c22a..00000000000000 --- a/x-pack/plugins/beats_management/common/constants/index.ts +++ /dev/null @@ -1,13 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -export { UNIQUENESS_ENFORCING_TYPES } from './configuration_blocks'; -export { INDEX_NAMES } from './index_names'; -export { PLUGIN, MANAGEMENT_SECTION } from './plugin'; -export { LICENSES, REQUIRED_LICENSES, REQUIRED_ROLES } from './security'; -export { TABLE_CONFIG } from './table'; -export const BASE_PATH = '/management/ingest/beats_management'; diff --git a/x-pack/plugins/beats_management/common/constants/index_names.ts b/x-pack/plugins/beats_management/common/constants/index_names.ts deleted file mode 100644 index f0a00c5ca28913..00000000000000 --- a/x-pack/plugins/beats_management/common/constants/index_names.ts +++ /dev/null @@ -1,16 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -export const INDEX_NAMES = { - BEATS: '.management-beats', - EVENTS: '.management-beats-events-*', - EVENTS_ALIAS: '.management-beats-events', -}; - -export const POLICY_NAMES = { - EVENTS: '.beats-management-events-retention', -}; diff --git a/x-pack/plugins/beats_management/common/constants/plugin.ts b/x-pack/plugins/beats_management/common/constants/plugin.ts deleted file mode 100644 index 912bc75b98f601..00000000000000 --- a/x-pack/plugins/beats_management/common/constants/plugin.ts +++ /dev/null @@ -1,12 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -export const PLUGIN = { - ID: 'beats_management', -}; -export const CONFIG_PREFIX = 'xpack.beats'; -export const MANAGEMENT_SECTION = 'beats_management'; diff --git a/x-pack/plugins/beats_management/common/constants/security.ts b/x-pack/plugins/beats_management/common/constants/security.ts deleted file mode 100644 index af4ef129f54b40..00000000000000 --- a/x-pack/plugins/beats_management/common/constants/security.ts +++ /dev/null @@ -1,18 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -export const REQUIRED_ROLES = ['beats_admin']; -export const REQUIRED_LICENSES = ['standard', 'gold', 'trial', 'platinum', 'enterprise']; -export const LICENSES = ['oss', 'basic', 'standard', 'gold', 'trial', 'platinum', 'enterprise']; -export type LicenseType = - | 'oss' - | 'basic' - | 'trial' - | 'standard' - | 'gold' - | 'platinum' - | 'enterprise'; diff --git a/x-pack/plugins/beats_management/common/constants/table.ts b/x-pack/plugins/beats_management/common/constants/table.ts deleted file mode 100644 index 54751c29cd35a6..00000000000000 --- a/x-pack/plugins/beats_management/common/constants/table.ts +++ /dev/null @@ -1,13 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -export const TABLE_CONFIG = { - INITIAL_ROW_SIZE: 5, - PAGE_SIZE_OPTIONS: [3, 5, 10, 20], - TRUNCATE_TAG_LENGTH: 33, - TRUNCATE_TAG_LENGTH_SMALL: 20, -}; diff --git a/x-pack/plugins/beats_management/common/domain_types.ts b/x-pack/plugins/beats_management/common/domain_types.ts deleted file mode 100644 index f7efb77f0dc395..00000000000000 --- a/x-pack/plugins/beats_management/common/domain_types.ts +++ /dev/null @@ -1,136 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import * as t from 'io-ts'; -import { configBlockSchemas } from './config_schemas'; -import { DateFromString } from './io_ts_types'; - -// Here we create the runtime check for a generic, unknown beat config type. -// We can also pass in optional params to create spacific runtime checks that -// can be used to validate blocs on the API and UI -export const createConfigurationBlockInterface = ( - configType: t.LiteralType | t.KeyofC> = t.keyof( - Object.fromEntries(configBlockSchemas.map((s) => [s.id, null])) as Record - ), - beatConfigInterface: t.Mixed = t.Dictionary -) => - t.interface( - { - id: t.union([t.undefined, t.string]), - type: configType, - description: t.union([t.undefined, t.string]), - tag: t.string, - config: beatConfigInterface, - last_updated: t.union([t.undefined, t.number]), - }, - 'ConfigBlock' - ); -const BaseConfigurationBlock = createConfigurationBlockInterface(); -export interface ConfigurationBlock - extends Pick< - t.TypeOf, - Exclude, 'id'> - > { - id: string; -} - -export interface CMBeat { - id: string; - status?: BeatEvent; - enrollment_token: string; - active: boolean; - access_token?: string; - verified_on?: string; - type: string; - version?: string; - host_ip: string; - host_name: string; - ephemeral_id?: string; - last_checkin?: Date; - event_rate?: string; - local_configuration_yml?: string; - tags: string[]; - central_configuration_yml?: string; - metadata?: {}; - name?: string; - last_updated: number; -} - -export interface ConfigBlockSchema { - id: string; - name: string; - version: number; - allowOtherConfigs?: boolean; - configs: BeatConfigSchema[]; -} - -export interface BeatConfigSchema { - id: string; - ui: { - label: string; - labelId?: string; - type: 'input' | 'multi-input' | 'select' | 'code' | 'password'; - helpText?: string; - helpTextId?: string; - placeholder?: string; - }; - options?: Array<{ value: string; text: string }>; - validation?: 'isHosts' | 'isString' | 'isPeriod' | 'isPath' | 'isPaths' | 'isYaml'; - error: string; - errorId: string; - defaultValue?: string; - required?: boolean; - parseValidResult?: (value: any) => any; -} - -export const RuntimeBeatTag = t.interface( - { - id: t.union([t.undefined, t.string]), - name: t.string, - color: t.string, - hasConfigurationBlocksTypes: t.array(t.string), - }, - 'CMBeat' -); -export interface BeatTag - extends Pick< - t.TypeOf, - Exclude, 'id'> - > { - id: string; - // Used by the UI and api when a tag exists but is an invalid option - disabled?: boolean; -} - -export const RuntimeBeatEvent = t.interface( - { - type: t.union([t.literal('STATE'), t.literal('ERROR')]), - beat: t.union([t.undefined, t.string]), - timestamp: DateFromString, - event: t.type({ - type: t.union([ - t.literal('RUNNING'), - t.literal('STARTING'), - t.literal('IN_PROGRESS'), - t.literal('CONFIG'), - t.literal('FAILED'), - t.literal('STOPPED'), - ]), - message: t.string, - uuid: t.union([t.undefined, t.string]), - }), - }, - 'BeatEvent' -); -export interface BeatEvent - extends Pick< - t.TypeOf, - Exclude, 'timestamp'> - > { - beat: string; - timestamp: Date; -} diff --git a/x-pack/plugins/beats_management/common/index.ts b/x-pack/plugins/beats_management/common/index.ts deleted file mode 100644 index a7dde2298054fb..00000000000000 --- a/x-pack/plugins/beats_management/common/index.ts +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { schema, TypeOf } from '@kbn/config-schema'; - -const DEFAULT_ENROLLMENT_TOKENS_TTL_S = 10 * 60; // 10 minutes - -export const beatsManagementConfigSchema = schema.object({ - enabled: schema.boolean({ defaultValue: true }), - defaultUserRoles: schema.arrayOf(schema.string(), { defaultValue: ['superuser'] }), - encryptionKey: schema.string({ defaultValue: 'xpack_beats_default_encryptionKey' }), - enrollmentTokensTtlInSeconds: schema.number({ - min: 1, - max: 10 * 60 * 14, // No more then 2 weeks for security reasons, - defaultValue: DEFAULT_ENROLLMENT_TOKENS_TTL_S, - }), -}); - -export type BeatsManagementConfigType = TypeOf; diff --git a/x-pack/plugins/beats_management/common/io_ts_types.ts b/x-pack/plugins/beats_management/common/io_ts_types.ts deleted file mode 100644 index b1abd3d8b6b3bb..00000000000000 --- a/x-pack/plugins/beats_management/common/io_ts_types.ts +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import * as t from 'io-ts'; -import { isRight } from 'fp-ts/lib/Either'; - -class DateFromStringType extends t.Type { - public readonly _tag: 'DateFromISOStringType' = 'DateFromISOStringType'; - constructor() { - super( - 'DateFromString', - (u): u is Date => u instanceof Date, - (u, c) => { - const validation = t.string.validate(u, c); - if (!isRight(validation)) { - return validation as any; - } else { - const s = validation.right; - const d = new Date(s); - return isNaN(d.getTime()) ? t.failure(s, c) : t.success(d); - } - }, - (a) => a.toISOString() - ); - } -} -// eslint-disable-next-line -export interface DateFromString extends DateFromStringType {} - -export const DateFromString: DateFromString = new DateFromStringType(); diff --git a/x-pack/plugins/beats_management/common/return_types.ts b/x-pack/plugins/beats_management/common/return_types.ts deleted file mode 100644 index c498038d6a21da..00000000000000 --- a/x-pack/plugins/beats_management/common/return_types.ts +++ /dev/null @@ -1,106 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -export interface BaseReturnType { - error?: { - message: string; - code?: number; - }; - success: boolean; -} - -export interface ReturnTypeCreate extends BaseReturnType { - item: T; - action: 'created'; -} - -export interface ReturnTypeUpdate extends BaseReturnType { - item: T; - action: 'updated'; -} - -export interface ReturnTypeBulkCreate extends BaseReturnType { - results: Array<{ - item: T; - success: boolean; - action: 'created'; - error?: { - message: string; - code?: number; - }; - }>; -} - -export interface ReturnTypeBulkDelete extends BaseReturnType { - results: Array<{ - success: boolean; - action: 'deleted'; - error?: { - message: string; - code?: number; - }; - }>; -} - -// upsert -export interface ReturnTypeUpsert extends BaseReturnType { - item: T; - action: 'created' | 'updated'; -} - -// upsert bulk -export interface ReturnTypeBulkUpsert extends BaseReturnType { - results: Array<{ - success: boolean; - action: 'created' | 'updated'; - error?: { - message: string; - code?: number; - }; - }>; -} - -// list -export interface ReturnTypeList extends BaseReturnType { - list: T[]; - page: number; - total: number; -} - -// get -export interface ReturnTypeGet extends BaseReturnType { - item: T; -} - -export interface ReturnTypeBulkGet extends BaseReturnType { - items: T[]; -} - -// e.g. -// { -// result: { -// username: { valid: true }, -// password: { valid: false, error: 'something' }, -// hosts: [ -// { valid: false }, { valid: true }, -// ] -// } -// } - -// bulk action -- e.g. assign tags to beats -export interface ReturnTypeBulkAction extends BaseReturnType { - results?: Array<{ - success: boolean; - result?: { - [key: string]: any; - }; - error?: { - message: string; - code?: number; - }; - }>; -} diff --git a/x-pack/plugins/beats_management/jest.config.js b/x-pack/plugins/beats_management/jest.config.js deleted file mode 100644 index be070350450038..00000000000000 --- a/x-pack/plugins/beats_management/jest.config.js +++ /dev/null @@ -1,12 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -module.exports = { - preset: '@kbn/test', - rootDir: '../../..', - roots: ['/x-pack/plugins/beats_management'], -}; diff --git a/x-pack/plugins/beats_management/kibana.json b/x-pack/plugins/beats_management/kibana.json deleted file mode 100644 index c1070eedf07a62..00000000000000 --- a/x-pack/plugins/beats_management/kibana.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "id": "beatsManagement", - "configPath": ["xpack", "beats_management"], - "ui": true, - "server": true, - "version": "kibana", - "requiredPlugins": [ - "data", - "licensing", - "management", - "features" - ], - "optionalPlugins": [ - "security" - ] -} diff --git a/x-pack/plugins/beats_management/public/application.tsx b/x-pack/plugins/beats_management/public/application.tsx deleted file mode 100644 index 5a9b0a768856ed..00000000000000 --- a/x-pack/plugins/beats_management/public/application.tsx +++ /dev/null @@ -1,89 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import * as euiVars from '@elastic/eui/dist/eui_theme_light.json'; -import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; -import React from 'react'; -import ReactDOM from 'react-dom'; -import { Router } from 'react-router-dom'; -import { ThemeProvider } from 'styled-components'; -import { Provider as UnstatedProvider, Subscribe } from 'unstated'; -import { EuiCallOut, EuiLink, EuiSpacer } from '@elastic/eui'; -import { Background } from './components/layouts/background'; -import { BreadcrumbProvider } from './components/navigation/breadcrumb'; -import { Breadcrumb } from './components/navigation/breadcrumb/breadcrumb'; -import { BeatsContainer } from './containers/beats'; -import { TagsContainer } from './containers/tags'; -import { FrontendLibs } from './lib/types'; -import { AppRouter } from './router'; -import { services } from './kbn_services'; -import { ManagementAppMountParams } from '../../../../src/plugins/management/public'; - -export const renderApp = ({ element, history }: ManagementAppMountParams, libs: FrontendLibs) => { - ReactDOM.render( - - - - - - - {(beats: BeatsContainer, tags: TagsContainer) => ( - - - -

- - - - ), - }} - /> -

-
- - -
- )} -
-
-
-
-
-
, - element - ); - - return () => { - ReactDOM.unmountComponentAtNode(element); - }; -}; diff --git a/x-pack/plugins/beats_management/public/bootstrap.tsx b/x-pack/plugins/beats_management/public/bootstrap.tsx deleted file mode 100644 index b5bdd39fa0817e..00000000000000 --- a/x-pack/plugins/beats_management/public/bootstrap.tsx +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { FrontendLibs } from './lib/types'; -import { compose } from './lib/compose/kibana'; - -import { setServices } from './kbn_services'; -import { ManagementSetup } from '../../../../src/plugins/management/public'; -import { SecurityPluginSetup } from '../../security/public'; -import { CoreSetup } from '../../../../src/core/public'; -import { DataPublicPluginStart } from '../../../../src/plugins/data/public'; -import { LicensingPluginSetup } from '../../licensing/public'; -import { BeatsManagementConfigType } from '../common'; -import { MANAGEMENT_SECTION } from '../common/constants'; - -async function startApp(libs: FrontendLibs, core: CoreSetup) { - const startServices = await core.getStartServices(); - - if (startServices[0].http.anonymousPaths.isAnonymous(window.location.pathname)) { - return; - } - // Can't run until the `start` lifecycle, so we wait for start services to resolve above before calling this. - await libs.framework.waitUntilFrameworkReady(); - - const capabilities = startServices[0].application.capabilities; - const hasBeatsCapability = capabilities.management.ingest?.[MANAGEMENT_SECTION] ?? false; - - if (libs.framework.licenseIsAtLeast('standard') && hasBeatsCapability) { - const mount = async (params: any) => { - const [coreStart, pluginsStart] = await core.getStartServices(); - setServices(coreStart, pluginsStart, params); - const { renderApp } = await import('./application'); - return renderApp(params, libs); - }; - - libs.framework.registerManagementUI(mount); - } -} - -interface SetupDeps { - management: ManagementSetup; - licensing: LicensingPluginSetup; - security?: SecurityPluginSetup; -} - -interface StartDeps { - data: DataPublicPluginStart; -} - -export const bootstrap = ( - core: CoreSetup, - plugins: SetupDeps, - config: BeatsManagementConfigType, - version: string -) => { - startApp( - compose({ - core, - config, - version, - ...plugins, - }), - core - ); -}; diff --git a/x-pack/plugins/beats_management/public/components/autocomplete_field/index.tsx b/x-pack/plugins/beats_management/public/components/autocomplete_field/index.tsx deleted file mode 100644 index 320296274e262b..00000000000000 --- a/x-pack/plugins/beats_management/public/components/autocomplete_field/index.tsx +++ /dev/null @@ -1,290 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { - EuiFieldSearch, - EuiFieldSearchProps, - EuiOutsideClickDetector, - EuiPanel, -} from '@elastic/eui'; -import React from 'react'; -import styled from 'styled-components'; - -import { QuerySuggestion } from '../../../../../../src/plugins/data/public'; - -import { composeStateUpdaters } from '../../utils/typed_react'; -import { SuggestionItem } from './suggestion_item'; - -interface AutocompleteFieldProps { - isLoadingSuggestions: boolean; - isValid: boolean; - loadSuggestions: (value: string, cursorPosition: number, maxCount?: number) => void; - onSubmit?: (value: string) => void; - onChange?: (value: string) => void; - placeholder?: string; - suggestions: QuerySuggestion[]; - value: string; -} - -interface AutocompleteFieldState { - areSuggestionsVisible: boolean; - selectedIndex: number | null; -} - -export class AutocompleteField extends React.Component< - AutocompleteFieldProps, - AutocompleteFieldState -> { - public readonly state: AutocompleteFieldState = { - areSuggestionsVisible: false, - selectedIndex: null, - }; - - private inputElement: HTMLInputElement | null = null; - - public render() { - const { suggestions, isLoadingSuggestions, isValid, placeholder, value } = this.props; - const { areSuggestionsVisible, selectedIndex } = this.state; - - return ( - - - - {areSuggestionsVisible && !isLoadingSuggestions && suggestions.length > 0 ? ( - - {suggestions.map((suggestion, suggestionIndex) => ( - - ))} - - ) : null} - - - ); - } - - public componentDidUpdate(prevProps: AutocompleteFieldProps, prevState: AutocompleteFieldState) { - const hasNewSuggestions = prevProps.suggestions !== this.props.suggestions; - const hasNewValue = prevProps.value !== this.props.value; - - if (hasNewValue) { - this.updateSuggestions(); - } - - if (hasNewSuggestions) { - this.showSuggestions(); - } - } - - private handleChangeInputRef = (element: HTMLInputElement | null) => { - this.inputElement = element; - }; - - private handleChange = (evt: React.ChangeEvent) => { - this.changeValue(evt.currentTarget.value); - }; - - private handleKeyDown = (evt: React.KeyboardEvent) => { - const { suggestions } = this.props; - - switch (evt.key) { - case 'ArrowUp': - evt.preventDefault(); - if (suggestions.length > 0) { - this.setState( - composeStateUpdaters(withSuggestionsVisible, withPreviousSuggestionSelected) - ); - } - break; - case 'ArrowDown': - evt.preventDefault(); - if (suggestions.length > 0) { - this.setState(composeStateUpdaters(withSuggestionsVisible, withNextSuggestionSelected)); - } else { - this.updateSuggestions(); - } - break; - case 'Enter': - evt.preventDefault(); - if (this.state.selectedIndex !== null) { - this.applySelectedSuggestion(); - } else { - this.submit(); - } - break; - case 'Escape': - evt.preventDefault(); - this.setState(withSuggestionsHidden); - break; - } - }; - - private handleKeyUp = (evt: React.KeyboardEvent) => { - switch (evt.key) { - case 'ArrowLeft': - case 'ArrowRight': - case 'Home': - case 'End': - this.updateSuggestions(); - break; - } - }; - - private selectSuggestionAt = (index: number) => () => { - this.setState(withSuggestionAtIndexSelected(index)); - }; - - private applySelectedSuggestion = () => { - if (this.state.selectedIndex !== null) { - this.applySuggestionAt(this.state.selectedIndex)(); - } - }; - - private applySuggestionAt = (index: number) => () => { - const { value, suggestions } = this.props; - const selectedSuggestion = suggestions[index]; - - if (!selectedSuggestion) { - return; - } - - const newValue = - value.substr(0, selectedSuggestion.start) + - selectedSuggestion.text + - value.substr(selectedSuggestion.end); - - this.setState(withSuggestionsHidden); - this.changeValue(newValue); - this.focusInputElement(); - }; - - private changeValue = (value: string) => { - const { onChange } = this.props; - if (onChange) { - onChange(value); - } - }; - - private focusInputElement = () => { - if (this.inputElement) { - this.inputElement.focus(); - } - }; - - private showSuggestions = () => { - this.setState(withSuggestionsVisible); - }; - - private hideSuggestions = () => { - this.setState(withSuggestionsHidden); - }; - - private submit = () => { - const { isValid, onSubmit, value } = this.props; - - if (isValid && onSubmit) { - onSubmit(value); - } - - this.setState(withSuggestionsHidden); - }; - - private updateSuggestions = (value?: string) => { - const inputCursorPosition = this.inputElement ? this.inputElement.selectionStart || 0 : 0; - this.props.loadSuggestions(value || this.props.value, inputCursorPosition, 10); - }; -} - -const withPreviousSuggestionSelected = ( - state: AutocompleteFieldState, - props: AutocompleteFieldProps -): AutocompleteFieldState => ({ - ...state, - selectedIndex: - props.suggestions.length === 0 - ? null - : state.selectedIndex !== null - ? (state.selectedIndex + props.suggestions.length - 1) % props.suggestions.length - : Math.max(props.suggestions.length - 1, 0), -}); - -const withNextSuggestionSelected = ( - state: AutocompleteFieldState, - props: AutocompleteFieldProps -): AutocompleteFieldState => ({ - ...state, - selectedIndex: - props.suggestions.length === 0 - ? null - : state.selectedIndex !== null - ? (state.selectedIndex + 1) % props.suggestions.length - : 0, -}); - -const withSuggestionAtIndexSelected = (suggestionIndex: number) => ( - state: AutocompleteFieldState, - props: AutocompleteFieldProps -): AutocompleteFieldState => ({ - ...state, - selectedIndex: - props.suggestions.length === 0 - ? null - : suggestionIndex >= 0 && suggestionIndex < props.suggestions.length - ? suggestionIndex - : 0, -}); - -const withSuggestionsVisible = (state: AutocompleteFieldState) => ({ - ...state, - areSuggestionsVisible: true, -}); - -const withSuggestionsHidden = (state: AutocompleteFieldState) => ({ - ...state, - areSuggestionsVisible: false, - selectedIndex: null, -}); - -const FixedEuiFieldSearch: React.FC< - React.InputHTMLAttributes & - EuiFieldSearchProps & { - inputRef?: (element: HTMLInputElement | null) => void; - onSearch: (value: string) => void; - } -> = EuiFieldSearch as any; - -const AutocompleteContainer = styled.div` - position: relative; -`; - -const SuggestionsPanel = styled(EuiPanel).attrs(() => ({ - paddingSize: 'none', - hasShadow: true, -}))` - position: absolute; - width: 100%; - margin-top: 2px; - overflow: hidden; - z-index: 1000; -`; diff --git a/x-pack/plugins/beats_management/public/components/autocomplete_field/suggestion_item.tsx b/x-pack/plugins/beats_management/public/components/autocomplete_field/suggestion_item.tsx deleted file mode 100644 index b870982d63d22d..00000000000000 --- a/x-pack/plugins/beats_management/public/components/autocomplete_field/suggestion_item.tsx +++ /dev/null @@ -1,119 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { EuiIcon } from '@elastic/eui'; -import { tint } from 'polished'; -import React from 'react'; -import styled from 'styled-components'; - -import { QuerySuggestion } from '../../../../../../src/plugins/data/public'; - -interface SuggestionItemProps { - isSelected?: boolean; - onClick?: React.MouseEventHandler; - onMouseEnter?: React.MouseEventHandler; - suggestion: QuerySuggestion; -} - -export const SuggestionItem: React.FC = (props) => { - const { isSelected, onClick, onMouseEnter, suggestion } = props; - - return ( - - - - - {suggestion.text} - {suggestion.description} - - ); -}; - -SuggestionItem.defaultProps = { - isSelected: false, -}; - -const SuggestionItemContainer = styled.div<{ - isSelected?: boolean; -}>` - display: flex; - flex-direction: row; - font-size: ${(props) => props.theme.eui.default.euiFontSizeS}; - height: ${(props) => props.theme.eui.default.euiSizeXl}; - white-space: nowrap; - background-color: ${(props) => - props.isSelected ? props.theme.eui.default.euiColorLightestShade : 'transparent'}; -`; - -const SuggestionItemField = styled.div` - align-items: center; - cursor: pointer; - display: flex; - flex-direction: row; - height: ${(props) => props.theme.eui.default.euiSizeXl}; - padding: ${(props) => props.theme.eui.default.euiSizeXs}; -`; - -const SuggestionItemIconField = styled(SuggestionItemField)<{ suggestionType: string }>` - background-color: ${(props) => { - return tint(0.1, getEuiIconColor(props.theme, props.suggestionType)); - }}; - color: ${(props) => { - return getEuiIconColor(props.theme, props.suggestionType); - }}; - flex: 0 0 auto; - justify-content: center; - width: ${(props) => props.theme.eui.default.euiSizeXl}; -`; - -const SuggestionItemTextField = styled(SuggestionItemField)` - flex: 2 0 0; - font-family: ${(props) => props.theme.eui.default.euiCodeFontFamily}; -`; - -const SuggestionItemDescriptionField = styled(SuggestionItemField)` - flex: 3 0 0; - p { - display: inline; - span { - font-family: ${(props) => props.theme.eui.default.euiCodeFontFamily}; - } - } -`; - -const getEuiIconType = (suggestionType: string) => { - switch (suggestionType) { - case 'field': - return 'kqlField'; - case 'value': - return 'kqlValue'; - case 'recentSearch': - return 'search'; - case 'conjunction': - return 'kqlSelector'; - case 'operator': - return 'kqlOperand'; - default: - return 'empty'; - } -}; - -const getEuiIconColor = (theme: any, suggestionType: string): string => { - switch (suggestionType) { - case 'field': - return theme.eui.default.euiColorVis7; - case 'value': - return theme.eui.default.euiColorVis0; - case 'operator': - return theme.eui.default.euiColorVis1; - case 'conjunction': - return theme.eui.default.euiColorVis2; - case 'recentSearch': - default: - return theme.eui.default.euiColorMediumShade; - } -}; diff --git a/x-pack/plugins/beats_management/public/components/config_list.tsx b/x-pack/plugins/beats_management/public/components/config_list.tsx deleted file mode 100644 index 44a581a8667352..00000000000000 --- a/x-pack/plugins/beats_management/public/components/config_list.tsx +++ /dev/null @@ -1,117 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -// @ts-ignore -import { EuiBasicTable, EuiLink } from '@elastic/eui'; -import { InjectedIntl, injectI18n } from '@kbn/i18n/react'; -import React from 'react'; -import { configBlockSchemas } from '../../common/config_schemas'; -import { translateConfigSchema } from '../../common/config_schemas_translations_map'; -import { ConfigurationBlock } from '../../common/domain_types'; - -interface ComponentProps { - configs: { - error?: string | undefined; - list: ConfigurationBlock[]; - page: number; - total: number; - }; - onConfigClick: (action: 'edit' | 'delete', config: ConfigurationBlock) => any; - onTableChange: (index: number, size: number) => void; - intl: InjectedIntl; -} -const pagination = { - pageSize: 5, - hidePerPageOptions: true, -}; - -const ConfigListUi: React.FC = (props) => ( - { - if (props.onTableChange) { - props.onTableChange(table.page.index, table.page.size); - } - }} - columns={[ - { - field: 'type', - name: props.intl.formatMessage({ - id: 'xpack.beatsManagement.tagTable.typeColumnName', - defaultMessage: 'Type', - }), - truncateText: false, - render: (type: string, config: ConfigurationBlock) => { - const translatedConfig = translateConfigSchema(configBlockSchemas).find( - (sc) => sc.id === type - ); - - return ( - props.onConfigClick('edit', config)}> - {translatedConfig ? translatedConfig.name : type} - - ); - }, - }, - { - field: 'module', - name: props.intl.formatMessage({ - id: 'xpack.beatsManagement.tagTable.moduleColumnName', - defaultMessage: 'Module', - }), - truncateText: false, - render: (value: string, config: ConfigurationBlock) => { - return ( - config.config._sub_type || - props.intl.formatMessage({ - id: 'xpack.beatsManagement.tagTable.moduleColumn.notAvailibaleLabel', - defaultMessage: 'N/A', - }) - ); - }, - }, - { - field: 'description', - name: props.intl.formatMessage({ - id: 'xpack.beatsManagement.tagTable.descriptionColumnName', - defaultMessage: 'Description', - }), - }, - { - name: props.intl.formatMessage({ - id: 'xpack.beatsManagement.tagTable.actionsColumnName', - defaultMessage: 'Actions', - }), - actions: [ - { - name: props.intl.formatMessage({ - id: 'xpack.beatsManagement.tagTable.actions.removeButtonAriaLabel', - defaultMessage: 'Remove', - }), - description: props.intl.formatMessage({ - id: 'xpack.beatsManagement.tagTable.actions.removeTooltip', - defaultMessage: 'Remove this config from tag', - }), - type: 'icon', - icon: 'trash', - onClick: (item: ConfigurationBlock) => props.onConfigClick('delete', item), - }, - ], - }, - ]} - /> -); - -export const ConfigList = injectI18n(ConfigListUi); diff --git a/x-pack/plugins/beats_management/public/components/enroll_beats.tsx b/x-pack/plugins/beats_management/public/components/enroll_beats.tsx deleted file mode 100644 index 4c85509f13256e..00000000000000 --- a/x-pack/plugins/beats_management/public/components/enroll_beats.tsx +++ /dev/null @@ -1,292 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { - EuiBasicTable, - EuiButton, - EuiCodeBlock, - EuiCopy, - EuiFlexGroup, - EuiFlexItem, - EuiLoadingSpinner, - EuiModalBody, - // @ts-ignore - EuiSelect, - EuiSpacer, - EuiTitle, -} from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; -import { upperFirst } from 'lodash'; -import React from 'react'; -import { CMBeat } from '../../common/domain_types'; - -interface ComponentProps { - /** Such as kibanas basePath, for use to generate command */ - frameworkBasePath?: string; - enrollmentToken?: string; - getBeatWithToken(token: string): Promise; - createEnrollmentToken(): Promise; - onBeatEnrolled(enrolledBeat: CMBeat): void; -} - -interface ComponentState { - enrolledBeat: CMBeat | null; - hasPolledForBeat: boolean; - command: string; - beatType: string; -} - -export class EnrollBeat extends React.Component { - private pinging = false; - constructor(props: ComponentProps) { - super(props); - - this.state = { - enrolledBeat: null, - hasPolledForBeat: false, - command: 'sudo {{beatType}}', - beatType: 'filebeat', - }; - } - public pingForBeatWithToken = async (token: string): Promise => { - try { - const beats = await this.props.getBeatWithToken(token); - - if (!beats) { - throw new Error('no beats'); - } - return beats; - } catch (err) { - if (this.pinging) { - const timeout = (ms: number) => new Promise((res) => setTimeout(res, ms)); - await timeout(5000); - return await this.pingForBeatWithToken(token); - } - } - }; - public async componentDidMount() { - if (!this.props.enrollmentToken) { - await this.props.createEnrollmentToken(); - } - } - public waitForTokenToEnrollBeat = async () => { - if (this.pinging || !this.props.enrollmentToken) { - return; - } - this.pinging = true; - const enrolledBeat = (await this.pingForBeatWithToken(this.props.enrollmentToken)) as CMBeat; - - this.setState({ - enrolledBeat, - }); - this.props.onBeatEnrolled(enrolledBeat); - this.pinging = false; - }; - public render() { - if (!this.props.enrollmentToken && !this.state.enrolledBeat) { - return null; - } - if (this.props.enrollmentToken && !this.state.enrolledBeat) { - this.waitForTokenToEnrollBeat(); - } - const cmdText = `${this.state.command - .replace('{{beatType}}', this.state.beatType) - .replace('{{beatTypeInCaps}}', upperFirst(this.state.beatType))} enroll ${ - window.location.protocol - }//${window.location.host}${this.props.frameworkBasePath} ${this.props.enrollmentToken}`; - - return ( - - {!this.state.enrolledBeat && ( - - - - - - -

- -

-
-
-
- this.setState({ beatType: e.target.value })} - fullWidth={true} - /> -
-
- -
-
- - - - - -

- -

-
-
-
- {{beatType}}.exe`, - text: 'Windows', - }, - { - value: `./{{beatType}}`, - text: 'MacOS', - }, - ]} - onChange={(e: any) => this.setState({ command: e.target.value })} - fullWidth={true} - /> -
-
-
-
- {this.state.command && ( - - - - - -

- -

-
-
- - - {(copy: any) => ( - - - - )} - - -
- -
- - {`$ ${cmdText}`} -
- - - - - - - - -

- -

-
-
-
-
-
-
- -
-
- )} -
- )} - {this.state.enrolledBeat && ( - - -
-
-
- - ), - sortable: false, - }, - { - field: 'version', - name: ( - - ), - sortable: false, - }, - { - field: 'host_name', - name: ( - - ), - sortable: false, - }, - ]} - /> -
-
-
- )} -
- ); - } -} diff --git a/x-pack/plugins/beats_management/public/components/inputs/code_editor.tsx b/x-pack/plugins/beats_management/public/components/inputs/code_editor.tsx deleted file mode 100644 index 9116725bfe06ab..00000000000000 --- a/x-pack/plugins/beats_management/public/components/inputs/code_editor.tsx +++ /dev/null @@ -1,114 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -// @ts-ignore -import { CommonProps, EuiCodeEditor, EuiCodeEditorProps, EuiFormRow } from '@elastic/eui'; -// @ts-ignore -import { FormsyInputProps, withFormsy } from 'formsy-react'; -import React, { Component, InputHTMLAttributes } from 'react'; - -interface ComponentProps extends FormsyInputProps, CommonProps, EuiCodeEditorProps { - instantValidation: boolean; - label: string; - isReadOnly: boolean; - mode: 'javascript' | 'yaml'; - errorText: string; - fullWidth: boolean; - helpText: React.ReactElement; - compressed: boolean; - onChange(value: string): void; - onBlur(): void; -} - -interface ComponentState { - allowError: boolean; -} - -class CodeEditor extends Component< - InputHTMLAttributes & ComponentProps, - ComponentState -> { - public static defaultProps = { - passRequiredToField: true, - }; - - public state = { allowError: false }; - - public componentDidMount() { - const { defaultValue, setValue } = this.props; - setValue(defaultValue || ''); - } - - public UNSAFE_componentWillReceiveProps(nextProps: ComponentProps) { - if (nextProps.isFormSubmitted()) { - this.showError(); - } - } - - public handleChange = (value: string) => { - this.props.setValue(value); - if (this.props.onChange) { - this.props.onChange(value); - } - if (this.props.instantValidation) { - this.showError(); - } - }; - - public handleBlur = () => { - this.showError(); - if (this.props.onBlur) { - this.props.onBlur(); - } - }; - - public showError = () => this.setState({ allowError: true }); - - public render() { - const { - name, - id, - label, - isReadOnly, - isValid, - getValue, - isPristine, - getErrorMessage, - mode, - fullWidth, - className, - helpText, - } = this.props; - - const { allowError } = this.state; - const error = !isPristine() && !isValid() && allowError; - - return ( - - - - ); - } -} - -export const FormsyEuiCodeEditor = withFormsy(CodeEditor); diff --git a/x-pack/plugins/beats_management/public/components/inputs/index.ts b/x-pack/plugins/beats_management/public/components/inputs/index.ts deleted file mode 100644 index 58f5ba4c81f71c..00000000000000 --- a/x-pack/plugins/beats_management/public/components/inputs/index.ts +++ /dev/null @@ -1,12 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -export { FormsyEuiCodeEditor } from './code_editor'; -export { FormsyEuiFieldText } from './input'; -export { FormsyEuiPasswordText } from './password_input'; -export { FormsyEuiMultiFieldText } from './multi_input'; -export { FormsyEuiSelect } from './select'; diff --git a/x-pack/plugins/beats_management/public/components/inputs/input.tsx b/x-pack/plugins/beats_management/public/components/inputs/input.tsx deleted file mode 100644 index 3fb18e1b218b43..00000000000000 --- a/x-pack/plugins/beats_management/public/components/inputs/input.tsx +++ /dev/null @@ -1,120 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { EuiFieldText, EuiFormRow } from '@elastic/eui'; -import { CommonProps } from '@elastic/eui/src/components/common'; -import { FormsyInputProps, withFormsy } from 'formsy-react'; -import React, { Component, InputHTMLAttributes } from 'react'; - -interface ComponentProps - extends FormsyInputProps, - CommonProps, - Omit, 'onChange' | 'onBlur'> { - instantValidation?: boolean; - label: string; - errorText: string; - fullWidth: boolean; - helpText: React.ReactElement; - compressed: boolean; - onChange?(e: React.ChangeEvent, value: any): void; - onBlur?(e: React.ChangeEvent, value: any): void; -} - -interface ComponentState { - allowError: boolean; -} - -class FieldText extends Component< - InputHTMLAttributes & ComponentProps, - ComponentState -> { - public static defaultProps = { - passRequiredToField: true, - }; - - public state = { allowError: false }; - - public componentDidMount() { - const { defaultValue, setValue } = this.props; - if (defaultValue) { - setValue(defaultValue); - } - } - - public UNSAFE_componentWillReceiveProps(nextProps: ComponentProps) { - if (nextProps.isFormSubmitted()) { - this.showError(); - } - } - - public handleChange = (e: React.ChangeEvent) => { - const { value } = e.currentTarget; - this.props.setValue(value); - if (this.props.onChange) { - this.props.onChange(e, e.currentTarget.value); - } - if (this.props.instantValidation) { - this.showError(); - } - }; - - public handleBlur = (e: React.ChangeEvent) => { - this.showError(); - if (this.props.onBlur) { - this.props.onBlur(e, e.currentTarget.value); - } - }; - - public showError = () => this.setState({ allowError: true }); - - public render() { - const { - name, - id, - required, - label, - getValue, - isValid, - isPristine, - getErrorMessage, - fullWidth, - className, - disabled, - helpText, - placeholder, - } = this.props; - - const { allowError } = this.state; - const error = !isPristine() && !isValid() && allowError; - - return ( - - - - ); - } -} - -export const FormsyEuiFieldText = withFormsy(FieldText); diff --git a/x-pack/plugins/beats_management/public/components/inputs/multi_input.tsx b/x-pack/plugins/beats_management/public/components/inputs/multi_input.tsx deleted file mode 100644 index ffc208f6f94fd6..00000000000000 --- a/x-pack/plugins/beats_management/public/components/inputs/multi_input.tsx +++ /dev/null @@ -1,122 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { EuiFormRow, EuiTextArea, EuiTextAreaProps } from '@elastic/eui'; -import { CommonProps } from '@elastic/eui/src/components/common'; -// @ts-ignore -import { FormsyInputProps, withFormsy } from 'formsy-react'; -import React, { Component, InputHTMLAttributes } from 'react'; - -interface ComponentProps - extends FormsyInputProps, - CommonProps, - Omit { - instantValidation: boolean; - label: string; - errorText: string; - fullWidth: boolean; - helpText: React.ReactElement; - compressed: boolean; - onChange(e: React.ChangeEvent, value: any): void; - onBlur(e: React.ChangeEvent, value: any): void; -} - -interface ComponentState { - allowError: boolean; -} - -class MultiFieldText extends Component< - InputHTMLAttributes & ComponentProps, - ComponentState -> { - public static defaultProps = { - passRequiredToField: true, - }; - - public state = { allowError: false }; - - public componentDidMount() { - const { defaultValue, setValue } = this.props; - - if (defaultValue) { - setValue(defaultValue); - } - } - - public UNSAFE_componentWillReceiveProps(nextProps: ComponentProps) { - if (nextProps.isFormSubmitted()) { - this.showError(); - } - } - - public handleChange = (e: React.ChangeEvent) => { - const value = e.currentTarget.value.split('\n'); - this.props.setValue(value); - if (this.props.onChange) { - this.props.onChange(e, value); - } - if (this.props.instantValidation) { - this.showError(); - } - }; - - public handleBlur = (e: React.ChangeEvent) => { - this.showError(); - if (this.props.onBlur) { - this.props.onBlur(e, e.currentTarget.value); - } - }; - - public showError = () => this.setState({ allowError: true }); - - public render() { - const { - name, - id, - required, - label, - getValue, - isValid, - isPristine, - getErrorMessage, - fullWidth, - className, - disabled, - helpText, - placeholder, - } = this.props; - - const { allowError } = this.state; - const error = !isPristine() && !isValid() && allowError; - - return ( - - - - ); - } -} - -export const FormsyEuiMultiFieldText = withFormsy(MultiFieldText); diff --git a/x-pack/plugins/beats_management/public/components/inputs/password_input.tsx b/x-pack/plugins/beats_management/public/components/inputs/password_input.tsx deleted file mode 100644 index 7d4b0c369c19ae..00000000000000 --- a/x-pack/plugins/beats_management/public/components/inputs/password_input.tsx +++ /dev/null @@ -1,114 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { CommonProps, EuiFieldPassword, EuiFieldPasswordProps, EuiFormRow } from '@elastic/eui'; -import { FormsyInputProps, withFormsy } from 'formsy-react'; -import React, { Component, InputHTMLAttributes } from 'react'; - -interface ComponentProps - extends FormsyInputProps, - CommonProps, - Omit { - instantValidation?: boolean; - label: string; - errorText: string; - fullWidth: boolean; - helpText: React.ReactElement; - compressed: boolean; - onChange?(e: React.ChangeEvent, value: any): void; - onBlur?(e: React.ChangeEvent, value: any): void; -} - -interface ComponentState { - allowError: boolean; -} - -class FieldPassword extends Component< - InputHTMLAttributes & ComponentProps, - ComponentState -> { - constructor(props: any) { - super(props); - - this.state = { - allowError: false, - }; - } - - public componentDidMount() { - const { defaultValue, setValue } = this.props; - if (defaultValue) { - setValue(defaultValue); - } - } - - public handleChange = (e: React.ChangeEvent) => { - const { value } = e.currentTarget; - this.props.setValue(value); - if (this.props.onChange) { - this.props.onChange(e, value); - } - if (this.props.instantValidation) { - this.showError(); - } - }; - - public handleBlur = (e: React.ChangeEvent) => { - this.showError(); - if (this.props.onBlur) { - this.props.onBlur(e, e.currentTarget.value); - } - }; - - public showError = () => this.setState({ allowError: true }); - - public render() { - const { - name, - id, - required, - label, - getValue, - isValid, - isPristine, - getErrorMessage, - fullWidth, - className, - disabled, - helpText, - onBlur, - } = this.props; - - const { allowError } = this.state; - const error = !isPristine() && !isValid() && allowError; - - return ( - - - - ); - } -} - -export const FormsyEuiPasswordText = withFormsy(FieldPassword); diff --git a/x-pack/plugins/beats_management/public/components/inputs/select.tsx b/x-pack/plugins/beats_management/public/components/inputs/select.tsx deleted file mode 100644 index edd1a7fee90c50..00000000000000 --- a/x-pack/plugins/beats_management/public/components/inputs/select.tsx +++ /dev/null @@ -1,125 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { - EuiFormRow, - // @ts-ignore - EuiSelect, -} from '@elastic/eui'; -import { CommonProps } from '@elastic/eui/src/components/common'; -// @ts-ignore -import { FormsyInputProps, withFormsy } from 'formsy-react'; -import React, { Component, InputHTMLAttributes } from 'react'; - -const FixedSelect = EuiSelect as React.FC; - -interface ComponentProps extends FormsyInputProps, CommonProps { - instantValidation: boolean; - options: Array<{ value: string; text: string }>; - label: string; - errorText: string; - fullWidth: boolean; - helpText: React.ReactElement; - compressed: boolean; - onChange(e: React.ChangeEvent, value: any): void; - onBlur(e: React.ChangeEvent, value: any): void; -} - -interface ComponentState { - allowError: boolean; -} - -class FieldSelect extends Component< - InputHTMLAttributes & ComponentProps, - ComponentState -> { - public static defaultProps = { - passRequiredToField: true, - }; - - public state = { allowError: false }; - - public componentDidMount() { - const { defaultValue, setValue } = this.props; - if (defaultValue) { - setValue(defaultValue); - } - } - - public UNSAFE_componentWillReceiveProps(nextProps: ComponentProps) { - if (nextProps.isFormSubmitted()) { - this.showError(); - } - } - - public handleChange = (e: React.ChangeEvent) => { - const { value } = e.currentTarget; - - this.props.setValue(value); - if (this.props.onChange) { - this.props.onChange(e, e.currentTarget.value); - } - if (this.props.instantValidation) { - this.showError(); - } - }; - - public handleBlur = (e: React.ChangeEvent) => { - this.showError(); - if (this.props.onBlur) { - this.props.onBlur(e, e.currentTarget.value); - } - }; - - public showError = () => this.setState({ allowError: true }); - - public render() { - const { - id, - required, - label, - options, - getValue, - isValid, - isPristine, - getErrorMessage, - fullWidth, - className, - disabled, - helpText, - } = this.props; - - const { allowError } = this.state; - const error = !isPristine() && !isValid() && allowError; - - return ( - - - - ); - } -} - -export const FormsyEuiSelect = withFormsy(FieldSelect); diff --git a/x-pack/plugins/beats_management/public/components/layouts/background.tsx b/x-pack/plugins/beats_management/public/components/layouts/background.tsx deleted file mode 100644 index ff060cb5869faa..00000000000000 --- a/x-pack/plugins/beats_management/public/components/layouts/background.tsx +++ /dev/null @@ -1,12 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import styled from 'styled-components'; - -export const Background = styled.div` - flex-grow: 1; -`; diff --git a/x-pack/plugins/beats_management/public/components/layouts/no_data.tsx b/x-pack/plugins/beats_management/public/components/layouts/no_data.tsx deleted file mode 100644 index e61c3db2ebd139..00000000000000 --- a/x-pack/plugins/beats_management/public/components/layouts/no_data.tsx +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { EuiEmptyPrompt, EuiFlexGroup, EuiFlexItem, EuiPageContent } from '@elastic/eui'; -import React from 'react'; -import { withRouter, RouteComponentProps } from 'react-router-dom'; - -interface LayoutProps extends RouteComponentProps { - children: React.ReactNode; - title: string | React.ReactNode; - actionSection?: React.ReactNode; -} - -export const NoDataLayout = withRouter(({ actionSection, title, children }: LayoutProps) => ( - - - - {title}} - body={children} - actions={actionSection} - /> - - - -)); diff --git a/x-pack/plugins/beats_management/public/components/layouts/primary.tsx b/x-pack/plugins/beats_management/public/components/layouts/primary.tsx deleted file mode 100644 index 0a1c0bb028c77b..00000000000000 --- a/x-pack/plugins/beats_management/public/components/layouts/primary.tsx +++ /dev/null @@ -1,84 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { - EuiHeader, - EuiHeaderBreadcrumbs, - EuiHeaderSection, - EuiPage, - EuiPageBody, - EuiPageContent, - EuiPageContentBody, - EuiPageHeader, - EuiPageHeaderSection, - EuiTitle, -} from '@elastic/eui'; -import React, { Component, ReactNode } from 'react'; -import styled from 'styled-components'; -import { BreadcrumbConsumer } from '../navigation/breadcrumb'; - -type RenderCallback = (component: () => JSX.Element) => void; -interface PrimaryLayoutProps { - title: string | React.ReactNode; - actionSection?: React.ReactNode; - hideBreadcrumbs?: boolean; -} -export class PrimaryLayout extends Component { - private actionSection: (() => JSX.Element) | null = null; - constructor(props: PrimaryLayoutProps) { - super(props); - } - - public render() { - const children: (callback: RenderCallback) => void | ReactNode = this.props.children as any; - return ( - - {!this.props.hideBreadcrumbs && ( - - {({ breadcrumbs }) => ( - - - - - - )} - - )} - - - - - -

{this.props.title}

-
-
- - {(this.actionSection && this.actionSection()) || this.props.actionSection} - -
- - - {(children && typeof children === 'function' - ? children(this.renderAction) - : children) || } - - -
-
-
- ); - } - - private renderAction = (component: () => JSX.Element) => { - this.actionSection = component; - this.forceUpdate(); - }; -} - -const HeaderWrapper = styled(EuiHeader)` - height: 29px; -`; diff --git a/x-pack/plugins/beats_management/public/components/layouts/walkthrough.tsx b/x-pack/plugins/beats_management/public/components/layouts/walkthrough.tsx deleted file mode 100644 index 4d0fb9126d5b50..00000000000000 --- a/x-pack/plugins/beats_management/public/components/layouts/walkthrough.tsx +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import React from 'react'; - -import { EuiPageContent, EuiPageContentBody, EuiStepsHorizontal, EuiTitle } from '@elastic/eui'; - -interface LayoutProps { - title: string; - goTo: (path: string) => any; - walkthroughSteps: Array<{ - id: string; - name: string; - }>; - activePath: string; -} - -export const WalkthroughLayout: React.FC = ({ - walkthroughSteps, - title, - activePath, - goTo, - children, -}) => { - const indexOfCurrent = walkthroughSteps.findIndex((step) => activePath === step.id); - return ( - - -

{title}

-
-
-
- ({ - title: step.name, - isComplete: i <= indexOfCurrent, - onClick: () => goTo(step.id), - }))} - /> -
-
- {children} -
- ); -}; diff --git a/x-pack/plugins/beats_management/public/components/loading.tsx b/x-pack/plugins/beats_management/public/components/loading.tsx deleted file mode 100644 index fabbee359946c8..00000000000000 --- a/x-pack/plugins/beats_management/public/components/loading.tsx +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { EuiFlexGroup, EuiFlexItem, EuiLoadingSpinner } from '@elastic/eui'; -import * as React from 'react'; - -export const Loading: React.FC<{}> = () => ( - - - - - -); diff --git a/x-pack/plugins/beats_management/public/components/navigation/breadcrumb/breadcrumb.tsx b/x-pack/plugins/beats_management/public/components/navigation/breadcrumb/breadcrumb.tsx deleted file mode 100644 index 7af0270822422d..00000000000000 --- a/x-pack/plugins/beats_management/public/components/navigation/breadcrumb/breadcrumb.tsx +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import React, { Component } from 'react'; -import { RouteProps } from 'react-router-dom'; -import { BASE_PATH } from '../../../../common/constants'; -import { BreadcrumbConsumer } from './consumer'; -import { Breadcrumb as BreadcrumbData, BreadcrumbContext } from './types'; - -interface BreadcrumbManagerProps extends RouteProps { - text: string; - href?: string; - parents?: BreadcrumbData[]; - context: BreadcrumbContext; -} - -class BreadcrumbManager extends Component { - public componentWillUnmount() { - const { text, href, context } = this.props; - - context.removeCrumb({ - text, - href, - }); - } - - public componentDidMount() { - const { text, href, parents, context } = this.props; - context.addCrumb( - { - text, - href, - }, - parents - ); - } - - public render() { - return ; - } -} - -interface BreadcrumbProps extends RouteProps { - title: string; - path?: string; - parentBreadcrumbs?: BreadcrumbData[]; -} - -export const Breadcrumb: React.FC = ({ title, path, parentBreadcrumbs }) => ( - - {(context) => ( - - )} - -); diff --git a/x-pack/plugins/beats_management/public/components/navigation/breadcrumb/consumer.tsx b/x-pack/plugins/beats_management/public/components/navigation/breadcrumb/consumer.tsx deleted file mode 100644 index 3062095a06383b..00000000000000 --- a/x-pack/plugins/beats_management/public/components/navigation/breadcrumb/consumer.tsx +++ /dev/null @@ -1,8 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -export { Consumer as BreadcrumbConsumer } from './context'; diff --git a/x-pack/plugins/beats_management/public/components/navigation/breadcrumb/context.tsx b/x-pack/plugins/beats_management/public/components/navigation/breadcrumb/context.tsx deleted file mode 100644 index 3d11194bc3fb9f..00000000000000 --- a/x-pack/plugins/beats_management/public/components/navigation/breadcrumb/context.tsx +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import React from 'react'; - -import { Breadcrumb, BreadcrumbContext } from './types'; - -/* istanbul ignore next */ -const defaultContext: BreadcrumbContext = { - breadcrumbs: [], - addCrumb: (crumb: Breadcrumb) => null, - removeCrumb: (crumb: Breadcrumb) => null, -}; - -export const { Provider, Consumer } = React.createContext(defaultContext); diff --git a/x-pack/plugins/beats_management/public/components/navigation/breadcrumb/index.ts b/x-pack/plugins/beats_management/public/components/navigation/breadcrumb/index.ts deleted file mode 100644 index e4839a75c39e06..00000000000000 --- a/x-pack/plugins/beats_management/public/components/navigation/breadcrumb/index.ts +++ /dev/null @@ -1,10 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -export { BreadcrumbProvider } from './provider'; -export { BreadcrumbConsumer } from './consumer'; -export { Breadcrumb } from './breadcrumb'; diff --git a/x-pack/plugins/beats_management/public/components/navigation/breadcrumb/provider.tsx b/x-pack/plugins/beats_management/public/components/navigation/breadcrumb/provider.tsx deleted file mode 100644 index 20919a52b658ed..00000000000000 --- a/x-pack/plugins/beats_management/public/components/navigation/breadcrumb/provider.tsx +++ /dev/null @@ -1,73 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import React, { Component, ReactElement } from 'react'; -import { Provider } from './context'; -import { Breadcrumb } from './types'; -import { services } from '../../../kbn_services'; - -interface ComponentProps { - useGlobalBreadcrumbs: boolean; - children: ReactElement | Array>; -} - -interface ComponentState { - breadcrumbs: Array<{ - href?: string; - breadcrumb: Breadcrumb; - parents?: Breadcrumb[]; - }>; -} - -export class BreadcrumbProvider extends Component { - public state = { - breadcrumbs: [] as ComponentState['breadcrumbs'], - }; - - public addCrumb = (breadcrumb: Breadcrumb, parents?: Breadcrumb[]) => { - this.setState(({ breadcrumbs: prevCrumbs }) => ({ - breadcrumbs: [ - ...prevCrumbs, - { - href: breadcrumb.href, - breadcrumb, - parents, - }, - ], - })); - }; - - public removeCrumb = (crumbToRemove: Breadcrumb) => { - this.setState(({ breadcrumbs: prevCrumbs }) => { - const breadcrumbs = prevCrumbs.filter((prevCrumb) => { - const { href } = prevCrumb; - return !(crumbToRemove.href === href); - }); - return { breadcrumbs }; - }); - }; - - public render() { - const { breadcrumbs } = this.state; - - const context = { - breadcrumbs: breadcrumbs.reduce((crumbs, crumbStorageItem) => { - if (crumbStorageItem.parents) { - crumbs = crumbs.concat(crumbStorageItem.parents); - } - crumbs.push(crumbStorageItem.breadcrumb); - return crumbs; - }, [] as Breadcrumb[]), - addCrumb: this.addCrumb, - removeCrumb: this.removeCrumb, - }; - if (this.props.useGlobalBreadcrumbs) { - services.setBreadcrumbs(context.breadcrumbs); - } - return {this.props.children}; - } -} diff --git a/x-pack/plugins/beats_management/public/components/navigation/breadcrumb/types.d.ts b/x-pack/plugins/beats_management/public/components/navigation/breadcrumb/types.d.ts deleted file mode 100644 index 33a947d649c46e..00000000000000 --- a/x-pack/plugins/beats_management/public/components/navigation/breadcrumb/types.d.ts +++ /dev/null @@ -1,16 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -export interface BreadcrumbContext { - breadcrumbs: Breadcrumb[]; - addCrumb: (crumb: Breadcrumb, parents?: Breadcrumb[]) => void; - removeCrumb: (crumb: Breadcrumb) => void; -} -export interface Breadcrumb { - text: string; - href?: string; -} diff --git a/x-pack/plugins/beats_management/public/components/navigation/child_routes.tsx b/x-pack/plugins/beats_management/public/components/navigation/child_routes.tsx deleted file mode 100644 index 9e4eaa98c41e95..00000000000000 --- a/x-pack/plugins/beats_management/public/components/navigation/child_routes.tsx +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import React, { FC } from 'react'; -import { Route, Switch } from 'react-router-dom'; - -export interface RouteConfig { - path: string; - component: React.ComponentType; - routes?: RouteConfig[]; -} - -export const ChildRoutes: FC<{ - routes?: RouteConfig[]; - useSwitch?: boolean; - [other: string]: any; -}> = ({ routes, useSwitch = true, ...rest }) => { - if (!routes) { - return null; - } - const Parent = useSwitch ? Switch : React.Fragment; - return ( - - {routes.map((route) => ( - { - const Component = route.component; - return ; - }} - /> - ))} - - ); -}; diff --git a/x-pack/plugins/beats_management/public/components/navigation/connected_link.tsx b/x-pack/plugins/beats_management/public/components/navigation/connected_link.tsx deleted file mode 100644 index 3eb00c8714868d..00000000000000 --- a/x-pack/plugins/beats_management/public/components/navigation/connected_link.tsx +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { get } from 'lodash'; -import React from 'react'; - -import { EuiLink } from '@elastic/eui'; -import { Link, withRouter, RouteComponentProps } from 'react-router-dom'; - -interface ConnectedLinkComponent extends RouteComponentProps { - location: any; - path: string; - disabled: boolean; - query: any; - [key: string]: any; -} - -export const ConnectedLinkComponent = ({ - location, - path, - query, - disabled, - children, - ...props -}: ConnectedLinkComponent) => { - if (disabled) { - return ; - } - - // Shorthand for pathname - const pathname = path || get(props.to, 'pathname') || location.pathname; - - return ( - - ); -}; - -export const ConnectedLink = withRouter(ConnectedLinkComponent); diff --git a/x-pack/plugins/beats_management/public/components/table/action_schema.ts b/x-pack/plugins/beats_management/public/components/table/action_schema.ts deleted file mode 100644 index 254188e764590a..00000000000000 --- a/x-pack/plugins/beats_management/public/components/table/action_schema.ts +++ /dev/null @@ -1,101 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { i18n } from '@kbn/i18n'; -import { AssignmentActionType } from './table'; - -export enum ActionComponentType { - Action, - Popover, - SelectionCount, - TagBadgeList, -} -export interface ControlSchema { - id?: number; - name: string; - danger?: boolean; - type: ActionComponentType; - action?: AssignmentActionType; - actionDataKey?: string; - showWarning?: boolean; - warningHeading?: string; - warningMessage?: string; - lazyLoad?: boolean; - grow?: boolean; -} - -export const beatsListActions: ControlSchema[] = [ - { - grow: false, - name: i18n.translate('xpack.beatsManagement.beatsListAssignmentOptions.unenrollButtonLabel', { - defaultMessage: 'Unenroll selected', - }), - showWarning: true, - type: ActionComponentType.Action, - warningHeading: i18n.translate( - 'xpack.beatsManagement.beatsListAssignmentOptions.unenrollBeatsWarninigTitle', - { defaultMessage: 'Unenroll selected beats?' } - ), - warningMessage: i18n.translate( - 'xpack.beatsManagement.beatsListAssignmentOptions.unenrollBeatsWarninigMessage', - { defaultMessage: 'The selected Beats will no longer use central management' } - ), - action: AssignmentActionType.Delete, - danger: true, - }, - { - name: i18n.translate('xpack.beatsManagement.beatsListAssignmentOptions.setTagsButtonLabel', { - defaultMessage: 'Set tags', - }), - grow: false, - type: ActionComponentType.TagBadgeList, - actionDataKey: 'tags', - lazyLoad: true, - }, -]; - -export const tagListActions: ControlSchema[] = [ - { - danger: true, - grow: false, - name: i18n.translate('xpack.beatsManagement.tagListAssignmentOptions.removeTagsButtonLabel', { - defaultMessage: 'Remove selected', - }), - type: ActionComponentType.Action, - showWarning: true, - warningHeading: i18n.translate( - 'xpack.beatsManagement.tagListAssignmentOptions.removeTagsWarninigTitle', - { defaultMessage: 'Remove tag(s)' } - ), - warningMessage: i18n.translate( - 'xpack.beatsManagement.tagListAssignmentOptions.removeTagWarninigMessage', - { defaultMessage: 'Remove the tag?' } - ), - action: AssignmentActionType.Delete, - }, -]; - -export const tagConfigActions: ControlSchema[] = [ - { - danger: true, - grow: false, - name: i18n.translate('xpack.beatsManagement.tagConfigAssignmentOptions.removeTagsButtonLabel', { - defaultMessage: 'Remove tag(s)', - }), - type: ActionComponentType.Action, - showWarning: true, - warningHeading: i18n.translate( - 'xpack.beatsManagement.tagConfigAssignmentOptions.removeTagsWarninigTitle', - { defaultMessage: 'Remove tag(s)' } - ), - warningMessage: i18n.translate( - 'xpack.beatsManagement.tagConfigAssignmentOptions.removeTagsWarninigMessage', - { defaultMessage: 'Remove the tag from the selected beat(s)?' } - ), - action: AssignmentActionType.Delete, - }, -]; diff --git a/x-pack/plugins/beats_management/public/components/table/controls/action_control.tsx b/x-pack/plugins/beats_management/public/components/table/controls/action_control.tsx deleted file mode 100644 index 5badef9a71fe17..00000000000000 --- a/x-pack/plugins/beats_management/public/components/table/controls/action_control.tsx +++ /dev/null @@ -1,97 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { EuiButton, EuiConfirmModal } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; -import React from 'react'; -import { AssignmentActionType } from '../table'; - -interface ActionControlProps { - action: AssignmentActionType; - disabled: boolean; - danger?: boolean; - name: string; - showWarning?: boolean; - warningHeading?: string; - warningMessage?: string; - actionHandler(action: AssignmentActionType, payload?: any): void; -} - -interface ActionControlState { - showModal: boolean; -} - -export class ActionControl extends React.PureComponent { - constructor(props: ActionControlProps) { - super(props); - - this.state = { - showModal: false, - }; - } - - public render() { - const { - action, - actionHandler, - danger, - name, - showWarning, - warningHeading, - warningMessage, - } = this.props; - - return ( -
- this.setState({ showModal: true }) : () => actionHandler(action) - } - > - {name} - - {this.state.showModal && ( - - } - confirmButtonText={ - - } - onConfirm={() => { - actionHandler(action); - this.setState({ showModal: false }); - }} - onCancel={() => this.setState({ showModal: false })} - title={ - warningHeading ? ( - warningHeading - ) : ( - - ) - } - > - {warningMessage} - - )} -
- ); - } -} diff --git a/x-pack/plugins/beats_management/public/components/table/controls/index.ts b/x-pack/plugins/beats_management/public/components/table/controls/index.ts deleted file mode 100644 index 72cbc7fcb23fd0..00000000000000 --- a/x-pack/plugins/beats_management/public/components/table/controls/index.ts +++ /dev/null @@ -1,8 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -export { OptionControl } from './option_control'; diff --git a/x-pack/plugins/beats_management/public/components/table/controls/option_control.tsx b/x-pack/plugins/beats_management/public/components/table/controls/option_control.tsx deleted file mode 100644 index f07c84f584d918..00000000000000 --- a/x-pack/plugins/beats_management/public/components/table/controls/option_control.tsx +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import React from 'react'; -import { ActionComponentType, ControlSchema } from '../action_schema'; -import { AssignmentActionType } from '../table'; -import { ActionControl } from './action_control'; -import { TagBadgeList } from './tag_badge_list'; - -interface ComponentProps extends ControlSchema { - actionData?: { - [key: string]: any; - }; - disabled: boolean; - actionHandler(action: AssignmentActionType, payload?: any): void; -} - -export const OptionControl: React.FC = (props: ComponentProps) => { - switch (props.type) { - case ActionComponentType.Action: - if (!props.action) { - throw Error('Action cannot be undefined'); - } - return ( - - ); - case ActionComponentType.TagBadgeList: - if (!props.actionDataKey) { - throw Error('actionDataKey cannot be undefined'); - } - if (!props.actionData) { - throw Error('actionData cannot be undefined'); - } - return ( - - ); - } - return
Invalid config
; -}; diff --git a/x-pack/plugins/beats_management/public/components/table/controls/tag_badge_list.tsx b/x-pack/plugins/beats_management/public/components/table/controls/tag_badge_list.tsx deleted file mode 100644 index 15cc3f3fce5771..00000000000000 --- a/x-pack/plugins/beats_management/public/components/table/controls/tag_badge_list.tsx +++ /dev/null @@ -1,110 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { - EuiButton, - EuiContextMenuPanel, - EuiFlexGroup, - EuiFlexItem, - EuiLoadingSpinner, - EuiPopover, -} from '@elastic/eui'; -import React from 'react'; -import { TABLE_CONFIG } from '../../../../common/constants/table'; -import { TagBadge } from '../../tag/tag_badge'; -import { AssignmentActionType } from '../index'; - -interface TagBadgeListProps { - items: object[]; - disabled: boolean; - name: string; - action?: AssignmentActionType; - actionHandler(action: AssignmentActionType, payload?: any): void; -} - -interface ComponentState { - isPopoverOpen: boolean; - items: object[]; -} - -export class TagBadgeList extends React.Component { - constructor(props: TagBadgeListProps) { - super(props); - - this.state = { - isPopoverOpen: false, - items: [], - }; - } - - public render() { - const button = ( - - {this.props.name} - - ); - - return ( - - - - {!this.props.items && } - {this.props.items && this.props.items.length === 0 && ( - - - No options avaliable - - - )} - {this.props.items && - this.props.items.map((tag: any) => ( - - - - - this.props.actionHandler(AssignmentActionType.Assign, tag.id) - } - onClickAriaLabel={tag.id} - tag={tag} - /> - - - - ))} - - - - ); - } - private onButtonClick = async () => { - this.props.actionHandler(AssignmentActionType.Reload); - this.setState((prevState) => ({ - isPopoverOpen: !prevState.isPopoverOpen, - })); - }; - - private closePopover = () => { - this.setState({ - isPopoverOpen: false, - }); - }; -} diff --git a/x-pack/plugins/beats_management/public/components/table/index.ts b/x-pack/plugins/beats_management/public/components/table/index.ts deleted file mode 100644 index bc6590c2e5c21c..00000000000000 --- a/x-pack/plugins/beats_management/public/components/table/index.ts +++ /dev/null @@ -1,16 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -export { beatsListActions, tagConfigActions } from './action_schema'; -export { AssignmentActionType, KueryBarProps, Table } from './table'; -export { - ActionDefinition, - BeatDetailTagsTable, - BeatsTableType, - FilterDefinition, - TagsTableType, -} from './table_type_configs'; diff --git a/x-pack/plugins/beats_management/public/components/table/table.tsx b/x-pack/plugins/beats_management/public/components/table/table.tsx deleted file mode 100644 index f22799c8b55b71..00000000000000 --- a/x-pack/plugins/beats_management/public/components/table/table.tsx +++ /dev/null @@ -1,160 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { EuiBasicTable, EuiFlexGroup, EuiFlexItem, EuiSpacer } from '@elastic/eui'; -import { i18n } from '@kbn/i18n'; -import React from 'react'; -import styled from 'styled-components'; -import { QuerySuggestion } from '../../../../../../src/plugins/data/public'; -import { TABLE_CONFIG } from '../../../common/constants'; -import { AutocompleteField } from '../autocomplete_field/index'; -import { ControlSchema } from './action_schema'; -import { OptionControl } from './controls/option_control'; -import { TableType } from './table_type_configs'; - -export enum AssignmentActionType { - Add, - Assign, - Delete, - Edit, - Reload, - Search, -} - -export interface KueryBarProps { - filterQueryDraft: string; - isLoadingSuggestions: boolean; - isValid: boolean; - loadSuggestions: (value: string, cursorPosition: number, maxCount?: number) => void; - onChange?: (value: string) => void; - onSubmit?: (value: string) => void; - suggestions: QuerySuggestion[]; - value: string; -} - -interface TableProps { - actions?: ControlSchema[]; - actionData?: { - [key: string]: any; - }; - hideTableControls?: boolean; - kueryBarProps?: KueryBarProps; - items: any[]; - onTableChange?: (index: number, size: number) => void; - type: TableType; - actionHandler?(action: AssignmentActionType, payload?: any): void; -} - -interface TableState { - selection: any[]; - pageIndex: number; -} - -const TableContainer = styled.div` - padding: 16px; -`; - -export class Table extends React.Component { - constructor(props: any) { - super(props); - - this.state = { - selection: [], - pageIndex: 0, - }; - } - - public resetSelection = () => { - this.setSelection([]); - }; - - public setSelection = (selection: any[]) => { - this.setState({ - selection, - }); - }; - - public actionHandler = (action: AssignmentActionType, payload?: any): void => { - if (this.props.actionHandler) { - this.props.actionHandler(action, payload); - } - }; - - public render() { - const { actionData, actions, hideTableControls, items, kueryBarProps, type } = this.props; - - const pagination = { - pageIndex: this.state.pageIndex, - pageSize: TABLE_CONFIG.INITIAL_ROW_SIZE, - pageSizeOptions: TABLE_CONFIG.PAGE_SIZE_OPTIONS, - }; - - const selectionOptions = hideTableControls - ? undefined - : { - onSelectionChange: this.setSelection, - selectable: () => true, - selectableMessage: () => - i18n.translate('xpack.beatsManagement.table.selectThisBeatTooltip', { - defaultMessage: 'Select this beat', - }), - selection: this.state.selection, - }; - - return ( - - - {actions && - actions.map((action) => ( - - - - ))} - - {kueryBarProps && ( - - - - )} - - - - - - ); - } - - private onTableChange = ({ page }: { page: { index: number; size: number } }) => { - if (this.props.onTableChange) { - this.props.onTableChange(page.index, page.size); - } - this.setState({ - pageIndex: page.index, - }); - }; -} diff --git a/x-pack/plugins/beats_management/public/components/table/table_type_configs.tsx b/x-pack/plugins/beats_management/public/components/table/table_type_configs.tsx deleted file mode 100644 index 56cf99b01e8d99..00000000000000 --- a/x-pack/plugins/beats_management/public/components/table/table_type_configs.tsx +++ /dev/null @@ -1,345 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { EuiFlexGroup, EuiFlexItem, EuiHealth, EuiToolTip, IconColor } from '@elastic/eui'; -import { i18n } from '@kbn/i18n'; -import { sortBy, uniqBy } from 'lodash'; -import moment from 'moment'; -import React from 'react'; -import { BeatTag, CMBeat } from '../../../common/domain_types'; -import { ConnectedLink } from '../navigation/connected_link'; -import { TagBadge } from '../tag'; - -export interface ColumnDefinition { - align?: 'left' | 'right' | 'center' | undefined; - field: string; - name: string; - sortable?: boolean; - width?: string; - render?(value: any, object?: any): any; -} - -export interface ActionDefinition { - action: string; - danger?: boolean; - icon?: any; - name: string; -} - -interface FilterOption { - value: string; -} - -export interface FilterDefinition { - field: string; - name: string; - options?: FilterOption[]; - type: string; -} - -export interface ControlDefinitions { - actions: ActionDefinition[]; - filters: FilterDefinition[]; - primaryActions?: ActionDefinition[]; -} - -export interface TableType { - itemType: 'Beats' | 'Tags'; - columnDefinitions: ColumnDefinition[]; - controlDefinitions(items: any[]): ControlDefinitions; -} - -const dynamicStatuses = { - STARTING: { - color: 'success', - status: i18n.translate('xpack.beatsManagement.beatsTable.startingStatusLabel', { - defaultMessage: 'Starting', - }), - details: i18n.translate('xpack.beatsManagement.beatsTable.configStatus.startingTooltip', { - defaultMessage: 'This Beat is starting.', - }), - }, - IN_PROGRESS: { - color: 'warning', - status: i18n.translate('xpack.beatsManagement.beatsTable.updatingStatusLabel', { - defaultMessage: 'Updating', - }), - details: i18n.translate('xpack.beatsManagement.beatsTable.configStatus.progressTooltip', { - defaultMessage: 'This Beat is currently reloading config from CM.', - }), - }, - RUNNING: { - color: 'success', - status: i18n.translate('xpack.beatsManagement.beatsTable.runningStatusLabel', { - defaultMessage: 'Running', - }), - details: i18n.translate('xpack.beatsManagement.beatsTable.configStatus.runningTooltip', { - defaultMessage: 'This Beat is running without issues.', - }), - }, - CONFIG: { - color: 'danger', - status: i18n.translate('xpack.beatsManagement.beatsTable.configErrorStatusLabel', { - defaultMessage: 'Config error', - }), - }, - FAILED: { - color: 'danger', - status: i18n.translate('xpack.beatsManagement.beatsTable.failedStatusLabel', { - defaultMessage: 'Error', - }), - details: i18n.translate('xpack.beatsManagement.beatsTable.configStatus.errorTooltip', { - defaultMessage: 'There is an error on this beat, please check the logs for this host.', - }), - }, - STOPPED: { - color: 'danger', - status: i18n.translate('xpack.beatsManagement.beatsTable.stoppedStatusLabel', { - defaultMessage: 'stopped', - }), - details: i18n.translate('xpack.beatsManagement.beatsTable.configStatus.errorTooltip', { - defaultMessage: 'There is an error on this beat, please check the logs for this host.', - }), - }, -}; - -export const BeatsTableType: TableType = { - itemType: 'Beats', - columnDefinitions: [ - { - field: 'name', - name: i18n.translate('xpack.beatsManagement.beatsTable.beatNameTitle', { - defaultMessage: 'Beat name', - }), - render: (name: string, beat: CMBeat) => ( - {name} - ), - sortable: true, - }, - { - field: 'type', - name: i18n.translate('xpack.beatsManagement.beatsTable.typeTitle', { - defaultMessage: 'Type', - }), - sortable: true, - }, - { - field: 'full_tags', - name: i18n.translate('xpack.beatsManagement.beatsTable.tagsTitle', { - defaultMessage: 'Tags', - }), - render: (value: string, beat: CMBeat & { tags: BeatTag[] }) => ( - - {(sortBy(beat.tags, 'id') || []).map((tag) => ( - - - - - - ))} - - ), - sortable: false, - }, - { - field: 'config_status', - name: i18n.translate('xpack.beatsManagement.beatsTable.configStatusTitle', { - defaultMessage: 'Config Status', - }), - render: (value: string, beat: CMBeat) => { - let color: IconColor = 'success'; - let statusText = i18n.translate('xpack.beatsManagement.beatsTable.configStatus.okLabel', { - defaultMessage: 'OK', - }); - let tooltipText = i18n.translate( - 'xpack.beatsManagement.beatsTable.configStatus.okTooltip', - { - defaultMessage: 'Beat successfully applied latest config', - } - ); - - if (beat.status && moment().diff(beat.last_checkin, 'minutes') < 10) { - color = dynamicStatuses[beat.status.event.type].color; - statusText = dynamicStatuses[beat.status.event.type].status; - tooltipText = - (dynamicStatuses[beat.status.event.type] as any).details || beat.status.event.message; - } else if (!beat.status && moment().diff(beat.last_checkin, 'minutes') >= 10) { - color = 'danger'; - statusText = i18n.translate( - 'xpack.beatsManagement.beatsTable.configStatus.offlineLabel', - { - defaultMessage: 'Offline', - } - ); - tooltipText = i18n.translate( - 'xpack.beatsManagement.beatsTable.configStatus.noConnectionTooltip', - { - defaultMessage: 'This Beat has not connected to kibana in over 10min', - } - ); - } else if (beat.status && moment().diff(beat.last_checkin, 'minutes') >= 10) { - color = 'subdued'; - - tooltipText = i18n.translate( - 'xpack.beatsManagement.beatsTable.configStatus.notStartedTooltip', - { - defaultMessage: 'This Beat has not yet been started.', - } - ); - statusText = i18n.translate( - 'xpack.beatsManagement.beatsTable.configStatus.notStartedLabel', - { - defaultMessage: 'Not started', - } - ); - } else { - color = 'subdued'; - statusText = i18n.translate( - 'xpack.beatsManagement.beatsTable.configStatus.offlineLabel', - { - defaultMessage: 'Offline', - } - ); - } - - return ( - - - {statusText} - - - ); - }, - sortable: false, - }, - // { - // field: 'full_tags', - // name: i18n.translate('xpack.beatsManagement.beatsTable.lastConfigUpdateTitle', { - // defaultMessage: 'Last config update', - // }), - // render: (tags?: BeatTag[]) => - // tags && tags.length ? ( - // - // {moment(first(orderBy(tags, ['last_updated'], ['desc'])).last_updated).fromNow()} - // - // ) : null, - // sortable: true, - // }, - ], - controlDefinitions: (data: any[]) => ({ - actions: [ - { - name: i18n.translate('xpack.beatsManagement.beatsTable.disenrollSelectedLabel', { - defaultMessage: 'Unenroll Selected', - }), - action: 'delete', - danger: true, - }, - ], - filters: [ - { - type: 'field_value_selection', - field: 'type', - name: i18n.translate('xpack.beatsManagement.beatsTable.typeLabel', { - defaultMessage: 'Type', - }), - options: uniqBy( - data.map(({ type }: { type: any }) => ({ value: type })), - 'value' - ), - }, - ], - }), -}; - -export const TagsTableType: TableType = { - itemType: 'Tags', - columnDefinitions: [ - { - field: 'id', - name: i18n.translate('xpack.beatsManagement.tagsTable.tagNameTitle', { - defaultMessage: 'Tag name', - }), - render: (id: string, tag: BeatTag) => ( - - - - ), - sortable: true, - width: '45%', - }, - { - align: 'right', - field: 'last_updated', - name: i18n.translate('xpack.beatsManagement.tagsTable.lastUpdateTitle', { - defaultMessage: 'Last update', - }), - render: (lastUpdate: Date) =>
{moment(lastUpdate).fromNow()}
, - sortable: true, - }, - ], - controlDefinitions: (data: any) => ({ - actions: [ - { - name: i18n.translate('xpack.beatsManagement.tagsTable.removeSelectedLabel', { - defaultMessage: 'Remove Selected', - }), - action: 'delete', - danger: true, - }, - ], - filters: [], - }), -}; - -export const BeatDetailTagsTable: TableType = { - itemType: 'Tags', - columnDefinitions: [ - { - field: 'id', - name: i18n.translate('xpack.beatsManagement.beatTagsTable.tagNameTitle', { - defaultMessage: 'Tag name', - }), - render: (id: string, tag: BeatTag) => ( - - - - ), - sortable: true, - width: '55%', - }, - { - align: 'right', - field: 'last_updated', - name: i18n.translate('xpack.beatsManagement.beatTagsTable.lastUpdateTitle', { - defaultMessage: 'Last update', - }), - render: (lastUpdate: string) => {moment(lastUpdate).fromNow()}, - sortable: true, - }, - ], - controlDefinitions: (data: any) => ({ - actions: [], - filters: [], - primaryActions: [ - { - name: i18n.translate('xpack.beatsManagement.beatTagsTable.addTagLabel', { - defaultMessage: 'Add Tag', - }), - action: 'add', - danger: false, - }, - { - name: i18n.translate('xpack.beatsManagement.beatTagsTable.removeSelectedLabel', { - defaultMessage: 'Remove Selected', - }), - action: 'remove', - danger: true, - }, - ], - }), -}; diff --git a/x-pack/plugins/beats_management/public/components/tag/config_view/config_form.tsx b/x-pack/plugins/beats_management/public/components/tag/config_view/config_form.tsx deleted file mode 100644 index a3512a395570f0..00000000000000 --- a/x-pack/plugins/beats_management/public/components/tag/config_view/config_form.tsx +++ /dev/null @@ -1,216 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -// @ts-ignore -import { i18n } from '@kbn/i18n'; -import Formsy from 'formsy-react'; -import { get } from 'lodash'; -import React from 'react'; -import { ConfigBlockSchema, ConfigurationBlock } from '../../../../common/domain_types'; -import { - FormsyEuiCodeEditor, - FormsyEuiFieldText, - FormsyEuiMultiFieldText, - FormsyEuiPasswordText, - FormsyEuiSelect, -} from '../../inputs'; - -interface ComponentProps { - values: ConfigurationBlock; - schema: ConfigBlockSchema; - id: string; - onSubmit?: (modal: any) => any; - canSubmit(canIt: boolean): any; -} - -interface ComponentState { - canSubmit: boolean; -} - -class ConfigFormUi extends React.Component { - private form = React.createRef(); - constructor(props: ComponentProps) { - super(props); - - this.state = { - canSubmit: false, - }; - } - - public enableButton = () => { - this.setState({ - canSubmit: true, - }); - this.props.canSubmit(true); - }; - public disableButton = () => { - this.setState({ - canSubmit: false, - }); - this.props.canSubmit(false); - }; - public submit = () => { - if (this.form.current && this.props.onSubmit) { - this.form.current.click(); - } - }; - public onValidSubmit = (model: ModelType) => { - if (!this.props.onSubmit) { - return; - } - - this.props.onSubmit(model); - }; - public render() { - return ( -
-
- - {this.props.schema.configs.map((schema) => { - switch (schema.ui.type) { - case 'input': - return ( - - ); - case 'password': - return ( - - ); - case 'multi-input': - return ( - - ); - case 'select': - return ( - - ); - case 'code': - return ( - - ); - } - })} - {this.props.schema && ( - - )} - {this.props.onSubmit && ( -
- ); - } -} -export const ConfigForm = ConfigFormUi; diff --git a/x-pack/plugins/beats_management/public/components/tag/config_view/index.tsx b/x-pack/plugins/beats_management/public/components/tag/config_view/index.tsx deleted file mode 100644 index 601d517e95e9e5..00000000000000 --- a/x-pack/plugins/beats_management/public/components/tag/config_view/index.tsx +++ /dev/null @@ -1,189 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { - EuiButton, - EuiButtonEmpty, - EuiFieldText, - EuiFlexGroup, - EuiFlexItem, - EuiFlyout, - EuiFlyoutBody, - EuiFlyoutFooter, - EuiFlyoutHeader, - EuiFormRow, - EuiHorizontalRule, - EuiSelect, - EuiSpacer, - EuiTitle, -} from '@elastic/eui'; -import { i18n } from '@kbn/i18n'; -import React from 'react'; -import { configBlockSchemas } from '../../../../common/config_schemas'; -import { translateConfigSchema } from '../../../../common/config_schemas_translations_map'; -import { ConfigurationBlock } from '../../../../common/domain_types'; -import { ConfigForm } from './config_form'; - -interface ComponentProps { - configBlock?: ConfigurationBlock; - onClose(): any; - onSave?(config: ConfigurationBlock): any; -} - -interface ComponentState { - valid: boolean; - configBlock: ConfigurationBlock; -} - -class ConfigViewUi extends React.Component { - private form = React.createRef(); - private editMode: boolean; - private schema = translateConfigSchema(configBlockSchemas); - constructor(props: any) { - super(props); - this.editMode = props.configBlock !== undefined; - - this.state = { - valid: false, - configBlock: props.configBlock || { - type: this.schema[0].id, - }, - }; - } - public onValueChange = (field: string) => (e: any) => { - const value = e.currentTarget ? e.currentTarget.value : e; - this.setState((state: any) => ({ - configBlock: { - ...state.configBlock, - [field]: value, - }, - })); - }; - public render() { - const thisConfigSchema = this.schema.find((s) => this.state.configBlock.type === s.id); - - if (!thisConfigSchema) { - return i18n.translate('xpack.beatsManagement.tagConfig.invalidSchema', { - defaultMessage: - 'Error: This config is invalid, it is not supported by Beats and should be removed', - }); - } - return ( - - - -

- {this.editMode - ? this.props.onSave - ? i18n.translate('xpack.beatsManagement.tagConfig.editConfigurationTitle', { - defaultMessage: 'Edit configuration block', - }) - : i18n.translate('xpack.beatsManagement.tagConfig.viewConfigurationTitle"', { - defaultMessage: 'View configuration block', - }) - : i18n.translate('xpack.beatsManagement.tagConfig.addConfigurationTitle"', { - defaultMessage: 'Add configuration block', - })} -

-
-
- - - ({ value: s.id, text: s.name }))} - value={this.state.configBlock.type} - disabled={this.editMode} - onChange={this.onValueChange('type')} - /> - - - - - -

- {i18n.translate('xpack.beatsManagement.tagConfig.configurationTypeText', { - defaultMessage: '{configType} configuration', - values: { - configType: thisConfigSchema ? thisConfigSchema.name : 'Unknown', - }, - })} -

- - - { - if (this.props.onSave) { - this.props.onSave({ - ...this.state.configBlock, - config: data, - }); - } - this.props.onClose(); - } - : undefined - } - canSubmit={(canIt) => this.setState({ valid: canIt })} - ref={this.form} - values={this.state.configBlock} - id={thisConfigSchema ? thisConfigSchema.name : 'Undefined'} - schema={thisConfigSchema} - /> -
- - - - - {i18n.translate('xpack.beatsManagement.tagConfig.closeButtonLabel', { - defaultMessage: 'Close', - })} - - - {this.props.onSave && ( - - { - if (this.form.current) { - this.form.current.submit(); - } - }} - > - {i18n.translate('xpack.beatsManagement.tagConfig.saveButtonLabel', { - defaultMessage: 'Save', - })} - - - )} - - -
- ); - } -} - -export const ConfigView = ConfigViewUi; diff --git a/x-pack/plugins/beats_management/public/components/tag/index.ts b/x-pack/plugins/beats_management/public/components/tag/index.ts deleted file mode 100644 index 9bf533537a3b51..00000000000000 --- a/x-pack/plugins/beats_management/public/components/tag/index.ts +++ /dev/null @@ -1,9 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -export { TagBadge } from './tag_badge'; -export { TagEdit } from './tag_edit'; diff --git a/x-pack/plugins/beats_management/public/components/tag/tag_badge.tsx b/x-pack/plugins/beats_management/public/components/tag/tag_badge.tsx deleted file mode 100644 index 0940b9c4fbdf91..00000000000000 --- a/x-pack/plugins/beats_management/public/components/tag/tag_badge.tsx +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { EuiBadge, EuiBadgeProps } from '@elastic/eui'; -import React from 'react'; -import { TABLE_CONFIG } from '../../../common/constants'; - -type TagBadgeProps = EuiBadgeProps & { - maxIdRenderSize?: number; - tag: { name: string; color: string; disabled?: boolean; id: string }; -}; - -export const TagBadge = (props: TagBadgeProps) => { - const { iconType, onClick, onClickAriaLabel, tag } = props; - const maxIdRenderSize = props.maxIdRenderSize || TABLE_CONFIG.TRUNCATE_TAG_LENGTH; - const idToRender = `${tag.name.substring(0, maxIdRenderSize)}${ - tag.name.length > maxIdRenderSize ? '...' : '' - }`; - - if (tag.disabled) { - return ( - - {idToRender} - - ); - } else if (onClick && onClickAriaLabel) { - return ( - } - onClickAriaLabel={onClickAriaLabel} - > - {idToRender} - - ); - } else { - return ( - - {idToRender} - - ); - } -}; diff --git a/x-pack/plugins/beats_management/public/components/tag/tag_edit.tsx b/x-pack/plugins/beats_management/public/components/tag/tag_edit.tsx deleted file mode 100644 index bbf5a8407905e5..00000000000000 --- a/x-pack/plugins/beats_management/public/components/tag/tag_edit.tsx +++ /dev/null @@ -1,238 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { - EuiButton, - // @ts-ignore - EuiColorPicker, - EuiFieldText, - EuiFlexGroup, - EuiFlexItem, - // @ts-ignore - EuiForm, - EuiFormRow, - EuiHorizontalRule, - EuiSpacer, - EuiText, - EuiTitle, -} from '@elastic/eui'; -import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; -import 'brace/mode/yaml'; -import 'brace/theme/github'; -import React from 'react'; -import { BeatTag, CMBeat, ConfigurationBlock } from '../../../common/domain_types'; -import { ConfigList } from '../config_list'; -import { AssignmentActionType, BeatsTableType, Table, tagConfigActions } from '../table'; -import { ConfigView } from './config_view'; -import { TagBadge } from './tag_badge'; - -interface TagEditProps { - tag: BeatTag; - configuration_blocks: { - error?: string | undefined; - list: ConfigurationBlock[]; - page: number; - total: number; - }; - onConfigListChange: (index: number, size: number) => void; - onDetachBeat?: (beatIds: string[]) => void; - onTagChange: (field: keyof BeatTag, value: string) => any; - onConfigAddOrEdit: (block: ConfigurationBlock) => any; - onConfigRemoved: (block: ConfigurationBlock) => any; - attachedBeats?: CMBeat[]; -} - -interface TagEditState { - showFlyout: boolean; - tableRef: any; - selectedConfig?: ConfigurationBlock; -} - -export class TagEdit extends React.PureComponent { - constructor(props: TagEditProps) { - super(props); - - this.state = { - showFlyout: false, - tableRef: React.createRef(), - }; - } - - public render() { - // eslint-disable-next-line @typescript-eslint/naming-convention - const { tag, attachedBeats, configuration_blocks } = this.props; - - return ( -
- - - -

- -

-
- -

- -

-
-
- -
-
- - - - } - isInvalid={!!this.getNameError(tag.name)} - error={this.getNameError(tag.name) || undefined} - > - - - - - - - -
- - - - - -

- -

-
- -

- -

-
-
- -
- { - if (action === 'delete') { - this.props.onConfigRemoved(block); - } else { - this.setState({ - showFlyout: true, - selectedConfig: block, - }); - } - }} - /> -
- { - this.setState({ showFlyout: true }); - }} - > - - -
-
-
- - {attachedBeats && ( -
- - - -

- -

-
- - - )} - {this.state.showFlyout && ( - this.setState({ showFlyout: false, selectedConfig: undefined })} - onSave={(config: ConfigurationBlock) => { - this.setState({ showFlyout: false, selectedConfig: undefined }); - this.props.onConfigAddOrEdit(config); - }} - /> - )} - - ); - } - - private getNameError = (name: string) => { - if (name && name !== '' && name.search(/^[a-zA-Z0-9-]+$/) === -1) { - return i18n.translate('xpack.beatsManagement.tag.tagName.validationErrorMessage', { - defaultMessage: 'Tag name must consist of letters, numbers, and dashes only', - }); - } else { - return false; - } - }; - - private handleAssignmentActions = (action: AssignmentActionType) => { - switch (action) { - case AssignmentActionType.Delete: - const { selection } = this.state.tableRef.current.state; - if (this.props.onDetachBeat) { - this.props.onDetachBeat(selection.map((beat: any) => beat.id)); - } - } - }; - - private updateTag = (key: keyof BeatTag, value?: any) => - value !== undefined - ? this.props.onTagChange(key, value) - : (e: any) => this.props.onTagChange(key, e.target ? e.target.value : e); -} diff --git a/x-pack/plugins/beats_management/public/containers/beats.ts b/x-pack/plugins/beats_management/public/containers/beats.ts deleted file mode 100644 index 73f77c08282e10..00000000000000 --- a/x-pack/plugins/beats_management/public/containers/beats.ts +++ /dev/null @@ -1,104 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { Container } from 'unstated'; -import { CMBeat } from '../../common/domain_types'; -// eslint-disable-next-line @kbn/eslint/no-restricted-paths -import type { BeatsTagAssignment } from '../../server/lib/adapters/beats/adapter_types'; -import { FrontendLibs } from './../lib/types'; - -interface ContainerState { - list: CMBeat[]; -} - -export class BeatsContainer extends Container { - private query?: string; - constructor(private readonly libs: FrontendLibs) { - super(); - this.state = { - list: [], - }; - } - - public getBeatWithToken = async (token: string) => { - const beat = await this.libs.beats.getBeatWithToken(token); - - if (beat) { - this.setState({ - list: [beat as CMBeat, ...this.state.list], - }); - return beat as CMBeat; - } - return null; - }; - - public reload = async (kuery?: string) => { - if (kuery) { - this.query = kuery; - } else { - this.query = undefined; - } - const beats = await this.libs.beats.getAll(this.query); - - this.setState({ - list: beats, - }); - }; - - public deactivate = async (beats: CMBeat[]) => { - for (const beat of beats) { - await this.libs.beats.update(beat.id, { active: false }); - } - - // because the compile code above has a very minor race condition, we wait, - // the max race condition time is really 10ms but doing 100 to be safe - setTimeout(async () => { - await this.reload(this.query); - }, 100); - }; - - public toggleTagAssignment = async (tagId: string, beats: CMBeat[]) => { - if (beats.some((beat) => beat.tags !== undefined && beat.tags.some((id) => id === tagId))) { - await this.removeTagsFromBeats(beats, tagId); - return 'removed'; - } - await this.assignTagsToBeats(beats, tagId); - return 'added'; - }; - - public removeTagsFromBeats = async (beats: CMBeat[] | string[], tagId: string) => { - if (!beats.length) { - return false; - } - const assignments = createBeatTagAssignments(beats, tagId); - await this.libs.beats.removeTagsFromBeats(assignments); - // ES responds incorrectly when we call too soon - setTimeout(async () => { - await this.reload(this.query); - }, 150); - }; - - public assignTagsToBeats = async (beats: CMBeat[] | string[], tagId: string) => { - if (!beats.length) { - return false; - } - const assignments = createBeatTagAssignments(beats, tagId); - await this.libs.beats.assignTagsToBeats(assignments); - // ES responds incorrectly when we call too soon - setTimeout(async () => { - await this.reload(this.query); - }, 150); - }; -} - -function createBeatTagAssignments(beats: CMBeat[] | string[], tagId: string): BeatsTagAssignment[] { - if (typeof beats[0] === 'string') { - return (beats as string[]).map((id) => ({ beatId: id, tag: tagId })); - } else { - return (beats as CMBeat[]).map(({ id }) => ({ beatId: id, tag: tagId })); - } -} diff --git a/x-pack/plugins/beats_management/public/containers/tags.ts b/x-pack/plugins/beats_management/public/containers/tags.ts deleted file mode 100644 index f7b4996fc750d8..00000000000000 --- a/x-pack/plugins/beats_management/public/containers/tags.ts +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { Container } from 'unstated'; -import { BeatTag } from '../../common/domain_types'; -import { FrontendLibs } from '../lib/types'; - -interface ContainerState { - list: BeatTag[]; -} - -export class TagsContainer extends Container { - private query?: string; - constructor(private readonly libs: FrontendLibs) { - super(); - this.state = { - list: [], - }; - } - public reload = async (kuery?: string) => { - if (kuery) { - this.query = kuery; - } else { - this.query = undefined; - } - - const tags = await this.libs.tags.getAll(this.query); - - this.setState({ - list: tags, - }); - }; - - public delete = async (tags: BeatTag[]) => { - const tagIds = tags.map((tag: BeatTag) => tag.id); - const success = await this.libs.tags.delete(tagIds); - if (success) { - this.setState({ - list: this.state.list.filter((tag) => tagIds.includes(tag.id)), - }); - } - return success; - }; - - public upsertTag = async (tag: BeatTag) => { - const beatTag = await this.libs.tags.upsertTag(tag); - await this.reload(); - return beatTag !== null; - }; -} diff --git a/x-pack/plugins/beats_management/public/containers/with_kuery_autocompletion.tsx b/x-pack/plugins/beats_management/public/containers/with_kuery_autocompletion.tsx deleted file mode 100644 index 5bd3a4194d4f77..00000000000000 --- a/x-pack/plugins/beats_management/public/containers/with_kuery_autocompletion.tsx +++ /dev/null @@ -1,89 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import React from 'react'; - -import { QuerySuggestion } from '../../../../../src/plugins/data/public'; - -import { FrontendLibs } from '../lib/types'; -import { RendererFunction } from '../utils/typed_react'; - -interface WithKueryAutocompletionLifecycleProps { - libs: FrontendLibs; - fieldPrefix?: string; - children: RendererFunction<{ - isLoadingSuggestions: boolean; - loadSuggestions: (expression: string, cursorPosition: number, maxSuggestions?: number) => void; - suggestions: QuerySuggestion[]; - }>; -} - -interface WithKueryAutocompletionLifecycleState { - // lacking cancellation support in the autocompletion api, - // this is used to keep older, slower requests from clobbering newer ones - currentRequest: { - expression: string; - cursorPosition: number; - } | null; - suggestions: QuerySuggestion[]; -} - -export class WithKueryAutocompletion extends React.Component< - WithKueryAutocompletionLifecycleProps, - WithKueryAutocompletionLifecycleState -> { - public readonly state: WithKueryAutocompletionLifecycleState = { - currentRequest: null, - suggestions: [], - }; - - public render() { - const { currentRequest, suggestions } = this.state; - - return this.props.children({ - isLoadingSuggestions: currentRequest !== null, - loadSuggestions: this.loadSuggestions, - suggestions, - }); - } - - private loadSuggestions = async ( - expression: string, - cursorPosition: number, - maxSuggestions?: number - ) => { - this.setState({ - currentRequest: { - expression, - cursorPosition, - }, - suggestions: [], - }); - let suggestions: any[] = []; - try { - suggestions = await this.props.libs.elasticsearch.getSuggestions( - expression, - cursorPosition, - this.props.fieldPrefix - ); - } catch (e) { - suggestions = []; - } - - this.setState((state) => - state.currentRequest && - state.currentRequest.expression !== expression && - state.currentRequest.cursorPosition !== cursorPosition - ? state // ignore this result, since a newer request is in flight - : { - ...state, - currentRequest: null, - suggestions: maxSuggestions ? suggestions.slice(0, maxSuggestions) : suggestions, - } - ); - }; -} diff --git a/x-pack/plugins/beats_management/public/containers/with_url_state.tsx b/x-pack/plugins/beats_management/public/containers/with_url_state.tsx deleted file mode 100644 index a72a60bf04a184..00000000000000 --- a/x-pack/plugins/beats_management/public/containers/with_url_state.tsx +++ /dev/null @@ -1,101 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { parse, stringify } from 'query-string'; -import React from 'react'; -import { withRouter, RouteComponentProps } from 'react-router-dom'; -import { FlatObject } from '../frontend_types'; -import { RendererFunction } from '../utils/typed_react'; - -type StateCallback = (previousState: T) => T; - -export interface URLStateProps { - goTo: (path: string) => void; - setUrlState: ( - newState: - | Partial> - | StateCallback - | Promise> - ) => void; - urlState: URLState; -} -interface ComponentProps extends RouteComponentProps { - children: RendererFunction>; -} - -export class WithURLStateComponent extends React.Component< - ComponentProps -> { - private get URLState(): URLState { - // slice because parse does not account for the initial ? in the search string - return parse(decodeURIComponent(this.props.history.location.search).substring(1), { - sort: false, - }) as URLState; - } - - private historyListener: (() => void) | null = null; - - public componentWillUnmount() { - if (this.historyListener) { - this.historyListener(); - } - } - public render() { - return this.props.children({ - goTo: this.goTo, - setUrlState: this.setURLState, - urlState: this.URLState || {}, - }); - } - - private setURLState = async ( - state: - | Partial> - | StateCallback - | Promise> - ) => { - let newState; - const pastState = this.URLState; - if (typeof state === 'function') { - newState = await state(pastState); - } else { - newState = state; - } - - const search: string = stringify( - { - ...pastState, - ...newState, - }, - { sort: false } - ); - - const newLocation = { - ...this.props.history.location, - search, - }; - - this.props.history.replace(newLocation); - this.forceUpdate(); - }; - - private goTo = (path: string) => { - this.props.history.push({ - pathname: path, - search: this.props.history.location.search, - }); - }; -} -export const WithURLState = withRouter(WithURLStateComponent); - -export function withUrlState(UnwrappedComponent: React.ComponentType) { - return (origProps: OP) => ( - - {(URLProps: URLStateProps) => } - - ); -} diff --git a/x-pack/plugins/beats_management/public/frontend_types.d.ts b/x-pack/plugins/beats_management/public/frontend_types.d.ts deleted file mode 100644 index 2fa6da067d2b0d..00000000000000 --- a/x-pack/plugins/beats_management/public/frontend_types.d.ts +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { RouteComponentProps } from 'react-router-dom'; -import { BeatsContainer } from './containers/beats'; -import { TagsContainer } from './containers/tags'; -import { URLStateProps } from './containers/with_url_state'; -import { FrontendLibs } from './lib/types'; - -export type FlatObject = { [Key in keyof T]: string }; - -export interface AppURLState { - beatsKBar?: string; - tagsKBar?: string; - enrollmentToken?: string; - createdTag?: string; -} - -export interface RouteConfig { - path: string; - component: React.ComponentType; - routes?: RouteConfig[]; -} - -export interface AppPageProps extends URLStateProps, RouteComponentProps { - libs: FrontendLibs; - containers: { - beats: BeatsContainer; - tags: TagsContainer; - }; - routes?: RouteConfig[]; -} diff --git a/x-pack/plugins/beats_management/public/index.ts b/x-pack/plugins/beats_management/public/index.ts deleted file mode 100644 index da124a3c50da13..00000000000000 --- a/x-pack/plugins/beats_management/public/index.ts +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { CoreSetup, Plugin, PluginInitializerContext } from '../../../../src/core/public'; - -import { ManagementSetup } from '../../../../src/plugins/management/public'; -import { SecurityPluginSetup } from '../../security/public'; -import { DataPublicPluginStart } from '../../../../src/plugins/data/public'; -import { LicensingPluginSetup } from '../../licensing/public'; - -import { bootstrap } from './bootstrap'; -import { BeatsManagementConfigType } from '../common'; - -interface SetupDeps { - management: ManagementSetup; - licensing: LicensingPluginSetup; - security?: SecurityPluginSetup; -} - -interface StartDeps { - data: DataPublicPluginStart; -} - -class BeatsManagementPlugin implements Plugin { - constructor(private readonly initContext: PluginInitializerContext) {} - - public setup(core: CoreSetup, plugins: SetupDeps) { - const config = this.initContext.config.get(); - bootstrap(core, plugins, config, this.initContext.env.packageInfo.version); - } - - public start() {} - public stop() {} -} - -export const plugin = (init: PluginInitializerContext) => new BeatsManagementPlugin(init); diff --git a/x-pack/plugins/beats_management/public/kbn_services.ts b/x-pack/plugins/beats_management/public/kbn_services.ts deleted file mode 100644 index 7c7ddef0dabc4e..00000000000000 --- a/x-pack/plugins/beats_management/public/kbn_services.ts +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { CoreStart } from '../../../../src/core/public'; -import { DataPublicPluginStart } from '../../../../src/plugins/data/public'; -import { ManagementAppMountParams } from '../../../../src/plugins/management/public'; - -export const services = { - I18nContext: (null as any) as CoreStart['i18n']['Context'], - setBreadcrumbs: (null as any) as ManagementAppMountParams['setBreadcrumbs'], - dataStart: (null as any) as DataPublicPluginStart, -}; - -export const setServices = ( - core: CoreStart, - plugins: { data: DataPublicPluginStart }, - params: ManagementAppMountParams -) => { - services.I18nContext = core.i18n.Context; - services.setBreadcrumbs = params.setBreadcrumbs; - services.dataStart = plugins.data; -}; diff --git a/x-pack/plugins/beats_management/public/lib/adapters/beats/adapter_types.ts b/x-pack/plugins/beats_management/public/lib/adapters/beats/adapter_types.ts deleted file mode 100644 index da61655e2c8564..00000000000000 --- a/x-pack/plugins/beats_management/public/lib/adapters/beats/adapter_types.ts +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { CMBeat } from '../../../../common/domain_types'; -import { ReturnTypeBulkAction } from '../../../../common/return_types'; - -export interface CMBeatsAdapter { - get(id: string): Promise; - update(id: string, beatData: Partial): Promise; - getBeatsWithTag(tagId: string): Promise; - getAll(ESQuery?: any): Promise; - removeTagsFromBeats(removals: BeatsTagAssignment[]): Promise; - assignTagsToBeats(assignments: BeatsTagAssignment[]): Promise; - getBeatWithToken(enrollmentToken: string): Promise; -} - -export interface BeatsTagAssignment { - beatId: string; - tag: string; - idxInRequest?: number; -} - -interface BeatsReturnedTagAssignment { - status: number | null; - result?: string; -} - -export interface CMAssignmentReturn { - assignments: BeatsReturnedTagAssignment[]; -} - -export interface BeatsRemovalReturn { - removals: BeatsReturnedTagAssignment[]; -} diff --git a/x-pack/plugins/beats_management/public/lib/adapters/beats/memory_beats_adapter.ts b/x-pack/plugins/beats_management/public/lib/adapters/beats/memory_beats_adapter.ts deleted file mode 100644 index 172635fb14f9ad..00000000000000 --- a/x-pack/plugins/beats_management/public/lib/adapters/beats/memory_beats_adapter.ts +++ /dev/null @@ -1,109 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { omit } from 'lodash'; -import { CMBeat } from '../../../../common/domain_types'; -import { ReturnTypeBulkAction } from '../../../../common/return_types'; -import { BeatsTagAssignment, CMBeatsAdapter } from './adapter_types'; - -export class MemoryBeatsAdapter implements CMBeatsAdapter { - private beatsDB: CMBeat[]; - - constructor(beatsDB: CMBeat[]) { - this.beatsDB = beatsDB; - } - - public async get(id: string) { - return this.beatsDB.find((beat) => beat.id === id) || null; - } - - public async update(id: string, beatData: Partial): Promise { - const index = this.beatsDB.findIndex((beat) => beat.id === id); - - if (index === -1) { - return false; - } - - this.beatsDB[index] = { ...this.beatsDB[index], ...beatData }; - return true; - } - - public async getAll() { - return this.beatsDB.map((beat: any) => omit(beat, ['access_token'])) as CMBeat[]; - } - public async getBeatsWithTag(tagId: string): Promise { - return this.beatsDB.map((beat: any) => omit(beat, ['access_token'])) as CMBeat[]; - } - - public async getBeatWithToken(enrollmentToken: string): Promise { - return this.beatsDB.map((beat: any) => omit(beat, ['access_token']))[0] as CMBeat | null; - } - public async removeTagsFromBeats( - removals: BeatsTagAssignment[] - ): Promise { - const beatIds = removals.map((r) => r.beatId); - - const response = this.beatsDB - .filter((beat) => beatIds.includes(beat.id)) - .map((beat) => { - const tagData = removals.find((r) => r.beatId === beat.id); - if (tagData) { - if (beat.tags) { - beat.tags = beat.tags.filter((tag) => tag !== tagData.tag); - } - } - const removalsForBeat = removals.filter((r) => r.beatId === beat.id); - if (removalsForBeat.length) { - removalsForBeat.forEach((assignment: BeatsTagAssignment) => { - if (beat.tags) { - beat.tags = beat.tags.filter((tag) => tag !== assignment.tag); - } - }); - } - return beat; - }); - - return response.map((item: CMBeat, resultIdx: number) => ({ - idxInRequest: removals[resultIdx].idxInRequest, - result: 'updated', - status: 200, - })) as any; - } - - public async assignTagsToBeats( - assignments: BeatsTagAssignment[] - ): Promise { - const beatIds = assignments.map((r) => r.beatId); - - this.beatsDB - .filter((beat) => beatIds.includes(beat.id)) - .map((beat) => { - // get tags that need to be assigned to this beat - const tags = assignments - .filter((a) => a.beatId === beat.id) - .map((t: BeatsTagAssignment) => t.tag); - - if (tags.length > 0) { - if (!beat.tags) { - beat.tags = []; - } - const nonExistingTags = tags.filter((t: string) => beat.tags && !beat.tags.includes(t)); - - if (nonExistingTags.length > 0) { - beat.tags = beat.tags.concat(nonExistingTags); - } - } - return beat; - }); - - return assignments.map((item: BeatsTagAssignment, resultIdx: number) => ({ - idxInRequest: assignments[resultIdx].idxInRequest, - result: 'updated', - status: 200, - })); - } -} diff --git a/x-pack/plugins/beats_management/public/lib/adapters/beats/rest_beats_adapter.ts b/x-pack/plugins/beats_management/public/lib/adapters/beats/rest_beats_adapter.ts deleted file mode 100644 index 489eb4d721cd34..00000000000000 --- a/x-pack/plugins/beats_management/public/lib/adapters/beats/rest_beats_adapter.ts +++ /dev/null @@ -1,80 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { CMBeat } from '../../../../common/domain_types'; -import { - ReturnTypeBulkAction, - ReturnTypeGet, - ReturnTypeList, - ReturnTypeUpdate, -} from '../../../../common/return_types'; -import { RestAPIAdapter } from '../rest_api/adapter_types'; -import { BeatsTagAssignment, CMBeatsAdapter } from './adapter_types'; - -export class RestBeatsAdapter implements CMBeatsAdapter { - constructor(private readonly REST: RestAPIAdapter) {} - - public async get(id: string): Promise { - try { - return (await this.REST.get>(`/api/beats/agent/${id}`)).item; - } catch (e) { - return null; - } - } - - public async getBeatWithToken(enrollmentToken: string): Promise { - try { - return ( - await this.REST.get>(`/api/beats/agent/unknown/${enrollmentToken}`) - ).item; - } catch (e) { - return null; - } - } - - public async getAll(ESQuery?: string): Promise { - try { - return (await this.REST.get>('/api/beats/agents/all', { ESQuery })) - .list; - } catch (e) { - return []; - } - } - - public async getBeatsWithTag(tagId: string): Promise { - try { - return (await this.REST.get>(`/api/beats/agents/tag/${tagId}`)).list; - } catch (e) { - return []; - } - } - - public async update(id: string, beatData: Partial): Promise { - await this.REST.put>(`/api/beats/agent/${id}`, beatData); - return true; - } - - public async removeTagsFromBeats( - removals: BeatsTagAssignment[] - ): Promise { - return ( - await this.REST.post(`/api/beats/agents_tags/removals`, { - removals, - }) - ).results; - } - - public async assignTagsToBeats( - assignments: BeatsTagAssignment[] - ): Promise { - return ( - await this.REST.post(`/api/beats/agents_tags/assignments`, { - assignments, - }) - ).results; - } -} diff --git a/x-pack/plugins/beats_management/public/lib/adapters/configuration_blocks/adapter_types.ts b/x-pack/plugins/beats_management/public/lib/adapters/configuration_blocks/adapter_types.ts deleted file mode 100644 index 24921f1778b6c0..00000000000000 --- a/x-pack/plugins/beats_management/public/lib/adapters/configuration_blocks/adapter_types.ts +++ /dev/null @@ -1,15 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { ConfigurationBlock } from '../../../../common/domain_types'; -import { ReturnTypeBulkUpsert, ReturnTypeList } from '../../../../common/return_types'; - -export interface FrontendConfigBlocksAdapter { - upsert(blocks: ConfigurationBlock[]): Promise; - getForTags(tagIds: string[], page: number): Promise>; - delete(id: string): Promise; -} diff --git a/x-pack/plugins/beats_management/public/lib/adapters/configuration_blocks/memory_config_blocks_adapter.ts b/x-pack/plugins/beats_management/public/lib/adapters/configuration_blocks/memory_config_blocks_adapter.ts deleted file mode 100644 index 6b3549465e171f..00000000000000 --- a/x-pack/plugins/beats_management/public/lib/adapters/configuration_blocks/memory_config_blocks_adapter.ts +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { ConfigurationBlock } from '../../../../common/domain_types'; -import { ReturnTypeBulkUpsert, ReturnTypeList } from '../../../../common/return_types'; -import { FrontendConfigBlocksAdapter } from './adapter_types'; - -export class MemoryConfigBlocksAdapter implements FrontendConfigBlocksAdapter { - constructor(private db: ConfigurationBlock[]) {} - - public async upsert(blocks: ConfigurationBlock[]): Promise { - this.db = this.db.concat(blocks); - return { - success: true, - results: blocks.map(() => ({ - success: true, - action: 'created', - })), - } as ReturnTypeBulkUpsert; - } - public async getForTags(tagIds: string[]): Promise> { - return { - success: true, - list: this.db.filter((block) => tagIds.includes(block.tag)), - page: 0, - total: this.db.filter((block) => tagIds.includes(block.tag)).length, - }; - } - public async delete(id: string): Promise { - this.db = this.db.reduce((newDB: ConfigurationBlock[], block) => { - if (block.id !== id) { - newDB.push(block); - } - return newDB; - }, []); - return !!this.db.find((block) => block.id === id); - } -} diff --git a/x-pack/plugins/beats_management/public/lib/adapters/configuration_blocks/rest_config_blocks_adapter.ts b/x-pack/plugins/beats_management/public/lib/adapters/configuration_blocks/rest_config_blocks_adapter.ts deleted file mode 100644 index 295455dfaa48d1..00000000000000 --- a/x-pack/plugins/beats_management/public/lib/adapters/configuration_blocks/rest_config_blocks_adapter.ts +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { ConfigurationBlock } from '../../../../common/domain_types'; -import { - ReturnTypeBulkDelete, - ReturnTypeBulkUpsert, - ReturnTypeList, -} from '../../../../common/return_types'; -import { RestAPIAdapter } from '../rest_api/adapter_types'; -import { FrontendConfigBlocksAdapter } from './adapter_types'; - -export class RestConfigBlocksAdapter implements FrontendConfigBlocksAdapter { - constructor(private readonly REST: RestAPIAdapter) {} - - public async upsert(blocks: ConfigurationBlock[]) { - const result = await this.REST.put(`/api/beats/configurations`, blocks); - return result; - } - public async getForTags( - tagIds: string[], - page: number - ): Promise> { - return await this.REST.get>( - `/api/beats/configurations/${tagIds.join(',')}/${page}` - ); - } - public async delete(id: string): Promise { - return (await this.REST.delete(`/api/beats/configurations/${id}`)) - .success; - } -} diff --git a/x-pack/plugins/beats_management/public/lib/adapters/elasticsearch/adapter_types.ts b/x-pack/plugins/beats_management/public/lib/adapters/elasticsearch/adapter_types.ts deleted file mode 100644 index b414648a192cb3..00000000000000 --- a/x-pack/plugins/beats_management/public/lib/adapters/elasticsearch/adapter_types.ts +++ /dev/null @@ -1,14 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { QuerySuggestion } from '../../../../../../../src/plugins/data/public'; - -export interface ElasticsearchAdapter { - convertKueryToEsQuery: (kuery: string) => Promise; - getSuggestions: (kuery: string, selectionStart: any) => Promise; - isKueryValid(kuery: string): boolean; -} diff --git a/x-pack/plugins/beats_management/public/lib/adapters/elasticsearch/memory.ts b/x-pack/plugins/beats_management/public/lib/adapters/elasticsearch/memory.ts deleted file mode 100644 index e5a24f53d049eb..00000000000000 --- a/x-pack/plugins/beats_management/public/lib/adapters/elasticsearch/memory.ts +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { QuerySuggestion } from '../../../../../../../src/plugins/data/public'; -import { ElasticsearchAdapter } from './adapter_types'; - -export class MemoryElasticsearchAdapter implements ElasticsearchAdapter { - constructor( - private readonly mockIsKueryValid: (kuery: string) => boolean, - private readonly mockKueryToEsQuery: (kuery: string) => string, - private readonly suggestions: QuerySuggestion[] - ) {} - - public isKueryValid(kuery: string): boolean { - return this.mockIsKueryValid(kuery); - } - public async convertKueryToEsQuery(kuery: string): Promise { - return this.mockKueryToEsQuery(kuery); - } - public async getSuggestions(kuery: string, selectionStart: any): Promise { - return this.suggestions; - } -} diff --git a/x-pack/plugins/beats_management/public/lib/adapters/elasticsearch/rest.ts b/x-pack/plugins/beats_management/public/lib/adapters/elasticsearch/rest.ts deleted file mode 100644 index 0143fc8b4a364a..00000000000000 --- a/x-pack/plugins/beats_management/public/lib/adapters/elasticsearch/rest.ts +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { isEmpty } from 'lodash'; -import { ElasticsearchAdapter } from './adapter_types'; -import { QuerySuggestion, esKuery } from '../../../../../../../src/plugins/data/public'; -import { services } from '../../../kbn_services'; - -export class RestElasticsearchAdapter implements ElasticsearchAdapter { - private cachedIndexPattern: any = null; - constructor(private readonly indexPatternName: string) {} - - public isKueryValid(kuery: string): boolean { - try { - esKuery.fromKueryExpression(kuery); - } catch (err) { - return false; - } - - return true; - } - public async convertKueryToEsQuery(kuery: string): Promise { - if (!this.isKueryValid(kuery)) { - return ''; - } - const ast = esKuery.fromKueryExpression(kuery); - const indexPattern = await this.getIndexPattern(); - return JSON.stringify(esKuery.toElasticsearchQuery(ast, indexPattern)); - } - - public async getSuggestions(kuery: string, selectionStart: any): Promise { - const indexPattern = await this.getIndexPattern(); - - return ( - (await services.dataStart.autocomplete.getQuerySuggestions({ - language: 'kuery', - indexPatterns: [indexPattern], - boolFilter: [], - query: kuery || '', - selectionStart, - selectionEnd: selectionStart, - })) || [] - ); - } - - private async getIndexPattern() { - if (this.cachedIndexPattern) { - return this.cachedIndexPattern; - } - const res = await services.dataStart.indexPatterns.getFieldsForWildcard({ - pattern: this.indexPatternName, - }); - if (isEmpty(res.fields)) { - return; - } - this.cachedIndexPattern = { - fields: res.fields, - title: `${this.indexPatternName}`, - }; - return this.cachedIndexPattern; - } -} diff --git a/x-pack/plugins/beats_management/public/lib/adapters/framework/adapter_types.ts b/x-pack/plugins/beats_management/public/lib/adapters/framework/adapter_types.ts deleted file mode 100644 index c9a0e6029dadae..00000000000000 --- a/x-pack/plugins/beats_management/public/lib/adapters/framework/adapter_types.ts +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -/* eslint-disable @typescript-eslint/no-empty-interface */ - -import * as t from 'io-ts'; -import { LICENSES } from '../../../../common/constants/security'; -import { RegisterManagementAppArgs } from '../../../../../../../src/plugins/management/public'; - -export interface FrameworkAdapter { - // Instance vars - info: FrameworkInfo; - version: string; - currentUser: FrameworkUser; - // Methods - waitUntilFrameworkReady(): Promise; - registerManagementUI(mount: RegisterManagementAppArgs['mount']): void; -} - -export const RuntimeFrameworkInfo = t.type({ - basePath: t.string, - license: t.type({ - type: t.keyof(Object.fromEntries(LICENSES.map((s) => [s, null])) as Record), - expired: t.boolean, - expiry_date_in_millis: t.number, - }), - security: t.type({ - enabled: t.boolean, - available: t.boolean, - }), - settings: t.type({ - encryptionKey: t.string, - enrollmentTokensTtlInSeconds: t.number, - defaultUserRoles: t.array(t.string), - }), -}); - -export interface FrameworkInfo extends t.TypeOf {} - -export const RuntimeFrameworkUser = t.interface( - { - username: t.string, - roles: t.readonlyArray(t.string), - full_name: t.union([t.null, t.string]), - email: t.union([t.null, t.string]), - enabled: t.boolean, - }, - 'FrameworkUser' -); -export interface FrameworkUser extends t.TypeOf {} diff --git a/x-pack/plugins/beats_management/public/lib/adapters/framework/kibana_framework_adapter.ts b/x-pack/plugins/beats_management/public/lib/adapters/framework/kibana_framework_adapter.ts deleted file mode 100644 index 03a9a776084984..00000000000000 --- a/x-pack/plugins/beats_management/public/lib/adapters/framework/kibana_framework_adapter.ts +++ /dev/null @@ -1,160 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -/* eslint-disable max-classes-per-file */ -import { IScope } from 'angular'; -import { PathReporter } from 'io-ts/lib/PathReporter'; -import { isLeft } from 'fp-ts/lib/Either'; -import { first } from 'rxjs/operators'; -import { i18n } from '@kbn/i18n'; -import { MANAGEMENT_SECTION } from '../../../../common/constants'; -import { SecurityPluginSetup } from '../../../../../security/public'; -import { BufferedKibanaServiceCall, KibanaAdapterServiceRefs, KibanaUIConfig } from '../../types'; -import { - FrameworkAdapter, - FrameworkInfo, - FrameworkUser, - RuntimeFrameworkInfo, - RuntimeFrameworkUser, -} from './adapter_types'; -import { - ManagementSetup, - RegisterManagementAppArgs, -} from '../../../../../../../src/plugins/management/public'; -import { LicensingPluginSetup } from '../../../../../licensing/public'; -import { BeatsManagementConfigType } from '../../../../common'; - -export class KibanaFrameworkAdapter implements FrameworkAdapter { - public get info() { - if (this.xpackInfo) { - return this.xpackInfo; - } else { - throw new Error('framework adapter must have init called before anything else'); - } - } - - public get currentUser() { - return this.shieldUser!; - } - private xpackInfo: FrameworkInfo | null = null; - private adapterService: KibanaAdapterServiceProvider; - private shieldUser: FrameworkUser | null = null; - constructor( - private readonly PLUGIN_ID: string, - private readonly management: ManagementSetup, - private readonly getBasePath: () => string, - private readonly licensing: LicensingPluginSetup, - private readonly securitySetup: SecurityPluginSetup | undefined, - private readonly config: BeatsManagementConfigType, - public readonly version: string - ) { - this.adapterService = new KibanaAdapterServiceProvider(); - } - - public setUISettings = (key: string, value: any) => { - this.adapterService.callOrBuffer(({ config }) => { - config.set(key, value); - }); - }; - - public async waitUntilFrameworkReady(): Promise { - const license = await this.licensing.license$.pipe(first()).toPromise(); - let xpackInfoUnpacked: FrameworkInfo; - - try { - xpackInfoUnpacked = { - basePath: this.getBasePath(), - license: { - type: license.type ?? 'oss', - expired: !license.isActive, - expiry_date_in_millis: license.expiryDateInMillis ?? -1, - }, - security: { - enabled: license.getFeature('security').isEnabled, - available: license.getFeature('security').isAvailable, - }, - settings: this.config, - }; - } catch (e) { - throw new Error(`Unexpected data structure from xpackInfoService, ${JSON.stringify(e)}`); - } - - const assertData = RuntimeFrameworkInfo.decode(xpackInfoUnpacked); - if (isLeft(assertData)) { - throw new Error( - `Error parsing xpack info in ${this.PLUGIN_ID}, ${PathReporter.report(assertData)[0]}` - ); - } - this.xpackInfo = xpackInfoUnpacked; - - try { - this.shieldUser = (await this.securitySetup?.authc.getCurrentUser()) || null; - const assertUser = RuntimeFrameworkUser.decode(this.shieldUser); - - if (isLeft(assertUser)) { - throw new Error( - `Error parsing user info in ${this.PLUGIN_ID}, ${PathReporter.report(assertUser)[0]}` - ); - } - } catch (e) { - this.shieldUser = null; - } - } - - public registerManagementUI(mount: RegisterManagementAppArgs['mount']) { - const section = this.management.sections.section.ingest; - section.registerApp({ - id: MANAGEMENT_SECTION, - title: i18n.translate('xpack.beatsManagement.centralManagementLinkLabel', { - defaultMessage: 'Beats Central Management', - }), - order: 2, - mount, - }); - } -} - -class KibanaAdapterServiceProvider { - public serviceRefs: KibanaAdapterServiceRefs | null = null; - public bufferedCalls: Array> = []; - - public $get($rootScope: IScope, config: KibanaUIConfig) { - this.serviceRefs = { - config, - rootScope: $rootScope, - }; - - this.applyBufferedCalls(this.bufferedCalls); - - return this; - } - - public callOrBuffer(serviceCall: (serviceRefs: KibanaAdapterServiceRefs) => void) { - if (this.serviceRefs !== null) { - this.applyBufferedCalls([serviceCall]); - } else { - this.bufferedCalls.push(serviceCall); - } - } - - public applyBufferedCalls( - bufferedCalls: Array> - ) { - if (!this.serviceRefs) { - return; - } - - this.serviceRefs.rootScope.$apply(() => { - bufferedCalls.forEach((serviceCall) => { - if (!this.serviceRefs) { - return; - } - return serviceCall(this.serviceRefs); - }); - }); - } -} diff --git a/x-pack/plugins/beats_management/public/lib/adapters/framework/testing_framework_adapter.ts b/x-pack/plugins/beats_management/public/lib/adapters/framework/testing_framework_adapter.ts deleted file mode 100644 index 46aab987fb0a42..00000000000000 --- a/x-pack/plugins/beats_management/public/lib/adapters/framework/testing_framework_adapter.ts +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { FrameworkAdapter, FrameworkInfo, FrameworkUser } from './adapter_types'; - -export class TestingFrameworkAdapter implements FrameworkAdapter { - public get info() { - if (this.xpackInfo) { - return this.xpackInfo; - } else { - throw new Error('framework adapter must have init called before anything else'); - } - } - - public get currentUser() { - return this.shieldUser!; - } - private settings: any; - constructor( - private readonly xpackInfo: FrameworkInfo | null, - private readonly shieldUser: FrameworkUser | null, - public readonly version: string - ) {} - - // We dont really want to have this, but it's needed to conditionaly render for k7 due to - // when that data is needed. - public getUISetting(key: 'k7design'): boolean { - return this.settings[key]; - } - - public setUISettings = (key: string, value: any) => { - this.settings[key] = value; - }; - - public async waitUntilFrameworkReady(): Promise { - return; - } - - public registerManagementUI(settings: { sectionId?: string; name: string; order?: number }) { - throw new Error('not yet implamented'); - } -} diff --git a/x-pack/plugins/beats_management/public/lib/adapters/rest_api/adapter_types.ts b/x-pack/plugins/beats_management/public/lib/adapters/rest_api/adapter_types.ts deleted file mode 100644 index db79031ade7b45..00000000000000 --- a/x-pack/plugins/beats_management/public/lib/adapters/rest_api/adapter_types.ts +++ /dev/null @@ -1,15 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { FlatObject } from '../../../frontend_types'; - -export interface RestAPIAdapter { - get(url: string, query?: FlatObject): Promise; - post(url: string, body?: { [key: string]: any }): Promise; - delete(url: string): Promise; - put(url: string, body?: any): Promise; -} diff --git a/x-pack/plugins/beats_management/public/lib/adapters/rest_api/axios_rest_api_adapter.ts b/x-pack/plugins/beats_management/public/lib/adapters/rest_api/axios_rest_api_adapter.ts deleted file mode 100644 index acf4734ed58eea..00000000000000 --- a/x-pack/plugins/beats_management/public/lib/adapters/rest_api/axios_rest_api_adapter.ts +++ /dev/null @@ -1,79 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import axios, { AxiosInstance } from 'axios'; -import { FlatObject } from '../../../frontend_types'; -import { RestAPIAdapter } from './adapter_types'; -let globalAPI: AxiosInstance; - -export class AxiosRestAPIAdapter implements RestAPIAdapter { - constructor(private readonly xsrfToken: string, private readonly basePath: string) {} - - public async get(url: string, query?: FlatObject): Promise { - return await this.REST.get(url, query ? { params: query } : {}).then((resp) => resp.data); - } - - public async post( - url: string, - body?: { [key: string]: any } - ): Promise { - return await this.REST.post(url, body).then((resp) => resp.data); - } - - public async delete(url: string): Promise { - return await this.REST.delete(url).then((resp) => resp.data); - } - - public async put(url: string, body?: any): Promise { - return await this.REST.put(url, body).then((resp) => resp.data); - } - - private get REST() { - if (globalAPI) { - return globalAPI; - } - - globalAPI = axios.create({ - baseURL: this.basePath, - withCredentials: true, - responseType: 'json', - timeout: 30000, - headers: { - Accept: 'application/json', - credentials: 'same-origin', - 'Content-Type': 'application/json', - 'kbn-version': this.xsrfToken, - 'kbn-xsrf': this.xsrfToken, - }, - }); - // Add a request interceptor - globalAPI.interceptors.request.use( - (config) => { - // Do something before request is sent - return config; - }, - (error) => { - // Do something with request error - return Promise.reject(error); - } - ); - - // Add a response interceptor - globalAPI.interceptors.response.use( - (response) => { - // Do something with response data - return response; - }, - (error) => { - // Do something with response error - return Promise.reject(error); - } - ); - - return globalAPI; - } -} diff --git a/x-pack/plugins/beats_management/public/lib/adapters/rest_api/node_axios_api_adapter.ts b/x-pack/plugins/beats_management/public/lib/adapters/rest_api/node_axios_api_adapter.ts deleted file mode 100644 index 675f28b2edb7d8..00000000000000 --- a/x-pack/plugins/beats_management/public/lib/adapters/rest_api/node_axios_api_adapter.ts +++ /dev/null @@ -1,93 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import axios, { AxiosInstance } from 'axios'; -import fs from 'fs'; -import { join, resolve } from 'path'; -import { FlatObject } from '../../../frontend_types'; -import { RestAPIAdapter } from './adapter_types'; -const pkg = JSON.parse( - fs.readFileSync(resolve(join(__dirname, '../../../../../../../../package.json'))).toString() -); - -let globalAPI: AxiosInstance; - -export class NodeAxiosAPIAdapter implements RestAPIAdapter { - constructor( - private readonly username: string, - private readonly password: string, - private readonly basePath: string - ) {} - - public async get(url: string, query?: FlatObject): Promise { - return await this.REST.get(url, query ? { params: query } : {}).then((resp) => resp.data); - } - - public async post( - url: string, - body?: { [key: string]: any } - ): Promise { - return await this.REST.post(url, body).then((resp) => resp.data); - } - - public async delete(url: string): Promise { - return await this.REST.delete(url).then((resp) => resp.data); - } - - public async put(url: string, body?: any): Promise { - return await this.REST.put(url, body).then((resp) => resp.data); - } - - private get REST() { - if (globalAPI) { - return globalAPI; - } - - globalAPI = axios.create({ - baseURL: this.basePath, - withCredentials: true, - responseType: 'json', - timeout: 60 * 10 * 1000, // 10min - auth: { - username: this.username, - password: this.password, - }, - headers: { - 'Access-Control-Allow-Origin': '*', - Accept: 'application/json', - 'Content-Type': 'application/json', - 'kbn-version': (pkg as any).version, - 'kbn-xsrf': 'xxx', - }, - }); - // Add a request interceptor - globalAPI.interceptors.request.use( - (config) => { - // Do something before request is sent - return config; - }, - (error) => { - // Do something with request error - return Promise.reject(error); - } - ); - - // Add a response interceptor - globalAPI.interceptors.response.use( - (response) => { - // Do something with response data - return response; - }, - (error) => { - // Do something with response error - return Promise.reject(JSON.stringify(error.response.data)); - } - ); - - return globalAPI; - } -} diff --git a/x-pack/plugins/beats_management/public/lib/adapters/tags/adapter_types.ts b/x-pack/plugins/beats_management/public/lib/adapters/tags/adapter_types.ts deleted file mode 100644 index c45b354bab5d07..00000000000000 --- a/x-pack/plugins/beats_management/public/lib/adapters/tags/adapter_types.ts +++ /dev/null @@ -1,16 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { BeatTag, CMBeat } from '../../../../common/domain_types'; - -export interface CMTagsAdapter { - getTagsWithIds(tagIds: string[]): Promise; - delete(tagIds: string[]): Promise; - getAll(ESQuery?: string): Promise; - upsertTag(tag: BeatTag): Promise; - getAssignable(beats: CMBeat[]): Promise; -} diff --git a/x-pack/plugins/beats_management/public/lib/adapters/tags/memory_tags_adapter.ts b/x-pack/plugins/beats_management/public/lib/adapters/tags/memory_tags_adapter.ts deleted file mode 100644 index bdab45c9c9d3f1..00000000000000 --- a/x-pack/plugins/beats_management/public/lib/adapters/tags/memory_tags_adapter.ts +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { BeatTag, CMBeat } from '../../../../common/domain_types'; -import { CMTagsAdapter } from './adapter_types'; - -export class MemoryTagsAdapter implements CMTagsAdapter { - private tagsDB: BeatTag[] = []; - - constructor(tagsDB: BeatTag[]) { - this.tagsDB = tagsDB; - } - - public async getTagsWithIds(tagIds: string[]) { - return this.tagsDB.filter((tag) => tagIds.includes(tag.id)); - } - - public async delete(tagIds: string[]) { - this.tagsDB = this.tagsDB.filter((tag) => !tagIds.includes(tag.id)); - return true; - } - - public async getAll(ESQuery?: string) { - return this.tagsDB; - } - - public async upsertTag(tag: BeatTag) { - const existingTagIndex = this.tagsDB.findIndex((t) => t.id === tag.id); - if (existingTagIndex !== -1) { - this.tagsDB[existingTagIndex] = tag; - } else { - this.tagsDB.push(tag); - } - return tag; - } - - public async getAssignable(beats: CMBeat[]) { - return this.tagsDB; - } -} diff --git a/x-pack/plugins/beats_management/public/lib/adapters/tags/rest_tags_adapter.ts b/x-pack/plugins/beats_management/public/lib/adapters/tags/rest_tags_adapter.ts deleted file mode 100644 index 7c8e563948b22a..00000000000000 --- a/x-pack/plugins/beats_management/public/lib/adapters/tags/rest_tags_adapter.ts +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { uniq } from 'lodash'; -import { BeatTag, CMBeat } from '../../../../common/domain_types'; -import { - ReturnTypeBulkDelete, - ReturnTypeBulkGet, - ReturnTypeList, - ReturnTypeUpsert, -} from '../../../../common/return_types'; -import { RestAPIAdapter } from '../rest_api/adapter_types'; -import { CMTagsAdapter } from './adapter_types'; - -export class RestTagsAdapter implements CMTagsAdapter { - constructor(private readonly REST: RestAPIAdapter) {} - - public async getTagsWithIds(tagIds: string[]): Promise { - try { - return ( - await this.REST.get>(`/api/beats/tags/${uniq(tagIds).join(',')}`) - ).items; - } catch (e) { - return []; - } - } - - public async getAll(ESQuery: string): Promise { - try { - return (await this.REST.get>(`/api/beats/tags`, { ESQuery })).list; - } catch (e) { - return []; - } - } - - public async delete(tagIds: string[]): Promise { - return ( - await this.REST.delete(`/api/beats/tags/${uniq(tagIds).join(',')}`) - ).success; - } - - public async upsertTag(tag: BeatTag): Promise { - const response = await this.REST.put>(`/api/beats/tag/${tag.id}`, { - color: tag.color, - name: tag.name, - }); - - return response.success ? tag : null; - } - - public async getAssignable(beats: CMBeat[]) { - try { - return ( - await this.REST.get>( - `/api/beats/tags/assignable/${beats.map((beat) => beat.id).join(',')}` - ) - ).items; - } catch (e) { - return []; - } - } -} diff --git a/x-pack/plugins/beats_management/public/lib/adapters/tokens/adapter_types.ts b/x-pack/plugins/beats_management/public/lib/adapters/tokens/adapter_types.ts deleted file mode 100644 index 7a5f334aee6d2d..00000000000000 --- a/x-pack/plugins/beats_management/public/lib/adapters/tokens/adapter_types.ts +++ /dev/null @@ -1,10 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -export interface CMTokensAdapter { - createEnrollmentTokens(numTokens?: number): Promise; -} diff --git a/x-pack/plugins/beats_management/public/lib/adapters/tokens/memory_tokens_adapter.ts b/x-pack/plugins/beats_management/public/lib/adapters/tokens/memory_tokens_adapter.ts deleted file mode 100644 index c5f871884609ae..00000000000000 --- a/x-pack/plugins/beats_management/public/lib/adapters/tokens/memory_tokens_adapter.ts +++ /dev/null @@ -1,14 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { CMTokensAdapter } from './adapter_types'; - -export class MemoryTokensAdapter implements CMTokensAdapter { - public async createEnrollmentTokens(): Promise { - return ['2jnwkrhkwuehriauhweair']; - } -} diff --git a/x-pack/plugins/beats_management/public/lib/adapters/tokens/rest_tokens_adapter.ts b/x-pack/plugins/beats_management/public/lib/adapters/tokens/rest_tokens_adapter.ts deleted file mode 100644 index cac45c6b9f674c..00000000000000 --- a/x-pack/plugins/beats_management/public/lib/adapters/tokens/rest_tokens_adapter.ts +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { ReturnTypeBulkCreate } from '../../../../common/return_types'; -import { RestAPIAdapter } from '../rest_api/adapter_types'; -import { CMTokensAdapter } from './adapter_types'; - -export class RestTokensAdapter implements CMTokensAdapter { - constructor(private readonly REST: RestAPIAdapter) {} - - public async createEnrollmentTokens(numTokens: number = 1): Promise { - const results = ( - await this.REST.post>('/api/beats/enrollment_tokens', { - num_tokens: numTokens, - }) - ).results; - return results.map((result) => result.item); - } -} diff --git a/x-pack/plugins/beats_management/public/lib/beats.ts b/x-pack/plugins/beats_management/public/lib/beats.ts deleted file mode 100644 index ebe2f4125ba851..00000000000000 --- a/x-pack/plugins/beats_management/public/lib/beats.ts +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { ReturnTypeBulkAction } from '../../common/return_types'; -import { CMBeat } from '../../common/domain_types'; -import { BeatsTagAssignment, CMBeatsAdapter } from './adapters/beats/adapter_types'; -import { ElasticsearchLib } from './elasticsearch'; - -export class BeatsLib { - constructor( - private readonly adapter: CMBeatsAdapter, - private readonly elasticsearch: ElasticsearchLib - ) {} - - /** Get a single beat using it's ID for lookup */ - public async get(id: string): Promise { - const beat = await this.adapter.get(id); - return beat; - } - - /** Get a single beat using the token it was enrolled in for lookup */ - public getBeatWithToken = async (enrollmentToken: string): Promise => { - const beat = await this.adapter.getBeatWithToken(enrollmentToken); - return beat; - }; - - /** Get an array of beats that have a given tag id assigned to it */ - public getBeatsWithTag = async (tagId: string): Promise => { - const beats = await this.adapter.getBeatsWithTag(tagId); - return beats; - }; - - // FIXME: This needs to be paginated https://github.com/elastic/kibana/issues/26022 - /** Get an array of all enrolled beats. */ - public getAll = async (kuery?: string): Promise => { - let ESQuery; - if (kuery) { - ESQuery = await this.elasticsearch.convertKueryToEsQuery(kuery); - } - const beats = await this.adapter.getAll(ESQuery); - return beats; - }; - - /** Update a given beat via it's ID */ - public update = async (id: string, beatData: Partial): Promise => { - return await this.adapter.update(id, beatData); - }; - - /** unassign tags from beats using an array of tags and beats */ - public removeTagsFromBeats = async ( - removals: BeatsTagAssignment[] - ): Promise => { - return await this.adapter.removeTagsFromBeats(removals); - }; - - /** assign tags from beats using an array of tags and beats */ - public assignTagsToBeats = async ( - assignments: BeatsTagAssignment[] - ): Promise => { - return await this.adapter.assignTagsToBeats(assignments); - }; -} diff --git a/x-pack/plugins/beats_management/public/lib/compose/kibana.ts b/x-pack/plugins/beats_management/public/lib/compose/kibana.ts deleted file mode 100644 index bd562f03548c26..00000000000000 --- a/x-pack/plugins/beats_management/public/lib/compose/kibana.ts +++ /dev/null @@ -1,81 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { camelCase } from 'lodash'; -import { configBlockSchemas } from '../../../common/config_schemas'; -import { translateConfigSchema } from '../../../common/config_schemas_translations_map'; -import { INDEX_NAMES } from '../../../common/constants/index_names'; -import { RestBeatsAdapter } from '../adapters/beats/rest_beats_adapter'; -import { RestConfigBlocksAdapter } from '../adapters/configuration_blocks/rest_config_blocks_adapter'; -import { RestElasticsearchAdapter } from '../adapters/elasticsearch/rest'; -import { KibanaFrameworkAdapter } from '../adapters/framework/kibana_framework_adapter'; -import { AxiosRestAPIAdapter } from '../adapters/rest_api/axios_rest_api_adapter'; -import { RestTagsAdapter } from '../adapters/tags/rest_tags_adapter'; -import { RestTokensAdapter } from '../adapters/tokens/rest_tokens_adapter'; -import { BeatsLib } from '../beats'; -import { ConfigBlocksLib } from '../configuration_blocks'; -import { ElasticsearchLib } from '../elasticsearch'; -import { TagsLib } from '../tags'; -import { FrontendLibs } from '../types'; -import { PLUGIN } from '../../../common/constants/plugin'; -import { FrameworkLib } from './../framework'; -import { ManagementSetup } from '../../../../../../src/plugins/management/public'; -import { SecurityPluginSetup } from '../../../../security/public'; -import { CoreSetup } from '../../../../../../src/core/public'; -import { LicensingPluginSetup } from '../../../../licensing/public'; -import { BeatsManagementConfigType } from '../../../common'; - -interface ComposeDeps { - core: CoreSetup; - management: ManagementSetup; - licensing: LicensingPluginSetup; - config: BeatsManagementConfigType; - version: string; - security?: SecurityPluginSetup; -} - -export function compose({ - core, - management, - licensing, - config, - version, - security, -}: ComposeDeps): FrontendLibs { - const api = new AxiosRestAPIAdapter(version, core.http.basePath.get()); - const esAdapter = new RestElasticsearchAdapter(INDEX_NAMES.BEATS); - const elasticsearchLib = new ElasticsearchLib(esAdapter); - const configBlocks = new ConfigBlocksLib( - new RestConfigBlocksAdapter(api), - translateConfigSchema(configBlockSchemas) - ); - const tags = new TagsLib(new RestTagsAdapter(api), elasticsearchLib); - const tokens = new RestTokensAdapter(api); - const beats = new BeatsLib(new RestBeatsAdapter(api), elasticsearchLib); - - const framework = new FrameworkLib( - new KibanaFrameworkAdapter( - camelCase(PLUGIN.ID), - management, - core.http.basePath.get, - licensing, - security, - config, - version - ) - ); - - const libs: FrontendLibs = { - framework, - elasticsearch: elasticsearchLib, - tags, - tokens, - beats, - configBlocks, - }; - return libs; -} diff --git a/x-pack/plugins/beats_management/public/lib/compose/scripts.ts b/x-pack/plugins/beats_management/public/lib/compose/scripts.ts deleted file mode 100644 index 37a1bc9ac4944d..00000000000000 --- a/x-pack/plugins/beats_management/public/lib/compose/scripts.ts +++ /dev/null @@ -1,79 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { configBlockSchemas } from '../../../common/config_schemas'; -import { translateConfigSchema } from '../../../common/config_schemas_translations_map'; -import { RestBeatsAdapter } from '../adapters/beats/rest_beats_adapter'; -import { RestConfigBlocksAdapter } from '../adapters/configuration_blocks/rest_config_blocks_adapter'; -import { MemoryElasticsearchAdapter } from '../adapters/elasticsearch/memory'; -import { TestingFrameworkAdapter } from '../adapters/framework/testing_framework_adapter'; -import { NodeAxiosAPIAdapter } from '../adapters/rest_api/node_axios_api_adapter'; -import { RestTagsAdapter } from '../adapters/tags/rest_tags_adapter'; -import { RestTokensAdapter } from '../adapters/tokens/rest_tokens_adapter'; -import { BeatsLib } from '../beats'; -import { ConfigBlocksLib } from '../configuration_blocks'; -import { ElasticsearchLib } from '../elasticsearch'; -import { FrameworkLib } from '../framework'; -import { TagsLib } from '../tags'; -import { FrontendLibs } from '../types'; - -export function compose(basePath: string): FrontendLibs { - const api = new NodeAxiosAPIAdapter('elastic', 'changeme', basePath); - const esAdapter = new MemoryElasticsearchAdapter( - () => true, - () => '', - [] - ); - const elasticsearchLib = new ElasticsearchLib(esAdapter); - const configBlocks = new ConfigBlocksLib( - new RestConfigBlocksAdapter(api), - translateConfigSchema(configBlockSchemas) - ); - const tags = new TagsLib(new RestTagsAdapter(api), elasticsearchLib); - const tokens = new RestTokensAdapter(api); - const beats = new BeatsLib(new RestBeatsAdapter(api), elasticsearchLib); - - const framework = new FrameworkLib( - new TestingFrameworkAdapter( - { - basePath, - license: { - type: 'gold', - expired: false, - expiry_date_in_millis: 34353453452345, - }, - security: { - enabled: true, - available: true, - }, - settings: { - encryptionKey: 'xpack_beats_default_encryptionKey', - enrollmentTokensTtlInSeconds: 10 * 60, // 10 minutes - defaultUserRoles: ['superuser'], - }, - }, - { - username: 'joeuser', - roles: ['beats_admin'], - enabled: true, - full_name: null, - email: null, - }, - '6.7.0' - ) - ); - - const libs: FrontendLibs = { - framework, - elasticsearch: elasticsearchLib, - tags, - tokens, - beats, - configBlocks, - }; - return libs; -} diff --git a/x-pack/plugins/beats_management/public/lib/config_blocks.test.ts b/x-pack/plugins/beats_management/public/lib/config_blocks.test.ts deleted file mode 100644 index 5fcd30e32d0236..00000000000000 --- a/x-pack/plugins/beats_management/public/lib/config_blocks.test.ts +++ /dev/null @@ -1,149 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { configBlockSchemas } from '../../common/config_schemas'; -import { translateConfigSchema } from '../../common/config_schemas_translations_map'; -import { ConfigBlocksLib } from './configuration_blocks'; -import { MemoryConfigBlocksAdapter } from './adapters/configuration_blocks/memory_config_blocks_adapter'; - -describe('Tags Client Domain Lib', () => { - let lib: ConfigBlocksLib; - - beforeEach(async () => { - lib = new ConfigBlocksLib( - new MemoryConfigBlocksAdapter([]), - translateConfigSchema(configBlockSchemas) - ); - }); - - it('should use helper function to convert users yaml in tag to config object', async () => { - const convertedBlocks = await lib.userConfigsToJson([ - { - id: 'foo', - tag: 'basic', - last_updated: parseInt(new Date().toISOString(), 10), - type: 'filebeat.inputs', - description: 'string', - config: { - paths: ['adad/adasd'], - other: "something: 'here'", - }, - }, - ]); - - expect(convertedBlocks.length).toBe(1); - expect(convertedBlocks[0]).toHaveProperty('config'); - expect(convertedBlocks[0].config).not.toHaveProperty('other'); - expect(convertedBlocks[0].config).toHaveProperty('something'); - expect(convertedBlocks[0].config.something).toBe('here'); - }); - - it('should use helper function to convert user config to json with undefined `other`', async () => { - const convertedTag = await lib.userConfigsToJson([ - { - id: 'foo', - tag: 'basic', - last_updated: parseInt(new Date().toISOString(), 10), - type: 'filebeat.inputs', - description: 'sdfsdf', - config: { - paths: ['sdfsfsdf'], - other: undefined, - }, - }, - ]); - - expect(convertedTag.length).toBe(1); - expect(convertedTag[0]).not.toHaveProperty('other'); - }); - - it('should use helper function to convert users yaml in tag to config object, where empty other leads to no other fields saved', async () => { - const convertedTag = await lib.userConfigsToJson([ - { - id: 'foo', - tag: 'basic', - last_updated: parseInt(new Date().toISOString(), 10), - type: 'filebeat.inputs', - description: 'string', - config: { - paths: ['adad/adasd'], - other: ` - sdfsdf: "foo" - `, - }, - }, - ]); - - expect(convertedTag.length).toBe(1); - expect(convertedTag[0].config).not.toHaveProperty('other'); - expect(convertedTag[0].config.sdfsdf).toBe('foo'); - }); - - it('should convert tokenized fields to JSON', async () => { - const convertedTag = await lib.userConfigsToJson([ - { - id: 'foo', - tag: 'basic', - last_updated: parseInt(new Date().toISOString(), 10), - type: 'output', - description: 'something', - config: { - _sub_type: 'console', - hosts: ['esefsfsgg', 'drgdrgdgr'], - username: '', - password: '', - }, - }, - ]); - - expect(convertedTag.length).toBe(1); - expect(convertedTag[0].config).toHaveProperty('_sub_type'); - expect(convertedTag[0].config).toHaveProperty('hosts'); - expect(convertedTag[0].config.hosts.length).toBe(2); - }); - - it('should use helper function to convert config object to users yaml', async () => { - const convertedTag = await lib.jsonConfigToUserYaml([ - { - id: 'foo', - tag: 'basic', - last_updated: parseInt(new Date().toISOString(), 10), - type: 'filebeat.inputs', - description: 'sdfsdf', - config: { - paths: ['sdfsfsdf'], - something: 'here', - }, - }, - ]); - - expect(convertedTag.length).toBe(1); - expect(convertedTag[0].config).not.toHaveProperty('something'); - expect(convertedTag[0].config).toHaveProperty('other'); - expect(convertedTag[0].config.other).toBe('something: here\n'); - }); - - it('should use helper function to convert config object to users yaml with empty `other`', async () => { - const convertedTag = await lib.jsonConfigToUserYaml([ - { - id: 'foo', - tag: 'basic', - last_updated: parseInt(new Date().toISOString(), 10), - type: 'filebeat.inputs', - description: undefined, - config: { - paths: ['sdfsfsdf'], - }, - }, - ]); - - expect(convertedTag.length).toBe(1); - expect(convertedTag[0].config).not.toHaveProperty('something'); - expect(convertedTag[0].config).toHaveProperty('other'); - expect(convertedTag[0].config.other).toBe(''); - }); -}); diff --git a/x-pack/plugins/beats_management/public/lib/configuration_blocks.ts b/x-pack/plugins/beats_management/public/lib/configuration_blocks.ts deleted file mode 100644 index 2328b353fe326f..00000000000000 --- a/x-pack/plugins/beats_management/public/lib/configuration_blocks.ts +++ /dev/null @@ -1,123 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { set } from '@elastic/safer-lodash-set'; -import { get, has, omit } from 'lodash'; -import { ConfigBlockSchema, ConfigurationBlock } from '../../common/domain_types'; -import { FrontendConfigBlocksAdapter } from './adapters/configuration_blocks/adapter_types'; - -export class ConfigBlocksLib { - public delete = this.adapter.delete.bind(this.adapter); - - constructor( - private readonly adapter: FrontendConfigBlocksAdapter, - private readonly configSchemas: ConfigBlockSchema[] - ) {} - - public upsert = async (blocks: ConfigurationBlock[]) => { - return await this.adapter.upsert(await this.userConfigsToJson(blocks)); - }; - - public getForTags = async (tagIds: string[], page: number) => { - const result = await this.adapter.getForTags(tagIds, page); - result.list = await this.jsonConfigToUserYaml(result.list); - return result; - }; - - public async jsonConfigToUserYaml(blocks: ConfigurationBlock[]): Promise { - const yaml = await import('js-yaml'); - // configuration_blocks yaml, JS cant read YAML so we parse it into JS, - // because beats flattens all fields, and we need more structure. - // we take tagConfigs, grab the config that applies here, render what we can into - // an object, and the rest we assume to be the yaml string that goes - // into the yaml editor... - // NOTE: The perk of this, is that as we support more features via controls - // vs yaml editing, it should "just work", and things that were in YAML - // will now be in the UI forms... - return blocks.map((block) => { - const { type, config } = block; - - const thisConfigSchema = this.configSchemas.find((conf) => conf.id === type); - const thisConfigBlockSchema = thisConfigSchema ? thisConfigSchema.configs : null; - if (!thisConfigBlockSchema) { - throw new Error('No config block schema '); - } - - const knownConfigIds: string[] = thisConfigBlockSchema.map((schema) => schema.id); - - const convertedConfig: ConfigurationBlock['config'] = knownConfigIds.reduce( - (blockObj: any, configKey: string, index: number) => { - const unhydratedKey = knownConfigIds[index]; - - set(blockObj, configKey, get(config, unhydratedKey)); - - return blockObj; - }, - thisConfigSchema && thisConfigSchema.allowOtherConfigs - ? { other: yaml.safeDump(omit(config, knownConfigIds)) } - : {} - ); - - // Workaround to empty object passed into dump resulting in this odd output - if (convertedConfig.other && convertedConfig.other === '{}\n') { - convertedConfig.other = ''; - } - - return { - ...block, - config: convertedConfig, - }; - }); - } - - public async userConfigsToJson(blocks: ConfigurationBlock[]): Promise { - const yaml = await import('js-yaml'); - // configurations is the JS representation of the config yaml, - // so here we take that JS and convert it into a YAML string. - // we do so while also flattening "other" into the flat yaml beats expect - return blocks.map((block) => { - const { type, config } = block; - const thisConfigSchema = this.configSchemas.find((conf) => conf.id === type); - const thisConfigBlockSchema = thisConfigSchema ? thisConfigSchema.configs : null; - if (!thisConfigBlockSchema) { - throw new Error('No config block schema '); - } - const knownConfigIds = thisConfigBlockSchema - .map((schema: ConfigurationBlock['config']) => schema.id) - .filter((id: string) => id !== 'other'); - - const picked = this.pickDeep(config, knownConfigIds); - let other = yaml.safeLoad(config.other || '{}'); - if (typeof other === 'string') { - other = { - [other]: '', - }; - } - - const convertedConfig = { - ...other, - ...picked, - }; - - return { - ...block, - config: convertedConfig, - }; - }); - } - - private pickDeep(obj: { [key: string]: any }, keys: string[]) { - const copy = {}; - keys.forEach((key) => { - if (has(obj, key)) { - const val = get(obj, key); - set(copy, key, val); - } - }); - return copy; - } -} diff --git a/x-pack/plugins/beats_management/public/lib/elasticsearch.ts b/x-pack/plugins/beats_management/public/lib/elasticsearch.ts deleted file mode 100644 index b64c307682f2f7..00000000000000 --- a/x-pack/plugins/beats_management/public/lib/elasticsearch.ts +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { QuerySuggestion } from '../../../../../src/plugins/data/public'; -import { ElasticsearchAdapter } from './adapters/elasticsearch/adapter_types'; - -interface HiddenFields { - op: 'is' | 'startsWith' | 'withoutPrefix'; - value: string; -} - -export class ElasticsearchLib { - private readonly hiddenFields: HiddenFields[] = [ - { op: 'startsWith', value: 'enrollment_token' }, - { op: 'is', value: 'beat.active' }, - { op: 'is', value: 'beat.enrollment_token' }, - { op: 'is', value: 'beat.access_token' }, - { op: 'is', value: 'beat.ephemeral_id' }, - { op: 'is', value: 'beat.verified_on' }, - ]; - - constructor(private readonly adapter: ElasticsearchAdapter) {} - - public isKueryValid(kuery: string): boolean { - return this.adapter.isKueryValid(kuery); - } - public async convertKueryToEsQuery(kuery: string): Promise { - return await this.adapter.convertKueryToEsQuery(kuery); - } - - public async getSuggestions( - kuery: string, - selectionStart: any, - fieldPrefix?: string - ): Promise { - const suggestions = await this.adapter.getSuggestions(kuery, selectionStart); - - const filteredSuggestions = suggestions.filter((suggestion) => { - const hiddenFieldsCheck = this.hiddenFields; - - if (fieldPrefix) { - hiddenFieldsCheck.push({ - op: 'withoutPrefix', - value: `${fieldPrefix}.`, - }); - } - - return hiddenFieldsCheck.reduce((isvalid: boolean, field) => { - if (!isvalid) { - return false; - } - - switch (field.op) { - case 'startsWith': - return !suggestion.text.startsWith(field.value); - case 'is': - return suggestion.text.trim() !== field.value; - case 'withoutPrefix': - return suggestion.text.startsWith(field.value); - } - }, true); - }); - - return filteredSuggestions; - } -} diff --git a/x-pack/plugins/beats_management/public/lib/framework.ts b/x-pack/plugins/beats_management/public/lib/framework.ts deleted file mode 100644 index 94f6df20e4b4d3..00000000000000 --- a/x-pack/plugins/beats_management/public/lib/framework.ts +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { difference, get } from 'lodash'; -import { LICENSES, LicenseType } from '../../common/constants/security'; -import { FrameworkAdapter } from './adapters/framework/adapter_types'; - -export class FrameworkLib { - public waitUntilFrameworkReady = this.adapter.waitUntilFrameworkReady.bind(this.adapter); - public registerManagementUI = this.adapter.registerManagementUI.bind(this.adapter); - - constructor(private readonly adapter: FrameworkAdapter) {} - - public get currentUser() { - return this.adapter.currentUser; - } - - public get info() { - return this.adapter.info; - } - - public licenseIsAtLeast(type: LicenseType) { - return ( - LICENSES.indexOf(get(this.adapter.info, 'license.type', 'oss')) >= LICENSES.indexOf(type) - ); - } - - public versionGreaterThen(version: string) { - const pa = this.adapter.version.split('.'); - const pb = version.split('.'); - for (let i = 0; i < 3; i++) { - const na = Number(pa[i]); - const nb = Number(pb[i]); - // version is greater - if (na > nb) { - return true; - } - // version is less then - if (nb > na) { - return false; - } - if (!isNaN(na) && isNaN(nb)) { - return true; - } - if (isNaN(na) && !isNaN(nb)) { - return false; - } - } - return true; - } - - public currentUserHasOneOfRoles(roles: string[]) { - // If the user has at least one of the roles requested, the returnd difference will be less - // then the orig array size. difference only compares based on the left side arg - return difference(roles, get(this.currentUser, 'roles', []) as string[]).length < roles.length; - } -} diff --git a/x-pack/plugins/beats_management/public/lib/tags.ts b/x-pack/plugins/beats_management/public/lib/tags.ts deleted file mode 100644 index 45f840be8e0627..00000000000000 --- a/x-pack/plugins/beats_management/public/lib/tags.ts +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import uuidv4 from 'uuid/v4'; -import { BeatTag, CMBeat } from '../../common/domain_types'; -import { CMTagsAdapter } from './adapters/tags/adapter_types'; -import { ElasticsearchLib } from './elasticsearch'; - -export class TagsLib { - constructor( - private readonly adapter: CMTagsAdapter, - private readonly elasticsearch: ElasticsearchLib - ) {} - - public async getTagsWithIds(tagIds: string[]): Promise { - if (tagIds.length === 0) { - return []; - } - return await this.adapter.getTagsWithIds([...new Set(tagIds)]); - } - public async delete(tagIds: string[]): Promise { - return await this.adapter.delete([...new Set(tagIds)]); - } - - // FIXME: This needs to be paginated https://github.com/elastic/kibana/issues/26022 - public async getAll(kuery?: string): Promise { - let ESQuery; - if (kuery) { - ESQuery = await this.elasticsearch.convertKueryToEsQuery(kuery); - } - - return await this.adapter.getAll(ESQuery); - } - public async upsertTag(tag: BeatTag): Promise { - if (!tag.id) { - tag.id = uuidv4(); - } - return await this.adapter.upsertTag(tag); - } - - public async getassignableTagsForBeats(beats: CMBeat[]): Promise { - return await this.adapter.getAssignable(beats); - } -} diff --git a/x-pack/plugins/beats_management/public/lib/types.ts b/x-pack/plugins/beats_management/public/lib/types.ts deleted file mode 100644 index 68f09cc3e8ba43..00000000000000 --- a/x-pack/plugins/beats_management/public/lib/types.ts +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { IModule, IScope } from 'angular'; -import { AxiosRequestConfig } from 'axios'; -import { FrameworkAdapter } from './adapters/framework/adapter_types'; -import { CMTokensAdapter } from './adapters/tokens/adapter_types'; -import { BeatsLib } from './beats'; -import { ConfigBlocksLib } from './configuration_blocks'; -import { ElasticsearchLib } from './elasticsearch'; -import { FrameworkLib } from './framework'; -import { TagsLib } from './tags'; - -export interface FrontendLibs { - elasticsearch: ElasticsearchLib; - framework: FrameworkLib; - beats: BeatsLib; - tags: TagsLib; - tokens: CMTokensAdapter; - configBlocks: ConfigBlocksLib; -} - -export type FramworkAdapterConstructable = new (uiModule: IModule) => FrameworkAdapter; - -// FIXME: replace AxiosRequestConfig with something more defined -export type RequestConfig = AxiosRequestConfig; - -export interface ApiAdapter { - kbnVersion: string; - - get(url: string, config?: RequestConfig | undefined): Promise; - post(url: string, data?: any, config?: AxiosRequestConfig | undefined): Promise; - delete(url: string, config?: RequestConfig | undefined): Promise; - put(url: string, data?: any, config?: RequestConfig | undefined): Promise; -} - -export interface UiKibanaAdapterScope extends IScope { - breadcrumbs: any[]; - topNavMenu: any[]; -} - -export interface KibanaUIConfig { - get(key: string): any; - set(key: string, value: any): Promise; -} - -export interface KibanaAdapterServiceRefs { - config: KibanaUIConfig; - rootScope: IScope; -} - -export type BufferedKibanaServiceCall = (serviceRefs: ServiceRefs) => void; - -export interface Chrome { - setRootTemplate(template: string): void; -} diff --git a/x-pack/plugins/beats_management/public/pages/__404.tsx b/x-pack/plugins/beats_management/public/pages/__404.tsx deleted file mode 100644 index d5813d36e2c6d3..00000000000000 --- a/x-pack/plugins/beats_management/public/pages/__404.tsx +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { FormattedMessage } from '@kbn/i18n/react'; -import React from 'react'; - -export class NotFoundPage extends React.PureComponent { - public render() { - return ( -
- -
- ); - } -} diff --git a/x-pack/plugins/beats_management/public/pages/beat/details.tsx b/x-pack/plugins/beats_management/public/pages/beat/details.tsx deleted file mode 100644 index c9b26da9349b17..00000000000000 --- a/x-pack/plugins/beats_management/public/pages/beat/details.tsx +++ /dev/null @@ -1,201 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { - EuiFlexGroup, - EuiFlexItem, - // @ts-ignore EuiInMemoryTable typings not yet available - EuiInMemoryTable, - EuiLink, - EuiSpacer, - EuiText, - EuiTitle, - EuiBasicTableColumn, -} from '@elastic/eui'; -import { i18n } from '@kbn/i18n'; -import { FormattedMessage, InjectedIntl, injectI18n } from '@kbn/i18n/react'; -import { get } from 'lodash'; -import React from 'react'; -import { configBlockSchemas } from '../../../common/config_schemas'; -import { translateConfigSchema } from '../../../common/config_schemas_translations_map'; -import { TABLE_CONFIG } from '../../../common/constants'; -import { BeatTag, CMBeat, ConfigurationBlock } from '../../../common/domain_types'; -import { Breadcrumb } from '../../components/navigation/breadcrumb'; -import { ConnectedLink } from '../../components/navigation/connected_link'; -import { TagBadge } from '../../components/tag'; -import { ConfigView } from '../../components/tag/config_view/index'; -import { AppPageProps } from '../../frontend_types'; - -interface PageProps extends AppPageProps { - beat: CMBeat; - intl: InjectedIntl; -} - -interface PageState { - selectedConfig: ConfigurationBlock | null; - tags: BeatTag[]; - configuration_blocks: ConfigurationBlock[]; - configurationBlocksPage: number; -} - -class BeatDetailPageUi extends React.PureComponent { - constructor(props: PageProps) { - super(props); - - this.state = { - selectedConfig: null, - tags: [], - configuration_blocks: [], - configurationBlocksPage: 0, - }; - } - - public async UNSAFE_componentWillMount() { - const tags = await this.props.libs.tags.getTagsWithIds(this.props.beat.tags); - const blocksResult = await this.props.libs.configBlocks.getForTags( - this.props.beat.tags, - this.state.configurationBlocksPage - ); - - this.setState({ - configuration_blocks: blocksResult.list, - tags, - }); - } - public render() { - const props = this.props; - const { beat, intl } = props; - if (!beat) { - return ( - - ); - } - const configurationBlocks = !this.state.configuration_blocks - ? [] - : this.state.configuration_blocks.map((configuration) => ({ - // @ts-ignore one of the types on ConfigurationBlock doesn't define a "module" property - module: configuration.config.type || null, - tagId: configuration.tag, - tagColor: - ((this.state.tags || []).find((tag) => tag.id === configuration.tag) || ({} as BeatTag)) - .color || 'grey', - tagName: - ((this.state.tags || []).find((tag) => tag.id === configuration.tag) || ({} as BeatTag)) - .name || configuration.tag, - ...beat, - ...configuration, - displayValue: get( - translateConfigSchema(configBlockSchemas).find( - (config) => config.id === configuration.type - ), - 'text', - null - ), - })); - - const columns: Array> = [ - { - field: 'displayValue', - name: intl.formatMessage({ - id: 'xpack.beatsManagement.beatConfigurations.typeColumnName', - defaultMessage: 'Type', - }), - sortable: true, - render: (value: string | null, configuration: any) => ( - { - this.setState({ - selectedConfig: configuration, - }); - }} - > - {value || configuration.type} - - ), - }, - { - field: 'module', - name: intl.formatMessage({ - id: 'xpack.beatsManagement.beatConfigurations.moduleColumnName', - defaultMessage: 'Module', - }), - sortable: true, - }, - { - field: 'description', - name: intl.formatMessage({ - id: 'xpack.beatsManagement.beatConfigurations.descriptionColumnName', - defaultMessage: 'Description', - }), - sortable: true, - }, - { - field: 'tagId', - name: intl.formatMessage({ - id: 'xpack.beatsManagement.beatConfigurations.tagColumnName', - defaultMessage: 'Tag', - }), - render: (id: string, block: any) => ( - - - - ), - sortable: true, - }, - ]; - return ( - - - - - - -

- -

-
- -

- -

-
-
- - - -
- {this.state.selectedConfig && ( - this.setState({ selectedConfig: null })} - /> - )} -
- ); - } -} -export const BeatDetailPage = injectI18n(BeatDetailPageUi); diff --git a/x-pack/plugins/beats_management/public/pages/beat/index.tsx b/x-pack/plugins/beats_management/public/pages/beat/index.tsx deleted file mode 100644 index 3b306d6699a44d..00000000000000 --- a/x-pack/plugins/beats_management/public/pages/beat/index.tsx +++ /dev/null @@ -1,201 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { - EuiFlexGroup, - EuiFlexItem, - // @ts-ignore - EuiTab, - // @ts-ignore - EuiTabs, - EuiText, -} from '@elastic/eui'; -import { FormattedMessage, InjectedIntl, injectI18n } from '@kbn/i18n/react'; -import moment from 'moment'; -import React from 'react'; -import { Redirect, Route, Switch } from 'react-router-dom'; -import { CMBeat } from '../../../common/domain_types'; -import { PrimaryLayout } from '../../components/layouts/primary'; -import { Breadcrumb } from '../../components/navigation/breadcrumb'; -import { ChildRoutes } from '../../components/navigation/child_routes'; -import { AppPageProps } from '../../frontend_types'; - -interface PageProps extends AppPageProps { - intl: InjectedIntl; -} -interface PageState { - beat: CMBeat | undefined; - beatId: string; - isLoading: boolean; -} - -class BeatDetailsPageComponent extends React.PureComponent { - constructor(props: PageProps) { - super(props); - this.state = { - beat: undefined, - beatId: props.match.params.beatId, - isLoading: true, - }; - this.loadBeat(); - } - - public onSelectedTabChanged = (id: string) => { - this.props.history.push({ - pathname: id, - search: this.props.location.search, - }); - }; - - public renderActionSection(beat?: CMBeat) { - return beat ? ( - - - - {beat.type} }} - /> - - - - - {beat.version} }} - /> - - - {beat.last_updated && ( - - - {moment(beat.last_updated).fromNow()}, - }} - /> - - - )} - - ) : ( - - ); - } - - public render() { - const { intl } = this.props; - const { beat } = this.state; - let id: string | undefined; - let name; - - if (beat) { - id = beat.id; - name = beat.name; - } - - const title = this.state.isLoading - ? intl.formatMessage({ - id: 'xpack.beatsManagement.beat.loadingTitle', - defaultMessage: 'Loading', - }) - : intl.formatMessage( - { - id: 'xpack.beatsManagement.beat.beatNameAndIdTitle', - defaultMessage: 'Beat: {nameOrNoName} (id: {id})', - }, - { - nameOrNoName: - name || - intl.formatHTMLMessage({ - id: 'xpack.beatsManagement.beat.noNameReceivedFromBeatTitle', - defaultMessage: 'No name received from beat', - }), - id, - } - ); - - return ( - - - - - - - - - - - - {!this.state.beat &&
Beat not found
} - {this.state.beat && ( - - - {id && } />} - - )} -
-
- ); - } - - private onTabClicked = (path: string) => { - return () => { - this.props.goTo(path); - }; - }; - - private async loadBeat() { - const { intl } = this.props; - const { beatId } = this.props.match.params; - let beat; - try { - beat = await this.props.libs.beats.get(beatId); - if (!beat) { - throw new Error( - intl.formatMessage({ - id: 'xpack.beatsManagement.beat.beatNotFoundErrorMessage', - defaultMessage: 'beat not found', - }) - ); - } - } catch (e) { - throw new Error(e); - } - this.setState({ beat, isLoading: false }); - } -} - -export const BeatDetailsPage = injectI18n(BeatDetailsPageComponent); diff --git a/x-pack/plugins/beats_management/public/pages/beat/tags.tsx b/x-pack/plugins/beats_management/public/pages/beat/tags.tsx deleted file mode 100644 index e5f7e7c3711a05..00000000000000 --- a/x-pack/plugins/beats_management/public/pages/beat/tags.tsx +++ /dev/null @@ -1,76 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { EuiGlobalToastList } from '@elastic/eui'; -import { i18n } from '@kbn/i18n'; -import React from 'react'; -import { BeatTag, CMBeat } from '../../../common/domain_types'; -import { Breadcrumb } from '../../components/navigation/breadcrumb'; -import { BeatDetailTagsTable, Table } from '../../components/table'; -import { FrontendLibs } from '../../lib/types'; - -interface BeatTagsPageProps { - beat: CMBeat; - libs: FrontendLibs; - refreshBeat(): void; -} - -interface BeatTagsPageState { - notifications: any[]; - tags: BeatTag[]; -} - -export class BeatTagsPage extends React.PureComponent { - private tableRef = React.createRef
(); - constructor(props: BeatTagsPageProps) { - super(props); - - this.state = { - notifications: [], - tags: [], - }; - } - - public UNSAFE_componentWillMount() { - this.updateBeatsData(); - } - - public async updateBeatsData() { - const tags = await this.props.libs.tags.getTagsWithIds(this.props.beat.tags); - this.setState({ - tags, - }); - } - - public render() { - const { beat } = this.props; - return ( - - - -
- - this.setState({ notifications: [] })} - toastLifeTimeMs={5000} - /> - - ); - } -} diff --git a/x-pack/plugins/beats_management/public/pages/error/enforce_security.tsx b/x-pack/plugins/beats_management/public/pages/error/enforce_security.tsx deleted file mode 100644 index 2d55df7be69230..00000000000000 --- a/x-pack/plugins/beats_management/public/pages/error/enforce_security.tsx +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { FormattedMessage, injectI18n } from '@kbn/i18n/react'; -import * as React from 'react'; -import { NoDataLayout } from '../../components/layouts/no_data'; - -export const EnforceSecurityPage = injectI18n(({ intl }) => ( - -

- -

-
-)); diff --git a/x-pack/plugins/beats_management/public/pages/error/invalid_license.tsx b/x-pack/plugins/beats_management/public/pages/error/invalid_license.tsx deleted file mode 100644 index d34e3d22e4e677..00000000000000 --- a/x-pack/plugins/beats_management/public/pages/error/invalid_license.tsx +++ /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 - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { FormattedMessage, injectI18n } from '@kbn/i18n/react'; -import * as React from 'react'; -import { NoDataLayout } from '../../components/layouts/no_data'; - -export const InvalidLicensePage = injectI18n(({ intl }) => ( - -

- -

-
-)); diff --git a/x-pack/plugins/beats_management/public/pages/error/no_access.tsx b/x-pack/plugins/beats_management/public/pages/error/no_access.tsx deleted file mode 100644 index 2a380a64ccd898..00000000000000 --- a/x-pack/plugins/beats_management/public/pages/error/no_access.tsx +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { FormattedMessage, injectI18n } from '@kbn/i18n/react'; -import * as React from 'react'; -import { NoDataLayout } from '../../components/layouts/no_data'; - -export const NoAccessPage = injectI18n(({ intl }) => ( - -

- -

-
-)); diff --git a/x-pack/plugins/beats_management/public/pages/index.ts b/x-pack/plugins/beats_management/public/pages/index.ts deleted file mode 100644 index eafe9f9b1394fe..00000000000000 --- a/x-pack/plugins/beats_management/public/pages/index.ts +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { BeatDetailPage } from './beat/details'; -import { BeatDetailsPage } from './beat/index'; -import { BeatTagsPage } from './beat/tags'; -import { EnforceSecurityPage } from './error/enforce_security'; -import { InvalidLicensePage } from './error/invalid_license'; -import { NoAccessPage } from './error/no_access'; -import { TagsPage } from './overview/configuration_tags'; -import { BeatsPage } from './overview/enrolled_beats'; -import { MainPage } from './overview/index'; -import { TagCreatePage } from './tag/create'; -import { TagEditPage } from './tag/edit'; -import { BeatsInitialEnrollmentPage } from './walkthrough/initial/beat'; -import { FinishWalkthroughPage } from './walkthrough/initial/finish'; -import { InitialWalkthroughPage } from './walkthrough/initial/index'; -import { InitialTagPage } from './walkthrough/initial/tag'; -import type { RouteConfig } from '../components/navigation/child_routes'; - -export const routeMap: RouteConfig[] = [ - { path: '/tag/create/:tagid?', component: TagCreatePage }, - { path: '/tag/edit/:tagid?', component: TagEditPage }, - { - path: '/beat/:beatId', - component: BeatDetailsPage, - routes: [ - { path: '/beat/:beatId/details', component: BeatDetailPage }, - { path: '/beat/:beatId/tags', component: BeatTagsPage }, - ], - }, - { path: '/error/enforce_security', component: EnforceSecurityPage }, - { path: '/error/invalid_license', component: InvalidLicensePage }, - { path: '/error/no_access', component: NoAccessPage }, - { - path: '/overview', - component: MainPage, - routes: [ - { path: '/overview/configuration_tags', component: TagsPage }, - { path: '/overview/enrolled_beats', component: BeatsPage }, - ], - }, - { - path: '/walkthrough/initial', - component: InitialWalkthroughPage, - routes: [ - { path: '/walkthrough/initial/beat', component: BeatsInitialEnrollmentPage }, - { path: '/walkthrough/initial/finish', component: FinishWalkthroughPage }, - { path: '/walkthrough/initial/tag', component: InitialTagPage }, - ], - }, -]; diff --git a/x-pack/plugins/beats_management/public/pages/overview/configuration_tags.tsx b/x-pack/plugins/beats_management/public/pages/overview/configuration_tags.tsx deleted file mode 100644 index 0b7c4f17a6e2ca..00000000000000 --- a/x-pack/plugins/beats_management/public/pages/overview/configuration_tags.tsx +++ /dev/null @@ -1,118 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { EuiButton } from '@elastic/eui'; -import { i18n } from '@kbn/i18n'; -import { FormattedMessage, InjectedIntl, injectI18n } from '@kbn/i18n/react'; -import React from 'react'; -import { Breadcrumb } from '../../components/navigation/breadcrumb'; -import { AssignmentActionType, Table, TagsTableType } from '../../components/table'; -import { tagListActions } from '../../components/table/action_schema'; -import { WithKueryAutocompletion } from '../../containers/with_kuery_autocompletion'; -import { AppPageProps } from '../../frontend_types'; - -interface PageProps extends AppPageProps { - renderAction: (area: () => JSX.Element) => void; - intl: InjectedIntl; -} - -interface PageState { - tableRef: any; -} - -class TagsPageComponent extends React.PureComponent { - constructor(props: PageProps) { - super(props); - - this.state = { - tableRef: React.createRef(), - }; - - props.containers.tags.reload(props.urlState.tagsKBar); - props.renderAction(this.renderActionArea); - } - - public renderActionArea = () => ( - { - this.props.goTo('/tag/create'); - }} - > - - - ); - - public render() { - return ( - - - - {(autocompleteProps) => ( -
{ - this.props.setUrlState({ tagsKBar: value }); - this.props.containers.tags.reload(value); - }, - onSubmit: () => null, // todo - value: this.props.urlState.tagsKBar || '', - }} - actions={tagListActions} - actionHandler={this.handleTagsAction} - ref={this.state.tableRef} - items={this.props.containers.tags.state.list} - type={TagsTableType} - /> - )} - - - ); - } - - private handleTagsAction = async (action: AssignmentActionType) => { - const { intl } = this.props; - switch (action) { - case AssignmentActionType.Delete: - const success = await this.props.containers.tags.delete(this.getSelectedTags()); - if (!success) { - alert( - intl.formatMessage({ - id: 'xpack.beatsManagement.tags.someTagsMightBeAssignedToBeatsTitle', - defaultMessage: - 'Some of these tags might be assigned to beats. Please ensure tags being removed are not activly assigned', - }) - ); - } else { - if (this.state.tableRef && this.state.tableRef.current) { - this.state.tableRef.current.resetSelection(); - } - } - break; - } - }; - - private getSelectedTags = () => { - return this.state.tableRef.current ? this.state.tableRef.current.state.selection : []; - }; -} - -export const TagsPage = injectI18n(TagsPageComponent); diff --git a/x-pack/plugins/beats_management/public/pages/overview/enrolled_beats.tsx b/x-pack/plugins/beats_management/public/pages/overview/enrolled_beats.tsx deleted file mode 100644 index 0ab02430e90e61..00000000000000 --- a/x-pack/plugins/beats_management/public/pages/overview/enrolled_beats.tsx +++ /dev/null @@ -1,355 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { - EuiButton, - EuiButtonEmpty, - EuiGlobalToastList, - EuiModal, - EuiModalBody, - EuiModalHeader, - EuiModalHeaderTitle, -} from '@elastic/eui'; -import { i18n } from '@kbn/i18n'; -import { FormattedMessage, InjectedIntl, injectI18n } from '@kbn/i18n/react'; -import { flatten, sortBy } from 'lodash'; -import moment from 'moment'; -import React from 'react'; -import { BeatTag, CMBeat } from '../../../common/domain_types'; -import { EnrollBeat } from '../../components/enroll_beats'; -import { Breadcrumb } from '../../components/navigation/breadcrumb'; -import { BeatsTableType, Table } from '../../components/table'; -import { beatsListActions } from '../../components/table/action_schema'; -import { AssignmentActionType } from '../../components/table/table'; -import { WithKueryAutocompletion } from '../../containers/with_kuery_autocompletion'; -import { AppPageProps } from '../../frontend_types'; - -interface PageProps extends AppPageProps { - renderAction: (area: () => JSX.Element) => void; - intl: InjectedIntl; -} - -interface PageState { - notifications: any[]; - tags: BeatTag[] | null; - beats: CMBeat[]; - assignmentOptions: BeatTag[] | null; -} - -class BeatsPageComponent extends React.PureComponent { - private tableRef: React.RefObject = React.createRef(); - constructor(props: PageProps) { - super(props); - - this.state = { - notifications: [], - tags: null, - beats: [], - assignmentOptions: null, - }; - - props.renderAction(this.renderActionArea); - } - - public componentDidMount() { - if (this.props.urlState.beatsKBar) { - this.props.containers.beats.reload(this.props.urlState.beatsKBar); - } - this.updateBeatsData(this.props.urlState.beatsKBar); - } - - public async updateBeatsData(beatsKBar?: string) { - const beats = sortBy(await this.props.libs.beats.getAll(beatsKBar), 'id') || []; - const tags = await this.props.libs.tags.getTagsWithIds(flatten(beats.map((beat) => beat.tags))); - - this.setState({ - tags, - beats, - }); - } - - public renderActionArea = () => ( - - { - // random, but specific number ensures new tab does not overwrite another _newtab in chrome - // and at the same time not truly random so that many clicks of the link open many tabs at this same URL - window.open( - 'https://www.elastic.co/guide/en/beats/libbeat/current/getting-started.html', - '_newtab35628937456' - ); - }} - > - - - { - this.props.goTo(`/overview/enrolled_beats/enroll`); - }} - > - - - - {this.props.location.pathname === '/overview/enrolled_beats/enroll' && ( - { - this.props.setUrlState({ - enrollmentToken: '', - }); - this.props.goTo(`/overview/enrolled_beats`); - }} - style={{ width: '640px' }} - > - - - - - - - { - const enrollmentTokens = await this.props.libs.tokens.createEnrollmentTokens(); - this.props.setUrlState({ - enrollmentToken: enrollmentTokens[0], - }); - }} - onBeatEnrolled={() => { - this.props.setUrlState({ - enrollmentToken: '', - }); - }} - /> - {!this.props.urlState.enrollmentToken && ( - - { - this.props.goTo('/overview/enrolled_beats'); - }} - > - Done - - - )} - - - )} - - ); - - public render() { - return ( - - - - {(autocompleteProps) => ( -
{ - this.props.setUrlState({ beatsKBar: value }); - - this.updateBeatsData(value); - }, - onSubmit: () => null, // todo - value: this.props.urlState.beatsKBar || '', - }} - actions={beatsListActions} - actionData={{ - tags: this.state.assignmentOptions, - }} - actionHandler={async (action: AssignmentActionType, payload: any) => { - switch (action) { - case AssignmentActionType.Assign: - const status = await this.props.containers.beats.toggleTagAssignment( - payload, - this.getSelectedBeats() - ); - await this.updateBeatsData(); - this.notifyUpdatedTagAssociation(status, this.getSelectedBeats(), payload); - break; - case AssignmentActionType.Delete: - await this.props.containers.beats.deactivate(this.getSelectedBeats()); - await this.updateBeatsData(); - this.notifyBeatDisenrolled(this.getSelectedBeats()); - break; - case AssignmentActionType.Reload: - const assignmentOptions = await this.props.libs.tags.getassignableTagsForBeats( - this.getSelectedBeats() - ); - this.setState({ assignmentOptions }); - break; - } - }} - items={this.state.beats.map((beat) => ({ - ...beat, - tags: (this.state.tags || []).filter((tag) => beat.tags.includes(tag.id)), - }))} - ref={this.tableRef} - type={BeatsTableType} - /> - )} - - this.setState({ notifications: [] })} - toastLifeTimeMs={5000} - /> - - ); - } - - private notifyBeatDisenrolled = async (beats: CMBeat[]) => { - const { intl } = this.props; - let title; - let text; - if (beats.length === 1) { - title = intl.formatMessage( - { - id: 'xpack.beatsManagement.beats.beatDisenrolledNotificationTitle', - defaultMessage: '{firstBeatNameOrId} disenrolled', - }, - { - firstBeatNameOrId: `"${beats[0].name || beats[0].id}"`, - } - ); - text = intl.formatMessage( - { - id: 'xpack.beatsManagement.beats.beatDisenrolledNotificationDescription', - defaultMessage: 'Beat with ID {firstBeatId} was disenrolled.', - }, - { - firstBeatId: `"${beats[0].id}"`, - } - ); - } else { - title = intl.formatMessage( - { - id: 'xpack.beatsManagement.beats.disenrolledBeatsNotificationTitle', - defaultMessage: '{beatsLength} beats disenrolled', - }, - { - beatsLength: beats.length, - } - ); - } - - this.setState({ - notifications: this.state.notifications.concat({ - color: 'warning', - id: `disenroll_${new Date()}`, - title, - text, - }), - }); - }; - - private notifyUpdatedTagAssociation = ( - action: 'added' | 'removed', - beats: CMBeat[], - tag: string - ) => { - const { intl } = this.props; - const notificationMessage = - action === 'removed' - ? intl.formatMessage( - { - id: 'xpack.beatsManagement.beats.removedNotificationDescription', - defaultMessage: - 'Removed tag {tag} from {assignmentsLength, plural, one {beat {beatName}} other {# beats}}.', - }, - { - tag: `"${tag}"`, - assignmentsLength: beats.length, - beatName: `"${beats[0].name || beats[0].id}"`, - } - ) - : intl.formatMessage( - { - id: 'xpack.beatsManagement.beats.addedNotificationDescription', - defaultMessage: - 'Added tag {tag} to {assignmentsLength, plural, one {beat {beatName}} other {# beats}}.', - }, - { - tag: `"${tag}"`, - assignmentsLength: beats.length, - beatName: `"${beats[0].name || beats[0].id}"`, - } - ); - const notificationTitle = - action === 'removed' - ? intl.formatMessage( - { - id: 'xpack.beatsManagement.beats.removedNotificationTitle', - defaultMessage: '{assignmentsLength, plural, one {Tag} other {Tags}} removed', - }, - { - assignmentsLength: beats.length, - } - ) - : intl.formatMessage( - { - id: 'xpack.beatsManagement.beats.addedNotificationTitle', - defaultMessage: '{assignmentsLength, plural, one {Tag} other {Tags}} added', - }, - { - assignmentsLength: beats.length, - } - ); - - this.setState({ - notifications: this.state.notifications.concat({ - color: 'success', - id: `tag-${moment.now()}`, - text:

{notificationMessage}

, - title: notificationTitle, - }), - }); - }; - - private getSelectedBeats = (): CMBeat[] => { - if (!this.tableRef.current) { - return []; - } - const selectedIds = this.tableRef.current.state.selection.map((beat: any) => beat.id); - const beats: CMBeat[] = []; - selectedIds.forEach((id: any) => { - const beat = this.props.containers.beats.state.list.find((b) => b.id === id); - if (beat) { - beats.push(beat); - } - }); - return beats; - }; -} - -export const BeatsPage = injectI18n(BeatsPageComponent); diff --git a/x-pack/plugins/beats_management/public/pages/overview/index.tsx b/x-pack/plugins/beats_management/public/pages/overview/index.tsx deleted file mode 100644 index 942f600b09ea8e..00000000000000 --- a/x-pack/plugins/beats_management/public/pages/overview/index.tsx +++ /dev/null @@ -1,110 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { - EuiBetaBadge, - EuiFlexGroup, - EuiFlexItem, - EuiTab, - // @ts-ignore types for EuiTab not currently available - EuiTabs, -} from '@elastic/eui'; -import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; -import React from 'react'; -import { Subscribe } from 'unstated'; -import { CMBeat } from '../../../common/domain_types'; -import { PrimaryLayout } from '../../components/layouts/primary'; -import { ChildRoutes } from '../../components/navigation/child_routes'; -import { BeatsContainer } from '../../containers/beats'; -import { TagsContainer } from '../../containers/tags'; -import { withUrlState } from '../../containers/with_url_state'; -import { AppPageProps } from '../../frontend_types'; - -interface MainPagesState { - enrollBeat?: { - enrollmentToken: string; - } | null; - beats: CMBeat[]; - loadedBeatsAtLeastOnce: boolean; -} - -class MainPageComponent extends React.PureComponent { - constructor(props: AppPageProps) { - super(props); - this.state = { - loadedBeatsAtLeastOnce: false, - beats: [], - }; - } - public onTabClicked = (path: string) => { - return () => { - this.props.goTo(path); - }; - }; - - public render() { - return ( - - {'Beats'} - - - - - - } - hideBreadcrumbs={this.props.libs.framework.versionGreaterThen('6.7.0')} - > - {(renderAction: any) => ( - - {(beats: BeatsContainer, tags: TagsContainer) => ( - - - - - - - - - - - - )} - - )} - - ); - } -} - -export const MainPage = withUrlState(MainPageComponent); diff --git a/x-pack/plugins/beats_management/public/pages/tag/create.tsx b/x-pack/plugins/beats_management/public/pages/tag/create.tsx deleted file mode 100644 index 63651156760010..00000000000000 --- a/x-pack/plugins/beats_management/public/pages/tag/create.tsx +++ /dev/null @@ -1,160 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { EuiButton, EuiButtonEmpty, EuiFlexGroup, EuiFlexItem, EuiSpacer } from '@elastic/eui'; -import euiVars from '@elastic/eui/dist/eui_theme_light.json'; -import { i18n } from '@kbn/i18n'; -import { FormattedMessage, InjectedIntl, injectI18n } from '@kbn/i18n/react'; -import 'brace/mode/yaml'; -import 'brace/theme/github'; -import { isEqual } from 'lodash'; -import React from 'react'; -import { UNIQUENESS_ENFORCING_TYPES } from '../../../common/constants/configuration_blocks'; -import { BeatTag, ConfigurationBlock } from '../../../common/domain_types'; -import { PrimaryLayout } from '../../components/layouts/primary'; -import { TagEdit } from '../../components/tag'; -import { AppPageProps } from '../../frontend_types'; -import { randomEUIColor } from '../../utils/random_eui_color'; - -interface TagPageState { - showFlyout: boolean; - tag: BeatTag; - configuration_blocks: ConfigurationBlock[]; - currentConfigPage: number; -} -class TagCreatePageComponent extends React.PureComponent< - AppPageProps & { - intl: InjectedIntl; - }, - TagPageState -> { - constructor(props: AppPageProps & { intl: InjectedIntl }) { - super(props); - - this.state = { - showFlyout: false, - currentConfigPage: 0, - tag: { - id: '', - name: '', - color: randomEUIColor(euiVars), - hasConfigurationBlocksTypes: [], - }, - configuration_blocks: [], - }; - } - public render() { - const { intl } = this.props; - const blockStartingIndex = this.state.currentConfigPage * 5; - return ( - -
- - this.setState((oldState) => ({ - tag: { ...oldState.tag, [field]: value }, - })) - } - onConfigListChange={(index: number) => { - this.setState({ - currentConfigPage: index, - }); - }} - onConfigAddOrEdit={(block: ConfigurationBlock) => { - this.setState((previousState) => ({ - configuration_blocks: previousState.configuration_blocks.concat([block]), - })); - }} - onConfigRemoved={(block: ConfigurationBlock) => { - this.setState((previousState) => { - const selectedIndex = previousState.configuration_blocks.findIndex((c) => { - return isEqual(block, c); - }); - const blocks = [...previousState.configuration_blocks]; - blocks.splice(selectedIndex, 1); - return { - configuration_blocks: blocks, - }; - }); - }} - /> - - - - 1 // || this.state.tag.configuration_blocks.length === 0 - } - onClick={this.saveTag} - > - - - - - this.props.goTo('/overview/configuration_tags')}> - - - - -
-
- ); - } - - private saveTag = async () => { - const newTag = await this.props.containers.tags.upsertTag(this.state.tag); - if (!newTag) { - return alert( - i18n.translate('xpack.beatsManagement.createTag.errorSavingTagTitle', { - defaultMessage: 'error saving tag', - }) - ); - } - const createBlocksResponse = await this.props.libs.configBlocks.upsert( - this.state.configuration_blocks.map((block) => ({ ...block, tag: this.state.tag.id })) - ); - const creationError = createBlocksResponse.results.reduce( - (err: string, resp) => (!err ? (err = resp.error ? resp.error.message : '') : err), - '' - ); - if (creationError) { - return alert(creationError); - } - - this.props.goTo(`/overview/configuration_tags`); - }; - private getNumExclusiveConfigurationBlocks = () => - this.state.configuration_blocks - .map(({ type }) => UNIQUENESS_ENFORCING_TYPES.some((uniqueType) => uniqueType === type)) - .reduce((acc, cur) => (cur ? acc + 1 : acc), 0); -} - -export const TagCreatePage = injectI18n(TagCreatePageComponent); diff --git a/x-pack/plugins/beats_management/public/pages/tag/edit.tsx b/x-pack/plugins/beats_management/public/pages/tag/edit.tsx deleted file mode 100644 index 7c023a14b16bd6..00000000000000 --- a/x-pack/plugins/beats_management/public/pages/tag/edit.tsx +++ /dev/null @@ -1,203 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { EuiButton, EuiButtonEmpty, EuiFlexGroup, EuiFlexItem, EuiSpacer } from '@elastic/eui'; -import { FormattedMessage, InjectedIntl, injectI18n } from '@kbn/i18n/react'; -import 'brace/mode/yaml'; -import 'brace/theme/github'; -import { flatten } from 'lodash'; -import React from 'react'; -import { UNIQUENESS_ENFORCING_TYPES } from '../../../common/constants'; -import { BeatTag, CMBeat, ConfigurationBlock } from '../../../common/domain_types'; -import { PrimaryLayout } from '../../components/layouts/primary'; -import { TagEdit } from '../../components/tag'; -import { AppPageProps } from '../../frontend_types'; -interface TagPageState { - showFlyout: boolean; - attachedBeats: CMBeat[] | null; - tag: BeatTag; - beatsTags: BeatTag[]; - configuration_blocks: { - error?: string | undefined; - list: ConfigurationBlock[]; - page: number; - total: number; - }; -} -class TagEditPageComponent extends React.PureComponent< - AppPageProps & { - intl: InjectedIntl; - }, - TagPageState -> { - constructor(props: AppPageProps & { intl: InjectedIntl }) { - super(props); - - this.state = { - showFlyout: false, - attachedBeats: null, - beatsTags: [], - tag: { - id: props.match.params.tagid, - name: '', - color: '#fff', - hasConfigurationBlocksTypes: [], - }, - configuration_blocks: { - list: [], - page: 0, - total: 0, - }, - }; - } - - public UNSAFE_componentWillMount() { - this.loadTag(); - this.loadAttachedBeats(); - this.loadConfigBlocks(); - } - public render() { - const { intl } = this.props; - - return ( - -
- { - await this.props.containers.beats.removeTagsFromBeats(beatIds, this.state.tag.id); - await this.loadAttachedBeats(); - }} - onTagChange={(field: string, value: string | number) => - this.setState((oldState) => ({ - tag: { ...oldState.tag, [field]: value }, - })) - } - attachedBeats={ - (this.state.attachedBeats || []).map((beat) => ({ - ...beat, - tags: flatten( - beat.tags.map((tagId) => this.state.beatsTags.filter((tag) => tag.id === tagId)) - ), - })) as any - } - onConfigListChange={(index: number) => { - this.loadConfigBlocks(index); - }} - onConfigAddOrEdit={(block: ConfigurationBlock) => { - this.props.libs.configBlocks - .upsert([{ ...block, tag: this.state.tag.id }]) - .catch((e: any) => { - // eslint-disable-next-line - console.error('Error upseting config block', e); - }) - .then(() => { - this.loadConfigBlocks(this.state.configuration_blocks.page); - }); - }} - onConfigRemoved={(block: ConfigurationBlock) => { - this.props.libs.configBlocks - .delete(block.id) - .catch((e: any) => { - alert( - 'Error removing block, please check your browsers console logs for more details' - ); - // eslint-disable-next-line - console.error(`Error removing block ${block.id}`, e); - }) - .then(() => { - this.loadConfigBlocks(this.state.configuration_blocks.page); - }); - }} - /> - - - - 1 // || this.state.tag.configuration_blocks.length === 0 - } - onClick={this.saveTag} - > - - - - - this.props.goTo('/overview/configuration_tags')}> - - - - -
-
- ); - } - private loadConfigBlocks = async (page: number = -1) => { - const blocksResponse = await this.props.libs.configBlocks.getForTags([this.state.tag.id], page); - - this.setState({ - configuration_blocks: blocksResponse as { - error?: string | undefined; - list: ConfigurationBlock[]; - page: number; - total: number; - }, - }); - }; - - private loadTag = async () => { - const tags = await this.props.libs.tags.getTagsWithIds([this.props.match.params.tagid]); - if (tags.length === 0) { - // TODO do something to error https://github.com/elastic/kibana/issues/26023 - } - this.setState({ - tag: tags[0], - }); - }; - - private loadAttachedBeats = async () => { - const beats = await this.props.libs.beats.getBeatsWithTag(this.props.match.params.tagid); - const beatsTags = await this.props.libs.tags.getTagsWithIds( - flatten(beats.map((beat) => beat.tags)) - ); - this.setState({ - attachedBeats: beats, - beatsTags, - }); - }; - private saveTag = async () => { - await this.props.containers.tags.upsertTag(this.state.tag); - this.props.goTo(`/overview/configuration_tags`); - }; - private getNumExclusiveConfigurationBlocks = () => - this.state.configuration_blocks.list - .map(({ type }) => UNIQUENESS_ENFORCING_TYPES.some((uniqueType) => uniqueType === type)) - .reduce((acc, cur) => (cur ? acc + 1 : acc), 0); -} - -export const TagEditPage = injectI18n(TagEditPageComponent); diff --git a/x-pack/plugins/beats_management/public/pages/walkthrough/initial/beat.tsx b/x-pack/plugins/beats_management/public/pages/walkthrough/initial/beat.tsx deleted file mode 100644 index 2881bcfb18b565..00000000000000 --- a/x-pack/plugins/beats_management/public/pages/walkthrough/initial/beat.tsx +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { EuiButton } from '@elastic/eui'; -import React, { Component } from 'react'; -import { EnrollBeat } from '../../../components/enroll_beats'; -import { AppPageProps } from '../../../frontend_types'; - -interface ComponentState { - readyToContinue: boolean; -} - -export class BeatsInitialEnrollmentPage extends Component { - constructor(props: AppPageProps) { - super(props); - this.state = { - readyToContinue: false, - }; - } - - public onBeatEnrolled = () => { - this.setState({ - readyToContinue: true, - }); - }; - - public createEnrollmentToken = async () => { - const enrollmentToken = await this.props.libs.tokens.createEnrollmentTokens(); - this.props.setUrlState({ - enrollmentToken: enrollmentToken[0], - }); - }; - - public render() { - return ( - - - {this.state.readyToContinue && ( - - { - this.props.goTo('/walkthrough/initial/tag'); - }} - > - Continue - - - )} - - ); - } -} diff --git a/x-pack/plugins/beats_management/public/pages/walkthrough/initial/finish.tsx b/x-pack/plugins/beats_management/public/pages/walkthrough/initial/finish.tsx deleted file mode 100644 index 7a1bc5e2184fe3..00000000000000 --- a/x-pack/plugins/beats_management/public/pages/walkthrough/initial/finish.tsx +++ /dev/null @@ -1,136 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { EuiButton, EuiEmptyPrompt, EuiFlexGroup, EuiFlexItem, EuiPageContent } from '@elastic/eui'; -import { FormattedMessage, InjectedIntl, injectI18n } from '@kbn/i18n/react'; -import React from 'react'; -import { CMBeat } from '../../../../common/domain_types'; -import { AppPageProps } from '../../../frontend_types'; - -interface PageState { - assigned: boolean; -} -class FinishWalkthrough extends React.Component< - AppPageProps & { - intl: InjectedIntl; - }, - PageState -> { - constructor( - props: AppPageProps & { - intl: InjectedIntl; - } - ) { - super(props); - - this.state = { - assigned: false, - }; - } - - public componentDidMount() { - setTimeout(async () => { - const done = await this.assignTagToBeat(); - - if (done) { - this.setState({ - assigned: true, - }); - } - }, 300); - } - - public render() { - const { goTo } = this.props; - - return ( - - - - - - - } - body={ - -

- -

-
- } - actions={ - { - goTo('/overview/enrolled_beats'); - }} - > - - - } - /> -
-
-
- ); - } - - private assignTagToBeat = async () => { - const { intl } = this.props; - if (!this.props.urlState.enrollmentToken) { - return alert( - intl.formatMessage({ - id: 'xpack.beatsManagement.enrollBeat.assignTagToBeatInvalidURLNoTokenFountTitle', - defaultMessage: 'Invalid URL, no enrollmentToken found', - }) - ); - } - if (!this.props.urlState.createdTag) { - return alert( - intl.formatMessage({ - id: 'xpack.beatsManagement.enrollBeat.assignTagToBeatInvalidURLNoTagFoundTitle', - defaultMessage: 'Invalid URL, no createdTag found', - }) - ); - } - - const beat = await this.props.libs.beats.getBeatWithToken(this.props.urlState.enrollmentToken); - if (!beat) { - return alert( - intl.formatMessage({ - id: 'xpack.beatsManagement.enrollBeat.assignTagToBeatNotEnrolledProperlyTitle', - defaultMessage: 'Error: Beat not enrolled properly', - }) - ); - } - - await this.props.containers.beats.assignTagsToBeats( - [beat as CMBeat], - this.props.urlState.createdTag - ); - this.props.setUrlState({ - createdTag: '', - enrollmentToken: '', - }); - return true; - }; -} - -export const FinishWalkthroughPage = injectI18n(FinishWalkthrough); diff --git a/x-pack/plugins/beats_management/public/pages/walkthrough/initial/index.tsx b/x-pack/plugins/beats_management/public/pages/walkthrough/initial/index.tsx deleted file mode 100644 index 506aa87bc51ef2..00000000000000 --- a/x-pack/plugins/beats_management/public/pages/walkthrough/initial/index.tsx +++ /dev/null @@ -1,97 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { EuiBetaBadge, EuiButton, EuiFlexGroup, EuiFlexItem } from '@elastic/eui'; -import { i18n } from '@kbn/i18n'; -import { FormattedMessage, InjectedIntl, injectI18n } from '@kbn/i18n/react'; -import React from 'react'; -import { NoDataLayout } from '../../../components/layouts/no_data'; -import { WalkthroughLayout } from '../../../components/layouts/walkthrough'; -import { ChildRoutes } from '../../../components/navigation/child_routes'; -import { ConnectedLink } from '../../../components/navigation/connected_link'; -import { AppPageProps } from '../../../frontend_types'; - -type Props = AppPageProps & { - intl: InjectedIntl; -}; - -const InitialWalkthroughPageComponent: React.FC = (props) => { - if (props.location.pathname === '/walkthrough/initial') { - return ( - - {'Beats central management '} - - - - - } - actionSection={ - - - {' '} - - - } - > -

- -

-
- ); - } - return ( - { - // FIXME implament goto - }} - activePath={props.location.pathname} - > - - - ); -}; - -export const InitialWalkthroughPage = injectI18n(InitialWalkthroughPageComponent); diff --git a/x-pack/plugins/beats_management/public/pages/walkthrough/initial/tag.tsx b/x-pack/plugins/beats_management/public/pages/walkthrough/initial/tag.tsx deleted file mode 100644 index eb1e251b2896d3..00000000000000 --- a/x-pack/plugins/beats_management/public/pages/walkthrough/initial/tag.tsx +++ /dev/null @@ -1,137 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { EuiButton, EuiFlexGroup, EuiFlexItem } from '@elastic/eui'; -import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; -import { isEqual } from 'lodash'; -import React, { Component } from 'react'; -import uuidv4 from 'uuid/v4'; -import { BeatTag, ConfigurationBlock } from '../../../../common/domain_types'; -import { TagEdit } from '../../../components/tag/tag_edit'; -import { AppPageProps } from '../../../frontend_types'; -interface PageState { - tag: BeatTag; - configuration_blocks: ConfigurationBlock[]; - currentConfigPage: number; -} - -export class InitialTagPage extends Component { - constructor(props: AppPageProps) { - super(props); - this.state = { - tag: { - id: uuidv4(), - name: '', - color: '#DD0A73', - hasConfigurationBlocksTypes: [], - }, - configuration_blocks: [], - currentConfigPage: 0, - }; - - if (props.urlState.createdTag) { - this.loadTag(); - } - } - - public render() { - const blockStartingIndex = this.state.currentConfigPage * 5; - - return ( - - - this.setState((oldState) => ({ - tag: { ...oldState.tag, [field]: value }, - })) - } - onConfigListChange={(index: number) => { - this.setState({ - currentConfigPage: index, - }); - }} - onConfigAddOrEdit={(block: ConfigurationBlock) => { - this.setState((previousState) => ({ - configuration_blocks: previousState.configuration_blocks.concat([block]), - })); - }} - onConfigRemoved={(block: ConfigurationBlock) => { - this.setState((previousState) => { - const selectedIndex = previousState.configuration_blocks.findIndex((c) => { - return isEqual(block, c); - }); - const blocks = [...previousState.configuration_blocks]; - blocks.splice(selectedIndex, 1); - return { - configuration_blocks: blocks, - }; - }); - }} - /> - - - - - - - - - ); - } - - private loadTag = async () => { - const tags = await this.props.libs.tags.getTagsWithIds([this.state.tag.id]); - if (tags.length > 0) { - this.setState({ - tag: tags[0], - }); - } - }; - - private saveTag = async () => { - const newTag = await this.props.libs.tags.upsertTag(this.state.tag as BeatTag); - if (!newTag) { - return alert( - i18n.translate('xpack.beatsManagement.createTag.errorSavingTagTitle', { - defaultMessage: 'error saving tag', - }) - ); - } - const createBlocksResponse = await this.props.libs.configBlocks.upsert( - this.state.configuration_blocks.map((block) => ({ ...block, tag: this.state.tag.id })) - ); - const creationError = createBlocksResponse.results.reduce( - (err: string, resp) => (!err ? (err = resp.error ? resp.error.message : '') : err), - '' - ); - if (creationError) { - return alert(creationError); - } - this.props.setUrlState({ - createdTag: newTag.id, - }); - this.props.goTo(`/walkthrough/initial/finish`); - }; -} diff --git a/x-pack/plugins/beats_management/public/router.tsx b/x-pack/plugins/beats_management/public/router.tsx deleted file mode 100644 index 2c328c2745c14d..00000000000000 --- a/x-pack/plugins/beats_management/public/router.tsx +++ /dev/null @@ -1,132 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { get } from 'lodash'; -import React, { Component } from 'react'; -import { Redirect, Route, Switch } from 'react-router-dom'; -import { Loading } from './components/loading'; -import { ChildRoutes } from './components/navigation/child_routes'; -import { BeatsContainer } from './containers/beats'; -import { TagsContainer } from './containers/tags'; -import { URLStateProps, WithURLState } from './containers/with_url_state'; -import { FrontendLibs } from './lib/types'; -import { routeMap } from './pages/index'; - -interface RouterProps { - libs: FrontendLibs; - tagsContainer: TagsContainer; - beatsContainer: BeatsContainer; -} -interface RouterState { - loading: boolean; -} - -export class AppRouter extends Component { - constructor(props: RouterProps) { - super(props); - this.state = { - loading: true, - }; - } - - public async UNSAFE_componentWillMount() { - if (this.state.loading === true) { - try { - await this.props.beatsContainer.reload(); - await this.props.tagsContainer.reload(); - } catch (e) { - // TODO in a furture version we will better manage this "error" in a returned arg - } - - this.setState({ - loading: false, - }); - } - } - - public render() { - if (this.state.loading === true) { - return ; - } - - const countOfEverything = - this.props.beatsContainer.state.list.length + this.props.tagsContainer.state.list.length; - - return ( - - {/* Redirects mapping */} - - {/* License check (UI displays when license exists but is expired) */} - {get(this.props.libs.framework.info, 'license.expired', true) && ( - - !props.location.pathname.includes('/error') ? ( - - ) : null - } - /> - )} - - {/* Ensure security is eanabled for elastic and kibana */} - {!get(this.props.libs.framework.info, 'security.enabled', true) && ( - - !props.location.pathname.includes('/error') ? ( - - ) : null - } - /> - )} - - {/* Make sure the user has correct permissions */} - {!this.props.libs.framework.currentUserHasOneOfRoles( - ['beats_admin'].concat(this.props.libs.framework.info.settings.defaultUserRoles) - ) && ( - - !props.location.pathname.includes('/error') ? ( - - ) : null - } - /> - )} - - {/* If there are no beats or tags yet, redirect to the walkthrough */} - {countOfEverything === 0 && ( - - !props.location.pathname.includes('/walkthrough') ? ( - - ) : null - } - /> - )} - - {/* This app does not make use of a homepage. The mainpage is overview/enrolled_beats */} - } /> - - - {/* Render routes from the FS */} - - {(URLProps: URLStateProps) => ( - - )} - - - ); - } -} diff --git a/x-pack/plugins/beats_management/public/utils/random_eui_color.ts b/x-pack/plugins/beats_management/public/utils/random_eui_color.ts deleted file mode 100644 index 52d847cc6a5a0e..00000000000000 --- a/x-pack/plugins/beats_management/public/utils/random_eui_color.ts +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { sample } from 'lodash'; - -export const randomEUIColor = (euiVars: any) => { - const rgb = sample( - Object.keys(euiVars) - .filter((key) => key.startsWith('euiColorVis')) - .map((key) => (euiVars as any)[key]) - ); - - const matchedrgb = rgb.match( - /^rgba?[\s+]?\([\s+]?(\d+)[\s+]?,[\s+]?(\d+)[\s+]?,[\s+]?(\d+)[\s+]?/i - ); - return matchedrgb && matchedrgb.length === 4 - ? '#' + - ('0' + parseInt(matchedrgb[1], 10).toString(16)).slice(-2) + - ('0' + parseInt(matchedrgb[2], 10).toString(16)).slice(-2) + - ('0' + parseInt(matchedrgb[3], 10).toString(16)).slice(-2) - : ''; -}; diff --git a/x-pack/plugins/beats_management/public/utils/typed_react.ts b/x-pack/plugins/beats_management/public/utils/typed_react.ts deleted file mode 100644 index ee5ffc2969bb07..00000000000000 --- a/x-pack/plugins/beats_management/public/utils/typed_react.ts +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import React from 'react'; - -export type RendererResult = React.ReactElement | null; -export type RendererFunction = (args: RenderArgs) => Result; - -export type StateUpdater = ( - prevState: Readonly, - prevProps: Readonly -) => State | null; - -export function composeStateUpdaters(...updaters: Array>) { - return (state: State, props: Props) => - updaters.reduce((currentState, updater) => updater(currentState, props) || currentState, state); -} diff --git a/x-pack/plugins/beats_management/readme.md b/x-pack/plugins/beats_management/readme.md deleted file mode 100644 index 75adf428772e43..00000000000000 --- a/x-pack/plugins/beats_management/readme.md +++ /dev/null @@ -1,39 +0,0 @@ -# Beats CM - -Notes: -Failure to have auth enabled in Kibana will make for a broken UI. UI-based errors not yet in place - -## Testing - -### Unit tests - -Run Jest tests: - -Documentation: https://www.elastic.co/guide/en/kibana/current/development-tests.html#_unit_testing - -``` -yarn test:jest x-pack/plugins/beats --watch -``` - -### API tests - -In one shell, from **~/kibana/x-pack**: -`node scripts/functional_tests-server.js` - -In another shell, from **~kibana/x-pack**: -`node ../scripts/functional_test_runner.js --config test/api_integration/config.ts`. - -### Manual e2e testing - -- Run this command to fake an enrolling beat (from beats_management dir) - -``` -node scripts/enroll.js -``` - -- Run a command to setup a fake large-scale deployment - Note: `ts-node` is required to be installed gloably from NPM/Yarn for this action - -``` -ts-node scripts/fake_env.ts <# of beats> <# of tags per beat> <# of congifs per tag> -``` diff --git a/x-pack/plugins/beats_management/scripts/enroll.js b/x-pack/plugins/beats_management/scripts/enroll.js deleted file mode 100644 index 3c6712ada8e9b2..00000000000000 --- a/x-pack/plugins/beats_management/scripts/enroll.js +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -const request = require('request'); -const Chance = require('chance'); // eslint-disable-line -const args = process.argv.slice(2); -const chance = new Chance(); - -const enroll = async (kibanaURL, token) => { - const beatId = chance.word(); - - if (!token) { - token = kibanaURL; - kibanaURL = 'http://localhost:5601'; - } - - await request( - { - url: `${kibanaURL}/api/beats/agent/${beatId}`, - method: 'POST', - headers: { - 'kbn-xsrf': 'xxx', - 'kbn-beats-enrollment-token': token, - }, - body: JSON.stringify({ - type: 'filebeat', - host_name: `${chance.word()}.bar.com`, - name: chance.word(), - version: '6.3.0', - }), - }, - (error, response, body) => { - console.log(error, body); - } - ); -}; - -enroll(...args); diff --git a/x-pack/plugins/beats_management/scripts/fake_env.ts b/x-pack/plugins/beats_management/scripts/fake_env.ts deleted file mode 100644 index e45bbe2277387b..00000000000000 --- a/x-pack/plugins/beats_management/scripts/fake_env.ts +++ /dev/null @@ -1,158 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import Chance from 'chance'; -// @ts-ignore -import request from 'request'; -import uuidv4 from 'uuid/v4'; -import { configBlockSchemas } from '../common/config_schemas'; -import { BeatTag } from '../common/domain_types'; -import { compose } from '../public/lib/compose/scripts'; -const args = process.argv.slice(2); -const chance = new Chance(); - -function sleep(ms: number) { - return new Promise((resolve) => setTimeout(resolve, ms)); -} -function getRandomColor() { - const letters = '0123456789ABCDEF'; - let color = '#'; - for (let i = 0; i < 6; i++) { - color += letters[Math.floor(Math.random() * 16)]; - } - return color; -} - -const enroll = async (kibanaURL: string, token: string) => { - const beatId = uuidv4(); - - await request( - { - url: `${kibanaURL}/api/beats/agent/${beatId}`, - method: 'POST', - headers: { - 'kbn-xsrf': 'xxx', - 'kbn-beats-enrollment-token': token, - }, - body: JSON.stringify({ - type: Math.random() >= 0.5 ? 'filebeat' : 'metricbeat', - host_name: `${chance.word()}.local`, - name: chance.word(), - version: '6.7.0', - }), - }, - (error: any, response: any, body: any) => { - const res = JSON.parse(body); - if (res.message) { - // eslint-disable-next-line - console.log(res.message); - } - } - ); -}; - -const start = async ( - kibanaURL: string, - numberOfBeats = 10, - maxNumberOfTagsPerBeat = 2, - maxNumberOfConfigsPerTag = 4 -) => { - try { - const libs = compose(kibanaURL); - // eslint-disable-next-line - console.error(`Enrolling ${numberOfBeats} fake beats...`); - - const enrollmentTokens = await libs.tokens.createEnrollmentTokens(numberOfBeats); - process.stdout.write(`enrolling fake beats... 0 of ${numberOfBeats}`); - let count = 0; - for (const token of enrollmentTokens) { - count++; - // @ts-ignore - process.stdout.clearLine(); - // @ts-ignore - process.stdout.cursorTo(0); - process.stdout.write(`enrolling fake beats... ${count} of ${numberOfBeats}`); - - await enroll(kibanaURL, token); - await sleep(10); - } - process.stdout.write('\n'); - - await sleep(2000); - // eslint-disable-next-line - console.error(`${numberOfBeats} fake beats are enrolled`); - const beats = await libs.beats.getAll(); - - // eslint-disable-next-line - console.error(`Creating tags, configs, and assigning them...`); - process.stdout.write(`creating tags/configs for beat... 0 of ${numberOfBeats}`); - count = 0; - for (const beat of beats) { - count++; - // @ts-ignore - process.stdout.clearLine(); - // @ts-ignore - process.stdout.cursorTo(0); - process.stdout.write(`creating tags w/configs for beat... ${count} of ${numberOfBeats}`); - - const tags = await Promise.all( - [...Array(maxNumberOfTagsPerBeat)].map(() => { - return libs.tags.upsertTag({ - name: chance.word(), - color: getRandomColor(), - hasConfigurationBlocksTypes: [] as string[], - } as BeatTag); - }) - ); - await libs.beats.assignTagsToBeats( - tags.map((tag: any) => ({ - beatId: beat.id, - tag: tag.id, - })) - ); - - await Promise.all( - tags.map((tag: any) => { - return libs.configBlocks.upsert( - [...Array(maxNumberOfConfigsPerTag)].map( - () => - ({ - type: configBlockSchemas[Math.floor(Math.random())].id, - description: `Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sint ista Graecorum; -Nihil ad rem! Ne sit sane; Quod quidem nobis non saepe contingit. -Duo Reges: constructio interrete. Itaque his sapiens semper vacabit.`.substring( - 0, - Math.floor(Math.random() * (0 - 115 + 1)) - ), - tag: tag.id, - last_updated: new Date(), - config: {}, - } as any) - ) - ); - }) - ); - } - } catch (e) { - if (e.response && e.response.data && e.response.message) { - // eslint-disable-next-line - console.error(e.response.data.message); - } else if (e.response && e.response.data && e.response.reason) { - // eslint-disable-next-line - console.error(e.response.data.reason); - } else if (e.code) { - // eslint-disable-next-line - console.error(e.code); - } else { - // eslint-disable-next-line - console.error(e); - } - } -}; - -// @ts-ignore -start(...args); diff --git a/x-pack/plugins/beats_management/server/index.ts b/x-pack/plugins/beats_management/server/index.ts deleted file mode 100644 index 5489fce1f36a3c..00000000000000 --- a/x-pack/plugins/beats_management/server/index.ts +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { PluginInitializer } from '../../../../src/core/server'; -import { beatsManagementConfigSchema } from '../common'; -import { BeatsManagementPlugin } from './plugin'; - -export const config = { - schema: beatsManagementConfigSchema, - - exposeToBrowser: { - defaultUserRoles: true, - encryptionKey: true, - enrollmentTokensTtlInSeconds: true, - }, -}; - -export const plugin: PluginInitializer<{}, {}> = (context) => new BeatsManagementPlugin(context); diff --git a/x-pack/plugins/beats_management/server/index_templates/beats_template.json b/x-pack/plugins/beats_management/server/index_templates/beats_template.json deleted file mode 100644 index 36fc753c68745f..00000000000000 --- a/x-pack/plugins/beats_management/server/index_templates/beats_template.json +++ /dev/null @@ -1,137 +0,0 @@ -{ - "index_patterns": [".management-beats"], - "version": 70000, - "settings": { - "index": { - "number_of_shards": 1, - "auto_expand_replicas": "0-1", - "codec": "best_compression" - } - }, - "mappings": { - "dynamic": "strict", - "properties": { - "type": { - "type": "keyword" - }, - "configuration_block": { - "properties": { - "id": { - "type": "keyword" - }, - "type": { - "type": "keyword" - }, - "tag": { - "type": "keyword" - }, - "description": { - "type": "text" - }, - "config": { - "type": "keyword" - }, - "last_updated": { - "type": "date" - } - } - }, - "enrollment_token": { - "properties": { - "token": { - "type": "keyword" - }, - "expires_on": { - "type": "date" - } - } - }, - "tag": { - "properties": { - "id": { - "type": "keyword" - }, - "name": { - "type": "keyword" - }, - "color": { - "type": "keyword" - }, - "hasConfigurationBlocksTypes": { - "type": "keyword" - } - } - }, - "beat": { - "properties": { - "id": { - "type": "keyword" - }, - "status": { - "properties": { - "type": { - "type": "keyword" - }, - "timestamp": { - "type": "date" - }, - "event": { - "properties": { - "type": { - "type": "keyword" - }, - "message": { - "type": "text" - }, - "uuid": { - "type": "keyword" - } - } - } - } - }, - "active": { - "type": "boolean" - }, - "last_checkin": { - "type": "date" - }, - "enrollment_token": { - "type": "keyword" - }, - "access_token": { - "type": "keyword" - }, - "verified_on": { - "type": "date" - }, - "type": { - "type": "keyword" - }, - "version": { - "type": "keyword" - }, - "host_ip": { - "type": "ip" - }, - "host_name": { - "type": "keyword" - }, - "ephemeral_id": { - "type": "keyword" - }, - "tags": { - "type": "keyword" - }, - "metadata": { - "dynamic": "true", - "type": "object" - }, - "name": { - "type": "keyword" - } - } - } - } - } -} diff --git a/x-pack/plugins/beats_management/server/index_templates/events_template.json b/x-pack/plugins/beats_management/server/index_templates/events_template.json deleted file mode 100644 index 4f8063f0481329..00000000000000 --- a/x-pack/plugins/beats_management/server/index_templates/events_template.json +++ /dev/null @@ -1,45 +0,0 @@ -{ - "index_patterns": [".management-beats-events-*"], - "version": 67000, - "index": { - "lifecycle": { - "name": ".beats-management-events-retention" - } - }, - "settings": { - "index": { - "number_of_shards": 1, - "auto_expand_replicas": "0-1", - "codec": "best_compression" - } - }, - "mappings": { - "_doc": { - "dynamic": "strict", - "properties": { - "type": { - "type": "keyword" - }, - "beat": { - "type": "keyword" - }, - "timestamp": { - "type": "date" - }, - "event": { - "properties": { - "type": { - "type": "keyword" - }, - "message": { - "type": "text" - }, - "uuid": { - "type": "keyword" - } - } - } - } - } - } -} diff --git a/x-pack/plugins/beats_management/server/index_templates/index.ts b/x-pack/plugins/beats_management/server/index_templates/index.ts deleted file mode 100644 index ade9a86114e630..00000000000000 --- a/x-pack/plugins/beats_management/server/index_templates/index.ts +++ /dev/null @@ -1,11 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import beatsIndexTemplate from './beats_template.json'; -import eventsIndexTemplate from './events_template.json'; - -export { beatsIndexTemplate, eventsIndexTemplate }; diff --git a/x-pack/plugins/beats_management/server/lib/adapters/beats/adapter_types.ts b/x-pack/plugins/beats_management/server/lib/adapters/beats/adapter_types.ts deleted file mode 100644 index 995fec9825db88..00000000000000 --- a/x-pack/plugins/beats_management/server/lib/adapters/beats/adapter_types.ts +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { CMBeat } from '../../../../common/domain_types'; -import { FrameworkUser } from '../framework/adapter_types'; - -export interface CMBeatsAdapter { - insert(user: FrameworkUser, beat: CMBeat): Promise; - update(user: FrameworkUser, beat: CMBeat): Promise; - get(user: FrameworkUser, id: string): Promise; - getAll(user: FrameworkUser, ESQuery?: any): Promise; - getWithIds(user: FrameworkUser, beatIds: string[]): Promise; - getAllWithTags(user: FrameworkUser, tagIds: string[]): Promise; - getBeatWithToken(user: FrameworkUser, enrollmentToken: string): Promise; - removeTagsFromBeats( - user: FrameworkUser, - removals: BeatsTagAssignment[] - ): Promise; - assignTagsToBeats( - user: FrameworkUser, - assignments: BeatsTagAssignment[] - ): Promise; -} - -export interface BeatsTagAssignment { - beatId: string; - tag: string; - idxInRequest?: number; -} - -interface BeatsReturnedTagAssignment { - status: number | null; - result?: string; -} - -export interface CMAssignmentReturn { - assignments: BeatsReturnedTagAssignment[]; -} - -export interface BeatsRemovalReturn { - removals: BeatsReturnedTagAssignment[]; -} diff --git a/x-pack/plugins/beats_management/server/lib/adapters/beats/elasticsearch_beats_adapter.ts b/x-pack/plugins/beats_management/server/lib/adapters/beats/elasticsearch_beats_adapter.ts deleted file mode 100644 index 3fdba8f7441d19..00000000000000 --- a/x-pack/plugins/beats_management/server/lib/adapters/beats/elasticsearch_beats_adapter.ts +++ /dev/null @@ -1,245 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { flatten, get as _get, omit } from 'lodash'; -import { INDEX_NAMES } from '../../../../common/constants'; -import { CMBeat } from '../../../../common/domain_types'; -import { DatabaseAdapter } from '../database/adapter_types'; -import { FrameworkUser } from '../framework/adapter_types'; -import { BeatsTagAssignment, CMBeatsAdapter } from './adapter_types'; - -function formatWithTags(beat: CMBeat) { - const { tags, ...rest } = beat; - - return { - tags: tags || [], - ...rest, - }; -} - -export class ElasticsearchBeatsAdapter implements CMBeatsAdapter { - private database: DatabaseAdapter; - - constructor(database: DatabaseAdapter) { - this.database = database; - } - - public async get(user: FrameworkUser, id: string) { - const params = { - id: `beat:${id}`, - ignore: [404], - index: INDEX_NAMES.BEATS, - }; - - const response = await this.database.get(user, params); - if (!response.found) { - return null; - } - const beat = _get(response, '_source.beat') as CMBeat; - beat.tags = beat.tags || []; - return beat; - } - - public async insert(user: FrameworkUser, beat: CMBeat) { - const body = { - beat, - type: 'beat', - }; - - await this.database.index(user, { - body, - id: `beat:${beat.id}`, - index: INDEX_NAMES.BEATS, - refresh: 'wait_for', - }); - } - - public async update(user: FrameworkUser, beat: CMBeat) { - const body = { - beat, - type: 'beat', - }; - - const params = { - body, - id: `beat:${beat.id}`, - index: INDEX_NAMES.BEATS, - refresh: 'wait_for', - }; - await this.database.index(user, params); - } - - public async getWithIds(user: FrameworkUser, beatIds: string[]) { - const ids = beatIds.map((beatId) => `beat:${beatId}`); - - const params = { - body: { - ids, - }, - index: INDEX_NAMES.BEATS, - }; - const response = await this.database.mget(user, params); - - return _get(response, 'docs', []) - .filter((b: any) => b.found) - .map((b: any) => ({ tags: [], ...b._source.beat })); - } - - public async getAllWithTags(user: FrameworkUser, tagIds: string[]): Promise { - const params = { - ignore: [404], - index: INDEX_NAMES.BEATS, - body: { - query: { - terms: { 'beat.tags': tagIds }, - }, - }, - }; - - const response = await this.database.search(user, params); - - const beats = _get(response, 'hits.hits', []) as CMBeat[]; - - if (beats.length === 0) { - return []; - } - return beats.map((beat: any) => - formatWithTags(omit(beat._source.beat as CMBeat, ['access_token']) as CMBeat) - ); - } - - public async getBeatWithToken( - user: FrameworkUser, - enrollmentToken: string - ): Promise { - const params = { - ignore: [404], - index: INDEX_NAMES.BEATS, - body: { - query: { - match: { 'beat.enrollment_token': enrollmentToken }, - }, - }, - }; - - const response = await this.database.search(user, params); - - const beats = _get(response, 'hits.hits', []) as CMBeat[]; - - if (beats.length === 0) { - return null; - } - return omit(_get(formatWithTags(beats[0]), '_source.beat'), ['access_token']) as CMBeat; - } - - public async getAll(user: FrameworkUser, ESQuery?: any) { - const params = { - index: INDEX_NAMES.BEATS, - size: 10000, - ignore: [404], - body: { - query: { - bool: { - must: { - term: { - type: 'beat', - }, - }, - }, - }, - }, - }; - - if (ESQuery) { - params.body.query = { - ...params.body.query, - ...ESQuery, - }; - } - - let response; - try { - response = await this.database.search(user, params); - } catch (e) { - // TODO something - } - if (!response) { - return []; - } - const beats = _get(response, 'hits.hits', []) as any; - - return beats.map((beat: any) => - formatWithTags(omit(beat._source.beat as CMBeat, ['access_token']) as CMBeat) - ); - } - - public async removeTagsFromBeats( - user: FrameworkUser, - removals: BeatsTagAssignment[] - ): Promise { - const body = flatten( - removals.map(({ beatId, tag }) => { - const script = ` - def beat = ctx._source.beat; - if (beat.tags != null) { - beat.tags.removeAll([params.tag]); - }`; - - return [ - { update: { _id: `beat:${beatId}` } }, - { script: { source: script.replace(' ', ''), params: { tag } } }, - ]; - }) - ); - - const response = await this.database.bulk(user, { - body, - index: INDEX_NAMES.BEATS, - refresh: 'wait_for', - }); - return (_get(response, 'items', []) as any).map((item: any, resultIdx: number) => ({ - idxInRequest: removals[resultIdx].idxInRequest, - result: item.update.result, - status: item.update.status, - })); - } - - public async assignTagsToBeats( - user: FrameworkUser, - assignments: BeatsTagAssignment[] - ): Promise { - const body = flatten( - assignments.map(({ beatId, tag }) => { - const script = ` - def beat = ctx._source.beat; - if (beat.tags == null) { - beat.tags = []; - } - if (!beat.tags.contains(params.tag)) { - beat.tags.add(params.tag); - }`; - - return [ - { update: { _id: `beat:${beatId}` } }, - { script: { source: script.replace(' ', ''), params: { tag } } }, - ]; - }) - ); - - const response = await this.database.bulk(user, { - body, - index: INDEX_NAMES.BEATS, - refresh: 'wait_for', - }); - // console.log(response.items[0].update.error); - return (_get(response, 'items', []) as any).map((item: any, resultIdx: any) => ({ - idxInRequest: assignments[resultIdx].idxInRequest, - result: item.update.result, - status: item.update.status, - })); - } -} diff --git a/x-pack/plugins/beats_management/server/lib/adapters/configuration_blocks/adapter_types.ts b/x-pack/plugins/beats_management/server/lib/adapters/configuration_blocks/adapter_types.ts deleted file mode 100644 index dcd2043bd0ea15..00000000000000 --- a/x-pack/plugins/beats_management/server/lib/adapters/configuration_blocks/adapter_types.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 - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { ConfigurationBlock } from '../../../../common/domain_types'; -import { FrameworkUser } from '../framework/adapter_types'; - -export interface ConfigurationBlockAdapter { - getByIds(user: FrameworkUser, ids: string[]): Promise; - getForTags( - user: FrameworkUser, - tagIds: string[], - page?: number, - size?: number - ): Promise<{ blocks: ConfigurationBlock[]; page: number; total: number }>; - delete( - user: FrameworkUser, - blockIds: string[] - ): Promise>; - create(user: FrameworkUser, configs: ConfigurationBlock[]): Promise; - deleteForTags( - user: FrameworkUser, - tagIds: string[] - ): Promise<{ success: boolean; reason?: string }>; -} diff --git a/x-pack/plugins/beats_management/server/lib/adapters/configuration_blocks/elasticsearch_configuration_block_adapter.ts b/x-pack/plugins/beats_management/server/lib/adapters/configuration_blocks/elasticsearch_configuration_block_adapter.ts deleted file mode 100644 index 744aa0d87c7601..00000000000000 --- a/x-pack/plugins/beats_management/server/lib/adapters/configuration_blocks/elasticsearch_configuration_block_adapter.ts +++ /dev/null @@ -1,168 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { flatten, get } from 'lodash'; -import uuidv4 from 'uuid/v4'; -import { INDEX_NAMES } from '../../../../common/constants'; -import { ConfigurationBlock } from '../../../../common/domain_types'; -import { DatabaseAdapter } from '../database/adapter_types'; -import { FrameworkUser } from '../framework/adapter_types'; -import { ConfigurationBlockAdapter } from './adapter_types'; - -export class ElasticsearchConfigurationBlockAdapter implements ConfigurationBlockAdapter { - private database: DatabaseAdapter; - - constructor(database: DatabaseAdapter) { - this.database = database; - } - - public async getByIds(user: FrameworkUser, ids: string[]): Promise { - if (ids.length === 0) { - return []; - } - - const params = { - ignore: [404], - _source: true, - size: 10000, - index: INDEX_NAMES.BEATS, - body: { - ids: ids.map((id) => `configuration_block:${id}`), - }, - }; - - const response = await this.database.search(user, params); - const configs = get(response, 'hits.hits', []); - - return configs.map((tag: any) => ({ ...tag._source.tag, config: JSON.parse(tag._source.tag) })); - } - - public async getForTags( - user: FrameworkUser, - tagIds: string[], - page: number = 0, - size: number = 100 - ): Promise<{ blocks: ConfigurationBlock[]; page: number; total: number }> { - if (tagIds.length === 0) { - return { - page: 0, - total: 0, - blocks: [] as ConfigurationBlock[], - }; - } - - const params = { - ignore: [404], - index: INDEX_NAMES.BEATS, - body: { - from: page === -1 ? undefined : page * size, - size, - query: { - terms: { 'configuration_block.tag': tagIds }, - }, - }, - }; - let response; - if (page === -1) { - response = await this.database.searchAll(user, params); - } else { - response = await this.database.search(user, params); - } - const configs = get(response, 'hits.hits', []); - - return { - blocks: configs.map((block: any) => ({ - ...block._source.configuration_block, - config: JSON.parse(block._source.configuration_block.config || '{}'), - })), - page, - total: response.hits ? (response.hits.total as any).value : 0, - }; - } - - public async delete( - user: FrameworkUser, - ids: string[] - ): Promise> { - const result = await this.database.bulk(user, { - body: ids.map((id) => ({ delete: { _id: `configuration_block:${id}` } })), - index: INDEX_NAMES.BEATS, - refresh: 'wait_for', - }); - - if (result.errors) { - if (result.items[0].result) { - throw new Error(result.items[0].result); - } - throw new Error((result.items[0] as any).index.error.reason); - } - - return result.items.map((item: any) => { - return { - id: item.delete._id, - success: item.delete.result === 'deleted', - reason: item.delete.result !== 'deleted' ? item.delete.result : undefined, - }; - }); - } - - public async deleteForTags( - user: FrameworkUser, - tagIds: string[] - ): Promise<{ success: boolean; reason?: string }> { - const result: any = await this.database.deleteByQuery(user, { - body: { - query: { - terms: { 'configuration_block.tag': tagIds }, - }, - }, - index: INDEX_NAMES.BEATS, - }); - - if (result.failures.length > 0) { - return { - success: false, - reason: result.failures[0], - }; - } - - return { - success: true, - }; - } - - public async create(user: FrameworkUser, configs: ConfigurationBlock[]): Promise { - const body = flatten( - configs.map((config) => { - const { id: configId, ...configWithoutId } = config; - const id = configId || uuidv4(); - return [ - { index: { _id: `configuration_block:${id}` } }, - { - type: 'configuration_block', - configuration_block: { id, ...configWithoutId, config: JSON.stringify(config.config) }, - }, - ]; - }) - ); - - const result = await this.database.bulk(user, { - body, - index: INDEX_NAMES.BEATS, - refresh: 'wait_for', - }); - - if (result.errors) { - if (result.items[0].result) { - throw new Error(result.items[0].result); - } - throw new Error((result.items[0] as any).index.error.reason); - } - - return result.items.map((item: any) => item.index._id); - } -} diff --git a/x-pack/plugins/beats_management/server/lib/adapters/database/adapter_types.ts b/x-pack/plugins/beats_management/server/lib/adapters/database/adapter_types.ts deleted file mode 100644 index a1af8e79296355..00000000000000 --- a/x-pack/plugins/beats_management/server/lib/adapters/database/adapter_types.ts +++ /dev/null @@ -1,302 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { FrameworkUser } from '../framework/adapter_types'; - -export interface DatabaseAdapter { - get( - user: FrameworkUser, - params: DatabaseGetParams - ): Promise>; - create( - user: FrameworkUser, - params: DatabaseCreateDocumentParams - ): Promise; - index( - user: FrameworkUser, - params: DatabaseIndexDocumentParams - ): Promise; - delete( - user: FrameworkUser, - params: DatabaseDeleteDocumentParams - ): Promise; - deleteByQuery( - user: FrameworkUser, - params: DatabaseSearchParams - ): Promise; - mget(user: FrameworkUser, params: DatabaseMGetParams): Promise>; - bulk( - user: FrameworkUser, - params: DatabaseBulkIndexDocumentsParams - ): Promise; - search(user: FrameworkUser, params: DatabaseSearchParams): Promise>; - searchAll( - user: FrameworkUser, - params: DatabaseSearchParams - ): Promise>; - putTemplate(name: string, template: any): Promise; -} - -export interface DatabaseSearchParams extends DatabaseGenericParams { - analyzer?: string; - analyzeWildcard?: boolean; - defaultOperator?: DefaultOperator; - df?: string; - explain?: boolean; - storedFields?: DatabaseNameList; - docvalueFields?: DatabaseNameList; - fielddataFields?: DatabaseNameList; - from?: number; - ignoreUnavailable?: boolean; - allowNoIndices?: boolean; - expandWildcards?: ExpandWildcards; - lenient?: boolean; - lowercaseExpandedTerms?: boolean; - preference?: string; - q?: string; - routing?: DatabaseNameList; - scroll?: string; - searchType?: 'query_then_fetch' | 'dfs_query_then_fetch'; - size?: number; - sort?: DatabaseNameList; - _source?: DatabaseNameList; - _sourceExclude?: DatabaseNameList; - _source_includes?: DatabaseNameList; - terminateAfter?: number; - stats?: DatabaseNameList; - suggestField?: string; - suggestMode?: 'missing' | 'popular' | 'always'; - suggestSize?: number; - suggestText?: string; - timeout?: string; - trackScores?: boolean; - version?: boolean; - requestCache?: boolean; - index?: DatabaseNameList; - type?: DatabaseNameList; -} - -export interface DatabaseSearchResponse { - took: number; - timed_out: boolean; - _scroll_id?: string; - _shards: DatabaseShardsResponse; - hits: { - total: number; - max_score: number; - hits: Array<{ - _index: string; - _id: string; - _score: number; - _source: T; - _seq_no?: number; - _primary_term?: number; - _explanation?: DatabaseExplanation; - fields?: any; - highlight?: any; - inner_hits?: any; - sort?: string[]; - }>; - }; - aggregations?: any; -} - -export interface DatabaseExplanation { - value: number; - description: string; - details: DatabaseExplanation[]; -} - -export interface DatabaseShardsResponse { - total: number; - successful: number; - failed: number; - skipped: number; -} - -export interface DatabaseGetDocumentResponse { - _index: string; - _id: string; - _seq_no: number; - _primary_term: number; - found: boolean; - _source: Source; -} - -export interface DatabaseBulkResponse { - took: number; - errors: boolean; - items: Array< - DatabaseDeleteDocumentResponse | DatabaseIndexDocumentResponse | DatabaseUpdateDocumentResponse - >; -} - -export interface DatabaseBulkIndexDocumentsParams extends DatabaseGenericParams { - waitForActiveShards?: string; - refresh?: DatabaseRefresh; - routing?: string; - timeout?: string; - fields?: DatabaseNameList; - _source?: DatabaseNameList; - _sourceExclude?: DatabaseNameList; - _source_includes?: DatabaseNameList; - pipeline?: string; - index?: string; -} - -export interface DatabaseMGetParams extends DatabaseGenericParams { - storedFields?: DatabaseNameList; - preference?: string; - realtime?: boolean; - refresh?: boolean; - _source?: DatabaseNameList; - _sourceExclude?: DatabaseNameList; - _source_includes?: DatabaseNameList; - index: string; -} - -export interface DatabaseMGetResponse { - docs?: Array>; -} - -export interface DatabasePutTemplateParams extends DatabaseGenericParams { - name: string; - body: any; -} - -export interface DatabaseDeleteDocumentParams extends DatabaseGenericParams { - waitForActiveShards?: string; - parent?: string; - refresh?: DatabaseRefresh; - routing?: string; - timeout?: string; - ifSeqNo?: number; - ifPrimaryTerm?: number; - index: string; - id: string; -} - -export interface DatabaseIndexDocumentResponse { - found: boolean; - _index: string; - _id: string; - _seq_no: number; - _primary_term: number; - result: string; -} - -export interface DatabaseUpdateDocumentResponse { - found: boolean; - _index: string; - _id: string; - _seq_no: number; - _primary_term: number; - result: string; -} - -export interface DatabaseDeleteDocumentResponse { - found: boolean; - _index: string; - _id: string; - _seq_no: number; - _primary_term: number; - result: string; -} - -export interface DatabaseIndexDocumentParams extends DatabaseGenericParams { - waitForActiveShards?: string; - opType?: 'index' | 'create'; - parent?: string; - refresh?: string; - routing?: string; - timeout?: string; - timestamp?: Date | number; - ttl?: string; - ifSeqNo?: number; - ifPrimaryTerm?: number; - pipeline?: string; - id?: string; - index: string; - body: T; -} - -export interface DatabaseGetResponse { - found: boolean; - _source: T; -} -export interface DatabaseCreateDocumentParams extends DatabaseGenericParams { - waitForActiveShards?: string; - parent?: string; - refresh?: DatabaseRefresh; - routing?: string; - timeout?: string; - timestamp?: Date | number; - ttl?: string; - ifSeqNo?: number; - ifPrimaryTerm?: number; - pipeline?: string; - id?: string; - index: string; -} - -export interface DatabaseCreateDocumentResponse { - created: boolean; - result: string; -} - -export interface DatabaseDeleteDocumentParams extends DatabaseGenericParams { - waitForActiveShards?: string; - parent?: string; - refresh?: DatabaseRefresh; - routing?: string; - timeout?: string; - ifSeqNo?: number; - ifPrimaryTerm?: number; - index: string; - id: string; -} - -export interface DatabaseGetParams extends DatabaseGenericParams { - storedFields?: DatabaseNameList; - parent?: string; - preference?: string; - realtime?: boolean; - refresh?: boolean; - routing?: string; - _source?: DatabaseNameList; - _sourceExclude?: DatabaseNameList; - _source_includes?: DatabaseNameList; - ifSeqNo?: number; - ifPrimaryTerm?: number; - id: string; - index: string; -} - -export type DatabaseNameList = string | string[] | boolean; -export type DatabaseRefresh = boolean | 'true' | 'false' | 'wait_for' | ''; -export type ExpandWildcards = 'open' | 'closed' | 'none' | 'all'; -export type DefaultOperator = 'AND' | 'OR'; -export type DatabaseConflicts = 'abort' | 'proceed'; - -export interface DatabaseGenericParams { - requestTimeout?: number; - maxRetries?: number; - method?: string; - body?: any; - ignore?: number | number[]; - filterPath?: string | string[]; -} - -export interface DatabaseDeleteDocumentResponse { - found: boolean; - _index: string; - _type: string; - _id: string; - _seq_no: number; - _primary_term: number; - result: string; -} diff --git a/x-pack/plugins/beats_management/server/lib/adapters/database/kibana_database_adapter.ts b/x-pack/plugins/beats_management/server/lib/adapters/database/kibana_database_adapter.ts deleted file mode 100644 index 741668429a3c7f..00000000000000 --- a/x-pack/plugins/beats_management/server/lib/adapters/database/kibana_database_adapter.ts +++ /dev/null @@ -1,118 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { ElasticsearchServiceStart, ILegacyClusterClient } from 'src/core/server'; -import { FrameworkUser } from '../framework/adapter_types'; -import { internalAuthData } from './../framework/adapter_types'; -import { - DatabaseAdapter, - DatabaseBulkIndexDocumentsParams, - DatabaseCreateDocumentParams, - DatabaseCreateDocumentResponse, - DatabaseDeleteDocumentParams, - DatabaseDeleteDocumentResponse, - DatabaseGetDocumentResponse, - DatabaseGetParams, - DatabaseIndexDocumentParams, - DatabaseMGetParams, - DatabaseMGetResponse, - DatabaseSearchParams, - DatabaseSearchResponse, -} from './adapter_types'; - -export class KibanaDatabaseAdapter implements DatabaseAdapter { - private es: ILegacyClusterClient; - - constructor(elasticsearch: ElasticsearchServiceStart) { - this.es = elasticsearch.legacy.client; - } - - public async get( - user: FrameworkUser, - params: DatabaseGetParams - ): Promise> { - return await this.callWithUser(user, 'get', params); - } - - public async mget( - user: FrameworkUser, - params: DatabaseMGetParams - ): Promise> { - return await this.callWithUser(user, 'mget', params); - } - - public async bulk(user: FrameworkUser, params: DatabaseBulkIndexDocumentsParams): Promise { - return await this.callWithUser(user, 'bulk', params); - } - - public async create( - user: FrameworkUser, - params: DatabaseCreateDocumentParams - ): Promise { - return await this.callWithUser(user, 'create', params); - } - - public async index(user: FrameworkUser, params: DatabaseIndexDocumentParams): Promise { - return await this.callWithUser(user, 'index', params); - } - - public async delete( - user: FrameworkUser, - params: DatabaseDeleteDocumentParams - ): Promise { - return await this.callWithUser(user, 'delete', params); - } - - public async deleteByQuery( - user: FrameworkUser, - params: DatabaseSearchParams - ): Promise { - return await this.callWithUser(user, 'deleteByQuery', params); - } - - public async search( - user: FrameworkUser, - params: DatabaseSearchParams - ): Promise> { - return await this.callWithUser(user, 'search', params); - } - - public async searchAll( - user: FrameworkUser, - params: DatabaseSearchParams - ): Promise> { - return await this.callWithUser(user, 'search', { - scroll: '1m', - ...params, - body: { - size: 1000, - ...params.body, - }, - }); - } - - public async putTemplate(name: string, template: any): Promise { - return await this.callWithUser({ kind: 'internal' }, 'indices.putTemplate', { - name, - body: template, - }); - } - - private callWithUser(user: FrameworkUser, esMethod: string, options: any = {}): any { - if (user.kind === 'authenticated') { - return this.es - .asScoped({ - headers: user[internalAuthData], - }) - .callAsCurrentUser(esMethod, options); - } else if (user.kind === 'internal') { - return this.es.callAsInternalUser(esMethod, options); - } else { - throw new Error('Invalid user type'); - } - } -} diff --git a/x-pack/plugins/beats_management/server/lib/adapters/framework/adapter_types.ts b/x-pack/plugins/beats_management/server/lib/adapters/framework/adapter_types.ts deleted file mode 100644 index f4102b767c0446..00000000000000 --- a/x-pack/plugins/beats_management/server/lib/adapters/framework/adapter_types.ts +++ /dev/null @@ -1,115 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -/* eslint-disable @typescript-eslint/no-empty-interface */ - -import * as t from 'io-ts'; -import { Headers, KibanaRequest } from 'src/core/server'; - -export const internalAuthData = Symbol('internalAuthData'); -export const internalUser: FrameworkInternalUser = { - kind: 'internal', -}; - -export interface BackendFrameworkAdapter { - getUser(request: KibanaRequest): FrameworkUser; - internalUser: FrameworkInternalUser; - info: null | FrameworkInfo; - log(text: string): void; -} - -export const RuntimeFrameworkInfo = t.interface( - { - kibana: t.type({ - version: t.string, - }), - license: t.type({ - type: t.keyof({ - oss: null, - trial: null, - standard: null, - basic: null, - gold: null, - platinum: null, - enterprise: null, - }), - expired: t.boolean, - expiry_date_in_millis: t.number, - }), - security: t.type({ - enabled: t.boolean, - available: t.boolean, - }), - watcher: t.type({ - enabled: t.boolean, - available: t.boolean, - }), - }, - 'FrameworkInfo' -); -export interface FrameworkInfo extends t.TypeOf {} - -export const RuntimeKibanaServerRequest = t.interface( - { - params: t.object, - payload: t.object, - query: t.object, - headers: t.type({ - authorization: t.union([t.string, t.null]), - }), - info: t.type({ - remoteAddress: t.string, - }), - }, - 'KibanaServerRequest' -); -export interface KibanaServerRequest extends t.TypeOf {} - -export const RuntimeKibanaUser = t.interface( - { - username: t.string, - roles: t.readonlyArray(t.string), - full_name: t.union([t.null, t.string]), - email: t.union([t.null, t.string]), - enabled: t.boolean, - }, - 'KibanaUser' -); -export interface KibanaUser extends t.TypeOf {} - -export interface FrameworkAuthenticatedUser { - kind: 'authenticated'; - [internalAuthData]: AuthDataType; - username: string; - roles: readonly string[]; - full_name: string | null; - email: string | null; - enabled: boolean; -} - -export interface FrameworkUnAuthenticatedUser { - kind: 'unauthenticated'; -} - -export interface FrameworkInternalUser { - kind: 'internal'; -} - -export type FrameworkUser = - | FrameworkAuthenticatedUser - | FrameworkUnAuthenticatedUser - | FrameworkInternalUser; -export interface FrameworkRequest< - KibanaServerRequestGenaric extends Partial = any -> { - user: FrameworkUser; - headers: KibanaServerRequestGenaric['headers']; - info: KibanaServerRequest['info']; - payload: KibanaServerRequestGenaric['payload']; - params: KibanaServerRequestGenaric['params']; - query: KibanaServerRequestGenaric['query']; -} diff --git a/x-pack/plugins/beats_management/server/lib/adapters/framework/kibana_framework_adapter.ts b/x-pack/plugins/beats_management/server/lib/adapters/framework/kibana_framework_adapter.ts deleted file mode 100644 index dcacde81ce8b39..00000000000000 --- a/x-pack/plugins/beats_management/server/lib/adapters/framework/kibana_framework_adapter.ts +++ /dev/null @@ -1,116 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { PathReporter } from 'io-ts/lib/PathReporter'; -import { isLeft } from 'fp-ts/lib/Either'; -import { KibanaRequest, Headers, Logger } from 'src/core/server'; -import { - BackendFrameworkAdapter, - FrameworkInfo, - FrameworkUser, - internalAuthData, - internalUser, - RuntimeFrameworkInfo, - RuntimeKibanaUser, -} from './adapter_types'; -import { BeatsManagementConfigType } from '../../../../common'; -import { ILicense, LicensingPluginStart } from '../../../../../licensing/server'; -import { SecurityPluginSetup } from '../../../../../security/server'; - -export class KibanaBackendFrameworkAdapter implements BackendFrameworkAdapter { - public readonly internalUser = internalUser; - public info: null | FrameworkInfo = null; - - constructor( - private readonly PLUGIN_ID: string, - private readonly kibanaVersion: string, - private readonly config: BeatsManagementConfigType, - private readonly logger: Logger, - private readonly licensing: LicensingPluginStart, - private readonly security?: SecurityPluginSetup - ) { - this.licensing.license$.subscribe((license) => this.licenseUpdateHandler(license)); - } - - public log(text: string) { - this.logger.info(text); - } - - getUser(request: KibanaRequest): FrameworkUser { - const user = this.security?.authc.getCurrentUser(request); - if (!user) { - return { - kind: 'unauthenticated', - }; - } - const assertKibanaUser = RuntimeKibanaUser.decode(user); - if (isLeft(assertKibanaUser)) { - throw new Error( - `Error parsing user info in ${this.PLUGIN_ID}, ${ - PathReporter.report(assertKibanaUser)[0] - }` - ); - } - - return { - kind: 'authenticated', - [internalAuthData]: request.headers, - ...user, - }; - } - - private licenseUpdateHandler = (license: ILicense) => { - let xpackInfoUnpacked: FrameworkInfo; - - // If, for some reason, we cannot get the license information - // from Elasticsearch, assume worst case and disable - if (!license.isAvailable) { - this.info = null; - return; - } - - const securityFeature = license.getFeature('security'); - const watcherFeature = license.getFeature('watcher'); - - try { - xpackInfoUnpacked = { - kibana: { - version: this.kibanaVersion, - }, - license: { - type: license.type!, - expired: !license.isActive, - expiry_date_in_millis: license.expiryDateInMillis ?? -1, - }, - security: { - enabled: securityFeature.isEnabled, - available: securityFeature.isAvailable, - }, - watcher: { - enabled: watcherFeature.isEnabled, - available: watcherFeature.isAvailable, - }, - }; - } catch (e) { - this.logger.error(`Error accessing required xPackInfo in ${this.PLUGIN_ID} Kibana adapter`); - throw e; - } - - const assertData = RuntimeFrameworkInfo.decode(xpackInfoUnpacked); - if (isLeft(assertData)) { - throw new Error( - `Error parsing xpack info in ${this.PLUGIN_ID}, ${PathReporter.report(assertData)[0]}` - ); - } - this.info = xpackInfoUnpacked; - - return { - security: xpackInfoUnpacked.security, - settings: { ...this.config }, - }; - }; -} diff --git a/x-pack/plugins/beats_management/server/lib/adapters/tags/adapter_types.ts b/x-pack/plugins/beats_management/server/lib/adapters/tags/adapter_types.ts deleted file mode 100644 index 6e1ad59ce0c717..00000000000000 --- a/x-pack/plugins/beats_management/server/lib/adapters/tags/adapter_types.ts +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { BeatTag } from '../../../../common/domain_types'; -import { FrameworkUser } from '../framework/adapter_types'; - -export interface CMTagsAdapter { - getAll(user: FrameworkUser, ESQuery?: any): Promise; - delete(user: FrameworkUser, tagIds: string[]): Promise; - getTagsWithIds(user: FrameworkUser, tagIds: string[]): Promise; - upsertTag(user: FrameworkUser, tag: BeatTag): Promise; - getWithoutConfigTypes(user: FrameworkUser, blockTypes: string[]): Promise; -} diff --git a/x-pack/plugins/beats_management/server/lib/adapters/tags/elasticsearch_tags_adapter.ts b/x-pack/plugins/beats_management/server/lib/adapters/tags/elasticsearch_tags_adapter.ts deleted file mode 100644 index bfc6993fcb025a..00000000000000 --- a/x-pack/plugins/beats_management/server/lib/adapters/tags/elasticsearch_tags_adapter.ts +++ /dev/null @@ -1,180 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { flatten, get } from 'lodash'; -import { INDEX_NAMES } from '../../../../common/constants'; -import { BeatTag } from '../../../../common/domain_types'; -import { DatabaseAdapter } from '../database/adapter_types'; -import { FrameworkUser } from '../framework/adapter_types'; -import { CMTagsAdapter } from './adapter_types'; - -export class ElasticsearchTagsAdapter implements CMTagsAdapter { - private database: DatabaseAdapter; - - constructor(database: DatabaseAdapter) { - this.database = database; - } - - public async getAll(user: FrameworkUser, ESQuery?: any): Promise { - const params = { - ignore: [404], - _source: true, - size: 10000, - index: INDEX_NAMES.BEATS, - body: { - query: { - bool: { - must: { - term: { - type: 'tag', - }, - }, - }, - }, - }, - }; - if (ESQuery) { - params.body.query = { - ...params.body.query, - ...ESQuery, - }; - } - const response = await this.database.search(user, params); - const tags = get(response, 'hits.hits', []) as any; - - return tags.map((tag: any) => ({ hasConfigurationBlocksTypes: [], ...tag._source.tag })); - } - - public async delete(user: FrameworkUser, tagIds: string[]): Promise { - const ids = tagIds.map((tag) => tag); - - const params = { - ignore: [404], - index: INDEX_NAMES.BEATS, - body: { - query: { - terms: { 'beat.tags': tagIds }, - }, - }, - }; - - const beatsResponse = await this.database.search(user, params); - - const beats = (get(beatsResponse, 'hits.hits', []) as BeatTag[]).map( - (beat: any) => beat._source.beat - ); - - const inactiveBeats = beats.filter((beat) => beat.active === false); - const activeBeats = beats.filter((beat) => beat.active === true); - if (activeBeats.length !== 0) { - return false; - } - const beatIds = inactiveBeats.map((beat: BeatTag) => beat.id); - - // While we block tag deletion when on an active beat, we should remove from inactive - const bulkInactiveBeatsUpdates = flatten( - beatIds.map((beatId) => { - const script = ` - def beat = ctx._source.beat; - if (beat.tags != null) { - beat.tags.removeAll([params.tag]); - }`; - - return flatten( - ids.map((tagId) => [ - { update: { _id: `beat:${beatId}` } }, - { script: { source: script.replace(' ', ''), params: { tagId } } }, - ]) - ); - }) - ); - - const bulkTagsDelete = ids.map((tagId) => ({ delete: { _id: `tag:${tagId}` } })); - - await this.database.bulk(user, { - body: flatten([...bulkInactiveBeatsUpdates, ...bulkTagsDelete]), - index: INDEX_NAMES.BEATS, - refresh: 'wait_for', - }); - - return true; - } - - public async getTagsWithIds(user: FrameworkUser, tagIds: string[]): Promise { - if (tagIds.length === 0) { - return []; - } - const ids = tagIds.map((tag) => `tag:${tag}`); - - const params = { - ignore: [404], - _source: true, - body: { - ids, - }, - index: INDEX_NAMES.BEATS, - }; - const response = await this.database.mget(user, params); - - return get(response, 'docs', []) - .filter((b: any) => b.found) - .map((b: any) => ({ - hasConfigurationBlocksTypes: [], - ...b._source.tag, - id: b._id.replace('tag:', ''), - })); - } - - public async upsertTag(user: FrameworkUser, tag: BeatTag): Promise { - const body = { - tag, - type: 'tag', - }; - - const params = { - body, - id: `tag:${tag.id}`, - index: INDEX_NAMES.BEATS, - refresh: 'wait_for', - }; - const response = await this.database.index(user, params); - - return get(response, 'result') as string; - } - - public async getWithoutConfigTypes( - user: FrameworkUser, - blockTypes: string[] - ): Promise { - const body = { - query: { - bool: { - filter: { - match: { - type: 'tag', - }, - }, - must_not: { - terms: { 'tag.hasConfigurationBlocksTypes': blockTypes }, - }, - }, - }, - }; - - const params = { - body, - index: INDEX_NAMES.BEATS, - ignore: [404], - _source: true, - size: 10000, - }; - const response = await this.database.search(user, params); - const tags = get(response, 'hits.hits', []) as any; - - return tags.map((tag: any) => ({ hasConfigurationBlocksTypes: [], ...tag._source.tag })); - } -} diff --git a/x-pack/plugins/beats_management/server/lib/adapters/tokens/adapter_types.ts b/x-pack/plugins/beats_management/server/lib/adapters/tokens/adapter_types.ts deleted file mode 100644 index a7d45490ada387..00000000000000 --- a/x-pack/plugins/beats_management/server/lib/adapters/tokens/adapter_types.ts +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { FrameworkUser } from '../framework/adapter_types'; - -export interface TokenEnrollmentData { - token: string | null; - expires_on: string; -} - -export interface CMTokensAdapter { - deleteEnrollmentToken(user: FrameworkUser, enrollmentToken: string): Promise; - getEnrollmentToken(user: FrameworkUser, enrollmentToken: string): Promise; - insertTokens(user: FrameworkUser, tokens: TokenEnrollmentData[]): Promise; -} diff --git a/x-pack/plugins/beats_management/server/lib/adapters/tokens/elasticsearch_tokens_adapter.ts b/x-pack/plugins/beats_management/server/lib/adapters/tokens/elasticsearch_tokens_adapter.ts deleted file mode 100644 index 849602564347e4..00000000000000 --- a/x-pack/plugins/beats_management/server/lib/adapters/tokens/elasticsearch_tokens_adapter.ts +++ /dev/null @@ -1,76 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { flatten, get } from 'lodash'; -import { INDEX_NAMES } from '../../../../common/constants'; -import { DatabaseAdapter } from '../database/adapter_types'; -import { FrameworkUser } from '../framework/adapter_types'; -import { CMTokensAdapter, TokenEnrollmentData } from './adapter_types'; - -export class ElasticsearchTokensAdapter implements CMTokensAdapter { - constructor(private readonly database: DatabaseAdapter) {} - - public async deleteEnrollmentToken(user: FrameworkUser, enrollmentToken: string) { - const params = { - id: `enrollment_token:${enrollmentToken}`, - index: INDEX_NAMES.BEATS, - }; - - await this.database.delete(user, params); - } - - public async getEnrollmentToken( - user: FrameworkUser, - tokenString: string - ): Promise { - const params = { - id: `enrollment_token:${tokenString}`, - ignore: [404], - index: INDEX_NAMES.BEATS, - }; - - const response = await this.database.get(user, params); - - const tokenDetails = get(response, '_source.enrollment_token', { - expires_on: '0', - token: null, - }) as TokenEnrollmentData; - - // Elasticsearch might return fast if the token is not found. OR it might return fast - // if the token *is* found. Either way, an attacker could using a timing attack to figure - // out whether a token is valid or not. So we introduce a random delay in returning from - // this function to obscure the actual time it took for Elasticsearch to find the token. - const randomDelayInMs = 25 + Math.round(Math.random() * 200); // between 25 and 225 ms - return new Promise((resolve) => - setTimeout(() => resolve(tokenDetails), randomDelayInMs) - ); - } - - public async insertTokens(user: FrameworkUser, tokens: TokenEnrollmentData[]) { - const body = flatten( - tokens.map((token) => [ - { index: { _id: `enrollment_token:${token.token}` } }, - { - enrollment_token: token, - type: 'enrollment_token', - }, - ]) - ); - - const result = await this.database.bulk(user, { - body, - index: INDEX_NAMES.BEATS, - refresh: 'wait_for', - }); - - if (result.errors) { - throw new Error(result.items[0].result); - } - - return tokens; - } -} diff --git a/x-pack/plugins/beats_management/server/lib/beat_events.ts b/x-pack/plugins/beats_management/server/lib/beat_events.ts deleted file mode 100644 index ffe77f8d99fffa..00000000000000 --- a/x-pack/plugins/beats_management/server/lib/beat_events.ts +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { PathReporter } from 'io-ts/lib/PathReporter'; -import { isLeft } from 'fp-ts/lib/Either'; -import { BeatEvent, RuntimeBeatEvent } from '../../common/domain_types'; -import { FrameworkUser } from './adapters/framework/adapter_types'; -import { CMBeatsDomain } from './beats'; - -export class BeatEventsLib { - constructor(private readonly beats: CMBeatsDomain) {} - - public log = async ( - user: FrameworkUser, - beatId: string, - events: BeatEvent[] - ): Promise> => { - return events.map((event, i) => { - const assertData = RuntimeBeatEvent.decode(event); - if (isLeft(assertData)) { - if (events.length - 1 === i) { - this.beats - .update(user, beatId, { - status: { - ...events[events.length - 2], - timestamp: new Date(events[events.length - 2].timestamp), - }, - }) - .catch((e) => { - // eslint-disable-next-line - console.error('Error inserting event into beats log.', e); - }); - } - return { - success: false, - error: `Error parsing event ${i}, ${PathReporter.report(assertData)[0]}`, - }; - } - if (events.length - 1 === i) { - this.beats - .update(user, beatId, { - status: { - ...events[events.length - 1], - timestamp: new Date(events[events.length - 1].timestamp), - }, - }) - .catch((e) => { - // eslint-disable-next-line - console.error('Error inserting event into beats log.', e); - }); - } - return { success: true }; - }); - }; -} diff --git a/x-pack/plugins/beats_management/server/lib/beats.ts b/x-pack/plugins/beats_management/server/lib/beats.ts deleted file mode 100644 index de3fce4011a3d1..00000000000000 --- a/x-pack/plugins/beats_management/server/lib/beats.ts +++ /dev/null @@ -1,260 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { uniq } from 'lodash'; -import moment from 'moment'; -import { CMBeat } from '../../common/domain_types'; -import { - BeatsRemovalReturn, - BeatsTagAssignment, - CMAssignmentReturn, - CMBeatsAdapter, -} from './adapters/beats/adapter_types'; -import { FrameworkUser } from './adapters/framework/adapter_types'; -import { BeatEnrollmentStatus, CMServerLibs, UserOrToken } from './types'; - -export class CMBeatsDomain { - private tags: CMServerLibs['tags']; - private tokens: CMServerLibs['tokens']; - private framework: CMServerLibs['framework']; - - constructor( - private readonly adapter: CMBeatsAdapter, - libs: { - tags: CMServerLibs['tags']; - tokens: CMServerLibs['tokens']; - framework: CMServerLibs['framework']; - } - ) { - this.adapter = adapter; - this.tags = libs.tags; - this.tokens = libs.tokens; - this.framework = libs.framework; - } - - public async getById(user: FrameworkUser, beatId: string): Promise { - const beat = await this.adapter.get(user, beatId); - return beat && beat.active ? beat : null; - } - - public async getByIds(user: FrameworkUser, beatIds: string[]): Promise { - const beats = await this.adapter.getWithIds(user, beatIds); - return beats.filter((beat) => beat.active); - } - - public async getAll(user: FrameworkUser, ESQuery?: any) { - return (await this.adapter.getAll(user, ESQuery)).filter( - (beat: CMBeat) => beat.active === true - ); - } - - public async getAllWithTag(user: FrameworkUser, tagId: string) { - return (await this.adapter.getAllWithTags(user, [tagId])).filter( - (beat: CMBeat) => beat.active === true - ); - } - - public async getByEnrollmentToken(user: FrameworkUser, enrollmentToken: string) { - const beat = await this.adapter.getBeatWithToken(user, enrollmentToken); - return beat && beat.active ? beat : null; - } - - public async update(userOrToken: UserOrToken, beatId: string, beatData: Partial) { - const beat = await this.adapter.get(this.framework.internalUser, beatId); - - // FIXME make return type enum - if (beat === null) { - return 'beat-not-found'; - } - - if (typeof userOrToken === 'string') { - const { verified: isAccessTokenValid } = this.tokens.verifyToken( - beat?.access_token ?? '', - userOrToken - ); - if (!isAccessTokenValid) { - return 'invalid-access-token'; - } - } - - const user = typeof userOrToken === 'string' ? this.framework.internalUser : userOrToken; - await this.adapter.update(user, { - ...beat, - ...beatData, - }); - } - - public async enrollBeat( - enrollmentToken: string, - beatId: string, - remoteAddress: string, - beat: Partial - ): Promise<{ status: string; accessToken?: string }> { - // eslint-disable-next-line @typescript-eslint/naming-convention - const { token, expires_on } = await this.tokens.getEnrollmentToken(enrollmentToken); - if (expires_on && moment(expires_on).isBefore(moment())) { - return { status: BeatEnrollmentStatus.ExpiredEnrollmentToken }; - } - if (!token) { - return { status: BeatEnrollmentStatus.InvalidEnrollmentToken }; - } - - const existingBeat = await this.getById(this.framework.internalUser, beatId); - if (existingBeat) { - return { status: BeatEnrollmentStatus.Success }; - } - - const accessToken = this.tokens.generateAccessToken(); - const verifiedOn = moment().toJSON(); - - await this.adapter.insert(this.framework.internalUser, { - tags: [], - ...beat, - active: true, - enrollment_token: enrollmentToken, - verified_on: verifiedOn, - access_token: accessToken, - host_ip: remoteAddress, - id: beatId, - } as CMBeat); - - await this.tokens.deleteEnrollmentToken(enrollmentToken); - - return { status: BeatEnrollmentStatus.Success, accessToken }; - } - - public async removeTagsFromBeats( - user: FrameworkUser, - removals: BeatsTagAssignment[] - ): Promise { - const beatIds = uniq(removals.map((removal) => removal.beatId)); - const tagIds = uniq(removals.map((removal) => removal.tag)); - - const response = { - removals: removals.map(() => ({ status: null })), - }; - - const beats = await this.adapter.getWithIds(user, beatIds); - const tags = await this.tags.getWithIds(user, tagIds); - - // Handle assignments containing non-existing beat IDs or tags - const nonExistentBeatIds = findNonExistentItems(beats, beatIds); - const nonExistentTags = await findNonExistentItems(tags, tagIds); - - addNonExistentItemToResponse( - response, - removals, - nonExistentBeatIds, - nonExistentTags, - 'removals' - ); - - // FIXME abstract this - const validRemovals = removals - .map((removal, idxInRequest) => ({ - beatId: removal.beatId, - idxInRequest, // so we can add the result of this removal to the correct place in the response - tag: removal.tag, - })) - .filter((removal, idx) => response.removals[idx].status === null); - - if (validRemovals.length > 0) { - const removalResults = await this.adapter.removeTagsFromBeats(user, validRemovals); - return addToResultsToResponse('removals', response, removalResults); - } - return response; - } - - public async assignTagsToBeats( - user: FrameworkUser, - assignments: BeatsTagAssignment[] - ): Promise { - const beatIds = uniq(assignments.map((assignment) => assignment.beatId)); - const tagIds = uniq(assignments.map((assignment) => assignment.tag)); - - const response = { - assignments: assignments.map(() => ({ status: null })), - }; - const beats = await this.adapter.getWithIds(user, beatIds); - const tags = await this.tags.getWithIds(user, tagIds); - // Handle assignments containing non-existing beat IDs or tags - const nonExistentBeatIds = findNonExistentItems(beats, beatIds); - const nonExistentTags = findNonExistentItems(tags, tagIds); - - // FIXME break out back into route / function response - // FIXME causes function to error if a beat or tag does not exist - addNonExistentItemToResponse( - response, - assignments, - nonExistentBeatIds, - nonExistentTags, - 'assignments' - ); - - // FIXME abstract this - const validAssignments = assignments - .map((assignment, idxInRequest) => ({ - beatId: assignment.beatId, - idxInRequest, // so we can add the result of this assignment to the correct place in the response - tag: assignment.tag, - })) - .filter((assignment, idx) => response.assignments[idx].status === null); - - if (validAssignments.length > 0) { - const assignmentResults = await this.adapter.assignTagsToBeats(user, validAssignments); - - // TODO This should prob not mutate - return addToResultsToResponse('assignments', response, assignmentResults); - } - return response; - } -} - -// FIXME abstract to the route, also the key arg is a temp fix -function addNonExistentItemToResponse( - response: any, - assignments: any, - nonExistentBeatIds: any, - nonExistentTags: any, - key: string -) { - assignments.forEach(({ beatId, tag }: BeatsTagAssignment, idx: any) => { - const isBeatNonExistent = nonExistentBeatIds.includes(beatId); - - const isTagNonExistent = nonExistentTags.includes(tag); - - if (isBeatNonExistent && isTagNonExistent) { - response[key][idx].status = 404; - response[key][idx].result = `Beat ${beatId} and tag ${tag} not found`; - } else if (isBeatNonExistent) { - response[key][idx].status = 404; - response[key][idx].result = `Beat ${beatId} not found`; - } else if (isTagNonExistent) { - response[key][idx].status = 404; - response[key][idx].result = `Tag ${tag} not found`; - } - }); -} - -// TODO dont mutate response -function addToResultsToResponse(key: string, response: any, assignmentResults: any) { - assignmentResults.forEach((assignmentResult: any) => { - const { idxInRequest, status, result } = assignmentResult; - response[key][idxInRequest].status = status; - response[key][idxInRequest].result = result; - }); - return response; -} - -export function findNonExistentItems(items: Array<{ id: string }>, requestedItems: string[]) { - return requestedItems.reduce((nonExistentItems: string[], requestedItem: string, idx: number) => { - if (items.findIndex((item) => item && item.id === requestedItem) === -1) { - nonExistentItems.push(requestedItems[idx]); - } - return nonExistentItems; - }, []); -} diff --git a/x-pack/plugins/beats_management/server/lib/compose/kibana.ts b/x-pack/plugins/beats_management/server/lib/compose/kibana.ts deleted file mode 100644 index d3606bf24071df..00000000000000 --- a/x-pack/plugins/beats_management/server/lib/compose/kibana.ts +++ /dev/null @@ -1,85 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { camelCase } from 'lodash'; -import type { ElasticsearchServiceStart, Logger } from 'src/core/server'; -import { SecurityPluginSetup } from '../../../../security/server'; -import { LicensingPluginStart } from '../../../../licensing/server'; -import { PLUGIN } from '../../../common/constants'; -import { BeatsManagementConfigType } from '../../../common'; -import { ElasticsearchBeatsAdapter } from '../adapters/beats/elasticsearch_beats_adapter'; -import { ElasticsearchConfigurationBlockAdapter } from '../adapters/configuration_blocks/elasticsearch_configuration_block_adapter'; -import { KibanaDatabaseAdapter } from '../adapters/database/kibana_database_adapter'; -import { KibanaBackendFrameworkAdapter } from '../adapters/framework/kibana_framework_adapter'; -import { ElasticsearchTagsAdapter } from '../adapters/tags/elasticsearch_tags_adapter'; -import { ElasticsearchTokensAdapter } from '../adapters/tokens/elasticsearch_tokens_adapter'; -import { BeatEventsLib } from '../beat_events'; -import { CMBeatsDomain } from '../beats'; -import { ConfigurationBlocksLib } from '../configuration_blocks'; -import { CMTagsDomain } from '../tags'; -import { CMTokensDomain } from '../tokens'; -import { CMServerLibs } from '../types'; -import { BackendFrameworkLib } from './../framework'; - -interface ComposeOptions { - elasticsearch: ElasticsearchServiceStart; - licensing: LicensingPluginStart; - security?: SecurityPluginSetup; - config: BeatsManagementConfigType; - logger: Logger; - kibanaVersion: string; -} - -export function compose({ - elasticsearch, - config, - kibanaVersion, - logger, - licensing, - security, -}: ComposeOptions): CMServerLibs { - const backendAdapter = new KibanaBackendFrameworkAdapter( - camelCase(PLUGIN.ID), - kibanaVersion, - config, - logger, - licensing, - security - ); - const framework = new BackendFrameworkLib(backendAdapter, config); - const database = new KibanaDatabaseAdapter(elasticsearch); - const beatsAdapter = new ElasticsearchBeatsAdapter(database); - const configAdapter = new ElasticsearchConfigurationBlockAdapter(database); - - const tags = new CMTagsDomain( - new ElasticsearchTagsAdapter(database), - configAdapter, - beatsAdapter - ); - const configurationBlocks = new ConfigurationBlocksLib(configAdapter, tags); - const tokens = new CMTokensDomain(new ElasticsearchTokensAdapter(database), { - framework, - }); - const beats = new CMBeatsDomain(beatsAdapter, { - tags, - tokens, - framework, - }); - const beatEvents = new BeatEventsLib(beats); - - const libs: CMServerLibs = { - beatEvents, - framework, - database, - beats, - tags, - tokens, - configurationBlocks, - }; - - return libs; -} diff --git a/x-pack/plugins/beats_management/server/lib/configuration_blocks.ts b/x-pack/plugins/beats_management/server/lib/configuration_blocks.ts deleted file mode 100644 index 06f1674af93fb0..00000000000000 --- a/x-pack/plugins/beats_management/server/lib/configuration_blocks.ts +++ /dev/null @@ -1,77 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { UNIQUENESS_ENFORCING_TYPES } from '../../common/constants/configuration_blocks'; -import { ConfigurationBlock } from '../../common/domain_types'; -import { ConfigurationBlockAdapter } from './adapters/configuration_blocks/adapter_types'; -import { FrameworkUser } from './adapters/framework/adapter_types'; -import { CMTagsDomain } from './tags'; - -export class ConfigurationBlocksLib { - constructor( - private readonly adapter: ConfigurationBlockAdapter, - private readonly tags: CMTagsDomain - ) {} - - public async getForTags( - user: FrameworkUser, - tagIds: string[], - page: number = 0, - size: number = 10 - ) { - if ((page + 1) * size > 10000) { - throw new Error('System error, too many results. To get all results, request page: -1'); - } - - const result = await this.adapter.getForTags(user, tagIds, page, size); - - return { ...result, error: null }; - } - - public async delete(user: FrameworkUser, ids: string[]) { - return await this.adapter.delete(user, ids); - } - - public async save(user: FrameworkUser, block: ConfigurationBlock) { - const tags = await this.tags.getWithIds(user, [block.tag]); - const tag = tags[0]; - - if (!tag) { - return { - error: 'Invalid tag, tag not found', - }; - } - - if (!tag.hasConfigurationBlocksTypes) { - tag.hasConfigurationBlocksTypes = []; - } - - if ( - !block.id && - UNIQUENESS_ENFORCING_TYPES.includes(block.type) && - tag.hasConfigurationBlocksTypes.some((type: string) => - UNIQUENESS_ENFORCING_TYPES.includes(type) - ) - ) { - return { - error: - 'Block is of type that already exists on this tag, and only one config of this type can exist at a time on a beat. Config not saved', - }; - } - - if (UNIQUENESS_ENFORCING_TYPES.includes(block.type)) { - tag.hasConfigurationBlocksTypes.push(block.type); - await this.tags.upsertTag(user, tag); - } - - const ids = await this.adapter.create(user, [block]); - return { - success: true, - blockID: ids[0], - }; - } -} diff --git a/x-pack/plugins/beats_management/server/lib/framework.ts b/x-pack/plugins/beats_management/server/lib/framework.ts deleted file mode 100644 index 072bbae6d46c0a..00000000000000 --- a/x-pack/plugins/beats_management/server/lib/framework.ts +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { Headers, KibanaRequest } from 'kibana/server'; -import { BackendFrameworkAdapter, FrameworkUser } from './adapters/framework/adapter_types'; -import { BeatsManagementConfigType } from '../../common'; - -export class BackendFrameworkLib { - public log = this.adapter.log; - public internalUser = this.adapter.internalUser; - - constructor( - private readonly adapter: BackendFrameworkAdapter, - private readonly config: BeatsManagementConfigType - ) { - this.validateConfig(); - } - - public getConfig(): BeatsManagementConfigType { - return this.config; - } - - public getUser(request: KibanaRequest): FrameworkUser { - return this.adapter.getUser(request); - } - - /** - * Expired `null` happens when we have no xpack info - */ - public get license() { - return { - type: this.adapter.info ? this.adapter.info.license.type : 'unknown', - expired: this.adapter.info ? this.adapter.info.license.expired : null, - }; - } - - public get securityIsEnabled() { - return this.adapter.info ? this.adapter.info.security.enabled : false; - } - - private validateConfig() { - const encryptionKey = this.config.encryptionKey; - - if (!encryptionKey) { - this.adapter.log( - 'Using a default encryption key for xpack.beats.encryptionKey. It is recommended that you set xpack.beats.encryptionKey in kibana.yml with a unique token' - ); - } - } -} diff --git a/x-pack/plugins/beats_management/server/lib/tags.ts b/x-pack/plugins/beats_management/server/lib/tags.ts deleted file mode 100644 index 2750e73b898b06..00000000000000 --- a/x-pack/plugins/beats_management/server/lib/tags.ts +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { uniq } from 'lodash'; -import { UNIQUENESS_ENFORCING_TYPES } from '../../common/constants/configuration_blocks'; -import { BeatTag } from '../../common/domain_types'; -import { CMBeatsAdapter } from './adapters/beats/adapter_types'; -import { ConfigurationBlockAdapter } from './adapters/configuration_blocks/adapter_types'; -import { FrameworkUser } from './adapters/framework/adapter_types'; -import { CMTagsAdapter } from './adapters/tags/adapter_types'; - -export class CMTagsDomain { - constructor( - private readonly adapter: CMTagsAdapter, - private readonly configurationBlocksAdapter: ConfigurationBlockAdapter, - private readonly beatsAdabter: CMBeatsAdapter - ) {} - - public async getAll(user: FrameworkUser, ESQuery?: any): Promise { - const tags = await this.adapter.getAll(user, ESQuery); - return tags; - } - - public async getWithIds(user: FrameworkUser, tagIds: string[]): Promise { - const tags = await this.adapter.getTagsWithIds(user, tagIds); - return tags; - } - - public async delete(user: FrameworkUser, tagIds: string[]) { - const beats = await this.beatsAdabter.getAllWithTags(user, tagIds); - if (beats.filter((b) => b.active).length > 0) { - return false; - } - await this.configurationBlocksAdapter.deleteForTags(user, tagIds); - return await this.adapter.delete(user, tagIds); - } - - public async getNonConflictingTags(user: FrameworkUser, existingTagIds: string[]) { - const tags = await this.adapter.getTagsWithIds(user, existingTagIds); - const existingUniqueBlockTypes = uniq( - tags.reduce((existingUniqueTypes, tag) => { - if (tag.hasConfigurationBlocksTypes) { - existingUniqueTypes = existingUniqueTypes.concat(tag.hasConfigurationBlocksTypes); - } - return existingUniqueTypes; - }, [] as string[]) - ).filter((type) => UNIQUENESS_ENFORCING_TYPES.includes(type)); - - const safeTags = await this.adapter.getWithoutConfigTypes(user, existingUniqueBlockTypes); - return safeTags; - } - - public async upsertTag(user: FrameworkUser, tag: BeatTag): Promise { - const tagId = await this.adapter.upsertTag(user, tag); - - return tagId; - } -} diff --git a/x-pack/plugins/beats_management/server/lib/tokens.ts b/x-pack/plugins/beats_management/server/lib/tokens.ts deleted file mode 100644 index 8ff130190f661a..00000000000000 --- a/x-pack/plugins/beats_management/server/lib/tokens.ts +++ /dev/null @@ -1,144 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { randomBytes, timingSafeEqual } from 'crypto'; -import { sign as signToken, verify as verifyToken } from 'jsonwebtoken'; -import { chunk } from 'lodash'; -import moment from 'moment'; -import { FrameworkUser } from './adapters/framework/adapter_types'; -import { CMTokensAdapter } from './adapters/tokens/adapter_types'; -import { CMServerLibs } from './types'; - -const RANDOM_TOKEN_1 = 'b48c4bda384a40cb91c6eb9b8849e77f'; -const RANDOM_TOKEN_2 = '80a3819e3cd64f4399f1d4886be7a08b'; - -export class CMTokensDomain { - private adapter: CMTokensAdapter; - private framework: CMServerLibs['framework']; - - constructor(adapter: CMTokensAdapter, libs: { framework: CMServerLibs['framework'] }) { - this.adapter = adapter; - this.framework = libs.framework; - } - - public async getEnrollmentToken(enrollmentToken: string) { - const fullToken = await this.adapter.getEnrollmentToken( - this.framework.internalUser, - enrollmentToken - ); - if (!fullToken) { - return { - token: null, - expired: true, - expires_on: null, - }; - } - - const { verified, expired } = this.verifyToken(enrollmentToken, fullToken.token || '', false); - - if (!verified) { - return { - expired, - token: null, - expires_on: null, - }; - } - - return { ...fullToken, expired }; - } - - public async deleteEnrollmentToken(enrollmentToken: string) { - return await this.adapter.deleteEnrollmentToken(this.framework.internalUser, enrollmentToken); - } - - public verifyToken(recivedToken: string, token2: string, decode = true) { - let tokenDecoded = true; - let expired = false; - - if (decode) { - const enrollmentTokenSecret = this.framework.getConfig().encryptionKey; - - try { - verifyToken(recivedToken, enrollmentTokenSecret); - tokenDecoded = true; - } catch (err) { - if (err.name === 'TokenExpiredError') { - expired = true; - } - tokenDecoded = false; - } - } - - if ( - typeof recivedToken !== 'string' || - typeof token2 !== 'string' || - recivedToken.length !== token2.length - ) { - // This prevents a more subtle timing attack where we know already the tokens aren't going to - // match but still we don't return fast. Instead we compare two pre-generated random tokens using - // the same comparison algorithm that we would use to compare two equal-length tokens. - return { - expired, - verified: - timingSafeEqual( - Buffer.from(RANDOM_TOKEN_1, 'utf8'), - Buffer.from(RANDOM_TOKEN_2, 'utf8') - ) && tokenDecoded, - }; - } - - return { - expired, - verified: - timingSafeEqual(Buffer.from(recivedToken, 'utf8'), Buffer.from(token2, 'utf8')) && - tokenDecoded, - }; - } - - public generateAccessToken() { - const enrollmentTokenSecret = this.framework.getConfig().encryptionKey; - - const tokenData = { - created: moment().toJSON(), - randomHash: randomBytes(26).toString(), - }; - - return signToken(tokenData, enrollmentTokenSecret); - } - - public async createEnrollmentTokens( - user: FrameworkUser, - numTokens: number = 1 - ): Promise { - const tokens = []; - const enrollmentTokensTtlInSeconds = this.framework.getConfig().enrollmentTokensTtlInSeconds; - - const enrollmentTokenExpiration = moment() - .add(enrollmentTokensTtlInSeconds, 'seconds') - .toJSON(); - const enrollmentTokenSecret = this.framework.getConfig().encryptionKey; - - while (tokens.length < numTokens) { - const tokenData = { - created: moment().toJSON(), - expires: enrollmentTokenExpiration, - randomHash: randomBytes(26).toString(), - }; - - tokens.push({ - expires_on: enrollmentTokenExpiration, - token: signToken(tokenData, enrollmentTokenSecret), - }); - } - - await Promise.all( - chunk(tokens, 100).map((tokenChunk) => this.adapter.insertTokens(user, tokenChunk)) - ); - - return tokens.map((token) => token.token); - } -} diff --git a/x-pack/plugins/beats_management/server/lib/types.ts b/x-pack/plugins/beats_management/server/lib/types.ts deleted file mode 100644 index 8342018469450b..00000000000000 --- a/x-pack/plugins/beats_management/server/lib/types.ts +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import type { IRouter, RequestHandlerContext } from 'src/core/server'; -import { DatabaseAdapter } from './adapters/database/adapter_types'; -import { FrameworkUser } from './adapters/framework/adapter_types'; -import { BeatEventsLib } from './beat_events'; -import { CMBeatsDomain } from './beats'; -import { ConfigurationBlocksLib } from './configuration_blocks'; -import { BackendFrameworkLib } from './framework'; -import { CMTagsDomain } from './tags'; -import { CMTokensDomain } from './tokens'; - -export type UserOrToken = FrameworkUser | string; - -export interface CMServerLibs { - framework: BackendFrameworkLib; - database: DatabaseAdapter; - beats: CMBeatsDomain; - tags: CMTagsDomain; - beatEvents: BeatEventsLib; - tokens: CMTokensDomain; - configurationBlocks: ConfigurationBlocksLib; -} - -export enum BeatEnrollmentStatus { - Success = 'Success', - ExpiredEnrollmentToken = 'Expired enrollment token', - InvalidEnrollmentToken = 'Invalid enrollment token', -} - -export interface AsyncResponse { - error: { - code: number | string; - message: string; - }; -} -export interface AsyncResponse { - data: DataType; -} - -/** - * @internal - */ -export type BeatsManagementApiRequestHandlerContext = CMServerLibs; - -/** - * @internal - */ -export interface BeatsManagementRequestHandlerContext extends RequestHandlerContext { - beatsManagement: CMServerLibs; -} - -/** - * @internal - */ -export type BeatsManagementRouter = IRouter; diff --git a/x-pack/plugins/beats_management/server/plugin.ts b/x-pack/plugins/beats_management/server/plugin.ts deleted file mode 100644 index 3093d5d9b8d299..00000000000000 --- a/x-pack/plugins/beats_management/server/plugin.ts +++ /dev/null @@ -1,89 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { CoreSetup, CoreStart, Plugin, PluginInitializerContext, Logger } from 'src/core/server'; -import { PluginSetupContract as FeaturesPluginSetup } from '../../features/server'; -import { SecurityPluginSetup } from '../../security/server'; -import { LicensingPluginStart } from '../../licensing/server'; -import { BeatsManagementConfigType } from '../common'; -import type { BeatsManagementRequestHandlerContext, CMServerLibs } from './lib/types'; -import { registerRoutes } from './routes'; -import { compose } from './lib/compose/kibana'; -import { INDEX_NAMES } from '../common/constants'; -import { beatsIndexTemplate } from './index_templates'; - -interface SetupDeps { - security?: SecurityPluginSetup; - features: FeaturesPluginSetup; -} - -interface StartDeps { - licensing: LicensingPluginStart; -} - -export class BeatsManagementPlugin implements Plugin<{}, {}, SetupDeps, StartDeps> { - private readonly logger: Logger; - private securitySetup?: SecurityPluginSetup; - private beatsLibs?: CMServerLibs; - - constructor( - private readonly initializerContext: PluginInitializerContext - ) { - this.logger = initializerContext.logger.get(); - } - - public setup(core: CoreSetup, { features, security }: SetupDeps) { - this.securitySetup = security; - - const router = core.http.createRouter(); - registerRoutes(router); - - core.http.registerRouteHandlerContext( - 'beatsManagement', - (_, req) => { - return this.beatsLibs!; - } - ); - - features.registerElasticsearchFeature({ - id: 'beats_management', - management: { - ingest: ['beats_management'], - }, - privileges: [ - { - ui: [], - requiredClusterPrivileges: [], - requiredRoles: ['beats_admin'], - }, - ], - }); - - return {}; - } - - public start({ elasticsearch }: CoreStart, { licensing }: StartDeps) { - const config = this.initializerContext.config.get(); - const logger = this.initializerContext.logger.get(); - const kibanaVersion = this.initializerContext.env.packageInfo.version; - - this.beatsLibs = compose({ - elasticsearch, - licensing, - security: this.securitySetup, - config, - logger, - kibanaVersion, - }); - - this.beatsLibs.database.putTemplate(INDEX_NAMES.BEATS, beatsIndexTemplate).catch((e) => { - this.logger.error(`Error create beats template: ${e.message}`); - }); - - return {}; - } -} diff --git a/x-pack/plugins/beats_management/server/routes/beats/configuration.ts b/x-pack/plugins/beats_management/server/routes/beats/configuration.ts deleted file mode 100644 index 2adbe46524c6a8..00000000000000 --- a/x-pack/plugins/beats_management/server/routes/beats/configuration.ts +++ /dev/null @@ -1,83 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { schema } from '@kbn/config-schema'; -import type { BeatsManagementRouter } from '../../lib/types'; -import { ConfigurationBlock } from '../../../common/domain_types'; -import { ReturnTypeList } from '../../../common/return_types'; -import { wrapRouteWithSecurity } from '../wrap_route_with_security'; - -export const registerGetBeatConfigurationRoute = (router: BeatsManagementRouter) => { - router.get( - { - path: '/api/beats/agent/{beatId}/configuration', - validate: { - params: schema.object({ - beatId: schema.string(), - }), - }, - options: { - authRequired: false, - }, - }, - wrapRouteWithSecurity({}, async (context, request, response) => { - const beatsManagement = context.beatsManagement!; - const accessToken = request.headers['kbn-beats-access-token']; - if (!accessToken) { - return response.badRequest({ - body: 'beats access token required', - }); - } - const beatId = request.params.beatId; - - let configurationBlocks: ConfigurationBlock[]; - const beat = await beatsManagement.beats.getById( - beatsManagement.framework.internalUser, - beatId - ); - if (beat === null) { - return response.notFound({ - body: { - message: `Beat "${beatId}" not found`, - }, - }); - } - - const isAccessTokenValid = beat.access_token === accessToken; - if (!isAccessTokenValid) { - return response.unauthorized({ - body: { - message: 'Invalid access token', - }, - }); - } - - await beatsManagement.beats.update(beatsManagement.framework.internalUser, beat.id, { - last_checkin: new Date(), - }); - - if (beat.tags) { - const result = await beatsManagement.configurationBlocks.getForTags( - beatsManagement.framework.internalUser, - beat.tags, - -1 - ); - - configurationBlocks = result.blocks; - } else { - configurationBlocks = []; - } - - return response.ok({ - body: { - list: configurationBlocks, - success: true, - } as ReturnTypeList, - }); - }) - ); -}; diff --git a/x-pack/plugins/beats_management/server/routes/beats/enroll.ts b/x-pack/plugins/beats_management/server/routes/beats/enroll.ts deleted file mode 100644 index 8af93a30b61b57..00000000000000 --- a/x-pack/plugins/beats_management/server/routes/beats/enroll.ts +++ /dev/null @@ -1,90 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { schema } from '@kbn/config-schema'; -import type { BeatsManagementRouter } from '../../lib/types'; -// eslint-disable-next-line @kbn/eslint/no-restricted-paths -import { ensureRawRequest } from '../../../../../../src/core/server/http/router'; -import { REQUIRED_LICENSES } from '../../../common/constants/security'; -import { BeatEnrollmentStatus } from '../../lib/types'; -import { wrapRouteWithSecurity } from '../wrap_route_with_security'; - -export const registerBeatEnrollmentRoute = (router: BeatsManagementRouter) => { - // TODO: write to Kibana audit log file https://github.com/elastic/kibana/issues/26024 - router.post( - { - path: '/api/beats/agent/{beatId}', - validate: { - params: schema.object({ - beatId: schema.string(), - }), - body: schema.object( - { - host_name: schema.string(), - name: schema.string(), - type: schema.string(), - version: schema.string(), - }, - { unknowns: 'ignore' } - ), - }, - options: { - authRequired: false, - }, - }, - wrapRouteWithSecurity( - { - requiredLicense: REQUIRED_LICENSES, - }, - async (context, request, response) => { - const beatsManagement = context.beatsManagement!; - - const { beatId } = request.params; - const enrollmentToken = request.headers['kbn-beats-enrollment-token'] as string; - if (!enrollmentToken) { - return response.badRequest({ - body: 'beats enrollment token required', - }); - } - - // TODO: fixme eventually, need to access `info.remoteAddress` from KibanaRequest. - const legacyRequest = ensureRawRequest(request); - - const { status, accessToken } = await beatsManagement.beats.enrollBeat( - enrollmentToken, - beatId, - legacyRequest.info.remoteAddress, - request.body - ); - - switch (status) { - case BeatEnrollmentStatus.ExpiredEnrollmentToken: - return response.badRequest({ - body: { - message: BeatEnrollmentStatus.ExpiredEnrollmentToken, - }, - }); - case BeatEnrollmentStatus.InvalidEnrollmentToken: - return response.badRequest({ - body: { - message: BeatEnrollmentStatus.InvalidEnrollmentToken, - }, - }); - case BeatEnrollmentStatus.Success: - default: - return response.ok({ - body: { - item: accessToken, - action: 'created', - success: true, - }, - }); - } - } - ) - ); -}; diff --git a/x-pack/plugins/beats_management/server/routes/beats/events.ts b/x-pack/plugins/beats_management/server/routes/beats/events.ts deleted file mode 100644 index 8df18224845ea4..00000000000000 --- a/x-pack/plugins/beats_management/server/routes/beats/events.ts +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { schema } from '@kbn/config-schema'; -import type { BeatsManagementRouter } from '../../lib/types'; -import { ReturnTypeBulkAction } from '../../../common/return_types'; -import { wrapRouteWithSecurity } from '../wrap_route_with_security'; - -export const registerBeatEventsRoute = (router: BeatsManagementRouter) => { - router.post( - { - path: '/api/beats/{beatId}/events', - validate: { - params: schema.object({ - beatId: schema.string(), - }), - body: schema.arrayOf(schema.any(), { defaultValue: [] }), - }, - options: { - authRequired: false, - }, - }, - wrapRouteWithSecurity({}, async (context, request, response) => { - const beatsManagement = context.beatsManagement!; - const accessToken = request.headers['kbn-beats-access-token']; - if (!accessToken) { - return response.badRequest({ - body: 'beats access token required', - }); - } - const beatId = request.params.beatId; - const events = request.body; - const internalUser = beatsManagement.framework.internalUser; - - const beat = await beatsManagement.beats.getById(internalUser, beatId); - if (beat === null) { - return response.badRequest({ - body: { - message: `Beat "${beatId}" not found`, - }, - }); - } - - const isAccessTokenValid = beat.access_token === accessToken; - if (!isAccessTokenValid) { - return response.unauthorized({ - body: { - message: `Invalid access token`, - }, - }); - } - - const results = await beatsManagement.beatEvents.log(internalUser, beat.id, events); - - return response.ok({ - body: { - results, - success: true, - } as ReturnTypeBulkAction, - }); - }) - ); -}; diff --git a/x-pack/plugins/beats_management/server/routes/beats/get.ts b/x-pack/plugins/beats_management/server/routes/beats/get.ts deleted file mode 100644 index e9a31030831434..00000000000000 --- a/x-pack/plugins/beats_management/server/routes/beats/get.ts +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { schema } from '@kbn/config-schema'; -import type { BeatsManagementRouter } from '../../lib/types'; -import { CMBeat } from '../../../common/domain_types'; -import { ReturnTypeGet } from '../../../common/return_types'; -import { wrapRouteWithSecurity } from '../wrap_route_with_security'; - -export const registerGetBeatRoute = (router: BeatsManagementRouter) => { - router.get( - { - path: '/api/beats/agent/{beatId}/{token?}', - validate: { - params: schema.object({ - beatId: schema.string(), - token: schema.string({ defaultValue: '' }), - }), - }, - }, - wrapRouteWithSecurity( - { requiredRoles: ['beats_admin'] }, - async (context, request, response) => { - const beatsManagement = context.beatsManagement!; - const user = beatsManagement.framework.getUser(request); - const beatId = request.params.beatId; - - let beat: CMBeat | null; - if (beatId === 'unknown') { - beat = await beatsManagement.beats.getByEnrollmentToken(user, request.params.token); - if (beat === null) { - return response.ok({ body: { success: false } }); - } - } else { - beat = await beatsManagement.beats.getById(user, beatId); - if (beat === null) { - return response.notFound({ - body: { - message: 'Beat not found', - }, - }); - } - } - - delete beat.access_token; - - return response.ok({ - body: { - item: beat, - success: true, - } as ReturnTypeGet, - }); - } - ) - ); -}; diff --git a/x-pack/plugins/beats_management/server/routes/beats/index.ts b/x-pack/plugins/beats_management/server/routes/beats/index.ts deleted file mode 100644 index c39248b6766ae4..00000000000000 --- a/x-pack/plugins/beats_management/server/routes/beats/index.ts +++ /dev/null @@ -1,15 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -export { registerGetBeatConfigurationRoute } from './configuration'; -export { registerBeatEnrollmentRoute } from './enroll'; -export { registerBeatEventsRoute } from './events'; -export { registerGetBeatRoute } from './get'; -export { registerListAgentsRoute } from './list'; -export { registerTagAssignmentsRoute } from './tag_assignment'; -export { registerTagRemovalsRoute } from './tag_removal'; -export { registerBeatUpdateRoute } from './update'; diff --git a/x-pack/plugins/beats_management/server/routes/beats/list.ts b/x-pack/plugins/beats_management/server/routes/beats/list.ts deleted file mode 100644 index 549c274bfc1ada..00000000000000 --- a/x-pack/plugins/beats_management/server/routes/beats/list.ts +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { schema } from '@kbn/config-schema'; -import type { BeatsManagementRouter } from '../../lib/types'; -import { REQUIRED_LICENSES } from '../../../common/constants/security'; -import { CMBeat } from '../../../common/domain_types'; -import { ReturnTypeList } from '../../../common/return_types'; -import { wrapRouteWithSecurity } from '../wrap_route_with_security'; - -export const registerListAgentsRoute = (router: BeatsManagementRouter) => { - router.get( - { - path: '/api/beats/agents/{listByAndValue*}', - validate: { - params: schema.object({ - listByAndValue: schema.maybe(schema.string()), - }), - query: schema.object( - { - ESQuery: schema.maybe(schema.string()), - }, - { defaultValue: {} } - ), - }, - }, - wrapRouteWithSecurity( - { - requiredRoles: ['beats_admin'], - requiredLicense: REQUIRED_LICENSES, - }, - async (context, request, response) => { - const beatsManagement = context.beatsManagement; - const user = beatsManagement.framework.getUser(request); - - const listByAndValueParts = request.params.listByAndValue?.split('/') ?? []; - let listBy: string | null = null; - let listByValue: string | null = null; - if (listByAndValueParts.length === 2) { - listBy = listByAndValueParts[0]; - listByValue = listByAndValueParts[1]; - } - - let beats: CMBeat[]; - - switch (listBy) { - case 'tag': - beats = await beatsManagement.beats.getAllWithTag(user, listByValue || ''); - break; - - default: - beats = await beatsManagement.beats.getAll( - user, - request.query.ESQuery ? JSON.parse(request.query.ESQuery) : undefined - ); - - break; - } - - return response.ok({ - body: { list: beats, success: true, page: -1, total: -1 } as ReturnTypeList, - }); - } - ) - ); -}; diff --git a/x-pack/plugins/beats_management/server/routes/beats/tag_assignment.ts b/x-pack/plugins/beats_management/server/routes/beats/tag_assignment.ts deleted file mode 100644 index 44274ac8af4011..00000000000000 --- a/x-pack/plugins/beats_management/server/routes/beats/tag_assignment.ts +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { schema } from '@kbn/config-schema'; -import type { BeatsManagementRouter } from '../../lib/types'; -import { REQUIRED_LICENSES } from '../../../common/constants/security'; -import { ReturnTypeBulkAction } from '../../../common/return_types'; -// eslint-disable-next-line @kbn/eslint/no-restricted-paths -import type { BeatsTagAssignment } from '../../../public/lib/adapters/beats/adapter_types'; -import { wrapRouteWithSecurity } from '../wrap_route_with_security'; - -export const registerTagAssignmentsRoute = (router: BeatsManagementRouter) => { - // TODO: write to Kibana audit log file https://github.com/elastic/kibana/issues/26024 - router.post( - { - path: '/api/beats/agents_tags/assignments', - validate: { - body: schema.object({ - assignments: schema.arrayOf( - schema.object({ - beatId: schema.string(), - tag: schema.string(), - }), - { defaultValue: [] } - ), - }), - }, - }, - wrapRouteWithSecurity( - { - requiredLicense: REQUIRED_LICENSES, - requiredRoles: ['beats_admin'], - }, - async (context, request, response) => { - const beatsManagement = context.beatsManagement!; - const user = beatsManagement.framework.getUser(request); - const { assignments }: { assignments: BeatsTagAssignment[] } = request.body; - - const result = await beatsManagement.beats.assignTagsToBeats(user, assignments); - - return response.ok({ - body: { - success: true, - results: result.assignments.map((assignment) => ({ - success: assignment.status && assignment.status >= 200 && assignment.status < 300, - error: - !assignment.status || assignment.status >= 300 - ? { - code: assignment.status || 400, - message: assignment.result, - } - : undefined, - result: - assignment.status && assignment.status >= 200 && assignment.status < 300 - ? { - message: assignment.result, - } - : undefined, - })), - } as ReturnTypeBulkAction, - }); - } - ) - ); -}; diff --git a/x-pack/plugins/beats_management/server/routes/beats/tag_removal.ts b/x-pack/plugins/beats_management/server/routes/beats/tag_removal.ts deleted file mode 100644 index d00b16c4ae176f..00000000000000 --- a/x-pack/plugins/beats_management/server/routes/beats/tag_removal.ts +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { schema } from '@kbn/config-schema'; -import type { BeatsManagementRouter } from '../../lib/types'; -import { REQUIRED_LICENSES } from '../../../common/constants/security'; -import { ReturnTypeBulkAction } from '../../../common/return_types'; -import { wrapRouteWithSecurity } from '../wrap_route_with_security'; - -export const registerTagRemovalsRoute = (router: BeatsManagementRouter) => { - // TODO: write to Kibana audit log file https://github.com/elastic/kibana/issues/26024 - router.post( - { - path: '/api/beats/agents_tags/removals', - validate: { - body: schema.object({ - removals: schema.arrayOf( - schema.object({ - beatId: schema.string(), - tag: schema.string(), - }), - { defaultValue: [] } - ), - }), - }, - }, - wrapRouteWithSecurity( - { - requiredLicense: REQUIRED_LICENSES, - requiredRoles: ['beats_admin'], - }, - async (context, request, response) => { - const beatsManagement = context.beatsManagement; - const user = beatsManagement.framework.getUser(request); - const { removals } = request.body; - - const result = await beatsManagement.beats.removeTagsFromBeats(user, removals); - - return response.ok({ - body: { - success: true, - results: result.removals.map((removal) => ({ - success: removal.status && removal.status >= 200 && removal.status < 300, - error: - !removal.status || removal.status >= 300 - ? { - code: removal.status || 400, - message: removal.result, - } - : undefined, - result: - removal.status && removal.status >= 200 && removal.status < 300 - ? { - message: removal.result, - } - : undefined, - })), - } as ReturnTypeBulkAction, - }); - } - ) - ); -}; diff --git a/x-pack/plugins/beats_management/server/routes/beats/update.ts b/x-pack/plugins/beats_management/server/routes/beats/update.ts deleted file mode 100644 index 982005bcf84e93..00000000000000 --- a/x-pack/plugins/beats_management/server/routes/beats/update.ts +++ /dev/null @@ -1,105 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { schema } from '@kbn/config-schema'; -import type { BeatsManagementRouter } from '../../lib/types'; -// eslint-disable-next-line @kbn/eslint/no-restricted-paths -import { ensureRawRequest } from '../../../../../../src/core/server/http/router'; -import { REQUIRED_LICENSES } from '../../../common/constants/security'; -import { CMBeat } from '../../../common/domain_types'; -import { ReturnTypeUpdate } from '../../../common/return_types'; -import { internalUser } from '../../lib/adapters/framework/adapter_types'; -import { wrapRouteWithSecurity } from '../wrap_route_with_security'; - -export const registerBeatUpdateRoute = (router: BeatsManagementRouter) => { - // TODO: write to Kibana audit log file (include who did the verification as well) https://github.com/elastic/kibana/issues/26024 - router.put( - { - path: '/api/beats/agent/{beatId}', - validate: { - params: schema.object({ - beatId: schema.string(), - }), - body: schema.object( - { - active: schema.maybe(schema.boolean()), - ephemeral_id: schema.maybe(schema.string()), - host_name: schema.maybe(schema.string()), - local_configuration_yml: schema.maybe(schema.string()), - metadata: schema.maybe(schema.recordOf(schema.string(), schema.any())), - name: schema.maybe(schema.string()), - type: schema.maybe(schema.string()), - version: schema.maybe(schema.string()), - }, - { defaultValue: {} } - ), - }, - }, - wrapRouteWithSecurity( - { - requiredLicense: REQUIRED_LICENSES, - requiredRoles: ['beats_admin'], - }, - async (context, request, response) => { - const beatsManagement = context.beatsManagement; - const accessToken = request.headers['kbn-beats-access-token'] as string; - const { beatId } = request.params; - const user = beatsManagement.framework.getUser(request); - const userOrToken = accessToken || user; - - // TODO: fixme eventually, need to access `info.remoteAddress` from KibanaRequest. - const legacyRequest = ensureRawRequest(request); - const remoteAddress = legacyRequest.info.remoteAddress; - - if (user.kind === 'unauthenticated' && request.body.active !== undefined) { - return response.unauthorized({ - body: { - message: 'access-token is not a valid auth type to change beat status', - }, - }); - } - - const status = await beatsManagement.beats.update(userOrToken, beatId, { - ...request.body, - host_ip: remoteAddress, - }); - - switch (status) { - case 'beat-not-found': - return response.notFound({ - body: { - message: 'Beat not found', - }, - }); - case 'invalid-access-token': - return response.unauthorized({ - body: { - message: 'Invalid access token', - }, - }); - } - - const beat = await beatsManagement.beats.getById(internalUser, beatId); - if (!beat) { - return response.notFound({ - body: { - message: 'Beat not found', - }, - }); - } - - return response.ok({ - body: { - item: beat, - action: 'updated', - success: true, - } as ReturnTypeUpdate, - }); - } - ) - ); -}; diff --git a/x-pack/plugins/beats_management/server/routes/configurations/delete.ts b/x-pack/plugins/beats_management/server/routes/configurations/delete.ts deleted file mode 100644 index 2596204017c114..00000000000000 --- a/x-pack/plugins/beats_management/server/routes/configurations/delete.ts +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { schema } from '@kbn/config-schema'; -import type { BeatsManagementRouter } from '../../lib/types'; -import { wrapRouteWithSecurity } from '../wrap_route_with_security'; -import { REQUIRED_LICENSES } from '../../../common/constants/security'; -import { ReturnTypeBulkDelete } from '../../../common/return_types'; - -export const registerDeleteConfigurationBlocksRoute = (router: BeatsManagementRouter) => { - router.delete( - { - path: '/api/beats/configurations/{ids}', - validate: { - params: schema.object({ - ids: schema.string(), - }), - }, - }, - wrapRouteWithSecurity( - { - requiredLicense: REQUIRED_LICENSES, - requiredRoles: ['beats_admin'], - }, - async (context, request, response) => { - const beatsManagement = context.beatsManagement; - const ids = request.params.ids.split(',').filter((id) => id.length > 0); - const user = beatsManagement.framework.getUser(request); - - const results = await beatsManagement.configurationBlocks.delete(user, ids); - return response.ok({ - body: { - success: true, - results: results.map((result) => ({ - success: result.success, - action: 'deleted', - error: result.success ? undefined : { message: result.reason }, - })), - } as ReturnTypeBulkDelete, - }); - } - ) - ); -}; diff --git a/x-pack/plugins/beats_management/server/routes/configurations/get.ts b/x-pack/plugins/beats_management/server/routes/configurations/get.ts deleted file mode 100644 index 8018420bda7733..00000000000000 --- a/x-pack/plugins/beats_management/server/routes/configurations/get.ts +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { schema } from '@kbn/config-schema'; -import type { BeatsManagementRouter } from '../../lib/types'; -import { wrapRouteWithSecurity } from '../wrap_route_with_security'; -import { REQUIRED_LICENSES } from '../../../common/constants/security'; -import { ConfigurationBlock } from '../../../common/domain_types'; -import { ReturnTypeList } from '../../../common/return_types'; - -export const registerGetConfigurationBlocksRoute = (router: BeatsManagementRouter) => { - router.get( - { - path: '/api/beats/configurations/{tagIds}/{page?}', - validate: { - params: schema.object({ - tagIds: schema.string(), - page: schema.maybe(schema.number()), - }), - }, - }, - wrapRouteWithSecurity( - { - requiredLicense: REQUIRED_LICENSES, - requiredRoles: ['beats_admin'], - }, - async (context, request, response) => { - const beatsManagement = context.beatsManagement; - const tagIds = request.params.tagIds.split(',').filter((id) => id.length > 0); - const user = beatsManagement.framework.getUser(request); - const result = await beatsManagement.configurationBlocks.getForTags( - user, - tagIds, - request.params.page, - 5 - ); - - return response.ok({ - body: { - page: result.page, - total: result.total, - list: result.blocks, - success: true, - } as ReturnTypeList, - }); - } - ) - ); -}; diff --git a/x-pack/plugins/beats_management/server/routes/configurations/index.ts b/x-pack/plugins/beats_management/server/routes/configurations/index.ts deleted file mode 100644 index f1e0875c8919de..00000000000000 --- a/x-pack/plugins/beats_management/server/routes/configurations/index.ts +++ /dev/null @@ -1,10 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -export { registerGetConfigurationBlocksRoute } from './get'; -export { registerDeleteConfigurationBlocksRoute } from './delete'; -export { registerUpsertConfigurationBlocksRoute } from './upsert'; diff --git a/x-pack/plugins/beats_management/server/routes/configurations/upsert.ts b/x-pack/plugins/beats_management/server/routes/configurations/upsert.ts deleted file mode 100644 index d490cadabf236c..00000000000000 --- a/x-pack/plugins/beats_management/server/routes/configurations/upsert.ts +++ /dev/null @@ -1,73 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { PathReporter } from 'io-ts/lib/PathReporter'; -import { isLeft } from 'fp-ts/lib/Either'; -import { schema } from '@kbn/config-schema'; -import type { BeatsManagementRouter } from '../../lib/types'; -import { REQUIRED_LICENSES } from '../../../common/constants'; -import { - ConfigurationBlock, - createConfigurationBlockInterface, -} from '../../../common/domain_types'; -import { ReturnTypeBulkUpsert } from '../../../common/return_types'; -import { wrapRouteWithSecurity } from '../wrap_route_with_security'; - -export const registerUpsertConfigurationBlocksRoute = (router: BeatsManagementRouter) => { - // TODO: write to Kibana audit log file - router.put( - { - path: '/api/beats/configurations', - validate: { - body: schema.arrayOf(schema.recordOf(schema.string(), schema.any()), { defaultValue: [] }), - }, - }, - wrapRouteWithSecurity( - { - requiredLicense: REQUIRED_LICENSES, - requiredRoles: ['beats_admin'], - }, - async (context, request, response) => { - const beatsManagement = context.beatsManagement; - const user = beatsManagement.framework.getUser(request); - const input = request.body as ConfigurationBlock[]; - - const result = await Promise.all( - input.map(async (block: ConfigurationBlock) => { - const assertData = createConfigurationBlockInterface().decode(block); - if (isLeft(assertData)) { - return { - error: `Error parsing block info, ${PathReporter.report(assertData)[0]}`, - }; - } - - const { blockID, success, error } = await beatsManagement.configurationBlocks.save( - user, - block - ); - if (error) { - return { success, error }; - } - - return { success, blockID }; - }) - ); - - return response.ok({ - body: { - results: result.map((r) => ({ - success: r.success as boolean, - // TODO: we need to surface this data, not hard coded - action: 'created' as 'created' | 'updated', - })), - success: true, - } as ReturnTypeBulkUpsert, - }); - } - ) - ); -}; diff --git a/x-pack/plugins/beats_management/server/routes/index.ts b/x-pack/plugins/beats_management/server/routes/index.ts deleted file mode 100644 index 8ea1ca9502959f..00000000000000 --- a/x-pack/plugins/beats_management/server/routes/index.ts +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import type { BeatsManagementRouter } from '../lib/types'; -import { - registerDeleteConfigurationBlocksRoute, - registerGetConfigurationBlocksRoute, - registerUpsertConfigurationBlocksRoute, -} from './configurations'; -import { registerCreateTokenRoute } from './tokens'; -import { - registerSetTagRoute, - registerListTagsRoute, - registerGetTagsWithIdsRoute, - registerDeleteTagsWithIdsRoute, - registerAssignableTagsRoute, -} from './tags'; -import { - registerBeatUpdateRoute, - registerTagRemovalsRoute, - registerTagAssignmentsRoute, - registerListAgentsRoute, - registerGetBeatRoute, - registerBeatEventsRoute, - registerBeatEnrollmentRoute, - registerGetBeatConfigurationRoute, -} from './beats'; - -export const registerRoutes = (router: BeatsManagementRouter) => { - // configurations - registerGetConfigurationBlocksRoute(router); - registerDeleteConfigurationBlocksRoute(router); - registerUpsertConfigurationBlocksRoute(router); - // beats - registerBeatUpdateRoute(router); - registerTagRemovalsRoute(router); - registerTagAssignmentsRoute(router); - registerListAgentsRoute(router); - registerGetBeatRoute(router); - registerBeatEventsRoute(router); - registerBeatEnrollmentRoute(router); - registerGetBeatConfigurationRoute(router); - // tags - registerSetTagRoute(router); - registerListTagsRoute(router); - registerGetTagsWithIdsRoute(router); - registerDeleteTagsWithIdsRoute(router); - registerAssignableTagsRoute(router); - // tokens - registerCreateTokenRoute(router); -}; diff --git a/x-pack/plugins/beats_management/server/routes/tags/assignable.ts b/x-pack/plugins/beats_management/server/routes/tags/assignable.ts deleted file mode 100644 index 9ab89dbcfbcd4e..00000000000000 --- a/x-pack/plugins/beats_management/server/routes/tags/assignable.ts +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { schema } from '@kbn/config-schema'; -import { flatten } from 'lodash'; -import type { BeatsManagementRouter } from '../../lib/types'; -import { REQUIRED_LICENSES } from '../../../common/constants/security'; -import { BeatTag } from '../../../common/domain_types'; -import { ReturnTypeBulkGet } from '../../../common/return_types'; -import { wrapRouteWithSecurity } from '../wrap_route_with_security'; - -export const registerAssignableTagsRoute = (router: BeatsManagementRouter) => { - router.get( - { - path: '/api/beats/tags/assignable/{beatIds}', - validate: { - params: schema.object({ - beatIds: schema.string(), - }), - }, - }, - wrapRouteWithSecurity( - { - requiredLicense: REQUIRED_LICENSES, - requiredRoles: ['beats_admin'], - }, - async (context, request, response) => { - const beatsManagement = context.beatsManagement!; - const user = beatsManagement.framework.getUser(request); - const beatIds = request.params.beatIds.split(',').filter((id) => id.length > 0); - - const beats = await beatsManagement.beats.getByIds(user, beatIds); - const tags = await beatsManagement.tags.getNonConflictingTags( - user, - flatten(beats.map((beat) => beat.tags)) - ); - - return response.ok({ - body: { - items: tags, - success: true, - } as ReturnTypeBulkGet, - }); - } - ) - ); -}; diff --git a/x-pack/plugins/beats_management/server/routes/tags/delete.ts b/x-pack/plugins/beats_management/server/routes/tags/delete.ts deleted file mode 100644 index 54b3cf03a08bb3..00000000000000 --- a/x-pack/plugins/beats_management/server/routes/tags/delete.ts +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { schema } from '@kbn/config-schema'; -import type { BeatsManagementRouter } from '../../lib/types'; -import { REQUIRED_LICENSES } from '../../../common/constants/security'; -import { ReturnTypeBulkDelete } from '../../../common/return_types'; -import { wrapRouteWithSecurity } from '../wrap_route_with_security'; - -export const registerDeleteTagsWithIdsRoute = (router: BeatsManagementRouter) => { - router.delete( - { - path: '/api/beats/tags/{tagIds}', - validate: { - params: schema.object({ - tagIds: schema.string(), - }), - }, - }, - wrapRouteWithSecurity( - { - requiredLicense: REQUIRED_LICENSES, - requiredRoles: ['beats_admin'], - }, - async (context, request, response) => { - const beatsManagement = context.beatsManagement!; - const user = beatsManagement.framework.getUser(request); - const tagIds = request.params.tagIds.split(',').filter((id) => id.length > 0); - - const success = await beatsManagement.tags.delete(user, tagIds); - - return response.ok({ - body: { - results: tagIds.map(() => ({ - success, - action: 'deleted', - })), - success, - } as ReturnTypeBulkDelete, - }); - } - ) - ); -}; diff --git a/x-pack/plugins/beats_management/server/routes/tags/get.ts b/x-pack/plugins/beats_management/server/routes/tags/get.ts deleted file mode 100644 index 2fe1eb8ab5515e..00000000000000 --- a/x-pack/plugins/beats_management/server/routes/tags/get.ts +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { schema } from '@kbn/config-schema'; -import type { BeatsManagementRouter } from '../../lib/types'; -import { REQUIRED_LICENSES } from '../../../common/constants/security'; -import { BeatTag } from '../../../common/domain_types'; -import { ReturnTypeBulkGet } from '../../../common/return_types'; -import { wrapRouteWithSecurity } from '../wrap_route_with_security'; - -export const registerGetTagsWithIdsRoute = (router: BeatsManagementRouter) => { - router.get( - { - path: '/api/beats/tags/{tagIds}', - validate: { - params: schema.object({ - tagIds: schema.string(), - }), - }, - }, - wrapRouteWithSecurity( - { - requiredLicense: REQUIRED_LICENSES, - requiredRoles: ['beats_admin'], - }, - async (context, request, response) => { - const beatsManagement = context.beatsManagement!; - const user = beatsManagement.framework.getUser(request); - const tagIds = request.params.tagIds.split(',').filter((id) => id.length > 0); - - const tags = await beatsManagement.tags.getWithIds(user, tagIds); - - return response.ok({ - body: { - items: tags, - success: true, - } as ReturnTypeBulkGet, - }); - } - ) - ); -}; diff --git a/x-pack/plugins/beats_management/server/routes/tags/index.ts b/x-pack/plugins/beats_management/server/routes/tags/index.ts deleted file mode 100644 index a4208a56793599..00000000000000 --- a/x-pack/plugins/beats_management/server/routes/tags/index.ts +++ /dev/null @@ -1,12 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -export { registerAssignableTagsRoute } from './assignable'; -export { registerDeleteTagsWithIdsRoute } from './delete'; -export { registerGetTagsWithIdsRoute } from './get'; -export { registerListTagsRoute } from './list'; -export { registerSetTagRoute } from './set'; diff --git a/x-pack/plugins/beats_management/server/routes/tags/list.ts b/x-pack/plugins/beats_management/server/routes/tags/list.ts deleted file mode 100644 index cee2231808aa63..00000000000000 --- a/x-pack/plugins/beats_management/server/routes/tags/list.ts +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { schema } from '@kbn/config-schema'; -import type { BeatsManagementRouter } from '../../lib/types'; -import { REQUIRED_LICENSES } from '../../../common/constants/security'; -import { BeatTag } from '../../../common/domain_types'; -import { ReturnTypeList } from '../../../common/return_types'; -import { wrapRouteWithSecurity } from '../wrap_route_with_security'; - -export const registerListTagsRoute = (router: BeatsManagementRouter) => { - router.get( - { - path: '/api/beats/tags', - validate: { - query: schema.object( - { - ESQuery: schema.maybe(schema.string()), - }, - { defaultValue: {} } - ), - }, - }, - wrapRouteWithSecurity( - { - requiredLicense: REQUIRED_LICENSES, - requiredRoles: ['beats_admin'], - }, - async (context, request, response) => { - const beatsManagement = context.beatsManagement!; - const user = beatsManagement.framework.getUser(request); - - const tags = await beatsManagement.tags.getAll( - user, - request.query && request.query.ESQuery ? JSON.parse(request.query.ESQuery) : undefined - ); - - return response.ok({ - body: { - list: tags, - success: true, - page: -1, - total: -1, - } as ReturnTypeList, - }); - } - ) - ); -}; diff --git a/x-pack/plugins/beats_management/server/routes/tags/set.ts b/x-pack/plugins/beats_management/server/routes/tags/set.ts deleted file mode 100644 index b556531e8c113a..00000000000000 --- a/x-pack/plugins/beats_management/server/routes/tags/set.ts +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { schema } from '@kbn/config-schema'; -import type { BeatsManagementRouter } from '../../lib/types'; -import { REQUIRED_LICENSES } from '../../../common/constants'; -import { BeatTag } from '../../../common/domain_types'; -import { ReturnTypeUpsert } from '../../../common/return_types'; -import { wrapRouteWithSecurity } from '../wrap_route_with_security'; - -export const registerSetTagRoute = (router: BeatsManagementRouter) => { - // TODO: write to Kibana audit log file - router.put( - { - path: '/api/beats/tag/{tagId}', - validate: { - params: schema.object({ - tagId: schema.string(), - }), - body: schema.object( - { - color: schema.maybe(schema.string()), - name: schema.maybe(schema.string()), - }, - { defaultValue: {} } - ), - }, - }, - wrapRouteWithSecurity( - { - requiredLicense: REQUIRED_LICENSES, - requiredRoles: ['beats_admin'], - }, - async (context, request, response) => { - const beatsManagement = context.beatsManagement!; - const user = beatsManagement.framework.getUser(request); - - const config = { - id: request.params.tagId, - name: request.params.tagId, - color: '#DD0A73', - hasConfigurationBlocksTypes: [], - ...request.body, - }; - const id = await beatsManagement.tags.upsertTag(user, config); - const tag = await beatsManagement.tags.getWithIds(user, [id]); - - // TODO the action needs to be surfaced - return response.ok({ - body: { - success: true, - item: tag[0], - action: 'created', - } as ReturnTypeUpsert, - }); - } - ) - ); -}; diff --git a/x-pack/plugins/beats_management/server/routes/tokens/create.ts b/x-pack/plugins/beats_management/server/routes/tokens/create.ts deleted file mode 100644 index c44f9c2dd4e7dc..00000000000000 --- a/x-pack/plugins/beats_management/server/routes/tokens/create.ts +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { schema } from '@kbn/config-schema'; -import type { BeatsManagementRouter } from '../../lib/types'; -import { REQUIRED_LICENSES } from '../../../common/constants/security'; -import { ReturnTypeBulkCreate } from '../../../common/return_types'; -import { wrapRouteWithSecurity } from '../wrap_route_with_security'; - -const DEFAULT_NUM_TOKENS = 1; - -export const registerCreateTokenRoute = (router: BeatsManagementRouter) => { - // TODO: write to Kibana audit log file - router.post( - { - path: '/api/beats/enrollment_tokens', - validate: { - body: schema.nullable( - schema.object({ - num_tokens: schema.number({ defaultValue: DEFAULT_NUM_TOKENS, min: 1 }), - }) - ), - }, - }, - wrapRouteWithSecurity( - { - requiredLicense: REQUIRED_LICENSES, - requiredRoles: ['beats_admin'], - }, - async (context, request, response) => { - const beatsManagement = context.beatsManagement!; - const user = beatsManagement.framework.getUser(request); - - const numTokens = request.body?.num_tokens ?? DEFAULT_NUM_TOKENS; - try { - const tokens = await beatsManagement.tokens.createEnrollmentTokens(user, numTokens); - return response.ok({ - body: { - results: tokens.map((token) => ({ - item: token, - success: true, - action: 'created', - })), - success: true, - } as ReturnTypeBulkCreate, - }); - } catch (err) { - beatsManagement.framework.log(err.message); - throw new Error('An error occurred, please check your Kibana logs'); - } - } - ) - ); -}; diff --git a/x-pack/plugins/beats_management/server/routes/tokens/index.ts b/x-pack/plugins/beats_management/server/routes/tokens/index.ts deleted file mode 100644 index f04a8e0d5bc5a0..00000000000000 --- a/x-pack/plugins/beats_management/server/routes/tokens/index.ts +++ /dev/null @@ -1,8 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -export { registerCreateTokenRoute } from './create'; diff --git a/x-pack/plugins/beats_management/server/routes/wrap_route_with_security.ts b/x-pack/plugins/beats_management/server/routes/wrap_route_with_security.ts deleted file mode 100644 index 327d599ec27036..00000000000000 --- a/x-pack/plugins/beats_management/server/routes/wrap_route_with_security.ts +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { KibanaRequest, KibanaResponseFactory, RequestHandler, RouteMethod } from 'src/core/server'; -import { difference } from 'lodash'; -import type { BeatsManagementRequestHandlerContext } from '../lib/types'; - -export function wrapRouteWithSecurity< - P, - Q, - B, - Context extends BeatsManagementRequestHandlerContext ->( - { - requiredLicense = [], - requiredRoles = [], - }: { requiredLicense?: string[]; requiredRoles?: string[] }, - handler: RequestHandler -): RequestHandler { - return async ( - context: Context, - request: KibanaRequest, - response: KibanaResponseFactory - ) => { - const beatsManagement = context.beatsManagement!; - const license = beatsManagement.framework.license; - const user = beatsManagement.framework.getUser(request); - - if ( - requiredLicense.length > 0 && - (license.expired || !requiredLicense.includes(license.type)) - ) { - return response.forbidden({ - body: { - message: `Your ${license.type} license does not support this API or is expired. Please upgrade your license.`, - }, - }); - } - - if (requiredRoles.length > 0) { - if (user.kind !== 'authenticated') { - return response.forbidden({ - body: { - message: `Request must be authenticated`, - }, - }); - } - - if ( - user.kind === 'authenticated' && - !user.roles.includes('superuser') && - difference(requiredRoles, user.roles).length !== 0 - ) { - return response.forbidden({ - body: { - message: `Request must be authenticated by a user with one of the following user roles: ${requiredRoles.join( - ',' - )}`, - }, - }); - } - } - - return handler(context, request, response); - }; -} diff --git a/x-pack/plugins/beats_management/tsconfig.json b/x-pack/plugins/beats_management/tsconfig.json deleted file mode 100644 index ad68cc900e6382..00000000000000 --- a/x-pack/plugins/beats_management/tsconfig.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "extends": "../../../tsconfig.base.json", - "compilerOptions": { - "composite": true, - "outDir": "./target/types", - "emitDeclarationOnly": true, - "declaration": true, - "declarationMap": true - }, - "include": [ - "common/**/*", - "public/**/*", - "server/**/*", - "types/**/*", - "scripts/**/*", - "server/index_templates/*.json", - ], - "references": [ - { "path": "../../../src/core/tsconfig.json" }, - { "path": "../../../src/plugins/data/tsconfig.json" }, - { "path": "../../../src/plugins/management/tsconfig.json" }, - { "path": "../licensing/tsconfig.json" }, - { "path": "../features/tsconfig.json" }, - { "path": "../security/tsconfig.json" } - ] -} diff --git a/x-pack/plugins/beats_management/types/formsy.d.ts b/x-pack/plugins/beats_management/types/formsy.d.ts deleted file mode 100644 index 46231b2385991c..00000000000000 --- a/x-pack/plugins/beats_management/types/formsy.d.ts +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -declare module 'formsy-react' { - import React, { FC } from 'react'; - let Formsy: FC; - export interface FormsyInputProps { - getErrorMessage(): any; - getValue(): any; - hasValue(): boolean; - isFormDisabled(): boolean; - isFormSubmitted(): boolean; - isPristine(): boolean; - isRequired(): boolean; - isValid(): boolean; - isValidValue(): boolean; - resetValue(): void; - setValidations(validations: any, required: boolean): void; - setValue(value: any): void; - showError(): boolean; - showRequired(): boolean; - } - - // eslint-disable-next-line import/no-default-export - export default Formsy; - export type FormData = { [fieldName in keyof FormShape]: string }; - export type FieldValue = string | null | undefined; - - type ValidationMethod = ( - values: FormData, - value: string | null | undefined - ) => void; - - export function addValidationRule( - validationName: string, - validationMethod: ValidationMethod - ): void; - export function withFormsy(component: any): any; - - // function withFormsy( - // component: - // | React.Component - // | FC - // ): React.Component; -} diff --git a/x-pack/plugins/translations/translations/ja-JP.json b/x-pack/plugins/translations/translations/ja-JP.json index 66941a8fb591dc..845f4b2fb8643d 100644 --- a/x-pack/plugins/translations/translations/ja-JP.json +++ b/x-pack/plugins/translations/translations/ja-JP.json @@ -6156,185 +6156,6 @@ "xpack.banners.settings.textColor.description": "バナーテキストの色を設定します。{subscriptionLink}", "xpack.banners.settings.textColor.title": "バナーテキスト色", "xpack.banners.settings.textContent.title": "バナーテキスト", - "xpack.beatsManagement.beat.actionSectionTypeLabel": "タイプ:{beatType}。", - "xpack.beatsManagement.beat.actionSectionVersionLabel": "バージョン:{beatVersion}", - "xpack.beatsManagement.beat.beatNameAndIdTitle": "ビート:{nameOrNoName} (ID:{id}) ", - "xpack.beatsManagement.beat.beatNotFoundErrorMessage": "ビートが見つかりません", - "xpack.beatsManagement.beat.beatNotFoundErrorTitle": "ビートが見つかりません", - "xpack.beatsManagement.beat.beatNotFoundMessage": "ビートが見つかりません", - "xpack.beatsManagement.beat.configTabLabel": "構成", - "xpack.beatsManagement.beat.configurationTagsTabLabel": "構成タグ", - "xpack.beatsManagement.beat.detailsConfigurationDescription": "1 つのタグに複数の構成を適用することができます。これらの構成は必要に応じて同じタイプを繰り返したり、タイプを組み合わせることができます。たとえば、3 つの Metricbeat 構成と同時に 1 つのインプットと Filebeat 構成を使用することができます。", - "xpack.beatsManagement.beat.detailsConfigurationTitle": "構成", - "xpack.beatsManagement.beat.lastConfigUpdateMessage": "前回の構成の更新:{lastUpdateTime}。", - "xpack.beatsManagement.beat.loadingTitle": "読み込み中", - "xpack.beatsManagement.beatConfigurations.descriptionColumnName": "説明", - "xpack.beatsManagement.beatConfigurations.moduleColumnName": "モジュール", - "xpack.beatsManagement.beatConfigurations.tagColumnName": "タグ", - "xpack.beatsManagement.beatConfigurations.typeColumnName": "型", - "xpack.beatsManagement.beats.beatDisenrolledNotificationDescription": "ID {firstBeatId} のビートの登録が解除されました。", - "xpack.beatsManagement.beats.beatDisenrolledNotificationTitle": "{firstBeatNameOrId} の登録解除", - "xpack.beatsManagement.beats.configurationTagsTabTitle": "構成タグ", - "xpack.beatsManagement.beats.disenrolledBeatsNotificationTitle": "{beatsLength} 個のビートの登録解除", - "xpack.beatsManagement.beats.enrollBeatsButtonLabel": "ビートを登録", - "xpack.beatsManagement.beats.enrolledBeatsTabTitle": "登録済みのビート", - "xpack.beatsManagement.beats.enrollNewBeatsTitle": "新規ビートの登録", - "xpack.beatsManagement.beats.installBeatsLearningButtonLabel": "ビートのインストール方法", - "xpack.beatsManagement.beatsListAssignmentOptions.setTagsButtonLabel": "タグを設定", - "xpack.beatsManagement.beatsListAssignmentOptions.unenrollBeatsWarninigMessage": "選択されたビートは今後集中管理を使用しません", - "xpack.beatsManagement.beatsListAssignmentOptions.unenrollBeatsWarninigTitle": "選択されたビートの登録を解除しますか?", - "xpack.beatsManagement.beatsListAssignmentOptions.unenrollButtonLabel": "選択項目の登録を解除", - "xpack.beatsManagement.beatsTable.beatNameTitle": "ビート名", - "xpack.beatsManagement.beatsTable.configErrorStatusLabel": "構成エラー", - "xpack.beatsManagement.beatsTable.configStatus.errorTooltip": "このビートにエラーがあります。このホストのログを確認してください。", - "xpack.beatsManagement.beatsTable.configStatus.noConnectionTooltip": "このビートは 10 分以上 Kibana に接続していません", - "xpack.beatsManagement.beatsTable.configStatus.notStartedLabel": "未開始", - "xpack.beatsManagement.beatsTable.configStatus.notStartedTooltip": "このビートはまだ開始していません。", - "xpack.beatsManagement.beatsTable.configStatus.offlineLabel": "オフライン", - "xpack.beatsManagement.beatsTable.configStatus.okLabel": "OK", - "xpack.beatsManagement.beatsTable.configStatus.okTooltip": "最新の構成にビートが適用されました", - "xpack.beatsManagement.beatsTable.configStatus.progressTooltip": "このビートは現在 CM から構成を再読み込み中です。", - "xpack.beatsManagement.beatsTable.configStatus.runningTooltip": "このビートは問題なく動作中です。", - "xpack.beatsManagement.beatsTable.configStatus.startingTooltip": "このビートは開始中です。", - "xpack.beatsManagement.beatsTable.configStatusTitle": "構成ステータス", - "xpack.beatsManagement.beatsTable.disenrollSelectedLabel": "選択項目の登録を解除", - "xpack.beatsManagement.beatsTable.failedStatusLabel": "エラー", - "xpack.beatsManagement.beatsTable.runningStatusLabel": "実行中", - "xpack.beatsManagement.beatsTable.startingStatusLabel": "開始中", - "xpack.beatsManagement.beatsTable.stoppedStatusLabel": "停止中", - "xpack.beatsManagement.beatsTable.tagsTitle": "タグ", - "xpack.beatsManagement.beatsTable.typeLabel": "型", - "xpack.beatsManagement.beatsTable.typeTitle": "型", - "xpack.beatsManagement.beatsTable.updatingStatusLabel": "更新中", - "xpack.beatsManagement.beatTagsTable.addTagLabel": "タグを追加", - "xpack.beatsManagement.beatTagsTable.lastUpdateTitle": "最終更新", - "xpack.beatsManagement.beatTagsTable.removeSelectedLabel": "選択項目を削除", - "xpack.beatsManagement.beatTagsTable.tagNameTitle": "タグ名", - "xpack.beatsManagement.breadcrumb.beatDetails": "{beatId} のビート詳細", - "xpack.beatsManagement.breadcrumb.beatTags": "{beatId} のビートタグ", - "xpack.beatsManagement.breadcrumb.configurationTags": "構成タグ", - "xpack.beatsManagement.breadcrumb.enrolledBeats": "登録済みのビート", - "xpack.beatsManagement.centralManagementLinkLabel": "Beatsの集中管理", - "xpack.beatsManagement.config.other.error": "有効な YAML フォーマットを使用してください", - "xpack.beatsManagement.config.otherConfigDescription": "YAML フォーマットで Filebeat インプットの他の設定を指定します", - "xpack.beatsManagement.config.otherConfigLabel": "他の構成", - "xpack.beatsManagement.confirmModal.cancelButtonLabel": "キャンセル", - "xpack.beatsManagement.confirmModal.confirmButtonLabel": "確認", - "xpack.beatsManagement.confirmModal.confirmWarningTitle": "確認", - "xpack.beatsManagement.createTag.errorSavingTagTitle": "タグの保存中にエラーが発生", - "xpack.beatsManagement.createTag.saveAndContinueButtonLabel": "保存して続行", - "xpack.beatsManagement.disabledSecurityDescription": "ビートの集中管理を使用するには、Kibana と Elasticsearch でセキュリティを有効にする必要があります。", - "xpack.beatsManagement.disabledSecurityTitle": "セキュリティが有効ではありません", - "xpack.beatsManagement.enrollBeat.assignTagToBeatInvalidURLNoTagFoundTitle": "無効な URL、createdTag が見つかりません", - "xpack.beatsManagement.enrollBeat.assignTagToBeatInvalidURLNoTokenFountTitle": "無効な URL、enrollmentToken が見つかりません", - "xpack.beatsManagement.enrollBeat.assignTagToBeatNotEnrolledProperlyTitle": "エラー:ビートは正常に登録されていません", - "xpack.beatsManagement.enrollBeat.beatEnrolledTitle": "このビートは現在集中管理に登録されています:", - "xpack.beatsManagement.enrollBeat.beatsCentralManagementDescription": "一か所で構成を集中管理できます。", - "xpack.beatsManagement.enrollBeat.beatTypeColumnName": "ビートタイプ", - "xpack.beatsManagement.enrollBeat.beatTypeTitle": "ビートタイプ:", - "xpack.beatsManagement.enrollBeat.copyButtonLabel": "コマンドをコピー", - "xpack.beatsManagement.enrollBeat.createTagStepLabel": "タグを作成", - "xpack.beatsManagement.enrollBeat.enrollBeatButtonLabel": "ビートを登録", - "xpack.beatsManagement.enrollBeat.enrollBeatStepLabel": "ビートを登録", - "xpack.beatsManagement.enrollBeat.finishStepLabel": "終了", - "xpack.beatsManagement.enrollBeat.firstBeatEnrollingDoneButtonLabel": "完了", - "xpack.beatsManagement.enrollBeat.getStartedBeatsCentralManagementTitle": "ビートの集中管理を開始", - "xpack.beatsManagement.enrollBeat.hostnameColumnName": "ホスト名", - "xpack.beatsManagement.enrollBeat.nextStepDescription": "ビートを起動して構成エラーを確認し、「完了」をクリックしてください。", - "xpack.beatsManagement.enrollBeat.nextStepTitle": "ビートが登録されました。次のステップ", - "xpack.beatsManagement.enrollBeat.platformTitle": "プラットフォーム:", - "xpack.beatsManagement.enrollBeat.versionColumnName": "バージョン", - "xpack.beatsManagement.enrollBeat.waitingBeatTypeToEnrollTitle": "{beatType} の登録待ち…", - "xpack.beatsManagement.enrollBeat.yourBeatTypeHostTitle": "{beatType} がインストールされているホストでは次を実行:", - "xpack.beatsManagement.filebeatInputConfig.otherConfigDescription": "YAML フォーマットで Filebeat インプットの他の設定を指定します", - "xpack.beatsManagement.filebeatInputConfig.otherConfigErrorMessage": "有効な YAML フォーマットを使用してください", - "xpack.beatsManagement.filebeatInputConfig.otherConfigLabel": "他の構成", - "xpack.beatsManagement.filebeatInputConfig.pathsDescription": "それぞれのパスを別々の行に入力します", - "xpack.beatsManagement.filebeatInputConfig.pathsErrorMessage": "1 行につき 1 つのパスを入力してください", - "xpack.beatsManagement.filebeatInputConfig.pathsLabel": "パス", - "xpack.beatsManagement.filebeatModuleConfig.moduleDescription": "YAML フォーマットで Filebeat モジュールの他の設定を指定します", - "xpack.beatsManagement.filebeatModuleConfig.moduleErrorMessage": "モジュールを選択してください。", - "xpack.beatsManagement.filebeatModuleConfig.moduleLabel": "モジュール", - "xpack.beatsManagement.filebeatModuleConfig.otherConfigErrorMessage": "有効な YAML フォーマットを使用してください", - "xpack.beatsManagement.filebeatModuleConfig.otherConfigLabel": "他の構成", - "xpack.beatsManagement.invalidLicenseDescription": "現在のライセンスは期限切れです。登録されたビートは引き続き動作しますが、ビート管理 UI にアクセスするには有効なライセンスが必要です。", - "xpack.beatsManagement.invalidLicenseTitle": "ライセンスの期限切れ", - "xpack.beatsManagement.management.breadcrumb": "管理", - "xpack.beatsManagement.management.deprecationMessage": "Beats集中管理の開発は中止され、現在はそれに代わる包括的なソリューションを検討しています。ベータ版に参加して、フィードバックを提出していただき、どうもありがとうございます。ご質問や問題点がありましたら、{forumLink}からお問い合わせください。", - "xpack.beatsManagement.management.deprecationTitle": "Beats集中管理は廃止予定です", - "xpack.beatsManagement.management.forumLink": "ディスカッションフォーラム", - "xpack.beatsManagement.metricbeatModuleConfig.hostsDescription": "それぞれのパスを別々の行に入力します", - "xpack.beatsManagement.metricbeatModuleConfig.hostsErrorMessage": "1 行につき 1 つのファイルホストを入力してください", - "xpack.beatsManagement.metricbeatModuleConfig.hostsLabel": "ホスト", - "xpack.beatsManagement.metricbeatModuleConfig.moduleErrorMessage": "モジュールを選択してください。", - "xpack.beatsManagement.metricbeatModuleConfig.moduleLabel": "モジュール", - "xpack.beatsManagement.metricbeatModuleConfig.otherConfigDescription": "YAML フォーマットで Metricbeat モジュールの他の設定を指定します", - "xpack.beatsManagement.metricbeatModuleConfig.otherConfigErrorMessage": "有効な YAML フォーマットを使用してください", - "xpack.beatsManagement.metricbeatModuleConfig.otherConfigLabel": "他の構成", - "xpack.beatsManagement.metricbeatModuleConfig.periodErrorMessage": "無効な期間、10 秒は「10s」というフォーマットを使用してください", - "xpack.beatsManagement.metricbeatModuleConfig.periodLabel": "期間", - "xpack.beatsManagement.noAccess.accessDeniedDescription": "ビート集中管理へのアクセス権がありません。ビート集中管理を使用するには、{beatsAdminRole} ロールから権限が必要です。", - "xpack.beatsManagement.noAccess.accessDeniedTitle": "アクセスが拒否されました", - "xpack.beatsManagement.noContentFoundErrorMessage": "コンテンツがありません", - "xpack.beatsManagement.outputConfig.hostsErrorMessage": "1 行につき 1 つのファイルホストを入力してください", - "xpack.beatsManagement.outputConfig.hostsLabel": "ホスト", - "xpack.beatsManagement.outputConfig.outputTypeErrorMessage": "アウトプットタイプを選択してください", - "xpack.beatsManagement.outputConfig.outputTypeLabel": "アウトプットタイプ", - "xpack.beatsManagement.outputConfig.passwordErrorMessage": "処理不能なパスワードです", - "xpack.beatsManagement.outputConfig.passwordLabel": "パスワード", - "xpack.beatsManagement.outputConfig.usernameErrorMessage": "処理不能なユーザー名です", - "xpack.beatsManagement.outputConfig.usernameLabel": "ユーザー名", - "xpack.beatsManagement.overview.betaBadgeText": "ベータ", - "xpack.beatsManagement.table.filterResultsPlaceholder": "フィルター結果", - "xpack.beatsManagement.table.selectOptionLabel": "オプションを選択してください", - "xpack.beatsManagement.table.selectThisBeatTooltip": "このビートを選択します", - "xpack.beatsManagement.tag.addConfigurationButtonLabel": "構成ブロックを追加", - "xpack.beatsManagement.tag.beatsAssignedToTagTitle": "このタグが付いたビート", - "xpack.beatsManagement.tag.cancelButtonLabel": "キャンセル", - "xpack.beatsManagement.tag.createTagTitle": "タグの作成", - "xpack.beatsManagement.tag.saveButtonLabel": "保存", - "xpack.beatsManagement.tag.tagColorLabel": "タグの色", - "xpack.beatsManagement.tag.tagConfigurationsDescription": "タグには異なるタイプのビートの構成ブロックが使用できます。たとえば、1 つのタグに 2 つの Metricbeat 構成ブロックと 1 つの Filebeat インプット構成ブロックを使用することができます。", - "xpack.beatsManagement.tag.tagConfigurationsTitle": "構成ブロック", - "xpack.beatsManagement.tag.tagDetailsDescription": "タグとは、1 つまたは複数のビートに適用できる構成ブロックのグループです。", - "xpack.beatsManagement.tag.tagDetailsTitle": "タグの詳細", - "xpack.beatsManagement.tag.tagName.validationErrorMessage": "タグ名には文字、数字、ハイフンのみが使用できます。", - "xpack.beatsManagement.tag.tagNameLabel": "タグ名", - "xpack.beatsManagement.tag.tagNamePlaceholder": "タグ名 (必須) ", - "xpack.beatsManagement.tag.updateTagTitle": "タグ {tagId} を更新", - "xpack.beatsManagement.tagConfig.addConfigurationTitle\"": "構成ブロックを追加", - "xpack.beatsManagement.tagConfig.closeButtonLabel": "閉じる", - "xpack.beatsManagement.tagConfig.configurationTypeText": "{configType}‘構成", - "xpack.beatsManagement.tagConfig.descriptionLabel": "説明", - "xpack.beatsManagement.tagConfig.descriptionPlaceholder": "説明 (オプション) ", - "xpack.beatsManagement.tagConfig.editConfigurationTitle": "構成ブロックの編集", - "xpack.beatsManagement.tagConfig.filebeatInputLabel": "Filebeat インプット", - "xpack.beatsManagement.tagConfig.filebeatModuleLabel": "Filebeat モジュール", - "xpack.beatsManagement.tagConfig.invalidSchema": "エラー:この構成は無効です。Beats でサポートされておらず、削除する必要があります", - "xpack.beatsManagement.tagConfig.metricbeatModuleLabel": "Metricbeat モジュール", - "xpack.beatsManagement.tagConfig.outputLabel": "アウトプット", - "xpack.beatsManagement.tagConfig.saveButtonLabel": "保存", - "xpack.beatsManagement.tagConfig.typeLabel": "型", - "xpack.beatsManagement.tagConfig.viewConfigurationTitle\"": "構成ブロックの表示", - "xpack.beatsManagement.tagConfigAssignmentOptions.removeTagsButtonLabel": "タグを削除", - "xpack.beatsManagement.tagConfigAssignmentOptions.removeTagsWarninigMessage": "選択されたビートからタグを削除しますか?", - "xpack.beatsManagement.tagConfigAssignmentOptions.removeTagsWarninigTitle": "タグを削除", - "xpack.beatsManagement.tagListAssignmentOptions.removeTagsButtonLabel": "選択項目を削除", - "xpack.beatsManagement.tagListAssignmentOptions.removeTagsWarninigTitle": "タグを削除", - "xpack.beatsManagement.tagListAssignmentOptions.removeTagWarninigMessage": "タグを削除しますか?", - "xpack.beatsManagement.tags.addTagButtonLabel": "タグを追加", - "xpack.beatsManagement.tags.someTagsMightBeAssignedToBeatsTitle": "これらのタグのいくつかはビートに割り当てられている可能性があります。削除するタグが現在割り当てられていないことを確認してください", - "xpack.beatsManagement.tagsTable.lastUpdateTitle": "最終更新", - "xpack.beatsManagement.tagsTable.removeSelectedLabel": "選択項目を削除", - "xpack.beatsManagement.tagsTable.tagNameTitle": "タグ名", - "xpack.beatsManagement.tagTable.actions.removeButtonAriaLabel": "削除", - "xpack.beatsManagement.tagTable.actions.removeTooltip": "タグからこの構成を削除します", - "xpack.beatsManagement.tagTable.actionsColumnName": "アクション", - "xpack.beatsManagement.tagTable.descriptionColumnName": "説明", - "xpack.beatsManagement.tagTable.moduleColumn.notAvailibaleLabel": "N/A", - "xpack.beatsManagement.tagTable.moduleColumnName": "モジュール", - "xpack.beatsManagement.tagTable.typeColumnName": "型", - "xpack.beatsManagement.walkthrough.initial.betaBadgeText": "ベータ", "xpack.canvas.app.loadErrorMessage": "メッセージ:{error}", "xpack.canvas.app.loadErrorTitle": "Canvas の読み込みに失敗", "xpack.canvas.app.loadingMessage": "Canvas を読み込み中", diff --git a/x-pack/plugins/translations/translations/zh-CN.json b/x-pack/plugins/translations/translations/zh-CN.json index 306ac0bf744e2d..d223ba08185b4b 100644 --- a/x-pack/plugins/translations/translations/zh-CN.json +++ b/x-pack/plugins/translations/translations/zh-CN.json @@ -6195,189 +6195,6 @@ "xpack.banners.settings.textColor.description": "设置横幅广告文本的颜色。{subscriptionLink}", "xpack.banners.settings.textColor.title": "横幅广告文本颜色", "xpack.banners.settings.textContent.title": "横幅广告文本", - "xpack.beatsManagement.beat.actionSectionTypeLabel": "类型:{beatType}。", - "xpack.beatsManagement.beat.actionSectionVersionLabel": "版本:{beatVersion}。", - "xpack.beatsManagement.beat.beatNameAndIdTitle": "Beat:{nameOrNoName} (ID:{id}) ", - "xpack.beatsManagement.beat.beatNotFoundErrorMessage": "未找到 Beat", - "xpack.beatsManagement.beat.beatNotFoundErrorTitle": "未找到 Beat", - "xpack.beatsManagement.beat.beatNotFoundMessage": "未找到 Beat", - "xpack.beatsManagement.beat.configTabLabel": "配置", - "xpack.beatsManagement.beat.configurationTagsTabLabel": "配置标签", - "xpack.beatsManagement.beat.detailsConfigurationDescription": "可以将多个配置应用到单个标签。这些配置类型可以根据需要进行重复或混合。例如,您可以同时使用三个 Metricbeat 配置以及一个输入和 Filebeat 配置。", - "xpack.beatsManagement.beat.detailsConfigurationTitle": "配置", - "xpack.beatsManagement.beat.lastConfigUpdateMessage": "上次配置更新:{lastUpdateTime}。", - "xpack.beatsManagement.beat.loadingTitle": "正在加载", - "xpack.beatsManagement.beatConfigurations.descriptionColumnName": "描述", - "xpack.beatsManagement.beatConfigurations.moduleColumnName": "模块", - "xpack.beatsManagement.beatConfigurations.tagColumnName": "标签", - "xpack.beatsManagement.beatConfigurations.typeColumnName": "类型", - "xpack.beatsManagement.beats.addedNotificationDescription": "将标签 {tag} 添加到 {assignmentsLength, plural, one {Beat {beatName}} other {# 个 Beats}}。", - "xpack.beatsManagement.beats.addedNotificationTitle": "{assignmentsLength, plural, other {标签}}已添加", - "xpack.beatsManagement.beats.beatDisenrolledNotificationDescription": "ID 为 {firstBeatId} 的 Beat 已除名。", - "xpack.beatsManagement.beats.beatDisenrolledNotificationTitle": "{firstBeatNameOrId} 已除名", - "xpack.beatsManagement.beats.configurationTagsTabTitle": "配置标签", - "xpack.beatsManagement.beats.disenrolledBeatsNotificationTitle": "{beatsLength} 个 Beats 已除名", - "xpack.beatsManagement.beats.enrollBeatsButtonLabel": "注册 Beats", - "xpack.beatsManagement.beats.enrolledBeatsTabTitle": "已注册 Beats", - "xpack.beatsManagement.beats.enrollNewBeatsTitle": "注册新 Beat", - "xpack.beatsManagement.beats.installBeatsLearningButtonLabel": "了解如何安装 Beats", - "xpack.beatsManagement.beats.removedNotificationDescription": "已从 {assignmentsLength, plural, one {Beat {beatName}} other {# 个 Beat}} 移除标签 {tag}", - "xpack.beatsManagement.beats.removedNotificationTitle": "{assignmentsLength, plural, other {标签}}已删除", - "xpack.beatsManagement.beatsListAssignmentOptions.setTagsButtonLabel": "设置标签", - "xpack.beatsManagement.beatsListAssignmentOptions.unenrollBeatsWarninigMessage": "选定的 Beats 将不再使用集中管理", - "xpack.beatsManagement.beatsListAssignmentOptions.unenrollBeatsWarninigTitle": "取消注册选定的 Beats?", - "xpack.beatsManagement.beatsListAssignmentOptions.unenrollButtonLabel": "取消注册选定", - "xpack.beatsManagement.beatsTable.beatNameTitle": "Beat 名称", - "xpack.beatsManagement.beatsTable.configErrorStatusLabel": "配置错误", - "xpack.beatsManagement.beatsTable.configStatus.errorTooltip": "此 Beat 有错误,请查看此主机的日志。", - "xpack.beatsManagement.beatsTable.configStatus.noConnectionTooltip": "此 Beat 未连接到 Kibana 的时间已超过 10 分钟", - "xpack.beatsManagement.beatsTable.configStatus.notStartedLabel": "未开始", - "xpack.beatsManagement.beatsTable.configStatus.notStartedTooltip": "此 Beat 尚未启动。", - "xpack.beatsManagement.beatsTable.configStatus.offlineLabel": "脱机", - "xpack.beatsManagement.beatsTable.configStatus.okLabel": "确定", - "xpack.beatsManagement.beatsTable.configStatus.okTooltip": "Beat 成功应用最新的配置", - "xpack.beatsManagement.beatsTable.configStatus.progressTooltip": "此 Beat 当前正在从 CM 重新加载配置。", - "xpack.beatsManagement.beatsTable.configStatus.runningTooltip": "此 Beat 正在运行,没有任何问题。", - "xpack.beatsManagement.beatsTable.configStatus.startingTooltip": "此 Beat 正在启动。", - "xpack.beatsManagement.beatsTable.configStatusTitle": "配置状态", - "xpack.beatsManagement.beatsTable.disenrollSelectedLabel": "取消注册选定", - "xpack.beatsManagement.beatsTable.failedStatusLabel": "错误", - "xpack.beatsManagement.beatsTable.runningStatusLabel": "正在运行", - "xpack.beatsManagement.beatsTable.startingStatusLabel": "正在启动", - "xpack.beatsManagement.beatsTable.stoppedStatusLabel": "已停止", - "xpack.beatsManagement.beatsTable.tagsTitle": "标签", - "xpack.beatsManagement.beatsTable.typeLabel": "类型", - "xpack.beatsManagement.beatsTable.typeTitle": "类型", - "xpack.beatsManagement.beatsTable.updatingStatusLabel": "正在更新", - "xpack.beatsManagement.beatTagsTable.addTagLabel": "添加标签", - "xpack.beatsManagement.beatTagsTable.lastUpdateTitle": "上次更新", - "xpack.beatsManagement.beatTagsTable.removeSelectedLabel": "删除选定", - "xpack.beatsManagement.beatTagsTable.tagNameTitle": "标签名称", - "xpack.beatsManagement.breadcrumb.beatDetails": "{beatId} 的 Beat 详情", - "xpack.beatsManagement.breadcrumb.beatTags": "{beatId} 的 Beat 标签", - "xpack.beatsManagement.breadcrumb.configurationTags": "配置标签", - "xpack.beatsManagement.breadcrumb.enrolledBeats": "已注册 Beats", - "xpack.beatsManagement.centralManagementLinkLabel": "Beats 集中管理", - "xpack.beatsManagement.config.other.error": "使用有效的 YAML 格式", - "xpack.beatsManagement.config.otherConfigDescription": "使用 YAML 格式指定 Filebeat 输入的其他设置", - "xpack.beatsManagement.config.otherConfigLabel": "其他配置", - "xpack.beatsManagement.confirmModal.cancelButtonLabel": "取消", - "xpack.beatsManagement.confirmModal.confirmButtonLabel": "确认", - "xpack.beatsManagement.confirmModal.confirmWarningTitle": "确认", - "xpack.beatsManagement.createTag.errorSavingTagTitle": "保存标签时出错", - "xpack.beatsManagement.createTag.saveAndContinueButtonLabel": "保存并继续", - "xpack.beatsManagement.disabledSecurityDescription": "必须在 Kibana 和 Elasticsearch 启用安全性,才能使用 Beats 集中管理。", - "xpack.beatsManagement.disabledSecurityTitle": "安全性未启用", - "xpack.beatsManagement.enrollBeat.assignTagToBeatInvalidURLNoTagFoundTitle": "URL 无效,未找到 createdTag", - "xpack.beatsManagement.enrollBeat.assignTagToBeatInvalidURLNoTokenFountTitle": "URL 无效,未找到 enrollmentToken", - "xpack.beatsManagement.enrollBeat.assignTagToBeatNotEnrolledProperlyTitle": "错误:Beat 未正确注册", - "xpack.beatsManagement.enrollBeat.beatEnrolledTitle": "该 Beat 当前已在集中管理中注册:", - "xpack.beatsManagement.enrollBeat.beatsCentralManagementDescription": "在集中位置管理您的配置。", - "xpack.beatsManagement.enrollBeat.beatTypeColumnName": "Beat 类型", - "xpack.beatsManagement.enrollBeat.beatTypeTitle": "Beat 类型:", - "xpack.beatsManagement.enrollBeat.copyButtonLabel": "复制命令", - "xpack.beatsManagement.enrollBeat.createTagStepLabel": "创建标签", - "xpack.beatsManagement.enrollBeat.enrollBeatButtonLabel": "注册 Beat", - "xpack.beatsManagement.enrollBeat.enrollBeatStepLabel": "注册 Beat", - "xpack.beatsManagement.enrollBeat.finishStepLabel": "完成", - "xpack.beatsManagement.enrollBeat.firstBeatEnrollingDoneButtonLabel": "完成", - "xpack.beatsManagement.enrollBeat.getStartedBeatsCentralManagementTitle": "开始使用 Beats 集中管理", - "xpack.beatsManagement.enrollBeat.hostnameColumnName": "主机名", - "xpack.beatsManagement.enrollBeat.nextStepDescription": "启动您的 Beat 以检查是否有配置错误,然后单击“完成”。", - "xpack.beatsManagement.enrollBeat.nextStepTitle": "您的 Beat 已注册。后续操作", - "xpack.beatsManagement.enrollBeat.platformTitle": "平台:", - "xpack.beatsManagement.enrollBeat.versionColumnName": "版本", - "xpack.beatsManagement.enrollBeat.waitingBeatTypeToEnrollTitle": "正在等待注册 {beatType}……", - "xpack.beatsManagement.enrollBeat.yourBeatTypeHostTitle": "在安装您的 {beatType} 的主机上,运行:", - "xpack.beatsManagement.filebeatInputConfig.otherConfigDescription": "使用 YAML 格式指定 Filebeat 输入的其他设置", - "xpack.beatsManagement.filebeatInputConfig.otherConfigErrorMessage": "使用有效的 YAML 格式", - "xpack.beatsManagement.filebeatInputConfig.otherConfigLabel": "其他配置", - "xpack.beatsManagement.filebeatInputConfig.pathsDescription": "将每个路径放置在单独的行上", - "xpack.beatsManagement.filebeatInputConfig.pathsErrorMessage": "每行一个文件路径", - "xpack.beatsManagement.filebeatInputConfig.pathsLabel": "路径", - "xpack.beatsManagement.filebeatModuleConfig.moduleDescription": "使用 YAML 格式指定 Filebeat 模块的其他设置", - "xpack.beatsManagement.filebeatModuleConfig.moduleErrorMessage": "请选择模块", - "xpack.beatsManagement.filebeatModuleConfig.moduleLabel": "模块", - "xpack.beatsManagement.filebeatModuleConfig.otherConfigErrorMessage": "使用有效的 YAML 格式", - "xpack.beatsManagement.filebeatModuleConfig.otherConfigLabel": "其他配置", - "xpack.beatsManagement.invalidLicenseDescription": "您当前的许可证已过期。已注册的 Beats 将继续工作,但您需要有效的许可,才能访问 Beats 管理 UI。", - "xpack.beatsManagement.invalidLicenseTitle": "已过期许可证", - "xpack.beatsManagement.management.breadcrumb": "管理", - "xpack.beatsManagement.management.deprecationMessage": "我们已停止开发 Beats 集中管理,正开发一款全面的解决方案来替代它。感谢您参与公测版测试并提供反馈。如果您有任何问题或顾虑,请在 {forumLink} 上联系我们。", - "xpack.beatsManagement.management.deprecationTitle": "Beats 集中管理已弃用", - "xpack.beatsManagement.management.forumLink": "讨论论坛", - "xpack.beatsManagement.metricbeatModuleConfig.hostsDescription": "将每个路径放置在单独的行上", - "xpack.beatsManagement.metricbeatModuleConfig.hostsErrorMessage": "每行一个文件主机", - "xpack.beatsManagement.metricbeatModuleConfig.hostsLabel": "主机", - "xpack.beatsManagement.metricbeatModuleConfig.moduleErrorMessage": "请选择模块", - "xpack.beatsManagement.metricbeatModuleConfig.moduleLabel": "模块", - "xpack.beatsManagement.metricbeatModuleConfig.otherConfigDescription": "使用 YAML 格式指定 Metricbeat 模块的其他设置", - "xpack.beatsManagement.metricbeatModuleConfig.otherConfigErrorMessage": "使用有效的 YAML 格式", - "xpack.beatsManagement.metricbeatModuleConfig.otherConfigLabel": "其他配置", - "xpack.beatsManagement.metricbeatModuleConfig.periodErrorMessage": "期间无效,10 秒的格式必须为 `10s`。", - "xpack.beatsManagement.metricbeatModuleConfig.periodLabel": "期间", - "xpack.beatsManagement.noAccess.accessDeniedDescription": "您无权访问 Beats 集中管理。要使用 Beats 集中管理,您需要 {beatsAdminRole} 角色授予的权限。", - "xpack.beatsManagement.noAccess.accessDeniedTitle": "访问被拒绝", - "xpack.beatsManagement.noContentFoundErrorMessage": "未找到任何内容", - "xpack.beatsManagement.outputConfig.hostsErrorMessage": "每行一个文件主机", - "xpack.beatsManagement.outputConfig.hostsLabel": "主机", - "xpack.beatsManagement.outputConfig.outputTypeErrorMessage": "请选择输出类型", - "xpack.beatsManagement.outputConfig.outputTypeLabel": "输出类型", - "xpack.beatsManagement.outputConfig.passwordErrorMessage": "无法处理的密码", - "xpack.beatsManagement.outputConfig.passwordLabel": "密码", - "xpack.beatsManagement.outputConfig.usernameErrorMessage": "无法处理的用户名", - "xpack.beatsManagement.outputConfig.usernameLabel": "用户名", - "xpack.beatsManagement.overview.betaBadgeText": "公测版", - "xpack.beatsManagement.table.filterResultsPlaceholder": "筛选结果", - "xpack.beatsManagement.table.selectOptionLabel": "请选择选项", - "xpack.beatsManagement.table.selectThisBeatTooltip": "选择此 Beat", - "xpack.beatsManagement.tag.addConfigurationButtonLabel": "添加配置块", - "xpack.beatsManagement.tag.beatsAssignedToTagTitle": "具有此标签的 Beats", - "xpack.beatsManagement.tag.cancelButtonLabel": "取消", - "xpack.beatsManagement.tag.createTagTitle": "创建标签", - "xpack.beatsManagement.tag.saveButtonLabel": "保存", - "xpack.beatsManagement.tag.tagColorLabel": "标签颜色", - "xpack.beatsManagement.tag.tagConfigurationsDescription": "标签可以有不同类型 Beats 的配置块。例如,标签可以有两个 Metricbeat 配置块和一个 Filebeat 输入配置块。", - "xpack.beatsManagement.tag.tagConfigurationsTitle": "配置块", - "xpack.beatsManagement.tag.tagDetailsDescription": "标签是可以应用到一个或多个 Beats 的一组配置块。", - "xpack.beatsManagement.tag.tagDetailsTitle": "标签详情", - "xpack.beatsManagement.tag.tagName.validationErrorMessage": "标签名称只能由字母、数字和短划线构成", - "xpack.beatsManagement.tag.tagNameLabel": "标签名称", - "xpack.beatsManagement.tag.tagNamePlaceholder": "标签名称 (必填) ", - "xpack.beatsManagement.tag.updateTagTitle": "创建标签:{tagId}", - "xpack.beatsManagement.tagConfig.addConfigurationTitle\"": "添加配置块", - "xpack.beatsManagement.tagConfig.closeButtonLabel": "关闭", - "xpack.beatsManagement.tagConfig.configurationTypeText": "{configType} 配置", - "xpack.beatsManagement.tagConfig.descriptionLabel": "描述", - "xpack.beatsManagement.tagConfig.descriptionPlaceholder": "描述 (可选) ", - "xpack.beatsManagement.tagConfig.editConfigurationTitle": "编辑配置块", - "xpack.beatsManagement.tagConfig.filebeatInputLabel": "Filebeat 输入", - "xpack.beatsManagement.tagConfig.filebeatModuleLabel": "Filebeat 模块", - "xpack.beatsManagement.tagConfig.invalidSchema": "错误:此配置无效,其不受 Beats 支持,应移除", - "xpack.beatsManagement.tagConfig.metricbeatModuleLabel": "Metricbeat 模块", - "xpack.beatsManagement.tagConfig.outputLabel": "输出", - "xpack.beatsManagement.tagConfig.saveButtonLabel": "保存", - "xpack.beatsManagement.tagConfig.typeLabel": "类型", - "xpack.beatsManagement.tagConfig.viewConfigurationTitle\"": "查看配置块", - "xpack.beatsManagement.tagConfigAssignmentOptions.removeTagsButtonLabel": "删除标签", - "xpack.beatsManagement.tagConfigAssignmentOptions.removeTagsWarninigMessage": "从选定 Beats 删除该标签?", - "xpack.beatsManagement.tagConfigAssignmentOptions.removeTagsWarninigTitle": "删除标签", - "xpack.beatsManagement.tagListAssignmentOptions.removeTagsButtonLabel": "删除选定", - "xpack.beatsManagement.tagListAssignmentOptions.removeTagsWarninigTitle": "删除标签", - "xpack.beatsManagement.tagListAssignmentOptions.removeTagWarninigMessage": "删除标签?", - "xpack.beatsManagement.tags.addTagButtonLabel": "添加标签", - "xpack.beatsManagement.tags.someTagsMightBeAssignedToBeatsTitle": "以下部分标签可能已分配给 Beats。请确保正要删除的标签当前未被分配", - "xpack.beatsManagement.tagsTable.lastUpdateTitle": "上次更新", - "xpack.beatsManagement.tagsTable.removeSelectedLabel": "删除选定", - "xpack.beatsManagement.tagsTable.tagNameTitle": "标签名称", - "xpack.beatsManagement.tagTable.actions.removeButtonAriaLabel": "移除", - "xpack.beatsManagement.tagTable.actions.removeTooltip": "从标签删除此配置", - "xpack.beatsManagement.tagTable.actionsColumnName": "操作", - "xpack.beatsManagement.tagTable.descriptionColumnName": "描述", - "xpack.beatsManagement.tagTable.moduleColumn.notAvailibaleLabel": "不可用", - "xpack.beatsManagement.tagTable.moduleColumnName": "模块", - "xpack.beatsManagement.tagTable.typeColumnName": "类型", - "xpack.beatsManagement.walkthrough.initial.betaBadgeText": "公测版", "xpack.canvas.app.loadErrorMessage": "消息:{error}", "xpack.canvas.app.loadErrorTitle": "Canvas 加载失败", "xpack.canvas.app.loadingMessage": "Canvas 正在加载", diff --git a/x-pack/test/api_integration/apis/beats/assign_tags_to_beats.js b/x-pack/test/api_integration/apis/beats/assign_tags_to_beats.js deleted file mode 100644 index c11bdb7112640a..00000000000000 --- a/x-pack/test/api_integration/apis/beats/assign_tags_to_beats.js +++ /dev/null @@ -1,254 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import expect from '@kbn/expect'; -import { ES_INDEX_NAME } from './constants'; - -export default function ({ getService }) { - const supertest = getService('supertest'); - const esArchiver = getService('esArchiver'); - const es = getService('legacyEs'); - const randomness = getService('randomness'); - - describe('assign_tags_to_beats', () => { - const archive = 'beats/list'; - - beforeEach('load beats archive', () => esArchiver.load(archive)); - afterEach('unload beats archive', () => esArchiver.unload(archive)); - - it('should add a single tag to a single beat', async () => { - const { body: apiResponse } = await supertest - .post('/api/beats/agents_tags/assignments') - .set('kbn-xsrf', 'xxx') - .send({ - assignments: [{ beatId: 'bar', tag: 'production' }], - }) - .expect(200); - - expect(apiResponse.results).to.eql([{ success: true, result: { message: 'updated' } }]); - - const esResponse = await es.get({ - index: ES_INDEX_NAME, - id: `beat:bar`, - }); - - const beat = esResponse._source.beat; - expect(beat.tags).to.eql(['production']); - }); - - it('should not re-add an existing tag to a beat', async () => { - const tags = ['production']; - - let esResponse; - let beat; - - // Before adding the existing tag - esResponse = await es.get({ - index: ES_INDEX_NAME, - id: `beat:foo`, - }); - - beat = esResponse._source.beat; - expect(beat.tags).to.eql([...tags, 'qa']); - - // Adding the existing tag - const { body: apiResponse } = await supertest - .post('/api/beats/agents_tags/assignments') - .set('kbn-xsrf', 'xxx') - .send({ - assignments: [{ beatId: 'foo', tag: 'production' }], - }) - .expect(200); - - expect(apiResponse.results).to.eql([{ success: true, result: { message: 'updated' } }]); - - // After adding the existing tag - esResponse = await es.get({ - index: ES_INDEX_NAME, - id: `beat:foo`, - }); - - beat = esResponse._source.beat; - expect(beat.tags).to.eql([...tags, 'qa']); - }); - - it('should add a single tag to a multiple beats', async () => { - const { body: apiResponse } = await supertest - .post('/api/beats/agents_tags/assignments') - .set('kbn-xsrf', 'xxx') - .send({ - assignments: [ - { beatId: 'foo', tag: 'development' }, - { beatId: 'bar', tag: 'development' }, - ], - }) - .expect(200); - - expect(apiResponse.results).to.eql([ - { success: true, result: { message: 'updated' } }, - { success: true, result: { message: 'updated' } }, - ]); - - let esResponse; - let beat; - - // Beat foo - esResponse = await es.get({ - index: ES_INDEX_NAME, - id: `beat:foo`, - }); - - beat = esResponse._source.beat; - expect(beat.tags).to.eql(['production', 'qa', 'development']); // as beat 'foo' already had 'production' and 'qa' tags attached to it - - // Beat bar - esResponse = await es.get({ - index: ES_INDEX_NAME, - id: `beat:bar`, - }); - - beat = esResponse._source.beat; - expect(beat.tags).to.eql(['development']); - }); - - it('should add multiple tags to a single beat', async () => { - const { body: apiResponse } = await supertest - .post('/api/beats/agents_tags/assignments') - .set('kbn-xsrf', 'xxx') - .send({ - assignments: [ - { beatId: 'bar', tag: 'development' }, - { beatId: 'bar', tag: 'production' }, - ], - }) - .expect(200); - - expect(apiResponse.results).to.eql([ - { success: true, result: { message: 'updated' } }, - { success: true, result: { message: 'updated' } }, - ]); - - const esResponse = await es.get({ - index: ES_INDEX_NAME, - id: `beat:bar`, - }); - - const beat = esResponse._source.beat; - expect(beat.tags).to.eql(['development', 'production']); - }); - - it('should add multiple tags to a multiple beats', async () => { - const { body: apiResponse } = await supertest - .post('/api/beats/agents_tags/assignments') - .set('kbn-xsrf', 'xxx') - .send({ - assignments: [ - { beatId: 'foo', tag: 'development' }, - { beatId: 'bar', tag: 'production' }, - ], - }) - .expect(200); - - expect(apiResponse.results).to.eql([ - { success: true, result: { message: 'updated' } }, - { success: true, result: { message: 'updated' } }, - ]); - - let esResponse; - let beat; - - // Beat foo - esResponse = await es.get({ - index: ES_INDEX_NAME, - id: `beat:foo`, - }); - - beat = esResponse._source.beat; - expect(beat.tags).to.eql(['production', 'qa', 'development']); // as beat 'foo' already had 'production' and 'qa' tags attached to it - - // Beat bar - esResponse = await es.get({ - index: ES_INDEX_NAME, - id: `beat:bar`, - }); - - beat = esResponse._source.beat; - expect(beat.tags).to.eql(['production']); - }); - - it('should return errors for non-existent beats', async () => { - const nonExistentBeatId = randomness.word(); - - const { body: apiResponse } = await supertest - .post('/api/beats/agents_tags/assignments') - .set('kbn-xsrf', 'xxx') - .send({ - assignments: [{ beatId: nonExistentBeatId, tag: 'production' }], - }) - .expect(200); - - expect(apiResponse.results).to.eql([ - { success: false, error: { code: 404, message: `Beat ${nonExistentBeatId} not found` } }, - ]); - }); - - it('should return errors for non-existent tags', async () => { - const nonExistentTag = randomness.word(); - - const { body: apiResponse } = await supertest - .post('/api/beats/agents_tags/assignments') - .set('kbn-xsrf', 'xxx') - .send({ - assignments: [{ beatId: 'bar', tag: nonExistentTag }], - }) - .expect(200); - - expect(apiResponse.results).to.eql([ - { success: false, error: { code: 404, message: `Tag ${nonExistentTag} not found` } }, - ]); - - const esResponse = await es.get({ - index: ES_INDEX_NAME, - id: `beat:bar`, - }); - - const beat = esResponse._source.beat; - expect(beat).to.not.have.property('tags'); - }); - - it('should return errors for non-existent beats and tags', async () => { - const nonExistentBeatId = randomness.word(); - const nonExistentTag = randomness.word(); - - const { body: apiResponse } = await supertest - .post('/api/beats/agents_tags/assignments') - .set('kbn-xsrf', 'xxx') - .send({ - assignments: [{ beatId: nonExistentBeatId, tag: nonExistentTag }], - }) - .expect(200); - - expect(apiResponse.results).to.eql([ - { - success: false, - error: { - code: 404, - message: `Beat ${nonExistentBeatId} and tag ${nonExistentTag} not found`, - }, - }, - ]); - - const esResponse = await es.get({ - index: ES_INDEX_NAME, - id: `beat:bar`, - }); - - const beat = esResponse._source.beat; - expect(beat).to.not.have.property('tags'); - }); - }); -} diff --git a/x-pack/test/api_integration/apis/beats/constants.js b/x-pack/test/api_integration/apis/beats/constants.js deleted file mode 100644 index 9e8064f4d1b5b1..00000000000000 --- a/x-pack/test/api_integration/apis/beats/constants.js +++ /dev/null @@ -1,8 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -export const ES_INDEX_NAME = '.management-beats'; diff --git a/x-pack/test/api_integration/apis/beats/create_enrollment_tokens.js b/x-pack/test/api_integration/apis/beats/create_enrollment_tokens.js deleted file mode 100644 index 5ac59b690465fb..00000000000000 --- a/x-pack/test/api_integration/apis/beats/create_enrollment_tokens.js +++ /dev/null @@ -1,88 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import expect from '@kbn/expect'; -import moment from 'moment'; -import { ES_INDEX_NAME } from './constants'; - -export default function ({ getService }) { - const supertest = getService('supertest'); - const es = getService('legacyEs'); - - describe('create_enrollment_token', () => { - it('should create one token by default', async () => { - const { body: apiResponse } = await supertest - .post('/api/beats/enrollment_tokens') - .set('kbn-xsrf', 'xxx') - .send() - .expect(200); - - const tokensFromApi = apiResponse.results.map((r) => r.item); - - const esResponse = await es.search({ - index: ES_INDEX_NAME, - q: 'type:enrollment_token', - }); - - const tokensInEs = esResponse.hits.hits.map((hit) => hit._source.enrollment_token.token); - - expect(tokensFromApi.length).to.eql(1); - expect(tokensFromApi).to.eql(tokensInEs); - }); - - it('should create the specified number of tokens', async () => { - const numTokens = 1000; - - const { body: apiResponse } = await supertest - .post('/api/beats/enrollment_tokens') - .set('kbn-xsrf', 'xxx') - .send({ - num_tokens: numTokens, - }) - .expect(200); - - const tokensFromApi = apiResponse.results.map((r) => r.item); - - const esResponse = await es.search({ - index: ES_INDEX_NAME, - q: 'type:enrollment_token', - size: numTokens, - }); - - const tokensInEs = esResponse.hits.hits.map((hit) => hit._source.enrollment_token.token); - - expect(tokensFromApi).to.be.an('array'); - expect(tokensFromApi.length).to.eql(numTokens); - expect(tokensInEs.length).to.eql(numTokens); - expect(tokensFromApi.sort()).to.eql(tokensInEs.sort()); - }); - - it('should set token expiration to 10 minutes from now by default', async () => { - await supertest - .post('/api/beats/enrollment_tokens') - .set('kbn-xsrf', 'xxx') - .send() - .expect(200); - - const esResponse = await es.search({ - index: ES_INDEX_NAME, - q: 'type:enrollment_token', - }); - - const tokenInEs = esResponse.hits.hits[0]._source.enrollment_token; - - // We do a fuzzy check to see if the token expires between 9 and 10 minutes - // from now because a bit of time has elapsed been the creation of the - // tokens and this check. - const tokenExpiresOn = moment(tokenInEs.expires_on).valueOf(); - const tenMinutesFromNow = moment().add('10', 'minutes').valueOf(); - const almostTenMinutesFromNow = moment(tenMinutesFromNow).subtract('2', 'seconds').valueOf(); - expect(tokenExpiresOn).to.be.lessThan(tenMinutesFromNow); - expect(tokenExpiresOn).to.be.greaterThan(almostTenMinutesFromNow); - }); - }); -} diff --git a/x-pack/test/api_integration/apis/beats/enroll_beat.js b/x-pack/test/api_integration/apis/beats/enroll_beat.js deleted file mode 100644 index a1ac449e7fcb85..00000000000000 --- a/x-pack/test/api_integration/apis/beats/enroll_beat.js +++ /dev/null @@ -1,184 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import expect from '@kbn/expect'; -import moment from 'moment'; - -import { ES_INDEX_NAME } from './constants'; - -export default function ({ getService }) { - const supertest = getService('supertest'); - const randomness = getService('randomness'); - const es = getService('legacyEs'); - - describe('enroll_beat', () => { - let validEnrollmentToken; - let beatId; - let beat; - - beforeEach(async () => { - validEnrollmentToken = randomness.word(); - - beatId = randomness.word(); - const version = - randomness.integer({ min: 1, max: 10 }) + - '.' + - randomness.integer({ min: 1, max: 10 }) + - '.' + - randomness.integer({ min: 1, max: 10 }); - - beat = { - type: 'filebeat', - host_name: 'foo.bar.com', - name: randomness.word(), - version, - }; - - await es.index({ - index: ES_INDEX_NAME, - id: `enrollment_token:${validEnrollmentToken}`, - body: { - type: 'enrollment_token', - enrollment_token: { - token: validEnrollmentToken, - expires_on: moment().add(4, 'hours').toJSON(), - }, - }, - }); - }); - - it('should enroll beat in a verified state', async () => { - await supertest - .post(`/api/beats/agent/${beatId}`) - .set('kbn-xsrf', 'xxx') - .set('kbn-beats-enrollment-token', validEnrollmentToken) - .send(beat) - .expect(200); - - const esResponse = await es.get({ - index: ES_INDEX_NAME, - id: `beat:${beatId}`, - }); - - expect(esResponse._source.beat).to.have.property('verified_on'); - expect(esResponse._source.beat).to.have.property('host_ip'); - }); - - it('should contain an access token in the response', async () => { - const { body: apiResponse } = await supertest - .post(`/api/beats/agent/${beatId}`) - .set('kbn-xsrf', 'xxx') - .set('kbn-beats-enrollment-token', validEnrollmentToken) - .send(beat) - .expect(200); - - const accessTokenFromApi = apiResponse.item; - - const esResponse = await es.get({ - index: ES_INDEX_NAME, - id: `beat:${beatId}`, - }); - - const accessTokenInEs = esResponse._source.beat.access_token; - - expect(accessTokenFromApi.length).to.be.greaterThan(0); - expect(accessTokenFromApi).to.eql(accessTokenInEs); - }); - - it('should reject an invalid enrollment token', async () => { - const { body: apiResponse } = await supertest - .post(`/api/beats/agent/${beatId}`) - .set('kbn-xsrf', 'xxx') - .set('kbn-beats-enrollment-token', randomness.word()) - .send(beat) - .expect(400); - - expect(apiResponse).to.eql({ - statusCode: 400, - error: 'Bad Request', - message: 'Invalid enrollment token', - }); - }); - - it('should reject an expired enrollment token', async () => { - const expiredEnrollmentToken = - 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.' + - 'eyJjcmVhdGVkIjoiMjAxOC0wNi0zMFQwMzo0MjoxNS4yMzBaIiwiaWF0IjoxNTMwMzMwMTM1LCJleHAiOjE1MzAzMzAxMzV9.' + - 'Azf4czAwWZEflR7Pf8pi-DUTcve9xyxWyViNYeUSGog'; - - await es.index({ - index: ES_INDEX_NAME, - id: `enrollment_token:${expiredEnrollmentToken}`, - body: { - type: 'enrollment_token', - enrollment_token: { - token: expiredEnrollmentToken, - expires_on: moment().subtract(1, 'minute').toJSON(), - }, - }, - }); - - const { body: apiResponse } = await supertest - .post(`/api/beats/agent/${beatId}`) - .set('kbn-xsrf', 'xxx') - .set('kbn-beats-enrollment-token', expiredEnrollmentToken) - .send(beat) - .expect(400); - - expect(apiResponse).to.eql({ - statusCode: 400, - error: 'Bad Request', - message: 'Expired enrollment token', - }); - }); - - it('should delete the given enrollment token so it may not be reused', async () => { - await supertest - .post(`/api/beats/agent/${beatId}`) - .set('kbn-xsrf', 'xxx') - .set('kbn-beats-enrollment-token', validEnrollmentToken) - .send(beat) - .expect(200); - - const esResponse = await es.get({ - index: ES_INDEX_NAME, - id: `enrollment_token:${validEnrollmentToken}`, - ignore: [404], - }); - - expect(esResponse.found).to.be(false); - }); - - it('should fail if the beat with the same ID is enrolled twice', async () => { - await supertest - .post(`/api/beats/agent/${beatId}`) - .set('kbn-xsrf', 'xxx') - .set('kbn-beats-enrollment-token', validEnrollmentToken) - .send(beat) - .expect(200); - - await es.index({ - index: ES_INDEX_NAME, - id: `enrollment_token:${validEnrollmentToken}`, - body: { - type: 'enrollment_token', - enrollment_token: { - token: validEnrollmentToken, - expires_on: moment().add(4, 'hours').toJSON(), - }, - }, - }); - - await supertest - .post(`/api/beats/agent/${beatId}`) - .set('kbn-xsrf', 'xxx') - .set('kbn-beats-enrollment-token', validEnrollmentToken) - .send(beat) - .expect(200); - }); - }); -} diff --git a/x-pack/test/api_integration/apis/beats/get_beat.js b/x-pack/test/api_integration/apis/beats/get_beat.js deleted file mode 100644 index 610ea72bb3d423..00000000000000 --- a/x-pack/test/api_integration/apis/beats/get_beat.js +++ /dev/null @@ -1,87 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import expect from '@kbn/expect'; -import { ES_INDEX_NAME } from './constants'; - -export default function ({ getService }) { - const supertest = getService('supertest'); - const esArchiver = getService('esArchiver'); - const es = getService('legacyEs'); - - describe('get_beat_configuration', () => { - const archive = 'beats/list'; - - beforeEach('load beats archive', () => esArchiver.load(archive)); - afterEach('unload beats archive', () => esArchiver.unload(archive)); - - it('should return no configurations for the beat without tags', async () => { - await es.index({ - index: ES_INDEX_NAME, - id: `beat:empty`, - body: { - type: 'beat', - beat: { - type: 'filebeat', - active: true, - host_ip: '1.2.3.4', - host_name: 'empty.com', - id: 'empty', - name: 'empty_filebeat', - access_token: - 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJjcmVhdGVkIjoiMjAxOC0wNi0zMFQwMzo0MjoxNS4yMzBaIiwiaWF0IjoxNTMwMzMwMTM1fQ.SSsX2Byyo1B1bGxV8C3G4QldhE5iH87EY_1r21-bwbI', // eslint-disable-line - }, - }, - }); - - const { body: apiResponse } = await supertest - .get('/api/beats/agent/empty/configuration') - .set( - 'kbn-beats-access-token', - 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.' + - 'eyJjcmVhdGVkIjoiMjAxOC0wNi0zMFQwMzo0MjoxNS4yMzBaIiwiaWF0IjoxNTMwMzMwMTM1fQ.' + - 'SSsX2Byyo1B1bGxV8C3G4QldhE5iH87EY_1r21-bwbI' - ) - .expect(200); - - const configurationBlocks = apiResponse.list; - - expect(configurationBlocks).to.be.an(Array); - expect(configurationBlocks.length).to.be(0); - }); - - it('should return merged configuration for the beat', async () => { - const { body: apiResponse } = await supertest - .get('/api/beats/agent/foo/configuration') - .set( - 'kbn-beats-access-token', - 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.' + - 'eyJjcmVhdGVkIjoiMjAxOC0wNi0zMFQwMzo0MjoxNS4yMzBaIiwiaWF0IjoxNTMwMzMwMTM1fQ.' + - 'SSsX2Byyo1B1bGxV8C3G4QldhE5iH87EY_1r21-bwbI' - ) - .expect(200); - - const configurationBlocks = apiResponse.list; - - expect(configurationBlocks).to.be.an(Array); - expect(configurationBlocks.length).to.be(3); - - expect(configurationBlocks[1].type).to.be('metricbeat.modules'); - expect(configurationBlocks[1].config).to.eql({ - module: 'memcached', - hosts: ['localhost:11211'], - }); - - expect(configurationBlocks[2].type).to.be('metricbeat.modules'); - expect(configurationBlocks[2].config).to.eql({ - module: 'memcached', - hosts: ['localhost:4949'], - 'node.namespace': 'node', - }); - }); - }); -} diff --git a/x-pack/test/api_integration/apis/beats/index.js b/x-pack/test/api_integration/apis/beats/index.js deleted file mode 100644 index b490ddd24da388..00000000000000 --- a/x-pack/test/api_integration/apis/beats/index.js +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { ES_INDEX_NAME } from './constants'; - -export default function ({ getService, loadTestFile }) { - const es = getService('legacyEs'); - - describe('beats', () => { - const cleanup = () => - es.indices.delete({ - index: ES_INDEX_NAME, - ignore: [404], - }); - - beforeEach(cleanup); - - loadTestFile(require.resolve('./create_enrollment_tokens')); - loadTestFile(require.resolve('./enroll_beat')); - loadTestFile(require.resolve('./list_beats')); - loadTestFile(require.resolve('./update_beat')); - loadTestFile(require.resolve('./set_tag')); - loadTestFile(require.resolve('./assign_tags_to_beats')); - loadTestFile(require.resolve('./remove_tags_from_beats')); - loadTestFile(require.resolve('./get_beat')); - }); -} diff --git a/x-pack/test/api_integration/apis/beats/list_beats.js b/x-pack/test/api_integration/apis/beats/list_beats.js deleted file mode 100644 index a844b814f7ca8c..00000000000000 --- a/x-pack/test/api_integration/apis/beats/list_beats.js +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import expect from '@kbn/expect'; - -export default function ({ getService }) { - const supertest = getService('supertest'); - const esArchiver = getService('esArchiver'); - - describe('list_beats', () => { - const archive = 'beats/list'; - - beforeEach('load beats archive', () => esArchiver.load(archive)); - afterEach('unload beats archive', () => esArchiver.unload(archive)); - - it('should return all beats', async () => { - const { body: apiResponse } = await supertest.get('/api/beats/agents').expect(200); - - const beatsFromApi = apiResponse.list; - - expect(beatsFromApi.length).to.be(4); - expect(beatsFromApi.filter((beat) => beat.hasOwnProperty('verified_on')).length).to.be(1); - expect(beatsFromApi.find((beat) => beat.hasOwnProperty('verified_on')).id).to.be('foo'); - }); - - it('should not return access tokens', async () => { - const { body: apiResponse } = await supertest.get('/api/beats/agents').expect(200); - - const beatsFromApi = apiResponse.list; - - expect(beatsFromApi.length).to.be(4); - expect(beatsFromApi.filter((beat) => beat.hasOwnProperty('access_token')).length).to.be(0); - }); - }); -} diff --git a/x-pack/test/api_integration/apis/beats/remove_tags_from_beats.js b/x-pack/test/api_integration/apis/beats/remove_tags_from_beats.js deleted file mode 100644 index 1c9ce2ffb7d484..00000000000000 --- a/x-pack/test/api_integration/apis/beats/remove_tags_from_beats.js +++ /dev/null @@ -1,218 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import expect from '@kbn/expect'; -import { ES_INDEX_NAME } from './constants'; - -export default function ({ getService }) { - const supertest = getService('supertest'); - const esArchiver = getService('esArchiver'); - const es = getService('legacyEs'); - const randomness = getService('randomness'); - - describe('remove_tags_from_beats', () => { - const archive = 'beats/list'; - - beforeEach('load beats archive', () => esArchiver.load(archive)); - afterEach('unload beats archive', () => esArchiver.unload(archive)); - - it('should remove a single tag from a single beat', async () => { - const { body: apiResponse } = await supertest - .post('/api/beats/agents_tags/removals') - .set('kbn-xsrf', 'xxx') - .send({ - removals: [{ beatId: 'foo', tag: 'production' }], - }) - .expect(200); - - expect(apiResponse.results).to.eql([{ success: true, result: { message: 'updated' } }]); - - const esResponse = await es.get({ - index: ES_INDEX_NAME, - id: `beat:foo`, - }); - - const beat = esResponse._source.beat; - expect(beat.tags).to.eql(['qa']); - }); - - it('should remove a single tag from a multiple beats', async () => { - const { body: apiResponse } = await supertest - .post('/api/beats/agents_tags/removals') - .set('kbn-xsrf', 'xxx') - .send({ - removals: [ - { beatId: 'foo', tag: 'development' }, - { beatId: 'bar', tag: 'development' }, - ], - }) - .expect(200); - - expect(apiResponse.results).to.eql([ - { success: true, result: { message: 'updated' } }, - { success: true, result: { message: 'updated' } }, - ]); - - let esResponse; - let beat; - - // Beat foo - esResponse = await es.get({ - index: ES_INDEX_NAME, - id: `beat:foo`, - }); - - beat = esResponse._source.beat; - expect(beat.tags).to.eql(['production', 'qa']); // as beat 'foo' already had 'production' and 'qa' tags attached to it - - // Beat bar - esResponse = await es.get({ - index: ES_INDEX_NAME, - id: `beat:bar`, - }); - - beat = esResponse._source.beat; - expect(beat).to.not.have.property('tags'); - }); - - it('should remove multiple tags from a single beat', async () => { - const { body: apiResponse } = await supertest - .post('/api/beats/agents_tags/removals') - .set('kbn-xsrf', 'xxx') - .send({ - removals: [ - { beatId: 'foo', tag: 'development' }, - { beatId: 'foo', tag: 'production' }, - ], - }) - .expect(200); - - expect(apiResponse.results).to.eql([ - { success: true, result: { message: 'updated' } }, - { success: true, result: { message: 'updated' } }, - ]); - - const esResponse = await es.get({ - index: ES_INDEX_NAME, - id: `beat:foo`, - }); - - const beat = esResponse._source.beat; - expect(beat.tags).to.eql(['qa']); // as beat 'foo' already had 'production' and 'qa' tags attached to it - }); - - it('should remove multiple tags from a multiple beats', async () => { - const { body: apiResponse } = await supertest - .post('/api/beats/agents_tags/removals') - .set('kbn-xsrf', 'xxx') - .send({ - removals: [ - { beatId: 'foo', tag: 'production' }, - { beatId: 'bar', tag: 'development' }, - ], - }) - .expect(200); - - expect(apiResponse.results).to.eql([ - { success: true, result: { message: 'updated' } }, - { success: true, result: { message: 'updated' } }, - ]); - - let esResponse; - let beat; - - // Beat foo - esResponse = await es.get({ - index: ES_INDEX_NAME, - id: `beat:foo`, - }); - - beat = esResponse._source.beat; - expect(beat.tags).to.eql(['qa']); // as beat 'foo' already had 'production' and 'qa' tags attached to it - - // Beat bar - esResponse = await es.get({ - index: ES_INDEX_NAME, - id: `beat:bar`, - }); - - beat = esResponse._source.beat; - expect(beat).to.not.have.property('tags'); - }); - - it('should return errors for non-existent beats', async () => { - const nonExistentBeatId = randomness.word(); - - const { body: apiResponse } = await supertest - .post('/api/beats/agents_tags/removals') - .set('kbn-xsrf', 'xxx') - .send({ - removals: [{ beatId: nonExistentBeatId, tag: 'production' }], - }) - .expect(200); - - expect(apiResponse.results).to.eql([ - { success: false, error: { code: 404, message: `Beat ${nonExistentBeatId} not found` } }, - ]); - }); - - it('should return errors for non-existent tags', async () => { - const nonExistentTag = randomness.word(); - - const { body: apiResponse } = await supertest - .post('/api/beats/agents_tags/removals') - .set('kbn-xsrf', 'xxx') - .send({ - removals: [{ beatId: 'bar', tag: nonExistentTag }], - }) - .expect(200); - - expect(apiResponse.results).to.eql([ - { success: false, error: { code: 404, message: `Tag ${nonExistentTag} not found` } }, - ]); - - const esResponse = await es.get({ - index: ES_INDEX_NAME, - id: `beat:bar`, - }); - - const beat = esResponse._source.beat; - expect(beat).to.not.have.property('tags'); - }); - - it('should return errors for non-existent beats and tags', async () => { - const nonExistentBeatId = randomness.word(); - const nonExistentTag = randomness.word(); - - const { body: apiResponse } = await supertest - .post('/api/beats/agents_tags/removals') - .set('kbn-xsrf', 'xxx') - .send({ - removals: [{ beatId: nonExistentBeatId, tag: nonExistentTag }], - }) - .expect(200); - - expect(apiResponse.results).to.eql([ - { - success: false, - error: { - code: 404, - message: `Beat ${nonExistentBeatId} and tag ${nonExistentTag} not found`, - }, - }, - ]); - - const esResponse = await es.get({ - index: ES_INDEX_NAME, - id: `beat:bar`, - }); - - const beat = esResponse._source.beat; - expect(beat).to.not.have.property('tags'); - }); - }); -} diff --git a/x-pack/test/api_integration/apis/beats/set_config.js b/x-pack/test/api_integration/apis/beats/set_config.js deleted file mode 100644 index fbc3db30313bfb..00000000000000 --- a/x-pack/test/api_integration/apis/beats/set_config.js +++ /dev/null @@ -1,246 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import expect from '@kbn/expect'; -import { ES_INDEX_NAME } from './constants'; - -export default function ({ getService }) { - const supertest = getService('supertest'); - const es = getService('legacyEs'); - const esArchiver = getService('esArchiver'); - - describe('set_config', () => { - const archive = 'beats/list'; - - beforeEach('load archive', () => esArchiver.load(archive)); - afterEach('unload archive', () => esArchiver.unload(archive)); - - it('should create a configuration block', async () => { - const tagId = 'qa'; - await supertest - .put(`/api/beats/configurations`) - .set('kbn-xsrf', 'xxx') - .send([ - { - type: 'output', - description: 'smething', - config: { elasticsearch: { hosts: ['localhost:9200'], username: 'foo' } }, - }, - ]) - .expect(200); - const esResponse = await es.get({ - index: ES_INDEX_NAME, - id: `tag:${tagId}`, - }); - - const tagInEs = esResponse._source; - - expect(tagInEs.type).to.be('tag'); - expect(tagInEs.tag.id).to.be(tagId); - expect(tagInEs.tag.configuration_blocks).to.be.an(Array); - expect(tagInEs.tag.configuration_blocks.length).to.be(1); - expect(tagInEs.tag.configuration_blocks[0].type).to.be('output'); - expect(tagInEs.tag.configuration_blocks[0].configs).to.eql([ - { - elasticsearch: { - hosts: ['localhost:9200'], - username: 'foo', - }, - }, - ]); - }); - - // it('should create a tag with two configuration blocks', async () => { - // const tagId = 'production'; - // await supertest - // .put(`/api/beats/tag/${tagId}`) - // .set('kbn-xsrf', 'xxx') - // .send({ - // configuration_blocks: [ - // { - // type: 'filebeat.inputs', - // configs: [ - // { - // paths: ['./foo'], - // }, - // ], - // }, - // { - // type: 'output', - // configs: [ - // { - // elasticsearch: { - // hosts: ['localhost:9200'], - // username: 'foo', - // }, - // }, - // ], - // }, - // ], - // }) - // .expect(201); - - // const esResponse = await es.get({ - // index: ES_INDEX_NAME, - // type: ES_TYPE_NAME, - // id: `tag:${tagId}`, - // }); - - // const tagInEs = esResponse._source; - - // expect(tagInEs.type).to.be('tag'); - // expect(tagInEs.tag.id).to.be(tagId); - // expect(tagInEs.tag.configuration_blocks).to.be.an(Array); - // expect(tagInEs.tag.configuration_blocks.length).to.be(2); - // expect(tagInEs.tag.configuration_blocks[0].type).to.be('filebeat.inputs'); - // expect(tagInEs.tag.configuration_blocks[0].configs).to.eql([ - // { - // paths: ['./foo'], - // }, - // ]); - // expect(tagInEs.tag.configuration_blocks[1].type).to.be('output'); - // expect(tagInEs.tag.configuration_blocks[1].configs).to.eql([ - // { - // elasticsearch: { - // hosts: ['localhost:9200'], - // username: 'foo', - // }, - // }, - // ]); - // }); - - // it('should fail when creating a tag with two configuration blocks of type output', async () => { - // const tagId = 'production'; - // await supertest - // .put(`/api/beats/tag/${tagId}`) - // .set('kbn-xsrf', 'xxx') - // .send({ - // configuration_blocks: [ - // { - // type: 'output', - // configs: [ - // { - // elasticsearch: { - // hosts: ['localhost:9200'], - // username: 'foo', - // }, - // }, - // ], - // }, - // { - // type: 'output', - // configs: [ - // { - // elasticsearch: { - // hosts: ['localhost:9200'], - // username: 'foo', - // }, - // }, - // ], - // }, - // ], - // }) - // .expect(400); - // }); - - // it('should fail when creating a tag with an invalid configuration block type', async () => { - // const tagId = 'production'; - // await supertest - // .put(`/api/beats/tag/${tagId}`) - // .set('kbn-xsrf', 'xxx') - // .send({ - // configuration_blocks: [ - // { - // type: chance.word(), - // configs: [ - // { - // elasticsearch: { - // hosts: ['localhost:9200'], - // username: 'foo', - // }, - // }, - // ], - // }, - // ], - // }) - // .expect(400); - // }); - - // it('should update an existing tag', async () => { - // const tagId = 'production'; - // await supertest - // .put(`/api/beats/tag/${tagId}`) - // .set('kbn-xsrf', 'xxx') - // .send({ - // configuration_blocks: [ - // { - // type: 'filebeat.inputs', - // configs: [ - // { - // paths: ['./test'], - // }, - // ], - // }, - // { - // type: 'output', - // configs: [ - // { - // elasticsearch: { - // hosts: ['localhost:9200'], - // username: 'foo', - // }, - // }, - // ], - // }, - // ], - // }) - // .expect(201); - - // await supertest - // .put(`/api/beats/tag/${tagId}`) - // .set('kbn-xsrf', 'xxx') - // .send({ - // configuration_blocks: [ - // { - // type: 'output', - // configs: [ - // { - // elasticsearch: { - // hosts: ['localhost:9000'], - // username: 'foo', - // }, - // }, - // ], - // }, - // ], - // }) - // .expect(200); - - // const esResponse = await es.get({ - // index: ES_INDEX_NAME, - // type: ES_TYPE_NAME, - // id: `tag:${tagId}`, - // }); - - // const tagInEs = esResponse._source; - - // expect(tagInEs.type).to.be('tag'); - // expect(tagInEs.tag.id).to.be(tagId); - // expect(tagInEs.tag.configuration_blocks).to.be.an(Array); - // expect(tagInEs.tag.configuration_blocks.length).to.be(1); - // expect(tagInEs.tag.configuration_blocks[0].type).to.be('output'); - // expect(tagInEs.tag.configuration_blocks[0].configs).to.eql([ - // { - // elasticsearch: { - // hosts: ['localhost:9000'], - // username: 'foo', - // }, - // }, - // ]); - // }); - }); -} diff --git a/x-pack/test/api_integration/apis/beats/set_tag.js b/x-pack/test/api_integration/apis/beats/set_tag.js deleted file mode 100644 index 742fe9db251bde..00000000000000 --- a/x-pack/test/api_integration/apis/beats/set_tag.js +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import expect from '@kbn/expect'; -import { ES_INDEX_NAME } from './constants'; - -export default function ({ getService }) { - const supertest = getService('supertest'); - const es = getService('legacyEs'); - - describe('set_tag', () => { - it('should create a tag', async () => { - const tagId = 'production'; - await supertest - .put(`/api/beats/tag/${tagId}`) - .set('kbn-xsrf', 'xxx') - .send({ - color: 'green', - }) - .expect(200); - - const esResponse = await es.get({ - index: ES_INDEX_NAME, - id: `tag:${tagId}`, - }); - - const tagInEs = esResponse._source; - - expect(tagInEs.type).to.be('tag'); - expect(tagInEs.tag.id).to.be(tagId); - }); - - it('should update an existing tag', async () => { - const tagId = 'production'; - await supertest - .put(`/api/beats/tag/${tagId}`) - .set('kbn-xsrf', 'xxx') - .send({ - color: 'blue', - }) - .expect(200); - - await supertest - .put(`/api/beats/tag/${tagId}`) - .set('kbn-xsrf', 'xxx') - .send({ - color: 'yellow', - }) - .expect(200); - - const esResponse = await es.get({ - index: ES_INDEX_NAME, - id: `tag:${tagId}`, - }); - - const tagInEs = esResponse._source; - - expect(tagInEs.type).to.be('tag'); - expect(tagInEs.tag.id).to.be(tagId); - expect(tagInEs.tag.color).to.be('yellow'); - }); - }); -} diff --git a/x-pack/test/api_integration/apis/beats/update_beat.js b/x-pack/test/api_integration/apis/beats/update_beat.js deleted file mode 100644 index 8c67f43839fcc7..00000000000000 --- a/x-pack/test/api_integration/apis/beats/update_beat.js +++ /dev/null @@ -1,122 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import expect from '@kbn/expect'; -import { ES_INDEX_NAME } from './constants'; -import moment from 'moment'; - -export default function ({ getService }) { - const supertest = getService('supertest'); - const randomness = getService('randomness'); - const es = getService('legacyEs'); - const esArchiver = getService('esArchiver'); - - describe('update_beat', () => { - let validEnrollmentToken; - let beat; - const archive = 'beats/list'; - - beforeEach('load beats archive', () => esArchiver.load(archive)); - beforeEach(async () => { - validEnrollmentToken = - 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.' + - 'eyJjcmVhdGVkIjoiMjAxOC0wNi0zMFQwMzo0MjoxNS4yMzBaIiwiaWF0IjoxNTMwMzMwMTM1fQ.' + - 'SSsX2Byyo1B1bGxV8C3G4QldhE5iH87EY_1r21-bwbI'; - - const version = - randomness.integer({ min: 1, max: 10 }) + - '.' + - randomness.integer({ min: 1, max: 10 }) + - '.' + - randomness.integer({ min: 1, max: 10 }); - - beat = { - type: `${randomness.word()}beat`, - host_name: `www.${randomness.word()}.net`, - name: randomness.word(), - version, - ephemeral_id: randomness.word(), - }; - - await es.index({ - index: ES_INDEX_NAME, - id: `enrollment_token:${validEnrollmentToken}`, - body: { - type: 'enrollment_token', - enrollment_token: { - token: validEnrollmentToken, - expires_on: moment().add(4, 'hours').toJSON(), - }, - }, - }); - }); - - afterEach('unload beats archive', () => esArchiver.unload(archive)); - - it('should update an existing verified beat', async () => { - const beatId = 'foo'; - await supertest - .put(`/api/beats/agent/${beatId}`) - .set('kbn-xsrf', 'xxx') - .set( - 'kbn-beats-access-token', - 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.' + - 'eyJjcmVhdGVkIjoiMjAxOC0wNi0zMFQwMzo0MjoxNS4yMzBaIiwiaWF0IjoxNTMwMzMwMTM1fQ.' + - 'SSsX2Byyo1B1bGxV8C3G4QldhE5iH87EY_1r21-bwbI' - ) - .send(beat) - .expect(200); - - const beatInEs = await es.get({ - index: ES_INDEX_NAME, - id: `beat:${beatId}`, - }); - - expect(beatInEs._source.beat.id).to.be(beatId); - expect(beatInEs._source.beat.type).to.be(beat.type); - expect(beatInEs._source.beat.host_name).to.be(beat.host_name); - expect(beatInEs._source.beat.version).to.be(beat.version); - expect(beatInEs._source.beat.ephemeral_id).to.be(beat.ephemeral_id); - expect(beatInEs._source.beat.name).to.be(beat.name); - }); - - it('should return an error for an invalid access token', async () => { - const beatId = 'foo'; - const { body } = await supertest - .put(`/api/beats/agent/${beatId}`) - .set('kbn-xsrf', 'xxx') - .set('kbn-beats-access-token', randomness.word()) - .send(beat) - .expect(401); - - expect(body.message).to.be('Invalid access token'); - - const beatInEs = await es.get({ - index: ES_INDEX_NAME, - id: `beat:${beatId}`, - }); - - expect(beatInEs._source.beat.id).to.be(beatId); - expect(beatInEs._source.beat.type).to.not.be(beat.type); - expect(beatInEs._source.beat.host_name).to.not.be(beat.host_name); - expect(beatInEs._source.beat.version).to.not.be(beat.version); - expect(beatInEs._source.beat.ephemeral_id).to.not.be(beat.ephemeral_id); - }); - - it('should return an error for a non-existent beat', async () => { - const beatId = randomness.word(); - const { body } = await supertest - .put(`/api/beats/agent/${beatId}`) - .set('kbn-xsrf', 'xxx') - .set('kbn-beats-access-token', validEnrollmentToken) - .send(beat) - .expect(404); - - expect(body.message).to.be('Beat not found'); - }); - }); -} diff --git a/x-pack/test/api_integration/apis/index.ts b/x-pack/test/api_integration/apis/index.ts index e0328444701777..0d345db58d24f7 100644 --- a/x-pack/test/api_integration/apis/index.ts +++ b/x-pack/test/api_integration/apis/index.ts @@ -22,7 +22,6 @@ export default function ({ loadTestFile }: FtrProviderContext) { loadTestFile(require.resolve('./logstash')); loadTestFile(require.resolve('./kibana')); loadTestFile(require.resolve('./metrics_ui')); - loadTestFile(require.resolve('./beats')); loadTestFile(require.resolve('./console')); loadTestFile(require.resolve('./management')); loadTestFile(require.resolve('./uptime')); diff --git a/x-pack/test/tsconfig.json b/x-pack/test/tsconfig.json index 63a9f8998a99db..7c95a53b75ee78 100644 --- a/x-pack/test/tsconfig.json +++ b/x-pack/test/tsconfig.json @@ -41,7 +41,6 @@ { "path": "../plugins/alerting/tsconfig.json" }, { "path": "../plugins/apm/tsconfig.json" }, { "path": "../plugins/banners/tsconfig.json" }, - { "path": "../plugins/beats_management/tsconfig.json" }, { "path": "../plugins/cases/tsconfig.json" }, { "path": "../plugins/cloud/tsconfig.json" }, { "path": "../plugins/console_extensions/tsconfig.json" }, From 77452e686be6a3b202e3a9e7bcf0fe0174a07ee9 Mon Sep 17 00:00:00 2001 From: Spencer Date: Thu, 27 May 2021 04:16:02 -0700 Subject: [PATCH 16/16] [ftr] migrate "comboBox" service to FtrService class (#100592) Co-authored-by: spalger --- test/functional/services/combo_box.ts | 518 +++++++++++++------------- test/functional/services/index.ts | 4 +- 2 files changed, 261 insertions(+), 261 deletions(-) diff --git a/test/functional/services/combo_box.ts b/test/functional/services/combo_box.ts index 4615a7378415cf..a198aec1d16960 100644 --- a/test/functional/services/combo_box.ts +++ b/test/functional/services/combo_box.ts @@ -6,301 +6,301 @@ * Side Public License, v 1. */ -import { FtrProviderContext } from '../ftr_provider_context'; +import { FtrService } from '../ftr_provider_context'; import { WebElementWrapper } from './lib/web_element_wrapper'; // @ts-ignore not supported yet import { scrollIntoViewIfNecessary } from './lib/web_element_wrapper/scroll_into_view_if_necessary'; -export function ComboBoxProvider({ getService, getPageObjects }: FtrProviderContext) { - const config = getService('config'); - const testSubjects = getService('testSubjects'); - const find = getService('find'); - const log = getService('log'); - const retry = getService('retry'); - const browser = getService('browser'); - const PageObjects = getPageObjects(['common']); +/** + * wrapper around EuiComboBox interactions + */ +export class ComboBoxService extends FtrService { + private readonly config = this.ctx.getService('config'); + private readonly testSubjects = this.ctx.getService('testSubjects'); + private readonly find = this.ctx.getService('find'); + private readonly log = this.ctx.getService('log'); + private readonly retry = this.ctx.getService('retry'); + private readonly browser = this.ctx.getService('browser'); + private readonly PageObjects = this.ctx.getPageObjects(['common']); - const WAIT_FOR_EXISTS_TIME: number = config.get('timeouts.waitForExists'); + private readonly WAIT_FOR_EXISTS_TIME: number = this.config.get('timeouts.waitForExists'); - // wrapper around EuiComboBox interactions - class ComboBox { - /** - * Finds combobox element and sets specified value - * - * @param comboBoxSelector data-test-subj selector - * @param value option text - */ + /** + * Finds combobox element and sets specified value + * + * @param comboBoxSelector data-test-subj selector + * @param value option text + */ - public async set(comboBoxSelector: string, value: string): Promise { - log.debug(`comboBox.set, comboBoxSelector: ${comboBoxSelector}`); - const comboBox = await testSubjects.find(comboBoxSelector); - await this.setElement(comboBox, value); - } + public async set(comboBoxSelector: string, value: string): Promise { + this.log.debug(`comboBox.set, comboBoxSelector: ${comboBoxSelector}`); + const comboBox = await this.testSubjects.find(comboBoxSelector); + await this.setElement(comboBox, value); + } - /** - * Clicks option in combobox dropdown - * - * @param isMouseClick if 'true', click will be done with mouse - * @param element element that wraps up option - */ - private async clickOption(isMouseClick: boolean, element: WebElementWrapper): Promise { - // element.click causes scrollIntoView which causes combobox to close, using _webElement.click instead - return isMouseClick ? await element.clickMouseButton() : await element._webElement.click(); - } + /** + * Clicks option in combobox dropdown + * + * @param isMouseClick if 'true', click will be done with mouse + * @param element element that wraps up option + */ + private async clickOption(isMouseClick: boolean, element: WebElementWrapper): Promise { + // element.click causes scrollIntoView which causes combobox to close, using _webElement.click instead + return isMouseClick ? await element.clickMouseButton() : await element._webElement.click(); + } - /** - * Finds combobox element options - * - * @param comboBoxSelector data-test-subj selector - */ - public async getOptions(comboBoxSelector: string) { - const comboBoxElement = await testSubjects.find(comboBoxSelector); - await this.openOptionsList(comboBoxElement); - return await find.allByCssSelector('.euiFilterSelectItem', WAIT_FOR_EXISTS_TIME); - } + /** + * Finds combobox element options + * + * @param comboBoxSelector data-test-subj selector + */ + public async getOptions(comboBoxSelector: string) { + const comboBoxElement = await this.testSubjects.find(comboBoxSelector); + await this.openOptionsList(comboBoxElement); + return await this.find.allByCssSelector('.euiFilterSelectItem', this.WAIT_FOR_EXISTS_TIME); + } - /** - * Sets value for specified combobox element - * - * @param comboBoxElement element that wraps up EuiComboBox - * @param value - */ - public async setElement( - comboBoxElement: WebElementWrapper, - value: string, - options = { clickWithMouse: false } - ): Promise { - log.debug(`comboBox.setElement, value: ${value}`); - const isOptionSelected = await this.isOptionSelected(comboBoxElement, value); + /** + * Sets value for specified combobox element + * + * @param comboBoxElement element that wraps up EuiComboBox + * @param value + */ + public async setElement( + comboBoxElement: WebElementWrapper, + value: string, + options = { clickWithMouse: false } + ): Promise { + this.log.debug(`comboBox.setElement, value: ${value}`); + const isOptionSelected = await this.isOptionSelected(comboBoxElement, value); - if (isOptionSelected) { - return; - } + if (isOptionSelected) { + return; + } - await comboBoxElement.scrollIntoViewIfNecessary(); - await this.setFilterValue(comboBoxElement, value); - await this.openOptionsList(comboBoxElement); + await comboBoxElement.scrollIntoViewIfNecessary(); + await this.setFilterValue(comboBoxElement, value); + await this.openOptionsList(comboBoxElement); - if (value !== undefined) { - const selectOptions = await find.allByCssSelector( - `.euiFilterSelectItem[title^="${value.toString().trim()}"]`, - WAIT_FOR_EXISTS_TIME - ); + if (value !== undefined) { + const selectOptions = await this.find.allByCssSelector( + `.euiFilterSelectItem[title^="${value.toString().trim()}"]`, + this.WAIT_FOR_EXISTS_TIME + ); - if (selectOptions.length > 0) { - await this.clickOption(options.clickWithMouse, selectOptions[0]); - } else { - // if it doesn't find the item which text starts with value, it will choose the first option - const firstOption = await find.byCssSelector('.euiFilterSelectItem', 5000); - await this.clickOption(options.clickWithMouse, firstOption); - } + if (selectOptions.length > 0) { + await this.clickOption(options.clickWithMouse, selectOptions[0]); } else { - const firstOption = await find.byCssSelector('.euiFilterSelectItem'); + // if it doesn't find the item which text starts with value, it will choose the first option + const firstOption = await this.find.byCssSelector('.euiFilterSelectItem', 5000); await this.clickOption(options.clickWithMouse, firstOption); } - await this.closeOptionsList(comboBoxElement); - } - - /** - * Finds combobox element and sets custom value - * It applies changes by pressing Enter key. Sometimes it may lead to auto-submitting a form. - * - * @param comboBoxSelector data-test-subj selector - * @param value option text - */ - public async setCustom(comboBoxSelector: string, value: string): Promise { - log.debug(`comboBox.setCustom, comboBoxSelector: ${comboBoxSelector}, value: ${value}`); - const comboBoxElement = await testSubjects.find(comboBoxSelector); - await this.setFilterValue(comboBoxElement, value); - await PageObjects.common.pressEnterKey(); - await this.closeOptionsList(comboBoxElement); + } else { + const firstOption = await this.find.byCssSelector('.euiFilterSelectItem'); + await this.clickOption(options.clickWithMouse, firstOption); } + await this.closeOptionsList(comboBoxElement); + } - /** - * Finds combobox element and sets filter value - * - * @param comboBoxSelector data-test-subj selector - * @param filterValue text - */ - public async filterOptionsList(comboBoxSelector: string, filterValue: string): Promise { - log.debug( - `comboBox.filterOptionsList, comboBoxSelector: ${comboBoxSelector}, filter: ${filterValue}` - ); - const comboBox = await testSubjects.find(comboBoxSelector); - await this.setFilterValue(comboBox, filterValue); - await this.closeOptionsList(comboBox); - } + /** + * Finds combobox element and sets custom value + * It applies changes by pressing Enter key. Sometimes it may lead to auto-submitting a form. + * + * @param comboBoxSelector data-test-subj selector + * @param value option text + */ + public async setCustom(comboBoxSelector: string, value: string): Promise { + this.log.debug(`comboBox.setCustom, comboBoxSelector: ${comboBoxSelector}, value: ${value}`); + const comboBoxElement = await this.testSubjects.find(comboBoxSelector); + await this.setFilterValue(comboBoxElement, value); + await this.PageObjects.common.pressEnterKey(); + await this.closeOptionsList(comboBoxElement); + } - /** - * Sets new filter value in specified combobox element - * - * @param comboBoxElement element that wraps up EuiComboBox - * @param filterValue text - */ - private async setFilterValue( - comboBoxElement: WebElementWrapper, - filterValue: string - ): Promise { - const input = await comboBoxElement.findByTagName('input'); - await input.clearValue(); - await this.waitForOptionsListLoading(comboBoxElement); - await input.type(filterValue); - await this.waitForOptionsListLoading(comboBoxElement); - } + /** + * Finds combobox element and sets filter value + * + * @param comboBoxSelector data-test-subj selector + * @param filterValue text + */ + public async filterOptionsList(comboBoxSelector: string, filterValue: string): Promise { + this.log.debug( + `comboBox.filterOptionsList, comboBoxSelector: ${comboBoxSelector}, filter: ${filterValue}` + ); + const comboBox = await this.testSubjects.find(comboBoxSelector); + await this.setFilterValue(comboBox, filterValue); + await this.closeOptionsList(comboBox); + } - /** - * Waits options list to be loaded - * - * @param comboBoxElement element that wraps up EuiComboBox - */ - private async waitForOptionsListLoading(comboBoxElement: WebElementWrapper): Promise { - await comboBoxElement.waitForDeletedByCssSelector('.euiLoadingSpinner'); - } + /** + * Sets new filter value in specified combobox element + * + * @param comboBoxElement element that wraps up EuiComboBox + * @param filterValue text + */ + private async setFilterValue( + comboBoxElement: WebElementWrapper, + filterValue: string + ): Promise { + const input = await comboBoxElement.findByTagName('input'); + await input.clearValue(); + await this.waitForOptionsListLoading(comboBoxElement); + await input.type(filterValue); + await this.waitForOptionsListLoading(comboBoxElement); + } - /** - * Returns options list as a single string - * - * @param comboBoxSelector data-test-subj selector - */ - public async getOptionsList(comboBoxSelector: string): Promise { - log.debug(`comboBox.getOptionsList, comboBoxSelector: ${comboBoxSelector}`); - const comboBox = await testSubjects.find(comboBoxSelector); - const menu = await retry.try(async () => { - await testSubjects.click(comboBoxSelector); - await this.waitForOptionsListLoading(comboBox); - const isOptionsListOpen = await testSubjects.exists('~comboBoxOptionsList'); - if (!isOptionsListOpen) { - throw new Error('Combo box options list did not open on click'); - } - return await testSubjects.find('~comboBoxOptionsList'); - }); - const optionsText = await menu.getVisibleText(); - await this.closeOptionsList(comboBox); - return optionsText; - } + /** + * Waits options list to be loaded + * + * @param comboBoxElement element that wraps up EuiComboBox + */ + private async waitForOptionsListLoading(comboBoxElement: WebElementWrapper): Promise { + await comboBoxElement.waitForDeletedByCssSelector('.euiLoadingSpinner'); + } - /** - * Finds combobox element and checks if it has selected options - * - * @param comboBoxSelector data-test-subj selector - */ - public async doesComboBoxHaveSelectedOptions(comboBoxSelector: string): Promise { - log.debug(`comboBox.doesComboBoxHaveSelectedOptions, comboBoxSelector: ${comboBoxSelector}`); - const comboBox = await testSubjects.find(comboBoxSelector); - const $ = await comboBox.parseDomContent(); - return $('.euiComboBoxPill').toArray().length > 0; - } + /** + * Returns options list as a single string + * + * @param comboBoxSelector data-test-subj selector + */ + public async getOptionsList(comboBoxSelector: string): Promise { + this.log.debug(`comboBox.getOptionsList, comboBoxSelector: ${comboBoxSelector}`); + const comboBox = await this.testSubjects.find(comboBoxSelector); + const menu = await this.retry.try(async () => { + await this.testSubjects.click(comboBoxSelector); + await this.waitForOptionsListLoading(comboBox); + const isOptionsListOpen = await this.testSubjects.exists('~comboBoxOptionsList'); + if (!isOptionsListOpen) { + throw new Error('Combo box options list did not open on click'); + } + return await this.testSubjects.find('~comboBoxOptionsList'); + }); + const optionsText = await menu.getVisibleText(); + await this.closeOptionsList(comboBox); + return optionsText; + } - /** - * Returns selected options - * @param comboBoxSelector data-test-subj selector - */ - public async getComboBoxSelectedOptions(comboBoxSelector: string): Promise { - log.debug(`comboBox.getComboBoxSelectedOptions, comboBoxSelector: ${comboBoxSelector}`); - const comboBox = await testSubjects.find(comboBoxSelector); - const $ = await comboBox.parseDomContent(); - return $('.euiComboBoxPill') - .toArray() - .map((option) => $(option).text()); - } + /** + * Finds combobox element and checks if it has selected options + * + * @param comboBoxSelector data-test-subj selector + */ + public async doesComboBoxHaveSelectedOptions(comboBoxSelector: string): Promise { + this.log.debug( + `comboBox.doesComboBoxHaveSelectedOptions, comboBoxSelector: ${comboBoxSelector}` + ); + const comboBox = await this.testSubjects.find(comboBoxSelector); + const $ = await comboBox.parseDomContent(); + return $('.euiComboBoxPill').toArray().length > 0; + } - /** - * Finds combobox element and clears value in the input field by clicking clear button - * - * @param comboBoxSelector data-test-subj selector - */ - public async clear(comboBoxSelector: string): Promise { - log.debug(`comboBox.clear, comboBoxSelector:${comboBoxSelector}`); - const comboBox = await testSubjects.find(comboBoxSelector); - await retry.try(async () => { - const clearButtonExists = await this.doesClearButtonExist(comboBox); - if (!clearButtonExists) { - log.debug('Unable to clear comboBox, comboBoxClearButton does not exist'); - return; - } + /** + * Returns selected options + * @param comboBoxSelector data-test-subj selector + */ + public async getComboBoxSelectedOptions(comboBoxSelector: string): Promise { + this.log.debug(`comboBox.getComboBoxSelectedOptions, comboBoxSelector: ${comboBoxSelector}`); + const comboBox = await this.testSubjects.find(comboBoxSelector); + const $ = await comboBox.parseDomContent(); + return $('.euiComboBoxPill') + .toArray() + .map((option) => $(option).text()); + } - const clearBtn = await comboBox.findByTestSubject('comboBoxClearButton'); - await clearBtn.click(); + /** + * Finds combobox element and clears value in the input field by clicking clear button + * + * @param comboBoxSelector data-test-subj selector + */ + public async clear(comboBoxSelector: string): Promise { + this.log.debug(`comboBox.clear, comboBoxSelector:${comboBoxSelector}`); + const comboBox = await this.testSubjects.find(comboBoxSelector); + await this.retry.try(async () => { + const clearButtonExists = await this.doesClearButtonExist(comboBox); + if (!clearButtonExists) { + this.log.debug('Unable to clear comboBox, comboBoxClearButton does not exist'); + return; + } - const clearButtonStillExists = await this.doesClearButtonExist(comboBox); - if (clearButtonStillExists) { - throw new Error('Failed to clear comboBox'); - } - }); - await this.closeOptionsList(comboBox); - } + const clearBtn = await comboBox.findByTestSubject('comboBoxClearButton'); + await clearBtn.click(); - public async doesClearButtonExist(comboBoxElement: WebElementWrapper): Promise { - const found = await comboBoxElement.findAllByTestSubject( - 'comboBoxClearButton', - WAIT_FOR_EXISTS_TIME - ); - return found.length > 0; - } + const clearButtonStillExists = await this.doesClearButtonExist(comboBox); + if (clearButtonStillExists) { + throw new Error('Failed to clear comboBox'); + } + }); + await this.closeOptionsList(comboBox); + } - public async checkValidity(comboBoxElement: WebElementWrapper): Promise { - const invalidClassName = 'euiComboBox-isInvalid'; + public async doesClearButtonExist(comboBoxElement: WebElementWrapper): Promise { + const found = await comboBoxElement.findAllByTestSubject( + 'comboBoxClearButton', + this.WAIT_FOR_EXISTS_TIME + ); + return found.length > 0; + } - return !(await comboBoxElement.elementHasClass(invalidClassName)); - } + public async checkValidity(comboBoxElement: WebElementWrapper): Promise { + const invalidClassName = 'euiComboBox-isInvalid'; - /** - * Closes options list - * - * @param comboBoxElement element that wraps up EuiComboBox - */ - public async closeOptionsList(comboBoxElement: WebElementWrapper): Promise { - const isOptionsListOpen = await testSubjects.exists('~comboBoxOptionsList'); - if (isOptionsListOpen) { - const input = await comboBoxElement.findByTagName('input'); - await input.pressKeys(browser.keys.ESCAPE); - } - } + return !(await comboBoxElement.elementHasClass(invalidClassName)); + } - /** - * Opens options list - * - * @param comboBoxElement element that wraps up EuiComboBox - */ - public async openOptionsList(comboBoxElement: WebElementWrapper): Promise { - const isOptionsListOpen = await testSubjects.exists('~comboBoxOptionsList'); - if (!isOptionsListOpen) { - await retry.try(async () => { - const toggleBtn = await comboBoxElement.findByTestSubject('comboBoxInput'); - await toggleBtn.click(); - }); - } + /** + * Closes options list + * + * @param comboBoxElement element that wraps up EuiComboBox + */ + public async closeOptionsList(comboBoxElement: WebElementWrapper): Promise { + const isOptionsListOpen = await this.testSubjects.exists('~comboBoxOptionsList'); + if (isOptionsListOpen) { + const input = await comboBoxElement.findByTagName('input'); + await input.pressKeys(this.browser.keys.ESCAPE); } + } - /** - * Checks if specified option is already selected - * - * @param comboBoxElement element that wraps up EuiComboBox - * @param value option text - */ - public async isOptionSelected( - comboBoxElement: WebElementWrapper, - value: string - ): Promise { - log.debug(`comboBox.isOptionSelected, value: ${value}`); - const $ = await comboBoxElement.parseDomContent(); - const selectedOptions = $('.euiComboBoxPill') - .toArray() - .map((option) => $(option).text()); - return selectedOptions.length === 1 && selectedOptions[0] === value; + /** + * Opens options list + * + * @param comboBoxElement element that wraps up EuiComboBox + */ + public async openOptionsList(comboBoxElement: WebElementWrapper): Promise { + const isOptionsListOpen = await this.testSubjects.exists('~comboBoxOptionsList'); + if (!isOptionsListOpen) { + await this.retry.try(async () => { + const toggleBtn = await comboBoxElement.findByTestSubject('comboBoxInput'); + await toggleBtn.click(); + }); } + } - /** - * Clears input field - * @param comboBoxSelector data-test-subj selector - */ - public async clearInputField(comboBoxSelector: string): Promise { - log.debug(`comboBox.clearInputField, comboBoxSelector:${comboBoxSelector}`); - const comboBoxElement = await testSubjects.find(comboBoxSelector); - const input = await comboBoxElement.findByTagName('input'); - await input.clearValueWithKeyboard(); - } + /** + * Checks if specified option is already selected + * + * @param comboBoxElement element that wraps up EuiComboBox + * @param value option text + */ + public async isOptionSelected( + comboBoxElement: WebElementWrapper, + value: string + ): Promise { + this.log.debug(`comboBox.isOptionSelected, value: ${value}`); + const $ = await comboBoxElement.parseDomContent(); + const selectedOptions = $('.euiComboBoxPill') + .toArray() + .map((option) => $(option).text()); + return selectedOptions.length === 1 && selectedOptions[0] === value; } - return new ComboBox(); + /** + * Clears input field + * @param comboBoxSelector data-test-subj selector + */ + public async clearInputField(comboBoxSelector: string): Promise { + this.log.debug(`comboBox.clearInputField, comboBoxSelector:${comboBoxSelector}`); + const comboBoxElement = await this.testSubjects.find(comboBoxSelector); + const input = await comboBoxElement.findByTagName('input'); + await input.clearValueWithKeyboard(); + } } diff --git a/test/functional/services/index.ts b/test/functional/services/index.ts index 294b68c5488658..03c43ffc302146 100644 --- a/test/functional/services/index.ts +++ b/test/functional/services/index.ts @@ -17,7 +17,7 @@ import { SnapshotsService, TestSubjects, } from './common'; -import { ComboBoxProvider } from './combo_box'; +import { ComboBoxService } from './combo_box'; import { DashboardAddPanelService, DashboardReplacePanelService, @@ -68,7 +68,7 @@ export const services = { dashboardReplacePanel: DashboardReplacePanelService, dashboardPanelActions: DashboardPanelActionsService, flyout: FlyoutService, - comboBox: ComboBoxProvider, + comboBox: ComboBoxService, dataGrid: DataGridService, embedding: EmbeddingProvider, renderable: RenderableProvider,