mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 01:13:23 -04:00
[Cases] Fix plugin lifecycle inconsistencies (#177132)
## Summary
The script from https://github.com/elastic/kibana/pull/171483 can
identify inconsistencies and untyped dependencies in Kibana plugins.
This PR fixes:
- Move `esUiShared`, `kibanaReact`, `kibanaUtils`, and
`savedObjectsFinder` to `requiredBundles`
- Rename `CasesUiSetup` to `CasesPublicSetup`
- Rename `CasesUiStart` to `CasesPublicStart`
- Rename `CasesSetup` to `CasesServerSetup`
- Rename `CasesStart` to `CasesServerStart`
- Rename `CasesPluginSetup` (public) to `CasesPublicSetupDependencies`
- Rename `CasesPluginStart` (public) to `CasesPublicStartDependencies`
- Moved `PluginsSetup` from `server/plugin.ts` to `server/types.ts` and
rename it to `CasesServerSetupDependencies`
- Moved `PluginsStart` from `server/plugin.ts` to `server/types.ts` and
rename it to `CasesServerStartDependencies`
I could not add the `apm` to optional plugins because I get an error due
to circular dependencies. Observability and Secuirty solution have `apm`
and `cases` as a dependency and probably this cause the following error.
<details>
<summary>Error</summary>
```
info Running model version mapping addition checks
│ info Generating field lists from registry and file
│ info Loading core with all plugins enabled so that we can get all savedObject mappings...
│ERROR UNHANDLED ERROR: Error: Topological ordering of plugins did not complete, these plugins have cyclic or missing dependencies: ["aiAssistantManagementObservability","aiops","apm","assetManager","cases","cloudDefend","datasetQuality","elasticAssistant","enterpriseSearch","exploratoryView","infra","kubernetesSecurity","logsShared","logstash","metricsDataAccess","ml","monitoring","observability","observabilityAIAssistant","observabilityOnboarding","observabilityShared","observabilityLogsExplorer","osquery","profiling","securitySolution","securitySolutionEss","securitySolutionServerless","serverlessObservability","sessionView","synthetics","threatIntelligence","timelines","upgradeAssistant","uptime","ux"]
│ERROR at PluginsSystem.getTopologicallySortedPluginNames (plugins_system.ts:354:13)
│ERROR at PluginsSystem.uiPlugins (plugins_system.ts:274:36)
│ERROR at PluginsService.discover (plugins_service.ts:120:58)
│ERROR at Server.preboot (server.ts:172:30)
│ERROR at Root.preboot (index.ts:57:14)
│ERROR at extract_field_lists_from_plugins_worker.ts:51:3
ERROR UNHANDLED ERROR
ERROR Error: worker exited without sending mappings
at extractFieldListsFromPlugins (extract_field_lists_from_plugins.ts:62:11)
at processTicksAndRejections (node:internal/process/task_queues:95:5)
at runModelVersionMappingAdditionsChecks (run_versions_mapping_additions_check.ts:28:66)
at run_check_mappings_update_cli.ts:23:9
at tooling_log.ts:84:18
at description (run_check_mappings_update_cli.ts:22:7)
at run.ts:73:10
at withProcRunner (with_proc_runner.ts:29:5)
at run (run.ts:71:5)
```
</details>
Also, the `storage` is passed by the `cases` plugin to the Kibana
context and is not a dependency to another plugin. The script assumes
that the `storage` is a plugin dependency and reports it. Neverthelss,
this demonstrates that we should stop passing `storage` to the Kibana
context and use hooks like `useLocalStorage`.
## Results from the script
<img width="727" alt="Screenshot 2024-02-17 at 8 54 32 AM"
src="1c86f501
-72c5-473c-92f5-7a4935da914b">
### For maintainers
- [x] This was checked for breaking API changes and was [labeled
appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)
---------
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
This commit is contained in:
parent
e82efe222d
commit
c7f2a6e3e6
51 changed files with 203 additions and 170 deletions
|
@ -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
|
||||
) {
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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({
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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"
|
||||
]
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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<CoreStart, 'application' | 'http' | 'theme'> &
|
||||
Pick<CasesPluginStart, 'serverless'>;
|
||||
Pick<CasesPublicStartDependencies, 'serverless'>;
|
||||
|
||||
export class KibanaServices {
|
||||
private static kibanaVersion?: string;
|
||||
|
|
|
@ -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 = <T extends { fields: ConnectorTypeF
|
|||
};
|
||||
|
||||
export const getConnectorIcon = (
|
||||
triggersActionsUi: CasesPluginStart['triggersActionsUi'],
|
||||
triggersActionsUi: CasesPublicStartDependencies['triggersActionsUi'],
|
||||
type?: string
|
||||
): IconType => {
|
||||
/**
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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';
|
||||
|
|
|
@ -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<CasesUiStart['api']> = {
|
||||
const apiMock: jest.Mocked<CasesPublicStart['api']> = {
|
||||
getRelatedCases: jest.fn(),
|
||||
cases: {
|
||||
find: jest.fn(),
|
||||
|
@ -18,7 +18,7 @@ const apiMock: jest.Mocked<CasesUiStart['api']> = {
|
|||
},
|
||||
};
|
||||
|
||||
const uiMock: jest.Mocked<CasesUiStart['ui']> = {
|
||||
const uiMock: jest.Mocked<CasesPublicStart['ui']> = {
|
||||
getCases: jest.fn(),
|
||||
getCasesContext: jest.fn().mockImplementation(() => mockCasesContext),
|
||||
getAllCasesSelectorModal: jest.fn(),
|
||||
|
@ -28,7 +28,7 @@ const uiMock: jest.Mocked<CasesUiStart['ui']> = {
|
|||
export const openAddToExistingCaseModalMock = jest.fn();
|
||||
export const openAddToNewCaseFlyoutMock = jest.fn();
|
||||
|
||||
const hooksMock: jest.Mocked<CasesUiStart['hooks']> = {
|
||||
const hooksMock: jest.Mocked<CasesPublicStart['hooks']> = {
|
||||
useCasesAddToNewCaseFlyout: jest.fn().mockImplementation(() => ({
|
||||
open: openAddToNewCaseFlyoutMock,
|
||||
})),
|
||||
|
@ -37,7 +37,7 @@ const hooksMock: jest.Mocked<CasesUiStart['hooks']> = {
|
|||
})),
|
||||
};
|
||||
|
||||
const helpersMock: jest.Mocked<CasesUiStart['helpers']> = {
|
||||
const helpersMock: jest.Mocked<CasesPublicStart['helpers']> = {
|
||||
canUseCases: jest.fn(),
|
||||
getUICapabilities: jest.fn().mockReturnValue({
|
||||
all: false,
|
||||
|
@ -54,10 +54,10 @@ const helpersMock: jest.Mocked<CasesUiStart['helpers']> = {
|
|||
};
|
||||
|
||||
export interface CaseUiClientMock {
|
||||
api: jest.Mocked<CasesUiStart['api']>;
|
||||
ui: jest.Mocked<CasesUiStart['ui']>;
|
||||
hooks: jest.Mocked<CasesUiStart['hooks']>;
|
||||
helpers: jest.Mocked<CasesUiStart['helpers']>;
|
||||
api: jest.Mocked<CasesPublicStart['api']>;
|
||||
ui: jest.Mocked<CasesPublicStart['ui']>;
|
||||
hooks: jest.Mocked<CasesPublicStart['hooks']>;
|
||||
helpers: jest.Mocked<CasesPublicStart['helpers']>;
|
||||
}
|
||||
|
||||
export const mockCasesContract = (): CaseUiClientMock => ({
|
||||
|
|
|
@ -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<typeof coreMock.createSetup>;
|
||||
let coreStart: ReturnType<typeof coreMock.createStart>;
|
||||
let pluginsSetup: jest.Mocked<CasesPluginSetup>;
|
||||
let pluginsStart: jest.Mocked<CasesPluginStart>;
|
||||
let pluginsSetup: jest.Mocked<CasesPublicSetupDependencies>;
|
||||
let pluginsStart: jest.Mocked<CasesPublicStartDependencies>;
|
||||
|
||||
beforeEach(() => {
|
||||
context = coreMock.createPluginInitializerContext(getConfig());
|
||||
|
|
|
@ -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<void, CasesUiStart, CasesPluginSetup, CasesPluginStart>
|
||||
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<CasesUiConfigType>();
|
||||
|
||||
KibanaServices.init({
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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';
|
||||
|
|
|
@ -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(),
|
||||
|
|
|
@ -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<typeof coreMock.createSetup>;
|
||||
let coreStart: ReturnType<typeof coreMock.createStart>;
|
||||
let pluginsSetup: jest.Mocked<PluginsSetup>;
|
||||
let pluginsStart: jest.Mocked<PluginsStart>;
|
||||
let pluginsSetup: jest.Mocked<CasesServerSetupDependencies>;
|
||||
let pluginsStart: jest.Mocked<CasesServerStartDependencies>;
|
||||
|
||||
beforeEach(() => {
|
||||
context = coreMock.createPluginInitializerContext<ConfigType>(getConfig());
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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<CasesClient>;
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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
|
||||
) {
|
||||
|
|
|
@ -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
|
||||
) {
|
||||
|
|
|
@ -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
|
||||
) {
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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
|
||||
) {
|
||||
|
|
|
@ -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<void>;
|
||||
private setMlReady: () => void = () => {};
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -35,7 +35,6 @@
|
|||
"optionalPlugins": [
|
||||
"actions",
|
||||
"alerting",
|
||||
"cases",
|
||||
"charts",
|
||||
"cloud",
|
||||
"discover",
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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<void, void, FixtureSetupDeps, FixtureStartDeps> {
|
||||
|
|
|
@ -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 = {
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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<void, void, CasesExamplePublicSetupDeps> {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue