import type { ElasticsearchClient } from 'src/core/server' ; export const getManagedPolicyNames = async ( clusterClient ) : Promise < string [ ] > => { try { const { body : { persistent , transient , defaults } , } = await clusterClient . cluster . getSettings ( { filter_path : '*.*managed_policies' , flat_settings : true , include_defaults : true , } ) ; const { 'cluster.metadata.managed_policies' : managedPolicyNames = [ ] } = { ... defaults , ... persistent , ... transient , } ; return managedPolicyNames ; } catch ( e ) { return [ ] ; } } ;