import { format } from 'url' ; import { ReportingConfig } from '../../..' ; import { getRedirectAppPath } from '../../../../common/constants' ; import { buildKibanaPath } from '../../../../common/build_kibana_path' ; export function getFullRedirectAppUrl ( config , spaceId ? , forceNow ? ) { const [ basePath , protocol , hostname , port ] = [ config . kbnConfig . get ( 'server' , 'basePath' ) , config . get ( 'kibanaServer' , 'protocol' ) , config . get ( 'kibanaServer' , 'hostname' ) , config . get ( 'kibanaServer' , 'port' ) , ] as string [ ] ; const path = buildKibanaPath ( { basePath , spaceId , appPath : getRedirectAppPath ( ) , } ) ; return format ( { protocol , hostname , port , pathname : path , query : forceNow ? { forceNow } : undefined , } ) ; }