import { Plugin , CoreSetup , Logger , PluginInitializerContext } from 'kibana/server' ; import { PluginSetupContract as ActionsPluginSetup } from '../../../../../../../plugins/actions/server/plugin' ; import { PluginSetupContract as AlertingPluginSetup } from '../../../../../../../plugins/alerting/server/plugin' ; import { EncryptedSavedObjectsPluginStart } from '../../../../../../../plugins/encrypted_saved_objects/server' ; import { PluginSetupContract as FeaturesPluginSetup } from '../../../../../../../plugins/features/server' ; import { defineAlertTypes } from './alert_types' ; import { defineActionTypes } from './action_types' ; import { defineRoutes } from './routes' ; import { SpacesPluginStart } from '../../../../../../../plugins/spaces/server' ; import { SecurityPluginStart } from '../../../../../../../plugins/security/server' ; import { PluginStartContract as ActionsPluginStart } from '../../../../../../../plugins/actions/server' ; export interface FixtureSetupDeps { features : FeaturesPluginSetup ; actions : ActionsPluginSetup ; alerting : AlertingPluginSetup ; } export interface FixtureStartDeps { encryptedSavedObjects : EncryptedSavedObjectsPluginStart ; security ? : SecurityPluginStart ; spaces ? : SpacesPluginStart ; actions : ActionsPluginStart ; } export class FixturePlugin implements Plugin < void , void , FixtureSetupDeps , FixtureStartDeps > { private readonly logger : Logger ; constructor ( initializerContext ) { this . logger = initializerContext . logger . get ( 'fixtures' , 'plugins' , 'alerts' ) ; } public setup ( core , { features , actions , alerting } ) { features . registerKibanaFeature ( { id : 'alertsFixture' , name : 'Alerts' , app : [ 'alerts' , 'kibana' ] , category : { id : 'foo' , label : 'foo' } , alerting : [ 'test.always-firing' , 'test.cumulative-firing' , 'test.never-firing' , 'test.failing' , 'test.authorization' , 'test.delayed' , 'test.validation' , 'test.onlyContextVariables' , 'test.onlyStateVariables' , 'test.noop' , 'test.unrestricted-noop' , 'test.patternFiring' , 'test.throw' , 'test.longRunning' , ] , privileges : { all : { app : [ 'alerts' , 'kibana' ] , savedObject : { all : [ 'alert' ] , read : [ ] , } , alerting : { rule : { all : [ 'test.always-firing' , 'test.cumulative-firing' , 'test.never-firing' , 'test.failing' , 'test.delayed' , 'test.authorization' , 'test.validation' , 'test.onlyContextVariables' , 'test.onlyStateVariables' , 'test.noop' , 'test.unrestricted-noop' , 'test.patternFiring' , 'test.throw' , 'test.longRunning' , ] , } , } , ui : [ ] , } , read : { app : [ 'alerts' , 'kibana' ] , savedObject : { all : [ ] , read : [ 'alert' ] , } , alerting : { rule : { read : [ 'test.always-firing' , 'test.cumulative-firing' , 'test.never-firing' , 'test.failing' , 'test.authorization' , 'test.delayed' , 'test.validation' , 'test.onlyContextVariables' , 'test.onlyStateVariables' , 'test.noop' , 'test.unrestricted-noop' , 'test.patternFiring' , 'test.throw' , 'test.longRunning' , ] , } , } , ui : [ ] , } , } , } ) ; defineActionTypes ( core , { actions } ) ; defineAlertTypes ( core , { alerting } ) ; defineRoutes ( core , { logger : this . logger } ) ; } public start ( ) { } public stop ( ) { } }