@wabot-dev/framework 0.5.8 → 0.5.9
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/src/addon/chat-controller/cmd/CmdChannel.js +6 -2
- package/dist/src/addon/chat-controller/cmd/cmdChannelName.js +3 -0
- package/dist/src/addon/chat-controller/socket/SocketChannel.js +6 -2
- package/dist/src/addon/chat-controller/socket/socketChannelName.js +3 -0
- package/dist/src/addon/chat-controller/telegram/TelegramChannel.js +6 -2
- package/dist/src/addon/chat-controller/telegram/telegramChannelName.js +3 -0
- package/dist/src/addon/chat-controller/wasender/WasenderWebhookController.js +8 -16
- package/dist/src/addon/chat-controller/wasender/WhatsAppByWasenderChannel.js +14 -5
- package/dist/src/addon/chat-controller/wasender/whatsAppByWasenderChannelName.js +3 -0
- package/dist/src/addon/chat-controller/whatsapp/WhatsAppChannel.js +3 -0
- package/dist/src/addon/chat-controller/whatsapp/cloud-api/WhatsAppReceiverByCloudApi.js +2 -2
- package/dist/src/addon/chat-controller/whatsapp/proxy/WhatsAppReceiverByWabotProxy.js +2 -1
- package/dist/src/addon/chat-controller/whatsapp/whatsAppChannelName.js +3 -0
- package/dist/src/index.d.ts +74 -7
- package/dist/src/index.js +5 -0
- package/package.json +1 -1
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { __decorate, __metadata } from 'tslib';
|
|
2
2
|
import { injectable } from '../../../core/injection/index.js';
|
|
3
3
|
import { Logger } from '../../../core/logger/Logger.js';
|
|
4
|
+
import { cmdChannelName } from './cmdChannelName.js';
|
|
4
5
|
import * as readline from 'readline';
|
|
5
6
|
import * as fs from 'fs';
|
|
6
7
|
import * as path from 'path';
|
|
@@ -10,13 +11,15 @@ import { Auth } from '../../../core/auth/Auth.js';
|
|
|
10
11
|
var CmdChannel_1;
|
|
11
12
|
const chatIdPath = '.cmd-channel/id.json';
|
|
12
13
|
const authInfoPath = '.cmd-channel/auth-info.json';
|
|
13
|
-
let CmdChannel =
|
|
14
|
+
let CmdChannel = class CmdChannel {
|
|
15
|
+
static { CmdChannel_1 = this; }
|
|
14
16
|
auth;
|
|
15
17
|
chatId = undefined;
|
|
16
18
|
rl = readline.createInterface({
|
|
17
19
|
input: process.stdin,
|
|
18
20
|
output: process.stdout,
|
|
19
21
|
});
|
|
22
|
+
static channelName = cmdChannelName;
|
|
20
23
|
callBack = null;
|
|
21
24
|
constructor(auth) {
|
|
22
25
|
this.auth = auth;
|
|
@@ -50,7 +53,7 @@ let CmdChannel = CmdChannel_1 = class CmdChannel {
|
|
|
50
53
|
const chatConnection = {
|
|
51
54
|
id: this.chatId,
|
|
52
55
|
chatType: 'PRIVATE',
|
|
53
|
-
channelName: CmdChannel_1.
|
|
56
|
+
channelName: CmdChannel_1.channelName,
|
|
54
57
|
};
|
|
55
58
|
if (!this.callBack)
|
|
56
59
|
return;
|
|
@@ -61,6 +64,7 @@ let CmdChannel = CmdChannel_1 = class CmdChannel {
|
|
|
61
64
|
}
|
|
62
65
|
}
|
|
63
66
|
await this.callBack({
|
|
67
|
+
channel: cmdChannelName,
|
|
64
68
|
chatConnection,
|
|
65
69
|
message: {
|
|
66
70
|
text: trimmedInput,
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { __decorate, __metadata } from 'tslib';
|
|
2
2
|
import { injectable } from '../../../core/injection/index.js';
|
|
3
|
+
import { socketChannelName } from './socketChannelName.js';
|
|
3
4
|
import { handshakeMiddlewares } from '../../../feature/socket-controller/metadata/@handshakeMiddlewares.js';
|
|
4
5
|
import { socketController } from '../../../feature/socket-controller/metadata/@socketController.js';
|
|
5
6
|
import { onSocketEvent } from '../../../feature/socket-controller/metadata/@onSocketEvent.js';
|
|
@@ -33,8 +34,10 @@ __decorate([
|
|
|
33
34
|
isNotEmpty(),
|
|
34
35
|
__metadata("design:type", String)
|
|
35
36
|
], SocketChannelReceivedMessage.prototype, "text", void 0);
|
|
36
|
-
let SocketChannel =
|
|
37
|
+
let SocketChannel = class SocketChannel {
|
|
38
|
+
static { SocketChannel_1 = this; }
|
|
37
39
|
config;
|
|
40
|
+
static channelName = socketChannelName;
|
|
38
41
|
callBack = null;
|
|
39
42
|
controller = null;
|
|
40
43
|
constructor(config) {
|
|
@@ -58,9 +61,10 @@ let SocketChannel = SocketChannel_1 = class SocketChannel {
|
|
|
58
61
|
const chatConnection = {
|
|
59
62
|
id: message.chatId,
|
|
60
63
|
chatType: 'PRIVATE',
|
|
61
|
-
channelName: SocketChannel_1.
|
|
64
|
+
channelName: SocketChannel_1.channelName,
|
|
62
65
|
};
|
|
63
66
|
await channel.callBack({
|
|
67
|
+
channel: socketChannelName,
|
|
64
68
|
chatConnection,
|
|
65
69
|
message: {
|
|
66
70
|
text: message.text,
|
|
@@ -2,10 +2,13 @@ import { __decorate, __metadata } from 'tslib';
|
|
|
2
2
|
import { Bot } from 'grammy';
|
|
3
3
|
import { TelegramChannelConfig } from './TelegramChannelConfig.js';
|
|
4
4
|
import { injectable } from '../../../core/injection/index.js';
|
|
5
|
+
import { telegramChannelName } from './telegramChannelName.js';
|
|
5
6
|
|
|
6
7
|
var TelegramChannel_1;
|
|
7
|
-
let TelegramChannel =
|
|
8
|
+
let TelegramChannel = class TelegramChannel {
|
|
9
|
+
static { TelegramChannel_1 = this; }
|
|
8
10
|
config;
|
|
11
|
+
static channelName = telegramChannelName;
|
|
9
12
|
bot;
|
|
10
13
|
constructor(config) {
|
|
11
14
|
this.config = config;
|
|
@@ -19,9 +22,10 @@ let TelegramChannel = TelegramChannel_1 = class TelegramChannel {
|
|
|
19
22
|
const chatConnection = {
|
|
20
23
|
id: ctx.message.chat.id.toString(),
|
|
21
24
|
chatType: ctx.message.chat.type === 'private' ? 'PRIVATE' : 'GROUP',
|
|
22
|
-
channelName: TelegramChannel_1.
|
|
25
|
+
channelName: TelegramChannel_1.channelName,
|
|
23
26
|
};
|
|
24
27
|
await callback({
|
|
28
|
+
channel: telegramChannelName,
|
|
25
29
|
chatConnection,
|
|
26
30
|
message: {
|
|
27
31
|
senderName: ctx.from.first_name,
|
|
@@ -30,27 +30,19 @@ class WasenderWebhookController {
|
|
|
30
30
|
}
|
|
31
31
|
}
|
|
32
32
|
async handleMessages(messages) {
|
|
33
|
-
if (!this.listener) {
|
|
34
|
-
this.logger.warn('No listener registered, ignoring messages');
|
|
35
|
-
return;
|
|
36
|
-
}
|
|
37
33
|
for (const message of messages) {
|
|
38
|
-
const
|
|
34
|
+
const rawNumber = extractNumberFromWasenderMessageKey(message.key);
|
|
35
|
+
const from = rawNumber.startsWith('+') ? rawNumber : `+${rawNumber}`;
|
|
39
36
|
this.logger.trace(`new message from '${from}'`);
|
|
40
37
|
if (message.message.conversation) {
|
|
41
|
-
const chatConnection = {
|
|
42
|
-
chatType: 'PRIVATE',
|
|
43
|
-
channelName: 'WhatsAppByWasenderChannel',
|
|
44
|
-
id: from,
|
|
45
|
-
};
|
|
46
38
|
await this.listener({
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
39
|
+
text: message.message.conversation,
|
|
40
|
+
senderName: message.pushName,
|
|
41
|
+
senderId: from,
|
|
42
|
+
metadata: {
|
|
43
|
+
whatsAppNumber: from,
|
|
52
44
|
},
|
|
53
|
-
});
|
|
45
|
+
}, from);
|
|
54
46
|
}
|
|
55
47
|
}
|
|
56
48
|
}
|
|
@@ -5,12 +5,16 @@ import { Logger } from '../../../core/logger/Logger.js';
|
|
|
5
5
|
import { WhatsAppByWasenderChannelConfig } from './WhatsAppByWasenderChannelConfig.js';
|
|
6
6
|
import { WhatsAppReceiverByWasender } from './WhatsAppReceiverByWasender.js';
|
|
7
7
|
import { WhatsAppSenderByWasender } from './WhatsAppSenderByWasender.js';
|
|
8
|
+
import { whatsAppByWasenderChannelName } from './whatsAppByWasenderChannelName.js';
|
|
8
9
|
|
|
10
|
+
var WhatsAppByWasenderChannel_1;
|
|
9
11
|
let WhatsAppByWasenderChannel = class WhatsAppByWasenderChannel {
|
|
12
|
+
static { WhatsAppByWasenderChannel_1 = this; }
|
|
10
13
|
logger = new Logger('wabot:whatsapp-by-wasender-channel');
|
|
11
14
|
sender;
|
|
12
15
|
receiver;
|
|
13
16
|
phoneNumber;
|
|
17
|
+
static channelName = whatsAppByWasenderChannelName;
|
|
14
18
|
constructor(config, env) {
|
|
15
19
|
const apiKey = config.apiKey ?? env.requireString('WASENDER_API_KEY');
|
|
16
20
|
const webhookSecret = config.webhookSecret ?? env.requireString('WASENDER_WEBHOOK_SECRET');
|
|
@@ -24,15 +28,20 @@ let WhatsAppByWasenderChannel = class WhatsAppByWasenderChannel {
|
|
|
24
28
|
});
|
|
25
29
|
}
|
|
26
30
|
listen(callback) {
|
|
27
|
-
this.receiver.listenMessage(async (message) => {
|
|
31
|
+
this.receiver.listenMessage(async (message, from) => {
|
|
28
32
|
try {
|
|
29
33
|
await callback({
|
|
30
|
-
|
|
31
|
-
|
|
34
|
+
channel: whatsAppByWasenderChannelName,
|
|
35
|
+
chatConnection: {
|
|
36
|
+
chatType: 'PRIVATE',
|
|
37
|
+
channelName: WhatsAppByWasenderChannel_1.channelName,
|
|
38
|
+
id: from,
|
|
39
|
+
},
|
|
40
|
+
message,
|
|
32
41
|
reply: async (replyMessage) => {
|
|
33
42
|
await this.sender.send({
|
|
34
43
|
from: this.phoneNumber,
|
|
35
|
-
to:
|
|
44
|
+
to: from,
|
|
36
45
|
message: replyMessage,
|
|
37
46
|
});
|
|
38
47
|
},
|
|
@@ -50,7 +59,7 @@ let WhatsAppByWasenderChannel = class WhatsAppByWasenderChannel {
|
|
|
50
59
|
this.receiver.disconnect();
|
|
51
60
|
}
|
|
52
61
|
};
|
|
53
|
-
WhatsAppByWasenderChannel = __decorate([
|
|
62
|
+
WhatsAppByWasenderChannel = WhatsAppByWasenderChannel_1 = __decorate([
|
|
54
63
|
injectable(),
|
|
55
64
|
__metadata("design:paramtypes", [WhatsAppByWasenderChannelConfig, Env])
|
|
56
65
|
], WhatsAppByWasenderChannel);
|
|
@@ -4,11 +4,13 @@ import { Logger } from '../../../core/logger/Logger.js';
|
|
|
4
4
|
import { WhatsappChannelConfig } from './WhatsAppChannelConfig.js';
|
|
5
5
|
import { WhatsAppReceiver } from './WhatsAppReceiver.js';
|
|
6
6
|
import { WhatsAppSender } from './WhatsAppSender.js';
|
|
7
|
+
import { whatsAppChannelName } from './whatsAppChannelName.js';
|
|
7
8
|
|
|
8
9
|
let WhatsAppChannel = class WhatsAppChannel {
|
|
9
10
|
config;
|
|
10
11
|
sender;
|
|
11
12
|
receiver;
|
|
13
|
+
static channelName = whatsAppChannelName;
|
|
12
14
|
logger = new Logger('wabot:whatsapp-channel');
|
|
13
15
|
constructor(config, sender, receiver) {
|
|
14
16
|
this.config = config;
|
|
@@ -21,6 +23,7 @@ let WhatsAppChannel = class WhatsAppChannel {
|
|
|
21
23
|
listener: async (message) => {
|
|
22
24
|
try {
|
|
23
25
|
await callback({
|
|
26
|
+
channel: whatsAppChannelName,
|
|
24
27
|
chatConnection: message.chatConnection,
|
|
25
28
|
message: message.message,
|
|
26
29
|
reply: async (replyMessage) => {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Logger } from '../../../../core/logger/Logger.js';
|
|
2
|
+
import { whatsAppChannelName } from '../whatsAppChannelName.js';
|
|
2
3
|
import { json } from 'express';
|
|
3
4
|
import { WhatsAppReceiver } from '../WhatsAppReceiver.js';
|
|
4
5
|
|
|
@@ -78,11 +79,10 @@ class WhatsAppReceiverByCloudApi extends WhatsAppReceiver {
|
|
|
78
79
|
this.logger.warn(`Message type '${message.type}' is not supported yet`);
|
|
79
80
|
return;
|
|
80
81
|
}
|
|
81
|
-
const channelName = 'WhatsAppChannel';
|
|
82
82
|
const chatConnection = {
|
|
83
83
|
id: contact.wa_id,
|
|
84
84
|
chatType: 'PRIVATE',
|
|
85
|
-
channelName,
|
|
85
|
+
channelName: whatsAppChannelName,
|
|
86
86
|
};
|
|
87
87
|
await listener({
|
|
88
88
|
chatConnection,
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { __decorate, __metadata } from 'tslib';
|
|
2
2
|
import { WhatsAppReceiver } from '../WhatsAppReceiver.js';
|
|
3
|
+
import { whatsAppChannelName } from '../whatsAppChannelName.js';
|
|
3
4
|
import { injectable } from '../../../../core/injection/index.js';
|
|
4
5
|
import { Logger } from '../../../../core/logger/Logger.js';
|
|
5
6
|
import { WHATSAPP_MESSAGE_EVENT } from './WhatsAppProxyContracts.js';
|
|
@@ -45,7 +46,7 @@ let WhatsAppReceiverByWabotProxy = class WhatsAppReceiverByWabotProxy extends Wh
|
|
|
45
46
|
request.listener({
|
|
46
47
|
chatConnection: {
|
|
47
48
|
chatType: 'PRIVATE',
|
|
48
|
-
channelName:
|
|
49
|
+
channelName: whatsAppChannelName,
|
|
49
50
|
id: data.from,
|
|
50
51
|
},
|
|
51
52
|
message: {
|
package/dist/src/index.d.ts
CHANGED
|
@@ -1597,13 +1597,25 @@ declare class WabotChatAdapter implements IChatAdapter {
|
|
|
1597
1597
|
|
|
1598
1598
|
declare function cmd(): (target: object, propertyKey: string | symbol) => void;
|
|
1599
1599
|
|
|
1600
|
+
declare const cmdChannelName: "CmdChannel";
|
|
1601
|
+
|
|
1602
|
+
interface ICmdReceivedMessage extends IReceivedMessage {
|
|
1603
|
+
channel: typeof cmdChannelName;
|
|
1604
|
+
}
|
|
1605
|
+
|
|
1606
|
+
interface ICmdChannelMessage extends ICmdReceivedMessage {
|
|
1607
|
+
chatConnection: IChatConnection;
|
|
1608
|
+
injectInstances?: [any, any][];
|
|
1609
|
+
}
|
|
1610
|
+
|
|
1600
1611
|
declare class CmdChannel implements IChatChannel {
|
|
1601
1612
|
private auth;
|
|
1602
1613
|
private chatId;
|
|
1603
1614
|
private rl;
|
|
1615
|
+
static channelName: "CmdChannel";
|
|
1604
1616
|
private callBack;
|
|
1605
1617
|
constructor(auth: Auth<any>);
|
|
1606
|
-
listen(callback: (message:
|
|
1618
|
+
listen(callback: (message: ICmdChannelMessage) => Promise<void>): void;
|
|
1607
1619
|
disconnect(): void;
|
|
1608
1620
|
connect(): void;
|
|
1609
1621
|
}
|
|
@@ -1623,6 +1635,17 @@ declare class SocketChannelConfig implements ISocketChannelConfig {
|
|
|
1623
1635
|
|
|
1624
1636
|
declare function socket(config: SocketChannelConfig): (target: object, propertyKey: string | symbol) => void;
|
|
1625
1637
|
|
|
1638
|
+
declare const socketChannelName: "SocketChannel";
|
|
1639
|
+
|
|
1640
|
+
interface ISocketReceivedMessage extends IReceivedMessage {
|
|
1641
|
+
channel: typeof socketChannelName;
|
|
1642
|
+
}
|
|
1643
|
+
|
|
1644
|
+
interface ISocketChannelMessage extends ISocketReceivedMessage {
|
|
1645
|
+
chatConnection: IChatConnection;
|
|
1646
|
+
injectInstances?: [any, any][];
|
|
1647
|
+
}
|
|
1648
|
+
|
|
1626
1649
|
interface ISocketChannelReceivedMessage {
|
|
1627
1650
|
chatId: string;
|
|
1628
1651
|
senderName: string;
|
|
@@ -1635,11 +1658,12 @@ declare class SocketChannelReceivedMessage implements ISocketChannelReceivedMess
|
|
|
1635
1658
|
}
|
|
1636
1659
|
declare class SocketChannel implements IChatChannel {
|
|
1637
1660
|
private config;
|
|
1661
|
+
static channelName: "SocketChannel";
|
|
1638
1662
|
private callBack;
|
|
1639
1663
|
private controller;
|
|
1640
1664
|
constructor(config: SocketChannelConfig);
|
|
1641
1665
|
private configController;
|
|
1642
|
-
listen(callback: (message:
|
|
1666
|
+
listen(callback: (message: ISocketChannelMessage) => Promise<void>): void;
|
|
1643
1667
|
connect(): void;
|
|
1644
1668
|
disconnect(): void;
|
|
1645
1669
|
}
|
|
@@ -1654,11 +1678,23 @@ declare class TelegramChannelConfig implements ITelegramChannelConfig {
|
|
|
1654
1678
|
|
|
1655
1679
|
declare function telegram(config: ITelegramChannelConfig): (target: object, propertyKey: string | symbol) => void;
|
|
1656
1680
|
|
|
1681
|
+
declare const telegramChannelName: "TelegramChannel";
|
|
1682
|
+
|
|
1683
|
+
interface ITelegramReceivedMessage extends IReceivedMessage {
|
|
1684
|
+
channel: typeof telegramChannelName;
|
|
1685
|
+
}
|
|
1686
|
+
|
|
1687
|
+
interface ITelegramChannelMessage extends ITelegramReceivedMessage {
|
|
1688
|
+
chatConnection: IChatConnection;
|
|
1689
|
+
injectInstances?: [any, any][];
|
|
1690
|
+
}
|
|
1691
|
+
|
|
1657
1692
|
declare class TelegramChannel implements IChatChannel {
|
|
1658
1693
|
private config;
|
|
1694
|
+
static channelName: "TelegramChannel";
|
|
1659
1695
|
private bot;
|
|
1660
1696
|
constructor(config: TelegramChannelConfig);
|
|
1661
|
-
listen(callback: (message:
|
|
1697
|
+
listen(callback: (message: ITelegramChannelMessage) => Promise<void>): void;
|
|
1662
1698
|
connect(): void;
|
|
1663
1699
|
disconnect(): void;
|
|
1664
1700
|
}
|
|
@@ -1819,13 +1855,25 @@ declare class WhatsAppSender {
|
|
|
1819
1855
|
protected replaceTemplateParameters(template: string, data: IWhatsAppCloudTemplateParameter[]): string;
|
|
1820
1856
|
}
|
|
1821
1857
|
|
|
1858
|
+
declare const whatsAppChannelName: "WhatsAppChannel";
|
|
1859
|
+
|
|
1860
|
+
interface IWhatsAppReceivedMessage extends IReceivedMessage {
|
|
1861
|
+
channel: typeof whatsAppChannelName;
|
|
1862
|
+
}
|
|
1863
|
+
|
|
1864
|
+
interface IWhatsAppChannelMessage extends IWhatsAppReceivedMessage {
|
|
1865
|
+
chatConnection: IChatConnection;
|
|
1866
|
+
injectInstances?: [any, any][];
|
|
1867
|
+
}
|
|
1868
|
+
|
|
1822
1869
|
declare class WhatsAppChannel implements IChatChannel {
|
|
1823
1870
|
private config;
|
|
1824
1871
|
private sender;
|
|
1825
1872
|
private receiver;
|
|
1873
|
+
static channelName: "WhatsAppChannel";
|
|
1826
1874
|
private logger;
|
|
1827
1875
|
constructor(config: WhatsappChannelConfig, sender: WhatsAppSender, receiver: WhatsAppReceiver);
|
|
1828
|
-
listen(callback: (message:
|
|
1876
|
+
listen(callback: (message: IWhatsAppChannelMessage) => Promise<void>): void;
|
|
1829
1877
|
connect(): void;
|
|
1830
1878
|
disconnect(): void;
|
|
1831
1879
|
}
|
|
@@ -2029,18 +2077,37 @@ declare class WhatsAppByWasenderChannelConfig implements IWhatsAppByWasenderChan
|
|
|
2029
2077
|
constructor(config: IWhatsAppByWasenderChannelConfig);
|
|
2030
2078
|
}
|
|
2031
2079
|
|
|
2080
|
+
interface IWhatsAppByWasenderChatMessage extends IChatMessage {
|
|
2081
|
+
metadata: {
|
|
2082
|
+
whatsAppNumber: string;
|
|
2083
|
+
};
|
|
2084
|
+
}
|
|
2085
|
+
|
|
2086
|
+
declare const whatsAppByWasenderChannelName: "WhatsAppByWasenderChannel";
|
|
2087
|
+
|
|
2088
|
+
interface IWhatsAppByWasenderReceivedMessage extends IReceivedMessage {
|
|
2089
|
+
channel: typeof whatsAppByWasenderChannelName;
|
|
2090
|
+
message: IWhatsAppByWasenderChatMessage;
|
|
2091
|
+
}
|
|
2092
|
+
|
|
2093
|
+
interface IWhatsAppByWasenderChannelMessage extends IWhatsAppByWasenderReceivedMessage {
|
|
2094
|
+
chatConnection: IChatConnection;
|
|
2095
|
+
injectInstances?: [any, any][];
|
|
2096
|
+
}
|
|
2097
|
+
|
|
2032
2098
|
declare class WhatsAppByWasenderChannel implements IChatChannel {
|
|
2033
2099
|
private logger;
|
|
2034
2100
|
private sender;
|
|
2035
2101
|
private receiver;
|
|
2036
2102
|
private phoneNumber;
|
|
2103
|
+
static channelName: "WhatsAppByWasenderChannel";
|
|
2037
2104
|
constructor(config: WhatsAppByWasenderChannelConfig, env: Env);
|
|
2038
|
-
listen(callback: (message:
|
|
2105
|
+
listen(callback: (message: IWhatsAppByWasenderChannelMessage) => Promise<void>): void;
|
|
2039
2106
|
connect(): void;
|
|
2040
2107
|
disconnect(): void;
|
|
2041
2108
|
}
|
|
2042
2109
|
|
|
2043
|
-
type IWasenderChannelMessageListener = (message:
|
|
2110
|
+
type IWasenderChannelMessageListener = (message: IWhatsAppByWasenderChatMessage, from: string) => Promise<void>;
|
|
2044
2111
|
declare class WasenderWebhookController {
|
|
2045
2112
|
private wasender;
|
|
2046
2113
|
private listener;
|
|
@@ -2095,4 +2162,4 @@ declare function HtmlModule(options: IHtmlModuleOptions): {
|
|
|
2095
2162
|
new (): {};
|
|
2096
2163
|
};
|
|
2097
2164
|
|
|
2098
|
-
export { AnthropicChatAdapter, ApiKey, ApiKeyGuardMiddleware, ApiKeyHandshakeGuardMiddleware, ApiKeyRepository, Async, AsyncMetadataStore, Auth, Chat, ChatAdapter, ChatBot, ChatBotMetadataStore, ChatItem, ChatMemory, ChatRepository, ChatResolver, type ClientMap, CmdChannel, Container, ControllerMetadataStore, CronJob, CronJobRepository, CustomError, DeepSeekChatAdapter, DescriptionMetadataStore, EXPRESS_REQ, EXPRESS_RES, Entity, Env, EnvWhatsAppRepository, type ErrorSeverity, ExpressProvider, GoogleChatAdapter, type GoogleChatAdapterV2Options, HtmlModule, HttpServerProvider, type IApiKeyData, type IApiKeyRepository, type IArrayValidationError, type IArrayValidationResult, type IBotMessageItem, type IChannelMessage, type IChannelMetadata, type IChatAdapter, type IChatAdapterNextItemsReq, type IChatAdapterNextItemsRes, type IChatAssociation, type IChatBot, type IChatBotMetadata, type IChatChannel, type IChatConnection, type IChatControllerMetadata, type IChatData, type IChatItem, type IChatItemData, type IChatItemType, type IChatMemory, type IChatMessage, type IChatRepository, type IChatType, type ICommandConfig, type ICommandHandler, type ICommandHandlerConfig, type IConstructor, type ICronConfig, type ICronJobData, type ICrudRepository, type ICustomErrorData, type IDescriptionMetadata, type IEndPointConfig, type IEndPointMetadata, type IEntityData, type IEnvType, type IErrorHandlersConfig, type IErrorMonitor, type IErrorMonitorContext, type IFunctionCall, type IFunctionCallItem, type IGenerateApiKeyReq, type IGenerateApiKeyRes, type IGetWhatsAppTemplateRequest, type IHandshakeMiddleware, type IHandshakeMiddlewareMetadata, type IHtmlModuleOptions, type IHumanMessageItem, type IJobData, type IJobRepository, type IJwtRefreshTokenData, type IJwtRefreshTokenRepository, type ILanguageModelUsage, type IListenWhatsAppMessageRequest, type ILockKey, type ILocker, type ILockerKey, type IMessageContext, type IMiddleware, type IMiddlewareMetadata, type IMindset, type IMindsetConfig, type IMindsetIdentity, type IMindsetLlm, type IMindsetMetadata, type IMindsetModuleConfig, type IMindsetModuleMetadata, type IMindsetTool, type IMindsetToolParameter, type IModelValidationError, type IModelValidationResult, type IModelValidatorsInfo, type IMoneyData, type IPersistentData, type IPgRepositoryConfig, type IPropertyValidatorInfo, type IReceivedMessage, type IRemoteApiKeyFetcher, type IRestControllerConfig, type IRestControllerMetadata, type IScheduleAt, type IScheduleDelay, type ISendByWasenderRequest, type ISendWhatsAppRequest, type ISendWhatsAppTemplateRequest, type ISocketChannelConfig, type ISocketChannelReceivedMessage, type ISocketControllerConfig, type ISocketControllerMetadata, type ISocketEventConfig, type ISocketEventMetadata, type IStorableData, type ITelegramChannelConfig, type IValidateArrayOptions, type IValidateArrayOptionsWithItemsValidators, type IValidateInputShape, type IValidateIsInOptions, type IValidateIsRecordOptions, type IValidateMaxOptions, type IValidateMinOptions, type IValidationError, type IValidationResult, type IValidator, type IValidatorMetadata, type IWasenderChannelMessageListener, type IWasenderDeviceListMetadata, type IWasenderEvent, type IWasenderMessageContent, type IWasenderMessageContextInfo, type IWasenderMessageKey, type IWasenderMessageReceivedData, type IWasenderMessageReceivedEvent, type IWasenderQrUpdatedEvent, type IWhatsAppBusinessAccount, type IWhatsAppBusinessNumber, type IWhatsAppByWasenderChannelConfig, type IWhatsAppCloudContact, type IWhatsAppCloudMessage, type IWhatsAppCloudMessageMetadata, type IWhatsAppCloudTemplate, type IWhatsAppCloudTemplateComponent, type IWhatsAppCloudTemplateMessage, type IWhatsAppCloudTemplateParameter, type IWhatsAppCloudTemplateResponse, type IWhatsAppCloudWebhookPayload, type IWhatsAppData, type IWhatsAppMessageListener, type IWhatsAppProxyListenMessageEventData, type IWhatsAppProxyListenMessageEventReq, type IWhatsAppProxyMessage, type IWhatsAppProxyMessageContent, type IWhatsAppProxyMessageEventReq, type IWhatsAppProxySendMessageEventReq, type IWhatsAppRepository, type IWhatsAppSenderOptions, type IWhatsappChannelConfig, type IchatControllerConfig, Job, JobRepository, JobRunner, Jwt, JwtAccessAndRefreshTokenDto, JwtConfig, JwtGuardMiddleware, JwtHandshakeGuardMiddleware, JwtRefreshToken, JwtRefreshTokenRepository, JwtSigner, JwtTokenDto, Lifecycle, Locker, Logger, Mapper, Mindset, MindsetMetadataStore, MindsetOperator, Money, MoneyDto, OpenaiChatAdapter, Password, type PasswordHashOptions, Persistent, PgApiKeyRepository, PgChatMemory, PgChatRepository, PgCronJobRepository, PgCrudRepository, PgJobRepository, PgJwtRefreshTokenRepository, PgLockKey, PgLocker, PgRepositoryBase, PgWhatsAppRepository, RamChatMemory, RamChatRepository, Random, RemoteApiKeyRepository, RestControllerMetadataStore, RestRequest, SocketChannel, SocketChannelConfig, SocketChannelReceivedMessage, SocketControllerMetadataStore, SocketServerConfig, SocketServerProvider, Storable, TelegramChannel, TelegramChannelConfig, ValidationMetadataStore, WHATSAPP_MESSAGE_EVENT, WHATSAPP_PROXY_LISTEN_MESSAGE_EVENT, WHATSAPP_PROXY_SEND_MESSAGE_EVENT, WabotChatAdapter, WasenderWebhookController, WhatsApp, WhatsAppByWasenderChannel, WhatsAppByWasenderChannelConfig, WhatsAppChannel, WhatsAppReceiver, WhatsAppReceiverByCloudApi, WhatsAppReceiverByWabotProxy, WhatsAppReceiverByWasender, WhatsAppRepository, WhatsAppSender, WhatsAppSenderByCloudApi, WhatsAppSenderByWabotProxy, WhatsAppSenderByWasender, WhatsAppWabotProxyConnection, WhatsappChannelConfig, apiKeyGuard, apiKeyHandshakeGuard, chatBot, chatController, chatItemTypeOptions, cmd, command, commandHandler, container, cron, description, extractChatMessageText, extractNumberFromWasenderMessageKey, getClientMap, getPgClient, handshakeMiddlewares, inject, injectable, isArray, isBoolean, isDate, isIn, isModel, isNotEmpty, isNumber, isOptional, isPresent, isRecord, isString, jwtGuard, jwtHandshakeGuard, max, middleware, min, mindset, mindsetModule, modelInfo, onDelete, onGet, onPost, onPut, onSocketEvent, pgStorage, readJsonFromFile, restController, runChatControllers, runCommandHandlers, runCronHandlers, runRestControllers, runSocketControllers, safeJsonParse, scoped, setupErrorHandlers, singleton, socket, socketController, stopCommandHandlers, stopCronHandlers, telegram, validateAndTransform, validateArray, validateIsBoolean, validateIsDate, validateIsIn, validateIsNotEmpty, validateIsNumber, validateIsPresent, validateIsRecord, validateIsString, validateMax, validateMin, validateModel, whatsApp, whatsAppByWasender, withPgClient, withPgTransaction, writeJsonToFile };
|
|
2165
|
+
export { AnthropicChatAdapter, ApiKey, ApiKeyGuardMiddleware, ApiKeyHandshakeGuardMiddleware, ApiKeyRepository, Async, AsyncMetadataStore, Auth, Chat, ChatAdapter, ChatBot, ChatBotMetadataStore, ChatItem, ChatMemory, ChatRepository, ChatResolver, type ClientMap, CmdChannel, Container, ControllerMetadataStore, CronJob, CronJobRepository, CustomError, DeepSeekChatAdapter, DescriptionMetadataStore, EXPRESS_REQ, EXPRESS_RES, Entity, Env, EnvWhatsAppRepository, type ErrorSeverity, ExpressProvider, GoogleChatAdapter, type GoogleChatAdapterV2Options, HtmlModule, HttpServerProvider, type IApiKeyData, type IApiKeyRepository, type IArrayValidationError, type IArrayValidationResult, type IBotMessageItem, type IChannelMessage, type IChannelMetadata, type IChatAdapter, type IChatAdapterNextItemsReq, type IChatAdapterNextItemsRes, type IChatAssociation, type IChatBot, type IChatBotMetadata, type IChatChannel, type IChatConnection, type IChatControllerMetadata, type IChatData, type IChatItem, type IChatItemData, type IChatItemType, type IChatMemory, type IChatMessage, type IChatRepository, type IChatType, type ICmdChannelMessage, type ICmdReceivedMessage, type ICommandConfig, type ICommandHandler, type ICommandHandlerConfig, type IConstructor, type ICronConfig, type ICronJobData, type ICrudRepository, type ICustomErrorData, type IDescriptionMetadata, type IEndPointConfig, type IEndPointMetadata, type IEntityData, type IEnvType, type IErrorHandlersConfig, type IErrorMonitor, type IErrorMonitorContext, type IFunctionCall, type IFunctionCallItem, type IGenerateApiKeyReq, type IGenerateApiKeyRes, type IGetWhatsAppTemplateRequest, type IHandshakeMiddleware, type IHandshakeMiddlewareMetadata, type IHtmlModuleOptions, type IHumanMessageItem, type IJobData, type IJobRepository, type IJwtRefreshTokenData, type IJwtRefreshTokenRepository, type ILanguageModelUsage, type IListenWhatsAppMessageRequest, type ILockKey, type ILocker, type ILockerKey, type IMessageContext, type IMiddleware, type IMiddlewareMetadata, type IMindset, type IMindsetConfig, type IMindsetIdentity, type IMindsetLlm, type IMindsetMetadata, type IMindsetModuleConfig, type IMindsetModuleMetadata, type IMindsetTool, type IMindsetToolParameter, type IModelValidationError, type IModelValidationResult, type IModelValidatorsInfo, type IMoneyData, type IPersistentData, type IPgRepositoryConfig, type IPropertyValidatorInfo, type IReceivedMessage, type IRemoteApiKeyFetcher, type IRestControllerConfig, type IRestControllerMetadata, type IScheduleAt, type IScheduleDelay, type ISendByWasenderRequest, type ISendWhatsAppRequest, type ISendWhatsAppTemplateRequest, type ISocketChannelConfig, type ISocketChannelMessage, type ISocketChannelReceivedMessage, type ISocketControllerConfig, type ISocketControllerMetadata, type ISocketEventConfig, type ISocketEventMetadata, type ISocketReceivedMessage, type IStorableData, type ITelegramChannelConfig, type ITelegramChannelMessage, type ITelegramReceivedMessage, type IValidateArrayOptions, type IValidateArrayOptionsWithItemsValidators, type IValidateInputShape, type IValidateIsInOptions, type IValidateIsRecordOptions, type IValidateMaxOptions, type IValidateMinOptions, type IValidationError, type IValidationResult, type IValidator, type IValidatorMetadata, type IWasenderChannelMessageListener, type IWasenderDeviceListMetadata, type IWasenderEvent, type IWasenderMessageContent, type IWasenderMessageContextInfo, type IWasenderMessageKey, type IWasenderMessageReceivedData, type IWasenderMessageReceivedEvent, type IWasenderQrUpdatedEvent, type IWhatsAppBusinessAccount, type IWhatsAppBusinessNumber, type IWhatsAppByWasenderChannelConfig, type IWhatsAppByWasenderReceivedMessage, type IWhatsAppChannelMessage, type IWhatsAppCloudContact, type IWhatsAppCloudMessage, type IWhatsAppCloudMessageMetadata, type IWhatsAppCloudTemplate, type IWhatsAppCloudTemplateComponent, type IWhatsAppCloudTemplateMessage, type IWhatsAppCloudTemplateParameter, type IWhatsAppCloudTemplateResponse, type IWhatsAppCloudWebhookPayload, type IWhatsAppData, type IWhatsAppMessageListener, type IWhatsAppProxyListenMessageEventData, type IWhatsAppProxyListenMessageEventReq, type IWhatsAppProxyMessage, type IWhatsAppProxyMessageContent, type IWhatsAppProxyMessageEventReq, type IWhatsAppProxySendMessageEventReq, type IWhatsAppReceivedMessage, type IWhatsAppRepository, type IWhatsAppSenderOptions, type IWhatsappChannelConfig, type IchatControllerConfig, Job, JobRepository, JobRunner, Jwt, JwtAccessAndRefreshTokenDto, JwtConfig, JwtGuardMiddleware, JwtHandshakeGuardMiddleware, JwtRefreshToken, JwtRefreshTokenRepository, JwtSigner, JwtTokenDto, Lifecycle, Locker, Logger, Mapper, Mindset, MindsetMetadataStore, MindsetOperator, Money, MoneyDto, OpenaiChatAdapter, Password, type PasswordHashOptions, Persistent, PgApiKeyRepository, PgChatMemory, PgChatRepository, PgCronJobRepository, PgCrudRepository, PgJobRepository, PgJwtRefreshTokenRepository, PgLockKey, PgLocker, PgRepositoryBase, PgWhatsAppRepository, RamChatMemory, RamChatRepository, Random, RemoteApiKeyRepository, RestControllerMetadataStore, RestRequest, SocketChannel, SocketChannelConfig, SocketChannelReceivedMessage, SocketControllerMetadataStore, SocketServerConfig, SocketServerProvider, Storable, TelegramChannel, TelegramChannelConfig, ValidationMetadataStore, WHATSAPP_MESSAGE_EVENT, WHATSAPP_PROXY_LISTEN_MESSAGE_EVENT, WHATSAPP_PROXY_SEND_MESSAGE_EVENT, WabotChatAdapter, WasenderWebhookController, WhatsApp, WhatsAppByWasenderChannel, WhatsAppByWasenderChannelConfig, WhatsAppChannel, WhatsAppReceiver, WhatsAppReceiverByCloudApi, WhatsAppReceiverByWabotProxy, WhatsAppReceiverByWasender, WhatsAppRepository, WhatsAppSender, WhatsAppSenderByCloudApi, WhatsAppSenderByWabotProxy, WhatsAppSenderByWasender, WhatsAppWabotProxyConnection, WhatsappChannelConfig, apiKeyGuard, apiKeyHandshakeGuard, chatBot, chatController, chatItemTypeOptions, cmd, cmdChannelName, command, commandHandler, container, cron, description, extractChatMessageText, extractNumberFromWasenderMessageKey, getClientMap, getPgClient, handshakeMiddlewares, inject, injectable, isArray, isBoolean, isDate, isIn, isModel, isNotEmpty, isNumber, isOptional, isPresent, isRecord, isString, jwtGuard, jwtHandshakeGuard, max, middleware, min, mindset, mindsetModule, modelInfo, onDelete, onGet, onPost, onPut, onSocketEvent, pgStorage, readJsonFromFile, restController, runChatControllers, runCommandHandlers, runCronHandlers, runRestControllers, runSocketControllers, safeJsonParse, scoped, setupErrorHandlers, singleton, socket, socketChannelName, socketController, stopCommandHandlers, stopCronHandlers, telegram, telegramChannelName, validateAndTransform, validateArray, validateIsBoolean, validateIsDate, validateIsIn, validateIsNotEmpty, validateIsNumber, validateIsPresent, validateIsRecord, validateIsString, validateMax, validateMin, validateModel, whatsApp, whatsAppByWasender, whatsAppByWasenderChannelName, whatsAppChannelName, withPgClient, withPgTransaction, writeJsonToFile };
|
package/dist/src/index.js
CHANGED
|
@@ -133,12 +133,15 @@ export { RamChatRepository } from './addon/chat-bot/ram/RamChatRepository.js';
|
|
|
133
133
|
export { WabotChatAdapter } from './addon/chat-bot/wabot/WabotChatAdapter.js';
|
|
134
134
|
export { cmd } from './addon/chat-controller/cmd/@cmd.js';
|
|
135
135
|
export { CmdChannel, readJsonFromFile, writeJsonToFile } from './addon/chat-controller/cmd/CmdChannel.js';
|
|
136
|
+
export { cmdChannelName } from './addon/chat-controller/cmd/cmdChannelName.js';
|
|
136
137
|
export { socket } from './addon/chat-controller/socket/@socket.js';
|
|
137
138
|
export { SocketChannel, SocketChannelReceivedMessage } from './addon/chat-controller/socket/SocketChannel.js';
|
|
138
139
|
export { SocketChannelConfig } from './addon/chat-controller/socket/SocketChannelConfig.js';
|
|
140
|
+
export { socketChannelName } from './addon/chat-controller/socket/socketChannelName.js';
|
|
139
141
|
export { telegram } from './addon/chat-controller/telegram/@telegram.js';
|
|
140
142
|
export { TelegramChannelConfig } from './addon/chat-controller/telegram/TelegramChannelConfig.js';
|
|
141
143
|
export { TelegramChannel } from './addon/chat-controller/telegram/TelegramChannel.js';
|
|
144
|
+
export { telegramChannelName } from './addon/chat-controller/telegram/telegramChannelName.js';
|
|
142
145
|
export { whatsApp } from './addon/chat-controller/whatsapp/@whatsApp.js';
|
|
143
146
|
export { EnvWhatsAppRepository } from './addon/chat-controller/whatsapp/EnvWhatsAppRepository.js';
|
|
144
147
|
export { PgWhatsAppRepository } from './addon/chat-controller/whatsapp/PgWhatsAppRepository.js';
|
|
@@ -148,6 +151,7 @@ export { WhatsappChannelConfig } from './addon/chat-controller/whatsapp/WhatsApp
|
|
|
148
151
|
export { WhatsAppReceiver } from './addon/chat-controller/whatsapp/WhatsAppReceiver.js';
|
|
149
152
|
export { WhatsAppRepository } from './addon/chat-controller/whatsapp/WhatsAppRepository.js';
|
|
150
153
|
export { WhatsAppSender } from './addon/chat-controller/whatsapp/WhatsAppSender.js';
|
|
154
|
+
export { whatsAppChannelName } from './addon/chat-controller/whatsapp/whatsAppChannelName.js';
|
|
151
155
|
export { WhatsAppReceiverByCloudApi } from './addon/chat-controller/whatsapp/cloud-api/WhatsAppReceiverByCloudApi.js';
|
|
152
156
|
export { WhatsAppSenderByCloudApi } from './addon/chat-controller/whatsapp/cloud-api/WhatsAppSenderByCloudApi.js';
|
|
153
157
|
export { WHATSAPP_MESSAGE_EVENT, WHATSAPP_PROXY_LISTEN_MESSAGE_EVENT, WHATSAPP_PROXY_SEND_MESSAGE_EVENT } from './addon/chat-controller/whatsapp/proxy/WhatsAppProxyContracts.js';
|
|
@@ -161,5 +165,6 @@ export { WhatsAppReceiverByWasender } from './addon/chat-controller/wasender/Wha
|
|
|
161
165
|
export { WhatsAppSenderByWasender } from './addon/chat-controller/wasender/WhatsAppSenderByWasender.js';
|
|
162
166
|
export { WasenderWebhookController } from './addon/chat-controller/wasender/WasenderWebhookController.js';
|
|
163
167
|
export { extractNumberFromWasenderMessageKey } from './addon/chat-controller/wasender/extractNumberFromWasenderKey.js';
|
|
168
|
+
export { whatsAppByWasenderChannelName } from './addon/chat-controller/wasender/whatsAppByWasenderChannelName.js';
|
|
164
169
|
export { HtmlModule } from './addon/mindset/html/HtmlModule.js';
|
|
165
170
|
export { Container } from './core/injection/Container.js';
|