import { RecursiveReadonly } from '@osd/utility-types' ; import { deepFreeze } from '@osd/std' ; import { Capabilities } from '../../../types/capabilities' ; import { HttpStart } from '../../http' ; interface StartDeps { appIds : string [ ] ; http : HttpStart ; } internal export interface CapabilitiesStart { capabilities : RecursiveReadonly < Capabilities > ; } internal export class CapabilitiesService { public async start ( { appIds , http } ) { const capabilities = await http . post < Capabilities > ( '/api/core/capabilities' , { body : JSON . stringify ( { applications : appIds } ) , } ) ; return { capabilities : deepFreeze ( capabilities ) , } ; } }