sorry, I'm a bit annoyed in case you can't tell, but seriously we couldn't just do something like this?
import{decorate,Tracer}from'@aws-lambda-powertools/tracer';importtype{Context}from'aws-lambda';importtype{Payment}from'../models/payment';const{captureLambdaHandler,superDuperSpecialStuff,}=Tracer({serviceName:'paymentCollections'});// This can't be a class anymore, because javascript...consthandler=async(input:{Payload:{Payment:Payment}},_context:Context,):Promise<{Status:number;Payment:Payment}>=>{constmin=0;constmax=1;constStatus=Math.floor(Math.random()*(max-min+1))+min;return{Status,Payment:input.Payload.Payment};}exportdefaultdecorate(handler,captureLambdaHandler,superDuperSpecialStuff,// ...);
What you want is supported using middy. You can use class decorators, middy-style function "decorators", or inline imperative statements. Check the docs and you'll see each example has a "Middy Middleware" example.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
sorry, I'm a bit annoyed in case you can't tell, but seriously we couldn't just do something like this?
What you want is supported using middy. You can use class decorators, middy-style function "decorators", or inline imperative statements. Check the docs and you'll see each example has a "Middy Middleware" example.