mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 01:38:56 -04:00
[Fleet] clean up extra exports from Fleet/Integrations (#136838)
This commit is contained in:
parent
955cb3f354
commit
277201e7e2
100 changed files with 379 additions and 172 deletions
|
@ -5,9 +5,8 @@
|
|||
* 2.0.
|
||||
*/
|
||||
|
||||
export * from './plugin';
|
||||
export { INTEGRATIONS_PLUGIN_ID, PLUGIN_ID } from './plugin';
|
||||
export * from './routes';
|
||||
|
||||
export * from './agent';
|
||||
export * from './agent_policy';
|
||||
export * from './package_policy';
|
||||
|
|
|
@ -5,13 +5,175 @@
|
|||
* 2.0.
|
||||
*/
|
||||
|
||||
// TODO: https://github.com/elastic/kibana/issues/110901
|
||||
/* eslint-disable @kbn/eslint/no_export_all */
|
||||
export {
|
||||
// Plugin id
|
||||
PLUGIN_ID,
|
||||
INTEGRATIONS_PLUGIN_ID,
|
||||
// Packages
|
||||
FLEET_APM_PACKAGE,
|
||||
FLEET_SERVER_PACKAGE,
|
||||
FLEET_SYSTEM_PACKAGE,
|
||||
FLEET_SYNTHETICS_PACKAGE,
|
||||
FLEET_ELASTIC_AGENT_PACKAGE,
|
||||
FLEET_KUBERNETES_PACKAGE,
|
||||
FLEET_CLOUD_SECURITY_POSTURE_PACKAGE,
|
||||
FLEET_ENDPOINT_PACKAGE,
|
||||
// Saved object type
|
||||
AGENT_POLICY_SAVED_OBJECT_TYPE,
|
||||
PACKAGES_SAVED_OBJECT_TYPE,
|
||||
PACKAGE_POLICY_SAVED_OBJECT_TYPE,
|
||||
OUTPUT_SAVED_OBJECT_TYPE,
|
||||
PRECONFIGURATION_DELETION_RECORD_SAVED_OBJECT_TYPE,
|
||||
ASSETS_SAVED_OBJECT_TYPE,
|
||||
// Fleet server index
|
||||
FLEET_SERVER_SERVERS_INDEX,
|
||||
FLEET_SERVER_ARTIFACTS_INDEX,
|
||||
AGENTS_INDEX,
|
||||
AGENT_POLICY_INDEX,
|
||||
AGENT_ACTIONS_INDEX,
|
||||
AGENT_ACTIONS_RESULTS_INDEX,
|
||||
// Agent constants
|
||||
AGENTS_PREFIX,
|
||||
AGENT_UPDATE_LAST_CHECKIN_INTERVAL_MS,
|
||||
agentPolicyStatuses,
|
||||
// Routes
|
||||
PACKAGE_POLICY_API_ROOT,
|
||||
AGENT_API_ROUTES,
|
||||
AGENT_POLICY_API_ROUTES,
|
||||
AGENTS_SETUP_API_ROUTES,
|
||||
PACKAGE_POLICY_API_ROUTES,
|
||||
EPM_API_ROUTES,
|
||||
SETUP_API_ROUTE,
|
||||
// Should probably be removed
|
||||
SO_SEARCH_LIMIT,
|
||||
// Statuses
|
||||
} from './constants';
|
||||
export {
|
||||
// Route services
|
||||
epmRouteService,
|
||||
agentRouteService,
|
||||
agentPolicyRouteService,
|
||||
setupRouteService,
|
||||
appRoutesService,
|
||||
packagePolicyRouteService,
|
||||
fleetSetupRouteService,
|
||||
// Package policy helpers
|
||||
isValidNamespace,
|
||||
// TODO Should probably not be exposed by Fleet
|
||||
decodeCloudId,
|
||||
} from './services';
|
||||
|
||||
export * from './constants';
|
||||
export * from './services';
|
||||
export * from './types';
|
||||
export * from './experimental_features';
|
||||
export type { FleetAuthz } from './authz';
|
||||
export { calculateAuthz } from './authz';
|
||||
export { createFleetAuthzMock } from './mocks';
|
||||
export type {
|
||||
// Request/Response
|
||||
GetOneAgentResponse,
|
||||
GetAgentsResponse,
|
||||
GetAgentStatusResponse,
|
||||
GetOnePackagePolicyResponse,
|
||||
CreatePackagePolicyRequest,
|
||||
CreatePackagePolicyResponse,
|
||||
UpdatePackagePolicyResponse,
|
||||
DeletePackagePoliciesRequest,
|
||||
GetPackagePoliciesRequest,
|
||||
GetPackagePoliciesResponse,
|
||||
CopyAgentPolicyResponse,
|
||||
DeleteAgentPolicyRequest,
|
||||
DeleteAgentPolicyResponse,
|
||||
GetOneAgentPolicyResponse,
|
||||
CreateAgentPolicyRequest,
|
||||
CreateAgentPolicyResponse,
|
||||
GetFullAgentPolicyResponse,
|
||||
GetAgentPoliciesRequest,
|
||||
GetAgentPoliciesResponse,
|
||||
GetAgentPoliciesResponseItem,
|
||||
DeletePackagePoliciesResponse,
|
||||
GetPackagesResponse,
|
||||
BulkInstallPackagesResponse,
|
||||
FleetErrorResponse,
|
||||
CheckPermissionsResponse,
|
||||
PostFleetSetupResponse,
|
||||
IBulkInstallPackageHTTPError,
|
||||
BulkInstallPackageInfo,
|
||||
GetInfoResponse,
|
||||
UpgradePackagePolicyResponse,
|
||||
UpgradePackagePolicyResponseItem,
|
||||
UpgradePackagePolicyBaseResponse,
|
||||
UpgradePackagePolicyDryRunResponseItem,
|
||||
// Models
|
||||
Agent,
|
||||
AgentStatus,
|
||||
FleetServerAgentMetadata,
|
||||
AgentMetadata,
|
||||
NewAgentPolicy,
|
||||
FullAgentPolicy,
|
||||
FullAgentPolicyKibanaConfig,
|
||||
FullAgentPolicyInput,
|
||||
FullAgentPolicyOutput,
|
||||
FullAgentPolicyOutputPermissions,
|
||||
FullAgentPolicyInputStream,
|
||||
DryRunPackagePolicy,
|
||||
AgentPolicy,
|
||||
Installation,
|
||||
NewPackagePolicy,
|
||||
NewPackagePolicyInput,
|
||||
NewPackagePolicyInputStream,
|
||||
UpdatePackagePolicy,
|
||||
PackagePolicy,
|
||||
PackagePolicyPackage,
|
||||
Installable,
|
||||
PackagePolicyInput,
|
||||
PackagePolicyInputStream,
|
||||
PackagePolicyConfigRecord,
|
||||
PackagePolicyConfigRecordEntry,
|
||||
RegistryVarsEntry,
|
||||
RegistryPackage,
|
||||
PackageListItem,
|
||||
PackageList,
|
||||
PackageInfo,
|
||||
Output,
|
||||
NewOutput,
|
||||
PackageAssetReference,
|
||||
KibanaAssetReference,
|
||||
KibanaSavedObjectType,
|
||||
EsAssetReference,
|
||||
KibanaAssetTypeToParts,
|
||||
KibanaAssetParts,
|
||||
KibanaAssetType,
|
||||
DocAssetType,
|
||||
AssetParts,
|
||||
RegistryElasticsearch,
|
||||
ElasticsearchAssetParts,
|
||||
ElasticsearchAssetTypeToParts,
|
||||
AssetReference,
|
||||
ListWithKuery,
|
||||
ListResult,
|
||||
DefaultPackagesInstallationError,
|
||||
EpmPackageAdditions,
|
||||
ArchivePackage,
|
||||
InstallResult,
|
||||
PackageSpecManifest,
|
||||
PackageSpecCategory,
|
||||
PackageSpecConditions,
|
||||
PackageSpecIcon,
|
||||
PackageSpecScreenshot,
|
||||
RegistryPolicyTemplate,
|
||||
RegistrySearchResult,
|
||||
RegistryInput,
|
||||
RegistryImage,
|
||||
RegistryDataStream,
|
||||
RegistryDataStreamPrivileges,
|
||||
RegistryStream,
|
||||
RegistryInputGroup,
|
||||
BundledPackage,
|
||||
InstallablePackage,
|
||||
InstallStatusExcluded,
|
||||
InstalledRegistry,
|
||||
Installing,
|
||||
NotInstalled,
|
||||
InstallFailed,
|
||||
// Fleet server models
|
||||
FleetServerAgent,
|
||||
} from './types';
|
||||
|
||||
export { ElasticsearchAssetType } from './types';
|
||||
|
|
|
@ -15,7 +15,7 @@ import {
|
|||
LICENCE_FOR_PER_POLICY_OUTPUT,
|
||||
FLEET_APM_PACKAGE,
|
||||
outputType,
|
||||
} from '../../../../../../../common';
|
||||
} from '../../../../../../../common/constants';
|
||||
import type { NewAgentPolicy, AgentPolicy } from '../../../../types';
|
||||
|
||||
// The super select component do not support null or '' as a value
|
||||
|
|
|
@ -22,7 +22,7 @@ import {
|
|||
import { FormattedMessage } from '@kbn/i18n-react';
|
||||
import { i18n } from '@kbn/i18n';
|
||||
|
||||
import { dataTypes } from '../../../../../../../common';
|
||||
import { dataTypes } from '../../../../../../../common/constants';
|
||||
import type { NewAgentPolicy, AgentPolicy } from '../../../../types';
|
||||
import { useStartServices } from '../../../../hooks';
|
||||
|
||||
|
|
|
@ -22,7 +22,7 @@ import { FormattedMessage } from '@kbn/i18n-react';
|
|||
import styled from 'styled-components';
|
||||
import { i18n } from '@kbn/i18n';
|
||||
|
||||
import { dataTypes } from '../../../../../../common';
|
||||
import { dataTypes } from '../../../../../../common/constants';
|
||||
|
||||
import type { AgentPolicy, NewAgentPolicy } from '../../../types';
|
||||
|
||||
|
|
|
@ -11,7 +11,7 @@ import { FormattedMessage } from '@kbn/i18n-react';
|
|||
import { i18n } from '@kbn/i18n';
|
||||
|
||||
import type { PackageInfo } from '../../../../types';
|
||||
import { getComponentTemplateNameForDatastream } from '../../../../../../../common';
|
||||
import { getComponentTemplateNameForDatastream } from '../../../../../../../common/services';
|
||||
import { useStartServices } from '../../../../hooks';
|
||||
|
||||
import { usePackagePolicyEditorPageUrl } from './datastream_hooks';
|
||||
|
|
|
@ -24,7 +24,7 @@ import { useStartServices, useGetPipeline } from '../../../../hooks';
|
|||
import {
|
||||
getPipelineNameForDatastream,
|
||||
getCustomPipelineNameForDatastream,
|
||||
} from '../../../../../../../common';
|
||||
} from '../../../../../../../common/services';
|
||||
|
||||
import { usePackagePolicyEditorPageUrl } from './datastream_hooks';
|
||||
|
||||
|
|
|
@ -33,7 +33,8 @@ import { packageToPackagePolicy, pkgKeyFromPackageInfo } from '../../../../../se
|
|||
import { Loading } from '../../../../../components';
|
||||
import { useStartServices, useGetPackagePolicies } from '../../../../../hooks';
|
||||
import { PACKAGE_POLICY_SAVED_OBJECT_TYPE } from '../../../../../../../constants';
|
||||
import { SO_SEARCH_LIMIT, getMaxPackageName } from '../../../../../../../../common';
|
||||
import { getMaxPackageName } from '../../../../../../../../common/services';
|
||||
import { SO_SEARCH_LIMIT } from '../../../../../../../../common/constants';
|
||||
|
||||
import { isAdvancedVar } from '../../services';
|
||||
import type { PackagePolicyValidationResults } from '../../services';
|
||||
|
|
|
@ -35,7 +35,11 @@ import {
|
|||
sendGetOneAgentPolicy,
|
||||
useFleetStatus,
|
||||
} from '../../../../../hooks';
|
||||
import { FLEET_APM_PACKAGE, SO_SEARCH_LIMIT, outputType } from '../../../../../../../../common';
|
||||
import {
|
||||
FLEET_APM_PACKAGE,
|
||||
SO_SEARCH_LIMIT,
|
||||
outputType,
|
||||
} from '../../../../../../../../common/constants';
|
||||
|
||||
const AgentPolicyFormRow = styled(EuiFormRow)`
|
||||
.euiFormRow__label {
|
||||
|
|
|
@ -8,7 +8,8 @@
|
|||
import type { NewPackagePolicy, PackageInfo } from '../../../../../types';
|
||||
|
||||
import { PACKAGE_POLICY_SAVED_OBJECT_TYPE } from '../../../../../../../constants';
|
||||
import { SO_SEARCH_LIMIT, getMaxPackageName } from '../../../../../../../../common';
|
||||
import { getMaxPackageName } from '../../../../../../../../common/services';
|
||||
import { SO_SEARCH_LIMIT } from '../../../../../../../../common/constants';
|
||||
import { packageToPackagePolicy } from '../../../../../services';
|
||||
import { sendGetPackagePolicies } from '../../../../../hooks';
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@ import React, { useMemo, useState } from 'react';
|
|||
import { useRouteMatch } from 'react-router-dom';
|
||||
import { i18n } from '@kbn/i18n';
|
||||
|
||||
import { splitPkgKey } from '../../../../../../../common';
|
||||
import { splitPkgKey } from '../../../../../../../common/services';
|
||||
|
||||
import { useGetPackageInfoByKey, useGetSettings } from '../../../../hooks';
|
||||
|
||||
|
|
|
@ -24,9 +24,10 @@ import type { EuiStepProps } from '@elastic/eui/src/components/steps/step';
|
|||
import { safeLoad } from 'js-yaml';
|
||||
|
||||
import { useCancelAddPackagePolicy, useOnSaveNavigate } from '../hooks';
|
||||
import type { CreatePackagePolicyRequest } from '../../../../../../../common';
|
||||
import type { CreatePackagePolicyRequest } from '../../../../../../../common/types';
|
||||
|
||||
import { dataTypes, FLEET_SYSTEM_PACKAGE, splitPkgKey } from '../../../../../../../common';
|
||||
import { splitPkgKey } from '../../../../../../../common/services';
|
||||
import { dataTypes, FLEET_SYSTEM_PACKAGE } from '../../../../../../../common/constants';
|
||||
import { useConfirmForceInstall } from '../../../../../integrations/hooks';
|
||||
import type {
|
||||
AgentPolicy,
|
||||
|
|
|
@ -24,7 +24,7 @@ import {
|
|||
EuiSpacer,
|
||||
} from '@elastic/eui';
|
||||
|
||||
import { dataTypes } from '../../../../../../../common';
|
||||
import { dataTypes } from '../../../../../../../common/constants';
|
||||
import type { NewAgentPolicy, AgentPolicy } from '../../../../types';
|
||||
import { useAuthz, useStartServices, sendCreateAgentPolicy } from '../../../../hooks';
|
||||
import { AgentPolicyForm, agentPolicyFormValidation } from '../../components';
|
||||
|
|
|
@ -14,7 +14,7 @@ import type { Agent, AgentPolicy } from '../../../../types';
|
|||
import {
|
||||
FLEET_ELASTIC_AGENT_PACKAGE,
|
||||
FLEET_ELASTIC_AGENT_DETAILS_DASHBOARD_ID,
|
||||
} from '../../../../../../../common';
|
||||
} from '../../../../../../../common/constants';
|
||||
|
||||
function useAgentDashboardLink(agent: Agent) {
|
||||
const { isLoading, data } = useGetPackageInfoByKey(FLEET_ELASTIC_AGENT_PACKAGE);
|
||||
|
|
|
@ -25,7 +25,7 @@ import {
|
|||
AgentUpgradeAgentModal,
|
||||
} from '../../components';
|
||||
import { useLicense } from '../../../../hooks';
|
||||
import { LICENSE_FOR_SCHEDULE_UPGRADE } from '../../../../../../../common';
|
||||
import { LICENSE_FOR_SCHEDULE_UPGRADE } from '../../../../../../../common/constants';
|
||||
|
||||
import { getCommonTags } from '../utils';
|
||||
|
||||
|
|
|
@ -11,7 +11,7 @@ import { i18n } from '@kbn/i18n';
|
|||
import { FormattedMessage } from '@kbn/i18n-react';
|
||||
|
||||
import { sendPutSettings, useComboInput, useStartServices } from '../../../../hooks';
|
||||
import { isDiffPathProtocol } from '../../../../../../../common';
|
||||
import { isDiffPathProtocol } from '../../../../../../../common/services';
|
||||
import { useConfirmModal } from '../../hooks/use_confirm_modal';
|
||||
import { getAgentAndPolicyCount } from '../../services/agent_and_policies_count';
|
||||
|
||||
|
|
|
@ -7,7 +7,11 @@
|
|||
|
||||
import { useStartServices } from '../../../hooks/use_core';
|
||||
import { epmRouteService } from '../../../services';
|
||||
import type { PackageSpecIcon, PackageSpecScreenshot, RegistryImage } from '../../../../common';
|
||||
import type {
|
||||
PackageSpecIcon,
|
||||
PackageSpecScreenshot,
|
||||
RegistryImage,
|
||||
} from '../../../../common/types';
|
||||
|
||||
const removeRelativePath = (relativePath: string): string =>
|
||||
new URL(relativePath, 'http://example.com').pathname;
|
||||
|
|
|
@ -24,7 +24,7 @@ import { i18n } from '@kbn/i18n';
|
|||
import { FormattedMessage } from '@kbn/i18n-react';
|
||||
import semverLt from 'semver/functions/lt';
|
||||
|
||||
import { splitPkgKey } from '../../../../../../../common';
|
||||
import { splitPkgKey } from '../../../../../../../common/services';
|
||||
import {
|
||||
useGetPackageInstallStatus,
|
||||
useSetPackageInstallStatus,
|
||||
|
|
|
@ -81,9 +81,8 @@ jest.mock('./steps', () => {
|
|||
};
|
||||
});
|
||||
|
||||
jest.mock('../../services', () => {
|
||||
jest.mock('../../services/has_fleet_server', () => {
|
||||
return {
|
||||
...jest.requireActual('../../services'),
|
||||
policyHasFleetServer: jest.fn().mockReturnValue(true),
|
||||
};
|
||||
});
|
||||
|
|
|
@ -9,7 +9,7 @@ import type {
|
|||
GetAgentTagsResponse,
|
||||
PostBulkUpdateAgentTagsRequest,
|
||||
UpdateAgentRequest,
|
||||
} from '../../../common';
|
||||
} from '../../../common/types';
|
||||
|
||||
import { agentRouteService } from '../../services';
|
||||
|
||||
|
|
|
@ -20,7 +20,7 @@ import type {
|
|||
UpdatePackageRequest,
|
||||
UpdatePackageResponse,
|
||||
} from '../../types';
|
||||
import type { FleetErrorResponse, GetStatsResponse } from '../../../common';
|
||||
import type { FleetErrorResponse, GetStatsResponse } from '../../../common/types';
|
||||
|
||||
import { getCustomIntegrations } from '../../services/custom_integrations';
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
|
||||
import { agentPolicyRouteService } from '../../services';
|
||||
|
||||
import type { GetFullAgentManifestResponse } from '../../../common';
|
||||
import type { GetFullAgentManifestResponse } from '../../../common/types';
|
||||
|
||||
import { sendRequest } from './use_request';
|
||||
|
||||
|
|
|
@ -5,9 +5,6 @@
|
|||
* 2.0.
|
||||
*/
|
||||
|
||||
// TODO: https://github.com/elastic/kibana/issues/110901
|
||||
/* eslint-disable @kbn/eslint/no_export_all */
|
||||
|
||||
import type { PluginInitializerContext } from '@kbn/core/public';
|
||||
|
||||
import { FleetPlugin } from './plugin';
|
||||
|
@ -19,8 +16,36 @@ export const plugin = (initializerContext: PluginInitializerContext) => {
|
|||
};
|
||||
|
||||
export type { NewPackagePolicy } from './types';
|
||||
export * from './types/intra_app_route_state';
|
||||
export * from './types/ui_extensions';
|
||||
export type {
|
||||
AgentDetailsReassignPolicyAction,
|
||||
AgentPolicyDetailsDeployAgentAction,
|
||||
AnyIntraAppRouteState,
|
||||
CreatePackagePolicyRouteState,
|
||||
IntegrationsAppBrowseRouteState,
|
||||
OnSaveQueryParamKeys,
|
||||
OnSaveQueryParamOpts,
|
||||
} from './types/intra_app_route_state';
|
||||
export type {
|
||||
AgentEnrollmentFlyoutFinalStepExtension,
|
||||
PackageAssetsComponent,
|
||||
PackageAssetsExtension,
|
||||
PackageCustomExtension,
|
||||
PackageCustomExtensionComponent,
|
||||
PackageCustomExtensionComponentProps,
|
||||
PackagePolicyCreateExtension,
|
||||
PackagePolicyCreateExtensionComponent,
|
||||
PackagePolicyCreateExtensionComponentProps,
|
||||
PackagePolicyEditExtension,
|
||||
PackagePolicyEditExtensionComponent,
|
||||
PackagePolicyEditExtensionComponentProps,
|
||||
PackagePolicyEditTabsExtension,
|
||||
PackagePolicyResponseExtension,
|
||||
PackagePolicyResponseExtensionComponent,
|
||||
PackagePolicyResponseExtensionComponentProps,
|
||||
UIExtensionPoint,
|
||||
UIExtensionRegistrationCallback,
|
||||
UIExtensionsStorage,
|
||||
} from './types/ui_extensions';
|
||||
|
||||
export { pagePathGetters } from './constants';
|
||||
export { pkgKeyFromPackageInfo } from './services';
|
||||
|
@ -31,3 +56,5 @@ export { PackagePolicyEditorDatastreamPipelines } from './applications/fleet/sec
|
|||
export type { PackagePolicyEditorDatastreamPipelinesProps } from './applications/fleet/sections/agent_policy/create_package_policy_page/components/datastream_pipelines';
|
||||
export { PackagePolicyEditorDatastreamMappings } from './applications/fleet/sections/agent_policy/create_package_policy_page/components/datastream_mappings';
|
||||
export type { PackagePolicyEditorDatastreamMappingsProps } from './applications/fleet/sections/agent_policy/create_package_policy_page/components/datastream_mappings';
|
||||
|
||||
export type { DynamicPagePathValues } from './constants';
|
||||
|
|
|
@ -42,20 +42,12 @@ import type { GlobalSearchPluginSetup } from '@kbn/global-search-plugin/public';
|
|||
|
||||
import type { UnifiedSearchPublicPluginStart } from '@kbn/unified-search-plugin/public';
|
||||
|
||||
import {
|
||||
PLUGIN_ID,
|
||||
INTEGRATIONS_PLUGIN_ID,
|
||||
setupRouteService,
|
||||
appRoutesService,
|
||||
calculateAuthz,
|
||||
parseExperimentalConfigValue,
|
||||
} from '../common';
|
||||
import type {
|
||||
CheckPermissionsResponse,
|
||||
PostFleetSetupResponse,
|
||||
FleetAuthz,
|
||||
ExperimentalFeatures,
|
||||
} from '../common';
|
||||
import { PLUGIN_ID, INTEGRATIONS_PLUGIN_ID, setupRouteService, appRoutesService } from '../common';
|
||||
import { calculateAuthz } from '../common/authz';
|
||||
import { parseExperimentalConfigValue } from '../common/experimental_features';
|
||||
import type { CheckPermissionsResponse, PostFleetSetupResponse } from '../common/types';
|
||||
import type { FleetAuthz } from '../common';
|
||||
import type { ExperimentalFeatures } from '../common/experimental_features';
|
||||
|
||||
import type { FleetConfigType } from '../common/types';
|
||||
|
||||
|
|
|
@ -11,7 +11,7 @@ export type {
|
|||
PackagePolicyValidationResults,
|
||||
PackagePolicyConfigValidationResults,
|
||||
PackagePolicyInputValidationResults,
|
||||
} from '../../common';
|
||||
} from '../../common/services';
|
||||
export { ExperimentalFeaturesService } from './experimental_features';
|
||||
export {
|
||||
AgentStatusKueryHelper,
|
||||
|
@ -41,9 +41,9 @@ export {
|
|||
countValidationErrors,
|
||||
getStreamsForInputType,
|
||||
downloadSourceRoutesService,
|
||||
} from '../../common';
|
||||
export * from './package_verification';
|
||||
export * from './pkg_key_from_package_info';
|
||||
export * from './ui_extensions';
|
||||
export * from './increment_policy_name';
|
||||
export * from './has_fleet_server';
|
||||
} from '../../common/services';
|
||||
export { isPackageUnverified, isVerificationError } from './package_verification';
|
||||
export { pkgKeyFromPackageInfo } from './pkg_key_from_package_info';
|
||||
export { createExtensionRegistrationCallback } from './ui_extensions';
|
||||
export { incrementPolicyName } from './increment_policy_name';
|
||||
export { policyHasFleetServer } from './has_fleet_server';
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
* 2.0.
|
||||
*/
|
||||
|
||||
import type { PackageVerificationStatus } from '../../common';
|
||||
import type { PackageVerificationStatus } from '../../common/types';
|
||||
import type { PackageInfo } from '../types';
|
||||
|
||||
import { ExperimentalFeaturesService, isPackageUnverified } from '.';
|
||||
|
|
|
@ -125,8 +125,13 @@ export type {
|
|||
GetDownloadSourceResponse,
|
||||
PostDownloadSourceRequest,
|
||||
PutDownloadSourceRequest,
|
||||
} from '../../common';
|
||||
export { entries, ElasticsearchAssetType, KibanaAssetType, InstallStatus } from '../../common';
|
||||
} from '../../common/types';
|
||||
export {
|
||||
entries,
|
||||
ElasticsearchAssetType,
|
||||
KibanaAssetType,
|
||||
InstallStatus,
|
||||
} from '../../common/types';
|
||||
|
||||
export * from './intra_app_route_state';
|
||||
export * from './ui_extensions';
|
||||
|
|
|
@ -11,7 +11,10 @@ import { schema } from '@kbn/config-schema';
|
|||
import type { TypeOf } from '@kbn/config-schema';
|
||||
import type { PluginConfigDescriptor } from '@kbn/core/server';
|
||||
|
||||
import { getExperimentalAllowedValues, isValidExperimentalValue } from '../common';
|
||||
import {
|
||||
getExperimentalAllowedValues,
|
||||
isValidExperimentalValue,
|
||||
} from '../common/experimental_features';
|
||||
const allowedExperimentalValues = getExperimentalAllowedValues();
|
||||
|
||||
import {
|
||||
|
|
|
@ -64,7 +64,7 @@ export {
|
|||
DEFAULT_DOWNLOAD_SOURCE_URI,
|
||||
DOWNLOAD_SOURCE_SAVED_OBJECT_TYPE,
|
||||
DEFAULT_DOWNLOAD_SOURCE_ID,
|
||||
} from '../../common';
|
||||
} from '../../common/constants';
|
||||
|
||||
export {
|
||||
FLEET_GLOBALS_COMPONENT_TEMPLATE_NAME,
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
/* eslint-disable max-classes-per-file */
|
||||
import type { ElasticsearchErrorDetails } from '@kbn/es-errors';
|
||||
|
||||
import type { FleetErrorType } from '../../common';
|
||||
import type { FleetErrorType } from '../../common/types';
|
||||
|
||||
import { isESClientError } from './utils';
|
||||
|
||||
|
|
|
@ -10,7 +10,7 @@ import Path from 'path';
|
|||
import * as kbnTestServer from '@kbn/core/test_helpers/kbn_server';
|
||||
|
||||
import { AGENT_POLICY_INDEX } from '../../common';
|
||||
import type { PackagePolicySOAttributes } from '../../common';
|
||||
import type { PackagePolicySOAttributes } from '../../common/types';
|
||||
import type { AgentPolicySOAttributes } from '../types';
|
||||
|
||||
import { useDockerRegistry, waitForFleetSetup } from './helpers';
|
||||
|
|
|
@ -22,7 +22,8 @@ import type { PackagePolicyServiceInterface } from '../services/package_policy';
|
|||
import type { AgentPolicyServiceInterface } from '../services';
|
||||
import type { FleetAppContext } from '../plugin';
|
||||
import { createMockTelemetryEventsSender } from '../telemetry/__mocks__';
|
||||
import type { FleetConfigType, ExperimentalFeatures } from '../../common';
|
||||
import type { FleetConfigType } from '../../common/types';
|
||||
import type { ExperimentalFeatures } from '../../common/experimental_features';
|
||||
import { createFleetAuthzMock } from '../../common';
|
||||
import { agentServiceMock } from '../services/agents/agent_service.mock';
|
||||
import type { FleetRequestHandlerContext } from '../types';
|
||||
|
|
|
@ -42,8 +42,12 @@ import type { CloudSetup } from '@kbn/cloud-plugin/server';
|
|||
|
||||
import type { SpacesPluginStart } from '@kbn/spaces-plugin/server';
|
||||
|
||||
import type { FleetConfigType, FleetAuthz, ExperimentalFeatures } from '../common';
|
||||
import { INTEGRATIONS_PLUGIN_ID, parseExperimentalConfigValue } from '../common';
|
||||
import type { FleetConfigType } from '../common/types';
|
||||
import type { FleetAuthz } from '../common';
|
||||
import type { ExperimentalFeatures } from '../common/experimental_features';
|
||||
|
||||
import { INTEGRATIONS_PLUGIN_ID } from '../common';
|
||||
import { parseExperimentalConfigValue } from '../common/experimental_features';
|
||||
|
||||
import {
|
||||
PLUGIN_ID,
|
||||
|
|
|
@ -37,7 +37,7 @@ import type {
|
|||
GetFullAgentPolicyResponse,
|
||||
GetFullAgentConfigMapResponse,
|
||||
GetFullAgentManifestResponse,
|
||||
} from '../../../common';
|
||||
} from '../../../common/types';
|
||||
import { defaultIngestErrorHandler } from '../../errors';
|
||||
import { createAgentPolicyWithPackages } from '../../services/agent_policy_create';
|
||||
|
||||
|
|
|
@ -18,7 +18,7 @@ import {
|
|||
} from '../../types';
|
||||
import type { FleetAuthzRouter } from '../security';
|
||||
|
||||
import { K8S_API_ROUTES } from '../../../common';
|
||||
import { K8S_API_ROUTES } from '../../../common/constants';
|
||||
|
||||
import {
|
||||
getAgentPoliciesHandler,
|
||||
|
|
|
@ -10,7 +10,7 @@ import type { TypeOf } from '@kbn/config-schema';
|
|||
|
||||
import { APP_API_ROUTES } from '../../constants';
|
||||
import { appContextService } from '../../services';
|
||||
import type { CheckPermissionsResponse, GenerateServiceTokenResponse } from '../../../common';
|
||||
import type { CheckPermissionsResponse, GenerateServiceTokenResponse } from '../../../common/types';
|
||||
import { defaultIngestErrorHandler, GenerateServiceTokenError } from '../../errors';
|
||||
import type { FleetAuthzRouter } from '../security';
|
||||
import type { FleetRequestHandler } from '../../types';
|
||||
|
|
|
@ -8,8 +8,8 @@ import { keyBy, keys, merge } from 'lodash';
|
|||
import type { RequestHandler } from '@kbn/core/server';
|
||||
|
||||
import type { DataStream } from '../../types';
|
||||
import { KibanaSavedObjectType } from '../../../common';
|
||||
import type { GetDataStreamsResponse } from '../../../common';
|
||||
import { KibanaSavedObjectType } from '../../../common/types';
|
||||
import type { GetDataStreamsResponse } from '../../../common/types';
|
||||
import { getPackageSavedObjects } from '../../services/epm/packages/get';
|
||||
import { defaultIngestErrorHandler } from '../../errors';
|
||||
|
||||
|
|
|
@ -19,7 +19,7 @@ import type {
|
|||
DeleteDownloadSourceResponse,
|
||||
PutDownloadSourceResponse,
|
||||
GetDownloadSourceResponse,
|
||||
} from '../../../common';
|
||||
} from '../../../common/types';
|
||||
import { downloadSourceService } from '../../services/download_source';
|
||||
import { defaultIngestErrorHandler } from '../../errors';
|
||||
import { agentPolicyService } from '../../services';
|
||||
|
|
|
@ -19,7 +19,7 @@ import type {
|
|||
GetOneEnrollmentAPIKeyResponse,
|
||||
DeleteEnrollmentAPIKeyResponse,
|
||||
PostEnrollmentAPIKeyResponse,
|
||||
} from '../../../common';
|
||||
} from '../../../common/types';
|
||||
import * as APIKeyService from '../../services/api_keys';
|
||||
import { agentPolicyService } from '../../services/agent_policy';
|
||||
import { defaultIngestErrorHandler, AgentPolicyNotFoundError } from '../../errors';
|
||||
|
|
|
@ -24,7 +24,7 @@ import type {
|
|||
IBulkInstallPackageHTTPError,
|
||||
GetStatsResponse,
|
||||
UpdatePackageResponse,
|
||||
} from '../../../common';
|
||||
} from '../../../common/types';
|
||||
import type {
|
||||
GetCategoriesRequestSchema,
|
||||
GetPackagesRequestSchema,
|
||||
|
|
|
@ -12,7 +12,7 @@ import type {
|
|||
GetInfoResponse,
|
||||
InstallPackageResponse,
|
||||
UpdatePackageResponse,
|
||||
} from '../../../common';
|
||||
} from '../../../common/types';
|
||||
|
||||
import { EPM_API_ROUTES } from '../../constants';
|
||||
import { splitPkgKey } from '../../services/epm/registry';
|
||||
|
|
|
@ -19,7 +19,7 @@ import type {
|
|||
GetOneOutputResponse,
|
||||
GetOutputsResponse,
|
||||
PostLogstashApiKeyResponse,
|
||||
} from '../../../common';
|
||||
} from '../../../common/types';
|
||||
import { outputService } from '../../services/output';
|
||||
import { defaultIngestErrorHandler, FleetUnauthorizedError } from '../../errors';
|
||||
import { agentPolicyService } from '../../services';
|
||||
|
|
|
@ -31,8 +31,8 @@ import type {
|
|||
NewPackagePolicy,
|
||||
UpgradePackagePolicyDryRunResponse,
|
||||
UpgradePackagePolicyResponse,
|
||||
} from '../../../common';
|
||||
import { installationStatuses } from '../../../common';
|
||||
} from '../../../common/types';
|
||||
import { installationStatuses } from '../../../common/constants';
|
||||
import { defaultIngestErrorHandler } from '../../errors';
|
||||
import { getInstallations } from '../../services/epm/packages';
|
||||
import { PACKAGES_SAVED_OBJECT_TYPE, SO_SEARCH_LIMIT } from '../../constants';
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
|
||||
import type { TypeOf } from '@kbn/config-schema';
|
||||
|
||||
import type { PreconfiguredAgentPolicy } from '../../../common';
|
||||
import type { PreconfiguredAgentPolicy } from '../../../common/types';
|
||||
|
||||
import type { FleetRequestHandler } from '../../types';
|
||||
import type {
|
||||
|
|
|
@ -16,7 +16,8 @@ import type {
|
|||
} from '@kbn/core/server';
|
||||
|
||||
import type { FleetAuthz } from '../../common';
|
||||
import { calculateAuthz, INTEGRATIONS_PLUGIN_ID } from '../../common';
|
||||
import { INTEGRATIONS_PLUGIN_ID } from '../../common';
|
||||
import { calculateAuthz } from '../../common/authz';
|
||||
|
||||
import { appContextService } from '../services';
|
||||
import type { FleetRequestHandlerContext } from '../types';
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
import type { AwaitedProperties } from '@kbn/utility-types';
|
||||
import { httpServerMock, savedObjectsClientMock, coreMock } from '@kbn/core/server/mocks';
|
||||
|
||||
import type { PostFleetSetupResponse } from '../../../common';
|
||||
import type { PostFleetSetupResponse } from '../../../common/types';
|
||||
import { RegistryError } from '../../errors';
|
||||
import { createAppContextStartContractMock, xpackMocks } from '../../mocks';
|
||||
import { agentServiceMock } from '../../services/agents/agent_service.mock';
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
*/
|
||||
|
||||
import { appContextService } from '../../services';
|
||||
import type { GetFleetStatusResponse, PostFleetSetupResponse } from '../../../common';
|
||||
import type { GetFleetStatusResponse, PostFleetSetupResponse } from '../../../common/types';
|
||||
import { formatNonFatalErrors, setupFleet } from '../../services/setup';
|
||||
import { hasFleetServers } from '../../services/fleet_server';
|
||||
import { defaultIngestErrorHandler } from '../../errors';
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
*/
|
||||
|
||||
import { AGENTS_SETUP_API_ROUTES, SETUP_API_ROUTE } from '../../constants';
|
||||
import type { FleetConfigType } from '../../../common';
|
||||
import type { FleetConfigType } from '../../../common/types';
|
||||
|
||||
import type { FleetAuthzRouter } from '../security';
|
||||
|
||||
|
|
|
@ -7,8 +7,8 @@
|
|||
|
||||
import type { SavedObjectMigrationFn } from '@kbn/core/server';
|
||||
|
||||
import type { Installation, Output } from '../../../common';
|
||||
import { AUTO_UPGRADE_POLICIES_PACKAGES } from '../../../common';
|
||||
import type { Installation, Output } from '../../../common/types';
|
||||
import { AUTO_UPGRADE_POLICIES_PACKAGES } from '../../../common/constants';
|
||||
|
||||
export const migrateOutputToV800: SavedObjectMigrationFn<Output, Output> = (
|
||||
outputDoc,
|
||||
|
|
|
@ -17,8 +17,8 @@ import type {
|
|||
} from '../../types';
|
||||
import { agentPolicyService } from '../agent_policy';
|
||||
import { outputService } from '../output';
|
||||
import { dataTypes, outputType } from '../../../common';
|
||||
import type { FullAgentPolicyOutputPermissions } from '../../../common';
|
||||
import { dataTypes, outputType } from '../../../common/constants';
|
||||
import type { FullAgentPolicyOutputPermissions } from '../../../common/types';
|
||||
import { getSettings } from '../settings';
|
||||
import { DEFAULT_OUTPUT } from '../../constants';
|
||||
|
||||
|
|
|
@ -12,9 +12,9 @@ import {
|
|||
PACKAGE_POLICY_DEFAULT_INDEX_PRIVILEGES,
|
||||
AGENT_POLICY_DEFAULT_MONITORING_DATASETS,
|
||||
} from '../../constants';
|
||||
import type { FullAgentPolicyOutputPermissions } from '../../../common';
|
||||
import type { FullAgentPolicyOutputPermissions } from '../../../common/types';
|
||||
import { FLEET_ELASTIC_AGENT_PACKAGE } from '../../../common';
|
||||
import { dataTypes } from '../../../common';
|
||||
import { dataTypes } from '../../../common/constants';
|
||||
|
||||
import { getDataStreamPrivileges } from './package_policies_to_agent_permissions';
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
import type { SavedObjectsClientContract } from '@kbn/core/server';
|
||||
|
||||
import type { AgentPolicySOAttributes } from '../../types';
|
||||
import { LICENCE_FOR_PER_POLICY_OUTPUT, outputType } from '../../../common';
|
||||
import { LICENCE_FOR_PER_POLICY_OUTPUT, outputType } from '../../../common/constants';
|
||||
import { appContextService } from '..';
|
||||
import { outputService } from '../output';
|
||||
import { OutputInvalidError, OutputLicenceError } from '../../errors';
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
import type { SavedObjectsClientContract } from '@kbn/core/server';
|
||||
import { merge } from 'lodash';
|
||||
|
||||
import { isPackageLimited } from '../../../common';
|
||||
import { isPackageLimited } from '../../../common/services';
|
||||
import type {
|
||||
PackagePolicy,
|
||||
FullAgentPolicyInput,
|
||||
|
|
|
@ -9,7 +9,7 @@ import type { SavedObjectsClientContract } from '@kbn/core/server';
|
|||
import type {
|
||||
FullAgentPolicyOutputPermissions,
|
||||
RegistryDataStreamPrivileges,
|
||||
} from '../../../common';
|
||||
} from '../../../common/types';
|
||||
import { PACKAGE_POLICY_DEFAULT_INDEX_PRIVILEGES } from '../../constants';
|
||||
|
||||
import type { PackagePolicy } from '../../types';
|
||||
|
|
|
@ -36,21 +36,21 @@ import type {
|
|||
ListWithKuery,
|
||||
NewPackagePolicy,
|
||||
} from '../types';
|
||||
import { packageToPackagePolicy } from '../../common/services';
|
||||
import {
|
||||
agentPolicyStatuses,
|
||||
packageToPackagePolicy,
|
||||
AGENT_POLICY_INDEX,
|
||||
UUID_V5_NAMESPACE,
|
||||
FLEET_APM_PACKAGE,
|
||||
FLEET_ELASTIC_AGENT_PACKAGE,
|
||||
} from '../../common';
|
||||
} from '../../common/constants';
|
||||
import type {
|
||||
DeleteAgentPolicyResponse,
|
||||
FleetServerPolicy,
|
||||
Installation,
|
||||
Output,
|
||||
DeletePackagePoliciesResponse,
|
||||
} from '../../common';
|
||||
} from '../../common/types';
|
||||
import { AgentPolicyNameExistsError, HostedAgentPolicyRestrictionRelatedError } from '../errors';
|
||||
|
||||
import type { FullAgentConfigMap } from '../../common/types/models/agent_cm';
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
import type { ElasticsearchClient, KibanaRequest } from '@kbn/core/server';
|
||||
|
||||
import type { AgentStatus, ListWithKuery } from '../../types';
|
||||
import type { Agent, GetAgentStatusResponse } from '../../../common';
|
||||
import type { Agent, GetAgentStatusResponse } from '../../../common/types';
|
||||
|
||||
import { getAuthzFromRequest } from '../../routes/security';
|
||||
|
||||
|
|
|
@ -11,8 +11,7 @@ import type { Agent } from '../../types';
|
|||
|
||||
import { errorsToResults, getAgentsByKuery, getAgentTags, processAgentsInBatches } from './crud';
|
||||
|
||||
jest.mock('../../../common', () => ({
|
||||
...jest.requireActual('../../../common'),
|
||||
jest.mock('../../../common/services/is_agent_upgradeable', () => ({
|
||||
isAgentUpgradeable: jest.fn().mockImplementation((agent: Agent) => agent.id.includes('up')),
|
||||
}));
|
||||
|
||||
|
|
|
@ -15,8 +15,9 @@ import { fromKueryExpression, toElasticsearchQuery } from '@kbn/es-query';
|
|||
|
||||
import type { AgentSOAttributes, Agent, BulkActionResult, ListWithKuery } from '../../types';
|
||||
import { appContextService, agentPolicyService } from '..';
|
||||
import type { FleetServerAgent } from '../../../common';
|
||||
import { isAgentUpgradeable, SO_SEARCH_LIMIT } from '../../../common';
|
||||
import type { FleetServerAgent } from '../../../common/types';
|
||||
import { SO_SEARCH_LIMIT } from '../../../common/constants';
|
||||
import { isAgentUpgradeable } from '../../../common/services';
|
||||
import { AGENTS_PREFIX, AGENTS_INDEX } from '../../constants';
|
||||
import { escapeSearchQueryPhrase, normalizeKuery } from '../saved_object';
|
||||
import { IngestManagerError, isESClientError, AgentNotFoundError } from '../../errors';
|
||||
|
|
|
@ -26,7 +26,8 @@ import type { SecurityPluginStart, SecurityPluginSetup } from '@kbn/security-plu
|
|||
|
||||
import type { CloudSetup } from '@kbn/cloud-plugin/server';
|
||||
|
||||
import type { FleetConfigType, ExperimentalFeatures } from '../../common';
|
||||
import type { FleetConfigType } from '../../common/types';
|
||||
import type { ExperimentalFeatures } from '../../common/experimental_features';
|
||||
import type {
|
||||
ExternalCallback,
|
||||
ExternalCallbacksStorage,
|
||||
|
|
|
@ -13,7 +13,7 @@ import { createHash } from 'crypto';
|
|||
|
||||
import type { ElasticsearchClient } from '@kbn/core/server';
|
||||
|
||||
import type { ListResult } from '../../../common';
|
||||
import type { ListResult } from '../../../common/types';
|
||||
import { FLEET_SERVER_ARTIFACTS_INDEX } from '../../../common';
|
||||
|
||||
import { ArtifactsElasticsearchError } from '../../errors';
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
*/
|
||||
import type { ElasticsearchClient } from '@kbn/core/server';
|
||||
|
||||
import type { ListResult } from '../../../common';
|
||||
import type { ListResult } from '../../../common/types';
|
||||
|
||||
import { ArtifactsClientAccessDeniedError, ArtifactsClientError } from '../../errors';
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
* 2.0.
|
||||
*/
|
||||
|
||||
import type { ListResult } from '../../../common';
|
||||
import type { ListResult } from '../../../common/types';
|
||||
import type { ListWithKuery } from '../../types';
|
||||
|
||||
export interface NewArtifact {
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
import Handlebars from 'handlebars';
|
||||
import { safeLoad, safeDump } from 'js-yaml';
|
||||
|
||||
import type { PackagePolicyConfigRecord } from '../../../../common';
|
||||
import type { PackagePolicyConfigRecord } from '../../../../common/types';
|
||||
|
||||
const handlebars = Handlebars.create();
|
||||
|
||||
|
|
|
@ -20,7 +20,7 @@ import type {
|
|||
InstallSource,
|
||||
PackageAssetReference,
|
||||
RegistryDataStream,
|
||||
} from '../../../../common';
|
||||
} from '../../../../common/types';
|
||||
import { pkgToPkgKey } from '../registry';
|
||||
|
||||
import { appContextService } from '../../app_context';
|
||||
|
|
|
@ -10,7 +10,7 @@ import { ElasticsearchAssetType } from '../../../../types';
|
|||
import type { RegistryDataStream } from '../../../../types';
|
||||
import { getPathParts } from '../../archive';
|
||||
|
||||
import { getPipelineNameForDatastream } from '../../../../../common';
|
||||
import { getPipelineNameForDatastream } from '../../../../../common/services';
|
||||
|
||||
import type { PipelineInstall, RewriteSubstitution } from './types';
|
||||
|
||||
|
|
|
@ -20,7 +20,7 @@ import {
|
|||
import {
|
||||
getCustomPipelineNameForDatastream,
|
||||
getPipelineNameForDatastream,
|
||||
} from '../../../../../common';
|
||||
} from '../../../../../common/services';
|
||||
|
||||
import { appendMetadataToIngestPipeline } from '../meta';
|
||||
import { retryTransientEsErrors } from '../retry';
|
||||
|
|
|
@ -10,7 +10,7 @@ import type { ElasticsearchClient, SavedObjectsClientContract } from '@kbn/core/
|
|||
import { appContextService } from '../../..';
|
||||
import { ElasticsearchAssetType } from '../../../../types';
|
||||
import { IngestManagerError } from '../../../../errors';
|
||||
import type { EsAssetReference } from '../../../../../common';
|
||||
import type { EsAssetReference } from '../../../../../common/types';
|
||||
import { updateEsAssetReferences } from '../../packages/install';
|
||||
|
||||
export const deletePreviousPipelines = async (
|
||||
|
|
|
@ -10,7 +10,7 @@ import Boom from '@hapi/boom';
|
|||
import type { ElasticsearchClient, Logger } from '@kbn/core/server';
|
||||
|
||||
import { ElasticsearchAssetType } from '../../../../types';
|
||||
import { getPipelineNameForDatastream } from '../../../../../common';
|
||||
import { getPipelineNameForDatastream } from '../../../../../common/services';
|
||||
import type {
|
||||
RegistryDataStream,
|
||||
IndexTemplateEntry,
|
||||
|
|
|
@ -12,7 +12,7 @@ import type {
|
|||
import type { ElasticsearchClient, Logger } from '@kbn/core/server';
|
||||
|
||||
import type { InstallablePackage, RegistryDataStream } from '../../../../types';
|
||||
import { getRegistryDataStreamAssetBaseName } from '../../../../../common';
|
||||
import { getRegistryDataStreamAssetBaseName } from '../../../../../common/services';
|
||||
const LEGACY_TEMPLATE_SUFFIXES = ['@mappings', '@settings'];
|
||||
|
||||
const getComponentTemplateWithSuffix = (dataStream: RegistryDataStream, suffix: string) => {
|
||||
|
|
|
@ -16,7 +16,7 @@ import type {
|
|||
IndexTemplateMappings,
|
||||
} from '../../../../types';
|
||||
import { appContextService } from '../../..';
|
||||
import { getRegistryDataStreamAssetBaseName } from '../../../../../common';
|
||||
import { getRegistryDataStreamAssetBaseName } from '../../../../../common/services';
|
||||
import {
|
||||
FLEET_GLOBALS_COMPONENT_TEMPLATE_NAME,
|
||||
FLEET_AGENT_ID_VERIFY_COMPONENT_TEMPLATE_NAME,
|
||||
|
|
|
@ -18,7 +18,7 @@ import {
|
|||
ASSETS_SAVED_OBJECT_TYPE,
|
||||
PACKAGE_POLICY_SAVED_OBJECT_TYPE,
|
||||
SO_SEARCH_LIMIT,
|
||||
} from '../../../../common';
|
||||
} from '../../../../common/constants';
|
||||
import { PACKAGES_SAVED_OBJECT_TYPE, FLEET_INSTALL_FORMAT_VERSION } from '../../../constants';
|
||||
import type {
|
||||
AssetReference,
|
||||
|
|
|
@ -10,7 +10,7 @@ import type { SavedObjectsClientContract } from '@kbn/core/server';
|
|||
import { removeArchiveEntries } from '../archive/storage';
|
||||
|
||||
import { ASSETS_SAVED_OBJECT_TYPE, PACKAGE_POLICY_SAVED_OBJECT_TYPE } from '../../../../common';
|
||||
import type { PackageAssetReference } from '../../../../common';
|
||||
import type { PackageAssetReference } from '../../../../common/types';
|
||||
import { packagePolicyService } from '../../package_policy';
|
||||
import { appContextService } from '../..';
|
||||
|
||||
|
|
|
@ -13,7 +13,7 @@ import { SavedObjectsErrorHelpers } from '@kbn/core/server';
|
|||
import { savedObjectsClientMock } from '@kbn/core/server/mocks';
|
||||
|
||||
import { PACKAGES_SAVED_OBJECT_TYPE, PACKAGE_POLICY_SAVED_OBJECT_TYPE } from '../../../../common';
|
||||
import type { PackagePolicySOAttributes, RegistryPackage } from '../../../../common';
|
||||
import type { PackagePolicySOAttributes, RegistryPackage } from '../../../../common/types';
|
||||
|
||||
import * as Registry from '../registry';
|
||||
|
||||
|
|
|
@ -10,11 +10,11 @@ import semverGte from 'semver/functions/gte';
|
|||
import type { Logger } from '@kbn/core/server';
|
||||
|
||||
import {
|
||||
isPackageLimited,
|
||||
installationStatuses,
|
||||
PACKAGE_POLICY_SAVED_OBJECT_TYPE,
|
||||
} from '../../../../common';
|
||||
import type { PackageUsageStats, PackagePolicySOAttributes } from '../../../../common';
|
||||
} from '../../../../common/constants';
|
||||
import { isPackageLimited } from '../../../../common/services';
|
||||
import type { PackageUsageStats, PackagePolicySOAttributes } from '../../../../common/types';
|
||||
import { PACKAGES_SAVED_OBJECT_TYPE } from '../../../constants';
|
||||
import type {
|
||||
ArchivePackage,
|
||||
|
|
|
@ -7,7 +7,8 @@
|
|||
|
||||
import type { SavedObject } from '@kbn/core/server';
|
||||
|
||||
import { installationStatuses, KibanaSavedObjectType } from '../../../../common';
|
||||
import { KibanaSavedObjectType } from '../../../../common/types';
|
||||
import { installationStatuses } from '../../../../common/constants';
|
||||
import { KibanaAssetType } from '../../../types';
|
||||
import type { AssetType, Installable, Installation } from '../../../types';
|
||||
|
||||
|
|
|
@ -35,7 +35,7 @@ import type {
|
|||
KibanaAssetType,
|
||||
PackageVerificationResult,
|
||||
} from '../../../types';
|
||||
import { AUTO_UPGRADE_POLICIES_PACKAGES } from '../../../../common';
|
||||
import { AUTO_UPGRADE_POLICIES_PACKAGES } from '../../../../common/constants';
|
||||
import { IngestManagerError, PackageOutdatedError } from '../../../errors';
|
||||
import { PACKAGES_SAVED_OBJECT_TYPE, MAX_TIME_COMPLETE_INSTALL } from '../../../constants';
|
||||
import { licenseService } from '../..';
|
||||
|
|
|
@ -13,7 +13,7 @@ import semverGte from 'semver/functions/gte';
|
|||
import type { Response } from 'node-fetch';
|
||||
import type { Logger } from '@kbn/logging';
|
||||
|
||||
import { splitPkgKey as split } from '../../../../common';
|
||||
import { splitPkgKey as split } from '../../../../common/services';
|
||||
|
||||
import { KibanaAssetType } from '../../../types';
|
||||
import type {
|
||||
|
|
|
@ -5,6 +5,6 @@
|
|||
* 2.0.
|
||||
*/
|
||||
|
||||
import { LicenseService } from '../../common';
|
||||
import { LicenseService } from '../../common/services';
|
||||
|
||||
export const licenseService = new LicenseService();
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
import type { ElasticsearchClient, SavedObjectsClientContract } from '@kbn/core/server';
|
||||
import semverLt from 'semver/functions/lt';
|
||||
|
||||
import type { UpgradePackagePolicyDryRunResponseItem } from '../../common';
|
||||
import type { UpgradePackagePolicyDryRunResponseItem } from '../../common/types';
|
||||
|
||||
import { PACKAGES_SAVED_OBJECT_TYPE, PACKAGE_POLICY_SAVED_OBJECT_TYPE } from '../constants';
|
||||
|
||||
|
|
|
@ -16,7 +16,8 @@ import {
|
|||
OUTPUT_SAVED_OBJECT_TYPE,
|
||||
AGENT_POLICY_SAVED_OBJECT_TYPE,
|
||||
} from '../constants';
|
||||
import { decodeCloudId, normalizeHostsForAgents, SO_SEARCH_LIMIT, outputType } from '../../common';
|
||||
import { SO_SEARCH_LIMIT, outputType } from '../../common/constants';
|
||||
import { decodeCloudId, normalizeHostsForAgents } from '../../common/services';
|
||||
import {
|
||||
OutputUnauthorizedError,
|
||||
OutputInvalidError,
|
||||
|
|
|
@ -7,7 +7,8 @@
|
|||
|
||||
import type { SavedObjectsClientContract } from '@kbn/core/server';
|
||||
|
||||
import { SO_SEARCH_LIMIT, getMaxPackageName } from '../../../common';
|
||||
import { SO_SEARCH_LIMIT } from '../../../common/constants';
|
||||
import { getMaxPackageName } from '../../../common/services';
|
||||
import { PACKAGE_POLICY_SAVED_OBJECT_TYPE } from '../../constants';
|
||||
|
||||
import { packagePolicyService } from '../package_policy';
|
||||
|
|
|
@ -41,8 +41,8 @@ import type {
|
|||
NewPackagePolicy,
|
||||
NewPackagePolicyInput,
|
||||
PackagePolicyPackage,
|
||||
} from '../../common';
|
||||
import { packageToPackagePolicy } from '../../common';
|
||||
} from '../../common/types';
|
||||
import { packageToPackagePolicy } from '../../common/services';
|
||||
|
||||
import { IngestManagerError, PackagePolicyIneligibleForUpgradeError } from '../errors';
|
||||
|
||||
|
@ -129,8 +129,8 @@ jest.mock('./epm/packages', () => {
|
|||
};
|
||||
});
|
||||
|
||||
jest.mock('../../common', () => ({
|
||||
...jest.requireActual('../../common'),
|
||||
jest.mock('../../common/services/package_to_package_policy', () => ({
|
||||
...jest.requireActual('../../common/services/package_to_package_policy'),
|
||||
packageToPackagePolicy: jest.fn(),
|
||||
}));
|
||||
|
||||
|
|
|
@ -30,10 +30,8 @@ import {
|
|||
doesAgentPolicyAlreadyIncludePackage,
|
||||
validatePackagePolicy,
|
||||
validationHasErrors,
|
||||
SO_SEARCH_LIMIT,
|
||||
FLEET_APM_PACKAGE,
|
||||
outputType,
|
||||
} from '../../common';
|
||||
} from '../../common/services';
|
||||
import { SO_SEARCH_LIMIT, FLEET_APM_PACKAGE, outputType } from '../../common/constants';
|
||||
import type {
|
||||
DeletePackagePoliciesResponse,
|
||||
UpgradePackagePolicyResponse,
|
||||
|
@ -47,7 +45,7 @@ import type {
|
|||
UpgradePackagePolicyDryRunResponseItem,
|
||||
RegistryDataStream,
|
||||
PackagePolicyPackage,
|
||||
} from '../../common';
|
||||
} from '../../common/types';
|
||||
import { PACKAGE_POLICY_SAVED_OBJECT_TYPE } from '../constants';
|
||||
import {
|
||||
IngestManagerError,
|
||||
|
|
|
@ -17,10 +17,10 @@ import type {
|
|||
DownloadSource,
|
||||
PreconfiguredAgentPolicy,
|
||||
PreconfiguredPackage,
|
||||
PreconfigurationError,
|
||||
PackagePolicy,
|
||||
} from '../../common';
|
||||
import { PRECONFIGURATION_LATEST_KEYWORD } from '../../common';
|
||||
} from '../../common/types';
|
||||
import type { PreconfigurationError } from '../../common/constants';
|
||||
import { PRECONFIGURATION_LATEST_KEYWORD } from '../../common/constants';
|
||||
import { PRECONFIGURATION_DELETION_RECORD_SAVED_OBJECT_TYPE } from '../constants';
|
||||
|
||||
import { escapeSearchQueryPhrase } from './saved_object';
|
||||
|
|
|
@ -9,8 +9,8 @@ import type { ElasticsearchClient, SavedObjectsClientContract } from '@kbn/core/
|
|||
import { isEqual } from 'lodash';
|
||||
import { safeDump } from 'js-yaml';
|
||||
|
||||
import type { PreconfiguredOutput, Output } from '../../../common';
|
||||
import { normalizeHostsForAgents } from '../../../common';
|
||||
import type { PreconfiguredOutput, Output } from '../../../common/types';
|
||||
import { normalizeHostsForAgents } from '../../../common/services';
|
||||
import type { FleetConfigType } from '../../config';
|
||||
import { DEFAULT_OUTPUT_ID, DEFAULT_OUTPUT } from '../../constants';
|
||||
import { outputService } from '../output';
|
||||
|
|
|
@ -9,13 +9,9 @@ import Boom from '@hapi/boom';
|
|||
import { isEqual } from 'lodash';
|
||||
import type { SavedObjectsClientContract } from '@kbn/core/server';
|
||||
|
||||
import {
|
||||
decodeCloudId,
|
||||
GLOBAL_SETTINGS_SAVED_OBJECT_TYPE,
|
||||
GLOBAL_SETTINGS_ID,
|
||||
normalizeHostsForAgents,
|
||||
} from '../../common';
|
||||
import type { SettingsSOAttributes, Settings, BaseSettings } from '../../common';
|
||||
import { decodeCloudId, normalizeHostsForAgents } from '../../common/services';
|
||||
import { GLOBAL_SETTINGS_SAVED_OBJECT_TYPE, GLOBAL_SETTINGS_ID } from '../../common/constants';
|
||||
import type { SettingsSOAttributes, Settings, BaseSettings } from '../../common/types';
|
||||
|
||||
import { appContextService } from './app_context';
|
||||
|
||||
|
|
|
@ -10,13 +10,13 @@ import pMap from 'p-map';
|
|||
import type { ElasticsearchClient, SavedObjectsClientContract } from '@kbn/core/server';
|
||||
import { DEFAULT_SPACE_ID } from '@kbn/spaces-plugin/common/constants';
|
||||
|
||||
import { AUTO_UPDATE_PACKAGES } from '../../common';
|
||||
import { AUTO_UPDATE_PACKAGES } from '../../common/constants';
|
||||
import type { PreconfigurationError } from '../../common/constants';
|
||||
import type {
|
||||
DefaultPackagesInstallationError,
|
||||
PreconfigurationError,
|
||||
BundledPackage,
|
||||
Installation,
|
||||
} from '../../common';
|
||||
} from '../../common/types';
|
||||
|
||||
import { SO_SEARCH_LIMIT } from '../constants';
|
||||
|
||||
|
|
|
@ -14,7 +14,7 @@ import type {
|
|||
NewPackagePolicy,
|
||||
UpdatePackagePolicy,
|
||||
PackagePolicy,
|
||||
} from '../../common';
|
||||
} from '../../common/types';
|
||||
|
||||
export type PostPackagePolicyDeleteCallback = (
|
||||
deletedPackagePolicies: DeepReadonly<DeletePackagePoliciesResponse>
|
||||
|
|
|
@ -80,13 +80,9 @@ export type {
|
|||
PackageVerificationStatus,
|
||||
BulkInstallPackageInfo,
|
||||
PackageAssetReference,
|
||||
} from '../../common';
|
||||
export {
|
||||
ElasticsearchAssetType,
|
||||
KibanaAssetType,
|
||||
KibanaSavedObjectType,
|
||||
dataTypes,
|
||||
} from '../../common';
|
||||
} from '../../common/types';
|
||||
export { ElasticsearchAssetType, KibanaAssetType, KibanaSavedObjectType } from '../../common/types';
|
||||
export { dataTypes } from '../../common/constants';
|
||||
|
||||
export type AgentPolicyUpdateHandler = (
|
||||
action: 'created' | 'updated' | 'deleted',
|
||||
|
@ -99,7 +95,7 @@ export interface BulkActionResult {
|
|||
error?: Error;
|
||||
}
|
||||
|
||||
import type { PackageVerificationStatus } from '../../common';
|
||||
import type { PackageVerificationStatus } from '../../common/types';
|
||||
export interface PackageVerificationResult {
|
||||
verificationKeyId?: string;
|
||||
verificationStatus: PackageVerificationStatus;
|
||||
|
|
|
@ -7,7 +7,11 @@
|
|||
|
||||
import { schema } from '@kbn/config-schema';
|
||||
|
||||
import { AGENT_TYPE_EPHEMERAL, AGENT_TYPE_PERMANENT, AGENT_TYPE_TEMPORARY } from '../../../common';
|
||||
import {
|
||||
AGENT_TYPE_EPHEMERAL,
|
||||
AGENT_TYPE_PERMANENT,
|
||||
AGENT_TYPE_TEMPORARY,
|
||||
} from '../../../common/constants';
|
||||
|
||||
export const AgentTypeSchema = schema.oneOf([
|
||||
schema.literal(AGENT_TYPE_EPHEMERAL),
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
|
||||
import { schema } from '@kbn/config-schema';
|
||||
|
||||
import { agentPolicyStatuses, dataTypes } from '../../../common';
|
||||
import { agentPolicyStatuses, dataTypes } from '../../../common/constants';
|
||||
|
||||
import { PackagePolicySchema, NamespaceSchema } from './package_policy';
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
|
||||
import { schema } from '@kbn/config-schema';
|
||||
|
||||
import { isValidNamespace } from '../../../common';
|
||||
import { isValidNamespace } from '../../../common/services';
|
||||
|
||||
export const NamespaceSchema = schema.string({
|
||||
minLength: 1,
|
||||
|
|
|
@ -9,7 +9,7 @@ import { schema } from '@kbn/config-schema';
|
|||
import semverValid from 'semver/functions/valid';
|
||||
|
||||
import { PRECONFIGURATION_LATEST_KEYWORD } from '../../constants';
|
||||
import type { PreconfiguredOutput } from '../../../common';
|
||||
import type { PreconfiguredOutput } from '../../../common/types';
|
||||
|
||||
import { AgentPolicyBaseSchema } from './agent_policy';
|
||||
import { NamespaceSchema } from './package_policy';
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
|
||||
import { schema } from '@kbn/config-schema';
|
||||
|
||||
import { isDiffPathProtocol } from '../../../common';
|
||||
import { isDiffPathProtocol } from '../../../common/services';
|
||||
|
||||
export const GetSettingsRequestSchema = {};
|
||||
|
||||
|
|
|
@ -25,7 +25,8 @@ import type { KibanaResponseFactory, RequestHandler, RouteConfig } from '@kbn/co
|
|||
import { ENDPOINTS_ACTION_LIST_ROUTE } from '../../../../common/endpoint/constants';
|
||||
import { EndpointAppContextService } from '../../endpoint_app_context_services';
|
||||
import { createMockConfig } from '../../../lib/detection_engine/routes/__mocks__';
|
||||
import { LicenseService, parseExperimentalConfigValue } from '@kbn/fleet-plugin/common';
|
||||
import { LicenseService } from '../../../../common/license';
|
||||
import { parseExperimentalConfigValue } from '../../../../common/experimental_features';
|
||||
import { Subject } from 'rxjs';
|
||||
import type { ILicense } from '@kbn/licensing-plugin/common/types';
|
||||
import { licenseMock } from '@kbn/licensing-plugin/common/licensing.mock';
|
||||
|
@ -69,7 +70,6 @@ describe('Action List Route', () => {
|
|||
endpointAppContextService.setup(createMockEndpointAppContextServiceSetupContract());
|
||||
endpointAppContextService.start({
|
||||
...startContract,
|
||||
// @ts-expect-error
|
||||
licenseService,
|
||||
});
|
||||
|
||||
|
@ -77,7 +77,6 @@ describe('Action List Route', () => {
|
|||
logFactory: loggingSystemMock.create(),
|
||||
service: endpointAppContextService,
|
||||
config: () => Promise.resolve(createMockConfig()),
|
||||
// @ts-expect-error
|
||||
experimentalFeatures: parseExperimentalConfigValue(createMockConfig().enableExperimental),
|
||||
});
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
import type { Client } from '@elastic/elasticsearch';
|
||||
import expect from '@kbn/expect';
|
||||
import { sortBy } from 'lodash';
|
||||
import { AssetReference } from '@kbn/fleet-plugin/common';
|
||||
import { AssetReference } from '@kbn/fleet-plugin/common/types';
|
||||
import { FLEET_INSTALL_FORMAT_VERSION } from '@kbn/fleet-plugin/server/constants';
|
||||
import { FtrProviderContext } from '../../../api_integration/ftr_provider_context';
|
||||
import { skipIfNoDockerRegistry } from '../../helpers';
|
||||
|
|
|
@ -6,7 +6,10 @@
|
|||
*/
|
||||
|
||||
import expect from '@kbn/expect';
|
||||
import { PACKAGES_SAVED_OBJECT_TYPE, MAX_TIME_COMPLETE_INSTALL } from '@kbn/fleet-plugin/common';
|
||||
import {
|
||||
PACKAGES_SAVED_OBJECT_TYPE,
|
||||
MAX_TIME_COMPLETE_INSTALL,
|
||||
} from '@kbn/fleet-plugin/common/constants';
|
||||
import { FtrProviderContext } from '../../../api_integration/ftr_provider_context';
|
||||
import { skipIfNoDockerRegistry } from '../../helpers';
|
||||
import { setupFleetAndAgents } from '../agents/services';
|
||||
|
|
|
@ -6,7 +6,10 @@
|
|||
*/
|
||||
|
||||
import expect from '@kbn/expect';
|
||||
import { PACKAGES_SAVED_OBJECT_TYPE, MAX_TIME_COMPLETE_INSTALL } from '@kbn/fleet-plugin/common';
|
||||
import {
|
||||
PACKAGES_SAVED_OBJECT_TYPE,
|
||||
MAX_TIME_COMPLETE_INSTALL,
|
||||
} from '@kbn/fleet-plugin/common/constants';
|
||||
import { skipIfNoDockerRegistry } from '../../helpers';
|
||||
import { FtrProviderContext } from '../../../api_integration/ftr_provider_context';
|
||||
import { setupFleetAndAgents } from '../agents/services';
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
*/
|
||||
|
||||
import expect from '@kbn/expect';
|
||||
import { GetInfoResponse, InstalledRegistry } from '@kbn/fleet-plugin/common';
|
||||
import { GetInfoResponse, InstalledRegistry } from '@kbn/fleet-plugin/common/types';
|
||||
import { FtrProviderContext } from '../../../api_integration/ftr_provider_context';
|
||||
import { skipIfNoDockerRegistry } from '../../helpers';
|
||||
import { setupFleetAndAgents } from '../agents/services';
|
||||
|
|
|
@ -8,7 +8,7 @@ import expect from '@kbn/expect';
|
|||
import {
|
||||
UpgradePackagePolicyDryRunResponse,
|
||||
UpgradePackagePolicyResponse,
|
||||
} from '@kbn/fleet-plugin/common';
|
||||
} from '@kbn/fleet-plugin/common/types';
|
||||
import { FtrProviderContext } from '../../../api_integration/ftr_provider_context';
|
||||
import { skipIfNoDockerRegistry } from '../../helpers';
|
||||
import { setupFleetAndAgents } from '../agents/services';
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue