UNPKG

@novu/framework

Version:

The Code-First Notifications Workflow SDK.

2 lines (1 loc) 1.01 kB
import{b as u,c as n,d as i}from"../chunk-ZF4VXELU.js";import{h as m,ja as P,ra as h}from"../chunk-YLCZR2QR.js";var p="lambda",l=y=>new n({frameworkName:p,...y,handler:r=>{let s=(e=>e.version==="2.0")(r);return{url:()=>{let e=s?r.requestContext.http.path:r.path,t=r.headers["x-forwarded-proto"]||"https",a=new URL(e,`${t}://${r.headers.host||r.headers.Host||""}`);for(let o in r.queryStringParameters)o&&a.searchParams.set(o,r.queryStringParameters[o]);return a},body:()=>{let e="{}";return r.body&&(e=r.isBase64Encoded?Buffer.from(r.body,"base64").toString():r.body),JSON.parse(e)},headers:e=>r.headers[e],queryString:e=>{var t;return(t=r.queryStringParameters)==null?void 0:t[e]},transformResponse:({body:e,status:t,headers:a})=>Promise.resolve({body:e,statusCode:t,headers:a}),method:()=>s?r.requestContext.http.method:r.httpMethod}}}).createHandler();export{u as Client,m as CronExpression,n as NovuRequestHandler,h as SeverityLevelEnum,p as frameworkName,P as providerSchemas,l as serve,i as workflow};