import { Observable } from 'rxjs' ; import { IClusterClient , KibanaRequest } from 'src/core/server' ; import { SpacesServiceStart } from '../../spaces/server' ; import { EsContext } from './es' ; import { IEventLogClientService } from './types' ; import { EventLogClient } from './event_log_client' ; import { SavedObjectProviderRegistry } from './saved_object_provider_registry' ; export type PluginClusterClient = Pick < IClusterClient , 'asInternalUser' > ; export type AdminClusterClient$ = Observable < PluginClusterClient > ; interface EventLogServiceCtorParams { esContext : EsContext ; savedObjectProviderRegistry : SavedObjectProviderRegistry ; spacesService ? : SpacesServiceStart ; } export class EventLogClientService implements IEventLogClientService { private esContext : EsContext ; private savedObjectProviderRegistry : SavedObjectProviderRegistry ; private spacesService ? : SpacesServiceStart ; constructor ( { esContext , savedObjectProviderRegistry , spacesService , } ) { this . esContext = esContext ; this . savedObjectProviderRegistry = savedObjectProviderRegistry ; this . spacesService = spacesService ; } getClient ( request ) { return new EventLogClient ( { esContext : this . esContext , savedObjectGetter : this . savedObjectProviderRegistry . getProvidersClient ( request ) , spacesService : this . spacesService , request , } ) ; } }