import { schema } from '@osd/config-schema' ; import { IRouter } from '../../http' ; export const registerBulkGetRoute = ( router ) => { router . post ( { path : '/_bulk_get' , validate : { body : schema . arrayOf ( schema . object ( { type : schema . string ( ) , id : schema . string ( ) , fields : schema . maybe ( schema . arrayOf ( schema . string ( ) ) ) , } ) ) , } , } , router . handleLegacyErrors ( async ( context , req , res ) => { const result = await context . core . savedObjects . client . bulkGet ( req . body ) ; return res . ok ( { body : result } ) ; } ) ) ; } ;