UNPKG

@novu/framework

Version:

The Code-First Notifications Workflow SDK.

2 lines (1 loc) 799 B
import{b as h,c as a,d as f}from"../chunk-ZF4VXELU.js";import{h as y,ja as c,ra as m}from"../chunk-YLCZR2QR.js";var l="express",w=p=>new a({frameworkName:l,...p,handler:(t,o)=>({body:()=>t.body,headers:e=>{let r=t.headers[e];return Array.isArray(r)?r[0]:r},method:()=>t.method||"GET",url:()=>{let e=t.headers.host||"",r=e!=null&&e.includes("://")?"":`${t.protocol||"https"}://`;return new URL(t.originalUrl||t.url||"",`${r}${e||""}`)},queryString:e=>{let r=t.query[e];return Array.isArray(r)?r[0]:r},transformResponse:({body:e,headers:r,status:s})=>(Object.entries(r).forEach(([n,d])=>{o.setHeader(n,d)}),o.status(s).send(e))})}).createHandler();export{h as Client,y as CronExpression,a as NovuRequestHandler,m as SeverityLevelEnum,l as frameworkName,c as providerSchemas,w as serve,f as workflow};