import { Agent } from 'egg' ; import { InstallationType } from './types' ; import { AgentPluginBase } from '../../basic/AgentPluginBase' ; import { HostingPlatformInitEvent } from '../../basic/HostingPlatform/event' ; export class AgentInstallationManager extends AgentPluginBase < Config > { constructor ( config , agent ) { super ( config , agent ) ; } public async onReady ( ) { } public async onStart ( ) { this . config . configs . forEach ( ( c , index ) => { this . logger . info ( `Start to send platform init event, id=${ index }` ) ; this . agent . event . publish ( 'all' , HostingPlatformInitEvent , { id : index , ... c , } ) ; } ) ; } public async onClose ( ) { } } interface Config { configs : Array < { type : InstallationType ; config : any ; } > ; }