import type { IContextProvider , StartServicesAccessor } from 'src/core/server' ; import { Observable } from 'rxjs' ; import { take } from 'rxjs/operators' ; import type { ILicense } from '../common/types' ; import type { LicensingPluginStart , LicensingRequestHandlerContext } from './types' ; param license$ public export function createRouteHandlerContext ( license$ , getStartServices ) { return async function licensingRouteHandlerContext ( ) { const [ , , { featureUsage } ] = await getStartServices ( ) ; const license = await license$ . pipe ( take ( 1 ) ) . toPromise ( ) ; return { featureUsage , license , } ; } ; }