import { schema , TypeOf } from '@kbn/config-schema' ; import type { IRouter , KibanaRequest , RequestHandlerContext } from 'src/core/server' ; export type { IEvent , IValidatedEvent } from '../generated/schemas' ; export { EventSchema , ECS_VERSION } from '../generated/schemas' ; import { IEvent } from '../generated/schemas' ; import { FindOptionsType } from './event_log_client' ; import { QueryEventsBySavedObjectResult } from './es/cluster_client_adapter' ; export type { QueryEventsBySavedObjectResult } from './es/cluster_client_adapter' ; import { SavedObjectProvider } from './saved_object_provider_registry' ; export const SAVED_OBJECT_REL_PRIMARY = 'primary' ; export const ConfigSchema = schema . object ( { logEntries : schema . boolean ( { defaultValue : false } ) , indexEntries : schema . boolean ( { defaultValue : true } ) , } ) ; export type IEventLogConfig = TypeOf < typeof ConfigSchema > ; export interface IEventLogService { isLoggingEntries ( ) : boolean ; isIndexingEntries ( ) : boolean ; registerProviderActions ( provider , actions ) : void ; isProviderActionRegistered ( provider , action ) : boolean ; getProviderActions ( ) : Map < string , Set < string > > ; registerSavedObjectProvider ( type , provider ) : void ; getLogger ( properties ) : IEventLogger ; getIndexPattern ( ) : string ; isEsContextReady ( ) : Promise < boolean > ; } export interface IEventLogClientService { getClient ( request ) : IEventLogClient ; } export interface IEventLogClient { findEventsBySavedObjectIds ( type , ids , options ? , legacyIds ? ) : Promise < QueryEventsBySavedObjectResult > ; } export interface IEventLogger { logEvent ( properties ) : void ; startTiming ( event ) : void ; stopTiming ( event ) : void ; } internal export interface EventLogApiRequestHandlerContext { getEventLogClient ( ) : IEventLogClient ; } internal export interface EventLogRequestHandlerContext extends RequestHandlerContext { eventLog : EventLogApiRequestHandlerContext ; } internal export type EventLogRouter = IRouter < EventLogRequestHandlerContext > ;