@ever-works/novu-channel-plugin 1.0.0 → 1.0.5

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.
@@ -0,0 +1,37 @@
1
+ import { INotificationChannelPlugin, PluginCategory, ChannelShape, JsonSchema, ChannelTargetConfig, ChannelOptions, ChannelVerification, ChannelSendInput, ChannelSendResult } from '@ever-works/plugin';
2
+
3
+ /**
4
+ * Novu notification channel — delegates to a Novu workflow via the
5
+ * Trigger API (raw fetch; no `@novu/node` runtime dep). Novu fans the
6
+ * event out across its own configured channel steps (in-app, email,
7
+ * SMS, push, chat), so this plugin's `shape` is `workflow`.
8
+ *
9
+ * The `text` plus any `novu-payload` rich content is merged into the
10
+ * trigger `payload`, available to the workflow's step templates.
11
+ */
12
+ declare class NovuChannelPlugin implements INotificationChannelPlugin {
13
+ readonly id = "novu-channel";
14
+ readonly name = "Novu";
15
+ readonly version = "1.0.0";
16
+ readonly category: PluginCategory;
17
+ readonly capabilities: readonly ["notification-channel", "notification-channel-novu"];
18
+ readonly shape: ChannelShape;
19
+ readonly settingsSchema: JsonSchema;
20
+ onLoad(): Promise<void>;
21
+ onUnload(): Promise<void>;
22
+ private readonly idempotencyCache;
23
+ private apiBase;
24
+ /**
25
+ * Security (SSRF): build the absolute Novu API URL from the
26
+ * tenant-controlled `apiBase` and reject it if the destination host is a
27
+ * literal private/loopback/link-local/cloud-metadata IP or a non-HTTP(S)
28
+ * scheme before any request (and the API key) leaves the process. Mirrors
29
+ * `MakeClient.buildUrl()`.
30
+ */
31
+ private safeNovuUrl;
32
+ verifyTarget(config: ChannelTargetConfig, options: ChannelOptions): Promise<ChannelVerification>;
33
+ send(payload: ChannelSendInput, options: ChannelOptions): Promise<ChannelSendResult>;
34
+ }
35
+ declare const novuChannelPlugin: NovuChannelPlugin;
36
+
37
+ export { NovuChannelPlugin, novuChannelPlugin };
@@ -0,0 +1,37 @@
1
+ import { INotificationChannelPlugin, PluginCategory, ChannelShape, JsonSchema, ChannelTargetConfig, ChannelOptions, ChannelVerification, ChannelSendInput, ChannelSendResult } from '@ever-works/plugin';
2
+
3
+ /**
4
+ * Novu notification channel — delegates to a Novu workflow via the
5
+ * Trigger API (raw fetch; no `@novu/node` runtime dep). Novu fans the
6
+ * event out across its own configured channel steps (in-app, email,
7
+ * SMS, push, chat), so this plugin's `shape` is `workflow`.
8
+ *
9
+ * The `text` plus any `novu-payload` rich content is merged into the
10
+ * trigger `payload`, available to the workflow's step templates.
11
+ */
12
+ declare class NovuChannelPlugin implements INotificationChannelPlugin {
13
+ readonly id = "novu-channel";
14
+ readonly name = "Novu";
15
+ readonly version = "1.0.0";
16
+ readonly category: PluginCategory;
17
+ readonly capabilities: readonly ["notification-channel", "notification-channel-novu"];
18
+ readonly shape: ChannelShape;
19
+ readonly settingsSchema: JsonSchema;
20
+ onLoad(): Promise<void>;
21
+ onUnload(): Promise<void>;
22
+ private readonly idempotencyCache;
23
+ private apiBase;
24
+ /**
25
+ * Security (SSRF): build the absolute Novu API URL from the
26
+ * tenant-controlled `apiBase` and reject it if the destination host is a
27
+ * literal private/loopback/link-local/cloud-metadata IP or a non-HTTP(S)
28
+ * scheme before any request (and the API key) leaves the process. Mirrors
29
+ * `MakeClient.buildUrl()`.
30
+ */
31
+ private safeNovuUrl;
32
+ verifyTarget(config: ChannelTargetConfig, options: ChannelOptions): Promise<ChannelVerification>;
33
+ send(payload: ChannelSendInput, options: ChannelOptions): Promise<ChannelSendResult>;
34
+ }
35
+ declare const novuChannelPlugin: NovuChannelPlugin;
36
+
37
+ export { NovuChannelPlugin, novuChannelPlugin };