@novu/framework 2.10.1-alpha.7 → 2.11.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.
Files changed (64) hide show
  1. package/dist/cjs/{health-check.types-S8oS3AQZ.d.cts → health-check.types-D4NEyjyC.d.cts} +32 -3
  2. package/dist/cjs/{index-DtCBrkhW.d.cts → index-BNiIiOE-.d.cts} +29 -2
  3. package/dist/cjs/index.cjs +84 -81
  4. package/dist/cjs/index.d.cts +3 -3
  5. package/dist/cjs/internal/index.cjs +1 -1
  6. package/dist/cjs/internal/index.d.cts +3 -3
  7. package/dist/cjs/jsx-dev-runtime.cjs +1 -1
  8. package/dist/cjs/jsx-runtime.cjs +1 -1
  9. package/dist/cjs/servers/express.cjs +92 -89
  10. package/dist/cjs/servers/express.d.cts +4 -4
  11. package/dist/cjs/servers/h3.cjs +88 -85
  12. package/dist/cjs/servers/h3.d.cts +4 -4
  13. package/dist/cjs/servers/lambda.cjs +93 -90
  14. package/dist/cjs/servers/lambda.d.cts +5 -5
  15. package/dist/cjs/servers/nest.cjs +92 -89
  16. package/dist/cjs/servers/nest.d.cts +6 -6
  17. package/dist/cjs/servers/next.cjs +88 -85
  18. package/dist/cjs/servers/next.d.cts +4 -4
  19. package/dist/cjs/servers/nuxt.cjs +88 -85
  20. package/dist/cjs/servers/nuxt.d.cts +4 -4
  21. package/dist/cjs/servers/remix.cjs +88 -85
  22. package/dist/cjs/servers/remix.d.cts +4 -4
  23. package/dist/cjs/servers/sveltekit.cjs +88 -85
  24. package/dist/cjs/servers/sveltekit.d.cts +4 -4
  25. package/dist/cjs/step-resolver.cjs +1 -1
  26. package/dist/cjs/step-resolver.d.cts +2 -2
  27. package/dist/cjs/{subscriber.types-DgRgSKMw.d.cts → subscriber.types-PRaHFLJu.d.cts} +8 -0
  28. package/dist/esm/{chunk-U3IL7QCI.js → chunk-DKQLYSZS.js} +1 -1
  29. package/dist/esm/chunk-FRWG7YTE.js +1 -0
  30. package/dist/esm/{chunk-T2VIX2ZH.js → chunk-KLCBNFAF.js} +11 -11
  31. package/dist/esm/{chunk-6GCCKYZC.js → chunk-N4PZBM53.js} +1 -1
  32. package/dist/esm/chunk-ND6IQFTA.js +133 -0
  33. package/dist/esm/{chunk-CBLKARLC.js → chunk-QTWEINJ4.js} +1 -1
  34. package/dist/esm/{health-check.types-C5lg4csi.d.ts → health-check.types-C-81VaBO.d.ts} +32 -3
  35. package/dist/esm/{index-CAMe0gXf.d.ts → index-D6L0Yufw.d.ts} +29 -2
  36. package/dist/esm/index.d.ts +3 -3
  37. package/dist/esm/index.js +1 -1
  38. package/dist/esm/internal/index.d.ts +3 -3
  39. package/dist/esm/internal/index.js +1 -1
  40. package/dist/esm/jsx-dev-runtime.js +1 -1
  41. package/dist/esm/jsx-runtime.js +1 -1
  42. package/dist/esm/servers/express.d.ts +4 -4
  43. package/dist/esm/servers/express.js +1 -1
  44. package/dist/esm/servers/h3.d.ts +4 -4
  45. package/dist/esm/servers/h3.js +1 -1
  46. package/dist/esm/servers/lambda.d.ts +5 -5
  47. package/dist/esm/servers/lambda.js +1 -1
  48. package/dist/esm/servers/nest.d.ts +6 -6
  49. package/dist/esm/servers/nest.js +1 -1
  50. package/dist/esm/servers/next.d.ts +4 -4
  51. package/dist/esm/servers/next.js +1 -1
  52. package/dist/esm/servers/nuxt.d.ts +4 -4
  53. package/dist/esm/servers/nuxt.js +1 -1
  54. package/dist/esm/servers/remix.d.ts +4 -4
  55. package/dist/esm/servers/remix.js +1 -1
  56. package/dist/esm/servers/sveltekit.d.ts +4 -4
  57. package/dist/esm/servers/sveltekit.js +1 -1
  58. package/dist/esm/step-resolver.d.ts +2 -2
  59. package/dist/esm/step-resolver.js +1 -1
  60. package/dist/esm/{subscriber.types-CbMgjzR-.d.ts → subscriber.types-CC7F0JO_.d.ts} +8 -0
  61. package/dist/esm/validators.js +1 -1
  62. package/package.json +5 -5
  63. package/dist/esm/chunk-E6L6ATIB.js +0 -130
  64. package/dist/esm/chunk-EWC7I6UD.js +0 -1
@@ -1,4 +1,4 @@
1
- import { b as ContextPayload, c as ConditionalPartial, P as PickRequiredKeys, d as Step, e as Prettify, S as Subscriber, E as EnvironmentSystemVariables, C as ContextResolved, D as DeepPartial$1, f as ChannelStepEnum, A as ActionStepEnum, g as Awaitable, W as WithPassthrough, h as StepOptions } from './subscriber.types-DgRgSKMw.cjs';
1
+ import { b as ContextPayload, c as ConditionalPartial, P as PickRequiredKeys, d as Step, e as Prettify, S as Subscriber, E as EnvironmentSystemVariables, C as ContextResolved, D as DeepPartial$1, f as ChannelStepEnum, A as ActionStepEnum, g as Awaitable, W as WithPassthrough, h as StepOptions } from './subscriber.types-PRaHFLJu.cjs';
2
2
  import { S as Schema, J as JsonSchema } from './base.schema.types-BApIn9jr.cjs';
3
3
 
4
4
  declare enum ChannelTypeEnum {
@@ -66,7 +66,8 @@ declare enum ChatProviderIdEnum {
66
66
  GetStream = "getstream",
67
67
  RocketChat = "rocket-chat",
68
68
  WhatsAppBusiness = "whatsapp-business",
69
- ChatWebhook = "chat-webhook"
69
+ ChatWebhook = "chat-webhook",
70
+ Telegram = "telegram"
70
71
  }
71
72
  declare enum PushProviderIdEnum {
72
73
  FCM = "fcm",
@@ -141,6 +142,21 @@ type CodeResult = {
141
142
  code: string;
142
143
  };
143
144
 
145
+ /**
146
+ * A minimal logger interface used for all of the framework's internal logging
147
+ * (workflow discovery, execution and bridge error reporting).
148
+ *
149
+ * The methods (`info`/`warn`/`error`) are chosen so that both the global
150
+ * `console` and common structured loggers (pino, winston, ...) satisfy this
151
+ * interface directly, with no adapter. The global `console` is the default;
152
+ * provide your own to route Novu's internal logs wherever the rest of your
153
+ * application logs go.
154
+ */
155
+ type Logger = {
156
+ info: typeof console.info;
157
+ warn: typeof console.warn;
158
+ error: typeof console.error;
159
+ };
144
160
  type ClientOptions = {
145
161
  /**
146
162
  * Use Novu Cloud US (https://api.novu.co) or EU deployment (https://eu.api.novu.co). Defaults to US.
@@ -170,6 +186,19 @@ type ClientOptions = {
170
186
  * Defaults to `true` in development, `false` in production.
171
187
  */
172
188
  verbose?: boolean;
189
+ /**
190
+ * A custom logger used for all of the framework's internal logging
191
+ * (workflow discovery, execution and bridge error reporting).
192
+ *
193
+ * Defaults to the global `console`. Provide your own logger to route Novu's
194
+ * internal logs through your application's structured logger.
195
+ *
196
+ * Note: `verbose` still controls *whether* discovery and execution logs are
197
+ * emitted; `logger` only controls *where* all logs are written. Bridge errors
198
+ * (HTTP status >= 500) are always logged via this logger, regardless of
199
+ * `verbose`.
200
+ */
201
+ logger?: Logger;
173
202
  };
174
203
 
175
204
  declare enum PostActionEnum {
@@ -699,4 +728,4 @@ type HealthCheck = {
699
728
  };
700
729
  };
701
730
 
702
- export { type ClientOptions as C, type DiscoverAgentOutput as D, type ExecuteInput as E, GetActionEnum as G, type HealthCheck as H, PostActionEnum as P, SeverityLevelEnum as S, type TriggerRecipientsPayload as T, type Workflow as W, CronExpression as a, type CancelEventTriggerResponse as b, type ChannelPreference as c, type CodeResult as d, type DiscoverOutput as e, type DiscoverProviderOutput as f, type DiscoverStepOutput as g, type DiscoverWorkflowOutput as h, type Event as i, type EventTriggerParams as j, type EventTriggerResponse as k, type EventTriggerResult as l, type Execute as m, type ExecuteOutput as n, type ExecuteOutputMetadata as o, type ExecuteOutputOptions as p, type State as q, type StepType as r, WorkflowChannelEnum as s, type WorkflowOptions as t, type WorkflowPreference as u, type WorkflowPreferences as v };
731
+ export { type ClientOptions as C, type DiscoverAgentOutput as D, type ExecuteInput as E, GetActionEnum as G, type HealthCheck as H, type Logger as L, PostActionEnum as P, SeverityLevelEnum as S, type TriggerRecipientsPayload as T, type Workflow as W, CronExpression as a, type CancelEventTriggerResponse as b, type ChannelPreference as c, type CodeResult as d, type DiscoverOutput as e, type DiscoverProviderOutput as f, type DiscoverStepOutput as g, type DiscoverWorkflowOutput as h, type Event as i, type EventTriggerParams as j, type EventTriggerResponse as k, type EventTriggerResult as l, type Execute as m, type ExecuteOutput as n, type ExecuteOutputMetadata as o, type ExecuteOutputOptions as p, type State as q, type StepType as r, WorkflowChannelEnum as s, type WorkflowOptions as t, type WorkflowPreference as u, type WorkflowPreferences as v };
@@ -1,6 +1,6 @@
1
1
  import { ChatElement, Emoji, CardElement } from 'chat';
2
- import { T as TriggerRecipientsPayload, C as ClientOptions, W as Workflow, H as HealthCheck, e as DiscoverOutput, i as Event, n as ExecuteOutput, d as CodeResult, j as EventTriggerParams, m as Execute, t as WorkflowOptions } from './health-check.types-S8oS3AQZ.cjs';
3
- import { g as Awaitable } from './subscriber.types-DgRgSKMw.cjs';
2
+ import { T as TriggerRecipientsPayload, L as Logger, C as ClientOptions, W as Workflow, H as HealthCheck, e as DiscoverOutput, i as Event, n as ExecuteOutput, d as CodeResult, j as EventTriggerParams, m as Execute, t as WorkflowOptions } from './health-check.types-D4NEyjyC.cjs';
3
+ import { g as Awaitable } from './subscriber.types-PRaHFLJu.cjs';
4
4
  import { S as Schema, a as FromSchema, F as FromSchemaUnvalidated } from './base.schema.types-BApIn9jr.cjs';
5
5
  import './step-resolver.cjs';
6
6
 
@@ -85,6 +85,27 @@ interface AgentHistoryEntry {
85
85
  };
86
86
  createdAt: string;
87
87
  }
88
+ /** Resolved inbound email domain metadata (present when `platform === 'email'`). */
89
+ interface AgentEmailDomainContext {
90
+ id: string;
91
+ name: string;
92
+ data?: Record<string, string>;
93
+ }
94
+ /** Resolved inbound email route metadata (present when `platform === 'email'`). */
95
+ interface AgentEmailRouteContext {
96
+ address: string;
97
+ data?: Record<string, string>;
98
+ }
99
+ /** Resolved inbound email envelope (present when `platform === 'email'`). */
100
+ interface AgentEmailContext {
101
+ domain?: AgentEmailDomainContext;
102
+ route?: AgentEmailRouteContext;
103
+ /**
104
+ * Platform-native Message-ID of the message that started this email thread.
105
+ * Equals the current message ID on the first message of a thread.
106
+ */
107
+ rootMessageId?: string;
108
+ }
88
109
  /** Platform-specific identifiers for the thread and channel. */
89
110
  interface AgentPlatformContext {
90
111
  /** Platform-native thread ID (e.g. Slack thread `ts`, Teams conversation ID). */
@@ -93,6 +114,10 @@ interface AgentPlatformContext {
93
114
  channelId: string;
94
115
  /** Whether the message arrived in a direct message rather than a shared channel. */
95
116
  isDM: boolean;
117
+ /** Platform-native raw message payload from the chat SDK adapter (e.g. email `NovuEmailRawMessage`). */
118
+ message?: unknown;
119
+ /** Resolved inbound email routing metadata extracted from the raw payload. */
120
+ email?: AgentEmailContext;
96
121
  }
97
122
  interface FileRef {
98
123
  filename: string;
@@ -118,6 +143,7 @@ interface FileRef {
118
143
  * - `ChatElement` — interactive card built with Card(), Button(), etc.
119
144
  *
120
145
  * For file attachments, pass a `files` array as the second argument to reply()/edit().
146
+ * Cards and files can be combined on platforms that support it (e.g. WhatsApp sends media then the card).
121
147
  */
122
148
  type MessageContent = string | ChatElement;
123
149
  /** Normalized content shape sent over HTTP to the reply endpoint. */
@@ -446,6 +472,7 @@ declare class Client {
446
472
  version: string;
447
473
  strictAuthentication: boolean;
448
474
  verbose: boolean;
475
+ logger: Logger;
449
476
  constructor(options?: ClientOptions);
450
477
  private buildOptions;
451
478
  private log;