@novu/framework 2.10.0-alpha.3 → 2.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/{health-check.types-4uaeqZcn.d.cts → health-check.types-DwKatX-8.d.cts} +1 -0
- package/dist/cjs/{index-CYSvjrhq.d.cts → index-BTTxx1ad.d.cts} +1 -1
- package/dist/cjs/index.cjs +28 -28
- package/dist/cjs/index.d.cts +2 -2
- package/dist/cjs/internal/index.d.cts +2 -2
- package/dist/cjs/servers/express.cjs +36 -36
- package/dist/cjs/servers/express.d.cts +3 -3
- package/dist/cjs/servers/h3.cjs +49 -49
- package/dist/cjs/servers/h3.d.cts +3 -3
- package/dist/cjs/servers/lambda.cjs +59 -59
- package/dist/cjs/servers/lambda.d.cts +3 -3
- package/dist/cjs/servers/nest.cjs +62 -62
- package/dist/cjs/servers/nest.d.cts +4 -4
- package/dist/cjs/servers/next.cjs +22 -22
- package/dist/cjs/servers/next.d.cts +3 -3
- package/dist/cjs/servers/nuxt.cjs +49 -49
- package/dist/cjs/servers/nuxt.d.cts +3 -3
- package/dist/cjs/servers/remix.cjs +49 -49
- package/dist/cjs/servers/remix.d.cts +3 -3
- package/dist/cjs/servers/sveltekit.cjs +54 -54
- package/dist/cjs/servers/sveltekit.d.cts +3 -3
- package/dist/cjs/validators.cjs +1 -1
- package/dist/esm/chunk-JKG63DBC.js +1 -0
- package/dist/esm/{chunk-6TKOIKX4.js → chunk-WSQ6EEHO.js} +38 -38
- package/dist/esm/{health-check.types-CbPsqNn9.d.ts → health-check.types-C4vZDz5x.d.ts} +1 -0
- package/dist/esm/{index-EtuVRQ6w.d.ts → index-D4Rt1gOC.d.ts} +1 -1
- package/dist/esm/index.d.ts +2 -2
- package/dist/esm/index.js +1 -1
- package/dist/esm/internal/index.d.ts +2 -2
- package/dist/esm/servers/express.d.ts +3 -3
- package/dist/esm/servers/express.js +1 -1
- package/dist/esm/servers/h3.d.ts +3 -3
- package/dist/esm/servers/h3.js +1 -1
- package/dist/esm/servers/lambda.d.ts +3 -3
- package/dist/esm/servers/lambda.js +1 -1
- package/dist/esm/servers/nest.d.ts +4 -4
- package/dist/esm/servers/nest.js +1 -1
- package/dist/esm/servers/next.d.ts +3 -3
- package/dist/esm/servers/next.js +1 -1
- package/dist/esm/servers/nuxt.d.ts +3 -3
- package/dist/esm/servers/nuxt.js +1 -1
- package/dist/esm/servers/remix.d.ts +3 -3
- package/dist/esm/servers/remix.js +1 -1
- package/dist/esm/servers/sveltekit.d.ts +3 -3
- package/dist/esm/servers/sveltekit.js +1 -1
- package/dist/esm/validators.js +1 -1
- package/package.json +17 -17
- package/dist/esm/chunk-V7JTIDNT.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { C as ClientOptions, W as Workflow, H as HealthCheck, D as DiscoverOutput, h as Event, m as ExecuteOutput, d as CodeResult, i as EventTriggerParams, l as Execute, s as WorkflowOptions } from './health-check.types-
|
|
1
|
+
import { C as ClientOptions, W as Workflow, H as HealthCheck, D as DiscoverOutput, h as Event, m as ExecuteOutput, d as CodeResult, i as EventTriggerParams, l as Execute, s as WorkflowOptions } from './health-check.types-C4vZDz5x.js';
|
|
2
2
|
import { f as Awaitable } from './subscriber.types-CfRj4acH.js';
|
|
3
3
|
import { S as Schema, a as FromSchema, F as FromSchemaUnvalidated } from './base.schema.types-BApIn9jr.js';
|
|
4
4
|
import './step-resolver.js';
|
package/dist/esm/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { C as Client, N as NovuRequestHandler, S as ServeHandlerOptions, w as workflow } from './index-
|
|
2
|
-
export { C as ClientOptions, a as CronExpression, E as ExecuteInput, S as SeverityLevelEnum, W as Workflow } from './health-check.types-
|
|
1
|
+
export { C as Client, N as NovuRequestHandler, S as ServeHandlerOptions, w as workflow } from './index-D4Rt1gOC.js';
|
|
2
|
+
export { C as ClientOptions, a as CronExpression, E as ExecuteInput, S as SeverityLevelEnum, W as Workflow } from './health-check.types-C4vZDz5x.js';
|
|
3
3
|
export { AnyStepResolver, ChatStepResolver, EmailStepResolver, InAppStepResolver, PushStepResolver, SmsStepResolver, StepResolverContext, step } from './step-resolver.js';
|
|
4
4
|
export { C as ContextResolved, S as Subscriber, p as providerSchemas } from './subscriber.types-CfRj4acH.js';
|
|
5
5
|
import './base.schema.types-BApIn9jr.js';
|
package/dist/esm/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b,c,d as f}from"./chunk-
|
|
1
|
+
import{b,c,d as f}from"./chunk-WSQ6EEHO.js";import{a as g}from"./chunk-MQSAHSED.js";import"./chunk-JKG63DBC.js";import{S as e}from"./chunk-APAOD3BG.js";import{a as d}from"./chunk-RCWIURDJ.js";import{f as a}from"./chunk-LPE4ME2M.js";import"./chunk-PLPQUHX6.js";export{b as Client,a as CronExpression,c as NovuRequestHandler,e as SeverityLevelEnum,d as providerSchemas,g as step,f as workflow};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { P as PostActionEnum } from '../health-check.types-
|
|
2
|
-
export { b as CancelEventTriggerResponse, c as ChannelPreference, C as ClientOptions, d as CodeResult, a as CronExpression, D as DiscoverOutput, e as DiscoverProviderOutput, f as DiscoverStepOutput, g as DiscoverWorkflowOutput, h as Event, i as EventTriggerParams, j as EventTriggerResponse, k as EventTriggerResult, l as Execute, E as ExecuteInput, m as ExecuteOutput, n as ExecuteOutputMetadata, o as ExecuteOutputOptions, G as GetActionEnum, H as HealthCheck, S as SeverityLevelEnum, p as State, q as StepType, W as Workflow, r as WorkflowChannelEnum, s as WorkflowOptions, t as WorkflowPreference, u as WorkflowPreferences } from '../health-check.types-
|
|
1
|
+
import { P as PostActionEnum } from '../health-check.types-C4vZDz5x.js';
|
|
2
|
+
export { b as CancelEventTriggerResponse, c as ChannelPreference, C as ClientOptions, d as CodeResult, a as CronExpression, D as DiscoverOutput, e as DiscoverProviderOutput, f as DiscoverStepOutput, g as DiscoverWorkflowOutput, h as Event, i as EventTriggerParams, j as EventTriggerResponse, k as EventTriggerResult, l as Execute, E as ExecuteInput, m as ExecuteOutput, n as ExecuteOutputMetadata, o as ExecuteOutputOptions, G as GetActionEnum, H as HealthCheck, S as SeverityLevelEnum, p as State, q as StepType, W as Workflow, r as WorkflowChannelEnum, s as WorkflowOptions, t as WorkflowPreference, u as WorkflowPreferences } from '../health-check.types-C4vZDz5x.js';
|
|
3
3
|
export { h as ActionStep, A as ActionStepEnum, f as Awaitable, i as ChannelStep, e as ChannelStepEnum, j as ChatOutput, k as ChatOutputUnvalidated, l as ChatResult, b as ConditionalPartial, a as ContextPayload, C as ContextResolved, m as ContextValue, n as CustomStep, D as DeepPartial, o as DeepRequired, q as DelayDynamicOutput, r as DelayDynamicOutputUnvalidated, s as DelayOutput, t as DelayOutputUnvalidated, u as DelayRegularOutput, v as DelayRegularOutputUnvalidated, w as DelayResult, x as DelayTimedOutput, y as DelayTimedOutputUnvalidated, z as DigestOutput, B as DigestOutputUnvalidated, F as DigestRegularOutput, G as DigestRegularOutputUnvalidated, H as DigestResult, I as DigestTimedOutput, J as DigestTimedOutputUnvalidated, E as Either, K as EmailOutput, L as EmailOutputUnvalidated, M as EmailResult, N as InAppOutput, O as InAppOutputUnvalidated, Q as InAppResult, R as Indexable, T as JobStatusEnum, U as PickOptional, V as PickOptionalKeys, X as PickRequired, P as PickRequiredKeys, d as Prettify, Y as PushOutput, Z as PushOutputUnvalidated, _ as PushResult, $ as Skip, a0 as SmsOutput, a1 as SmsOutputUnvalidated, a2 as SmsResult, c as Step, a3 as StepContext, g as StepOptions, a4 as StepOutput, S as Subscriber, a5 as ThrottleOutput, a6 as ThrottleOutputUnvalidated, a7 as ThrottleResult, a8 as actionStepSchemas, a9 as channelStepSchemas } from '../subscriber.types-CfRj4acH.js';
|
|
4
4
|
import { Filter, LiquidOptions, Liquid } from 'liquidjs';
|
|
5
5
|
export { a as FromSchema, F as FromSchemaUnvalidated, J as JsonSchema, S as Schema, Z as ZodSchema, b as ZodSchemaMinimal } from '../base.schema.types-BApIn9jr.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { S as ServeHandlerOptions } from '../index-
|
|
2
|
-
export { C as Client, N as NovuRequestHandler, w as workflow } from '../index-
|
|
3
|
-
export { C as ClientOptions, a as CronExpression, E as ExecuteInput, S as SeverityLevelEnum, W as Workflow } from '../health-check.types-
|
|
1
|
+
import { S as ServeHandlerOptions } from '../index-D4Rt1gOC.js';
|
|
2
|
+
export { C as Client, N as NovuRequestHandler, w as workflow } from '../index-D4Rt1gOC.js';
|
|
3
|
+
export { C as ClientOptions, a as CronExpression, E as ExecuteInput, S as SeverityLevelEnum, W as Workflow } from '../health-check.types-C4vZDz5x.js';
|
|
4
4
|
export { C as ContextResolved, S as Subscriber, p as providerSchemas } from '../subscriber.types-CfRj4acH.js';
|
|
5
5
|
import { S as SupportedFrameworkName } from '../server.types-BRWsA1CA.js';
|
|
6
6
|
export { AnyStepResolver, ChatStepResolver, EmailStepResolver, InAppStepResolver, PushStepResolver, SmsStepResolver, StepResolverContext, step } from '../step-resolver.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as h,c as a,d as f}from"../chunk-
|
|
1
|
+
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};
|
package/dist/esm/servers/h3.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as h3 from 'h3';
|
|
2
2
|
import { H3Event } from 'h3';
|
|
3
|
-
import { S as ServeHandlerOptions } from '../index-
|
|
4
|
-
export { C as Client, N as NovuRequestHandler, w as workflow } from '../index-
|
|
5
|
-
export { C as ClientOptions, a as CronExpression, E as ExecuteInput, S as SeverityLevelEnum, W as Workflow } from '../health-check.types-
|
|
3
|
+
import { S as ServeHandlerOptions } from '../index-D4Rt1gOC.js';
|
|
4
|
+
export { C as Client, N as NovuRequestHandler, w as workflow } from '../index-D4Rt1gOC.js';
|
|
5
|
+
export { C as ClientOptions, a as CronExpression, E as ExecuteInput, S as SeverityLevelEnum, W as Workflow } from '../health-check.types-C4vZDz5x.js';
|
|
6
6
|
export { C as ContextResolved, S as Subscriber, p as providerSchemas } from '../subscriber.types-CfRj4acH.js';
|
|
7
7
|
import { S as SupportedFrameworkName } from '../server.types-BRWsA1CA.js';
|
|
8
8
|
export { AnyStepResolver, ChatStepResolver, EmailStepResolver, InAppStepResolver, PushStepResolver, SmsStepResolver, StepResolverContext, step } from '../step-resolver.js';
|
package/dist/esm/servers/h3.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as y,c as t,d as i}from"../chunk-
|
|
1
|
+
import{b as y,c as t,d as i}from"../chunk-WSQ6EEHO.js";import{a as f}from"../chunk-MQSAHSED.js";import"../chunk-JKG63DBC.js";import{S}from"../chunk-APAOD3BG.js";import{a as H}from"../chunk-RCWIURDJ.js";import{f as l}from"../chunk-LPE4ME2M.js";import"../chunk-PLPQUHX6.js";import{getHeader as o,getQuery as a,readBody as p,send as n,setHeaders as m}from"h3";var h="h3",w=d=>new t({frameworkName:h,...d,handler:r=>({body:()=>p(r),headers:e=>o(r,e),method:()=>r.method,url:()=>new URL(String(r.path),`${process.env.NODE_ENV==="development"?"http":"https"}://${String(o(r,"host"))}`),queryString:e=>String(a(r)[e]),transformResponse:e=>{let{res:s}=r.node;return s.statusCode=e.status,m(r,e.headers),n(r,e.body)}})}).createHandler();export{y as Client,l as CronExpression,t as NovuRequestHandler,S as SeverityLevelEnum,h as frameworkName,H as providerSchemas,w as serve,f as step,i as workflow};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as aws_lambda from 'aws-lambda';
|
|
2
2
|
import { APIGatewayProxyEventV2, APIGatewayProxyResult } from 'aws-lambda';
|
|
3
|
-
import { S as ServeHandlerOptions } from '../index-
|
|
4
|
-
export { C as Client, N as NovuRequestHandler, w as workflow } from '../index-
|
|
5
|
-
export { C as ClientOptions, a as CronExpression, E as ExecuteInput, S as SeverityLevelEnum, W as Workflow } from '../health-check.types-
|
|
3
|
+
import { S as ServeHandlerOptions } from '../index-D4Rt1gOC.js';
|
|
4
|
+
export { C as Client, N as NovuRequestHandler, w as workflow } from '../index-D4Rt1gOC.js';
|
|
5
|
+
export { C as ClientOptions, a as CronExpression, E as ExecuteInput, S as SeverityLevelEnum, W as Workflow } from '../health-check.types-C4vZDz5x.js';
|
|
6
6
|
import { E as Either } from '../subscriber.types-CfRj4acH.js';
|
|
7
7
|
export { C as ContextResolved, S as Subscriber, p as providerSchemas } from '../subscriber.types-CfRj4acH.js';
|
|
8
8
|
import { S as SupportedFrameworkName } from '../server.types-BRWsA1CA.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as u,c as n,d as i}from"../chunk-
|
|
1
|
+
import{b as u,c as n,d as i}from"../chunk-WSQ6EEHO.js";import{a as w}from"../chunk-MQSAHSED.js";import"../chunk-JKG63DBC.js";import{S as h}from"../chunk-APAOD3BG.js";import{a as P}from"../chunk-RCWIURDJ.js";import{f as m}from"../chunk-LPE4ME2M.js";import"../chunk-PLPQUHX6.js";var p="lambda",f=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,f as serve,w as step,i as workflow};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { I as INovuRequestHandlerOptions, N as NovuRequestHandler, S as ServeHandlerOptions, C as Client } from '../index-
|
|
2
|
-
export { w as workflow } from '../index-
|
|
3
|
-
import { W as Workflow } from '../health-check.types-
|
|
4
|
-
export { C as ClientOptions, a as CronExpression, E as ExecuteInput, S as SeverityLevelEnum } from '../health-check.types-
|
|
1
|
+
import { I as INovuRequestHandlerOptions, N as NovuRequestHandler, S as ServeHandlerOptions, C as Client } from '../index-D4Rt1gOC.js';
|
|
2
|
+
export { w as workflow } from '../index-D4Rt1gOC.js';
|
|
3
|
+
import { W as Workflow } from '../health-check.types-C4vZDz5x.js';
|
|
4
|
+
export { C as ClientOptions, a as CronExpression, E as ExecuteInput, S as SeverityLevelEnum } from '../health-check.types-C4vZDz5x.js';
|
|
5
5
|
export { AnyStepResolver, ChatStepResolver, EmailStepResolver, InAppStepResolver, PushStepResolver, SmsStepResolver, StepResolverContext, step } from '../step-resolver.js';
|
|
6
6
|
import { E as Either } from '../subscriber.types-CfRj4acH.js';
|
|
7
7
|
export { C as ContextResolved, S as Subscriber, p as providerSchemas } from '../subscriber.types-CfRj4acH.js';
|
package/dist/esm/servers/nest.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as g,c as y,d as j}from"../chunk-
|
|
1
|
+
import{b as g,c as y,d as j}from"../chunk-WSQ6EEHO.js";import{a as C}from"../chunk-MQSAHSED.js";import"../chunk-JKG63DBC.js";import{S as U}from"../chunk-APAOD3BG.js";import{a as G}from"../chunk-RCWIURDJ.js";import{f as V}from"../chunk-LPE4ME2M.js";import{a,b as n}from"../chunk-PLPQUHX6.js";import{Inject as R,Injectable as E}from"@nestjs/common";import{ConfigurableModuleBuilder as x}from"@nestjs/common";var{ConfigurableModuleClass:d,MODULE_OPTIONS_TOKEN:m,OPTIONS_TYPE:F,ASYNC_OPTIONS_TYPE:k}=new x().setClassMethodName("register").setFactoryMethodName("createNovuModuleOptions").setExtras(l=>({...l,isGlobal:!0})).build();var P="REGISTER_API_PATH";import{Injectable as I}from"@nestjs/common";var i=class{handler(e,r){return{body:()=>e.body,headers:t=>{let p=e.headers[t.toLowerCase()];return Array.isArray(p)?p[0]:p},method:()=>e.method||"GET",queryString:t=>{let p=e.query[t];return Array.isArray(p)?p[0]:p},url:()=>{let t=e.headers.host||"",p=t!=null&&t.includes("://")?"":`${e.protocol||"https"}://`;return new URL(e.originalUrl||e.url||"",`${p}${t||""}`)},transformResponse:({body:t,headers:p,status:T})=>(Object.entries(p).forEach(([N,S])=>{r.setHeader(N,S)}),r.status(T).send(t))}}};i=a([I()],i);var _="nest",u=class{constructor(e,r){this.options=e;this.novuHandler=r;this.novuRequestHandler=new y({frameworkName:_,...this.options,handler:this.novuHandler.handler})}async handleRequest(e,r){await this.novuRequestHandler.createHandler()(e,r)}};u=a([E(),n(0,R(m)),n(1,R(i))],u);import{Controller as A,Get as H,Inject as q,Options as b,Post as w,Req as f,Res as O}from"@nestjs/common";var s=class{constructor(e){this.novuService=e}async handleGet(e,r){await this.novuService.handleRequest(e,r)}async handlePost(e,r){await this.novuService.handleRequest(e,r)}async handleOptions(e,r){await this.novuService.handleRequest(e,r)}};a([H(),n(0,f()),n(1,O())],s.prototype,"handleGet",1),a([w(),n(0,f()),n(1,O())],s.prototype,"handlePost",1),a([b(),n(0,f()),n(1,O())],s.prototype,"handleOptions",1),s=a([A(),n(0,q(u))],s);import{Module as Y}from"@nestjs/common";import{PATH_METADATA as M}from"@nestjs/common/constants";var h={provide:P,useFactory:l=>{if(!l.apiPath)throw new Error("`apiPath` must be provided to set the controller path");Reflect.defineMetadata(M,l.apiPath,s)},inject:[m]};function v(l,e=[]){return e.reduce((r,o)=>o(r),l)}var c=class extends d{static register(e,r){var t;let o=d.register(e);return o.controllers=[v(s,e.controllerDecorators||[])],(t=o.providers)==null||t.push(h,u,i,...r||[]),o.exports=[u,i],o}static registerAsync(e,r){var t;let o=d.registerAsync(e);return o.controllers=[s],(t=o.providers)==null||t.push(h,u,i,...r||[]),o.exports=[u,i],o}};c=a([Y({})],c);export{g as Client,V as CronExpression,m as NOVU_OPTIONS,u as NovuClient,s as NovuController,i as NovuHandler,c as NovuModule,y as NovuRequestHandler,P as REGISTER_API_PATH,U as SeverityLevelEnum,_ as frameworkName,G as providerSchemas,h as registerApiPath,C as step,j as workflow};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { NextRequest } from 'next/server';
|
|
2
|
-
import { S as ServeHandlerOptions } from '../index-
|
|
3
|
-
export { C as Client, N as NovuRequestHandler, w as workflow } from '../index-
|
|
4
|
-
export { C as ClientOptions, a as CronExpression, E as ExecuteInput, S as SeverityLevelEnum, W as Workflow } from '../health-check.types-
|
|
2
|
+
import { S as ServeHandlerOptions } from '../index-D4Rt1gOC.js';
|
|
3
|
+
export { C as Client, N as NovuRequestHandler, w as workflow } from '../index-D4Rt1gOC.js';
|
|
4
|
+
export { C as ClientOptions, a as CronExpression, E as ExecuteInput, S as SeverityLevelEnum, W as Workflow } from '../health-check.types-C4vZDz5x.js';
|
|
5
5
|
export { C as ContextResolved, S as Subscriber, p as providerSchemas } from '../subscriber.types-CfRj4acH.js';
|
|
6
6
|
import { S as SupportedFrameworkName } from '../server.types-BRWsA1CA.js';
|
|
7
7
|
export { AnyStepResolver, ChatStepResolver, EmailStepResolver, InAppStepResolver, PushStepResolver, SmsStepResolver, StepResolverContext, step } from '../step-resolver.js';
|
package/dist/esm/servers/next.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as l,b as x,c,d as T}from"../chunk-
|
|
1
|
+
import{a as l,b as x,c,d as T}from"../chunk-WSQ6EEHO.js";import{a as w}from"../chunk-MQSAHSED.js";import"../chunk-JKG63DBC.js";import{S}from"../chunk-APAOD3BG.js";import{a as q}from"../chunk-RCWIURDJ.js";import{f as O}from"../chunk-LPE4ME2M.js";import"../chunk-PLPQUHX6.js";var m="next",N=o=>typeof o=="object"&&o!==null&&typeof o.setHeader=="function"&&typeof o.status=="function"&&typeof o.send=="function",E=o=>{let p=new c({frameworkName:m,...o,handler:(h,R,d)=>{let n=R,i=e=>{let t=typeof n.headers.get=="function"?n.headers.get(e):n.headers[e];return Array.isArray(t)?t[0]:t};return{body:()=>typeof n.json=="function"?n.json():n.body,headers:i,method:()=>h||n.method||"",queryString:(e,t)=>{var a;let r=((a=n.query)==null?void 0:a[e])||t.searchParams.get(e);return Array.isArray(r)?r[0]:r},url:()=>{let e;try{e=new URL(n.url)}catch{}if(e){let s=i("host");if(s){let u=new URL(s.includes("://")?s:`${e.protocol}//${s}`);e.protocol=u.protocol,e.host=u.host,e.port=u.port,e.username=u.username,e.password=u.password}return e}let t="https",r=i("host")||"";try{(process.env.NODE_ENV==="development"||process.env.NODE_ENV==="dev")&&(t="http")}catch{}return new URL(n.url,`${t}://${r}`)},transformResponse:({body:e,headers:t,status:r})=>{if(N(d)){Object.entries(t).forEach(([s,u])=>{d.setHeader(s,u)}),d.status(r).send(e);return}let a=l();return new a(e,{status:r,headers:t})}}}}).createHandler(),f=p.bind(null,void 0);return Object.defineProperties(f,{GET:{value:p.bind(null,"GET")},POST:{value:p.bind(null,"POST")},OPTIONS:{value:p.bind(null,"OPTIONS")}})};export{x as Client,O as CronExpression,c as NovuRequestHandler,S as SeverityLevelEnum,m as frameworkName,q as providerSchemas,E as serve,w as step,T as workflow};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as h3 from 'h3';
|
|
2
2
|
import { H3Event } from 'h3';
|
|
3
|
-
import { S as ServeHandlerOptions } from '../index-
|
|
4
|
-
export { C as Client, N as NovuRequestHandler, w as workflow } from '../index-
|
|
5
|
-
export { C as ClientOptions, a as CronExpression, E as ExecuteInput, S as SeverityLevelEnum, W as Workflow } from '../health-check.types-
|
|
3
|
+
import { S as ServeHandlerOptions } from '../index-D4Rt1gOC.js';
|
|
4
|
+
export { C as Client, N as NovuRequestHandler, w as workflow } from '../index-D4Rt1gOC.js';
|
|
5
|
+
export { C as ClientOptions, a as CronExpression, E as ExecuteInput, S as SeverityLevelEnum, W as Workflow } from '../health-check.types-C4vZDz5x.js';
|
|
6
6
|
export { C as ContextResolved, S as Subscriber, p as providerSchemas } from '../subscriber.types-CfRj4acH.js';
|
|
7
7
|
import { S as SupportedFrameworkName } from '../server.types-BRWsA1CA.js';
|
|
8
8
|
export { AnyStepResolver, ChatStepResolver, EmailStepResolver, InAppStepResolver, PushStepResolver, SmsStepResolver, StepResolverContext, step } from '../step-resolver.js';
|
package/dist/esm/servers/nuxt.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as H,c as t,d as y}from"../chunk-
|
|
1
|
+
import{b as H,c as t,d as y}from"../chunk-WSQ6EEHO.js";import{a as f}from"../chunk-MQSAHSED.js";import"../chunk-JKG63DBC.js";import{S as i}from"../chunk-APAOD3BG.js";import{a as S}from"../chunk-RCWIURDJ.js";import{f as l}from"../chunk-LPE4ME2M.js";import"../chunk-PLPQUHX6.js";import{getHeader as o,getQuery as a,readBody as n,send as p,setHeaders as m}from"h3";var u="nuxt",c=d=>new t({frameworkName:u,...d,handler:r=>({queryString:e=>String(a(r)[e]),body:()=>n(r),headers:e=>o(r,e),url:()=>new URL(String(r.path),`${process.env.NODE_ENV==="development"?"http":"https"}://${String(o(r,"host"))}`),method:()=>r.method,transformResponse:e=>{let{res:s}=r.node;return s.statusCode=e.status,m(r,e.headers),p(r,e.body)}})}).createHandler();export{H as Client,l as CronExpression,t as NovuRequestHandler,i as SeverityLevelEnum,u as frameworkName,S as providerSchemas,c as serve,f as step,y as workflow};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { S as ServeHandlerOptions } from '../index-
|
|
2
|
-
export { C as Client, N as NovuRequestHandler, w as workflow } from '../index-
|
|
3
|
-
export { C as ClientOptions, a as CronExpression, E as ExecuteInput, S as SeverityLevelEnum, W as Workflow } from '../health-check.types-
|
|
1
|
+
import { S as ServeHandlerOptions } from '../index-D4Rt1gOC.js';
|
|
2
|
+
export { C as Client, N as NovuRequestHandler, w as workflow } from '../index-D4Rt1gOC.js';
|
|
3
|
+
export { C as ClientOptions, a as CronExpression, E as ExecuteInput, S as SeverityLevelEnum, W as Workflow } from '../health-check.types-C4vZDz5x.js';
|
|
4
4
|
export { C as ContextResolved, S as Subscriber, p as providerSchemas } from '../subscriber.types-CfRj4acH.js';
|
|
5
5
|
import { S as SupportedFrameworkName } from '../server.types-BRWsA1CA.js';
|
|
6
6
|
export { AnyStepResolver, ChatStepResolver, EmailStepResolver, InAppStepResolver, PushStepResolver, SmsStepResolver, StepResolverContext, step } from '../step-resolver.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as t,b as h,c as o,d as c}from"../chunk-
|
|
1
|
+
import{a as t,b as h,c as o,d as c}from"../chunk-WSQ6EEHO.js";import{a as i}from"../chunk-MQSAHSED.js";import"../chunk-JKG63DBC.js";import{S as R}from"../chunk-APAOD3BG.js";import{a as l}from"../chunk-RCWIURDJ.js";import{f as u}from"../chunk-LPE4ME2M.js";import"../chunk-PLPQUHX6.js";var m="remix",x=s=>new o({frameworkName:m,...s,handler:({request:e})=>({body:()=>e.json(),headers:r=>e.headers.get(r),method:()=>e.method,url:()=>new URL(e.url,`https://${e.headers.get("host")||""}`),transformResponse:({body:r,status:n,headers:p})=>{let a=t();return new a(r,{status:n,headers:p})}})}).createHandler();export{h as Client,u as CronExpression,o as NovuRequestHandler,R as SeverityLevelEnum,m as frameworkName,l as providerSchemas,x as serve,i as step,c as workflow};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { RequestEvent } from '@sveltejs/kit';
|
|
2
|
-
import { S as ServeHandlerOptions } from '../index-
|
|
3
|
-
export { C as Client, N as NovuRequestHandler, w as workflow } from '../index-
|
|
4
|
-
export { C as ClientOptions, a as CronExpression, E as ExecuteInput, S as SeverityLevelEnum, W as Workflow } from '../health-check.types-
|
|
2
|
+
import { S as ServeHandlerOptions } from '../index-D4Rt1gOC.js';
|
|
3
|
+
export { C as Client, N as NovuRequestHandler, w as workflow } from '../index-D4Rt1gOC.js';
|
|
4
|
+
export { C as ClientOptions, a as CronExpression, E as ExecuteInput, S as SeverityLevelEnum, W as Workflow } from '../health-check.types-C4vZDz5x.js';
|
|
5
5
|
export { C as ContextResolved, S as Subscriber, p as providerSchemas } from '../subscriber.types-CfRj4acH.js';
|
|
6
6
|
import { S as SupportedFrameworkName } from '../server.types-BRWsA1CA.js';
|
|
7
7
|
export { AnyStepResolver, ChatStepResolver, EmailStepResolver, InAppStepResolver, PushStepResolver, SmsStepResolver, StepResolverContext, step } from '../step-resolver.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as r,b as E,c as s,d as T}from"../chunk-
|
|
1
|
+
import{a as r,b as E,c as s,d as T}from"../chunk-WSQ6EEHO.js";import{a as S}from"../chunk-MQSAHSED.js";import"../chunk-JKG63DBC.js";import{S as R}from"../chunk-APAOD3BG.js";import{a as P}from"../chunk-RCWIURDJ.js";import{f as v}from"../chunk-LPE4ME2M.js";import"../chunk-PLPQUHX6.js";var m="sveltekit",h=o=>{let t=new s({frameworkName:m,...o,handler:(u,e)=>({method:()=>u||e.request.method||"",body:()=>e.request.json(),headers:n=>e.request.headers.get(n),url:()=>{let n=process.env.NODE_ENV==="development"||process.env.NODE_ENV==="dev"?"http":"https";return new URL(e.request.url,`${n}://${e.request.headers.get("host")||""}`)},transformResponse:({body:n,headers:d,status:a})=>{let l=r();return new l(n,{status:a,headers:d})}})}).createHandler(),p=t.bind(null,void 0);return Object.defineProperties(p,{GET:{value:t.bind(null,"GET")},POST:{value:t.bind(null,"POST")},OPTIONS:{value:t.bind(null,"OPTIONS")}})};export{E as Client,v as CronExpression,s as NovuRequestHandler,R as SeverityLevelEnum,m as frameworkName,P as providerSchemas,h as serve,S as step,T as workflow};
|
package/dist/esm/validators.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a,b}from"./chunk-
|
|
1
|
+
import{a,b}from"./chunk-JKG63DBC.js";import"./chunk-LPE4ME2M.js";import"./chunk-PLPQUHX6.js";export{b as transformSchema,a as validateData};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@novu/framework",
|
|
3
|
-
"version": "2.10.0
|
|
3
|
+
"version": "2.10.0",
|
|
4
4
|
"description": "The Code-First Notifications Workflow SDK.",
|
|
5
5
|
"main": "./dist/cjs/index.cjs",
|
|
6
6
|
"types": "./dist/cjs/index.d.cts",
|
|
@@ -29,21 +29,6 @@
|
|
|
29
29
|
"validators",
|
|
30
30
|
"README.md"
|
|
31
31
|
],
|
|
32
|
-
"scripts": {
|
|
33
|
-
"test": "vitest --typecheck",
|
|
34
|
-
"test:watch": "vitest --typecheck --watch",
|
|
35
|
-
"check": "biome check .",
|
|
36
|
-
"check:fix": "biome check --write .",
|
|
37
|
-
"build": "NODE_ENV=production tsup",
|
|
38
|
-
"debug": "NODE_ENV=production tsup --config tsup-debug.config.ts",
|
|
39
|
-
"build:watch": "tsup --watch",
|
|
40
|
-
"postbuild": "pnpm run check:exports && pnpm check:circulars",
|
|
41
|
-
"check:exports": "attw --pack .",
|
|
42
|
-
"check:circulars": "madge --circular --extensions ts ./src",
|
|
43
|
-
"bump:prerelease": "npm version prerelease --preid=alpha & PID=$!; (sleep 1 && kill -9 $PID) & wait $PID",
|
|
44
|
-
"release:alpha": "pnpm bump:prerelease || pnpm build && npm publish",
|
|
45
|
-
"devtool": "tsx ./scripts/devtool.ts"
|
|
46
|
-
},
|
|
47
32
|
"keywords": [
|
|
48
33
|
"novu",
|
|
49
34
|
"code-first",
|
|
@@ -267,5 +252,20 @@
|
|
|
267
252
|
"tags": [
|
|
268
253
|
"type:package"
|
|
269
254
|
]
|
|
255
|
+
},
|
|
256
|
+
"scripts": {
|
|
257
|
+
"test": "vitest --typecheck",
|
|
258
|
+
"test:watch": "vitest --typecheck --watch",
|
|
259
|
+
"check": "biome check .",
|
|
260
|
+
"check:fix": "biome check --write .",
|
|
261
|
+
"build": "NODE_ENV=production tsup",
|
|
262
|
+
"debug": "NODE_ENV=production tsup --config tsup-debug.config.ts",
|
|
263
|
+
"build:watch": "tsup --watch",
|
|
264
|
+
"postbuild": "pnpm run check:exports && pnpm check:circulars",
|
|
265
|
+
"check:exports": "attw --pack .",
|
|
266
|
+
"check:circulars": "madge --circular --extensions ts ./src",
|
|
267
|
+
"bump:prerelease": "npm version prerelease --preid=alpha & PID=$!; (sleep 1 && kill -9 $PID) & wait $PID",
|
|
268
|
+
"release:alpha": "pnpm bump:prerelease || pnpm build && npm publish",
|
|
269
|
+
"devtool": "tsx ./scripts/devtool.ts"
|
|
270
270
|
}
|
|
271
|
-
}
|
|
271
|
+
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{u as h}from"./chunk-LPE4ME2M.js";import f from"ajv";import y from"ajv-formats";var S=t=>typeof structuredClone=="function"?structuredClone(t):JSON.parse(JSON.stringify(t));var n=class extends h{constructor(a,o){let r=o.length===1?"it":"them";super(`Tried to use a ${a} in @novu/framework without ${o.join(", ")} installed. Please install ${r} by running \`npm install ${o.join(" ")}\`.`);this.statusCode=500;this.code="MissingDependencyError"}};var m=async(t,e)=>{let a=new Set;if((await Promise.allSettled(t.map(r=>r.import))).forEach((r,p)=>{let s=t[p];r.status==="fulfilled"&&s.exports.every(u=>r.value[u]!==void 0)||a.add(s.name)}),a.size>0)throw new n(e,Array.from(a))};var i=class{constructor(){this.requiredImports=[];this.ajv=new f({useDefaults:!0,removeAdditional:"failing"}),y(this.ajv),this.compiledSchemas=new Map}async canHandle(e){let a=e.type==="object"||!!e.anyOf||!!e.allOf||!!e.oneOf;return a&&await m(this.requiredImports,"JSON schema"),a}async validate(e,a){let o=this.compiledSchemas.get(a);o||(o=this.ajv.compile(a),this.compiledSchemas.set(a,o));let r=S(e);return o(r)?{success:!0,data:r}:{success:!1,errors:o.errors.map(s=>({path:s.instancePath,message:s.message}))}}async transformToJsonSchema(e){return e}};var c=class{constructor(){this.requiredImports=[{name:"zod",import:import("zod"),exports:["ZodType"]},{name:"zod-to-json-schema",import:import("zod-to-json-schema"),exports:["zodToJsonSchema"]}]}async canHandle(e){let a=e.safeParseAsync!==void 0;return a&&await m(this.requiredImports,"Zod schema"),a}async validate(e,a){let o=await a.safeParseAsync(e);return o.success?{success:!0,data:o.data}:{success:!1,errors:o.error.errors.map(r=>({path:`/${r.path.join("/")}`,message:r.message}))}}async transformToJsonSchema(e){let{zodToJsonSchema:a}=await import("zod-to-json-schema");return a(e)}};var d=new c,l=new i,v=async(t,e)=>{if(await d.canHandle(t))return d.validate(e,t);if(await l.canHandle(t))return l.validate(e,t);throw new Error("Invalid schema")},T=async t=>{if(await d.canHandle(t))return d.transformToJsonSchema(t);if(await l.canHandle(t))return l.transformToJsonSchema(t);throw new Error("Invalid schema")};export{v as a,T as b};
|