import { StartServicesAccessor } from 'src/core/server' ; import { LicensingPluginStart } from '../types' ; import { LicensingRouter } from '../types' ; export function registerFeatureUsageRoute ( router , getStartServices ) { router . get ( { path : '/api/licensing/feature_usage' , validate : false } , async ( context , request , response ) => { const [ , , { featureUsage } ] = await getStartServices ( ) ; return response . ok ( { body : { features : featureUsage . getLastUsages ( ) . map ( ( usage ) => ( { name : usage . name , last_used : usage . lastUsed , license_level : usage . licenseType , } ) ) , } , } ) ; } ) ; }