diff --git a/x-pack/plugins/aiops/public/cases/register_change_point_charts_attachment.tsx b/x-pack/plugins/aiops/public/cases/register_change_point_charts_attachment.tsx index d91a50ab13d36..3c76c2718b49e 100644 --- a/x-pack/plugins/aiops/public/cases/register_change_point_charts_attachment.tsx +++ b/x-pack/plugins/aiops/public/cases/register_change_point_charts_attachment.tsx @@ -8,7 +8,7 @@ import React from 'react'; import { i18n } from '@kbn/i18n'; import { FormattedMessage } from '@kbn/i18n-react'; -import type { CasesUiSetup } from '@kbn/cases-plugin/public'; +import type { CasesPublicSetup } from '@kbn/cases-plugin/public'; import type { CoreStart } from '@kbn/core/public'; import { CASES_ATTACHMENT_CHANGE_POINT_CHART, @@ -18,7 +18,7 @@ import { getEmbeddableChangePointChart } from '../embeddable/embeddable_change_p import { AiopsPluginStartDeps } from '../types'; export function registerChangePointChartsAttachment( - cases: CasesUiSetup, + cases: CasesPublicSetup, coreStart: CoreStart, pluginStart: AiopsPluginStartDeps ) { diff --git a/x-pack/plugins/aiops/public/hooks/use_aiops_app_context.ts b/x-pack/plugins/aiops/public/hooks/use_aiops_app_context.ts index c1903f6bba8ab..cc617c7bade1c 100644 --- a/x-pack/plugins/aiops/public/hooks/use_aiops_app_context.ts +++ b/x-pack/plugins/aiops/public/hooks/use_aiops_app_context.ts @@ -31,7 +31,7 @@ import type { import type { TimeRange as TimeRangeMs } from '@kbn/ml-date-picker'; import type { PresentationUtilPluginStart } from '@kbn/presentation-util-plugin/public'; import type { EmbeddableStart } from '@kbn/embeddable-plugin/public'; -import type { CasesUiStart } from '@kbn/cases-plugin/public'; +import type { CasesPublicStart } from '@kbn/cases-plugin/public'; import type { UsageCollectionSetup } from '@kbn/usage-collection-plugin/public'; import type { UiActionsStart } from '@kbn/ui-actions-plugin/public'; @@ -123,7 +123,7 @@ export interface AiopsAppDependencies { }; presentationUtil?: PresentationUtilPluginStart; embeddable?: EmbeddableStart; - cases?: CasesUiStart; + cases?: CasesPublicStart; isServerless?: boolean; /** Identifier to indicate the plugin utilizing the component */ embeddingOrigin?: string; diff --git a/x-pack/plugins/aiops/public/types.ts b/x-pack/plugins/aiops/public/types.ts index 0ecb0851572a4..8b416a515c342 100755 --- a/x-pack/plugins/aiops/public/types.ts +++ b/x-pack/plugins/aiops/public/types.ts @@ -16,13 +16,13 @@ import type { SharePluginStart } from '@kbn/share-plugin/public'; import type { UiActionsSetup, UiActionsStart } from '@kbn/ui-actions-plugin/public'; import type { UnifiedSearchPublicPluginStart } from '@kbn/unified-search-plugin/public'; import type { EmbeddableSetup, EmbeddableStart } from '@kbn/embeddable-plugin/public'; -import type { CasesUiSetup } from '@kbn/cases-plugin/public'; +import type { CasesPublicSetup } from '@kbn/cases-plugin/public'; import type { UsageCollectionSetup } from '@kbn/usage-collection-plugin/public'; import type { EmbeddableChangePointChartInput } from './embeddable/embeddable_change_point_chart'; export interface AiopsPluginSetupDeps { embeddable: EmbeddableSetup; - cases: CasesUiSetup; + cases: CasesPublicSetup; licensing: LicensingPluginSetup; uiActions: UiActionsSetup; diff --git a/x-pack/plugins/aiops/server/register_cases.ts b/x-pack/plugins/aiops/server/register_cases.ts index db05c0200d426..e7ceb8f398eeb 100644 --- a/x-pack/plugins/aiops/server/register_cases.ts +++ b/x-pack/plugins/aiops/server/register_cases.ts @@ -6,10 +6,10 @@ */ import type { Logger } from '@kbn/core/server'; -import type { CasesSetup } from '@kbn/cases-plugin/server'; +import type { CasesServerSetup } from '@kbn/cases-plugin/server'; import { CASES_ATTACHMENT_CHANGE_POINT_CHART } from '../common/constants'; -export function registerCasesPersistableState(cases: CasesSetup | undefined, logger: Logger) { +export function registerCasesPersistableState(cases: CasesServerSetup | undefined, logger: Logger) { if (cases) { try { cases.attachmentFramework.registerPersistableState({ diff --git a/x-pack/plugins/aiops/server/types.ts b/x-pack/plugins/aiops/server/types.ts index 2315b0ab01d69..58a2103d33a33 100755 --- a/x-pack/plugins/aiops/server/types.ts +++ b/x-pack/plugins/aiops/server/types.ts @@ -7,13 +7,13 @@ import type { PluginSetup, PluginStart } from '@kbn/data-plugin/server'; import type { LicensingPluginSetup } from '@kbn/licensing-plugin/server'; -import type { CasesSetup } from '@kbn/cases-plugin/server'; +import type { CasesServerSetup } from '@kbn/cases-plugin/server'; import type { UsageCollectionSetup } from '@kbn/usage-collection-plugin/server'; export interface AiopsPluginSetupDeps { data: PluginSetup; licensing: LicensingPluginSetup; - cases?: CasesSetup; + cases?: CasesServerSetup; usageCollection?: UsageCollectionSetup; } diff --git a/x-pack/plugins/cases/kibana.jsonc b/x-pack/plugins/cases/kibana.jsonc index 6b7cc4450985a..cd4fc787af2e0 100644 --- a/x-pack/plugins/cases/kibana.jsonc +++ b/x-pack/plugins/cases/kibana.jsonc @@ -15,19 +15,15 @@ "actions", "data", "embeddable", - "esUiShared", "lens", "licensing", "features", - "kibanaReact", - "kibanaUtils", "triggersActionsUi", "management", "security", "notifications", "ruleRegistry", "files", - "savedObjectsFinder", "contentManagement", "uiActions", ], @@ -38,7 +34,12 @@ "spaces", "serverless", ], - "requiredBundles": [], + "requiredBundles": [ + "esUiShared", + "kibanaReact", + "kibanaUtils", + "savedObjectsFinder", + ], "extraPublicDirs": [ "common" ] diff --git a/x-pack/plugins/cases/public/client/api/index.ts b/x-pack/plugins/cases/public/client/api/index.ts index 9493c5d6d94a2..822d8cea27377 100644 --- a/x-pack/plugins/cases/public/client/api/index.ts +++ b/x-pack/plugins/cases/public/client/api/index.ts @@ -16,9 +16,9 @@ import type { import { getCasesFromAlertsUrl } from '../../../common/api'; import { bulkGetCases, getCases, getCasesMetrics, getCasesStatus } from '../../api'; import type { CasesFindResponseUI, CasesStatus, CasesMetrics } from '../../../common/ui'; -import type { CasesUiStart } from '../../types'; +import type { CasesPublicStart } from '../../types'; -export const createClientAPI = ({ http }: { http: HttpStart }): CasesUiStart['api'] => { +export const createClientAPI = ({ http }: { http: HttpStart }): CasesPublicStart['api'] => { return { getRelatedCases: async ( alertId: string, diff --git a/x-pack/plugins/cases/public/common/lib/kibana/services.ts b/x-pack/plugins/cases/public/common/lib/kibana/services.ts index 1846548c5b2b4..1d2149bae811c 100644 --- a/x-pack/plugins/cases/public/common/lib/kibana/services.ts +++ b/x-pack/plugins/cases/public/common/lib/kibana/services.ts @@ -7,10 +7,10 @@ import type { CoreStart } from '@kbn/core/public'; import type { CasesUiConfigType } from '../../../../common/ui/types'; -import type { CasesPluginStart } from '../../../types'; +import type { CasesPublicStartDependencies } from '../../../types'; type GlobalServices = Pick & - Pick; + Pick; export class KibanaServices { private static kibanaVersion?: string; diff --git a/x-pack/plugins/cases/public/components/utils.ts b/x-pack/plugins/cases/public/components/utils.ts index 72fbbc24c15ec..13bff3b48fdc9 100644 --- a/x-pack/plugins/cases/public/components/utils.ts +++ b/x-pack/plugins/cases/public/components/utils.ts @@ -14,7 +14,7 @@ import type { import type { UserProfileWithAvatar } from '@kbn/user-profile-components'; import type { ConnectorTypeFields } from '../../common/types/domain'; import { ConnectorTypes } from '../../common/types/domain'; -import type { CasesPluginStart } from '../types'; +import type { CasesPublicStartDependencies } from '../types'; import { connectorValidator as swimlaneConnectorValidator } from './connectors/swimlane/validator'; import type { CaseActionConnector } from './types'; import type { CaseUser, CaseUsers } from '../../common/ui/types'; @@ -145,7 +145,7 @@ export const getConnectorsFormDeserializer = { /** diff --git a/x-pack/plugins/cases/public/components/visualizations/actions/types.ts b/x-pack/plugins/cases/public/components/visualizations/actions/types.ts index 507e5aa2c3744..8cbe7fd93585d 100644 --- a/x-pack/plugins/cases/public/components/visualizations/actions/types.ts +++ b/x-pack/plugins/cases/public/components/visualizations/actions/types.ts @@ -11,7 +11,7 @@ import type * as H from 'history'; import type { Storage } from '@kbn/kibana-utils-plugin/public'; import type { ActionExecutionContext } from '@kbn/ui-actions-plugin/public'; -import type { CasesPluginStart } from '../../../types'; +import type { CasesPublicStartDependencies } from '../../../types'; import type { CasesContextProps } from '../../cases_context'; export type CasesUIActionContextProps = Pick< @@ -23,7 +23,7 @@ export type CasesUIActionContextProps = Pick< export interface CasesUIActionProps { core: CoreStart; - plugins: CasesPluginStart; + plugins: CasesPublicStartDependencies; caseContextProps: CasesUIActionContextProps; history: H.History; storage: Storage; diff --git a/x-pack/plugins/cases/public/index.tsx b/x-pack/plugins/cases/public/index.tsx index 365c850909116..af6e71580f944 100644 --- a/x-pack/plugins/cases/public/index.tsx +++ b/x-pack/plugins/cases/public/index.tsx @@ -14,7 +14,7 @@ export function plugin(initializerContext: PluginInitializerContext) { export { DRAFT_COMMENT_STORAGE_ID } from './components/markdown_editor/plugins/lens/constants'; -export type { CasesUiStart, CasesUiSetup } from './types'; +export type { CasesPublicStart, CasesPublicSetup } from './types'; export type { GetCreateCaseFlyoutProps } from './client/ui/get_create_case_flyout'; export type { GetAllCasesSelectorModalProps } from './client/ui/get_all_cases_selector_modal'; export type { GetRecentCasesProps } from './client/ui/get_recent_cases'; diff --git a/x-pack/plugins/cases/public/mocks.ts b/x-pack/plugins/cases/public/mocks.ts index 237d7150aec6b..3511beda3cccc 100644 --- a/x-pack/plugins/cases/public/mocks.ts +++ b/x-pack/plugins/cases/public/mocks.ts @@ -6,9 +6,9 @@ */ import { mockCasesContext } from './mocks/mock_cases_context'; -import type { CasesUiStart } from './types'; +import type { CasesPublicStart } from './types'; -const apiMock: jest.Mocked = { +const apiMock: jest.Mocked = { getRelatedCases: jest.fn(), cases: { find: jest.fn(), @@ -18,7 +18,7 @@ const apiMock: jest.Mocked = { }, }; -const uiMock: jest.Mocked = { +const uiMock: jest.Mocked = { getCases: jest.fn(), getCasesContext: jest.fn().mockImplementation(() => mockCasesContext), getAllCasesSelectorModal: jest.fn(), @@ -28,7 +28,7 @@ const uiMock: jest.Mocked = { export const openAddToExistingCaseModalMock = jest.fn(); export const openAddToNewCaseFlyoutMock = jest.fn(); -const hooksMock: jest.Mocked = { +const hooksMock: jest.Mocked = { useCasesAddToNewCaseFlyout: jest.fn().mockImplementation(() => ({ open: openAddToNewCaseFlyoutMock, })), @@ -37,7 +37,7 @@ const hooksMock: jest.Mocked = { })), }; -const helpersMock: jest.Mocked = { +const helpersMock: jest.Mocked = { canUseCases: jest.fn(), getUICapabilities: jest.fn().mockReturnValue({ all: false, @@ -54,10 +54,10 @@ const helpersMock: jest.Mocked = { }; export interface CaseUiClientMock { - api: jest.Mocked; - ui: jest.Mocked; - hooks: jest.Mocked; - helpers: jest.Mocked; + api: jest.Mocked; + ui: jest.Mocked; + hooks: jest.Mocked; + helpers: jest.Mocked; } export const mockCasesContract = (): CaseUiClientMock => ({ diff --git a/x-pack/plugins/cases/public/plugin.test.ts b/x-pack/plugins/cases/public/plugin.test.ts index bb81b7d501c5d..03a17d5bf2cb0 100644 --- a/x-pack/plugins/cases/public/plugin.test.ts +++ b/x-pack/plugins/cases/public/plugin.test.ts @@ -18,7 +18,7 @@ import { lensPluginMock } from '@kbn/lens-plugin/public/mocks'; import { contentManagementMock } from '@kbn/content-management-plugin/public/mocks'; import { mockStorage } from '@kbn/kibana-utils-plugin/public/storage/hashed_item_store/mock'; import { triggersActionsUiMock } from '@kbn/triggers-actions-ui-plugin/public/mocks'; -import type { CasesPluginSetup, CasesPluginStart } from './types'; +import type { CasesPublicStartDependencies, CasesPublicSetupDependencies } from './types'; import { CasesUiPlugin } from './plugin'; import { ALLOWED_MIME_TYPES } from '../common/constants/mime_types'; @@ -36,8 +36,8 @@ describe('Cases Ui Plugin', () => { let plugin: CasesUiPlugin; let coreSetup: ReturnType; let coreStart: ReturnType; - let pluginsSetup: jest.Mocked; - let pluginsStart: jest.Mocked; + let pluginsSetup: jest.Mocked; + let pluginsStart: jest.Mocked; beforeEach(() => { context = coreMock.createPluginInitializerContext(getConfig()); diff --git a/x-pack/plugins/cases/public/plugin.ts b/x-pack/plugins/cases/public/plugin.ts index f4909f344e7fc..b9117746d87df 100644 --- a/x-pack/plugins/cases/public/plugin.ts +++ b/x-pack/plugins/cases/public/plugin.ts @@ -28,16 +28,27 @@ import { getUICapabilities } from './client/helpers/capabilities'; import { ExternalReferenceAttachmentTypeRegistry } from './client/attachment_framework/external_reference_registry'; import { PersistableStateAttachmentTypeRegistry } from './client/attachment_framework/persistable_state_registry'; import { registerCaseFileKinds } from './files'; -import type { CasesPluginSetup, CasesPluginStart, CasesUiSetup, CasesUiStart } from './types'; import { registerInternalAttachments } from './internal_attachments'; import { registerActions } from './components/visualizations/actions'; +import type { + CasesPublicSetup, + CasesPublicStart, + CasesPublicSetupDependencies, + CasesPublicStartDependencies, +} from './types'; /** * @public * A plugin for retrieving Cases UI components */ export class CasesUiPlugin - implements Plugin + implements + Plugin< + CasesPublicSetup, + CasesPublicStart, + CasesPublicSetupDependencies, + CasesPublicStartDependencies + > { private readonly kibanaVersion: string; private readonly storage = new Storage(localStorage); @@ -50,7 +61,7 @@ export class CasesUiPlugin this.persistableStateAttachmentTypeRegistry = new PersistableStateAttachmentTypeRegistry(); } - public setup(core: CoreSetup, plugins: CasesPluginSetup): CasesUiSetup { + public setup(core: CoreSetup, plugins: CasesPublicSetupDependencies): CasesPublicSetup { const kibanaVersion = this.kibanaVersion; const storage = this.storage; const externalReferenceAttachmentTypeRegistry = this.externalReferenceAttachmentTypeRegistry; @@ -83,7 +94,7 @@ export class CasesUiPlugin async mount(params: ManagementAppMountParams) { const [coreStart, pluginsStart] = (await core.getStartServices()) as [ CoreStart, - CasesPluginStart, + CasesPublicStartDependencies, unknown ]; @@ -114,7 +125,7 @@ export class CasesUiPlugin }; } - public start(core: CoreStart, plugins: CasesPluginStart): CasesUiStart { + public start(core: CoreStart, plugins: CasesPublicStartDependencies): CasesPublicStart { const config = this.initializerContext.config.get(); KibanaServices.init({ diff --git a/x-pack/plugins/cases/public/types.ts b/x-pack/plugins/cases/public/types.ts index 621a135b1ae3c..91ca41f89aae2 100644 --- a/x-pack/plugins/cases/public/types.ts +++ b/x-pack/plugins/cases/public/types.ts @@ -58,7 +58,7 @@ import type { ExternalReferenceSOAttachmentPayload, } from '../common/types/domain'; -export interface CasesPluginSetup { +export interface CasesPublicSetupDependencies { files: FilesSetup; security: SecurityPluginSetup; serverless?: ServerlessPluginSetup; @@ -66,13 +66,18 @@ export interface CasesPluginSetup { home?: HomePublicPluginSetup; } -export interface CasesPluginStart { +export interface CasesPublicStartDependencies { apm?: ApmBase; data: DataPublicPluginStart; embeddable: EmbeddableStart; features: FeaturesPluginStart; files: FilesStart; lens: LensPublicStart; + /** + * Cases in used by other plugins. Plugins pass the + * service to their KibanaContext. ML does not pass + * the licensing service thus it is optional. + */ licensing?: LicensingPluginStart; contentManagement: ContentManagementPublicStart; security: SecurityPluginStart; @@ -89,23 +94,23 @@ export interface CasesPluginStart { * Leaving it out currently in lieu of RBAC changes */ -export type StartServices = CoreStart & CasesPluginStart; +export type StartServices = CoreStart & CasesPublicStartDependencies; export interface RenderAppProps { mountParams: ManagementAppMountParams; coreStart: CoreStart; - pluginsStart: CasesPluginStart; + pluginsStart: CasesPublicStartDependencies; storage: Storage; kibanaVersion: string; externalReferenceAttachmentTypeRegistry: ExternalReferenceAttachmentTypeRegistry; persistableStateAttachmentTypeRegistry: PersistableStateAttachmentTypeRegistry; } -export interface CasesUiSetup { +export interface CasesPublicSetup { attachmentFramework: AttachmentFramework; } -export interface CasesUiStart { +export interface CasesPublicStart { api: { getRelatedCases: ( alertId: string, diff --git a/x-pack/plugins/cases/server/index.ts b/x-pack/plugins/cases/server/index.ts index 911c59bc4d46a..3c019b0d1bd20 100644 --- a/x-pack/plugins/cases/server/index.ts +++ b/x-pack/plugins/cases/server/index.ts @@ -26,4 +26,4 @@ export const plugin = async (initializerContext: PluginInitializerContext) => { return new CasePlugin(initializerContext); }; -export type { CasesSetup, CasesStart } from './types'; +export type { CasesServerSetup, CasesServerStart } from './types'; diff --git a/x-pack/plugins/cases/server/mocks.ts b/x-pack/plugins/cases/server/mocks.ts index f05b9e9e1a292..637cee85ed84b 100644 --- a/x-pack/plugins/cases/server/mocks.ts +++ b/x-pack/plugins/cases/server/mocks.ts @@ -8,7 +8,6 @@ import type { SavedObject } from '@kbn/core/server'; import { SECURITY_SOLUTION_OWNER } from '../common/constants'; -import type { CasesStart } from './types'; import { createCasesClientMock } from './client/mocks'; import type { CaseSavedObjectTransformed } from './common/types/case'; import type { @@ -28,6 +27,7 @@ import { AttachmentType, } from '../common/types/domain'; import type { CasePostRequest } from '../common/types/api'; +import type { CasesServerStart } from './types'; const lensPersistableState = { attributes: { @@ -722,7 +722,7 @@ export const mappings: ConnectorMappings = [ const casesClientMock = createCasesClientMock(); -export const mockCasesContract = (): CasesStart => ({ +export const mockCasesContract = (): CasesServerStart => ({ getCasesClientWithRequest: jest.fn().mockResolvedValue(casesClientMock), getExternalReferenceAttachmentTypeRegistry: jest.fn(), getPersistableStateAttachmentTypeRegistry: jest.fn(), diff --git a/x-pack/plugins/cases/server/plugin.test.ts b/x-pack/plugins/cases/server/plugin.test.ts index 255e6ce42af68..ad852fc65ebc5 100644 --- a/x-pack/plugins/cases/server/plugin.test.ts +++ b/x-pack/plugins/cases/server/plugin.test.ts @@ -18,10 +18,10 @@ import { taskManagerMock } from '@kbn/task-manager-plugin/server/mocks'; import { actionsMock } from '@kbn/actions-plugin/server/mocks'; import { notificationsMock } from '@kbn/notifications-plugin/server/mocks'; import { alertsMock } from '@kbn/alerting-plugin/server/mocks'; -import type { PluginsSetup, PluginsStart } from './plugin'; import { CasePlugin } from './plugin'; import type { ConfigType } from './config'; import { ALLOWED_MIME_TYPES } from '../common/constants/mime_types'; +import type { CasesServerSetupDependencies, CasesServerStartDependencies } from './types'; function getConfig(overrides = {}) { return { @@ -37,8 +37,8 @@ describe('Cases Plugin', () => { let plugin: CasePlugin; let coreSetup: ReturnType; let coreStart: ReturnType; - let pluginsSetup: jest.Mocked; - let pluginsStart: jest.Mocked; + let pluginsSetup: jest.Mocked; + let pluginsStart: jest.Mocked; beforeEach(() => { context = coreMock.createPluginInitializerContext(getConfig()); diff --git a/x-pack/plugins/cases/server/plugin.ts b/x-pack/plugins/cases/server/plugin.ts index 510686f1a98bd..cc77798be74e2 100644 --- a/x-pack/plugins/cases/server/plugin.ts +++ b/x-pack/plugins/cases/server/plugin.ts @@ -12,28 +12,11 @@ import type { PluginInitializerContext, CoreSetup, CoreStart, + Plugin, } from '@kbn/core/server'; -import type { FilesSetup, FilesStart } from '@kbn/files-plugin/server'; -import type { SecurityPluginSetup, SecurityPluginStart } from '@kbn/security-plugin/server'; -import type { - PluginSetupContract as ActionsPluginSetup, - PluginStartContract as ActionsPluginStart, -} from '@kbn/actions-plugin/server'; -import type { SpacesPluginStart } from '@kbn/spaces-plugin/server'; -import type { - PluginStartContract as FeaturesPluginStart, - PluginSetupContract as FeaturesPluginSetup, -} from '@kbn/features-plugin/server'; +import type { SecurityPluginSetup } from '@kbn/security-plugin/server'; import type { LensServerPluginSetup } from '@kbn/lens-plugin/server'; -import type { - TaskManagerSetupContract, - TaskManagerStartContract, -} from '@kbn/task-manager-plugin/server'; -import type { UsageCollectionSetup } from '@kbn/usage-collection-plugin/server'; -import type { LicensingPluginSetup, LicensingPluginStart } from '@kbn/licensing-plugin/server'; -import type { NotificationsPluginStart } from '@kbn/notifications-plugin/server'; -import type { RuleRegistryPluginStartContract } from '@kbn/rule-registry-plugin/server'; import { APP_ID } from '../common/constants'; import { @@ -46,7 +29,13 @@ import { } from './saved_object_types'; import type { CasesClient } from './client'; -import type { CasesRequestHandlerContext, CasesSetup, CasesStart } from './types'; +import type { + CasesRequestHandlerContext, + CasesServerSetup, + CasesServerSetupDependencies, + CasesServerStart, + CasesServerStartDependencies, +} from './types'; import { CasesClientFactory } from './client/factory'; import { getCasesKibanaFeature } from './features'; import { registerRoutes } from './routes/api/register_routes'; @@ -61,30 +50,15 @@ import { registerInternalAttachments } from './internal_attachments'; import { registerCaseFileKinds } from './files'; import type { ConfigType } from './config'; -export interface PluginsSetup { - actions: ActionsPluginSetup; - lens: LensServerPluginSetup; - features: FeaturesPluginSetup; - files: FilesSetup; - security: SecurityPluginSetup; - licensing: LicensingPluginSetup; - taskManager?: TaskManagerSetupContract; - usageCollection?: UsageCollectionSetup; -} - -export interface PluginsStart { - actions: ActionsPluginStart; - features: FeaturesPluginStart; - files: FilesStart; - licensing: LicensingPluginStart; - taskManager?: TaskManagerStartContract; - security: SecurityPluginStart; - spaces?: SpacesPluginStart; - notifications: NotificationsPluginStart; - ruleRegistry: RuleRegistryPluginStartContract; -} - -export class CasePlugin { +export class CasePlugin + implements + Plugin< + CasesServerSetup, + CasesServerStart, + CasesServerSetupDependencies, + CasesServerStartDependencies + > +{ private readonly caseConfig: ConfigType; private readonly logger: Logger; private readonly kibanaVersion: PluginInitializerContext['env']['packageInfo']['version']; @@ -105,7 +79,7 @@ export class CasePlugin { this.userProfileService = new UserProfileService(this.logger); } - public setup(core: CoreSetup, plugins: PluginsSetup): CasesSetup { + public setup(core: CoreSetup, plugins: CasesServerSetupDependencies): CasesServerSetup { this.logger.debug( `Setting up Case Workflow with core contract [${Object.keys( core @@ -185,7 +159,7 @@ export class CasePlugin { }; } - public start(core: CoreStart, plugins: PluginsStart): CasesStart { + public start(core: CoreStart, plugins: CasesServerStartDependencies): CasesServerStart { this.logger.debug(`Starting Case Workflow`); if (plugins.taskManager) { diff --git a/x-pack/plugins/cases/server/types.ts b/x-pack/plugins/cases/server/types.ts index a6fb8db9d974b..d0cbf370f729a 100644 --- a/x-pack/plugins/cases/server/types.ts +++ b/x-pack/plugins/cases/server/types.ts @@ -12,11 +12,54 @@ import type { ActionTypeParams, ActionType, } from '@kbn/actions-plugin/server/types'; +import type { FilesSetup, FilesStart } from '@kbn/files-plugin/server'; +import type { SecurityPluginSetup, SecurityPluginStart } from '@kbn/security-plugin/server'; +import type { + PluginSetupContract as ActionsPluginSetup, + PluginStartContract as ActionsPluginStart, +} from '@kbn/actions-plugin/server'; +import type { SpacesPluginStart } from '@kbn/spaces-plugin/server'; +import type { + PluginStartContract as FeaturesPluginStart, + PluginSetupContract as FeaturesPluginSetup, +} from '@kbn/features-plugin/server'; +import type { LensServerPluginSetup } from '@kbn/lens-plugin/server'; +import type { + TaskManagerSetupContract, + TaskManagerStartContract, +} from '@kbn/task-manager-plugin/server'; +import type { UsageCollectionSetup } from '@kbn/usage-collection-plugin/server'; +import type { LicensingPluginSetup, LicensingPluginStart } from '@kbn/licensing-plugin/server'; +import type { NotificationsPluginStart } from '@kbn/notifications-plugin/server'; +import type { RuleRegistryPluginStartContract } from '@kbn/rule-registry-plugin/server'; import type { CasesClient } from './client'; import type { AttachmentFramework } from './attachment_framework/types'; import type { ExternalReferenceAttachmentTypeRegistry } from './attachment_framework/external_reference_registry'; import type { PersistableStateAttachmentTypeRegistry } from './attachment_framework/persistable_state_registry'; +export interface CasesServerSetupDependencies { + actions: ActionsPluginSetup; + lens: LensServerPluginSetup; + features: FeaturesPluginSetup; + files: FilesSetup; + security: SecurityPluginSetup; + licensing: LicensingPluginSetup; + taskManager?: TaskManagerSetupContract; + usageCollection?: UsageCollectionSetup; +} + +export interface CasesServerStartDependencies { + actions: ActionsPluginStart; + features: FeaturesPluginStart; + files: FilesStart; + licensing: LicensingPluginStart; + taskManager?: TaskManagerStartContract; + security: SecurityPluginStart; + spaces?: SpacesPluginStart; + notifications: NotificationsPluginStart; + ruleRegistry: RuleRegistryPluginStartContract; +} + export interface CaseRequestContext { getCasesClient: () => Promise; } @@ -39,7 +82,7 @@ export type RegisterActionType = < /** * Cases server exposed contract for interacting with cases entities. */ -export interface CasesStart { +export interface CasesServerStart { /** * Returns a client which can be used to interact with the cases backend entities. * @@ -51,7 +94,7 @@ export interface CasesStart { getPersistableStateAttachmentTypeRegistry(): PersistableStateAttachmentTypeRegistry; } -export interface CasesSetup { +export interface CasesServerSetup { attachmentFramework: AttachmentFramework; } diff --git a/x-pack/plugins/ml/public/application/contexts/kibana/kibana_context.ts b/x-pack/plugins/ml/public/application/contexts/kibana/kibana_context.ts index bf92b528c60c1..d375269cb39c1 100644 --- a/x-pack/plugins/ml/public/application/contexts/kibana/kibana_context.ts +++ b/x-pack/plugins/ml/public/application/contexts/kibana/kibana_context.ts @@ -21,7 +21,7 @@ import type { TriggersAndActionsUIPublicPluginStart } from '@kbn/triggers-action import type { DashboardStart } from '@kbn/dashboard-plugin/public'; import type { SpacesPluginStart } from '@kbn/spaces-plugin/public'; import type { ChartsPluginStart } from '@kbn/charts-plugin/public'; -import type { CasesUiStart } from '@kbn/cases-plugin/public'; +import type { CasesPublicStart } from '@kbn/cases-plugin/public'; import type { UnifiedSearchPublicPluginStart } from '@kbn/unified-search-plugin/public'; import type { LensPublicStart } from '@kbn/lens-plugin/public'; import type { SavedObjectsManagementPluginStart } from '@kbn/saved-objects-management-plugin/public'; @@ -34,7 +34,7 @@ import type { FieldFormatsRegistry } from '@kbn/field-formats-plugin/common'; import type { MlServicesContext } from '../../app'; interface StartPlugins { - cases?: CasesUiStart; + cases?: CasesPublicStart; charts: ChartsPluginStart; contentManagement: ContentManagementPublicStart; dashboard: DashboardStart; diff --git a/x-pack/plugins/ml/public/cases/register_anomaly_charts_attachment.tsx b/x-pack/plugins/ml/public/cases/register_anomaly_charts_attachment.tsx index 0a69c8d4b8c12..bb22df1d19934 100644 --- a/x-pack/plugins/ml/public/cases/register_anomaly_charts_attachment.tsx +++ b/x-pack/plugins/ml/public/cases/register_anomaly_charts_attachment.tsx @@ -8,7 +8,7 @@ import React from 'react'; import { i18n } from '@kbn/i18n'; import { FormattedMessage } from '@kbn/i18n-react'; -import type { CasesUiSetup } from '@kbn/cases-plugin/public'; +import type { CasesPublicSetup } from '@kbn/cases-plugin/public'; import type { CoreStart } from '@kbn/core/public'; import { CASE_ATTACHMENT_TYPE_ID_ANOMALY_EXPLORER_CHARTS } from '../../common/constants/cases'; import { getEmbeddableComponent } from '../embeddables'; @@ -16,7 +16,7 @@ import type { MlStartDependencies } from '../plugin'; import { PLUGIN_ICON } from '../../common/constants/app'; export function registerAnomalyChartsCasesAttachment( - cases: CasesUiSetup, + cases: CasesPublicSetup, coreStart: CoreStart, pluginStart: MlStartDependencies ) { diff --git a/x-pack/plugins/ml/public/cases/register_anomaly_swim_lane_attachment.tsx b/x-pack/plugins/ml/public/cases/register_anomaly_swim_lane_attachment.tsx index 670a1a266cc41..abc2f9a7c2ab4 100644 --- a/x-pack/plugins/ml/public/cases/register_anomaly_swim_lane_attachment.tsx +++ b/x-pack/plugins/ml/public/cases/register_anomaly_swim_lane_attachment.tsx @@ -8,7 +8,7 @@ import React from 'react'; import { i18n } from '@kbn/i18n'; import { FormattedMessage } from '@kbn/i18n-react'; -import type { CasesUiSetup } from '@kbn/cases-plugin/public'; +import type { CasesPublicSetup } from '@kbn/cases-plugin/public'; import type { CoreStart } from '@kbn/core/public'; import { CASE_ATTACHMENT_TYPE_ID_ANOMALY_SWIMLANE } from '../../common/constants/cases'; import { getEmbeddableComponent } from '../embeddables'; @@ -16,7 +16,7 @@ import type { MlStartDependencies } from '../plugin'; import { PLUGIN_ICON } from '../../common/constants/app'; export function registerAnomalySwimLaneCasesAttachment( - cases: CasesUiSetup, + cases: CasesPublicSetup, coreStart: CoreStart, pluginStart: MlStartDependencies ) { diff --git a/x-pack/plugins/ml/public/cases/register_cases_attachments.ts b/x-pack/plugins/ml/public/cases/register_cases_attachments.ts index 5038c528f67e7..1dfeabb657b09 100644 --- a/x-pack/plugins/ml/public/cases/register_cases_attachments.ts +++ b/x-pack/plugins/ml/public/cases/register_cases_attachments.ts @@ -5,14 +5,14 @@ * 2.0. */ -import { CasesUiSetup } from '@kbn/cases-plugin/public'; +import { CasesPublicSetup } from '@kbn/cases-plugin/public'; import { CoreStart } from '@kbn/core/public'; import { registerAnomalyChartsCasesAttachment } from './register_anomaly_charts_attachment'; import { MlStartDependencies } from '../plugin'; import { registerAnomalySwimLaneCasesAttachment } from './register_anomaly_swim_lane_attachment'; export function registerCasesAttachments( - cases: CasesUiSetup, + cases: CasesPublicSetup, coreStart: CoreStart, pluginStart: MlStartDependencies ) { diff --git a/x-pack/plugins/ml/public/plugin.ts b/x-pack/plugins/ml/public/plugin.ts index c07a02e7a8c4b..9bbfe52bbca07 100644 --- a/x-pack/plugins/ml/public/plugin.ts +++ b/x-pack/plugins/ml/public/plugin.ts @@ -45,7 +45,7 @@ import type { UsageCollectionSetup } from '@kbn/usage-collection-plugin/public'; import type { FieldFormatsSetup } from '@kbn/field-formats-plugin/public'; import type { DashboardSetup, DashboardStart } from '@kbn/dashboard-plugin/public'; import type { ChartsPluginStart } from '@kbn/charts-plugin/public'; -import type { CasesUiSetup, CasesUiStart } from '@kbn/cases-plugin/public'; +import type { CasesPublicSetup, CasesPublicStart } from '@kbn/cases-plugin/public'; import type { SavedSearchPublicPluginStart } from '@kbn/saved-search-plugin/public'; import type { PresentationUtilPluginStart } from '@kbn/presentation-util-plugin/public'; import type { DataViewEditorStart } from '@kbn/data-view-editor-plugin/public'; @@ -72,7 +72,7 @@ import { ElasticModels } from './application/services/elastic_models_service'; import type { MlApiServices } from './application/services/ml_api_service'; export interface MlStartDependencies { - cases?: CasesUiStart; + cases?: CasesPublicStart; charts: ChartsPluginStart; contentManagement: ContentManagementPublicStart; dashboard: DashboardStart; @@ -97,7 +97,7 @@ export interface MlStartDependencies { export interface MlSetupDependencies { alerting?: AlertingSetup; - cases?: CasesUiSetup; + cases?: CasesPublicSetup; dashboard: DashboardSetup; embeddable: EmbeddableSetup; fieldFormats: FieldFormatsSetup; diff --git a/x-pack/plugins/ml/server/lib/register_cases.ts b/x-pack/plugins/ml/server/lib/register_cases.ts index fabd317d1d1bf..4cd629c7b1ac2 100644 --- a/x-pack/plugins/ml/server/lib/register_cases.ts +++ b/x-pack/plugins/ml/server/lib/register_cases.ts @@ -6,7 +6,7 @@ */ import type { Logger } from '@kbn/core/server'; -import type { CasesSetup } from '@kbn/cases-plugin/server'; +import type { CasesServerSetup } from '@kbn/cases-plugin/server'; import type { MlFeatures } from '../../common/constants/app'; import { CASE_ATTACHMENT_TYPE_ID_ANOMALY_EXPLORER_CHARTS, @@ -14,7 +14,7 @@ import { } from '../../common/constants/cases'; export function registerCasesPersistableState( - cases: CasesSetup, + cases: CasesServerSetup, enabledFeatures: MlFeatures, logger: Logger ) { diff --git a/x-pack/plugins/ml/server/plugin.ts b/x-pack/plugins/ml/server/plugin.ts index 3d9ef2dd747a8..e09a2fedaecaa 100644 --- a/x-pack/plugins/ml/server/plugin.ts +++ b/x-pack/plugins/ml/server/plugin.ts @@ -24,7 +24,7 @@ import type { PluginStart as DataViewsPluginStart } from '@kbn/data-views-plugin import type { SpacesPluginSetup } from '@kbn/spaces-plugin/server'; import type { FieldFormatsStart } from '@kbn/field-formats-plugin/server'; import type { HomeServerPluginSetup } from '@kbn/home-plugin/server'; -import type { CasesSetup } from '@kbn/cases-plugin/server'; +import type { CasesServerSetup } from '@kbn/cases-plugin/server'; import type { PluginsSetup, PluginsStart, RouteInitialization } from './types'; import type { MlCapabilities } from '../common/types/capabilities'; import { jsonSchemaRoutes } from './routes/json_schema'; @@ -91,7 +91,7 @@ export class MlServerPlugin private spacesPlugin: SpacesPluginSetup | undefined; private security: SecurityPluginSetup | undefined; private home: HomeServerPluginSetup | null = null; - private cases: CasesSetup | null | undefined = null; + private cases: CasesServerSetup | null | undefined = null; private dataViews: DataViewsPluginStart | null = null; private isMlReady: Promise; private setMlReady: () => void = () => {}; diff --git a/x-pack/plugins/ml/server/types.ts b/x-pack/plugins/ml/server/types.ts index 17f5c5a60a1a9..3cec3550ad7cc 100644 --- a/x-pack/plugins/ml/server/types.ts +++ b/x-pack/plugins/ml/server/types.ts @@ -26,7 +26,7 @@ import { TaskManagerSetupContract, TaskManagerStartContract, } from '@kbn/task-manager-plugin/server'; -import type { CasesSetup } from '@kbn/cases-plugin/server'; +import type { CasesServerSetup } from '@kbn/cases-plugin/server'; import type { RouteGuard } from './lib/route_guard'; import type { ResolveMlCapabilities } from '../common/types/capabilities'; import type { MlLicense } from '../common/license'; @@ -65,7 +65,7 @@ export interface PluginsSetup { actions?: ActionsPlugin['setup']; usageCollection?: UsageCollectionSetup; taskManager: TaskManagerSetupContract; - cases?: CasesSetup; + cases?: CasesServerSetup; } export interface PluginsStart { diff --git a/x-pack/plugins/observability_solution/apm/kibana.jsonc b/x-pack/plugins/observability_solution/apm/kibana.jsonc index e563bc9895577..56d7c094ee261 100644 --- a/x-pack/plugins/observability_solution/apm/kibana.jsonc +++ b/x-pack/plugins/observability_solution/apm/kibana.jsonc @@ -35,7 +35,6 @@ "optionalPlugins": [ "actions", "alerting", - "cases", "charts", "cloud", "discover", diff --git a/x-pack/plugins/observability_solution/exploratory_view/public/application/types.ts b/x-pack/plugins/observability_solution/exploratory_view/public/application/types.ts index 3cdaee088db7a..08cf568e98dd1 100644 --- a/x-pack/plugins/observability_solution/exploratory_view/public/application/types.ts +++ b/x-pack/plugins/observability_solution/exploratory_view/public/application/types.ts @@ -25,13 +25,13 @@ import { DataViewsPublicPluginStart } from '@kbn/data-views-plugin/public'; import { LensPublicStart } from '@kbn/lens-plugin/public'; import { SharePluginStart } from '@kbn/share-plugin/public'; import { TriggersAndActionsUIPublicPluginStart } from '@kbn/triggers-actions-ui-plugin/public'; -import { CasesUiStart } from '@kbn/cases-plugin/public'; +import { CasesPublicStart } from '@kbn/cases-plugin/public'; import type { ChartsPluginStart } from '@kbn/charts-plugin/public'; import { DiscoverStart } from '@kbn/discover-plugin/public'; export interface ObservabilityAppServices { application: ApplicationStart; - cases: CasesUiStart; + cases: CasesPublicStart; charts: ChartsPluginStart; chrome: ChromeStart; data: DataPublicPluginStart; diff --git a/x-pack/plugins/observability_solution/exploratory_view/public/plugin.ts b/x-pack/plugins/observability_solution/exploratory_view/public/plugin.ts index 66bcb9cf8a8a2..eb5fd4ead1501 100644 --- a/x-pack/plugins/observability_solution/exploratory_view/public/plugin.ts +++ b/x-pack/plugins/observability_solution/exploratory_view/public/plugin.ts @@ -24,7 +24,7 @@ import type { DiscoverStart } from '@kbn/discover-plugin/public'; import type { EmbeddableStart } from '@kbn/embeddable-plugin/public'; import type { HomePublicPluginSetup, HomePublicPluginStart } from '@kbn/home-plugin/public'; import type { ChartsPluginStart } from '@kbn/charts-plugin/public'; -import { CasesUiStart } from '@kbn/cases-plugin/public'; +import { CasesPublicStart } from '@kbn/cases-plugin/public'; import type { LensPublicStart } from '@kbn/lens-plugin/public'; import { TriggersAndActionsUIPublicPluginSetup, @@ -51,7 +51,7 @@ export interface ExploratoryViewPublicPluginsSetup { } export interface ExploratoryViewPublicPluginsStart { - cases: CasesUiStart; + cases: CasesPublicStart; charts: ChartsPluginStart; data: DataPublicPluginStart; dataViews: DataViewsPublicPluginStart; diff --git a/x-pack/plugins/observability_solution/infra/public/types.ts b/x-pack/plugins/observability_solution/infra/public/types.ts index f2069c215687f..475e37e9e2ef3 100644 --- a/x-pack/plugins/observability_solution/infra/public/types.ts +++ b/x-pack/plugins/observability_solution/infra/public/types.ts @@ -35,7 +35,7 @@ import type { SpacesPluginStart } from '@kbn/spaces-plugin/public'; import type { IStorageWrapper } from '@kbn/kibana-utils-plugin/public'; import { LensPublicStart } from '@kbn/lens-plugin/public'; import type { ChartsPluginStart } from '@kbn/charts-plugin/public'; -import { CasesUiStart } from '@kbn/cases-plugin/public'; +import { CasesPublicStart } from '@kbn/cases-plugin/public'; import { DiscoverStart } from '@kbn/discover-plugin/public'; import { UiActionsSetup, UiActionsStart } from '@kbn/ui-actions-plugin/public'; import { @@ -85,7 +85,7 @@ export interface InfraClientSetupDeps { } export interface InfraClientStartDeps { - cases: CasesUiStart; + cases: CasesPublicStart; charts: ChartsPluginStart; data: DataPublicPluginStart; dataViews: DataViewsPublicPluginStart; diff --git a/x-pack/plugins/observability_solution/observability/public/components/custom_threshold/types.ts b/x-pack/plugins/observability_solution/observability/public/components/custom_threshold/types.ts index 7ee011a3ab012..e748637bb380d 100644 --- a/x-pack/plugins/observability_solution/observability/public/components/custom_threshold/types.ts +++ b/x-pack/plugins/observability_solution/observability/public/components/custom_threshold/types.ts @@ -6,7 +6,7 @@ */ import * as rt from 'io-ts'; -import { CasesUiStart } from '@kbn/cases-plugin/public'; +import { CasesPublicStart } from '@kbn/cases-plugin/public'; import { ChartsPluginStart } from '@kbn/charts-plugin/public'; import { DataPublicPluginStart, SerializedSearchSourceFields } from '@kbn/data-plugin/public'; import { DataView, DataViewsPublicPluginStart } from '@kbn/data-views-plugin/public'; @@ -66,7 +66,7 @@ export interface AlertParams { } export interface InfraClientStartDeps { - cases: CasesUiStart; + cases: CasesPublicStart; charts: ChartsPluginStart; data: DataPublicPluginStart; dataViews: DataViewsPublicPluginStart; diff --git a/x-pack/plugins/observability_solution/observability/public/embeddable/slo/alerts/slo_alerts_embeddable.tsx b/x-pack/plugins/observability_solution/observability/public/embeddable/slo/alerts/slo_alerts_embeddable.tsx index c7138d93095e3..aba254429c730 100644 --- a/x-pack/plugins/observability_solution/observability/public/embeddable/slo/alerts/slo_alerts_embeddable.tsx +++ b/x-pack/plugins/observability_solution/observability/public/embeddable/slo/alerts/slo_alerts_embeddable.tsx @@ -17,7 +17,7 @@ import { IContainer, } from '@kbn/embeddable-plugin/public'; import { KibanaContextProvider } from '@kbn/kibana-react-plugin/public'; -import { CasesUiStart } from '@kbn/cases-plugin/public'; +import { CasesPublicStart } from '@kbn/cases-plugin/public'; import { type CoreStart, @@ -49,7 +49,7 @@ export interface SloEmbeddableDeps { triggersActionsUi: TriggersAndActionsUIPublicPluginStart; data: DataPublicPluginStart; notifications: NotificationsStart; - cases: CasesUiStart; + cases: CasesPublicStart; settings: SettingsStart; security: SecurityPluginStart; charts: ChartsPluginStart; diff --git a/x-pack/plugins/observability_solution/observability/public/pages/alert_details/components/header_actions.test.tsx b/x-pack/plugins/observability_solution/observability/public/pages/alert_details/components/header_actions.test.tsx index 507af13861d1b..f719a37237240 100644 --- a/x-pack/plugins/observability_solution/observability/public/pages/alert_details/components/header_actions.test.tsx +++ b/x-pack/plugins/observability_solution/observability/public/pages/alert_details/components/header_actions.test.tsx @@ -17,7 +17,7 @@ import { alertWithTags, mockAlertUuid, untrackedAlert } from '../mock/alert'; import { useFetchRule } from '../../../hooks/use_fetch_rule'; import { HeaderActions } from './header_actions'; -import { CasesUiStart } from '@kbn/cases-plugin/public'; +import { CasesPublicStart } from '@kbn/cases-plugin/public'; import { AlertStatus, ALERT_STATUS } from '@kbn/rule-data-utils'; import { OBSERVABILITY_BASE_PATH, RULES_PATH } from '../../../../common/locators/paths'; @@ -103,7 +103,7 @@ describe('Header Actions', () => { open: ({ getAttachments }: { getAttachments: () => any[] }) => { attachments = getAttachments(); }, - })) as CasesUiStart['hooks']['useCasesAddToExistingCaseModal']; + })) as CasesPublicStart['hooks']['useCasesAddToExistingCaseModal']; mockCases.hooks.useCasesAddToExistingCaseModal = useCasesAddToExistingCaseModalMock; diff --git a/x-pack/plugins/observability_solution/observability/public/plugin.ts b/x-pack/plugins/observability_solution/observability/public/plugin.ts index b4ba387b3d3eb..df165b5157845 100644 --- a/x-pack/plugins/observability_solution/observability/public/plugin.ts +++ b/x-pack/plugins/observability_solution/observability/public/plugin.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { CasesDeepLinkId, CasesUiStart, getCasesDeepLinks } from '@kbn/cases-plugin/public'; +import { CasesDeepLinkId, CasesPublicStart, getCasesDeepLinks } from '@kbn/cases-plugin/public'; import type { ChartsPluginStart } from '@kbn/charts-plugin/public'; import type { CloudStart } from '@kbn/cloud-plugin/public'; import type { IUiSettingsClient } from '@kbn/core/public'; @@ -130,7 +130,7 @@ export interface ObservabilityPublicPluginsSetup { } export interface ObservabilityPublicPluginsStart { actionTypeRegistry: ActionTypeRegistryContract; - cases: CasesUiStart; + cases: CasesPublicStart; charts: ChartsPluginStart; contentManagement: ContentManagementPublicStart; data: DataPublicPluginStart; diff --git a/x-pack/plugins/observability_solution/observability_shared/public/plugin.ts b/x-pack/plugins/observability_solution/observability_shared/public/plugin.ts index f2caeb94cbca4..cfa6be47401a7 100644 --- a/x-pack/plugins/observability_solution/observability_shared/public/plugin.ts +++ b/x-pack/plugins/observability_solution/observability_shared/public/plugin.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { CasesUiStart } from '@kbn/cases-plugin/public'; +import { CasesPublicStart } from '@kbn/cases-plugin/public'; import type { CoreSetup, CoreStart, Plugin } from '@kbn/core/public'; import type { EmbeddableStart } from '@kbn/embeddable-plugin/public'; import type { GuidedOnboardingPluginStart } from '@kbn/guided-onboarding-plugin/public'; @@ -38,7 +38,7 @@ export interface ObservabilitySharedSetup { export interface ObservabilitySharedStart { spaces?: SpacesPluginStart; - cases: CasesUiStart; + cases: CasesPublicStart; guidedOnboarding?: GuidedOnboardingPluginStart; setIsSidebarEnabled: (isEnabled: boolean) => void; embeddable: EmbeddableStart; diff --git a/x-pack/plugins/observability_solution/synthetics/public/plugin.ts b/x-pack/plugins/observability_solution/synthetics/public/plugin.ts index 6f87336a4daef..11ea23ca6da37 100644 --- a/x-pack/plugins/observability_solution/synthetics/public/plugin.ts +++ b/x-pack/plugins/observability_solution/synthetics/public/plugin.ts @@ -40,7 +40,7 @@ import { } from '@kbn/observability-plugin/public'; import { IStorageWrapper } from '@kbn/kibana-utils-plugin/public'; import { Start as InspectorPluginStart } from '@kbn/inspector-plugin/public'; -import { CasesUiStart } from '@kbn/cases-plugin/public'; +import { CasesPublicStart } from '@kbn/cases-plugin/public'; import { CloudSetup, CloudStart } from '@kbn/cloud-plugin/public'; import { DataViewsPublicPluginStart } from '@kbn/data-views-plugin/public'; import { SpacesPluginStart } from '@kbn/spaces-plugin/public'; @@ -87,7 +87,7 @@ export interface ClientPluginsStart { observabilityAIAssistant: ObservabilityAIAssistantPluginStart; share: SharePluginStart; triggersActionsUi: TriggersAndActionsUIPublicPluginStart; - cases: CasesUiStart; + cases: CasesPublicStart; dataViews: DataViewsPublicPluginStart; spaces?: SpacesPluginStart; cloud?: CloudStart; diff --git a/x-pack/plugins/observability_solution/uptime/public/plugin.ts b/x-pack/plugins/observability_solution/uptime/public/plugin.ts index 27ba81c692723..c628eadd2d244 100644 --- a/x-pack/plugins/observability_solution/uptime/public/plugin.ts +++ b/x-pack/plugins/observability_solution/uptime/public/plugin.ts @@ -40,7 +40,7 @@ import { } from '@kbn/observability-plugin/public'; import { IStorageWrapper } from '@kbn/kibana-utils-plugin/public'; import { Start as InspectorPluginStart } from '@kbn/inspector-plugin/public'; -import { CasesUiStart } from '@kbn/cases-plugin/public'; +import { CasesPublicStart } from '@kbn/cases-plugin/public'; import { CloudSetup, CloudStart } from '@kbn/cloud-plugin/public'; import { DataViewsPublicPluginStart } from '@kbn/data-views-plugin/public'; import { SpacesPluginStart } from '@kbn/spaces-plugin/public'; @@ -92,7 +92,7 @@ export interface ClientPluginsStart { observabilityAIAssistant: ObservabilityAIAssistantPluginStart; share: SharePluginStart; triggersActionsUi: TriggersAndActionsUIPublicPluginStart; - cases: CasesUiStart; + cases: CasesPublicStart; dataViews: DataViewsPublicPluginStart; spaces?: SpacesPluginStart; cloud?: CloudStart; diff --git a/x-pack/plugins/osquery/public/types.ts b/x-pack/plugins/osquery/public/types.ts index 8e6ea4354d283..e2f88c2a8f3dc 100644 --- a/x-pack/plugins/osquery/public/types.ts +++ b/x-pack/plugins/osquery/public/types.ts @@ -16,7 +16,7 @@ import type { TriggersAndActionsUIPublicPluginSetup, TriggersAndActionsUIPublicPluginStart, } from '@kbn/triggers-actions-ui-plugin/public'; -import type { CasesUiStart, CasesUiSetup } from '@kbn/cases-plugin/public'; +import type { CasesPublicStart, CasesPublicSetup } from '@kbn/cases-plugin/public'; import type { TimelinesUIStart } from '@kbn/timelines-plugin/public'; import type { getLazyLiveQueryField, @@ -52,14 +52,14 @@ export interface StartPlugins { lens?: LensPublicStart; security: SecurityPluginStart; triggersActionsUi: TriggersAndActionsUIPublicPluginStart; - cases: CasesUiStart; + cases: CasesPublicStart; timelines: TimelinesUIStart; appName?: string; } export interface SetupPlugins { triggersActionsUi: TriggersAndActionsUIPublicPluginSetup; - cases?: CasesUiSetup; + cases?: CasesPublicSetup; } export type StartServices = CoreStart & StartPlugins; diff --git a/x-pack/plugins/osquery/server/types.ts b/x-pack/plugins/osquery/server/types.ts index b4893193e7112..ac43d8818d62a 100644 --- a/x-pack/plugins/osquery/server/types.ts +++ b/x-pack/plugins/osquery/server/types.ts @@ -21,7 +21,7 @@ import type { } from '@kbn/task-manager-plugin/server'; import type { PluginStart as DataViewsPluginStart } from '@kbn/data-views-plugin/server'; import type { RuleRegistryPluginStartContract } from '@kbn/rule-registry-plugin/server'; -import type { CasesSetup } from '@kbn/cases-plugin/server'; +import type { CasesServerSetup } from '@kbn/cases-plugin/server'; import type { LicensingPluginSetup } from '@kbn/licensing-plugin/server'; import type { createActionService } from './handlers/action/create_action_service'; @@ -34,7 +34,7 @@ export interface OsqueryPluginStart {} export interface SetupPlugins { actions: ActionsPlugin['setup']; - cases: CasesSetup; + cases: CasesServerSetup; data: DataPluginSetup; features: PluginSetupContract; security: SecurityPluginStart; diff --git a/x-pack/plugins/security_solution/public/types.ts b/x-pack/plugins/security_solution/public/types.ts index ee2437d28f0d7..3c76453acb386 100644 --- a/x-pack/plugins/security_solution/public/types.ts +++ b/x-pack/plugins/security_solution/public/types.ts @@ -25,7 +25,7 @@ import type { TriggersAndActionsUIPublicPluginSetup as TriggersActionsSetup, TriggersAndActionsUIPublicPluginStart as TriggersActionsStart, } from '@kbn/triggers-actions-ui-plugin/public'; -import type { CasesUiStart, CasesUiSetup } from '@kbn/cases-plugin/public'; +import type { CasesPublicStart, CasesPublicSetup } from '@kbn/cases-plugin/public'; import type { SecurityPluginSetup, SecurityPluginStart } from '@kbn/security-plugin/public'; import type { TimelinesUIStart } from '@kbn/timelines-plugin/public'; import type { SessionViewStart } from '@kbn/session-view-plugin/public'; @@ -93,7 +93,7 @@ export interface SetupPlugins { triggersActionsUi: TriggersActionsSetup; usageCollection?: UsageCollectionSetup; ml?: MlPluginSetup; - cases?: CasesUiSetup; + cases?: CasesPublicSetup; } /** @@ -106,7 +106,7 @@ export interface SetupPlugins { * in the code. */ export interface StartPlugins { - cases: CasesUiStart; + cases: CasesPublicStart; data: DataPublicPluginStart; unifiedSearch: UnifiedSearchPublicPluginStart; dashboard?: DashboardStart; diff --git a/x-pack/plugins/security_solution/server/endpoint/endpoint_app_context_services.ts b/x-pack/plugins/security_solution/server/endpoint/endpoint_app_context_services.ts index 80f261b9aa818..250ac6f9be599 100644 --- a/x-pack/plugins/security_solution/server/endpoint/endpoint_app_context_services.ts +++ b/x-pack/plugins/security_solution/server/endpoint/endpoint_app_context_services.ts @@ -13,7 +13,7 @@ import type { SavedObjectsClientContract, } from '@kbn/core/server'; import type { ExceptionListClient, ListsServerExtensionRegistrar } from '@kbn/lists-plugin/server'; -import type { CasesClient, CasesStart } from '@kbn/cases-plugin/server'; +import type { CasesClient, CasesServerStart } from '@kbn/cases-plugin/server'; import type { SecurityPluginStart } from '@kbn/security-plugin/server'; import type { FleetFromHostFileClientInterface, @@ -76,7 +76,7 @@ export interface EndpointAppContextServiceStartContract { registerListsServerExtension?: ListsServerExtensionRegistrar; licenseService: LicenseService; exceptionListsClient: ExceptionListClient | undefined; - cases: CasesStart | undefined; + cases: CasesServerStart | undefined; featureUsageService: FeatureUsageService; experimentalFeatures: ExperimentalFeatures; messageSigningService: MessageSigningServiceInterface | undefined; diff --git a/x-pack/plugins/security_solution/server/plugin_contract.ts b/x-pack/plugins/security_solution/server/plugin_contract.ts index f213e5719f829..1a0dd6bccc15c 100644 --- a/x-pack/plugins/security_solution/server/plugin_contract.ts +++ b/x-pack/plugins/security_solution/server/plugin_contract.ts @@ -16,7 +16,7 @@ import type { PluginSetupContract as AlertingPluginSetup, PluginStartContract as AlertingPluginStart, } from '@kbn/alerting-plugin/server'; -import type { CasesStart, CasesSetup } from '@kbn/cases-plugin/server'; +import type { CasesServerStart, CasesServerSetup } from '@kbn/cases-plugin/server'; import type { EncryptedSavedObjectsPluginSetup } from '@kbn/encrypted-saved-objects-plugin/server'; import type { IEventLogClientService, IEventLogService } from '@kbn/event-log-plugin/server'; import type { PluginSetupContract as FeaturesPluginSetup } from '@kbn/features-plugin/server'; @@ -47,7 +47,7 @@ import type { ExperimentalFeatures } from '../common'; export interface SecuritySolutionPluginSetupDependencies { alerting: AlertingPluginSetup; - cases: CasesSetup; + cases: CasesServerSetup; cloud: CloudSetup; data: DataPluginSetup; encryptedSavedObjects?: EncryptedSavedObjectsPluginSetup; @@ -69,7 +69,7 @@ export interface SecuritySolutionPluginSetupDependencies { export interface SecuritySolutionPluginStartDependencies { alerting: AlertingPluginStart; - cases?: CasesStart; + cases?: CasesServerStart; cloud: CloudSetup; cloudExperiments?: CloudExperimentsPluginStart; data: DataPluginStart; diff --git a/x-pack/plugins/threat_intelligence/public/types.ts b/x-pack/plugins/threat_intelligence/public/types.ts index 6d77f991dec1e..7d8c4d2de0793 100644 --- a/x-pack/plugins/threat_intelligence/public/types.ts +++ b/x-pack/plugins/threat_intelligence/public/types.ts @@ -21,7 +21,7 @@ import { BrowserField } from '@kbn/rule-registry-plugin/common'; import { Store } from 'redux'; import { DataProvider } from '@kbn/timelines-plugin/common'; import { Start as InspectorPluginStart } from '@kbn/inspector-plugin/public'; -import { CasesUiSetup, CasesUiStart } from '@kbn/cases-plugin/public/types'; +import { CasesPublicSetup, CasesPublicStart } from '@kbn/cases-plugin/public/types'; import { CreateExceptionListItemSchema } from '@kbn/securitysolution-io-ts-list-types'; import { Policy } from './modules/block_list/hooks/use_policies'; @@ -33,7 +33,7 @@ export interface SecuritySolutionDataViewBase extends DataViewBase { export interface ThreatIntelligencePluginSetup {} export interface SetupPlugins { - cases: CasesUiSetup; + cases: CasesPublicSetup; } export interface ThreatIntelligencePluginStart { @@ -47,7 +47,7 @@ export interface ThreatIntelligencePluginStartDeps { } export type Services = { - cases: CasesUiStart; + cases: CasesPublicStart; data: DataPublicPluginStart; storage: Storage; dataViews: DataViewsPublicPluginStart; diff --git a/x-pack/plugins/threat_intelligence/server/types.ts b/x-pack/plugins/threat_intelligence/server/types.ts index b53ee6a3f6a88..ff41c53560406 100644 --- a/x-pack/plugins/threat_intelligence/server/types.ts +++ b/x-pack/plugins/threat_intelligence/server/types.ts @@ -7,11 +7,11 @@ import { CoreSetup, CoreStart, Plugin } from '@kbn/core/server'; import { DataPluginSetup, DataPluginStart } from '@kbn/data-plugin/server/plugin'; -import type { CasesSetup } from '@kbn/cases-plugin/server'; +import type { CasesServerSetup } from '@kbn/cases-plugin/server'; export interface ThreatIntelligencePluginSetupDependencies { data: DataPluginSetup; - cases: CasesSetup; + cases: CasesServerSetup; } export interface ThreatIntelligencePluginStartDependencies { diff --git a/x-pack/plugins/timelines/public/types.ts b/x-pack/plugins/timelines/public/types.ts index 69bd8bc92f8fd..a91d8669debc7 100644 --- a/x-pack/plugins/timelines/public/types.ts +++ b/x-pack/plugins/timelines/public/types.ts @@ -10,7 +10,7 @@ import type { SensorAPI } from '@hello-pangea/dnd'; import { Store } from 'redux'; import { CoreStart } from '@kbn/core/public'; import type { DataPublicPluginStart } from '@kbn/data-plugin/public'; -import { CasesUiStart } from '@kbn/cases-plugin/public'; +import { CasesPublicStart } from '@kbn/cases-plugin/public'; import { ApmBase } from '@elastic/apm-rum'; import type { UseAddToTimelineProps, UseAddToTimeline } from './hooks/use_add_to_timeline'; import { HoverActionsConfig } from './components/hover_actions'; @@ -29,7 +29,7 @@ export interface TimelinesUIStart { export interface TimelinesStartPlugins { data: DataPublicPluginStart; - cases: CasesUiStart; + cases: CasesPublicStart; apm?: ApmBase; } diff --git a/x-pack/test/cases_api_integration/common/plugins/cases/server/plugin.ts b/x-pack/test/cases_api_integration/common/plugins/cases/server/plugin.ts index b2ac0602774d5..9de0d8b2a8cef 100644 --- a/x-pack/test/cases_api_integration/common/plugins/cases/server/plugin.ts +++ b/x-pack/test/cases_api_integration/common/plugins/cases/server/plugin.ts @@ -9,7 +9,7 @@ import { Plugin, CoreSetup, CoreStart, PluginInitializerContext, Logger } from ' import { PluginSetupContract as FeaturesPluginSetup } from '@kbn/features-plugin/server'; import { SpacesPluginStart } from '@kbn/spaces-plugin/server'; import { SecurityPluginStart } from '@kbn/security-plugin/server'; -import type { CasesStart, CasesSetup } from '@kbn/cases-plugin/server'; +import type { CasesServerStart, CasesServerSetup } from '@kbn/cases-plugin/server'; import { FilesSetup } from '@kbn/files-plugin/server'; import { getPersistableStateAttachment } from './attachments/persistable_state'; import { getExternalReferenceAttachment } from './attachments/external_reference'; @@ -18,14 +18,14 @@ import { registerCaseFixtureFileKinds } from './files'; export interface FixtureSetupDeps { features: FeaturesPluginSetup; - cases: CasesSetup; + cases: CasesServerSetup; files: FilesSetup; } export interface FixtureStartDeps { security?: SecurityPluginStart; spaces?: SpacesPluginStart; - cases: CasesStart; + cases: CasesServerStart; } export class FixturePlugin implements Plugin { diff --git a/x-pack/test/functional_with_es_ssl/plugins/cases/public/application.tsx b/x-pack/test/functional_with_es_ssl/plugins/cases/public/application.tsx index af4fb983124e8..583dc72529a7a 100644 --- a/x-pack/test/functional_with_es_ssl/plugins/cases/public/application.tsx +++ b/x-pack/test/functional_with_es_ssl/plugins/cases/public/application.tsx @@ -18,7 +18,7 @@ import { } from '@elastic/eui'; import { Router } from '@kbn/shared-ux-router'; import { AppMountParameters, CoreStart } from '@kbn/core/public'; -import { CasesUiStart } from '@kbn/cases-plugin/public'; +import { CasesPublicStart } from '@kbn/cases-plugin/public'; import { AttachmentType } from '@kbn/cases-plugin/common'; import { KibanaContextProvider, KibanaThemeProvider } from '@kbn/kibana-react-plugin/public'; import { EuiThemeProvider as StyledComponentsThemeProvider } from '@kbn/kibana-react-plugin/common'; @@ -28,11 +28,11 @@ import { I18nProvider } from '@kbn/i18n-react'; export interface RenderAppProps { mountParams: AppMountParameters; coreStart: CoreStart; - pluginsStart: { cases: CasesUiStart }; + pluginsStart: { cases: CasesPublicStart }; } interface CasesFixtureAppDeps { - cases: CasesUiStart; + cases: CasesPublicStart; } const permissions = { diff --git a/x-pack/test/functional_with_es_ssl/plugins/cases/public/plugin.ts b/x-pack/test/functional_with_es_ssl/plugins/cases/public/plugin.ts index 2df834abf1f22..c5456907150c7 100644 --- a/x-pack/test/functional_with_es_ssl/plugins/cases/public/plugin.ts +++ b/x-pack/test/functional_with_es_ssl/plugins/cases/public/plugin.ts @@ -6,7 +6,7 @@ */ import { Plugin, CoreSetup, CoreStart, AppMountParameters } from '@kbn/core/public'; -import { CasesUiSetup, CasesUiStart } from '@kbn/cases-plugin/public/types'; +import { CasesPublicSetup, CasesPublicStart } from '@kbn/cases-plugin/public/types'; import { LensPublicStart } from '@kbn/lens-plugin/public'; import { getExternalReferenceAttachmentRegular } from './attachments/external_reference'; import { getPersistableStateAttachmentRegular } from './attachments/persistable_state'; @@ -15,12 +15,12 @@ export type Setup = void; export type Start = void; export interface CasesExamplePublicSetupDeps { - cases: CasesUiSetup; + cases: CasesPublicSetup; } export interface CasesExamplePublicStartDeps { lens: LensPublicStart; - cases: CasesUiStart; + cases: CasesPublicStart; } export class CasesFixturePlugin diff --git a/x-pack/test/functional_with_es_ssl/plugins/cases/server/plugin.ts b/x-pack/test/functional_with_es_ssl/plugins/cases/server/plugin.ts index fc3dd61fe6a44..9a325eaf46077 100644 --- a/x-pack/test/functional_with_es_ssl/plugins/cases/server/plugin.ts +++ b/x-pack/test/functional_with_es_ssl/plugins/cases/server/plugin.ts @@ -5,13 +5,13 @@ * 2.0. */ -import { CasesSetup } from '@kbn/cases-plugin/server/types'; +import { CasesServerSetup } from '@kbn/cases-plugin/server/types'; import { Plugin, CoreSetup } from '@kbn/core/server'; import { getExternalReferenceAttachment } from './attachments/external_reference'; import { getPersistableStateAttachmentServer } from './attachments/persistable_state'; export interface CasesExamplePublicSetupDeps { - cases: CasesSetup; + cases: CasesServerSetup; } export class CasesFixturePlugin implements Plugin {