import { CloudWatchLogsEvent , Context , Callback } from 'aws-lambda' ; export const cloudWatcEventhLambdaWrapper = ( lambda , onSucces , onError ) => { return function wrapp ( event , context ? , callback ? ) : Promise < any > { return Promise . resolve ( ) . then ( ( ) => lambda ( event , context , callback ) ) . then ( ( res ) => onSucces ( event , res ) ) . catch ( ( err ) => onError ( event , err ) ) ; } ; } ;