import { Transport , TransportRequestOptions , TransportRequestOptionsWithMeta , TransportRequestOptionsWithOutMeta , TransportResult } from '@elastic/transport' ; import * as T from '../types' ; import * as TB from '../typesWithBodyKey' ; interface That { transport : Transport ; } export default class Fleet { transport : Transport ; constructor ( transport ) { this . transport = transport ; } async globalCheckpoints ( this , params , options ? ) ; async globalCheckpoints ( this , params , options ? ) ; async globalCheckpoints ( this , params , options ? ) ; async globalCheckpoints ( this , params , options ? ) { const acceptedPath = [ 'index' ] ; const querystring = { } ; const body = undefined ; for ( const key in params ) { if ( acceptedPath . includes ( key ) ) { continue ; } else if ( key !== 'body' ) { querystring [ key ] = params [ key ] ; } } const method = 'GET' ; const path = `/${ encodeURIComponent ( params . index . toString ( ) ) }/_fleet/global_checkpoints` ; return await this . transport . request ( { path , method , querystring , body } , options ) ; } async msearch ( this , params ? , options ? ) ; async msearch ( this , params ? , options ? ) ; async msearch ( this , params ? , options ? ) ; async msearch ( this , params ? , options ? ) { const acceptedPath = [ 'index' ] ; const querystring = { } ; const body = undefined ; params = params ?? { } ; for ( const key in params ) { if ( acceptedPath . includes ( key ) ) { continue ; } else if ( key !== 'body' ) { querystring [ key ] = params [ key ] ; } } let method = '' ; let path = '' ; if ( params . index != null ) { method = body != null ? 'POST' : 'GET' ; path = `/${ encodeURIComponent ( params . index . toString ( ) ) }/_fleet/_fleet_msearch` ; } else { method = body != null ? 'POST' : 'GET' ; path = '/_fleet/_fleet_msearch' ; } return await this . transport . request ( { path , method , querystring , bulkBody : body } , options ) ; } async search ( this , params ? , options ? ) ; async search ( this , params ? , options ? ) ; async search ( this , params ? , options ? ) ; async search ( this , params ? , options ? ) { const acceptedPath = [ 'index' ] ; const querystring = { } ; const body = undefined ; params = params ?? { } ; for ( const key in params ) { if ( acceptedPath . includes ( key ) ) { continue ; } else if ( key !== 'body' ) { querystring [ key ] = params [ key ] ; } } const method = body != null ? 'POST' : 'GET' ; const path = `/${ encodeURIComponent ( params . index . toString ( ) ) }/_fleet/_fleet_search` ; return await this . transport . request ( { path , method , querystring , body } , options ) ; } }