import type { PutTransformsRequestSchema } from '../../../../plugins/transform/common/api_schemas/transforms' ; export async function asyncForEach ( array , callback ) { for ( let index = 0 ; index < array . length ; index ++ ) { await callback ( array [ index ] , index , array ) ; } } export function generateDestIndex ( transformId ) { return `user-${ transformId }` ; } export function generateTransformConfig ( transformId ) { const destinationIndex = generateDestIndex ( transformId ) ; return { source : { index : [ 'ft_farequote' ] } , pivot : { group_by : { airline : { terms : { field : 'airline' } } } , aggregations : { '@timestamp.value_count' : { value_count : { field : '@timestamp' } } } , } , dest : { index : destinationIndex } , } ; }