@novu/framework 2.9.0 → 2.10.0-alpha.1
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/base.schema.types-BApIn9jr.d.cts +135 -0
- package/dist/cjs/{health-check.types-D_KcRiM_.d.cts → health-check.types-CBl2aQ8k.d.cts} +21 -131
- package/dist/cjs/{index-S0QKfWxm.d.cts → index-D3UJoqjc.d.cts} +5 -1
- package/dist/cjs/index.cjs +37 -38
- package/dist/cjs/index.d.cts +4 -2
- package/dist/cjs/internal/index.cjs +1 -2
- package/dist/cjs/internal/index.d.cts +13 -67
- package/dist/cjs/servers/express.cjs +65 -66
- package/dist/cjs/servers/express.d.cts +5 -3
- package/dist/cjs/servers/h3.cjs +37 -38
- package/dist/cjs/servers/h3.d.cts +5 -3
- package/dist/cjs/servers/lambda.cjs +51 -52
- package/dist/cjs/servers/lambda.d.cts +6 -4
- package/dist/cjs/servers/nest.cjs +57 -58
- package/dist/cjs/servers/nest.d.cts +6 -4
- package/dist/cjs/servers/next.cjs +72 -73
- package/dist/cjs/servers/next.d.cts +5 -3
- package/dist/cjs/servers/nuxt.cjs +37 -38
- package/dist/cjs/servers/nuxt.d.cts +5 -3
- package/dist/cjs/servers/remix.cjs +37 -38
- package/dist/cjs/servers/remix.d.cts +5 -3
- package/dist/cjs/servers/sveltekit.cjs +35 -36
- package/dist/cjs/servers/sveltekit.d.cts +5 -3
- package/dist/cjs/step-resolver.cjs +1 -0
- package/dist/cjs/step-resolver.d.cts +32 -0
- package/dist/cjs/validator.types-BeoiKdnR.d.cts +66 -0
- package/dist/cjs/validators.cjs +1 -0
- package/dist/cjs/validators.d.cts +23 -0
- package/dist/esm/base.schema.types-BApIn9jr.d.ts +135 -0
- package/dist/esm/chunk-7YRWUU4W.js +95 -0
- package/dist/esm/chunk-AZJKOVFF.js +1 -0
- package/dist/esm/chunk-C734BFYR.js +1 -0
- package/dist/esm/{chunk-YLCZR2QR.js → chunk-HQVOLRIB.js} +4 -5
- package/dist/esm/chunk-JFMDTNSL.js +1 -0
- package/dist/esm/chunk-PLPQUHX6.js +1 -0
- package/dist/esm/{health-check.types-D_KcRiM_.d.ts → health-check.types-23Z3Ne4i.d.ts} +21 -131
- package/dist/esm/{index-CmEcpAEO.d.ts → index-B6Kq7kjS.d.ts} +5 -1
- package/dist/esm/index.d.ts +4 -2
- package/dist/esm/index.js +1 -1
- package/dist/esm/internal/index.d.ts +13 -67
- package/dist/esm/internal/index.js +1 -1
- package/dist/esm/servers/express.d.ts +5 -3
- package/dist/esm/servers/express.js +1 -1
- package/dist/esm/servers/h3.d.ts +5 -3
- package/dist/esm/servers/h3.js +1 -1
- package/dist/esm/servers/lambda.d.ts +6 -4
- package/dist/esm/servers/lambda.js +1 -1
- package/dist/esm/servers/nest.d.ts +6 -4
- package/dist/esm/servers/nest.js +1 -1
- package/dist/esm/servers/next.d.ts +5 -3
- package/dist/esm/servers/next.js +1 -1
- package/dist/esm/servers/nuxt.d.ts +5 -3
- package/dist/esm/servers/nuxt.js +1 -1
- package/dist/esm/servers/remix.d.ts +5 -3
- package/dist/esm/servers/remix.js +1 -1
- package/dist/esm/servers/sveltekit.d.ts +5 -3
- package/dist/esm/servers/sveltekit.js +1 -1
- package/dist/esm/step-resolver.d.ts +32 -0
- package/dist/esm/step-resolver.js +1 -0
- package/dist/esm/validator.types-BIQli_m1.d.ts +66 -0
- package/dist/esm/validators.d.ts +23 -0
- package/dist/esm/validators.js +1 -0
- package/package.json +24 -2
- package/step-resolver/package.json +4 -0
- package/validators/package.json +4 -0
- package/dist/esm/chunk-ZF4VXELU.js +0 -95
|
@@ -1,10 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export {
|
|
1
|
+
import { P as PostActionEnum } from '../health-check.types-23Z3Ne4i.js';
|
|
2
|
+
export { F as ActionStep, A as ActionStepEnum, am as Awaitable, r as CancelEventTriggerResponse, az as ChannelPreference, K as ChannelStep, d as ChannelStepEnum, X as ChatOutput, Y as ChatOutputUnvalidated, Z as ChatResult, a as ClientOptions, f as CodeResult, ao as ConditionalPartial, h as ContextPayload, i as ContextResolved, g as ContextValue, C as CronExpression, I as CustomStep, au as DeepPartial, av as DeepRequired, a5 as DelayDynamicOutput, a6 as DelayDynamicOutputUnvalidated, a7 as DelayOutput, a8 as DelayOutputUnvalidated, a1 as DelayRegularOutput, a2 as DelayRegularOutputUnvalidated, a9 as DelayResult, a3 as DelayTimedOutput, a4 as DelayTimedOutputUnvalidated, ae as DigestOutput, af as DigestOutputUnvalidated, aa as DigestRegularOutput, ab as DigestRegularOutputUnvalidated, ag as DigestResult, ac as DigestTimedOutput, ad as DigestTimedOutputUnvalidated, m as DiscoverOutput, D as DiscoverProviderOutput, k as DiscoverStepOutput, l as DiscoverWorkflowOutput, E as Either, L as EmailOutput, M as EmailOutputUnvalidated, N as EmailResult, s as Event, o as EventTriggerParams, q as EventTriggerResponse, n as EventTriggerResult, ax as Execute, aw as ExecuteInput, w as ExecuteOutput, u as ExecuteOutputMetadata, v as ExecuteOutputOptions, G as GetActionEnum, H as HealthCheck, _ as InAppOutput, $ as InAppOutputUnvalidated, a0 as InAppResult, ap as Indexable, J as JobStatusEnum, aq as PickOptional, at as PickOptionalKeys, ar as PickRequired, as as PickRequiredKeys, an as Prettify, T as PushOutput, U as PushOutputUnvalidated, V as PushResult, S as SeverityLevelEnum, x as Skip, O as SmsOutput, Q as SmsOutputUnvalidated, R as SmsResult, t as State, ak as Step, z as StepContext, y as StepOptions, B as StepOutput, j as StepType, al as Subscriber, ah as ThrottleOutput, ai as ThrottleOutputUnvalidated, aj as ThrottleResult, W as Workflow, e as WorkflowChannelEnum, aB as WorkflowOptions, ay as WorkflowPreference, aA as WorkflowPreferences, b as actionStepSchemas, c as channelStepSchemas } from '../health-check.types-23Z3Ne4i.js';
|
|
3
3
|
import { Filter, LiquidOptions, Liquid } from 'liquidjs';
|
|
4
|
+
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';
|
|
4
5
|
export { S as SupportedFrameworkName } from '../server.types-BRWsA1CA.js';
|
|
5
|
-
|
|
6
|
-
import { ParseReturnType } from 'zod';
|
|
6
|
+
export { a as ValidateFunction, V as ValidateResult, b as ValidationError, c as Validator } from '../validator.types-BIQli_m1.js';
|
|
7
7
|
import 'json-schema-to-ts';
|
|
8
|
+
import 'zod';
|
|
9
|
+
import 'ajv';
|
|
8
10
|
|
|
9
11
|
declare enum NovuApiEndpointsEnum {
|
|
10
12
|
SYNC = "/v1/bridge/sync",
|
|
@@ -54,7 +56,8 @@ declare enum HttpHeaderKeysEnum {
|
|
|
54
56
|
ACCESS_CONTROL_ALLOW_ORIGIN = "access-control-allow-origin",
|
|
55
57
|
ACCESS_CONTROL_ALLOW_METHODS = "access-control-allow-methods",
|
|
56
58
|
ACCESS_CONTROL_ALLOW_HEADERS = "access-control-allow-headers",
|
|
57
|
-
ACCESS_CONTROL_MAX_AGE = "access-control-max-age"
|
|
59
|
+
ACCESS_CONTROL_MAX_AGE = "access-control-max-age",
|
|
60
|
+
ACCESS_CONTROL_ALLOW_PRIVATE_NETWORK = "access-control-allow-private-network"
|
|
58
61
|
}
|
|
59
62
|
|
|
60
63
|
declare enum HttpMethodEnum {
|
|
@@ -127,67 +130,6 @@ declare enum ResourceEnum {
|
|
|
127
130
|
STEP = "step"
|
|
128
131
|
}
|
|
129
132
|
|
|
130
|
-
type ImportRequirement = {
|
|
131
|
-
/**
|
|
132
|
-
* The name of the dependency.
|
|
133
|
-
*
|
|
134
|
-
* This is a necessary duplicate as ESM does not provide a consistent API for
|
|
135
|
-
* reading the name of a dependency that can't be resolved.
|
|
136
|
-
*
|
|
137
|
-
* @example
|
|
138
|
-
* ```typescript
|
|
139
|
-
* 'module-name'
|
|
140
|
-
* ```
|
|
141
|
-
*/
|
|
142
|
-
name: string;
|
|
143
|
-
/**
|
|
144
|
-
* The import statement for the required dependency. An explicit `import('module-name')`
|
|
145
|
-
* call with a static module string is necessary to ensure that the bundler will make
|
|
146
|
-
* the dependency available for usage after tree-shaking. Without a static string,
|
|
147
|
-
* tree-shaking may aggressively remove the import, making it unavailable.
|
|
148
|
-
*
|
|
149
|
-
* This syntax is required during synchronous declaration (e.g. on a class property),
|
|
150
|
-
* but should only be awaited when you can handle a runtime import error.
|
|
151
|
-
*
|
|
152
|
-
* @example
|
|
153
|
-
* ```typescript
|
|
154
|
-
* import('module-name')
|
|
155
|
-
* ```
|
|
156
|
-
*/
|
|
157
|
-
import: Promise<{
|
|
158
|
-
default: unknown;
|
|
159
|
-
} & Record<string, unknown>>;
|
|
160
|
-
/**
|
|
161
|
-
* The required exports of the dependency. The availability of these exports are
|
|
162
|
-
* checked by the import validator to verify the dependency is installed.
|
|
163
|
-
*
|
|
164
|
-
* @example
|
|
165
|
-
* ```typescript
|
|
166
|
-
* ['my-export']
|
|
167
|
-
* ```
|
|
168
|
-
*/
|
|
169
|
-
exports: readonly string[];
|
|
170
|
-
};
|
|
171
|
-
|
|
172
|
-
type ValidateFunction<T = unknown> = ValidateFunction$1<T> | ((data: T) => ParseReturnType<T>);
|
|
173
|
-
type ValidationError = {
|
|
174
|
-
path: string;
|
|
175
|
-
message: string;
|
|
176
|
-
};
|
|
177
|
-
type ValidateResult<T> = {
|
|
178
|
-
success: false;
|
|
179
|
-
errors: ValidationError[];
|
|
180
|
-
} | {
|
|
181
|
-
success: true;
|
|
182
|
-
data: T;
|
|
183
|
-
};
|
|
184
|
-
type Validator<T_Schema extends Schema = Schema> = {
|
|
185
|
-
validate: <T_Unvalidated extends Record<string, unknown> = FromSchemaUnvalidated<T_Schema>, T_Validated extends Record<string, unknown> = FromSchema<T_Schema>>(data: T_Unvalidated, schema: T_Schema) => Promise<ValidateResult<T_Validated>>;
|
|
186
|
-
canHandle: (schema: Schema) => Promise<boolean>;
|
|
187
|
-
transformToJsonSchema: (schema: T_Schema) => Promise<JsonSchema>;
|
|
188
|
-
requiredImports: readonly ImportRequirement[];
|
|
189
|
-
};
|
|
190
|
-
|
|
191
133
|
/**
|
|
192
134
|
* Check if the object is a native error.
|
|
193
135
|
*
|
|
@@ -475,7 +417,11 @@ declare const FILTER_VALIDATORS: FilterValidators;
|
|
|
475
417
|
|
|
476
418
|
/**
|
|
477
419
|
* Creates a configured Liquid instance with Novu's default settings.
|
|
420
|
+
*
|
|
421
|
+
* @param options - LiquidJS options. Note: By default, this uses a custom outputEscape function
|
|
422
|
+
* that escapes special JSON characters. If you need different escaping behavior (e.g., for HTML
|
|
423
|
+
* rendering), you can override the outputEscape function in the options.
|
|
478
424
|
*/
|
|
479
425
|
declare function createLiquidEngine(options?: LiquidOptions): Liquid;
|
|
480
426
|
|
|
481
|
-
export { BadRequestError, BridgeError, ConflictError, ErrorCodeEnum, ExecutionEventControlsInvalidError, ExecutionEventPayloadInvalidError, ExecutionProviderOutputInvalidError, ExecutionStateControlsInvalidError, ExecutionStateCorruptError, ExecutionStateOutputInvalidError, ExecutionStateResultInvalidError, FILTER_VALIDATORS, ForbiddenError, FrameworkError,
|
|
427
|
+
export { BadRequestError, BridgeError, ConflictError, ErrorCodeEnum, ExecutionEventControlsInvalidError, ExecutionEventPayloadInvalidError, ExecutionProviderOutputInvalidError, ExecutionStateControlsInvalidError, ExecutionStateCorruptError, ExecutionStateOutputInvalidError, ExecutionStateResultInvalidError, FILTER_VALIDATORS, ForbiddenError, FrameworkError, HttpHeaderKeysEnum, HttpMethodEnum, HttpQueryKeysEnum, HttpStatusEnum, InvalidActionError, type LiquidFilterIssue, MethodNotAllowedError, MissingSecretKeyError, NotFoundError, NovuApiEndpointsEnum, PlatformError, PostActionEnum, ProviderExecutionFailedError, ProviderNotFoundError, ResourceConflictError, ResourceEnum, ResourceExecutionFailed, ResourceNotFoundError, SIGNATURE_TIMESTAMP_TOLERANCE, SIGNATURE_TIMESTAMP_TOLERANCE_MINUTES, ServerError, SignatureExpiredError, SignatureInvalidError, SignatureMismatchError, SignatureNotFoundError, SignatureVersionInvalidError, SigningKeyNotFoundError, StepAlreadyExistsError, StepControlCompilationFailedError, StepExecutionFailedError, StepNotFoundError, UnauthorizedError, WorkflowAlreadyExistsError, WorkflowNotFoundError, WorkflowPayloadInvalidError, createLiquidEngine, digest, isFrameworkError, isNativeError, pluralize, toSentence, toSentenceArgsValidator };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{A as Z,B as $,C as rr,D as er,E as or,F as tr,H as ir,I as mr,J as pr,K as r,L as e,Q as o,R as t,T as ar,U as fr,a as R,b as T,c as k,d as D,e as O,f as _,g as b,h as j,i as v,j as w,k as z,m as B,n as C,o as G,p as H,q as J,r as K,s as M,t as N,u as P,v as Q,w as U,x as W,y as X,z as Y}from"../chunk-HQVOLRIB.js";import{a as i,b as m,c as p,d as a,e as f,f as n,g as s,h as x,i as c,j as l,k as S,l as d,m as u,n as F,o as L,p as g,q as I,r as V,s as h,t as q,u as y,v as A,w as E}from"../chunk-C734BFYR.js";import"../chunk-PLPQUHX6.js";var sr={toSentence:r};export{F as ActionStepEnum,h as BadRequestError,R as BridgeError,u as ChannelStepEnum,A as ConflictError,n as CronExpression,s as ErrorCodeEnum,D as ExecutionEventControlsInvalidError,k as ExecutionEventPayloadInvalidError,v as ExecutionProviderOutputInvalidError,O as ExecutionStateControlsInvalidError,T as ExecutionStateCorruptError,_ as ExecutionStateOutputInvalidError,b as ExecutionStateResultInvalidError,sr as FILTER_VALIDATORS,E as ForbiddenError,I as FrameworkError,m as GetActionEnum,x as HttpHeaderKeysEnum,c as HttpMethodEnum,l as HttpQueryKeysEnum,S as HttpStatusEnum,C as InvalidActionError,ar as JobStatusEnum,B as MethodNotAllowedError,G as MissingSecretKeyError,V as NotFoundError,p as NovuApiEndpointsEnum,H as PlatformError,i as PostActionEnum,P as ProviderExecutionFailedError,N as ProviderNotFoundError,J as ResourceConflictError,d as ResourceEnum,M as ResourceExecutionFailed,K as ResourceNotFoundError,f as SIGNATURE_TIMESTAMP_TOLERANCE,a as SIGNATURE_TIMESTAMP_TOLERANCE_MINUTES,y as ServerError,fr as SeverityLevelEnum,X as SignatureExpiredError,W as SignatureInvalidError,Q as SignatureMismatchError,U as SignatureNotFoundError,Z as SignatureVersionInvalidError,Y as SigningKeyNotFoundError,rr as StepAlreadyExistsError,j as StepControlCompilationFailedError,er as StepExecutionFailedError,$ as StepNotFoundError,q as UnauthorizedError,tr as WorkflowAlreadyExistsError,L as WorkflowChannelEnum,or as WorkflowNotFoundError,w as WorkflowPayloadInvalidError,o as actionStepSchemas,t as channelStepSchemas,e as createLiquidEngine,ir as digest,z as isFrameworkError,g as isNativeError,mr as pluralize,pr as toSentence,r as toSentenceArgsValidator};
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import { S as ServeHandlerOptions } from '../index-
|
|
2
|
-
export { C as Client, N as NovuRequestHandler, w as workflow } from '../index-
|
|
3
|
-
export { C as CronExpression, S as SeverityLevelEnum, W as Workflow, p as providerSchemas } from '../health-check.types-
|
|
1
|
+
import { S as ServeHandlerOptions } from '../index-B6Kq7kjS.js';
|
|
2
|
+
export { C as Client, N as NovuRequestHandler, w as workflow } from '../index-B6Kq7kjS.js';
|
|
3
|
+
export { a as ClientOptions, C as CronExpression, S as SeverityLevelEnum, W as Workflow, p as providerSchemas } from '../health-check.types-23Z3Ne4i.js';
|
|
4
4
|
import { S as SupportedFrameworkName } from '../server.types-BRWsA1CA.js';
|
|
5
|
+
export { EmailStepResolver, step } from '../step-resolver.js';
|
|
6
|
+
import '../base.schema.types-BApIn9jr.js';
|
|
5
7
|
import 'json-schema-to-ts';
|
|
6
8
|
import 'zod';
|
|
7
9
|
|
|
@@ -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-7YRWUU4W.js";import{a as H}from"../chunk-JFMDTNSL.js";import"../chunk-AZJKOVFF.js";import{M as c,U as m}from"../chunk-HQVOLRIB.js";import{f as y}from"../chunk-C734BFYR.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,9 +1,11 @@
|
|
|
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 CronExpression, S as SeverityLevelEnum, W as Workflow, p as providerSchemas } from '../health-check.types-
|
|
3
|
+
import { S as ServeHandlerOptions } from '../index-B6Kq7kjS.js';
|
|
4
|
+
export { C as Client, N as NovuRequestHandler, w as workflow } from '../index-B6Kq7kjS.js';
|
|
5
|
+
export { a as ClientOptions, C as CronExpression, S as SeverityLevelEnum, W as Workflow, p as providerSchemas } from '../health-check.types-23Z3Ne4i.js';
|
|
6
6
|
import { S as SupportedFrameworkName } from '../server.types-BRWsA1CA.js';
|
|
7
|
+
export { EmailStepResolver, step } from '../step-resolver.js';
|
|
8
|
+
import '../base.schema.types-BApIn9jr.js';
|
|
7
9
|
import 'json-schema-to-ts';
|
|
8
10
|
import 'zod';
|
|
9
11
|
|
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-7YRWUU4W.js";import{a as f}from"../chunk-JFMDTNSL.js";import"../chunk-AZJKOVFF.js";import{M as H,U as S}from"../chunk-HQVOLRIB.js";import{f as l}from"../chunk-C734BFYR.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,10 +1,12 @@
|
|
|
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
|
-
import { E as Either } from '../health-check.types-
|
|
6
|
-
export { C as CronExpression, S as SeverityLevelEnum, W as Workflow, p as providerSchemas } from '../health-check.types-
|
|
3
|
+
import { S as ServeHandlerOptions } from '../index-B6Kq7kjS.js';
|
|
4
|
+
export { C as Client, N as NovuRequestHandler, w as workflow } from '../index-B6Kq7kjS.js';
|
|
5
|
+
import { E as Either } from '../health-check.types-23Z3Ne4i.js';
|
|
6
|
+
export { a as ClientOptions, C as CronExpression, S as SeverityLevelEnum, W as Workflow, p as providerSchemas } from '../health-check.types-23Z3Ne4i.js';
|
|
7
7
|
import { S as SupportedFrameworkName } from '../server.types-BRWsA1CA.js';
|
|
8
|
+
export { EmailStepResolver, step } from '../step-resolver.js';
|
|
9
|
+
import '../base.schema.types-BApIn9jr.js';
|
|
8
10
|
import 'json-schema-to-ts';
|
|
9
11
|
import 'zod';
|
|
10
12
|
|
|
@@ -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-7YRWUU4W.js";import{a as w}from"../chunk-JFMDTNSL.js";import"../chunk-AZJKOVFF.js";import{M as P,U as h}from"../chunk-HQVOLRIB.js";import{f as m}from"../chunk-C734BFYR.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,12 +1,14 @@
|
|
|
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 { E as Either, W as Workflow } from '../health-check.types-
|
|
4
|
-
export { C as CronExpression, S as SeverityLevelEnum, p as providerSchemas } from '../health-check.types-
|
|
1
|
+
import { I as INovuRequestHandlerOptions, N as NovuRequestHandler, S as ServeHandlerOptions, C as Client } from '../index-B6Kq7kjS.js';
|
|
2
|
+
export { w as workflow } from '../index-B6Kq7kjS.js';
|
|
3
|
+
import { E as Either, W as Workflow } from '../health-check.types-23Z3Ne4i.js';
|
|
4
|
+
export { a as ClientOptions, C as CronExpression, S as SeverityLevelEnum, p as providerSchemas } from '../health-check.types-23Z3Ne4i.js';
|
|
5
|
+
export { EmailStepResolver, step } from '../step-resolver.js';
|
|
5
6
|
import { Request, Response } from 'express';
|
|
6
7
|
import { S as SupportedFrameworkName } from '../server.types-BRWsA1CA.js';
|
|
7
8
|
import { VercelRequest, VercelResponse } from '@vercel/node';
|
|
8
9
|
import * as _nestjs_common from '@nestjs/common';
|
|
9
10
|
import { Provider, FactoryProvider } from '@nestjs/common';
|
|
11
|
+
import '../base.schema.types-BApIn9jr.js';
|
|
10
12
|
import 'json-schema-to-ts';
|
|
11
13
|
import 'zod';
|
|
12
14
|
|
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-7YRWUU4W.js";import{a as C}from"../chunk-JFMDTNSL.js";import"../chunk-AZJKOVFF.js";import{M as G,U}from"../chunk-HQVOLRIB.js";import{f as V}from"../chunk-C734BFYR.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,8 +1,10 @@
|
|
|
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 CronExpression, S as SeverityLevelEnum, W as Workflow, p as providerSchemas } from '../health-check.types-
|
|
2
|
+
import { S as ServeHandlerOptions } from '../index-B6Kq7kjS.js';
|
|
3
|
+
export { C as Client, N as NovuRequestHandler, w as workflow } from '../index-B6Kq7kjS.js';
|
|
4
|
+
export { a as ClientOptions, C as CronExpression, S as SeverityLevelEnum, W as Workflow, p as providerSchemas } from '../health-check.types-23Z3Ne4i.js';
|
|
5
5
|
import { S as SupportedFrameworkName } from '../server.types-BRWsA1CA.js';
|
|
6
|
+
export { EmailStepResolver, step } from '../step-resolver.js';
|
|
7
|
+
import '../base.schema.types-BApIn9jr.js';
|
|
6
8
|
import 'json-schema-to-ts';
|
|
7
9
|
import 'zod';
|
|
8
10
|
|
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-7YRWUU4W.js";import{a as w}from"../chunk-JFMDTNSL.js";import"../chunk-AZJKOVFF.js";import{M as q,U as S}from"../chunk-HQVOLRIB.js";import{f as O}from"../chunk-C734BFYR.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,9 +1,11 @@
|
|
|
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 CronExpression, S as SeverityLevelEnum, W as Workflow, p as providerSchemas } from '../health-check.types-
|
|
3
|
+
import { S as ServeHandlerOptions } from '../index-B6Kq7kjS.js';
|
|
4
|
+
export { C as Client, N as NovuRequestHandler, w as workflow } from '../index-B6Kq7kjS.js';
|
|
5
|
+
export { a as ClientOptions, C as CronExpression, S as SeverityLevelEnum, W as Workflow, p as providerSchemas } from '../health-check.types-23Z3Ne4i.js';
|
|
6
6
|
import { S as SupportedFrameworkName } from '../server.types-BRWsA1CA.js';
|
|
7
|
+
export { EmailStepResolver, step } from '../step-resolver.js';
|
|
8
|
+
import '../base.schema.types-BApIn9jr.js';
|
|
7
9
|
import 'json-schema-to-ts';
|
|
8
10
|
import 'zod';
|
|
9
11
|
|
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-7YRWUU4W.js";import{a as f}from"../chunk-JFMDTNSL.js";import"../chunk-AZJKOVFF.js";import{M as S,U as i}from"../chunk-HQVOLRIB.js";import{f as l}from"../chunk-C734BFYR.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,7 +1,9 @@
|
|
|
1
|
-
import { S as ServeHandlerOptions } from '../index-
|
|
2
|
-
export { C as Client, N as NovuRequestHandler, w as workflow } from '../index-
|
|
3
|
-
export { C as CronExpression, S as SeverityLevelEnum, W as Workflow, p as providerSchemas } from '../health-check.types-
|
|
1
|
+
import { S as ServeHandlerOptions } from '../index-B6Kq7kjS.js';
|
|
2
|
+
export { C as Client, N as NovuRequestHandler, w as workflow } from '../index-B6Kq7kjS.js';
|
|
3
|
+
export { a as ClientOptions, C as CronExpression, S as SeverityLevelEnum, W as Workflow, p as providerSchemas } from '../health-check.types-23Z3Ne4i.js';
|
|
4
4
|
import { S as SupportedFrameworkName } from '../server.types-BRWsA1CA.js';
|
|
5
|
+
export { EmailStepResolver, step } from '../step-resolver.js';
|
|
6
|
+
import '../base.schema.types-BApIn9jr.js';
|
|
5
7
|
import 'json-schema-to-ts';
|
|
6
8
|
import 'zod';
|
|
7
9
|
|
|
@@ -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-7YRWUU4W.js";import{a as i}from"../chunk-JFMDTNSL.js";import"../chunk-AZJKOVFF.js";import{M as l,U as R}from"../chunk-HQVOLRIB.js";import{f as u}from"../chunk-C734BFYR.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,8 +1,10 @@
|
|
|
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 CronExpression, S as SeverityLevelEnum, W as Workflow, p as providerSchemas } from '../health-check.types-
|
|
2
|
+
import { S as ServeHandlerOptions } from '../index-B6Kq7kjS.js';
|
|
3
|
+
export { C as Client, N as NovuRequestHandler, w as workflow } from '../index-B6Kq7kjS.js';
|
|
4
|
+
export { a as ClientOptions, C as CronExpression, S as SeverityLevelEnum, W as Workflow, p as providerSchemas } from '../health-check.types-23Z3Ne4i.js';
|
|
5
5
|
import { S as SupportedFrameworkName } from '../server.types-BRWsA1CA.js';
|
|
6
|
+
export { EmailStepResolver, step } from '../step-resolver.js';
|
|
7
|
+
import '../base.schema.types-BApIn9jr.js';
|
|
6
8
|
import 'json-schema-to-ts';
|
|
7
9
|
import 'zod';
|
|
8
10
|
|
|
@@ -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-7YRWUU4W.js";import{a as S}from"../chunk-JFMDTNSL.js";import"../chunk-AZJKOVFF.js";import{M as P,U as R}from"../chunk-HQVOLRIB.js";import{f as v}from"../chunk-C734BFYR.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};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { S as Schema, a as FromSchema } from './base.schema.types-BApIn9jr.js';
|
|
2
|
+
import 'json-schema-to-ts';
|
|
3
|
+
import 'zod';
|
|
4
|
+
|
|
5
|
+
type StepResolverContext<TPayload extends Record<string, unknown> = Record<string, unknown>> = {
|
|
6
|
+
payload: TPayload;
|
|
7
|
+
subscriber: Record<string, unknown>;
|
|
8
|
+
context: Record<string, unknown>;
|
|
9
|
+
steps: Record<string, unknown>;
|
|
10
|
+
};
|
|
11
|
+
type ResolveControls<T extends Schema | undefined> = T extends Schema ? FromSchema<T> : Record<string, unknown>;
|
|
12
|
+
type EmailStepResolver<TControlSchema extends Schema | undefined = undefined, TPayloadSchema extends Schema | undefined = undefined> = {
|
|
13
|
+
type: 'email';
|
|
14
|
+
stepId: string;
|
|
15
|
+
resolve: (controls: ResolveControls<TControlSchema>, ctx: StepResolverContext<ResolveControls<TPayloadSchema>>) => Promise<{
|
|
16
|
+
subject: unknown;
|
|
17
|
+
body: unknown;
|
|
18
|
+
}>;
|
|
19
|
+
controlSchema?: TControlSchema;
|
|
20
|
+
};
|
|
21
|
+
declare function email<TControlSchema extends Schema | undefined = undefined, TPayloadSchema extends Schema | undefined = undefined>(stepId: string, resolve: (controls: ResolveControls<TControlSchema>, ctx: StepResolverContext<ResolveControls<TPayloadSchema>>) => Promise<{
|
|
22
|
+
subject: unknown;
|
|
23
|
+
body: unknown;
|
|
24
|
+
}>, options?: {
|
|
25
|
+
controlSchema?: TControlSchema;
|
|
26
|
+
payloadSchema?: TPayloadSchema;
|
|
27
|
+
}): EmailStepResolver<TControlSchema, TPayloadSchema>;
|
|
28
|
+
declare const step: {
|
|
29
|
+
email: typeof email;
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
export { type EmailStepResolver, step };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as e}from"./chunk-JFMDTNSL.js";import"./chunk-PLPQUHX6.js";export{e as step};
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { ValidateFunction as ValidateFunction$1 } from 'ajv';
|
|
2
|
+
import { ParseReturnType } from 'zod';
|
|
3
|
+
import { S as Schema, F as FromSchemaUnvalidated, a as FromSchema, J as JsonSchema } from './base.schema.types-BApIn9jr.js';
|
|
4
|
+
|
|
5
|
+
type ImportRequirement = {
|
|
6
|
+
/**
|
|
7
|
+
* The name of the dependency.
|
|
8
|
+
*
|
|
9
|
+
* This is a necessary duplicate as ESM does not provide a consistent API for
|
|
10
|
+
* reading the name of a dependency that can't be resolved.
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```typescript
|
|
14
|
+
* 'module-name'
|
|
15
|
+
* ```
|
|
16
|
+
*/
|
|
17
|
+
name: string;
|
|
18
|
+
/**
|
|
19
|
+
* The import statement for the required dependency. An explicit `import('module-name')`
|
|
20
|
+
* call with a static module string is necessary to ensure that the bundler will make
|
|
21
|
+
* the dependency available for usage after tree-shaking. Without a static string,
|
|
22
|
+
* tree-shaking may aggressively remove the import, making it unavailable.
|
|
23
|
+
*
|
|
24
|
+
* This syntax is required during synchronous declaration (e.g. on a class property),
|
|
25
|
+
* but should only be awaited when you can handle a runtime import error.
|
|
26
|
+
*
|
|
27
|
+
* @example
|
|
28
|
+
* ```typescript
|
|
29
|
+
* import('module-name')
|
|
30
|
+
* ```
|
|
31
|
+
*/
|
|
32
|
+
import: Promise<{
|
|
33
|
+
default: unknown;
|
|
34
|
+
} & Record<string, unknown>>;
|
|
35
|
+
/**
|
|
36
|
+
* The required exports of the dependency. The availability of these exports are
|
|
37
|
+
* checked by the import validator to verify the dependency is installed.
|
|
38
|
+
*
|
|
39
|
+
* @example
|
|
40
|
+
* ```typescript
|
|
41
|
+
* ['my-export']
|
|
42
|
+
* ```
|
|
43
|
+
*/
|
|
44
|
+
exports: readonly string[];
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
type ValidateFunction<T = unknown> = ValidateFunction$1<T> | ((data: T) => ParseReturnType<T>);
|
|
48
|
+
type ValidationError = {
|
|
49
|
+
path: string;
|
|
50
|
+
message: string;
|
|
51
|
+
};
|
|
52
|
+
type ValidateResult<T> = {
|
|
53
|
+
success: false;
|
|
54
|
+
errors: ValidationError[];
|
|
55
|
+
} | {
|
|
56
|
+
success: true;
|
|
57
|
+
data: T;
|
|
58
|
+
};
|
|
59
|
+
type Validator<T_Schema extends Schema = Schema> = {
|
|
60
|
+
validate: <T_Unvalidated extends Record<string, unknown> = FromSchemaUnvalidated<T_Schema>, T_Validated extends Record<string, unknown> = FromSchema<T_Schema>>(data: T_Unvalidated, schema: T_Schema) => Promise<ValidateResult<T_Validated>>;
|
|
61
|
+
canHandle: (schema: Schema) => Promise<boolean>;
|
|
62
|
+
transformToJsonSchema: (schema: T_Schema) => Promise<JsonSchema>;
|
|
63
|
+
requiredImports: readonly ImportRequirement[];
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
export type { ValidateResult as V, ValidateFunction as a, ValidationError as b, Validator as c };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { S as Schema, F as FromSchemaUnvalidated, a as FromSchema, J as JsonSchema } from './base.schema.types-BApIn9jr.js';
|
|
2
|
+
import { V as ValidateResult } from './validator.types-BIQli_m1.js';
|
|
3
|
+
import 'json-schema-to-ts';
|
|
4
|
+
import 'zod';
|
|
5
|
+
import 'ajv';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Validate data against a schema.
|
|
9
|
+
*
|
|
10
|
+
* @param schema - The schema to validate the data against.
|
|
11
|
+
* @param data - The data to validate.
|
|
12
|
+
* @returns The validated data.
|
|
13
|
+
*/
|
|
14
|
+
declare const validateData: <T_Schema extends Schema = Schema, T_Unvalidated extends Record<string, unknown> = FromSchemaUnvalidated<T_Schema>, T_Validated extends Record<string, unknown> = FromSchema<T_Schema>>(schema: T_Schema, data: T_Unvalidated) => Promise<ValidateResult<T_Validated>>;
|
|
15
|
+
/**
|
|
16
|
+
* Transform a schema to a JSON schema.
|
|
17
|
+
*
|
|
18
|
+
* @param schema - The schema to transform.
|
|
19
|
+
* @returns The transformed JSON schema.
|
|
20
|
+
*/
|
|
21
|
+
declare const transformSchema: (schema: Schema) => Promise<JsonSchema>;
|
|
22
|
+
|
|
23
|
+
export { transformSchema, validateData };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a,b}from"./chunk-AZJKOVFF.js";import"./chunk-C734BFYR.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.
|
|
3
|
+
"version": "2.10.0-alpha.1",
|
|
4
4
|
"description": "The Code-First Notifications Workflow SDK.",
|
|
5
5
|
"main": "./dist/cjs/index.cjs",
|
|
6
6
|
"types": "./dist/cjs/index.d.cts",
|
|
@@ -24,7 +24,9 @@
|
|
|
24
24
|
"next",
|
|
25
25
|
"nuxt",
|
|
26
26
|
"remix",
|
|
27
|
+
"step-resolver",
|
|
27
28
|
"sveltekit",
|
|
29
|
+
"validators",
|
|
28
30
|
"README.md"
|
|
29
31
|
],
|
|
30
32
|
"keywords": [
|
|
@@ -145,6 +147,26 @@
|
|
|
145
147
|
"types": "./dist/esm/internal/index.d.ts",
|
|
146
148
|
"default": "./dist/esm/internal/index.js"
|
|
147
149
|
}
|
|
150
|
+
},
|
|
151
|
+
"./step-resolver": {
|
|
152
|
+
"require": {
|
|
153
|
+
"types": "./dist/cjs/step-resolver.d.cts",
|
|
154
|
+
"default": "./dist/cjs/step-resolver.cjs"
|
|
155
|
+
},
|
|
156
|
+
"import": {
|
|
157
|
+
"types": "./dist/esm/step-resolver.d.ts",
|
|
158
|
+
"default": "./dist/esm/step-resolver.js"
|
|
159
|
+
}
|
|
160
|
+
},
|
|
161
|
+
"./validators": {
|
|
162
|
+
"require": {
|
|
163
|
+
"types": "./dist/cjs/validators.d.cts",
|
|
164
|
+
"default": "./dist/cjs/validators.cjs"
|
|
165
|
+
},
|
|
166
|
+
"import": {
|
|
167
|
+
"types": "./dist/esm/validators.d.ts",
|
|
168
|
+
"default": "./dist/esm/validators.js"
|
|
169
|
+
}
|
|
148
170
|
}
|
|
149
171
|
},
|
|
150
172
|
"peerDependencies": {
|
|
@@ -205,7 +227,7 @@
|
|
|
205
227
|
"express": "^4.19.2",
|
|
206
228
|
"h3": "^1.11.1",
|
|
207
229
|
"madge": "^8.0.0",
|
|
208
|
-
"next": "^
|
|
230
|
+
"next": "^14.2.35",
|
|
209
231
|
"ts-node": "^10.9.2",
|
|
210
232
|
"tsup": "^8.0.2",
|
|
211
233
|
"tsx": "4.16.2",
|