import { Plugin , CoreSetup } from 'kibana/server' ; import { ApiRoutes } from './routes' ; import { handleEsError } from './shared_imports' ; import { SetupDependencies , StartDependencies } from './types' ; export class LicenseManagementServerPlugin implements Plugin < void , void , SetupDependencies , StartDependencies > { private readonly apiRoutes = new ApiRoutes ( ) ; setup ( { http , getStartServices } , { features , security } ) { const router = http . createRouter ( ) ; features . registerElasticsearchFeature ( { id : 'license_management' , management : { stack : [ 'license_management' ] , } , privileges : [ { requiredClusterPrivileges : [ 'manage' ] , ui : [ ] , } , ] , } ) ; getStartServices ( ) . then ( ( [ , { licensing } ] ) => { this . apiRoutes . setup ( { router , plugins : { licensing , } , lib : { handleEsError , } , config : { isSecurityEnabled : security !== undefined , } , } ) ; } ) ; } start ( ) { } stop ( ) { } }