From dc088b1cd5a23db5d8193a72e3c758a3cbe618b7 Mon Sep 17 00:00:00 2001 From: John Schulz Date: Thu, 5 Dec 2019 04:04:21 -0500 Subject: [PATCH] Run VSCode's organize imports on EPM files (#52234) Learned about it on Slack from https://twitter.com/ryanchenkie/status/1201883268527927301 Blog at https://code.visualstudio.com/updates/v1_23#_run-code-actions-on-save Basically does the order we've been loosely following (3rd party, then relative) & alphabetic by location and variable name. It's not customizable but it's reasonable and, afaict, consistent. --- x-pack/legacy/plugins/epm/index.ts | 4 ++-- .../epm/public/components/asset_accordion.tsx | 6 +++--- .../epm/public/components/assets_facet_group.tsx | 14 +++++++------- .../plugins/epm/public/components/icon_panel.tsx | 2 +- .../plugins/epm/public/components/package_card.tsx | 4 ++-- .../epm/public/components/package_list_grid.tsx | 4 ++-- .../plugins/epm/public/components/requirements.tsx | 4 ++-- x-pack/legacy/plugins/epm/public/constants.ts | 2 +- x-pack/legacy/plugins/epm/public/data.ts | 2 +- x-pack/legacy/plugins/epm/public/hooks/index.ts | 4 ++-- .../legacy/plugins/epm/public/hooks/use_links.tsx | 2 +- .../epm/public/hooks/use_package_install.tsx | 6 +++--- x-pack/legacy/plugins/epm/public/index.ts | 2 +- x-pack/legacy/plugins/epm/public/plugin.tsx | 6 +++--- x-pack/legacy/plugins/epm/public/routes.tsx | 2 +- .../screens/detail/confirm_package_delete.tsx | 2 +- .../screens/detail/confirm_package_install.tsx | 2 +- .../plugins/epm/public/screens/detail/content.tsx | 8 ++++---- .../epm/public/screens/detail/content_collapse.tsx | 4 ++-- .../plugins/epm/public/screens/detail/header.tsx | 6 +++--- .../plugins/epm/public/screens/detail/index.tsx | 8 ++++---- .../public/screens/detail/installation_button.tsx | 6 +++--- .../plugins/epm/public/screens/detail/layout.tsx | 2 +- .../public/screens/detail/markdown_renderers.tsx | 4 ++-- .../epm/public/screens/detail/nav_button_back.tsx | 6 +++--- .../epm/public/screens/detail/overview_panel.tsx | 4 ++-- .../plugins/epm/public/screens/detail/readme.tsx | 4 ++-- .../epm/public/screens/detail/screenshots.tsx | 4 ++-- .../epm/public/screens/detail/side_nav_links.tsx | 4 ++-- .../epm/public/screens/home/category_facets.tsx | 2 +- .../plugins/epm/public/screens/home/header.tsx | 2 +- .../plugins/epm/public/screens/home/hooks.tsx | 2 +- .../plugins/epm/public/screens/home/index.tsx | 7 +++---- .../epm/public/screens/home/search_packages.tsx | 2 +- .../epm/public/screens/home/search_results.tsx | 2 +- .../plugins/epm/server/datasources/create.ts | 6 +++--- .../plugins/epm/server/datasources/handlers.ts | 6 +++--- x-pack/legacy/plugins/epm/server/feature.ts | 2 +- x-pack/legacy/plugins/epm/server/index.ts | 2 +- .../plugins/epm/server/lib/agent/agent.test.ts | 4 ++-- .../ingest_pipeline/ingest_pipelines.test.ts | 2 +- .../ingest_pipeline/ingest_pipelines.ts | 4 ++-- .../server/lib/elasticsearch/template/install.ts | 6 +++--- .../lib/elasticsearch/template/template.test.ts | 4 ++-- .../plugins/epm/server/lib/fields/field.test.ts | 2 +- .../plugins/epm/server/packages/assets.test.ts | 2 +- .../legacy/plugins/epm/server/packages/assets.ts | 2 +- x-pack/legacy/plugins/epm/server/packages/get.ts | 4 ++-- .../legacy/plugins/epm/server/packages/handlers.ts | 10 +++++----- x-pack/legacy/plugins/epm/server/packages/index.ts | 2 +- .../legacy/plugins/epm/server/packages/install.ts | 2 +- .../legacy/plugins/epm/server/packages/remove.ts | 4 ++-- x-pack/legacy/plugins/epm/server/plugin.ts | 2 +- .../plugins/epm/server/registry/index.test.ts | 2 +- x-pack/legacy/plugins/epm/server/registry/index.ts | 8 ++++---- x-pack/legacy/plugins/epm/server/routes.ts | 4 ++-- x-pack/legacy/plugins/epm/server/saved_objects.ts | 2 +- 57 files changed, 113 insertions(+), 114 deletions(-) diff --git a/x-pack/legacy/plugins/epm/index.ts b/x-pack/legacy/plugins/epm/index.ts index 4ebe74b10560e..6e319e612dcf0 100644 --- a/x-pack/legacy/plugins/epm/index.ts +++ b/x-pack/legacy/plugins/epm/index.ts @@ -4,14 +4,14 @@ * you may not use this file except in compliance with the Elastic License. */ -import { resolve } from 'path'; import JoiNamespace from 'joi'; import { Legacy } from 'kibana'; +import { resolve } from 'path'; import { LegacyPluginInitializer, LegacyPluginOptions } from 'src/legacy/types'; import { PLUGIN } from './common/constants'; import manifest from './kibana.json'; import { getConfigSchema } from './server/config'; -import { Plugin, createSetupShim } from './server/plugin'; +import { createSetupShim, Plugin } from './server/plugin'; import { mappings, savedObjectSchemas } from './server/saved_objects'; const ROOT = `plugins/${PLUGIN.ID}`; diff --git a/x-pack/legacy/plugins/epm/public/components/asset_accordion.tsx b/x-pack/legacy/plugins/epm/public/components/asset_accordion.tsx index 2da561207100d..b243edc72a6be 100644 --- a/x-pack/legacy/plugins/epm/public/components/asset_accordion.tsx +++ b/x-pack/legacy/plugins/epm/public/components/asset_accordion.tsx @@ -4,7 +4,6 @@ * you may not use this file except in compliance with the Elastic License. */ -import React, { Fragment } from 'react'; import { EuiAccordion, EuiFlexGroup, @@ -12,13 +11,14 @@ import { EuiHorizontalRule, EuiIcon, EuiNotificationBadge, + EuiSpacer, EuiText, EuiTitle, - EuiSpacer, } from '@elastic/eui'; +import React, { Fragment } from 'react'; import styled from 'styled-components'; -import { entries } from '../../common/type_utils'; import { AssetsGroupedByServiceByType } from '../../common/types'; +import { entries } from '../../common/type_utils'; import { AssetIcons, AssetTitleMap, ServiceIcons, ServiceTitleMap } from '../constants'; import { useCore } from '../hooks/use_core'; diff --git a/x-pack/legacy/plugins/epm/public/components/assets_facet_group.tsx b/x-pack/legacy/plugins/epm/public/components/assets_facet_group.tsx index 0095adb164e31..86252555b6d78 100644 --- a/x-pack/legacy/plugins/epm/public/components/assets_facet_group.tsx +++ b/x-pack/legacy/plugins/epm/public/components/assets_facet_group.tsx @@ -4,7 +4,6 @@ * you may not use this file except in compliance with the Elastic License. */ -import React, { Fragment } from 'react'; import { EuiFacetButton, EuiFacetGroup, @@ -15,20 +14,21 @@ import { EuiTextColor, EuiTitle, } from '@elastic/eui'; +import React, { Fragment } from 'react'; import styled from 'styled-components'; +import { + AssetsGroupedByServiceByType, + AssetTypeToParts, + KibanaAssetType, +} from '../../common/types'; import { entries } from '../../common/type_utils'; import { - DisplayedAssets, AssetIcons, AssetTitleMap, + DisplayedAssets, ServiceIcons, ServiceTitleMap, } from '../constants'; -import { - AssetsGroupedByServiceByType, - AssetTypeToParts, - KibanaAssetType, -} from '../../common/types'; import { useCore } from '../hooks/use_core'; export function AssetsFacetGroup({ assets }: { assets: AssetsGroupedByServiceByType }) { diff --git a/x-pack/legacy/plugins/epm/public/components/icon_panel.tsx b/x-pack/legacy/plugins/epm/public/components/icon_panel.tsx index 226626a6b4d79..d7281d28eb2a9 100644 --- a/x-pack/legacy/plugins/epm/public/components/icon_panel.tsx +++ b/x-pack/legacy/plugins/epm/public/components/icon_panel.tsx @@ -4,9 +4,9 @@ * you may not use this file except in compliance with the Elastic License. */ +import { EuiIcon, EuiPanel, IconType } from '@elastic/eui'; import React from 'react'; import styled from 'styled-components'; -import { EuiIcon, EuiPanel, IconType } from '@elastic/eui'; import { useCore } from '../hooks/use_core'; export function IconPanel({ iconType }: { iconType: IconType }) { diff --git a/x-pack/legacy/plugins/epm/public/components/package_card.tsx b/x-pack/legacy/plugins/epm/public/components/package_card.tsx index 88b02c3d90bf9..88448003ae7e9 100644 --- a/x-pack/legacy/plugins/epm/public/components/package_card.tsx +++ b/x-pack/legacy/plugins/epm/public/components/package_card.tsx @@ -3,11 +3,11 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -import React from 'react'; import { EuiCard, EuiIcon, ICON_TYPES } from '@elastic/eui'; +import React from 'react'; import styled from 'styled-components'; +import { PackageInfo, PackageListItem } from '../../common/types'; import { useLinks } from '../hooks'; -import { PackageListItem, PackageInfo } from '../../common/types'; export interface BadgeProps { showInstalledBadge?: boolean; diff --git a/x-pack/legacy/plugins/epm/public/components/package_list_grid.tsx b/x-pack/legacy/plugins/epm/public/components/package_list_grid.tsx index 6bfed1bc1420c..785e9b82377a0 100644 --- a/x-pack/legacy/plugins/epm/public/components/package_list_grid.tsx +++ b/x-pack/legacy/plugins/epm/public/components/package_list_grid.tsx @@ -3,10 +3,10 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -import React, { Fragment, ReactNode } from 'react'; import { EuiFlexGrid, EuiFlexGroup, EuiFlexItem, EuiSpacer, EuiText } from '@elastic/eui'; +import React, { Fragment, ReactNode } from 'react'; import { PackageList } from '../../common/types'; -import { PackageCard, BadgeProps } from './package_card'; +import { BadgeProps, PackageCard } from './package_card'; type ListProps = { controls?: ReactNode; diff --git a/x-pack/legacy/plugins/epm/public/components/requirements.tsx b/x-pack/legacy/plugins/epm/public/components/requirements.tsx index 4e81051e6a7af..441cd8b3f7bd8 100644 --- a/x-pack/legacy/plugins/epm/public/components/requirements.tsx +++ b/x-pack/legacy/plugins/epm/public/components/requirements.tsx @@ -4,11 +4,11 @@ * you may not use this file except in compliance with the Elastic License. */ +import { EuiFlexGroup, EuiFlexItem, EuiIcon, EuiText, EuiTextColor, EuiTitle } from '@elastic/eui'; import React, { Fragment } from 'react'; -import { EuiFlexGroup, EuiFlexItem, EuiTextColor, EuiTitle, EuiIcon, EuiText } from '@elastic/eui'; import styled from 'styled-components'; -import { entries } from '../../common/type_utils'; import { RequirementsByServiceName } from '../../common/types'; +import { entries } from '../../common/type_utils'; import { ServiceTitleMap } from '../constants'; import { useCore } from '../hooks/use_core'; import { Version } from './version'; diff --git a/x-pack/legacy/plugins/epm/public/constants.ts b/x-pack/legacy/plugins/epm/public/constants.ts index 1a70220f97422..eea35ba274e98 100644 --- a/x-pack/legacy/plugins/epm/public/constants.ts +++ b/x-pack/legacy/plugins/epm/public/constants.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ import { IconType } from '@elastic/eui'; -import { ElasticsearchAssetType, KibanaAssetType, AssetType, ServiceName } from '../common/types'; +import { AssetType, ElasticsearchAssetType, KibanaAssetType, ServiceName } from '../common/types'; // only allow Kibana assets for the kibana key, ES asssets for elasticsearch, etc type ServiceNameToAssetTypes = Record, KibanaAssetType[]> & diff --git a/x-pack/legacy/plugins/epm/public/data.ts b/x-pack/legacy/plugins/epm/public/data.ts index 49e6e1337865c..88141d15f4afb 100644 --- a/x-pack/legacy/plugins/epm/public/data.ts +++ b/x-pack/legacy/plugins/epm/public/data.ts @@ -7,13 +7,13 @@ import { HttpHandler } from 'src/core/public'; import { getCategoriesPath, + getFilePath, getInfoPath, getInstallDatasourcePath, getInstallPath, getListPath, getRemovePath, ListParams, - getFilePath, } from '../common/routes'; import { AssetReference, diff --git a/x-pack/legacy/plugins/epm/public/hooks/index.ts b/x-pack/legacy/plugins/epm/public/hooks/index.ts index 6eebb8676ccc8..c66ee2162fa76 100644 --- a/x-pack/legacy/plugins/epm/public/hooks/index.ts +++ b/x-pack/legacy/plugins/epm/public/hooks/index.ts @@ -9,8 +9,8 @@ export { useCore } from './use_core'; export { useLinks } from './use_links'; export { PackageInstallProvider, + useDeletePackage, + useGetPackageInstallStatus, useInstallPackage, useSetPackageInstallStatus, - useGetPackageInstallStatus, - useDeletePackage, } from './use_package_install'; diff --git a/x-pack/legacy/plugins/epm/public/hooks/use_links.tsx b/x-pack/legacy/plugins/epm/public/hooks/use_links.tsx index b9b0079ec75e8..44f86e0821e6c 100644 --- a/x-pack/legacy/plugins/epm/public/hooks/use_links.tsx +++ b/x-pack/legacy/plugins/epm/public/hooks/use_links.tsx @@ -5,10 +5,10 @@ */ import { generatePath } from 'react-router-dom'; +import { useCore } from '.'; import { PLUGIN } from '../../common/constants'; import { getFilePath, getInfoPath } from '../../common/routes'; import { patterns } from '../routes'; -import { useCore } from '.'; import { DetailViewPanelName } from '..'; // TODO: get this from server/packages/handlers.ts (move elsewhere?) diff --git a/x-pack/legacy/plugins/epm/public/hooks/use_package_install.tsx b/x-pack/legacy/plugins/epm/public/hooks/use_package_install.tsx index 3ae37c6fef63e..24e44d43c2c89 100644 --- a/x-pack/legacy/plugins/epm/public/hooks/use_package_install.tsx +++ b/x-pack/legacy/plugins/epm/public/hooks/use_package_install.tsx @@ -4,13 +4,13 @@ * you may not use this file except in compliance with the Elastic License. */ -import React, { useCallback, useState, Fragment } from 'react'; +import { EuiButton, EuiFlexGroup, EuiFlexItem } from '@elastic/eui'; import createContainer from 'constate'; -import { EuiFlexGroup, EuiFlexItem, EuiButton } from '@elastic/eui'; +import React, { Fragment, useCallback, useState } from 'react'; import { NotificationsStart } from 'src/core/public'; import { toMountPoint } from '../../../../../../src/plugins/kibana_react/public'; import { PackageInfo } from '../../common/types'; -import { installPackage as fetchInstallPackage, installDatasource, removePackage } from '../data'; +import { installDatasource, installPackage as fetchInstallPackage, removePackage } from '../data'; import { InstallStatus } from '../types'; interface PackagesInstall { diff --git a/x-pack/legacy/plugins/epm/public/index.ts b/x-pack/legacy/plugins/epm/public/index.ts index 544998d97add8..f0dfbebf6dc18 100644 --- a/x-pack/legacy/plugins/epm/public/index.ts +++ b/x-pack/legacy/plugins/epm/public/index.ts @@ -3,8 +3,8 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -import euiLight from '@elastic/eui/dist/eui_theme_light.json'; import euiDark from '@elastic/eui/dist/eui_theme_dark.json'; +import euiLight from '@elastic/eui/dist/eui_theme_light.json'; import chrome from 'ui/chrome'; import { npSetup, npStart } from 'ui/new_platform'; import { Plugin, PluginInitializerContext } from './plugin'; diff --git a/x-pack/legacy/plugins/epm/public/plugin.tsx b/x-pack/legacy/plugins/epm/public/plugin.tsx index 40d9e449c643c..128fcdc535015 100644 --- a/x-pack/legacy/plugins/epm/public/plugin.tsx +++ b/x-pack/legacy/plugins/epm/public/plugin.tsx @@ -4,13 +4,13 @@ * you may not use this file except in compliance with the Elastic License. */ +import { EuiErrorBoundary } from '@elastic/eui'; +import euiLight from '@elastic/eui/dist/eui_theme_light.json'; import React from 'react'; import ReactDOM from 'react-dom'; import { HashRouter, Switch } from 'react-router-dom'; -import { ThemeProvider } from 'styled-components'; -import { EuiErrorBoundary } from '@elastic/eui'; -import euiLight from '@elastic/eui/dist/eui_theme_light.json'; import { ChromeStart, CoreSetup, HttpStart, I18nStart, NotificationsStart } from 'src/core/public'; +import { ThemeProvider } from 'styled-components'; import { CoreProvider } from './contexts/core'; import { setClient } from './data'; import { PackageInstallProvider } from './hooks/'; diff --git a/x-pack/legacy/plugins/epm/public/routes.tsx b/x-pack/legacy/plugins/epm/public/routes.tsx index bf5bb0c3cfecd..9da7c24d0d766 100644 --- a/x-pack/legacy/plugins/epm/public/routes.tsx +++ b/x-pack/legacy/plugins/epm/public/routes.tsx @@ -6,9 +6,9 @@ import React from 'react'; import { Route } from 'react-router-dom'; +import { PLUGIN } from '../common/constants'; import { Detail, DetailProps } from './screens/detail'; import { Home } from './screens/home'; -import { PLUGIN } from '../common/constants'; // patterns are used by React Router and are relative to `APP_ROOT` export const patterns = { diff --git a/x-pack/legacy/plugins/epm/public/screens/detail/confirm_package_delete.tsx b/x-pack/legacy/plugins/epm/public/screens/detail/confirm_package_delete.tsx index ba9a263e74319..2b3be04ac476b 100644 --- a/x-pack/legacy/plugins/epm/public/screens/detail/confirm_package_delete.tsx +++ b/x-pack/legacy/plugins/epm/public/screens/detail/confirm_package_delete.tsx @@ -3,8 +3,8 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ +import { EuiCallOut, EuiConfirmModal, EuiOverlayMask } from '@elastic/eui'; import React from 'react'; -import { EuiConfirmModal, EuiOverlayMask, EuiCallOut } from '@elastic/eui'; interface ConfirmPackageDeleteProps { onCancel: () => void; diff --git a/x-pack/legacy/plugins/epm/public/screens/detail/confirm_package_install.tsx b/x-pack/legacy/plugins/epm/public/screens/detail/confirm_package_install.tsx index b38f673229cac..137d9cf226b4d 100644 --- a/x-pack/legacy/plugins/epm/public/screens/detail/confirm_package_install.tsx +++ b/x-pack/legacy/plugins/epm/public/screens/detail/confirm_package_install.tsx @@ -3,8 +3,8 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ +import { EuiCallOut, EuiConfirmModal, EuiOverlayMask, EuiSpacer } from '@elastic/eui'; import React from 'react'; -import { EuiConfirmModal, EuiOverlayMask, EuiCallOut, EuiSpacer } from '@elastic/eui'; interface ConfirmPackageInstallProps { onCancel: () => void; diff --git a/x-pack/legacy/plugins/epm/public/screens/detail/content.tsx b/x-pack/legacy/plugins/epm/public/screens/detail/content.tsx index c2f2ba6b2e3fa..29fc93326ee14 100644 --- a/x-pack/legacy/plugins/epm/public/screens/detail/content.tsx +++ b/x-pack/legacy/plugins/epm/public/screens/detail/content.tsx @@ -4,17 +4,17 @@ * you may not use this file except in compliance with the Elastic License. */ +import { EuiFlexGroup, EuiFlexItem, EuiHorizontalRule, EuiSpacer, EuiTitle } from '@elastic/eui'; import React from 'react'; import styled from 'styled-components'; -import { EuiFlexGroup, EuiFlexItem, EuiHorizontalRule, EuiSpacer, EuiTitle } from '@elastic/eui'; -import { SideNavLinks } from './side_nav_links'; +import { DEFAULT_PANEL, DetailProps } from '.'; import { PackageInfo } from '../../../common/types'; -import { AssetAccordion } from '../../components/asset_accordion'; import { AssetsFacetGroup } from '../../components/assets_facet_group'; +import { AssetAccordion } from '../../components/asset_accordion'; import { Requirements } from '../../components/requirements'; import { CenterColumn, LeftColumn, RightColumn } from './layout'; import { OverviewPanel } from './overview_panel'; -import { DEFAULT_PANEL, DetailProps } from '.'; +import { SideNavLinks } from './side_nav_links'; type ContentProps = PackageInfo & Pick & { hasIconPanel: boolean }; export function Content(props: ContentProps) { diff --git a/x-pack/legacy/plugins/epm/public/screens/detail/content_collapse.tsx b/x-pack/legacy/plugins/epm/public/screens/detail/content_collapse.tsx index dc95618ff6f97..9d5614debb42b 100644 --- a/x-pack/legacy/plugins/epm/public/screens/detail/content_collapse.tsx +++ b/x-pack/legacy/plugins/epm/public/screens/detail/content_collapse.tsx @@ -3,8 +3,8 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -import React, { useState, useRef, useLayoutEffect, Fragment, useCallback } from 'react'; -import { EuiButtonEmpty, EuiSpacer, EuiButton, EuiHorizontalRule } from '@elastic/eui'; +import { EuiButton, EuiButtonEmpty, EuiHorizontalRule, EuiSpacer } from '@elastic/eui'; +import React, { Fragment, useCallback, useLayoutEffect, useRef, useState } from 'react'; import styled from 'styled-components'; const BottomFade = styled.div` diff --git a/x-pack/legacy/plugins/epm/public/screens/detail/header.tsx b/x-pack/legacy/plugins/epm/public/screens/detail/header.tsx index f471044bea8be..c85b542c1bfbd 100644 --- a/x-pack/legacy/plugins/epm/public/screens/detail/header.tsx +++ b/x-pack/legacy/plugins/epm/public/screens/detail/header.tsx @@ -3,16 +3,16 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ +import { EuiFlexGroup, EuiFlexItem, EuiPage, EuiTitle, IconType } from '@elastic/eui'; import React, { Fragment } from 'react'; import styled from 'styled-components'; -import { EuiFlexGroup, EuiFlexItem, EuiPage, EuiTitle, IconType } from '@elastic/eui'; import { PLUGIN } from '../../../common/constants'; import { PackageInfo } from '../../../common/types'; -import { Version } from '../../components/version'; import { IconPanel } from '../../components/icon_panel'; +import { Version } from '../../components/version'; import { useBreadcrumbs, useLinks } from '../../hooks'; -import { CenterColumn, LeftColumn, RightColumn } from './layout'; import { InstallationButton } from './installation_button'; +import { CenterColumn, LeftColumn, RightColumn } from './layout'; import { NavButtonBack } from './nav_button_back'; const FullWidthNavRow = styled(EuiPage)` diff --git a/x-pack/legacy/plugins/epm/public/screens/detail/index.tsx b/x-pack/legacy/plugins/epm/public/screens/detail/index.tsx index 4bc37ae2e148f..073ccc8c5dae5 100644 --- a/x-pack/legacy/plugins/epm/public/screens/detail/index.tsx +++ b/x-pack/legacy/plugins/epm/public/screens/detail/index.tsx @@ -3,17 +3,17 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -import React, { Fragment, useState, useEffect } from 'react'; import { EuiPage, EuiPageBody, EuiPageWidthProps, ICON_TYPES } from '@elastic/eui'; +import React, { Fragment, useEffect, useState } from 'react'; import styled from 'styled-components'; -import { PackageInfo } from '../../../common/types'; import { DetailViewPanelName } from '../../'; +import { PackageInfo } from '../../../common/types'; import { getPackageInfoByKey } from '../../data'; -import { useCore } from '../../hooks/use_core'; import { useSetPackageInstallStatus } from '../../hooks'; +import { useCore } from '../../hooks/use_core'; import { InstallStatus } from '../../types'; -import { Header } from './header'; import { Content } from './content'; +import { Header } from './header'; export const DEFAULT_PANEL: DetailViewPanelName = 'overview'; diff --git a/x-pack/legacy/plugins/epm/public/screens/detail/installation_button.tsx b/x-pack/legacy/plugins/epm/public/screens/detail/installation_button.tsx index 7609a2a89985d..159c4b1bba5c7 100644 --- a/x-pack/legacy/plugins/epm/public/screens/detail/installation_button.tsx +++ b/x-pack/legacy/plugins/epm/public/screens/detail/installation_button.tsx @@ -3,13 +3,13 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -import React, { Fragment, useCallback, useState, useMemo } from 'react'; import { EuiButton } from '@elastic/eui'; +import React, { Fragment, useCallback, useMemo, useState } from 'react'; import { PackageInfo } from '../../../common/types'; +import { useDeletePackage, useGetPackageInstallStatus, useInstallPackage } from '../../hooks'; import { InstallStatus } from '../../types'; -import { ConfirmPackageInstall } from './confirm_package_install'; import { ConfirmPackageDelete } from './confirm_package_delete'; -import { useDeletePackage, useInstallPackage, useGetPackageInstallStatus } from '../../hooks'; +import { ConfirmPackageInstall } from './confirm_package_install'; interface InstallationButtonProps { package: PackageInfo; diff --git a/x-pack/legacy/plugins/epm/public/screens/detail/layout.tsx b/x-pack/legacy/plugins/epm/public/screens/detail/layout.tsx index cfffad072fe1c..a802e35add7db 100644 --- a/x-pack/legacy/plugins/epm/public/screens/detail/layout.tsx +++ b/x-pack/legacy/plugins/epm/public/screens/detail/layout.tsx @@ -4,8 +4,8 @@ * you may not use this file except in compliance with the Elastic License. */ -import React, { FunctionComponent, ReactNode } from 'react'; import { EuiFlexItem } from '@elastic/eui'; +import React, { FunctionComponent, ReactNode } from 'react'; interface ColumnProps { children?: ReactNode; diff --git a/x-pack/legacy/plugins/epm/public/screens/detail/markdown_renderers.tsx b/x-pack/legacy/plugins/epm/public/screens/detail/markdown_renderers.tsx index 8f154789de31f..2e321e8bfc36f 100644 --- a/x-pack/legacy/plugins/epm/public/screens/detail/markdown_renderers.tsx +++ b/x-pack/legacy/plugins/epm/public/screens/detail/markdown_renderers.tsx @@ -5,12 +5,12 @@ */ import { - EuiText, EuiCodeBlock, + EuiLink, EuiTableHeaderCell, EuiTableRow, EuiTableRowCell, - EuiLink, + EuiText, } from '@elastic/eui'; import React from 'react'; diff --git a/x-pack/legacy/plugins/epm/public/screens/detail/nav_button_back.tsx b/x-pack/legacy/plugins/epm/public/screens/detail/nav_button_back.tsx index 85f548450b72f..42536e820ff7f 100644 --- a/x-pack/legacy/plugins/epm/public/screens/detail/nav_button_back.tsx +++ b/x-pack/legacy/plugins/epm/public/screens/detail/nav_button_back.tsx @@ -3,10 +3,10 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -import { EuiButtonEmptyProps, EuiButtonEmpty } from '@elastic/eui'; -import styled from 'styled-components'; +import { EuiButtonEmpty, EuiButtonEmptyProps } from '@elastic/eui'; import React from 'react'; -import { useLinks, useCore } from '../../hooks'; +import styled from 'styled-components'; +import { useCore, useLinks } from '../../hooks'; export function NavButtonBack() { const { toListView } = useLinks(); diff --git a/x-pack/legacy/plugins/epm/public/screens/detail/overview_panel.tsx b/x-pack/legacy/plugins/epm/public/screens/detail/overview_panel.tsx index 496141565ab0c..9e82bfccefc87 100644 --- a/x-pack/legacy/plugins/epm/public/screens/detail/overview_panel.tsx +++ b/x-pack/legacy/plugins/epm/public/screens/detail/overview_panel.tsx @@ -3,11 +3,11 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -import React, { Fragment } from 'react'; import { EuiSpacer } from '@elastic/eui'; +import React, { Fragment } from 'react'; import { PackageInfo } from '../../../common/types'; -import { Screenshots } from './screenshots'; import { Readme } from './readme'; +import { Screenshots } from './screenshots'; export function OverviewPanel(props: PackageInfo) { const { screenshots, readme, name, version } = props; diff --git a/x-pack/legacy/plugins/epm/public/screens/detail/readme.tsx b/x-pack/legacy/plugins/epm/public/screens/detail/readme.tsx index 172150566acb0..18a71dca85e0b 100644 --- a/x-pack/legacy/plugins/epm/public/screens/detail/readme.tsx +++ b/x-pack/legacy/plugins/epm/public/screens/detail/readme.tsx @@ -3,13 +3,13 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -import React, { useEffect, useState, Fragment } from 'react'; import { EuiLoadingContent, EuiText } from '@elastic/eui'; +import React, { Fragment, useEffect, useState } from 'react'; import ReactMarkdown from 'react-markdown'; import { getFileByPath } from '../../data'; -import { markdownRenderers } from './markdown_renderers'; import { useLinks } from '../../hooks'; import { ContentCollapse } from './content_collapse'; +import { markdownRenderers } from './markdown_renderers'; export function Readme({ readmePath, diff --git a/x-pack/legacy/plugins/epm/public/screens/detail/screenshots.tsx b/x-pack/legacy/plugins/epm/public/screens/detail/screenshots.tsx index 8d9b67284b702..27abfa29cc09f 100644 --- a/x-pack/legacy/plugins/epm/public/screens/detail/screenshots.tsx +++ b/x-pack/legacy/plugins/epm/public/screens/detail/screenshots.tsx @@ -3,11 +3,11 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ +import { EuiFlexGroup, EuiFlexItem, EuiImage, EuiSpacer, EuiText, EuiTitle } from '@elastic/eui'; import React, { Fragment } from 'react'; -import { EuiSpacer, EuiText, EuiTitle, EuiImage, EuiFlexGroup, EuiFlexItem } from '@elastic/eui'; import styled from 'styled-components'; import { ScreenshotItem } from '../../../common/types'; -import { useLinks, useCore } from '../../hooks'; +import { useCore, useLinks } from '../../hooks'; interface ScreenshotProps { images: ScreenshotItem[]; diff --git a/x-pack/legacy/plugins/epm/public/screens/detail/side_nav_links.tsx b/x-pack/legacy/plugins/epm/public/screens/detail/side_nav_links.tsx index 69caaf300b100..3925354135605 100644 --- a/x-pack/legacy/plugins/epm/public/screens/detail/side_nav_links.tsx +++ b/x-pack/legacy/plugins/epm/public/screens/detail/side_nav_links.tsx @@ -4,12 +4,12 @@ * you may not use this file except in compliance with the Elastic License. */ -import React, { Fragment } from 'react'; import { EuiButtonEmpty, EuiButtonEmptyProps } from '@elastic/eui'; +import React, { Fragment } from 'react'; import styled from 'styled-components'; +import { DetailViewPanelName } from '../../'; import { PackageInfo } from '../../../common/types'; import { entries } from '../../../common/type_utils'; -import { DetailViewPanelName } from '../../'; import { useLinks } from '../../hooks'; export type NavLinkProps = Pick & { diff --git a/x-pack/legacy/plugins/epm/public/screens/home/category_facets.tsx b/x-pack/legacy/plugins/epm/public/screens/home/category_facets.tsx index 6a9bd7c3c3ebf..58fcf57137090 100644 --- a/x-pack/legacy/plugins/epm/public/screens/home/category_facets.tsx +++ b/x-pack/legacy/plugins/epm/public/screens/home/category_facets.tsx @@ -3,8 +3,8 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -import React from 'react'; import { EuiFacetButton, EuiFacetGroup } from '@elastic/eui'; +import React from 'react'; import { CategorySummaryItem, CategorySummaryList } from '../../../common/types'; export function CategoryFacets({ diff --git a/x-pack/legacy/plugins/epm/public/screens/home/header.tsx b/x-pack/legacy/plugins/epm/public/screens/home/header.tsx index 44283c14ff5e7..9402aaa8db9a7 100644 --- a/x-pack/legacy/plugins/epm/public/screens/home/header.tsx +++ b/x-pack/legacy/plugins/epm/public/screens/home/header.tsx @@ -4,7 +4,6 @@ * you may not use this file except in compliance with the Elastic License. */ -import React, { Fragment, useState } from 'react'; import { EuiFlexGroup, EuiFlexItem, @@ -19,6 +18,7 @@ import { EuiText, EuiTitle, } from '@elastic/eui'; +import React, { Fragment, useState } from 'react'; import styled from 'styled-components'; import { useCore, useLinks } from '../../hooks'; diff --git a/x-pack/legacy/plugins/epm/public/screens/home/hooks.tsx b/x-pack/legacy/plugins/epm/public/screens/home/hooks.tsx index bffffc5b5dff9..63ac721341b2f 100644 --- a/x-pack/legacy/plugins/epm/public/screens/home/hooks.tsx +++ b/x-pack/legacy/plugins/epm/public/screens/home/hooks.tsx @@ -7,7 +7,7 @@ import { useEffect, useRef, useState } from 'react'; import { CategorySummaryList, PackageList } from '../../../common/types'; import { getCategories, getPackages } from '../../data'; -import { LocalSearch, fieldsToSearch, searchIdField } from './search_packages'; +import { fieldsToSearch, LocalSearch, searchIdField } from './search_packages'; export function useCategories() { const [categories, setCategories] = useState([]); diff --git a/x-pack/legacy/plugins/epm/public/screens/home/index.tsx b/x-pack/legacy/plugins/epm/public/screens/home/index.tsx index 2079c55cdf9dd..a9a2cb6a7fc4a 100644 --- a/x-pack/legacy/plugins/epm/public/screens/home/index.tsx +++ b/x-pack/legacy/plugins/epm/public/screens/home/index.tsx @@ -3,10 +3,9 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -import React, { Fragment, useState } from 'react'; import { EuiHorizontalRule, EuiPage, EuiPageBody, EuiSpacer } from '@elastic/eui'; +import React, { Fragment, useState } from 'react'; import styled from 'styled-components'; - import { PLUGIN } from '../../../common/constants'; import { CategorySummaryItem, PackageList } from '../../../common/types'; import { PackageListGrid } from '../../components/package_list_grid'; @@ -14,11 +13,11 @@ import { useBreadcrumbs, useLinks } from '../../hooks'; import { CategoryFacets } from './category_facets'; import { Header } from './header'; import { + useAllPackages, useCategories, useCategoryPackages, - useAllPackages, - useLocalSearch, useInstalledPackages, + useLocalSearch, } from './hooks'; import { SearchPackages } from './search_packages'; diff --git a/x-pack/legacy/plugins/epm/public/screens/home/search_packages.tsx b/x-pack/legacy/plugins/epm/public/screens/home/search_packages.tsx index 8f6bef4891cb7..14df303c342eb 100644 --- a/x-pack/legacy/plugins/epm/public/screens/home/search_packages.tsx +++ b/x-pack/legacy/plugins/epm/public/screens/home/search_packages.tsx @@ -4,8 +4,8 @@ * you may not use this file except in compliance with the Elastic License. */ -import React from 'react'; import { Search as LocalSearch } from 'js-search'; +import React from 'react'; import { PackageList, PackageListItem } from '../../../common/types'; import { SearchResults } from './search_results'; diff --git a/x-pack/legacy/plugins/epm/public/screens/home/search_results.tsx b/x-pack/legacy/plugins/epm/public/screens/home/search_results.tsx index 11c56fd4c33a8..ee7abb6272c6b 100644 --- a/x-pack/legacy/plugins/epm/public/screens/home/search_results.tsx +++ b/x-pack/legacy/plugins/epm/public/screens/home/search_results.tsx @@ -4,8 +4,8 @@ * you may not use this file except in compliance with the Elastic License. */ -import React from 'react'; import { EuiText, EuiTitle } from '@elastic/eui'; +import React from 'react'; import { PackageList } from '../../../common/types'; import { PackageListGrid } from '../../components/package_list_grid'; diff --git a/x-pack/legacy/plugins/epm/server/datasources/create.ts b/x-pack/legacy/plugins/epm/server/datasources/create.ts index 4befeff6b49cd..ceb1956faaac3 100644 --- a/x-pack/legacy/plugins/epm/server/datasources/create.ts +++ b/x-pack/legacy/plugins/epm/server/datasources/create.ts @@ -5,12 +5,12 @@ */ import { SavedObjectsClientContract } from 'src/core/server/'; +import { Asset, Datasource, InputType } from '../../../ingest/server/libs/types'; +import { SAVED_OBJECT_TYPE_DATASOURCES } from '../../common/constants'; +import { AssetReference } from '../../common/types'; import { CallESAsCurrentUser } from '../lib/cluster_access'; import { installPipelines } from '../lib/elasticsearch/ingest_pipeline/ingest_pipelines'; import { installTemplates } from '../lib/elasticsearch/template/install'; -import { AssetReference } from '../../common/types'; -import { SAVED_OBJECT_TYPE_DATASOURCES } from '../../common/constants'; -import { Datasource, Asset, InputType } from '../../../ingest/server/libs/types'; import * as Registry from '../registry'; export async function createDatasource(options: { diff --git a/x-pack/legacy/plugins/epm/server/datasources/handlers.ts b/x-pack/legacy/plugins/epm/server/datasources/handlers.ts index d1c39a95ce0d4..ef8ab0ed42900 100644 --- a/x-pack/legacy/plugins/epm/server/datasources/handlers.ts +++ b/x-pack/legacy/plugins/epm/server/datasources/handlers.ts @@ -4,11 +4,11 @@ * you may not use this file except in compliance with the Elastic License. */ -import { createDatasource } from './index'; +import { getClusterAccessor } from '../lib/cluster_access'; import { PluginContext } from '../plugin'; -import { Request, ResponseToolkit } from '../types'; import { getClient } from '../saved_objects'; -import { getClusterAccessor } from '../lib/cluster_access'; +import { Request, ResponseToolkit } from '../types'; +import { createDatasource } from './index'; // TODO: duplicated from packages/handlers.ts. unduplicate. interface Extra extends ResponseToolkit { diff --git a/x-pack/legacy/plugins/epm/server/feature.ts b/x-pack/legacy/plugins/epm/server/feature.ts index 1ab7c63754523..c53ce21d7a34b 100644 --- a/x-pack/legacy/plugins/epm/server/feature.ts +++ b/x-pack/legacy/plugins/epm/server/feature.ts @@ -3,8 +3,8 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -import { PLUGIN } from '../common/constants'; import { Feature } from '../../../../plugins/features/server'; +import { PLUGIN } from '../common/constants'; export const feature: Feature = { id: PLUGIN.ID, diff --git a/x-pack/legacy/plugins/epm/server/index.ts b/x-pack/legacy/plugins/epm/server/index.ts index 696e7fb3c5ffa..47e77604f23f6 100644 --- a/x-pack/legacy/plugins/epm/server/index.ts +++ b/x-pack/legacy/plugins/epm/server/index.ts @@ -3,7 +3,7 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -import { Plugin, EPMPluginInitializerContext } from './plugin'; +import { EPMPluginInitializerContext, Plugin } from './plugin'; // Kibana NP needs config to be exported from here, see https://github.com/elastic/kibana/pull/45299/files#r323254805 export { config } from './config'; diff --git a/x-pack/legacy/plugins/epm/server/lib/agent/agent.test.ts b/x-pack/legacy/plugins/epm/server/lib/agent/agent.test.ts index f868b7d6d53f4..123f0360ebdad 100644 --- a/x-pack/legacy/plugins/epm/server/lib/agent/agent.test.ts +++ b/x-pack/legacy/plugins/epm/server/lib/agent/agent.test.ts @@ -4,9 +4,9 @@ * you may not use this file except in compliance with the Elastic License. */ -import path from 'path'; -import * as yaml from 'js-yaml'; import fs from 'fs'; +import * as yaml from 'js-yaml'; +import path from 'path'; import { createInput } from './agent'; test('test converting input and manifest into template', () => { diff --git a/x-pack/legacy/plugins/epm/server/lib/elasticsearch/ingest_pipeline/ingest_pipelines.test.ts b/x-pack/legacy/plugins/epm/server/lib/elasticsearch/ingest_pipeline/ingest_pipelines.test.ts index dde1832185990..23b15173ece3d 100644 --- a/x-pack/legacy/plugins/epm/server/lib/elasticsearch/ingest_pipeline/ingest_pipelines.test.ts +++ b/x-pack/legacy/plugins/epm/server/lib/elasticsearch/ingest_pipeline/ingest_pipelines.test.ts @@ -4,9 +4,9 @@ * you may not use this file except in compliance with the Elastic License. */ -import { rewriteIngestPipeline } from './ingest_pipelines'; import { readFileSync } from 'fs'; import path from 'path'; +import { rewriteIngestPipeline } from './ingest_pipelines'; test('a json-format pipeline with pipeline references is correctly rewritten', () => { const inputStandard = readFileSync( diff --git a/x-pack/legacy/plugins/epm/server/lib/elasticsearch/ingest_pipeline/ingest_pipelines.ts b/x-pack/legacy/plugins/epm/server/lib/elasticsearch/ingest_pipeline/ingest_pipelines.ts index 078f42237c34c..216abbbd28cd4 100644 --- a/x-pack/legacy/plugins/epm/server/lib/elasticsearch/ingest_pipeline/ingest_pipelines.ts +++ b/x-pack/legacy/plugins/epm/server/lib/elasticsearch/ingest_pipeline/ingest_pipelines.ts @@ -4,9 +4,9 @@ * you may not use this file except in compliance with the Elastic License. */ -import { CallESAsCurrentUser } from '../../cluster_access'; -import * as Registry from '../../../registry'; import { AssetReference, ElasticsearchAssetType } from '../../../../common/types'; +import * as Registry from '../../../registry'; +import { CallESAsCurrentUser } from '../../cluster_access'; export function rewriteIngestPipeline( pipeline: string, diff --git a/x-pack/legacy/plugins/epm/server/lib/elasticsearch/template/install.ts b/x-pack/legacy/plugins/epm/server/lib/elasticsearch/template/install.ts index de48c999514c1..29071424184ae 100644 --- a/x-pack/legacy/plugins/epm/server/lib/elasticsearch/template/install.ts +++ b/x-pack/legacy/plugins/epm/server/lib/elasticsearch/template/install.ts @@ -5,12 +5,12 @@ */ import { safeLoad } from 'js-yaml'; -import { RegistryPackage, Dataset, AssetReference } from '../../../../common/types'; -import * as Registry from '../../../registry'; +import { AssetReference, Dataset, RegistryPackage } from '../../../../common/types'; import { CallESAsCurrentUser } from '../../../../server/lib/cluster_access'; import { getAssetsData } from '../../../packages/assets'; +import * as Registry from '../../../registry'; import { Field } from '../../fields/field'; -import { generateMappings, getTemplate, generateTemplateName } from './template'; +import { generateMappings, generateTemplateName, getTemplate } from './template'; const isFields = (path: string) => { return path.includes('/fields/'); diff --git a/x-pack/legacy/plugins/epm/server/lib/elasticsearch/template/template.test.ts b/x-pack/legacy/plugins/epm/server/lib/elasticsearch/template/template.test.ts index 968dc75d98ba4..7aa987a69e962 100644 --- a/x-pack/legacy/plugins/epm/server/lib/elasticsearch/template/template.test.ts +++ b/x-pack/legacy/plugins/epm/server/lib/elasticsearch/template/template.test.ts @@ -4,11 +4,11 @@ * you may not use this file except in compliance with the Elastic License. */ -import { getTemplate, generateMappings } from './template'; import { readFileSync, writeFileSync } from 'fs'; -import path from 'path'; import { safeLoad } from 'js-yaml'; +import path from 'path'; import { Field, processFields } from '../../fields/field'; +import { generateMappings, getTemplate } from './template'; test('get template', () => { const pattern = 'logs-nginx-access-abcd-*'; diff --git a/x-pack/legacy/plugins/epm/server/lib/fields/field.test.ts b/x-pack/legacy/plugins/epm/server/lib/fields/field.test.ts index ead9446056214..b74208da7cc09 100644 --- a/x-pack/legacy/plugins/epm/server/lib/fields/field.test.ts +++ b/x-pack/legacy/plugins/epm/server/lib/fields/field.test.ts @@ -5,8 +5,8 @@ */ import { readFileSync, writeFileSync } from 'fs'; -import path from 'path'; import { safeLoad } from 'js-yaml'; +import path from 'path'; import { Field, processFields } from './field'; test('tests loading fields.yml', () => { diff --git a/x-pack/legacy/plugins/epm/server/packages/assets.test.ts b/x-pack/legacy/plugins/epm/server/packages/assets.test.ts index 7b93cc297dad1..581c9bc38fac6 100644 --- a/x-pack/legacy/plugins/epm/server/packages/assets.test.ts +++ b/x-pack/legacy/plugins/epm/server/packages/assets.test.ts @@ -4,8 +4,8 @@ * you may not use this file except in compliance with the Elastic License. */ -import { getAssets } from './assets'; import { RegistryPackage } from '../../common/types'; +import { getAssets } from './assets'; const tests = [ { diff --git a/x-pack/legacy/plugins/epm/server/packages/assets.ts b/x-pack/legacy/plugins/epm/server/packages/assets.ts index 05f0c4b47b09e..6e95b980ed8e4 100644 --- a/x-pack/legacy/plugins/epm/server/packages/assets.ts +++ b/x-pack/legacy/plugins/epm/server/packages/assets.ts @@ -4,8 +4,8 @@ * you may not use this file except in compliance with the Elastic License. */ -import * as Registry from '../registry'; import { RegistryPackage } from '../../common/types'; +import * as Registry from '../registry'; export function getAssets( packageInfo: RegistryPackage, diff --git a/x-pack/legacy/plugins/epm/server/packages/get.ts b/x-pack/legacy/plugins/epm/server/packages/get.ts index 07b1ea213d71f..76a2c7638a0c7 100644 --- a/x-pack/legacy/plugins/epm/server/packages/get.ts +++ b/x-pack/legacy/plugins/epm/server/packages/get.ts @@ -6,11 +6,11 @@ import { SavedObjectsClientContract } from 'src/core/server/'; import { SAVED_OBJECT_TYPE_PACKAGES } from '../../common/constants'; -import { InstallationAttributes, Installed, Installation, NotInstalled } from '../../common/types'; +import { Installation, InstallationAttributes, Installed, NotInstalled } from '../../common/types'; import * as Registry from '../registry'; import { createInstallableFrom } from './index'; -export { SearchParams, fetchFile as getFile } from '../registry'; +export { fetchFile as getFile, SearchParams } from '../registry'; function nameAsTitle(name: string) { return name.charAt(0).toUpperCase() + name.substr(1).toLowerCase(); diff --git a/x-pack/legacy/plugins/epm/server/packages/handlers.ts b/x-pack/legacy/plugins/epm/server/packages/handlers.ts index e695dabc7e2be..ec84b0888e1f0 100644 --- a/x-pack/legacy/plugins/epm/server/packages/handlers.ts +++ b/x-pack/legacy/plugins/epm/server/packages/handlers.ts @@ -6,19 +6,19 @@ import { API_ROOT } from '../../common/routes'; import { AssetType } from '../../common/types'; +import { getClusterAccessor } from '../lib/cluster_access'; +import { PluginContext } from '../plugin'; +import { getClient } from '../saved_objects'; +import { Request, ResponseToolkit } from '../types'; import { - SearchParams, getCategories, getFile, getPackageInfo, getPackages, installPackage, removeInstallation, + SearchParams, } from './index'; -import { getClusterAccessor } from '../lib/cluster_access'; -import { PluginContext } from '../plugin'; -import { getClient } from '../saved_objects'; -import { Request, ResponseToolkit } from '../types'; interface Extra extends ResponseToolkit { context: PluginContext; diff --git a/x-pack/legacy/plugins/epm/server/packages/index.ts b/x-pack/legacy/plugins/epm/server/packages/index.ts index 002e90146655b..1c744c67209cf 100644 --- a/x-pack/legacy/plugins/epm/server/packages/index.ts +++ b/x-pack/legacy/plugins/epm/server/packages/index.ts @@ -14,9 +14,9 @@ import { } from '../../common/types'; export * from './get'; +export * from './handlers'; export * from './install'; export * from './remove'; -export * from './handlers'; // only Kibana Assets use Saved Objects at this point export const savedObjectTypes: AssetType[] = Object.values(KibanaAssetType); diff --git a/x-pack/legacy/plugins/epm/server/packages/install.ts b/x-pack/legacy/plugins/epm/server/packages/install.ts index 26e2a95f67f66..c8095755b40bc 100644 --- a/x-pack/legacy/plugins/epm/server/packages/install.ts +++ b/x-pack/legacy/plugins/epm/server/packages/install.ts @@ -8,8 +8,8 @@ import { SavedObject, SavedObjectsClientContract } from 'src/core/server/'; import { SAVED_OBJECT_TYPE_PACKAGES } from '../../common/constants'; import { AssetReference, InstallationAttributes, KibanaAssetType } from '../../common/types'; import * as Registry from '../registry'; -import { getInstallationObject } from './index'; import { getObject } from './get_objects'; +import { getInstallationObject } from './index'; export async function installPackage(options: { savedObjectsClient: SavedObjectsClientContract; diff --git a/x-pack/legacy/plugins/epm/server/packages/remove.ts b/x-pack/legacy/plugins/epm/server/packages/remove.ts index 6101bee8494e8..b8e02e89d33a3 100644 --- a/x-pack/legacy/plugins/epm/server/packages/remove.ts +++ b/x-pack/legacy/plugins/epm/server/packages/remove.ts @@ -6,9 +6,9 @@ import { SavedObjectsClientContract } from 'src/core/server/'; import { SAVED_OBJECT_TYPE_PACKAGES } from '../../common/constants'; -import { getInstallationObject, savedObjectTypes } from './index'; -import { CallESAsCurrentUser } from '../lib/cluster_access'; import { AssetReference, AssetType, ElasticsearchAssetType } from '../../common/types'; +import { CallESAsCurrentUser } from '../lib/cluster_access'; +import { getInstallationObject, savedObjectTypes } from './index'; export async function removeInstallation(options: { savedObjectsClient: SavedObjectsClientContract; diff --git a/x-pack/legacy/plugins/epm/server/plugin.ts b/x-pack/legacy/plugins/epm/server/plugin.ts index 31ffcc16c731e..6aecb48ccc075 100644 --- a/x-pack/legacy/plugins/epm/server/plugin.ts +++ b/x-pack/legacy/plugins/epm/server/plugin.ts @@ -6,13 +6,13 @@ import { Observable } from 'rxjs'; import { CoreSetup, CoreStart, IClusterClient, PluginInitializerContext } from 'src/core/server'; +import { PluginSetupContract } from '../../../../plugins/features/server'; import { PLUGIN } from '../common/constants'; import { Server } from '../server/types'; import { EPMConfigSchema, epmConfigStore } from './config'; import { feature } from './feature'; import { fetchList } from './registry'; import { routes } from './routes'; -import { PluginSetupContract } from '../../../../plugins/features/server'; export { createSetupShim } from './shim'; diff --git a/x-pack/legacy/plugins/epm/server/registry/index.test.ts b/x-pack/legacy/plugins/epm/server/registry/index.test.ts index a65b6ecf4a834..8e2008a035596 100644 --- a/x-pack/legacy/plugins/epm/server/registry/index.test.ts +++ b/x-pack/legacy/plugins/epm/server/registry/index.test.ts @@ -4,8 +4,8 @@ * you may not use this file except in compliance with the Elastic License. */ -import { pathParts } from './index'; import { AssetParts } from '../../common/types'; +import { pathParts } from './index'; const testPaths = [ { diff --git a/x-pack/legacy/plugins/epm/server/registry/index.ts b/x-pack/legacy/plugins/epm/server/registry/index.ts index 7d61b51002d9a..65b1e28791979 100644 --- a/x-pack/legacy/plugins/epm/server/registry/index.ts +++ b/x-pack/legacy/plugins/epm/server/registry/index.ts @@ -4,22 +4,22 @@ * you may not use this file except in compliance with the Elastic License. */ -import { URL } from 'url'; import { Response } from 'node-fetch'; +import { URL } from 'url'; import { - AssetsGroupedByServiceByType, AssetParts, + AssetsGroupedByServiceByType, CategoryId, CategorySummaryList, KibanaAssetType, RegistryList, RegistryPackage, } from '../../common/types'; +import { epmConfigStore } from '../config'; import { cacheGet, cacheSet } from './cache'; import { ArchiveEntry, untarBuffer } from './extract'; -import { fetchUrl, getResponseStream, getResponse } from './requests'; +import { fetchUrl, getResponse, getResponseStream } from './requests'; import { streamToBuffer } from './streams'; -import { epmConfigStore } from '../config'; export { ArchiveEntry } from './extract'; diff --git a/x-pack/legacy/plugins/epm/server/routes.ts b/x-pack/legacy/plugins/epm/server/routes.ts index 730337e2254ab..1b30673354503 100644 --- a/x-pack/legacy/plugins/epm/server/routes.ts +++ b/x-pack/legacy/plugins/epm/server/routes.ts @@ -5,9 +5,9 @@ */ import { PLUGIN } from '../common/constants'; import * as CommonRoutes from '../common/routes'; -import { ServerRoute } from './types'; -import * as Packages from './packages/handlers'; import * as Datasources from './datasources/handlers'; +import * as Packages from './packages/handlers'; +import { ServerRoute } from './types'; // Manager public API paths export const routes: ServerRoute[] = [ diff --git a/x-pack/legacy/plugins/epm/server/saved_objects.ts b/x-pack/legacy/plugins/epm/server/saved_objects.ts index ef27c96a8f3a9..277ba4ae5b662 100644 --- a/x-pack/legacy/plugins/epm/server/saved_objects.ts +++ b/x-pack/legacy/plugins/epm/server/saved_objects.ts @@ -4,9 +4,9 @@ * you may not use this file except in compliance with the Elastic License. */ +import { mappings as ingestMappings } from '../../ingest/server/mappings'; import { SAVED_OBJECT_TYPE_DATASOURCES, SAVED_OBJECT_TYPE_PACKAGES } from '../common/constants'; import { Request } from './types'; -import { mappings as ingestMappings } from '../../ingest/server/mappings'; export const getClient = (req: Request) => req.getSavedObjectsClient();