import _ from 'lodash' ; import type { Query } from 'src/plugins/data/common' ; import { DataFilters , VectorSourceRequestMeta } from '../../../common/descriptor_types' ; import { IVectorSource } from '../sources/vector_source' ; import { ITermJoinSource } from '../sources/term_join_source' ; export function buildVectorRequestMeta ( source , fieldNames , dataFilters , sourceQuery , isForceRefresh ) { return { ... dataFilters , fieldNames : _ . uniq ( fieldNames ) . sort ( ) , geogridPrecision : source . getGeoGridPrecision ( dataFilters . zoom ) , sourceQuery : sourceQuery ? sourceQuery : undefined , applyGlobalQuery : source . getApplyGlobalQuery ( ) , applyGlobalTime : source . getApplyGlobalTime ( ) , sourceMeta : source . getSyncMeta ( ) , applyForceRefresh : source . isESSource ( ) ? source . getApplyForceRefresh ( ) : false , isForceRefresh , } ; }