@novu/framework 2.0.1 → 2.0.3
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/{handler-gB0GtvM6.d.ts → handler-WKKD7ESp.d.ts} +86 -13
- package/dist/index.d.ts +2 -2
- package/dist/index.js +25 -24
- package/dist/servers/express.d.ts +1 -1
- package/dist/servers/express.js +9 -9
- package/dist/servers/h3.d.ts +1 -1
- package/dist/servers/h3.js +7 -7
- package/dist/servers/lambda.d.ts +1 -1
- package/dist/servers/lambda.js +6 -6
- package/dist/servers/next.d.ts +1 -1
- package/dist/servers/next.js +8 -8
- package/dist/servers/nuxt.d.ts +1 -1
- package/dist/servers/nuxt.js +7 -7
- package/dist/servers/remix.d.ts +1 -1
- package/dist/servers/remix.js +3 -3
- package/dist/servers/sveltekit.d.ts +1 -1
- package/dist/servers/sveltekit.js +6 -6
- package/package.json +2 -2
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { TriggerEventStatusEnum, ITriggerPayload, TriggerRecipientSubscriber, TriggerRecipientsPayload, ChannelTypeEnum } from '@novu/shared';
|
|
2
2
|
import { JSONSchema, FromSchema as FromSchema$1 } from 'json-schema-to-ts';
|
|
3
3
|
import zod from 'zod';
|
|
4
4
|
|
|
@@ -55,6 +55,15 @@ declare enum ActionStepEnum {
|
|
|
55
55
|
CUSTOM = "custom"
|
|
56
56
|
}
|
|
57
57
|
|
|
58
|
+
declare enum WorkflowChannelEnum {
|
|
59
|
+
EMAIL = "email",
|
|
60
|
+
SMS = "sms",
|
|
61
|
+
PUSH = "push",
|
|
62
|
+
CHAT = "chat",
|
|
63
|
+
/** Differs from ChannelTypeEnum in capitalization / snake_case */
|
|
64
|
+
IN_APP = "inApp"
|
|
65
|
+
}
|
|
66
|
+
|
|
58
67
|
type JsonSchema = JSONSchema;
|
|
59
68
|
/**
|
|
60
69
|
* A schema used to validate a JSON object.
|
|
@@ -3722,7 +3731,7 @@ declare const channelStepSchemas: {
|
|
|
3722
3731
|
readonly properties: {
|
|
3723
3732
|
readonly url: {
|
|
3724
3733
|
readonly type: "string";
|
|
3725
|
-
readonly
|
|
3734
|
+
readonly pattern: "^(?!mailto:)(?:(https?):\\/\\/[^\\s/$.?#].[^\\s]*)|^(\\/[^\\s]*)$";
|
|
3726
3735
|
};
|
|
3727
3736
|
readonly target: {
|
|
3728
3737
|
readonly type: "string";
|
|
@@ -3730,6 +3739,28 @@ declare const channelStepSchemas: {
|
|
|
3730
3739
|
readonly default: "_blank";
|
|
3731
3740
|
};
|
|
3732
3741
|
};
|
|
3742
|
+
readonly if: {
|
|
3743
|
+
readonly properties: {
|
|
3744
|
+
readonly url: {
|
|
3745
|
+
readonly type: "string";
|
|
3746
|
+
readonly pattern: "^/";
|
|
3747
|
+
};
|
|
3748
|
+
};
|
|
3749
|
+
};
|
|
3750
|
+
readonly then: {
|
|
3751
|
+
readonly properties: {
|
|
3752
|
+
readonly target: {
|
|
3753
|
+
readonly default: "_self";
|
|
3754
|
+
};
|
|
3755
|
+
};
|
|
3756
|
+
};
|
|
3757
|
+
readonly else: {
|
|
3758
|
+
readonly properties: {
|
|
3759
|
+
readonly target: {
|
|
3760
|
+
readonly default: "_blank";
|
|
3761
|
+
};
|
|
3762
|
+
};
|
|
3763
|
+
};
|
|
3733
3764
|
readonly required: readonly ["url"];
|
|
3734
3765
|
readonly additionalProperties: false;
|
|
3735
3766
|
};
|
|
@@ -3748,7 +3779,7 @@ declare const channelStepSchemas: {
|
|
|
3748
3779
|
readonly properties: {
|
|
3749
3780
|
readonly url: {
|
|
3750
3781
|
readonly type: "string";
|
|
3751
|
-
readonly
|
|
3782
|
+
readonly pattern: "^(?!mailto:)(?:(https?):\\/\\/[^\\s/$.?#].[^\\s]*)|^(\\/[^\\s]*)$";
|
|
3752
3783
|
};
|
|
3753
3784
|
readonly target: {
|
|
3754
3785
|
readonly type: "string";
|
|
@@ -3756,6 +3787,28 @@ declare const channelStepSchemas: {
|
|
|
3756
3787
|
readonly default: "_blank";
|
|
3757
3788
|
};
|
|
3758
3789
|
};
|
|
3790
|
+
readonly if: {
|
|
3791
|
+
readonly properties: {
|
|
3792
|
+
readonly url: {
|
|
3793
|
+
readonly type: "string";
|
|
3794
|
+
readonly pattern: "^/";
|
|
3795
|
+
};
|
|
3796
|
+
};
|
|
3797
|
+
};
|
|
3798
|
+
readonly then: {
|
|
3799
|
+
readonly properties: {
|
|
3800
|
+
readonly target: {
|
|
3801
|
+
readonly default: "_self";
|
|
3802
|
+
};
|
|
3803
|
+
};
|
|
3804
|
+
};
|
|
3805
|
+
readonly else: {
|
|
3806
|
+
readonly properties: {
|
|
3807
|
+
readonly target: {
|
|
3808
|
+
readonly default: "_blank";
|
|
3809
|
+
};
|
|
3810
|
+
};
|
|
3811
|
+
};
|
|
3759
3812
|
readonly required: readonly ["url"];
|
|
3760
3813
|
readonly additionalProperties: false;
|
|
3761
3814
|
};
|
|
@@ -3772,7 +3825,7 @@ declare const channelStepSchemas: {
|
|
|
3772
3825
|
readonly properties: {
|
|
3773
3826
|
readonly url: {
|
|
3774
3827
|
readonly type: "string";
|
|
3775
|
-
readonly
|
|
3828
|
+
readonly pattern: "^(?!mailto:)(?:(https?):\\/\\/[^\\s/$.?#].[^\\s]*)|^(\\/[^\\s]*)$";
|
|
3776
3829
|
};
|
|
3777
3830
|
readonly target: {
|
|
3778
3831
|
readonly type: "string";
|
|
@@ -3780,6 +3833,28 @@ declare const channelStepSchemas: {
|
|
|
3780
3833
|
readonly default: "_blank";
|
|
3781
3834
|
};
|
|
3782
3835
|
};
|
|
3836
|
+
readonly if: {
|
|
3837
|
+
readonly properties: {
|
|
3838
|
+
readonly url: {
|
|
3839
|
+
readonly type: "string";
|
|
3840
|
+
readonly pattern: "^/";
|
|
3841
|
+
};
|
|
3842
|
+
};
|
|
3843
|
+
};
|
|
3844
|
+
readonly then: {
|
|
3845
|
+
readonly properties: {
|
|
3846
|
+
readonly target: {
|
|
3847
|
+
readonly default: "_self";
|
|
3848
|
+
};
|
|
3849
|
+
};
|
|
3850
|
+
};
|
|
3851
|
+
readonly else: {
|
|
3852
|
+
readonly properties: {
|
|
3853
|
+
readonly target: {
|
|
3854
|
+
readonly default: "_blank";
|
|
3855
|
+
};
|
|
3856
|
+
};
|
|
3857
|
+
};
|
|
3783
3858
|
readonly required: readonly ["url"];
|
|
3784
3859
|
readonly additionalProperties: false;
|
|
3785
3860
|
};
|
|
@@ -4190,15 +4265,15 @@ type DigestResult = FromSchema<(typeof actionStepSchemas)[ActionStepEnum.DIGEST]
|
|
|
4190
4265
|
*/
|
|
4191
4266
|
type Step = {
|
|
4192
4267
|
/** Send an email. */
|
|
4193
|
-
|
|
4268
|
+
[WorkflowChannelEnum.EMAIL]: ChannelStep<ChannelStepEnum.EMAIL, EmailOutputUnvalidated, EmailResult>;
|
|
4194
4269
|
/** Send an SMS. */
|
|
4195
|
-
|
|
4270
|
+
[WorkflowChannelEnum.SMS]: ChannelStep<ChannelStepEnum.SMS, SmsOutputUnvalidated, SmsResult>;
|
|
4196
4271
|
/** Send a push notification. */
|
|
4197
|
-
|
|
4272
|
+
[WorkflowChannelEnum.PUSH]: ChannelStep<ChannelStepEnum.PUSH, PushOutputUnvalidated, PushResult>;
|
|
4198
4273
|
/** Send a chat message. */
|
|
4199
|
-
|
|
4274
|
+
[WorkflowChannelEnum.CHAT]: ChannelStep<ChannelStepEnum.CHAT, ChatOutputUnvalidated, ChatResult>;
|
|
4200
4275
|
/** Send an in-app notification. */
|
|
4201
|
-
|
|
4276
|
+
[WorkflowChannelEnum.IN_APP]: ChannelStep<ChannelStepEnum.IN_APP, InAppOutputUnvalidated, InAppResult>;
|
|
4202
4277
|
/** Aggregate events for a period of time. */
|
|
4203
4278
|
digest: ActionStep<DigestOutputUnvalidated, DigestResult>;
|
|
4204
4279
|
/** Delay the workflow for a period of time. */
|
|
@@ -4248,9 +4323,7 @@ type WorkflowOptionChannelPreference = {
|
|
|
4248
4323
|
};
|
|
4249
4324
|
type WorkflowOptionsPreferences = {
|
|
4250
4325
|
workflow?: WorkflowOptionChannelPreference;
|
|
4251
|
-
channels?:
|
|
4252
|
-
[key in (typeof ChannelTypeEnum)[keyof typeof ChannelTypeEnum]]?: WorkflowOptionChannelPreference;
|
|
4253
|
-
};
|
|
4326
|
+
channels?: Partial<Record<WorkflowChannelEnum, WorkflowOptionChannelPreference>>;
|
|
4254
4327
|
};
|
|
4255
4328
|
/**
|
|
4256
4329
|
* The options for the workflow.
|
|
@@ -4578,4 +4651,4 @@ declare class NovuRequestHandler<Input extends any[] = any[], Output = any> {
|
|
|
4578
4651
|
private hashHmac;
|
|
4579
4652
|
}
|
|
4580
4653
|
|
|
4581
|
-
export { type
|
|
4654
|
+
export { type ChatOutputUnvalidated as $, ActionStepEnum as A, type StepContext as B, Client as C, type DiscoverProviderOutput as D, type Execute as E, type FromSchemaUnvalidated as F, GetActionEnum as G, type HealthCheck as H, type StepOutput as I, type JsonSchema as J, type ActionStep as K, type CustomStep as L, type ChannelStep as M, NovuRequestHandler as N, type EmailOutput as O, PostActionEnum as P, type EmailOutputUnvalidated as Q, type EmailResult as R, type Schema as S, type SmsOutput as T, type SmsOutputUnvalidated as U, type SmsResult as V, type WorkflowOptions as W, type PushOutput as X, type PushOutputUnvalidated as Y, type PushResult as Z, type ChatOutput as _, type FromSchema as a, type ChatResult as a0, type InAppOutput as a1, type InAppOutputUnvalidated as a2, type InAppResult as a3, type DelayOutput as a4, type DelayOutputUnvalidated as a5, type DelayResult as a6, type DigestRegularOutput as a7, type DigestRegularOutputUnvalidated as a8, type DigestTimedOutput as a9, type DigestTimedOutputUnvalidated as aa, type DigestOutput as ab, type DigestOutputUnvalidated as ac, type DigestResult as ad, type Step as ae, type Subscriber as af, type Either as ag, type Awaitable as ah, type Prettify as ai, type ConditionalPartial as aj, type Indexable as ak, type PickOptional as al, type PickRequired as am, type PickRequiredKeys as an, type PickOptionalKeys as ao, type ExecuteInput as ap, type WorkflowOptionChannelPreference as aq, type WorkflowOptionsPreferences as ar, type Workflow as b, type ServeHandlerOptions as c, ChannelStepEnum as d, WorkflowChannelEnum as e, type CodeResult as f, type ClientOptions as g, type StepType as h, type DiscoverStepOutput as i, type ChannelPreference as j, type DiscoverWorkflowOutputPreferences as k, type DiscoverWorkflowOutput as l, type DiscoverOutput as m, type EventTriggerResult as n, type EventTriggerParams as o, type EventTriggerResponse as p, type CancelEventTriggerResponse as q, type Event as r, type State as s, type ExecuteOutputMetadata as t, type ExecuteOutputOptions as u, type ExecuteOutput as v, type SupportedFrameworkName as w, type Skip as x, type StepOptions as y, JobStatusEnum as z };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { S as Schema, F as FromSchemaUnvalidated, a as FromSchema, J as JsonSchema, E as Execute, W as WorkflowOptions, b as Workflow } from './handler-
|
|
2
|
-
export {
|
|
1
|
+
import { S as Schema, F as FromSchemaUnvalidated, a as FromSchema, J as JsonSchema, E as Execute, W as WorkflowOptions, b as Workflow } from './handler-WKKD7ESp.js';
|
|
2
|
+
export { K as ActionStep, A as ActionStepEnum, ah as Awaitable, q as CancelEventTriggerResponse, j as ChannelPreference, M as ChannelStep, d as ChannelStepEnum, _ as ChatOutput, $ as ChatOutputUnvalidated, a0 as ChatResult, C as Client, g as ClientOptions, f as CodeResult, aj as ConditionalPartial, L as CustomStep, a4 as DelayOutput, a5 as DelayOutputUnvalidated, a6 as DelayResult, ab as DigestOutput, ac as DigestOutputUnvalidated, a7 as DigestRegularOutput, a8 as DigestRegularOutputUnvalidated, ad as DigestResult, a9 as DigestTimedOutput, aa as DigestTimedOutputUnvalidated, m as DiscoverOutput, D as DiscoverProviderOutput, i as DiscoverStepOutput, l as DiscoverWorkflowOutput, k as DiscoverWorkflowOutputPreferences, ag as Either, O as EmailOutput, Q as EmailOutputUnvalidated, R as EmailResult, r as Event, o as EventTriggerParams, p as EventTriggerResponse, n as EventTriggerResult, ap as ExecuteInput, v as ExecuteOutput, t as ExecuteOutputMetadata, u as ExecuteOutputOptions, G as GetActionEnum, H as HealthCheck, a1 as InAppOutput, a2 as InAppOutputUnvalidated, a3 as InAppResult, ak as Indexable, z as JobStatusEnum, N as NovuRequestHandler, al as PickOptional, ao as PickOptionalKeys, am as PickRequired, an as PickRequiredKeys, P as PostActionEnum, ai as Prettify, X as PushOutput, Y as PushOutputUnvalidated, Z as PushResult, c as ServeHandlerOptions, x as Skip, T as SmsOutput, U as SmsOutputUnvalidated, V as SmsResult, s as State, ae as Step, B as StepContext, y as StepOptions, I as StepOutput, h as StepType, af as Subscriber, w as SupportedFrameworkName, e as WorkflowChannelEnum, aq as WorkflowOptionChannelPreference, ar as WorkflowOptionsPreferences } from './handler-WKKD7ESp.js';
|
|
3
3
|
import { ValidateFunction as ValidateFunction$1 } from 'ajv';
|
|
4
4
|
import { ParseReturnType } from 'zod';
|
|
5
5
|
import '@novu/shared';
|