UNPKG

@novu/framework

Version:

The Code-First Notifications Workflow SDK.

2 lines (1 loc) 974 B
import{b as h,c as a,d as f}from"../chunk-WSQ6EEHO.js";import{a as H}from"../chunk-MQSAHSED.js";import"../chunk-JKG63DBC.js";import{S as m}from"../chunk-APAOD3BG.js";import{a as c}from"../chunk-RCWIURDJ.js";import{f as y}from"../chunk-LPE4ME2M.js";import"../chunk-PLPQUHX6.js";var l="express",E=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,E as serve,H as step,f as workflow};