import type * as estypes from '@elastic/elasticsearch/lib/api/typesWithBodyKey' ; import { ISearchRequestParams } from '../../../../../../../../../src/plugins/data/common' ; import { AgentsRequestOptions } from '../../../../../../common/search_strategy' ; export const buildActionsQuery = ( { filterQuery , sort , pagination : { cursorStart , querySize } , } ) : ISearchRequestParams => { const dslQuery = { allow_no_indices : true , index : '.fleet-actions' , ignore_unavailable : true , body : { query : { bool : { must : [ { term : { type : { value : 'INPUT_ACTION' , } , } , } , { term : { input_type : { value : 'osquery' , } , } , } , ] as estypes . QueryDslQueryContainer [ ] , } , } , from : cursorStart , size : querySize , track_total_hits : true , fields : [ '*' ] , sort : [ { [ sort . field ] : { order : sort . direction , } , } , ] , } , } ; return dslQuery ; } ;