@ever-works/whatsapp-channel-plugin 1.0.0 → 1.0.4
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/index.cjs +960 -0
- package/dist/index.d.cts +30 -0
- package/dist/index.d.ts +30 -0
- package/dist/index.js +957 -0
- package/package.json +79 -69
- package/LICENSE +0 -661
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { INotificationChannelPlugin, PluginCategory, ChannelShape, JsonSchema, ChannelTargetConfig, ChannelOptions, ChannelVerification, ChannelSendInput, ChannelSendResult } from '@ever-works/plugin';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* WhatsApp notification channel — sends via the WhatsApp Business
|
|
5
|
+
* Cloud API.
|
|
6
|
+
*
|
|
7
|
+
* WhatsApp enforces a 24-hour customer-service window: free-form `text`
|
|
8
|
+
* messages are only deliverable within 24h of the user's last message.
|
|
9
|
+
* Outside that window you MUST send a pre-approved `template`. Callers
|
|
10
|
+
* that need guaranteed delivery should supply the `whatsapp-template`
|
|
11
|
+
* rich payload kind; plain `text` is best-effort (in-window).
|
|
12
|
+
*/
|
|
13
|
+
declare class WhatsappChannelPlugin implements INotificationChannelPlugin {
|
|
14
|
+
readonly id = "whatsapp-channel";
|
|
15
|
+
readonly name = "WhatsApp";
|
|
16
|
+
readonly version = "1.0.0";
|
|
17
|
+
readonly category: PluginCategory;
|
|
18
|
+
readonly capabilities: readonly ["notification-channel", "notification-channel-whatsapp"];
|
|
19
|
+
readonly shape: ChannelShape;
|
|
20
|
+
readonly settingsSchema: JsonSchema;
|
|
21
|
+
onLoad(): Promise<void>;
|
|
22
|
+
onUnload(): Promise<void>;
|
|
23
|
+
private readonly idempotencyCache;
|
|
24
|
+
private apiVersion;
|
|
25
|
+
verifyTarget(config: ChannelTargetConfig, options: ChannelOptions): Promise<ChannelVerification>;
|
|
26
|
+
send(payload: ChannelSendInput, options: ChannelOptions): Promise<ChannelSendResult>;
|
|
27
|
+
}
|
|
28
|
+
declare const whatsappChannelPlugin: WhatsappChannelPlugin;
|
|
29
|
+
|
|
30
|
+
export { WhatsappChannelPlugin, whatsappChannelPlugin };
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { INotificationChannelPlugin, PluginCategory, ChannelShape, JsonSchema, ChannelTargetConfig, ChannelOptions, ChannelVerification, ChannelSendInput, ChannelSendResult } from '@ever-works/plugin';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* WhatsApp notification channel — sends via the WhatsApp Business
|
|
5
|
+
* Cloud API.
|
|
6
|
+
*
|
|
7
|
+
* WhatsApp enforces a 24-hour customer-service window: free-form `text`
|
|
8
|
+
* messages are only deliverable within 24h of the user's last message.
|
|
9
|
+
* Outside that window you MUST send a pre-approved `template`. Callers
|
|
10
|
+
* that need guaranteed delivery should supply the `whatsapp-template`
|
|
11
|
+
* rich payload kind; plain `text` is best-effort (in-window).
|
|
12
|
+
*/
|
|
13
|
+
declare class WhatsappChannelPlugin implements INotificationChannelPlugin {
|
|
14
|
+
readonly id = "whatsapp-channel";
|
|
15
|
+
readonly name = "WhatsApp";
|
|
16
|
+
readonly version = "1.0.0";
|
|
17
|
+
readonly category: PluginCategory;
|
|
18
|
+
readonly capabilities: readonly ["notification-channel", "notification-channel-whatsapp"];
|
|
19
|
+
readonly shape: ChannelShape;
|
|
20
|
+
readonly settingsSchema: JsonSchema;
|
|
21
|
+
onLoad(): Promise<void>;
|
|
22
|
+
onUnload(): Promise<void>;
|
|
23
|
+
private readonly idempotencyCache;
|
|
24
|
+
private apiVersion;
|
|
25
|
+
verifyTarget(config: ChannelTargetConfig, options: ChannelOptions): Promise<ChannelVerification>;
|
|
26
|
+
send(payload: ChannelSendInput, options: ChannelOptions): Promise<ChannelSendResult>;
|
|
27
|
+
}
|
|
28
|
+
declare const whatsappChannelPlugin: WhatsappChannelPlugin;
|
|
29
|
+
|
|
30
|
+
export { WhatsappChannelPlugin, whatsappChannelPlugin };
|