@novu/framework 2.10.1-alpha.1 → 2.10.1-alpha.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/cjs/{health-check.types-Nhsa_lGZ.d.cts → health-check.types-S8oS3AQZ.d.cts} +138 -138
- package/dist/cjs/{index-naFCU9MB.d.cts → index-C5CigDlK.d.cts} +182 -14
- package/dist/cjs/index.cjs +58 -58
- package/dist/cjs/index.d.cts +3 -3
- package/dist/cjs/internal/index.d.cts +3 -3
- package/dist/cjs/servers/express.cjs +58 -58
- package/dist/cjs/servers/express.d.cts +4 -4
- package/dist/cjs/servers/h3.cjs +58 -58
- package/dist/cjs/servers/h3.d.cts +4 -4
- package/dist/cjs/servers/lambda.cjs +58 -58
- package/dist/cjs/servers/lambda.d.cts +5 -5
- package/dist/cjs/servers/nest.cjs +58 -58
- package/dist/cjs/servers/nest.d.cts +6 -6
- package/dist/cjs/servers/next.cjs +58 -58
- package/dist/cjs/servers/next.d.cts +4 -4
- package/dist/cjs/servers/nuxt.cjs +58 -58
- package/dist/cjs/servers/nuxt.d.cts +4 -4
- package/dist/cjs/servers/remix.cjs +58 -58
- package/dist/cjs/servers/remix.d.cts +4 -4
- package/dist/cjs/servers/sveltekit.cjs +58 -58
- package/dist/cjs/servers/sveltekit.d.cts +4 -4
- package/dist/cjs/step-resolver.d.cts +2 -2
- package/dist/esm/chunk-CBVFNQC3.js +130 -0
- package/dist/esm/{health-check.types-zMcfbkrA.d.ts → health-check.types-C5lg4csi.d.ts} +138 -138
- package/dist/esm/{index-cfmN-nqZ.d.ts → index-DCSlowxV.d.ts} +182 -14
- package/dist/esm/index.d.ts +3 -3
- package/dist/esm/index.js +1 -1
- package/dist/esm/internal/index.d.ts +3 -3
- package/dist/esm/servers/express.d.ts +4 -4
- package/dist/esm/servers/express.js +1 -1
- package/dist/esm/servers/h3.d.ts +4 -4
- package/dist/esm/servers/h3.js +1 -1
- package/dist/esm/servers/lambda.d.ts +5 -5
- package/dist/esm/servers/lambda.js +1 -1
- package/dist/esm/servers/nest.d.ts +6 -6
- package/dist/esm/servers/nest.js +1 -1
- package/dist/esm/servers/next.d.ts +4 -4
- package/dist/esm/servers/next.js +1 -1
- package/dist/esm/servers/nuxt.d.ts +4 -4
- package/dist/esm/servers/nuxt.js +1 -1
- package/dist/esm/servers/remix.d.ts +4 -4
- package/dist/esm/servers/remix.js +1 -1
- package/dist/esm/servers/sveltekit.d.ts +4 -4
- package/dist/esm/servers/sveltekit.js +1 -1
- package/dist/esm/step-resolver.d.ts +2 -2
- package/package.json +2 -2
- package/dist/esm/chunk-TW2732SM.js +0 -130
- package/dist/cjs/{subscriber.types-CNLicO8m.d.cts → subscriber.types-DgRgSKMw.d.cts} +77 -77
- package/dist/esm/{subscriber.types-B0sKq6v3.d.ts → subscriber.types-CbMgjzR-.d.ts} +77 -77
|
@@ -1,6 +1,142 @@
|
|
|
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-
|
|
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-CbMgjzR-.js';
|
|
2
2
|
import { S as Schema, J as JsonSchema } from './base.schema.types-BApIn9jr.js';
|
|
3
3
|
|
|
4
|
+
declare enum ChannelTypeEnum {
|
|
5
|
+
IN_APP = "in_app",
|
|
6
|
+
EMAIL = "email",
|
|
7
|
+
SMS = "sms",
|
|
8
|
+
CHAT = "chat",
|
|
9
|
+
PUSH = "push"
|
|
10
|
+
}
|
|
11
|
+
interface IAttachmentOptions {
|
|
12
|
+
mime: string;
|
|
13
|
+
file: Buffer;
|
|
14
|
+
name?: string;
|
|
15
|
+
channels?: ChannelTypeEnum[];
|
|
16
|
+
cid?: string;
|
|
17
|
+
disposition?: string;
|
|
18
|
+
}
|
|
19
|
+
interface ITriggerPayload {
|
|
20
|
+
attachments?: IAttachmentOptions[];
|
|
21
|
+
[key: string]: string | string[] | boolean | number | undefined | IAttachmentOptions | IAttachmentOptions[] | Record<string, unknown>;
|
|
22
|
+
}
|
|
23
|
+
interface ISubscriberPayload {
|
|
24
|
+
subscriberId: string;
|
|
25
|
+
firstName?: string;
|
|
26
|
+
lastName?: string;
|
|
27
|
+
email?: string;
|
|
28
|
+
phone?: string;
|
|
29
|
+
avatar?: string;
|
|
30
|
+
locale?: string;
|
|
31
|
+
data?: Record<string, unknown>;
|
|
32
|
+
channels?: ISubscriberChannel[];
|
|
33
|
+
}
|
|
34
|
+
interface ISubscriberChannel {
|
|
35
|
+
providerId: ChatProviderIdEnum | PushProviderIdEnum;
|
|
36
|
+
integrationIdentifier?: string;
|
|
37
|
+
credentials: IChannelCredentials;
|
|
38
|
+
}
|
|
39
|
+
interface IChannelCredentials {
|
|
40
|
+
webhookUrl?: string;
|
|
41
|
+
deviceTokens?: string[];
|
|
42
|
+
}
|
|
43
|
+
interface ITopic {
|
|
44
|
+
type: 'Topic';
|
|
45
|
+
topicKey: string;
|
|
46
|
+
exclude?: string[];
|
|
47
|
+
}
|
|
48
|
+
type TriggerRecipientsPayload = string | ISubscriberPayload | ITopic | ISubscriberPayload[] | ITopic[];
|
|
49
|
+
declare enum TriggerEventStatusEnum {
|
|
50
|
+
ERROR = "error",
|
|
51
|
+
NOT_ACTIVE = "trigger_not_active",
|
|
52
|
+
NO_WORKFLOW_ACTIVE_STEPS = "no_workflow_active_steps_defined",
|
|
53
|
+
NO_WORKFLOW_STEPS = "no_workflow_steps_defined",
|
|
54
|
+
PROCESSED = "processed",
|
|
55
|
+
SUBSCRIBER_MISSING = "subscriber_id_missing",
|
|
56
|
+
TENANT_MISSING = "no_tenant_found"
|
|
57
|
+
}
|
|
58
|
+
declare enum ChatProviderIdEnum {
|
|
59
|
+
Slack = "slack",
|
|
60
|
+
Discord = "discord",
|
|
61
|
+
MsTeams = "msteams",
|
|
62
|
+
Mattermost = "mattermost",
|
|
63
|
+
Ryver = "ryver",
|
|
64
|
+
Zulip = "zulip",
|
|
65
|
+
GrafanaOnCall = "grafana-on-call",
|
|
66
|
+
GetStream = "getstream",
|
|
67
|
+
RocketChat = "rocket-chat",
|
|
68
|
+
WhatsAppBusiness = "whatsapp-business",
|
|
69
|
+
ChatWebhook = "chat-webhook"
|
|
70
|
+
}
|
|
71
|
+
declare enum PushProviderIdEnum {
|
|
72
|
+
FCM = "fcm",
|
|
73
|
+
APNS = "apns",
|
|
74
|
+
EXPO = "expo",
|
|
75
|
+
OneSignal = "one-signal",
|
|
76
|
+
Pushpad = "pushpad",
|
|
77
|
+
PushWebhook = "push-webhook",
|
|
78
|
+
PusherBeams = "pusher-beams",
|
|
79
|
+
AppIO = "appio"
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* A preference for a notification delivery workflow.
|
|
83
|
+
*
|
|
84
|
+
* This provides a shortcut to setting all channels to the same preference.
|
|
85
|
+
*/
|
|
86
|
+
type WorkflowPreference$1 = {
|
|
87
|
+
/**
|
|
88
|
+
* A flag specifying if notification delivery is enabled for the workflow.
|
|
89
|
+
*
|
|
90
|
+
* If `true`, notification delivery is enabled by default for all channels.
|
|
91
|
+
*
|
|
92
|
+
* This setting can be overridden by the channel preferences.
|
|
93
|
+
*
|
|
94
|
+
* @default true
|
|
95
|
+
*/
|
|
96
|
+
enabled: boolean;
|
|
97
|
+
/**
|
|
98
|
+
* A flag specifying if the preference is read-only.
|
|
99
|
+
*
|
|
100
|
+
* If `true`, the preference cannot be changed by the Subscriber.
|
|
101
|
+
*
|
|
102
|
+
* @default false
|
|
103
|
+
*/
|
|
104
|
+
readOnly: boolean;
|
|
105
|
+
};
|
|
106
|
+
/** A preference for a notification delivery channel. */
|
|
107
|
+
type ChannelPreference$1 = {
|
|
108
|
+
/**
|
|
109
|
+
* A flag specifying if notification delivery is enabled for the channel.
|
|
110
|
+
*
|
|
111
|
+
* If `true`, notification delivery is enabled.
|
|
112
|
+
*
|
|
113
|
+
* @default true
|
|
114
|
+
*/
|
|
115
|
+
enabled: boolean;
|
|
116
|
+
};
|
|
117
|
+
type WorkflowPreferences$1 = {
|
|
118
|
+
/**
|
|
119
|
+
* A preference for the workflow.
|
|
120
|
+
*
|
|
121
|
+
* The values specified here will be used if no preference is specified for a channel.
|
|
122
|
+
*/
|
|
123
|
+
all: WorkflowPreference$1;
|
|
124
|
+
/**
|
|
125
|
+
* A preference for each notification delivery channel.
|
|
126
|
+
*
|
|
127
|
+
* If no preference is specified for a channel, the `all` preference will be used.
|
|
128
|
+
*/
|
|
129
|
+
channels: Record<ChannelTypeEnum, ChannelPreference$1>;
|
|
130
|
+
};
|
|
131
|
+
/**
|
|
132
|
+
* Recursively make all properties of type `T` optional.
|
|
133
|
+
*/
|
|
134
|
+
type DeepPartial<T> = T extends object ? {
|
|
135
|
+
[P in keyof T]?: DeepPartial<T[P]>;
|
|
136
|
+
} : T;
|
|
137
|
+
/** A partial set of workflow preferences. */
|
|
138
|
+
type WorkflowPreferencesPartial = DeepPartial<WorkflowPreferences$1>;
|
|
139
|
+
|
|
4
140
|
type CodeResult = {
|
|
5
141
|
code: string;
|
|
6
142
|
};
|
|
@@ -151,142 +287,6 @@ declare enum WorkflowChannelEnum {
|
|
|
151
287
|
IN_APP = "inApp"
|
|
152
288
|
}
|
|
153
289
|
|
|
154
|
-
declare enum ChannelTypeEnum {
|
|
155
|
-
IN_APP = "in_app",
|
|
156
|
-
EMAIL = "email",
|
|
157
|
-
SMS = "sms",
|
|
158
|
-
CHAT = "chat",
|
|
159
|
-
PUSH = "push"
|
|
160
|
-
}
|
|
161
|
-
interface IAttachmentOptions {
|
|
162
|
-
mime: string;
|
|
163
|
-
file: Buffer;
|
|
164
|
-
name?: string;
|
|
165
|
-
channels?: ChannelTypeEnum[];
|
|
166
|
-
cid?: string;
|
|
167
|
-
disposition?: string;
|
|
168
|
-
}
|
|
169
|
-
interface ITriggerPayload {
|
|
170
|
-
attachments?: IAttachmentOptions[];
|
|
171
|
-
[key: string]: string | string[] | boolean | number | undefined | IAttachmentOptions | IAttachmentOptions[] | Record<string, unknown>;
|
|
172
|
-
}
|
|
173
|
-
interface ISubscriberPayload {
|
|
174
|
-
subscriberId: string;
|
|
175
|
-
firstName?: string;
|
|
176
|
-
lastName?: string;
|
|
177
|
-
email?: string;
|
|
178
|
-
phone?: string;
|
|
179
|
-
avatar?: string;
|
|
180
|
-
locale?: string;
|
|
181
|
-
data?: Record<string, unknown>;
|
|
182
|
-
channels?: ISubscriberChannel[];
|
|
183
|
-
}
|
|
184
|
-
interface ISubscriberChannel {
|
|
185
|
-
providerId: ChatProviderIdEnum | PushProviderIdEnum;
|
|
186
|
-
integrationIdentifier?: string;
|
|
187
|
-
credentials: IChannelCredentials;
|
|
188
|
-
}
|
|
189
|
-
interface IChannelCredentials {
|
|
190
|
-
webhookUrl?: string;
|
|
191
|
-
deviceTokens?: string[];
|
|
192
|
-
}
|
|
193
|
-
interface ITopic {
|
|
194
|
-
type: 'Topic';
|
|
195
|
-
topicKey: string;
|
|
196
|
-
exclude?: string[];
|
|
197
|
-
}
|
|
198
|
-
type TriggerRecipientsPayload = string | ISubscriberPayload | ITopic | ISubscriberPayload[] | ITopic[];
|
|
199
|
-
declare enum TriggerEventStatusEnum {
|
|
200
|
-
ERROR = "error",
|
|
201
|
-
NOT_ACTIVE = "trigger_not_active",
|
|
202
|
-
NO_WORKFLOW_ACTIVE_STEPS = "no_workflow_active_steps_defined",
|
|
203
|
-
NO_WORKFLOW_STEPS = "no_workflow_steps_defined",
|
|
204
|
-
PROCESSED = "processed",
|
|
205
|
-
SUBSCRIBER_MISSING = "subscriber_id_missing",
|
|
206
|
-
TENANT_MISSING = "no_tenant_found"
|
|
207
|
-
}
|
|
208
|
-
declare enum ChatProviderIdEnum {
|
|
209
|
-
Slack = "slack",
|
|
210
|
-
Discord = "discord",
|
|
211
|
-
MsTeams = "msteams",
|
|
212
|
-
Mattermost = "mattermost",
|
|
213
|
-
Ryver = "ryver",
|
|
214
|
-
Zulip = "zulip",
|
|
215
|
-
GrafanaOnCall = "grafana-on-call",
|
|
216
|
-
GetStream = "getstream",
|
|
217
|
-
RocketChat = "rocket-chat",
|
|
218
|
-
WhatsAppBusiness = "whatsapp-business",
|
|
219
|
-
ChatWebhook = "chat-webhook"
|
|
220
|
-
}
|
|
221
|
-
declare enum PushProviderIdEnum {
|
|
222
|
-
FCM = "fcm",
|
|
223
|
-
APNS = "apns",
|
|
224
|
-
EXPO = "expo",
|
|
225
|
-
OneSignal = "one-signal",
|
|
226
|
-
Pushpad = "pushpad",
|
|
227
|
-
PushWebhook = "push-webhook",
|
|
228
|
-
PusherBeams = "pusher-beams",
|
|
229
|
-
AppIO = "appio"
|
|
230
|
-
}
|
|
231
|
-
/**
|
|
232
|
-
* A preference for a notification delivery workflow.
|
|
233
|
-
*
|
|
234
|
-
* This provides a shortcut to setting all channels to the same preference.
|
|
235
|
-
*/
|
|
236
|
-
type WorkflowPreference$1 = {
|
|
237
|
-
/**
|
|
238
|
-
* A flag specifying if notification delivery is enabled for the workflow.
|
|
239
|
-
*
|
|
240
|
-
* If `true`, notification delivery is enabled by default for all channels.
|
|
241
|
-
*
|
|
242
|
-
* This setting can be overridden by the channel preferences.
|
|
243
|
-
*
|
|
244
|
-
* @default true
|
|
245
|
-
*/
|
|
246
|
-
enabled: boolean;
|
|
247
|
-
/**
|
|
248
|
-
* A flag specifying if the preference is read-only.
|
|
249
|
-
*
|
|
250
|
-
* If `true`, the preference cannot be changed by the Subscriber.
|
|
251
|
-
*
|
|
252
|
-
* @default false
|
|
253
|
-
*/
|
|
254
|
-
readOnly: boolean;
|
|
255
|
-
};
|
|
256
|
-
/** A preference for a notification delivery channel. */
|
|
257
|
-
type ChannelPreference$1 = {
|
|
258
|
-
/**
|
|
259
|
-
* A flag specifying if notification delivery is enabled for the channel.
|
|
260
|
-
*
|
|
261
|
-
* If `true`, notification delivery is enabled.
|
|
262
|
-
*
|
|
263
|
-
* @default true
|
|
264
|
-
*/
|
|
265
|
-
enabled: boolean;
|
|
266
|
-
};
|
|
267
|
-
type WorkflowPreferences$1 = {
|
|
268
|
-
/**
|
|
269
|
-
* A preference for the workflow.
|
|
270
|
-
*
|
|
271
|
-
* The values specified here will be used if no preference is specified for a channel.
|
|
272
|
-
*/
|
|
273
|
-
all: WorkflowPreference$1;
|
|
274
|
-
/**
|
|
275
|
-
* A preference for each notification delivery channel.
|
|
276
|
-
*
|
|
277
|
-
* If no preference is specified for a channel, the `all` preference will be used.
|
|
278
|
-
*/
|
|
279
|
-
channels: Record<ChannelTypeEnum, ChannelPreference$1>;
|
|
280
|
-
};
|
|
281
|
-
/**
|
|
282
|
-
* Recursively make all properties of type `T` optional.
|
|
283
|
-
*/
|
|
284
|
-
type DeepPartial<T> = T extends object ? {
|
|
285
|
-
[P in keyof T]?: DeepPartial<T[P]>;
|
|
286
|
-
} : T;
|
|
287
|
-
/** A partial set of workflow preferences. */
|
|
288
|
-
type WorkflowPreferencesPartial = DeepPartial<WorkflowPreferences$1>;
|
|
289
|
-
|
|
290
290
|
type EventPayload = ITriggerPayload;
|
|
291
291
|
type Actor = string | ISubscriberPayload;
|
|
292
292
|
type Recipients = TriggerRecipientsPayload;
|
|
@@ -699,4 +699,4 @@ type HealthCheck = {
|
|
|
699
699
|
};
|
|
700
700
|
};
|
|
701
701
|
|
|
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 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 };
|
|
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 };
|
|
@@ -1,20 +1,34 @@
|
|
|
1
|
-
import { ChatElement } from 'chat';
|
|
2
|
-
import { 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-
|
|
3
|
-
import { g as Awaitable } from './subscriber.types-
|
|
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-C5lg4csi.js';
|
|
3
|
+
import { g as Awaitable } from './subscriber.types-CbMgjzR-.js';
|
|
4
4
|
import { S as Schema, a as FromSchema, F as FromSchemaUnvalidated } from './base.schema.types-BApIn9jr.js';
|
|
5
5
|
import './step-resolver.js';
|
|
6
6
|
|
|
7
|
+
declare enum AgentEventEnum {
|
|
8
|
+
ON_MESSAGE = "onMessage",
|
|
9
|
+
ON_ACTION = "onAction",
|
|
10
|
+
ON_RESOLVE = "onResolve",
|
|
11
|
+
ON_REACTION = "onReaction"
|
|
12
|
+
}
|
|
7
13
|
interface AgentMessageAuthor {
|
|
8
14
|
userId: string;
|
|
9
15
|
fullName: string;
|
|
10
16
|
userName: string;
|
|
11
17
|
isBot: boolean | 'unknown';
|
|
12
18
|
}
|
|
19
|
+
interface AgentAttachment {
|
|
20
|
+
type: string;
|
|
21
|
+
url?: string;
|
|
22
|
+
name?: string;
|
|
23
|
+
mimeType?: string;
|
|
24
|
+
size?: number;
|
|
25
|
+
}
|
|
13
26
|
interface AgentMessage {
|
|
14
27
|
text: string;
|
|
15
28
|
platformMessageId: string;
|
|
16
29
|
author: AgentMessageAuthor;
|
|
17
30
|
timestamp: string;
|
|
31
|
+
attachments?: AgentAttachment[];
|
|
18
32
|
}
|
|
19
33
|
interface AgentConversation {
|
|
20
34
|
identifier: string;
|
|
@@ -38,6 +52,7 @@ interface AgentHistoryEntry {
|
|
|
38
52
|
role: string;
|
|
39
53
|
type: string;
|
|
40
54
|
content: string;
|
|
55
|
+
richContent?: Record<string, unknown>;
|
|
41
56
|
senderName?: string;
|
|
42
57
|
signalData?: {
|
|
43
58
|
type: string;
|
|
@@ -59,10 +74,10 @@ interface FileRef {
|
|
|
59
74
|
url?: string;
|
|
60
75
|
}
|
|
61
76
|
/**
|
|
62
|
-
* Content accepted by ctx.reply() and
|
|
77
|
+
* Content accepted by ctx.reply() and handle.edit().
|
|
63
78
|
*
|
|
64
|
-
* - `string` — plain text
|
|
65
|
-
* - `{ markdown, files? }` — markdown
|
|
79
|
+
* - `string` — plain text or markdown; converted to platform format by the chat SDK
|
|
80
|
+
* - `{ markdown, files? }` — markdown with optional file attachments
|
|
66
81
|
* - `ChatElement` — interactive card built with Card(), Button(), etc.
|
|
67
82
|
* (must be a CardElement at runtime; validated by serializeContent)
|
|
68
83
|
*/
|
|
@@ -70,6 +85,12 @@ type MessageContent = string | {
|
|
|
70
85
|
markdown: string;
|
|
71
86
|
files?: FileRef[];
|
|
72
87
|
} | ChatElement;
|
|
88
|
+
/** Normalized content shape sent over HTTP to the reply endpoint. */
|
|
89
|
+
interface ReplyContent {
|
|
90
|
+
markdown?: string;
|
|
91
|
+
card?: CardElement;
|
|
92
|
+
files?: FileRef[];
|
|
93
|
+
}
|
|
73
94
|
interface AgentAction {
|
|
74
95
|
actionId: string;
|
|
75
96
|
value?: string;
|
|
@@ -82,6 +103,19 @@ interface AgentReaction {
|
|
|
82
103
|
added: boolean;
|
|
83
104
|
message: AgentMessage | null;
|
|
84
105
|
}
|
|
106
|
+
/**
|
|
107
|
+
* Handle to a message posted via ctx.reply(). Mirrors the chat SDK's `SentMessage`
|
|
108
|
+
* primitive: edits apply in-place on the platform (same platform message, content changes)
|
|
109
|
+
* and never post a new message.
|
|
110
|
+
*/
|
|
111
|
+
interface ReplyHandle {
|
|
112
|
+
/** Platform-native message id (e.g. Slack ts, Teams activityId). */
|
|
113
|
+
readonly messageId: string;
|
|
114
|
+
/** Platform-native thread id this message lives in. */
|
|
115
|
+
readonly platformThreadId: string;
|
|
116
|
+
/** Edit this message in place with new content. Returns the same handle for chaining. */
|
|
117
|
+
edit(content: MessageContent): Promise<ReplyHandle>;
|
|
118
|
+
}
|
|
85
119
|
interface AgentContext {
|
|
86
120
|
readonly event: string;
|
|
87
121
|
readonly action: AgentAction | null;
|
|
@@ -92,27 +126,161 @@ interface AgentContext {
|
|
|
92
126
|
readonly history: AgentHistoryEntry[];
|
|
93
127
|
readonly platform: string;
|
|
94
128
|
readonly platformContext: AgentPlatformContext;
|
|
95
|
-
|
|
96
|
-
|
|
129
|
+
/**
|
|
130
|
+
* Post a message to the conversation and return a handle to it.
|
|
131
|
+
* Use the handle to edit the message in place later — no second post.
|
|
132
|
+
*
|
|
133
|
+
* @example
|
|
134
|
+
* const msg = await ctx.reply('Thinking…');
|
|
135
|
+
* // ... do work ...
|
|
136
|
+
* await msg.edit('Here is the answer');
|
|
137
|
+
*/
|
|
138
|
+
reply(content: MessageContent): Promise<ReplyHandle>;
|
|
97
139
|
resolve(summary?: string): void;
|
|
98
140
|
metadata: {
|
|
99
141
|
set(key: string, value: unknown): void;
|
|
100
142
|
};
|
|
143
|
+
/**
|
|
144
|
+
* Trigger a Novu workflow from within this agent handler.
|
|
145
|
+
*
|
|
146
|
+
* Signals are batched and flushed with the next `ctx.reply()`, or automatically when the
|
|
147
|
+
* handler completes. The workflow executes asynchronously — the agent reply is not blocked.
|
|
148
|
+
*
|
|
149
|
+
* @param workflowId - Workflow identifier (e.g. `'escalation-email'`).
|
|
150
|
+
* @param opts.to - Recipient(s). Omit to target the conversation's resolved subscriber.
|
|
151
|
+
* @param opts.payload - Data forwarded to the workflow payload schema.
|
|
152
|
+
*
|
|
153
|
+
* @example
|
|
154
|
+
* // Target the conversation subscriber automatically
|
|
155
|
+
* ctx.trigger('follow-up-email', { payload: { reason: 'unresolved' } });
|
|
156
|
+
*
|
|
157
|
+
* // Explicit recipient
|
|
158
|
+
* ctx.trigger('escalation-email', { to: 'agent-inbox', payload: { priority: 'high' } });
|
|
159
|
+
*
|
|
160
|
+
* // Topic broadcast
|
|
161
|
+
* ctx.trigger('team-alert', { to: { type: 'Topic', topicKey: 'support-team' } });
|
|
162
|
+
*/
|
|
101
163
|
trigger(workflowId: string, opts?: {
|
|
102
|
-
to?:
|
|
164
|
+
to?: TriggerRecipientsPayload;
|
|
103
165
|
payload?: Record<string, unknown>;
|
|
104
166
|
}): void;
|
|
167
|
+
/**
|
|
168
|
+
* Add an emoji reaction to any platform message.
|
|
169
|
+
* Reactions are queued and sent with the next `ctx.reply()`, or flushed automatically
|
|
170
|
+
* when the handler completes (same batching contract as `ctx.trigger()`).
|
|
171
|
+
*
|
|
172
|
+
* @param messageId - Platform-native message ID to react to (e.g. Slack `ts`).
|
|
173
|
+
* @param emojiName - Emoji short-name (e.g. `'thumbs_up'`, `'check_mark'`).
|
|
174
|
+
*
|
|
175
|
+
* @example
|
|
176
|
+
* ctx.addReaction(ctx.reaction!.messageId, 'check_mark');
|
|
177
|
+
* await ctx.reply('Done!');
|
|
178
|
+
*/
|
|
179
|
+
addReaction(messageId: string, emojiName: Emoji): void;
|
|
105
180
|
}
|
|
106
181
|
interface AgentHandlers {
|
|
107
|
-
onMessage: (ctx: AgentContext) =>
|
|
108
|
-
onReaction?: (ctx: AgentContext) =>
|
|
109
|
-
onAction?: (ctx: AgentContext) =>
|
|
110
|
-
onResolve?: (ctx: AgentContext) =>
|
|
182
|
+
onMessage: (ctx: AgentContext) => Awaitable<MessageContent | void>;
|
|
183
|
+
onReaction?: (ctx: AgentContext) => Awaitable<MessageContent | void>;
|
|
184
|
+
onAction?: (ctx: AgentContext) => Awaitable<MessageContent | void>;
|
|
185
|
+
onResolve?: (ctx: AgentContext) => Awaitable<MessageContent | void>;
|
|
111
186
|
}
|
|
112
187
|
interface Agent {
|
|
113
188
|
id: string;
|
|
114
189
|
handlers: AgentHandlers;
|
|
115
190
|
}
|
|
191
|
+
interface AgentBridgeRequest {
|
|
192
|
+
version: number;
|
|
193
|
+
timestamp: string;
|
|
194
|
+
deliveryId: string;
|
|
195
|
+
event: string;
|
|
196
|
+
agentId: string;
|
|
197
|
+
replyUrl: string;
|
|
198
|
+
conversationId: string;
|
|
199
|
+
integrationIdentifier: string;
|
|
200
|
+
action: AgentAction | null;
|
|
201
|
+
message: AgentMessage | null;
|
|
202
|
+
reaction: AgentReaction | null;
|
|
203
|
+
conversation: AgentConversation;
|
|
204
|
+
subscriber: AgentSubscriber | null;
|
|
205
|
+
history: AgentHistoryEntry[];
|
|
206
|
+
platform: string;
|
|
207
|
+
platformContext: AgentPlatformContext;
|
|
208
|
+
}
|
|
209
|
+
type MetadataSignal = {
|
|
210
|
+
type: 'metadata';
|
|
211
|
+
key: string;
|
|
212
|
+
value: unknown;
|
|
213
|
+
};
|
|
214
|
+
/**
|
|
215
|
+
* Queued by `ctx.trigger()` — instructs Novu to fire a workflow from inside an agent handler.
|
|
216
|
+
*
|
|
217
|
+
* - `workflowId` — the workflow identifier (same string used in `novu.events.trigger()`).
|
|
218
|
+
* - `to` — recipient(s) for the workflow. Accepts a subscriberId string, a subscriber object,
|
|
219
|
+
* a topic, or arrays thereof. When omitted, Novu falls back to the conversation's resolved
|
|
220
|
+
* subscriber. If no subscriber can be resolved, the trigger is skipped and a warning is logged.
|
|
221
|
+
* - `payload` — arbitrary data forwarded to the workflow's payload schema.
|
|
222
|
+
*/
|
|
223
|
+
type TriggerSignal = {
|
|
224
|
+
type: 'trigger';
|
|
225
|
+
workflowId: string;
|
|
226
|
+
to?: TriggerRecipientsPayload;
|
|
227
|
+
payload?: Record<string, unknown>;
|
|
228
|
+
};
|
|
229
|
+
type Signal = MetadataSignal | TriggerSignal;
|
|
230
|
+
/** In-place edit of a previously posted agent message. Identified by platform message id. */
|
|
231
|
+
interface EditPayload {
|
|
232
|
+
messageId: string;
|
|
233
|
+
content: ReplyContent;
|
|
234
|
+
}
|
|
235
|
+
/** An emoji reaction to be added to a platform message. */
|
|
236
|
+
interface AddReactionPayload {
|
|
237
|
+
messageId: string;
|
|
238
|
+
emojiName: Emoji;
|
|
239
|
+
}
|
|
240
|
+
interface AgentReplyPayload {
|
|
241
|
+
conversationId: string;
|
|
242
|
+
integrationIdentifier: string;
|
|
243
|
+
reply?: ReplyContent;
|
|
244
|
+
edit?: EditPayload;
|
|
245
|
+
resolve?: {
|
|
246
|
+
summary?: string;
|
|
247
|
+
};
|
|
248
|
+
signals?: Signal[];
|
|
249
|
+
addReactions?: AddReactionPayload[];
|
|
250
|
+
}
|
|
251
|
+
/** Shape returned by /agents/:id/reply when a reply or edit was delivered. */
|
|
252
|
+
interface SentMessageInfo {
|
|
253
|
+
messageId: string;
|
|
254
|
+
platformThreadId: string;
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
/**
|
|
258
|
+
* Thrown by `ctx.reply()` and `handle.edit()` when the upstream message delivery
|
|
259
|
+
* fails — e.g. the configured email provider returns 401, Slack rejects the token,
|
|
260
|
+
* or Teams rejects the request.
|
|
261
|
+
*
|
|
262
|
+
* The `message` property contains the original provider error text
|
|
263
|
+
*
|
|
264
|
+
* @example
|
|
265
|
+
* ```ts
|
|
266
|
+
* import { AgentDeliveryError } from '@novu/framework';
|
|
267
|
+
*
|
|
268
|
+
* try {
|
|
269
|
+
* await ctx.reply('Hello!');
|
|
270
|
+
* } catch (err) {
|
|
271
|
+
* if (err instanceof AgentDeliveryError) {
|
|
272
|
+
* // Delivery failed (misconfigured provider, rate limit, etc.)
|
|
273
|
+
* console.error('Delivery failed:', err.message);
|
|
274
|
+
* return;
|
|
275
|
+
* }
|
|
276
|
+
* throw err;
|
|
277
|
+
* }
|
|
278
|
+
* ```
|
|
279
|
+
*/
|
|
280
|
+
declare class AgentDeliveryError extends Error {
|
|
281
|
+
readonly statusCode: number;
|
|
282
|
+
constructor(statusCode: number, message: string);
|
|
283
|
+
}
|
|
116
284
|
|
|
117
285
|
/**
|
|
118
286
|
* Define a new conversational agent.
|
|
@@ -265,4 +433,4 @@ declare class NovuRequestHandler<Input extends any[] = any[], Output = any> {
|
|
|
265
433
|
*/
|
|
266
434
|
declare function workflow<T_PayloadSchema extends Schema, T_ControlSchema extends Schema, T_EnvSchema extends Schema, T_PayloadValidated extends Record<string, unknown> = FromSchema<T_PayloadSchema>, T_PayloadUnvalidated extends Record<string, unknown> = FromSchemaUnvalidated<T_PayloadSchema>, T_Controls extends Record<string, unknown> = FromSchema<T_ControlSchema>, T_Env extends Record<string, unknown> = FromSchema<T_EnvSchema>>(workflowId: string, execute: Execute<T_PayloadValidated, T_Controls, T_Env>, workflowOptions?: WorkflowOptions<T_PayloadSchema, T_ControlSchema, T_EnvSchema>): Workflow<T_PayloadUnvalidated>;
|
|
267
435
|
|
|
268
|
-
export { type Agent as A, Client as C, type FileRef as F, type INovuRequestHandlerOptions as I, type MessageContent as M, NovuRequestHandler as N, type ServeHandlerOptions as S, type
|
|
436
|
+
export { type Agent as A, Client as C, type EditPayload as E, type FileRef as F, type INovuRequestHandlerOptions as I, type MessageContent as M, NovuRequestHandler as N, type ReplyContent as R, type ServeHandlerOptions as S, type TriggerSignal as T, type AgentAction as a, type AgentAttachment as b, type AgentBridgeRequest as c, type AgentContext as d, type AgentConversation as e, AgentDeliveryError as f, AgentEventEnum as g, type AgentHandlers as h, type AgentHistoryEntry as i, type AgentMessage as j, type AgentMessageAuthor as k, type AgentPlatformContext as l, type AgentReaction as m, type AgentReplyPayload as n, type AgentSubscriber as o, type MetadataSignal as p, type ReplyHandle as q, type SentMessageInfo as r, type Signal as s, agent as t, workflow as w };
|
package/dist/esm/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
export { A as Agent, a as
|
|
2
|
-
export { C as ClientOptions, a as CronExpression, E as ExecuteInput, S as SeverityLevelEnum, W as Workflow } from './health-check.types-
|
|
1
|
+
export { A as Agent, a as AgentAction, b as AgentAttachment, c as AgentBridgeRequest, d as AgentContext, e as AgentConversation, f as AgentDeliveryError, g as AgentEventEnum, h as AgentHandlers, i as AgentHistoryEntry, j as AgentMessage, k as AgentMessageAuthor, l as AgentPlatformContext, m as AgentReaction, n as AgentReplyPayload, o as AgentSubscriber, C as Client, E as EditPayload, F as FileRef, M as MessageContent, p as MetadataSignal, N as NovuRequestHandler, R as ReplyContent, q as ReplyHandle, r as SentMessageInfo, S as ServeHandlerOptions, s as Signal, T as TriggerSignal, t as agent, w as workflow } from './index-DCSlowxV.js';
|
|
2
|
+
export { C as ClientOptions, a as CronExpression, E as ExecuteInput, S as SeverityLevelEnum, W as Workflow } from './health-check.types-C5lg4csi.js';
|
|
3
3
|
export { Actions, Button, Card, CardChild, CardElement, CardLink, CardText, Divider, Select, SelectOption, TextInput } from 'chat';
|
|
4
4
|
export { AnyStepResolver, ChatStepResolver, EmailStepResolver, InAppStepResolver, PushStepResolver, SmsStepResolver, StepResolverContext, step } from './step-resolver.js';
|
|
5
|
-
export { C as ContextResolved, E as EnvironmentSystemVariables, S as Subscriber, p as providerSchemas } from './subscriber.types-
|
|
5
|
+
export { C as ContextResolved, E as EnvironmentSystemVariables, S as Subscriber, p as providerSchemas } from './subscriber.types-CbMgjzR-.js';
|
|
6
6
|
import './base.schema.types-BApIn9jr.js';
|
|
7
7
|
import 'json-schema-to-ts';
|
|
8
8
|
import 'zod';
|
package/dist/esm/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b,c,d,e,f,g,h,i,j,k,l,m,n as
|
|
1
|
+
import{b,c,d,e,f,g,h,i,j,k,l,m,n,o,p as r}from"./chunk-CBVFNQC3.js";import"./chunk-T2VIX2ZH.js";import{a as s}from"./chunk-2M25EATE.js";import"./chunk-U3IL7QCI.js";import{O as q}from"./chunk-6GCCKYZC.js";import{a as p}from"./chunk-CBLKARLC.js";import{f as a}from"./chunk-EWC7I6UD.js";import"./chunk-52LSX2V5.js";export{c as Actions,l as AgentDeliveryError,n as AgentEventEnum,d as Button,e as Card,f as CardLink,g as CardText,b as Client,a as CronExpression,h as Divider,o as NovuRequestHandler,i as Select,j as SelectOption,q as SeverityLevelEnum,k as TextInput,m as agent,p as providerSchemas,s as step,r as workflow};
|
|
@@ -1,6 +1,6 @@
|
|
|
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 DiscoverAgentOutput, e as DiscoverOutput, f as DiscoverProviderOutput, g as DiscoverStepOutput, h as DiscoverWorkflowOutput, i as Event, j as EventTriggerParams, k as EventTriggerResponse, l as EventTriggerResult, m as Execute, E as ExecuteInput, n as ExecuteOutput, o as ExecuteOutputMetadata, p as ExecuteOutputOptions, G as GetActionEnum, H as HealthCheck, S as SeverityLevelEnum, q as State, r as StepType, W as Workflow, s as WorkflowChannelEnum, t as WorkflowOptions, u as WorkflowPreference, v as WorkflowPreferences } from '../health-check.types-
|
|
3
|
-
export { i as ActionStep, A as ActionStepEnum, g as Awaitable, j as ChannelStep, f as ChannelStepEnum, k as ChatOutput, l as ChatOutputUnvalidated, m as ChatResult, c as ConditionalPartial, b as ContextPayload, C as ContextResolved, n as ContextValue, o as CustomStep, D as DeepPartial, q as DeepRequired, r as DelayDynamicOutput, s as DelayDynamicOutputUnvalidated, t as DelayOutput, u as DelayOutputUnvalidated, v as DelayRegularOutput, w as DelayRegularOutputUnvalidated, x as DelayResult, y as DelayTimedOutput, z as DelayTimedOutputUnvalidated, B as DigestOutput, F as DigestOutputUnvalidated, G as DigestRegularOutput, H as DigestRegularOutputUnvalidated, I as DigestResult, J as DigestTimedOutput, K as DigestTimedOutputUnvalidated, a as Either, L as EmailOutput, M as EmailOutputUnvalidated, N as EmailResult, E as EnvironmentSystemVariables, O as InAppOutput, Q as InAppOutputUnvalidated, R as InAppResult, T as Indexable, U as JobStatusEnum, V as PickOptional, X as PickOptionalKeys, Y as PickRequired, P as PickRequiredKeys, e as Prettify, Z as PushOutput, _ as PushOutputUnvalidated, $ as PushResult, a0 as Skip, a1 as SmsOutput, a2 as SmsOutputUnvalidated, a3 as SmsResult, d as Step, a4 as StepContext, h as StepOptions, a5 as StepOutput, S as Subscriber, a6 as ThrottleOutput, a7 as ThrottleOutputUnvalidated, a8 as ThrottleResult, a9 as actionStepSchemas, aa as channelStepSchemas } from '../subscriber.types-
|
|
1
|
+
import { P as PostActionEnum } from '../health-check.types-C5lg4csi.js';
|
|
2
|
+
export { b as CancelEventTriggerResponse, c as ChannelPreference, C as ClientOptions, d as CodeResult, a as CronExpression, D as DiscoverAgentOutput, e as DiscoverOutput, f as DiscoverProviderOutput, g as DiscoverStepOutput, h as DiscoverWorkflowOutput, i as Event, j as EventTriggerParams, k as EventTriggerResponse, l as EventTriggerResult, m as Execute, E as ExecuteInput, n as ExecuteOutput, o as ExecuteOutputMetadata, p as ExecuteOutputOptions, G as GetActionEnum, H as HealthCheck, S as SeverityLevelEnum, q as State, r as StepType, W as Workflow, s as WorkflowChannelEnum, t as WorkflowOptions, u as WorkflowPreference, v as WorkflowPreferences } from '../health-check.types-C5lg4csi.js';
|
|
3
|
+
export { i as ActionStep, A as ActionStepEnum, g as Awaitable, j as ChannelStep, f as ChannelStepEnum, k as ChatOutput, l as ChatOutputUnvalidated, m as ChatResult, c as ConditionalPartial, b as ContextPayload, C as ContextResolved, n as ContextValue, o as CustomStep, D as DeepPartial, q as DeepRequired, r as DelayDynamicOutput, s as DelayDynamicOutputUnvalidated, t as DelayOutput, u as DelayOutputUnvalidated, v as DelayRegularOutput, w as DelayRegularOutputUnvalidated, x as DelayResult, y as DelayTimedOutput, z as DelayTimedOutputUnvalidated, B as DigestOutput, F as DigestOutputUnvalidated, G as DigestRegularOutput, H as DigestRegularOutputUnvalidated, I as DigestResult, J as DigestTimedOutput, K as DigestTimedOutputUnvalidated, a as Either, L as EmailOutput, M as EmailOutputUnvalidated, N as EmailResult, E as EnvironmentSystemVariables, O as InAppOutput, Q as InAppOutputUnvalidated, R as InAppResult, T as Indexable, U as JobStatusEnum, V as PickOptional, X as PickOptionalKeys, Y as PickRequired, P as PickRequiredKeys, e as Prettify, Z as PushOutput, _ as PushOutputUnvalidated, $ as PushResult, a0 as Skip, a1 as SmsOutput, a2 as SmsOutputUnvalidated, a3 as SmsResult, d as Step, a4 as StepContext, h as StepOptions, a5 as StepOutput, S as Subscriber, a6 as ThrottleOutput, a7 as ThrottleOutputUnvalidated, a8 as ThrottleResult, a9 as actionStepSchemas, aa as channelStepSchemas } from '../subscriber.types-CbMgjzR-.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';
|
|
6
6
|
export { S as SupportedFrameworkName } from '../server.types-BRWsA1CA.js';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { S as ServeHandlerOptions } from '../index-
|
|
2
|
-
export { A as Agent, a as
|
|
3
|
-
export { C as ClientOptions, a as CronExpression, E as ExecuteInput, S as SeverityLevelEnum, W as Workflow } from '../health-check.types-
|
|
4
|
-
export { C as ContextResolved, E as EnvironmentSystemVariables, S as Subscriber, p as providerSchemas } from '../subscriber.types-
|
|
1
|
+
import { S as ServeHandlerOptions } from '../index-DCSlowxV.js';
|
|
2
|
+
export { A as Agent, a as AgentAction, b as AgentAttachment, c as AgentBridgeRequest, d as AgentContext, e as AgentConversation, f as AgentDeliveryError, g as AgentEventEnum, h as AgentHandlers, i as AgentHistoryEntry, j as AgentMessage, k as AgentMessageAuthor, l as AgentPlatformContext, m as AgentReaction, n as AgentReplyPayload, o as AgentSubscriber, C as Client, E as EditPayload, F as FileRef, M as MessageContent, p as MetadataSignal, N as NovuRequestHandler, R as ReplyContent, q as ReplyHandle, r as SentMessageInfo, s as Signal, T as TriggerSignal, t as agent, w as workflow } from '../index-DCSlowxV.js';
|
|
3
|
+
export { C as ClientOptions, a as CronExpression, E as ExecuteInput, S as SeverityLevelEnum, W as Workflow } from '../health-check.types-C5lg4csi.js';
|
|
4
|
+
export { C as ContextResolved, E as EnvironmentSystemVariables, S as Subscriber, p as providerSchemas } from '../subscriber.types-CbMgjzR-.js';
|
|
5
5
|
import { S as SupportedFrameworkName } from '../server.types-BRWsA1CA.js';
|
|
6
6
|
export { Actions, Button, Card, CardChild, CardElement, CardLink, CardText, Divider, Select, SelectOption, TextInput } from 'chat';
|
|
7
7
|
export { AnyStepResolver, ChatStepResolver, EmailStepResolver, InAppStepResolver, PushStepResolver, SmsStepResolver, StepResolverContext, step } from '../step-resolver.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as h,c,d as m,e as f,f as H,g as v,h as w,i as E,j as S,k as x,l as A,m as
|
|
1
|
+
import{b as h,c,d as m,e as f,f as H,g as v,h as w,i as E,j as S,k as x,l as A,m as N,n as R,o as a,p as k}from"../chunk-CBVFNQC3.js";import"../chunk-T2VIX2ZH.js";import{a as O}from"../chunk-2M25EATE.js";import"../chunk-U3IL7QCI.js";import{O as b}from"../chunk-6GCCKYZC.js";import{a as V}from"../chunk-CBLKARLC.js";import{f as y}from"../chunk-EWC7I6UD.js";import"../chunk-52LSX2V5.js";var l="express",F=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{c as Actions,A as AgentDeliveryError,R as AgentEventEnum,m as Button,f as Card,H as CardLink,v as CardText,h as Client,y as CronExpression,w as Divider,a as NovuRequestHandler,E as Select,S as SelectOption,b as SeverityLevelEnum,x as TextInput,N as agent,l as frameworkName,V as providerSchemas,F as serve,O as step,k as workflow};
|
package/dist/esm/servers/h3.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import * as h3 from 'h3';
|
|
2
2
|
import { H3Event } from 'h3';
|
|
3
|
-
import { S as ServeHandlerOptions } from '../index-
|
|
4
|
-
export { A as Agent, a as
|
|
5
|
-
export { C as ClientOptions, a as CronExpression, E as ExecuteInput, S as SeverityLevelEnum, W as Workflow } from '../health-check.types-
|
|
6
|
-
export { C as ContextResolved, E as EnvironmentSystemVariables, S as Subscriber, p as providerSchemas } from '../subscriber.types-
|
|
3
|
+
import { S as ServeHandlerOptions } from '../index-DCSlowxV.js';
|
|
4
|
+
export { A as Agent, a as AgentAction, b as AgentAttachment, c as AgentBridgeRequest, d as AgentContext, e as AgentConversation, f as AgentDeliveryError, g as AgentEventEnum, h as AgentHandlers, i as AgentHistoryEntry, j as AgentMessage, k as AgentMessageAuthor, l as AgentPlatformContext, m as AgentReaction, n as AgentReplyPayload, o as AgentSubscriber, C as Client, E as EditPayload, F as FileRef, M as MessageContent, p as MetadataSignal, N as NovuRequestHandler, R as ReplyContent, q as ReplyHandle, r as SentMessageInfo, s as Signal, T as TriggerSignal, t as agent, w as workflow } from '../index-DCSlowxV.js';
|
|
5
|
+
export { C as ClientOptions, a as CronExpression, E as ExecuteInput, S as SeverityLevelEnum, W as Workflow } from '../health-check.types-C5lg4csi.js';
|
|
6
|
+
export { C as ContextResolved, E as EnvironmentSystemVariables, S as Subscriber, p as providerSchemas } from '../subscriber.types-CbMgjzR-.js';
|
|
7
7
|
import { S as SupportedFrameworkName } from '../server.types-BRWsA1CA.js';
|
|
8
8
|
export { Actions, Button, Card, CardChild, CardElement, CardLink, CardText, Divider, Select, SelectOption, TextInput } from 'chat';
|
|
9
9
|
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 H,d as S,e as i,f,g,h as N,i as w,j as c,k as E,l as k,m as
|
|
1
|
+
import{b as y,c as H,d as S,e as i,f,g,h as N,i as w,j as c,k as E,l as k,m as x,n as O,o as t,p as F}from"../chunk-CBVFNQC3.js";import"../chunk-T2VIX2ZH.js";import{a as $}from"../chunk-2M25EATE.js";import"../chunk-U3IL7QCI.js";import{O as q}from"../chunk-6GCCKYZC.js";import{a as b}from"../chunk-CBLKARLC.js";import{f as l}from"../chunk-EWC7I6UD.js";import"../chunk-52LSX2V5.js";import{getHeader as o,getQuery as a,readBody as p,send as n,setHeaders as m}from"h3";var h="h3",D=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{H as Actions,k as AgentDeliveryError,O as AgentEventEnum,S as Button,i as Card,f as CardLink,g as CardText,y as Client,l as CronExpression,N as Divider,t as NovuRequestHandler,w as Select,c as SelectOption,q as SeverityLevelEnum,E as TextInput,x as agent,h as frameworkName,b as providerSchemas,D as serve,$ as step,F as workflow};
|