import { ESSearchRequest , ESSearchResponse , } from '../../../../../../src/core/types/elasticsearch' ; import { AlertServices } from '../../../../alerting/server' ; export async function alertingEsClient < TParams extends ESSearchRequest > ( { scopedClusterClient , params , } ) { const response = await scopedClusterClient . asCurrentUser . search ( { ... params , ignore_unavailable : true , } ) ; return response . body as unknown as ESSearchResponse < unknown , TParams > ; }