From 5c93286e23a2dd6d4f36314700a14fc9f312f2cf Mon Sep 17 00:00:00 2001 From: semd Date: Tue, 29 Aug 2023 00:21:56 +0200 Subject: [PATCH] split package exports for optimization --- src/plugins/files/common/index.ts | 8 +------ .../features/app_features.ts | 10 ++++++++ .../security-solution/features/config.ts | 12 ++++++++++ .../security-solution/features/index.ts | 13 ----------- .../security-solution/features/keys.ts | 8 +++++++ .../security-solution/features/privileges.ts | 7 ++++++ .../security-solution/features/tsconfig.json | 12 ++++++---- .../upselling/service/index.ts | 7 +++++- .../security_solution/common/constants.ts | 4 ++-- .../turn_off_policy_protections.test.ts | 2 +- .../migrations/turn_off_policy_protections.ts | 2 +- .../manifest_manager/manifest_manager.mock.ts | 2 +- .../manifest_manager/manifest_manager.ts | 3 ++- .../fleet_integration.test.ts | 2 +- .../fleet_integration/fleet_integration.ts | 2 +- .../handlers/create_default_policy.test.ts | 2 +- .../handlers/create_default_policy.ts | 2 +- .../app_features_service.ts | 2 +- .../server/lib/app_features_service/mocks.ts | 5 ++-- .../server/lib/app_features_service/types.ts | 4 ++-- .../app_features/cases_app_features_config.ts | 14 +++++------ .../security_app_features_config.ts | 23 +++++++++++-------- .../security_assistant_app_features_config.ts | 17 ++++++++------ .../common/pli/pli_config.ts | 3 ++- .../common/pli/pli_features.ts | 2 +- .../public/upselling/register_upsellings.tsx | 8 +++---- .../app_features/cases_app_features_config.ts | 15 ++++++------ .../security_app_features_config.ts | 16 ++++++------- .../security_assistant_app_features_config.ts | 17 ++++++++------ .../tsconfig.json | 2 -- 30 files changed, 132 insertions(+), 94 deletions(-) create mode 100644 x-pack/packages/security-solution/features/app_features.ts create mode 100644 x-pack/packages/security-solution/features/config.ts create mode 100644 x-pack/packages/security-solution/features/keys.ts create mode 100644 x-pack/packages/security-solution/features/privileges.ts diff --git a/src/plugins/files/common/index.ts b/src/plugins/files/common/index.ts index d2932e60b9c8e..96319e9651dc2 100755 --- a/src/plugins/files/common/index.ts +++ b/src/plugins/files/common/index.ts @@ -6,13 +6,7 @@ * Side Public License, v 1. */ -export { - PLUGIN_ID, - PLUGIN_NAME, - ES_FIXED_SIZE_INDEX_BLOB_STORE, - FILE_SO_TYPE, - FILE_SHARE_SO_TYPE, -} from './constants'; +export { FILE_SO_TYPE, PLUGIN_ID, PLUGIN_NAME, ES_FIXED_SIZE_INDEX_BLOB_STORE } from './constants'; export type { File, diff --git a/x-pack/packages/security-solution/features/app_features.ts b/x-pack/packages/security-solution/features/app_features.ts new file mode 100644 index 0000000000000..b9209441cff85 --- /dev/null +++ b/x-pack/packages/security-solution/features/app_features.ts @@ -0,0 +1,10 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +export { getSecurityFeature } from './src/security'; +export { getCasesFeature } from './src/cases'; +export { getAssistantFeature } from './src/assistant'; diff --git a/x-pack/packages/security-solution/features/config.ts b/x-pack/packages/security-solution/features/config.ts new file mode 100644 index 0000000000000..8f382fc13487f --- /dev/null +++ b/x-pack/packages/security-solution/features/config.ts @@ -0,0 +1,12 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +export { securityDefaultAppFeaturesConfig } from './src/security/app_feature_config'; +export { getCasesDefaultAppFeaturesConfig } from './src/cases/app_feature_config'; +export { assistantDefaultAppFeaturesConfig } from './src/assistant/app_feature_config'; + +export { createEnabledAppFeaturesConfigMap } from './src/helpers'; diff --git a/x-pack/packages/security-solution/features/index.ts b/x-pack/packages/security-solution/features/index.ts index c83d3f0458829..a7fe0b5131c73 100644 --- a/x-pack/packages/security-solution/features/index.ts +++ b/x-pack/packages/security-solution/features/index.ts @@ -4,17 +4,4 @@ * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ -export { AppFeaturesPrivileges } from './src/app_features_privileges'; -export { ASSISTANT_FEATURE_ID, CASES_FEATURE_ID } from './src/constants'; -export * from './src/app_features_keys'; export * from './src/types'; - -export { getSecurityFeature } from './src/security'; -export { getCasesFeature } from './src/cases'; -export { getAssistantFeature } from './src/assistant'; - -export { securityDefaultAppFeaturesConfig } from './src/security/app_feature_config'; -export { getCasesDefaultAppFeaturesConfig } from './src/cases/app_feature_config'; -export { assistantDefaultAppFeaturesConfig } from './src/assistant/app_feature_config'; - -export { createEnabledAppFeaturesConfigMap } from './src/helpers'; diff --git a/x-pack/packages/security-solution/features/keys.ts b/x-pack/packages/security-solution/features/keys.ts new file mode 100644 index 0000000000000..11063c154567c --- /dev/null +++ b/x-pack/packages/security-solution/features/keys.ts @@ -0,0 +1,8 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +export * from './src/app_features_keys'; diff --git a/x-pack/packages/security-solution/features/privileges.ts b/x-pack/packages/security-solution/features/privileges.ts new file mode 100644 index 0000000000000..2e5a99095e4f5 --- /dev/null +++ b/x-pack/packages/security-solution/features/privileges.ts @@ -0,0 +1,7 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ +export { AppFeaturesPrivilegeId, AppFeaturesPrivileges } from './src/app_features_privileges'; diff --git a/x-pack/packages/security-solution/features/tsconfig.json b/x-pack/packages/security-solution/features/tsconfig.json index 0e5ab0aaf7bfb..2c153f831721d 100644 --- a/x-pack/packages/security-solution/features/tsconfig.json +++ b/x-pack/packages/security-solution/features/tsconfig.json @@ -2,10 +2,13 @@ "extends": "../../../../tsconfig.base.json", "compilerOptions": { "outDir": "target/types", - "types": ["jest", "node"] + "types": [ + "jest", + "node", + "react", + ] }, - "include": ["**/*.ts"], - "exclude": ["target/**/*"], + "include": ["**/*.ts", "**/*.tsx"], "kbn_references": [ "@kbn/features-plugin", "@kbn/utility-types", @@ -14,5 +17,6 @@ "@kbn/cases-plugin", "@kbn/securitysolution-rules", "@kbn/securitysolution-list-constants", - ] + ], + "exclude": ["target/**/*"] } diff --git a/x-pack/packages/security-solution/upselling/service/index.ts b/x-pack/packages/security-solution/upselling/service/index.ts index d1cbf5bca70a8..6a71fd9dde2ca 100644 --- a/x-pack/packages/security-solution/upselling/service/index.ts +++ b/x-pack/packages/security-solution/upselling/service/index.ts @@ -5,4 +5,9 @@ * 2.0. */ export { UpsellingService } from './upselling_service'; -export * from './types'; +export type { + PageUpsellings, + SectionUpsellings, + UpsellingSectionId, + UpsellingMessageId, +} from './types'; diff --git a/x-pack/plugins/security_solution/common/constants.ts b/x-pack/plugins/security_solution/common/constants.ts index 5f8a50ce69bdc..6ade0511ec493 100644 --- a/x-pack/plugins/security_solution/common/constants.ts +++ b/x-pack/plugins/security_solution/common/constants.ts @@ -7,11 +7,9 @@ import { RuleNotifyWhen } from '@kbn/alerting-plugin/common'; import type { AddOptionsListControlProps } from '@kbn/controls-plugin/public'; - import * as i18n from './translations'; export { SecurityPageName } from '@kbn/security-solution-navigation'; -export { ASSISTANT_FEATURE_ID, CASES_FEATURE_ID } from '@kbn/security-solution-features'; /** * as const @@ -22,6 +20,8 @@ export { ASSISTANT_FEATURE_ID, CASES_FEATURE_ID } from '@kbn/security-solution-f */ export const APP_ID = 'securitySolution' as const; export const APP_UI_ID = 'securitySolutionUI' as const; +export const ASSISTANT_FEATURE_ID = 'securitySolutionAssistant' as const; +export const CASES_FEATURE_ID = 'securitySolutionCases' as const; export const SERVER_APP_ID = 'siem' as const; export const APP_NAME = 'Security' as const; export const APP_ICON = 'securityAnalyticsApp' as const; diff --git a/x-pack/plugins/security_solution/server/endpoint/migrations/turn_off_policy_protections.test.ts b/x-pack/plugins/security_solution/server/endpoint/migrations/turn_off_policy_protections.test.ts index 2d311a2ae547a..519d864b726e7 100644 --- a/x-pack/plugins/security_solution/server/endpoint/migrations/turn_off_policy_protections.test.ts +++ b/x-pack/plugins/security_solution/server/endpoint/migrations/turn_off_policy_protections.test.ts @@ -10,7 +10,7 @@ import type { Logger } from '@kbn/logging'; import type { ElasticsearchClient } from '@kbn/core-elasticsearch-server'; import type { EndpointInternalFleetServicesInterface } from '../services/fleet'; -import { ALL_APP_FEATURE_KEYS } from '../../../common'; +import { ALL_APP_FEATURE_KEYS } from '@kbn/security-solution-features/keys'; import { turnOffPolicyProtectionsIfNotSupported } from './turn_off_policy_protections'; import { FleetPackagePolicyGenerator } from '../../../common/endpoint/data_generators/fleet_package_policy_generator'; import type { PolicyData } from '../../../common/endpoint/types'; diff --git a/x-pack/plugins/security_solution/server/endpoint/migrations/turn_off_policy_protections.ts b/x-pack/plugins/security_solution/server/endpoint/migrations/turn_off_policy_protections.ts index 349330e97e0f6..13bdb1496da48 100644 --- a/x-pack/plugins/security_solution/server/endpoint/migrations/turn_off_policy_protections.ts +++ b/x-pack/plugins/security_solution/server/endpoint/migrations/turn_off_policy_protections.ts @@ -8,7 +8,7 @@ import type { Logger, ElasticsearchClient } from '@kbn/core/server'; import type { UpdatePackagePolicy } from '@kbn/fleet-plugin/common'; import type { AuthenticatedUser } from '@kbn/security-plugin/common'; -import { AppFeatureSecurityKey } from '@kbn/security-solution-features'; +import { AppFeatureSecurityKey } from '@kbn/security-solution-features/keys'; import { isPolicySetToEventCollectionOnly, ensureOnlyEventCollectionIsAllowed, diff --git a/x-pack/plugins/security_solution/server/endpoint/services/artifacts/manifest_manager/manifest_manager.mock.ts b/x-pack/plugins/security_solution/server/endpoint/services/artifacts/manifest_manager/manifest_manager.mock.ts index dc92a4288fcee..442708e625d84 100644 --- a/x-pack/plugins/security_solution/server/endpoint/services/artifacts/manifest_manager/manifest_manager.mock.ts +++ b/x-pack/plugins/security_solution/server/endpoint/services/artifacts/manifest_manager/manifest_manager.mock.ts @@ -16,6 +16,7 @@ import { createPackagePolicyServiceMock } from '@kbn/fleet-plugin/server/mocks'; import type { ExceptionListClient } from '@kbn/lists-plugin/server'; import { listMock } from '@kbn/lists-plugin/server/mocks'; import type { ExceptionListItemSchema } from '@kbn/securitysolution-io-ts-list-types'; +import type { AppFeatureKeys } from '@kbn/security-solution-features'; import { createPackagePolicyWithInitialManifestMock, createPackagePolicyWithManifestMock, @@ -28,7 +29,6 @@ import type { ManifestManagerContext } from './manifest_manager'; import { ManifestManager } from './manifest_manager'; import { parseExperimentalConfigValue } from '../../../../../common/experimental_features'; import { createAppFeaturesServiceMock } from '../../../../lib/app_features_service/mocks'; -import type { AppFeatureKeys } from '../../../../../common'; import type { AppFeaturesService } from '../../../../lib/app_features_service/app_features_service'; export const createExceptionListResponse = (data: ExceptionListItemSchema[], total?: number) => ({ diff --git a/x-pack/plugins/security_solution/server/endpoint/services/artifacts/manifest_manager/manifest_manager.ts b/x-pack/plugins/security_solution/server/endpoint/services/artifacts/manifest_manager/manifest_manager.ts index 71c98bc6d4399..1cda8bdd9533b 100644 --- a/x-pack/plugins/security_solution/server/endpoint/services/artifacts/manifest_manager/manifest_manager.ts +++ b/x-pack/plugins/security_solution/server/endpoint/services/artifacts/manifest_manager/manifest_manager.ts @@ -20,8 +20,9 @@ import type { ListResult, PackagePolicy } from '@kbn/fleet-plugin/common'; import type { Artifact, PackagePolicyClient } from '@kbn/fleet-plugin/server'; import type { ExceptionListClient } from '@kbn/lists-plugin/server'; import type { ExceptionListItemSchema } from '@kbn/securitysolution-io-ts-list-types'; +import { AppFeatureKey } from '@kbn/security-solution-features/keys'; import type { AppFeaturesService } from '../../../../lib/app_features_service/app_features_service'; -import { AppFeatureKey, type ExperimentalFeatures } from '../../../../../common'; +import type { ExperimentalFeatures } from '../../../../../common'; import type { ManifestSchemaVersion } from '../../../../../common/endpoint/schema/common'; import { manifestDispatchSchema, diff --git a/x-pack/plugins/security_solution/server/fleet_integration/fleet_integration.test.ts b/x-pack/plugins/security_solution/server/fleet_integration/fleet_integration.test.ts index 8f6ceee69232f..e2ce386337a85 100644 --- a/x-pack/plugins/security_solution/server/fleet_integration/fleet_integration.test.ts +++ b/x-pack/plugins/security_solution/server/fleet_integration/fleet_integration.test.ts @@ -30,6 +30,7 @@ import { getPackagePolicyUpdateCallback, } from './fleet_integration'; import type { KibanaRequest } from '@kbn/core/server'; +import { ALL_APP_FEATURE_KEYS } from '@kbn/security-solution-features/keys'; import { requestContextMock } from '../lib/detection_engine/routes/__mocks__'; import { requestContextFactoryMock } from '../request_context_factory.mock'; import type { EndpointAppContextServiceStartContract } from '../endpoint/endpoint_app_context_services'; @@ -54,7 +55,6 @@ import { createMockPolicyData } from '../endpoint/services/feature_usage/mocks'; import { ALL_ENDPOINT_ARTIFACT_LIST_IDS } from '../../common/endpoint/service/artifacts/constants'; import { ENDPOINT_EVENT_FILTERS_LIST_ID } from '@kbn/securitysolution-list-constants'; import { disableProtections } from '../../common/endpoint/models/policy_config_helpers'; -import { ALL_APP_FEATURE_KEYS } from '../../common'; import type { AppFeaturesService } from '../lib/app_features_service/app_features_service'; import { createAppFeaturesServiceMock } from '../lib/app_features_service/mocks'; diff --git a/x-pack/plugins/security_solution/server/fleet_integration/fleet_integration.ts b/x-pack/plugins/security_solution/server/fleet_integration/fleet_integration.ts index 9b96fbb150bac..554417eee480d 100644 --- a/x-pack/plugins/security_solution/server/fleet_integration/fleet_integration.ts +++ b/x-pack/plugins/security_solution/server/fleet_integration/fleet_integration.ts @@ -22,7 +22,7 @@ import type { } from '@kbn/fleet-plugin/common'; import type { CloudSetup } from '@kbn/cloud-plugin/server'; import type { InfoResponse } from '@elastic/elasticsearch/lib/api/types'; -import { AppFeatureSecurityKey } from '@kbn/security-solution-features'; +import { AppFeatureSecurityKey } from '@kbn/security-solution-features/keys'; import { isPolicySetToEventCollectionOnly, ensureOnlyEventCollectionIsAllowed, diff --git a/x-pack/plugins/security_solution/server/fleet_integration/handlers/create_default_policy.test.ts b/x-pack/plugins/security_solution/server/fleet_integration/handlers/create_default_policy.test.ts index 033523b77f9a9..03abd2a6b1fb1 100644 --- a/x-pack/plugins/security_solution/server/fleet_integration/handlers/create_default_policy.test.ts +++ b/x-pack/plugins/security_solution/server/fleet_integration/handlers/create_default_policy.test.ts @@ -8,6 +8,7 @@ import { Subject } from 'rxjs'; import type { ILicense } from '@kbn/licensing-plugin/common/types'; import { licenseMock } from '@kbn/licensing-plugin/common/licensing.mock'; import { cloudMock } from '@kbn/cloud-plugin/server/mocks'; +import { ALL_APP_FEATURE_KEYS } from '@kbn/security-solution-features/keys'; import { LicenseService } from '../../../common/license'; import { createDefaultPolicy } from './create_default_policy'; import { ProtectionModes } from '../../../common/endpoint/types'; @@ -19,7 +20,6 @@ import type { PolicyCreateCloudConfig, PolicyCreateEndpointConfig, } from '../types'; -import { ALL_APP_FEATURE_KEYS } from '../../../common'; import type { AppFeaturesService } from '../../lib/app_features_service/app_features_service'; import { createAppFeaturesServiceMock } from '../../lib/app_features_service/mocks'; diff --git a/x-pack/plugins/security_solution/server/fleet_integration/handlers/create_default_policy.ts b/x-pack/plugins/security_solution/server/fleet_integration/handlers/create_default_policy.ts index 38185a07b614a..0dda27872af0e 100644 --- a/x-pack/plugins/security_solution/server/fleet_integration/handlers/create_default_policy.ts +++ b/x-pack/plugins/security_solution/server/fleet_integration/handlers/create_default_policy.ts @@ -7,7 +7,7 @@ import type { CloudSetup } from '@kbn/cloud-plugin/server'; import type { InfoResponse } from '@elastic/elasticsearch/lib/api/types'; -import { AppFeatureSecurityKey } from '@kbn/security-solution-features'; +import { AppFeatureSecurityKey } from '@kbn/security-solution-features/keys'; import { policyFactory as policyConfigFactory, policyFactoryWithoutPaidFeatures as policyConfigFactoryWithoutPaidFeatures, diff --git a/x-pack/plugins/security_solution/server/lib/app_features_service/app_features_service.ts b/x-pack/plugins/security_solution/server/lib/app_features_service/app_features_service.ts index 4948e5e4768c9..871a2ecb80585 100644 --- a/x-pack/plugins/security_solution/server/lib/app_features_service/app_features_service.ts +++ b/x-pack/plugins/security_solution/server/lib/app_features_service/app_features_service.ts @@ -19,7 +19,7 @@ import { getSecurityFeature, getCasesFeature, getAssistantFeature, -} from '@kbn/security-solution-features'; +} from '@kbn/security-solution-features/app_features'; import type { ExperimentalFeatures } from '../../../common'; import { AppFeatures } from './app_features'; import type { AppFeaturesConfigurator } from './types'; diff --git a/x-pack/plugins/security_solution/server/lib/app_features_service/mocks.ts b/x-pack/plugins/security_solution/server/lib/app_features_service/mocks.ts index 40e7158611404..4f47befce92b9 100644 --- a/x-pack/plugins/security_solution/server/lib/app_features_service/mocks.ts +++ b/x-pack/plugins/security_solution/server/lib/app_features_service/mocks.ts @@ -10,7 +10,8 @@ import type { PluginSetupContract as FeaturesPluginSetup } from '@kbn/features-p import { loggingSystemMock } from '@kbn/core-logging-server-mocks'; import { featuresPluginMock } from '@kbn/features-plugin/server/mocks'; -import { ALL_APP_FEATURE_KEYS, type AppFeatureKeys } from '@kbn/security-solution-features'; +import type { AppFeatureKeys } from '@kbn/security-solution-features'; +import { ALL_APP_FEATURE_KEYS } from '@kbn/security-solution-features/keys'; import { allowedExperimentalValues, type ExperimentalFeatures } from '../../../common'; import { AppFeaturesService } from './app_features_service'; @@ -26,7 +27,7 @@ const ASSISTANT_BASE_CONFIG = { bar: 'bar', }; -jest.mock('@kbn/security-solution-features', () => ({ +jest.mock('@kbn/security-solution-features/app_features', () => ({ getSecurityFeature: jest.fn(() => ({ baseKibanaFeature: SECURITY_BASE_CONFIG, baseKibanaSubFeatureIds: ['subFeature1'], diff --git a/x-pack/plugins/security_solution/server/lib/app_features_service/types.ts b/x-pack/plugins/security_solution/server/lib/app_features_service/types.ts index 167741c0ab1e6..b2d1054985c4c 100644 --- a/x-pack/plugins/security_solution/server/lib/app_features_service/types.ts +++ b/x-pack/plugins/security_solution/server/lib/app_features_service/types.ts @@ -5,12 +5,12 @@ * 2.0. */ +import type { AppFeaturesConfig } from '@kbn/security-solution-features'; import type { - AppFeaturesConfig, SecuritySubFeatureId, CasesSubFeatureId, AssistantSubFeatureId, -} from '@kbn/security-solution-features'; +} from '@kbn/security-solution-features/keys'; import type { ExperimentalFeatures } from '../../../common'; export interface AppFeaturesConfigurator { diff --git a/x-pack/plugins/security_solution_ess/server/app_features/cases_app_features_config.ts b/x-pack/plugins/security_solution_ess/server/app_features/cases_app_features_config.ts index 506d07e16b437..58dcaee8f94ff 100644 --- a/x-pack/plugins/security_solution_ess/server/app_features/cases_app_features_config.ts +++ b/x-pack/plugins/security_solution_ess/server/app_features/cases_app_features_config.ts @@ -4,16 +4,16 @@ * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ - -import type { AppFeatureCasesKey } from '@kbn/security-solution-features'; +import type { + AppFeatureKibanaConfig, + AppFeaturesCasesConfig, + AppFeatureKeys, +} from '@kbn/security-solution-features'; +import type { AppFeatureCasesKey, CasesSubFeatureId } from '@kbn/security-solution-features/keys'; import { getCasesDefaultAppFeaturesConfig, createEnabledAppFeaturesConfigMap, - type AppFeatureKibanaConfig, - type AppFeaturesCasesConfig, - type AppFeatureKeys, - type CasesSubFeatureId, -} from '@kbn/security-solution-features'; +} from '@kbn/security-solution-features/config'; import { CASES_CONNECTORS_CAPABILITY, diff --git a/x-pack/plugins/security_solution_ess/server/app_features/security_app_features_config.ts b/x-pack/plugins/security_solution_ess/server/app_features/security_app_features_config.ts index 88c52ee907da3..6badb63d30ed1 100644 --- a/x-pack/plugins/security_solution_ess/server/app_features/security_app_features_config.ts +++ b/x-pack/plugins/security_solution_ess/server/app_features/security_app_features_config.ts @@ -4,19 +4,24 @@ * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ - -import { type ExperimentalFeatures } from '@kbn/security-solution-plugin/common'; +import type { ExperimentalFeatures } from '@kbn/security-solution-plugin/common'; +import type { + AppFeatureKeys, + AppFeatureKibanaConfig, + AppFeaturesSecurityConfig, +} from '@kbn/security-solution-features'; import { AppFeatureSecurityKey, - AppFeaturesPrivileges, + type SecuritySubFeatureId, +} from '@kbn/security-solution-features/keys'; +import { securityDefaultAppFeaturesConfig, createEnabledAppFeaturesConfigMap, - type AppFeatureKeys, - type AppFeatureKibanaConfig, - type AppFeaturesSecurityConfig, - type SecuritySubFeatureId, -} from '@kbn/security-solution-features'; -import { AppFeaturesPrivilegeId } from '@kbn/security-solution-features/src/app_features_privileges'; +} from '@kbn/security-solution-features/config'; +import { + AppFeaturesPrivilegeId, + AppFeaturesPrivileges, +} from '@kbn/security-solution-features/privileges'; export const getSecurityAppFeaturesConfigurator = (enabledAppFeatureKeys: AppFeatureKeys) => diff --git a/x-pack/plugins/security_solution_ess/server/app_features/security_assistant_app_features_config.ts b/x-pack/plugins/security_solution_ess/server/app_features/security_assistant_app_features_config.ts index 5156437968be4..b17ebf859a29a 100644 --- a/x-pack/plugins/security_solution_ess/server/app_features/security_assistant_app_features_config.ts +++ b/x-pack/plugins/security_solution_ess/server/app_features/security_assistant_app_features_config.ts @@ -4,16 +4,19 @@ * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ - -import type { AppFeatureAssistantKey } from '@kbn/security-solution-features'; +import type { + AppFeatureKeys, + AppFeatureKibanaConfig, + AppFeaturesAssistantConfig, +} from '@kbn/security-solution-features'; import { assistantDefaultAppFeaturesConfig, createEnabledAppFeaturesConfigMap, - type AppFeatureKeys, - type AppFeatureKibanaConfig, - type AppFeaturesAssistantConfig, - type AssistantSubFeatureId, -} from '@kbn/security-solution-features'; +} from '@kbn/security-solution-features/config'; +import type { + AppFeatureAssistantKey, + AssistantSubFeatureId, +} from '@kbn/security-solution-features/keys'; export const getSecurityAssistantAppFeaturesConfigurator = (enabledAppFeatureKeys: AppFeatureKeys) => (): AppFeaturesAssistantConfig => { diff --git a/x-pack/plugins/security_solution_serverless/common/pli/pli_config.ts b/x-pack/plugins/security_solution_serverless/common/pli/pli_config.ts index fc9e5b022ddb2..1ef3da121b910 100644 --- a/x-pack/plugins/security_solution_serverless/common/pli/pli_config.ts +++ b/x-pack/plugins/security_solution_serverless/common/pli/pli_config.ts @@ -5,7 +5,8 @@ * 2.0. */ -import { AppFeatureKey, type AppFeatureKeys } from '@kbn/security-solution-features'; +import type { AppFeatureKeys } from '@kbn/security-solution-features'; +import { AppFeatureKey } from '@kbn/security-solution-features/keys'; import type { SecurityProductLine, SecurityProductTier } from '../config'; type PliAppFeatures = Readonly< diff --git a/x-pack/plugins/security_solution_serverless/common/pli/pli_features.ts b/x-pack/plugins/security_solution_serverless/common/pli/pli_features.ts index 5db2945f512e8..cd20bc6681b3f 100644 --- a/x-pack/plugins/security_solution_serverless/common/pli/pli_features.ts +++ b/x-pack/plugins/security_solution_serverless/common/pli/pli_features.ts @@ -5,7 +5,7 @@ * 2.0. */ -import type { AppFeatureKeys } from '@kbn/security-solution-plugin/common'; +import type { AppFeatureKeys } from '@kbn/security-solution-features/src/types'; import type { SecurityProductTypes } from '../config'; import { ProductTier } from '../product'; import { PLI_APP_FEATURES } from './pli_config'; diff --git a/x-pack/plugins/security_solution_serverless/public/upselling/register_upsellings.tsx b/x-pack/plugins/security_solution_serverless/public/upselling/register_upsellings.tsx index ae7eb38c62638..0facb5dc62abd 100644 --- a/x-pack/plugins/security_solution_serverless/public/upselling/register_upsellings.tsx +++ b/x-pack/plugins/security_solution_serverless/public/upselling/register_upsellings.tsx @@ -7,15 +7,15 @@ import { SecurityPageName } from '@kbn/security-solution-plugin/common'; import type { MessageUpsellings, + UpsellingMessageId, PageUpsellings, SectionUpsellings, UpsellingSectionId, - UpsellingMessageId, - UpsellingService, -} from '@kbn/security-solution-upselling/service'; +} from '@kbn/security-solution-upselling/service/types'; +import type { UpsellingService } from '@kbn/security-solution-upselling/service'; import React from 'react'; import { UPGRADE_INVESTIGATION_GUIDE } from '@kbn/security-solution-upselling/messages'; -import { AppFeatureKey } from '@kbn/security-solution-features'; +import { AppFeatureKey } from '@kbn/security-solution-features/src/app_features_keys'; import { EndpointPolicyProtectionsLazy } from './sections/endpoint_management'; import type { SecurityProductTypes } from '../../common/config'; import { getProductAppFeatures } from '../../common/pli/pli_features'; diff --git a/x-pack/plugins/security_solution_serverless/server/app_features/cases_app_features_config.ts b/x-pack/plugins/security_solution_serverless/server/app_features/cases_app_features_config.ts index 99d4fb292c15b..7e62866816cc3 100644 --- a/x-pack/plugins/security_solution_serverless/server/app_features/cases_app_features_config.ts +++ b/x-pack/plugins/security_solution_serverless/server/app_features/cases_app_features_config.ts @@ -4,17 +4,16 @@ * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ - -import type { AppFeatureCasesKey } from '@kbn/security-solution-features'; +import type { + AppFeatureKibanaConfig, + AppFeaturesCasesConfig, + AppFeatureKeys, +} from '@kbn/security-solution-features'; import { getCasesDefaultAppFeaturesConfig, createEnabledAppFeaturesConfigMap, - type AppFeatureKibanaConfig, - type AppFeaturesCasesConfig, - type AppFeatureKeys, - type CasesSubFeatureId, -} from '@kbn/security-solution-features'; - +} from '@kbn/security-solution-features/config'; +import type { AppFeatureCasesKey, CasesSubFeatureId } from '@kbn/security-solution-features/keys'; import { CASES_CONNECTORS_CAPABILITY, GET_CONNECTORS_CONFIGURE_API_TAG, diff --git a/x-pack/plugins/security_solution_serverless/server/app_features/security_app_features_config.ts b/x-pack/plugins/security_solution_serverless/server/app_features/security_app_features_config.ts index d992a81f2f976..a18e9c39d2f5a 100644 --- a/x-pack/plugins/security_solution_serverless/server/app_features/security_app_features_config.ts +++ b/x-pack/plugins/security_solution_serverless/server/app_features/security_app_features_config.ts @@ -4,17 +4,17 @@ * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ - -import { type ExperimentalFeatures } from '@kbn/security-solution-plugin/common'; +import type { ExperimentalFeatures } from '@kbn/security-solution-plugin/common'; +import type { + AppFeatureKeys, + AppFeatureKibanaConfig, + AppFeaturesSecurityConfig, +} from '@kbn/security-solution-features'; import { - AppFeatureSecurityKey, - SecuritySubFeatureId, securityDefaultAppFeaturesConfig, createEnabledAppFeaturesConfigMap, - type AppFeatureKeys, - type AppFeatureKibanaConfig, - type AppFeaturesSecurityConfig, -} from '@kbn/security-solution-features'; +} from '@kbn/security-solution-features/config'; +import { AppFeatureSecurityKey, SecuritySubFeatureId } from '@kbn/security-solution-features/keys'; export const getSecurityAppFeaturesConfigurator = (enabledAppFeatureKeys: AppFeatureKeys) => diff --git a/x-pack/plugins/security_solution_serverless/server/app_features/security_assistant_app_features_config.ts b/x-pack/plugins/security_solution_serverless/server/app_features/security_assistant_app_features_config.ts index 1b953cf761736..8c3971faee45e 100644 --- a/x-pack/plugins/security_solution_serverless/server/app_features/security_assistant_app_features_config.ts +++ b/x-pack/plugins/security_solution_serverless/server/app_features/security_assistant_app_features_config.ts @@ -4,16 +4,19 @@ * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ - -import type { AppFeatureAssistantKey } from '@kbn/security-solution-features'; +import type { + AppFeatureKeys, + AppFeatureKibanaConfig, + AppFeaturesAssistantConfig, +} from '@kbn/security-solution-features'; import { assistantDefaultAppFeaturesConfig, createEnabledAppFeaturesConfigMap, - type AppFeatureKeys, - type AppFeatureKibanaConfig, - type AppFeaturesAssistantConfig, - type AssistantSubFeatureId, -} from '@kbn/security-solution-features'; +} from '@kbn/security-solution-features/config'; +import type { + AppFeatureAssistantKey, + AssistantSubFeatureId, +} from '@kbn/security-solution-features/keys'; export const getSecurityAssistantAppFeaturesConfigurator = (enabledAppFeatureKeys: AppFeatureKeys) => (): AppFeaturesAssistantConfig => { diff --git a/x-pack/plugins/security_solution_serverless/tsconfig.json b/x-pack/plugins/security_solution_serverless/tsconfig.json index a2307776e7480..0f517caa077aa 100644 --- a/x-pack/plugins/security_solution_serverless/tsconfig.json +++ b/x-pack/plugins/security_solution_serverless/tsconfig.json @@ -10,8 +10,6 @@ "public/**/*.tsx", "server/**/*.ts", "../../../typings/**/*" - , - "../../packages/security-solution/upselling/sections/generic_upselling_section.tsx" ], "exclude": ["target/**/*"], "kbn_references": [