import { AbstractSearchStrategy } from './abstract_search_strategy' ; import { DefaultSearchCapabilities } from '../capabilities/default_search_capabilities' ; import type { IndexPatternsService } from '../../../../../../data/server' ; import type { FetchedIndexPattern } from '../../../../common/types' ; import type { VisTypeTimeseriesRequestHandlerContext , VisTypeTimeseriesRequest , } from '../../../types' ; import { UI_SETTINGS } from '../../../../common/constants' ; export class DefaultSearchStrategy extends AbstractSearchStrategy { async checkForViability ( requestContext , req ) { const uiSettings = requestContext . core . uiSettings . client ; return { isViable : true , capabilities : new DefaultSearchCapabilities ( { panel : req . body . panels ? req . body . panels [ 0 ] : null , timezone : req . body . timerange ?. timezone , maxBucketsLimit : await uiSettings . get ( UI_SETTINGS . MAX_BUCKETS_SETTING ) , } ) , } ; } async getFieldsForWildcard ( fetchedIndexPattern , indexPatternsService , capabilities ? ) { return super . getFieldsForWildcard ( fetchedIndexPattern , indexPatternsService , capabilities ) ; } }