@wabot-dev/framework 0.1.0-beta.5 → 0.1.0-beta.51
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/async/pg/PgJobRepository.js +26 -0
- package/dist/src/addon/auth/api-key/@apiKeyGuard.js +17 -0
- package/dist/src/addon/auth/api-key/ApiKey.js +53 -0
- package/dist/src/addon/auth/api-key/ApiKeyGuardMiddleware.js +45 -0
- package/dist/src/addon/auth/api-key/ApiKeyRepository.js +13 -0
- package/dist/src/addon/auth/api-key/PgApiKeyRepository.js +21 -0
- package/dist/src/addon/auth/jwt/@jwtConnectionGuard.js +16 -0
- package/dist/src/addon/auth/jwt/@jwtGuard.js +17 -0
- package/dist/src/addon/auth/jwt/Jwt.js +53 -0
- package/dist/src/addon/auth/jwt/JwtAccessAndRefreshTokenDto.js +20 -0
- package/dist/src/addon/auth/jwt/JwtConfig.js +28 -0
- package/dist/src/addon/auth/jwt/JwtConnectionGuardMiddleware.js +57 -0
- package/dist/src/addon/auth/jwt/JwtGuardMiddleware.js +45 -0
- package/dist/src/addon/auth/jwt/JwtRefreshToken.js +56 -0
- package/dist/src/addon/auth/jwt/JwtRefreshTokenRepository.js +25 -0
- package/dist/src/addon/auth/jwt/JwtSigner.js +36 -0
- package/dist/src/addon/auth/jwt/JwtTokenDto.js +22 -0
- package/dist/src/addon/auth/jwt/PgJwtRefreshTokenRepository.js +21 -0
- package/dist/src/addon/chat-bot/anthropic/AnthropicChatAdapter.js +135 -0
- package/dist/src/addon/chat-bot/deepseek/DeepSeekChatAdapter.js +137 -0
- package/dist/src/addon/chat-bot/google/GoogleChatAdapter.js +145 -0
- package/dist/src/addon/chat-bot/openia/OpenaiChatAdapter.js +117 -0
- package/dist/src/{pre-made/repository/chat → addon/chat-bot}/pg/PgChatMemory.js +6 -4
- package/dist/src/{pre-made/repository/chat → addon/chat-bot}/pg/PgChatRepository.js +6 -5
- package/dist/src/{pre-made/repository/chat → addon/chat-bot}/ram/RamChatRepository.js +2 -2
- package/dist/src/addon/chat-bot/wabot/WabotChatAdapter.js +41 -0
- package/dist/src/addon/chat-controller/cmd/@cmd.js +23 -0
- package/dist/src/{channels → addon/chat-controller}/cmd/CmdChannel.js +4 -26
- package/dist/src/{channels → addon/chat-controller}/socket/@socket.js +9 -4
- package/dist/src/{channels → addon/chat-controller}/socket/SocketChannel.js +5 -23
- package/dist/src/{channels → addon/chat-controller}/socket/SocketChannelConfig.js +1 -1
- package/dist/src/{channels → addon/chat-controller}/telegram/@telegram.js +9 -4
- package/dist/src/{channels → addon/chat-controller}/telegram/TelegramChannel.js +4 -22
- package/dist/src/addon/chat-controller/whatsapp/@whatsApp.js +25 -0
- package/dist/src/{channels → addon/chat-controller}/whatsapp/EnvWhatsAppRepository.js +3 -3
- package/dist/src/{channels → addon/chat-controller}/whatsapp/PgWhatsAppRepository.js +2 -2
- package/dist/src/{channels → addon/chat-controller}/whatsapp/WhatsApp.js +2 -4
- package/dist/src/{channels → addon/chat-controller}/whatsapp/WhatsAppChannel.js +6 -18
- package/dist/src/addon/chat-controller/whatsapp/WhatsAppReceiver.js +10 -0
- package/dist/src/{channels → addon/chat-controller}/whatsapp/WhatsAppSender.js +20 -41
- package/dist/src/addon/chat-controller/whatsapp/cloud-api/WhatsAppReceiverByCloudApi.js +97 -0
- package/dist/src/{channels/whatsapp → addon/chat-controller/whatsapp/cloud-api}/WhatsAppSenderByCloudApi.js +26 -20
- package/dist/src/addon/chat-controller/whatsapp/proxy/WhatsAppProxyContracts.js +5 -0
- package/dist/src/addon/chat-controller/whatsapp/proxy/WhatsAppReceiverByWabotProxy.js +65 -0
- package/dist/src/addon/chat-controller/whatsapp/proxy/WhatsAppSenderByWabotProxy.js +60 -0
- package/dist/src/addon/chat-controller/whatsapp/proxy/WhatsAppWabotProxyConnection.js +45 -0
- package/dist/src/addon/mindset/html/HtmlModule.js +70 -0
- package/dist/src/core/auth/Auth.js +24 -0
- package/dist/src/core/{Persistent.js → entity/Entity.js} +24 -9
- package/dist/src/core/env/Env.js +39 -0
- package/dist/src/core/error/CustomError.js +15 -0
- package/dist/src/core/injection/index.js +4 -0
- package/dist/src/core/mapper/Mapper.js +42 -0
- package/dist/src/core/password/Password.js +30 -0
- package/dist/src/core/random/Random.js +47 -0
- package/dist/src/core/storable/Storable.js +8 -0
- package/dist/src/core/validation/core/validateArray.js +51 -0
- package/dist/src/core/validation/core/validateIsOptional.js +5 -0
- package/dist/src/core/validation/core/validateModel.js +36 -0
- package/dist/src/core/validation/metadata/@isArray.js +18 -0
- package/dist/src/core/validation/metadata/@isModel.js +18 -0
- package/dist/src/core/validation/metadata/@isOptional.js +17 -0
- package/dist/src/core/validation/metadata/ValidationMetadataStore.js +98 -0
- package/dist/src/core/validation/modelInfo.js +9 -0
- package/dist/src/core/validation/validate.js +11 -0
- package/dist/src/core/validation/validators/is-boolean/@isBoolean.js +17 -0
- package/dist/src/core/validation/validators/is-boolean/validateIsBoolean.js +12 -0
- package/dist/src/core/validation/validators/is-date/@isDate.js +17 -0
- package/dist/src/core/validation/validators/is-date/validateIsDate.js +16 -0
- package/dist/src/core/validation/validators/is-not-empty/@isNotEmpty.js +17 -0
- package/dist/src/core/validation/validators/is-not-empty/validateIsNotEmpty.js +12 -0
- package/dist/src/core/validation/validators/is-number/@isNumber.js +17 -0
- package/dist/src/core/validation/validators/is-number/validateIsNumber.js +12 -0
- package/dist/src/core/validation/validators/is-present/@isPresent.js +17 -0
- package/dist/src/core/validation/validators/is-present/validateIsPresent.js +12 -0
- package/dist/src/core/validation/validators/is-string/@isString.js +17 -0
- package/dist/src/core/validation/validators/is-string/validateIsString.js +12 -0
- package/dist/src/core/validation/validators/max/@max.js +18 -0
- package/dist/src/core/validation/validators/max/validateMax.js +17 -0
- package/dist/src/core/validation/validators/min/@min.js +18 -0
- package/dist/src/core/validation/validators/min/validateMin.js +17 -0
- package/dist/src/feature/async/@command.js +11 -0
- package/dist/src/feature/async/@commandHandler.js +12 -0
- package/dist/src/feature/async/Async.js +38 -0
- package/dist/src/feature/async/Command.js +9 -0
- package/dist/src/feature/async/CommandMetadataStore.js +38 -0
- package/dist/src/feature/async/Job.js +24 -0
- package/dist/src/feature/async/JobRepository.js +31 -0
- package/dist/src/feature/async/JobRunner.js +45 -0
- package/dist/src/feature/async/JobsEventsHub.js +24 -0
- package/dist/src/feature/async/runCommandHandlers.js +29 -0
- package/dist/src/{core/chat → feature/chat-bot}/Chat.js +2 -2
- package/dist/src/feature/chat-bot/ChatAdapter.js +7 -0
- package/dist/src/feature/chat-bot/ChatBot.js +73 -0
- package/dist/src/feature/chat-bot/ChatItem.js +24 -0
- package/dist/src/feature/chat-bot/ChatMemory.js +10 -0
- package/dist/src/{core/chat/repository/IChatRepository.js → feature/chat-bot/ChatRepository.js} +2 -8
- package/dist/src/feature/chat-bot/IChatItem.js +3 -0
- package/dist/src/{chatbot → feature/chat-bot}/metadata/@chatBot.js +1 -1
- package/dist/src/{chatbot → feature/chat-bot}/metadata/ChatBotMetadataStore.js +1 -1
- package/dist/src/{controller/channel → feature/chat-controller}/ChatResolver.js +6 -4
- package/dist/src/{controller → feature/chat-controller}/metadata/ControllerMetadataStore.js +1 -1
- package/dist/src/{controller → feature/chat-controller}/metadata/controller/@chatController.js +1 -1
- package/dist/src/feature/chat-controller/runChatControllers.js +69 -0
- package/dist/src/{channels → feature}/express/ExpressProvider.js +2 -4
- package/dist/src/{channels → feature}/http/HttpServerProvider.js +2 -2
- package/dist/src/{mindset → feature/mindset}/IMindset.js +3 -0
- package/dist/src/{mindset → feature/mindset}/MindsetOperator.js +69 -42
- package/dist/src/{mindset → feature/mindset}/metadata/MindsetMetadataStore.js +1 -1
- package/dist/src/{mindset → feature/mindset}/metadata/functions/@mindsetFunction.js +1 -1
- package/dist/src/{mindset → feature/mindset}/metadata/mindsets/@mindset.js +1 -1
- package/dist/src/{mindset → feature/mindset}/metadata/modules/@mindsetModule.js +1 -2
- package/dist/src/{mindset → feature/mindset}/metadata/params/@param.js +1 -1
- package/dist/src/feature/money/Money.js +61 -0
- package/dist/src/feature/money/MoneyDto.js +22 -0
- package/dist/src/{repository → feature}/pg/PgCrudRepository.js +25 -2
- package/dist/src/{repository → feature}/pg/PgRepositoryBase.js +2 -2
- package/dist/src/feature/rest-controller/injection-tokens.js +4 -0
- package/dist/src/feature/rest-controller/metadata/@get.js +19 -0
- package/dist/src/feature/rest-controller/metadata/@middleware.js +16 -0
- package/dist/src/feature/rest-controller/metadata/@post.js +19 -0
- package/dist/src/feature/rest-controller/metadata/@restController.js +15 -0
- package/dist/src/feature/rest-controller/metadata/RestControllerMetadataStore.js +50 -0
- package/dist/src/feature/rest-controller/runRestControllers.js +102 -0
- package/dist/src/{channels → feature}/socket/SocketServerProvider.js +2 -2
- package/dist/src/feature/socket-controller/metadata/@connectionMiddleware.js +16 -0
- package/dist/src/feature/socket-controller/metadata/@socketConnection.js +18 -0
- package/dist/src/feature/socket-controller/metadata/@socketController.js +15 -0
- package/dist/src/feature/socket-controller/metadata/@socketEvent.js +18 -0
- package/dist/src/feature/socket-controller/metadata/SocketControllerMetadataStore.js +65 -0
- package/dist/src/feature/socket-controller/runSocketControllers.js +98 -0
- package/dist/src/index.d.ts +1151 -575
- package/dist/src/index.js +140 -76
- package/package.json +10 -4
- package/dist/src/ai/deepseek/DeepSeekChatBotAdapter.js +0 -106
- package/dist/src/ai/openia/OpenaiChatBotAdapter.js +0 -84
- package/dist/src/channels/cmd/@cmd.js +0 -18
- package/dist/src/channels/wabot/WabotDevConnection.js +0 -57
- package/dist/src/channels/wabot/WabotDevSocketContracts.js +0 -10
- package/dist/src/channels/whatsapp/@whatsapp.js +0 -20
- package/dist/src/channels/whatsapp/WhatsAppReceiver.js +0 -59
- package/dist/src/channels/whatsapp/WhatsAppReceiverByDevConnection.js +0 -32
- package/dist/src/channels/whatsapp/WhatsAppReceiverByWebHook.js +0 -63
- package/dist/src/channels/whatsapp/WhatsAppSenderByDevConnection.js +0 -61
- package/dist/src/chatbot/ChatBot.js +0 -51
- package/dist/src/chatbot/ChatBotAdapter.js +0 -72
- package/dist/src/controller/channel/UserResolver.js +0 -21
- package/dist/src/core/IMessageContext.js +0 -12
- package/dist/src/core/chat/ChatItem.js +0 -15
- package/dist/src/core/chat/repository/IChatMemory.js +0 -10
- package/dist/src/core/user/IUserRepository.js +0 -19
- package/dist/src/core/user/User.js +0 -26
- package/dist/src/env/WabotEnv.js +0 -27
- package/dist/src/injection/index.js +0 -4
- package/dist/src/mindset/metadata/params/@isOptional.js +0 -21
- package/dist/src/pre-made/module/authentication/AuthenticationModule.js +0 -97
- package/dist/src/pre-made/module/authentication/requests/SendOneTimePasswordRequest.js +0 -25
- package/dist/src/pre-made/module/authentication/requests/ValidateOneTimePasswordRequest.js +0 -25
- package/dist/src/pre-made/module/register-user/RegisterUserModule.js +0 -56
- package/dist/src/pre-made/module/register-user/requests/RegisterUserWithEmailRequest.js +0 -25
- package/dist/src/pre-made/repository/user/pg/PgUserRepository.js +0 -33
- package/dist/src/pre-made/repository/user/ram/RamUserRepository.js +0 -27
- package/dist/src/pre-made/service/EmailService.js +0 -13
- package/dist/src/pre-made/service/OtpService.js +0 -14
- package/dist/src/server/prepareChatContainer.js +0 -43
- package/dist/src/server/runChannel.js +0 -27
- package/dist/src/server/runServer.js +0 -40
- /package/dist/src/{pre-made/repository/chat → addon/chat-bot}/ram/RamChatMemory.js +0 -0
- /package/dist/src/{channels → addon/chat-controller}/telegram/TelegramChannelConfig.js +0 -0
- /package/dist/src/{channels → addon/chat-controller}/whatsapp/WhatsAppChannelConfig.js +0 -0
- /package/dist/src/{channels → addon/chat-controller}/whatsapp/WhatsAppRepository.js +0 -0
- /package/dist/src/{injection → core/injection}/Container.js +0 -0
- /package/dist/src/{logger → core/logger}/Logger.js +0 -0
- /package/dist/src/{mindset → feature/mindset}/metadata/functions/decoratorNames.js +0 -0
- /package/dist/src/{mindset → feature/mindset}/metadata/mindsets/decoratorNames.js +0 -0
- /package/dist/src/{mindset → feature/mindset}/metadata/modules/decoratorNames.js +0 -0
- /package/dist/src/{mindset → feature/mindset}/metadata/params/decoratorNames.js +0 -0
|
@@ -1,25 +1,15 @@
|
|
|
1
|
-
import { __decorate
|
|
2
|
-
import {
|
|
3
|
-
import { UserResolver } from '../../controller/channel/UserResolver.js';
|
|
4
|
-
import { injectable } from '../../injection/index.js';
|
|
5
|
-
import '../../controller/metadata/ControllerMetadataStore.js';
|
|
1
|
+
import { __decorate } from 'tslib';
|
|
2
|
+
import { injectable } from '../../../core/injection/index.js';
|
|
6
3
|
import * as readline from 'readline';
|
|
7
4
|
|
|
8
5
|
var CmdChannel_1;
|
|
9
6
|
const chatId = 'cmd';
|
|
10
|
-
const userId = 'cmd';
|
|
11
7
|
let CmdChannel = CmdChannel_1 = class CmdChannel {
|
|
12
|
-
chatResolver;
|
|
13
|
-
userResolver;
|
|
14
8
|
rl = readline.createInterface({
|
|
15
9
|
input: process.stdin,
|
|
16
10
|
output: process.stdout,
|
|
17
11
|
});
|
|
18
12
|
callBack = null;
|
|
19
|
-
constructor(chatResolver, userResolver) {
|
|
20
|
-
this.chatResolver = chatResolver;
|
|
21
|
-
this.userResolver = userResolver;
|
|
22
|
-
}
|
|
23
13
|
listen(callback) {
|
|
24
14
|
this.callBack = callback;
|
|
25
15
|
}
|
|
@@ -39,22 +29,12 @@ let CmdChannel = CmdChannel_1 = class CmdChannel {
|
|
|
39
29
|
chatType: 'PRIVATE',
|
|
40
30
|
channelName: CmdChannel_1.name,
|
|
41
31
|
};
|
|
42
|
-
const chat = await this.chatResolver.resolve(chatConnection);
|
|
43
|
-
const userConnection = {
|
|
44
|
-
id: userId,
|
|
45
|
-
channelName: CmdChannel_1.name,
|
|
46
|
-
};
|
|
47
|
-
const user = await this.userResolver.resolve(userConnection);
|
|
48
32
|
if (!this.callBack)
|
|
49
33
|
return;
|
|
50
34
|
this.callBack({
|
|
51
|
-
|
|
52
|
-
user,
|
|
35
|
+
chatConnection,
|
|
53
36
|
message: {
|
|
54
|
-
chatConnection,
|
|
55
|
-
userConnection,
|
|
56
37
|
text: trimmedInput,
|
|
57
|
-
senderName: 'cmd',
|
|
58
38
|
},
|
|
59
39
|
reply: (message) => {
|
|
60
40
|
console.log(`\n[${message.senderName}]: ${message.text}\n`);
|
|
@@ -65,9 +45,7 @@ let CmdChannel = CmdChannel_1 = class CmdChannel {
|
|
|
65
45
|
}
|
|
66
46
|
};
|
|
67
47
|
CmdChannel = CmdChannel_1 = __decorate([
|
|
68
|
-
injectable()
|
|
69
|
-
__metadata("design:paramtypes", [ChatResolver,
|
|
70
|
-
UserResolver])
|
|
48
|
+
injectable()
|
|
71
49
|
], CmdChannel);
|
|
72
50
|
|
|
73
51
|
export { CmdChannel };
|
|
@@ -1,7 +1,12 @@
|
|
|
1
|
-
import '
|
|
2
|
-
import '
|
|
3
|
-
import
|
|
4
|
-
import
|
|
1
|
+
import { container } from '../../../core/injection/index.js';
|
|
2
|
+
import { ControllerMetadataStore } from '../../../feature/chat-controller/metadata/ControllerMetadataStore.js';
|
|
3
|
+
import '../../../feature/chat-controller/ChatResolver.js';
|
|
4
|
+
import '../../../feature/chat-bot/ChatBot.js';
|
|
5
|
+
import 'uuid';
|
|
6
|
+
import '../../../feature/chat-bot/metadata/ChatBotMetadataStore.js';
|
|
7
|
+
import 'reflect-metadata';
|
|
8
|
+
import '../../../feature/mindset/metadata/MindsetMetadataStore.js';
|
|
9
|
+
import '../../../feature/mindset/MindsetOperator.js';
|
|
5
10
|
import { SocketChannel } from './SocketChannel.js';
|
|
6
11
|
import { SocketChannelConfig } from './SocketChannelConfig.js';
|
|
7
12
|
|
|
@@ -1,24 +1,17 @@
|
|
|
1
1
|
import { __decorate, __metadata } from 'tslib';
|
|
2
|
+
import { injectable } from '../../../core/injection/index.js';
|
|
3
|
+
import { SocketServerProvider } from '../../../feature/socket/SocketServerProvider.js';
|
|
2
4
|
import { SocketChannelConfig } from './SocketChannelConfig.js';
|
|
3
|
-
import { injectable } from '../../injection/index.js';
|
|
4
|
-
import { ChatResolver } from '../../controller/channel/ChatResolver.js';
|
|
5
|
-
import { UserResolver } from '../../controller/channel/UserResolver.js';
|
|
6
|
-
import '../../controller/metadata/ControllerMetadataStore.js';
|
|
7
|
-
import { SocketServerProvider } from './SocketServerProvider.js';
|
|
8
5
|
|
|
9
6
|
var SocketChannel_1;
|
|
10
7
|
let SocketChannel = SocketChannel_1 = class SocketChannel {
|
|
11
8
|
config;
|
|
12
9
|
socketServerProvider;
|
|
13
|
-
chatResolver;
|
|
14
|
-
userResolver;
|
|
15
10
|
callBack = null;
|
|
16
11
|
server;
|
|
17
|
-
constructor(config, socketServerProvider
|
|
12
|
+
constructor(config, socketServerProvider) {
|
|
18
13
|
this.config = config;
|
|
19
14
|
this.socketServerProvider = socketServerProvider;
|
|
20
|
-
this.chatResolver = chatResolver;
|
|
21
|
-
this.userResolver = userResolver;
|
|
22
15
|
this.server = this.socketServerProvider.getSocketServer();
|
|
23
16
|
}
|
|
24
17
|
listen(callback) {
|
|
@@ -42,20 +35,11 @@ let SocketChannel = SocketChannel_1 = class SocketChannel {
|
|
|
42
35
|
chatType: 'PRIVATE',
|
|
43
36
|
channelName: SocketChannel_1.name,
|
|
44
37
|
};
|
|
45
|
-
const chat = await this.chatResolver.resolve(chatConnection);
|
|
46
|
-
const userConnection = {
|
|
47
|
-
id: message.userId,
|
|
48
|
-
channelName: SocketChannel_1.name,
|
|
49
|
-
};
|
|
50
|
-
const user = await this.userResolver.resolve(userConnection);
|
|
51
38
|
if (!this.callBack)
|
|
52
39
|
return;
|
|
53
40
|
this.callBack({
|
|
54
|
-
|
|
55
|
-
user,
|
|
41
|
+
chatConnection,
|
|
56
42
|
message: {
|
|
57
|
-
chatConnection,
|
|
58
|
-
userConnection,
|
|
59
43
|
text: trimmedInput,
|
|
60
44
|
senderName: message.senderName,
|
|
61
45
|
},
|
|
@@ -71,9 +55,7 @@ let SocketChannel = SocketChannel_1 = class SocketChannel {
|
|
|
71
55
|
SocketChannel = SocketChannel_1 = __decorate([
|
|
72
56
|
injectable(),
|
|
73
57
|
__metadata("design:paramtypes", [SocketChannelConfig,
|
|
74
|
-
SocketServerProvider
|
|
75
|
-
ChatResolver,
|
|
76
|
-
UserResolver])
|
|
58
|
+
SocketServerProvider])
|
|
77
59
|
], SocketChannel);
|
|
78
60
|
|
|
79
61
|
export { SocketChannel };
|
|
@@ -1,7 +1,12 @@
|
|
|
1
|
-
import { container } from '
|
|
2
|
-
import '
|
|
3
|
-
import '
|
|
4
|
-
import
|
|
1
|
+
import { container } from '../../../core/injection/index.js';
|
|
2
|
+
import { ControllerMetadataStore } from '../../../feature/chat-controller/metadata/ControllerMetadataStore.js';
|
|
3
|
+
import '../../../feature/chat-controller/ChatResolver.js';
|
|
4
|
+
import '../../../feature/chat-bot/ChatBot.js';
|
|
5
|
+
import 'uuid';
|
|
6
|
+
import '../../../feature/chat-bot/metadata/ChatBotMetadataStore.js';
|
|
7
|
+
import 'reflect-metadata';
|
|
8
|
+
import '../../../feature/mindset/metadata/MindsetMetadataStore.js';
|
|
9
|
+
import '../../../feature/mindset/MindsetOperator.js';
|
|
5
10
|
import { TelegramChannel } from './TelegramChannel.js';
|
|
6
11
|
import { TelegramChannelConfig } from './TelegramChannelConfig.js';
|
|
7
12
|
|
|
@@ -1,21 +1,14 @@
|
|
|
1
1
|
import { __decorate, __metadata } from 'tslib';
|
|
2
|
-
import { ChatResolver } from '../../controller/channel/ChatResolver.js';
|
|
3
|
-
import { UserResolver } from '../../controller/channel/UserResolver.js';
|
|
4
|
-
import { injectable } from '../../injection/index.js';
|
|
5
|
-
import '../../controller/metadata/ControllerMetadataStore.js';
|
|
6
2
|
import { Bot } from 'grammy';
|
|
7
3
|
import { TelegramChannelConfig } from './TelegramChannelConfig.js';
|
|
4
|
+
import { injectable } from '../../../core/injection/index.js';
|
|
8
5
|
|
|
9
6
|
var TelegramChannel_1;
|
|
10
7
|
let TelegramChannel = TelegramChannel_1 = class TelegramChannel {
|
|
11
8
|
config;
|
|
12
|
-
chatResolver;
|
|
13
|
-
userResolver;
|
|
14
9
|
bot;
|
|
15
|
-
constructor(config
|
|
10
|
+
constructor(config) {
|
|
16
11
|
this.config = config;
|
|
17
|
-
this.chatResolver = chatResolver;
|
|
18
|
-
this.userResolver = userResolver;
|
|
19
12
|
this.bot = new Bot(this.config.botToken);
|
|
20
13
|
}
|
|
21
14
|
listen(callback) {
|
|
@@ -28,18 +21,9 @@ let TelegramChannel = TelegramChannel_1 = class TelegramChannel {
|
|
|
28
21
|
chatType: ctx.message.chat.type === 'private' ? 'PRIVATE' : 'GROUP',
|
|
29
22
|
channelName: TelegramChannel_1.name,
|
|
30
23
|
};
|
|
31
|
-
const chat = await this.chatResolver.resolve(chatConnection);
|
|
32
|
-
const userConnection = {
|
|
33
|
-
id: ctx.from.id.toString(),
|
|
34
|
-
channelName: TelegramChannel_1.name,
|
|
35
|
-
};
|
|
36
|
-
const user = await this.userResolver.resolve(userConnection);
|
|
37
24
|
callback({
|
|
38
|
-
|
|
39
|
-
user,
|
|
25
|
+
chatConnection,
|
|
40
26
|
message: {
|
|
41
|
-
chatConnection,
|
|
42
|
-
userConnection,
|
|
43
27
|
senderName: ctx.from.first_name,
|
|
44
28
|
text: ctx.message.text,
|
|
45
29
|
},
|
|
@@ -55,9 +39,7 @@ let TelegramChannel = TelegramChannel_1 = class TelegramChannel {
|
|
|
55
39
|
};
|
|
56
40
|
TelegramChannel = TelegramChannel_1 = __decorate([
|
|
57
41
|
injectable(),
|
|
58
|
-
__metadata("design:paramtypes", [TelegramChannelConfig
|
|
59
|
-
ChatResolver,
|
|
60
|
-
UserResolver])
|
|
42
|
+
__metadata("design:paramtypes", [TelegramChannelConfig])
|
|
61
43
|
], TelegramChannel);
|
|
62
44
|
|
|
63
45
|
export { TelegramChannel };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { container } from '../../../core/injection/index.js';
|
|
2
|
+
import { WhatsappChannelConfig } from './WhatsAppChannelConfig.js';
|
|
3
|
+
import { ControllerMetadataStore } from '../../../feature/chat-controller/metadata/ControllerMetadataStore.js';
|
|
4
|
+
import '../../../feature/chat-controller/ChatResolver.js';
|
|
5
|
+
import '../../../feature/chat-bot/ChatBot.js';
|
|
6
|
+
import 'uuid';
|
|
7
|
+
import '../../../feature/chat-bot/metadata/ChatBotMetadataStore.js';
|
|
8
|
+
import 'reflect-metadata';
|
|
9
|
+
import '../../../feature/mindset/metadata/MindsetMetadataStore.js';
|
|
10
|
+
import '../../../feature/mindset/MindsetOperator.js';
|
|
11
|
+
import { WhatsAppChannel } from './WhatsAppChannel.js';
|
|
12
|
+
|
|
13
|
+
function whatsApp(config) {
|
|
14
|
+
return function (target, propertyKey) {
|
|
15
|
+
const store = container.resolve(ControllerMetadataStore);
|
|
16
|
+
store.saveChannelMetadata({
|
|
17
|
+
channelConstructor: WhatsAppChannel,
|
|
18
|
+
functionName: propertyKey.toString(),
|
|
19
|
+
controllerConstructor: target.constructor,
|
|
20
|
+
channelConfig: new WhatsappChannelConfig(typeof config === 'string' ? config : config.number),
|
|
21
|
+
});
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export { whatsApp };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { __decorate, __metadata } from 'tslib';
|
|
2
|
-
import { singleton } from '
|
|
2
|
+
import { singleton } from '../../../core/injection/index.js';
|
|
3
3
|
import { WhatsApp } from './WhatsApp.js';
|
|
4
|
-
import {
|
|
4
|
+
import { Env } from '../../../core/env/Env.js';
|
|
5
5
|
|
|
6
6
|
let EnvWhatsAppRepository = class EnvWhatsAppRepository {
|
|
7
7
|
env;
|
|
@@ -43,7 +43,7 @@ let EnvWhatsAppRepository = class EnvWhatsAppRepository {
|
|
|
43
43
|
};
|
|
44
44
|
EnvWhatsAppRepository = __decorate([
|
|
45
45
|
singleton(),
|
|
46
|
-
__metadata("design:paramtypes", [
|
|
46
|
+
__metadata("design:paramtypes", [Env])
|
|
47
47
|
], EnvWhatsAppRepository);
|
|
48
48
|
|
|
49
49
|
export { EnvWhatsAppRepository };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { __decorate, __metadata } from 'tslib';
|
|
2
2
|
import { Pool } from 'pg';
|
|
3
3
|
import { WhatsApp } from './WhatsApp.js';
|
|
4
|
-
import { singleton } from '
|
|
5
|
-
import { PgCrudRepository } from '
|
|
4
|
+
import { singleton } from '../../../core/injection/index.js';
|
|
5
|
+
import { PgCrudRepository } from '../../../feature/pg/PgCrudRepository.js';
|
|
6
6
|
|
|
7
7
|
let PgWhatsAppRepository = class PgWhatsAppRepository extends PgCrudRepository {
|
|
8
8
|
constructor(pool) {
|
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
import '
|
|
2
|
-
import { Persistent } from '../../core/Persistent.js';
|
|
3
|
-
import '../../core/user/IUserRepository.js';
|
|
1
|
+
import { Entity } from '../../../core/entity/Entity.js';
|
|
4
2
|
|
|
5
|
-
class WhatsApp extends
|
|
3
|
+
class WhatsApp extends Entity {
|
|
6
4
|
getVerifyToken() {
|
|
7
5
|
return this.data.verifyToken;
|
|
8
6
|
}
|
|
@@ -1,24 +1,17 @@
|
|
|
1
1
|
import { __decorate, __metadata } from 'tslib';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { injectable } from '../../injection/index.js';
|
|
5
|
-
import '../../controller/metadata/ControllerMetadataStore.js';
|
|
6
|
-
import { Logger } from '../../logger/Logger.js';
|
|
2
|
+
import { injectable } from '../../../core/injection/index.js';
|
|
3
|
+
import { Logger } from '../../../core/logger/Logger.js';
|
|
7
4
|
import { WhatsappChannelConfig } from './WhatsAppChannelConfig.js';
|
|
8
5
|
import { WhatsAppReceiver } from './WhatsAppReceiver.js';
|
|
9
6
|
import { WhatsAppSender } from './WhatsAppSender.js';
|
|
10
7
|
|
|
11
8
|
let WhatsAppChannel = class WhatsAppChannel {
|
|
12
9
|
config;
|
|
13
|
-
chatResolver;
|
|
14
|
-
userResolver;
|
|
15
10
|
sender;
|
|
16
11
|
receiver;
|
|
17
12
|
logger = new Logger('wabot:whatsapp-channel');
|
|
18
|
-
constructor(config,
|
|
13
|
+
constructor(config, sender, receiver) {
|
|
19
14
|
this.config = config;
|
|
20
|
-
this.chatResolver = chatResolver;
|
|
21
|
-
this.userResolver = userResolver;
|
|
22
15
|
this.sender = sender;
|
|
23
16
|
this.receiver = receiver;
|
|
24
17
|
}
|
|
@@ -27,16 +20,13 @@ let WhatsAppChannel = class WhatsAppChannel {
|
|
|
27
20
|
to: this.config.number,
|
|
28
21
|
listener: async (message) => {
|
|
29
22
|
try {
|
|
30
|
-
const chat = await this.chatResolver.resolve(message.chatConnection);
|
|
31
|
-
const user = await this.userResolver.resolve(message.userConnection);
|
|
32
23
|
callback({
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
message,
|
|
24
|
+
chatConnection: message.chatConnection,
|
|
25
|
+
message: message.message,
|
|
36
26
|
reply: (replyMessage) => {
|
|
37
27
|
this.sender.sendWhatsApp({
|
|
38
28
|
from: this.config.number,
|
|
39
|
-
to: message.
|
|
29
|
+
to: message.chatConnection.id,
|
|
40
30
|
message: replyMessage,
|
|
41
31
|
});
|
|
42
32
|
},
|
|
@@ -55,8 +45,6 @@ let WhatsAppChannel = class WhatsAppChannel {
|
|
|
55
45
|
WhatsAppChannel = __decorate([
|
|
56
46
|
injectable(),
|
|
57
47
|
__metadata("design:paramtypes", [WhatsappChannelConfig,
|
|
58
|
-
ChatResolver,
|
|
59
|
-
UserResolver,
|
|
60
48
|
WhatsAppSender,
|
|
61
49
|
WhatsAppReceiver])
|
|
62
50
|
], WhatsAppChannel);
|
|
@@ -1,53 +1,29 @@
|
|
|
1
|
-
import '
|
|
2
|
-
import { ChatItem } from '
|
|
3
|
-
import '
|
|
1
|
+
import '../../../feature/chat-bot/ChatBot.js';
|
|
2
|
+
import { ChatItem } from '../../../feature/chat-bot/ChatItem.js';
|
|
3
|
+
import '../../../core/injection/index.js';
|
|
4
|
+
import 'uuid';
|
|
5
|
+
import '../../../feature/chat-bot/metadata/ChatBotMetadataStore.js';
|
|
4
6
|
|
|
5
7
|
class WhatsAppSender {
|
|
6
|
-
logger;
|
|
7
8
|
chatRepository;
|
|
8
9
|
chatResolver;
|
|
9
10
|
whatsAppRepository;
|
|
10
|
-
constructor(
|
|
11
|
-
this.logger = logger;
|
|
11
|
+
constructor(chatRepository, chatResolver, whatsAppRepository) {
|
|
12
12
|
this.chatRepository = chatRepository;
|
|
13
13
|
this.chatResolver = chatResolver;
|
|
14
14
|
this.whatsAppRepository = whatsAppRepository;
|
|
15
15
|
}
|
|
16
16
|
async sendWhatsApp(request, options) {
|
|
17
|
-
|
|
18
|
-
await this.handleSendRequest(request);
|
|
19
|
-
if (options?.writeChatMemory) {
|
|
20
|
-
await this.writePrivateChatMemory(request.message, request.to);
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
catch (error) {
|
|
24
|
-
this.logger.error(`Error sending WhatsApp message: ${error}`);
|
|
25
|
-
}
|
|
17
|
+
throw new Error('Not implemented');
|
|
26
18
|
}
|
|
27
19
|
async sendWhatsAppTemplate(request, options) {
|
|
28
|
-
|
|
29
|
-
await this.handleSendTemplateRequest(request);
|
|
30
|
-
if (options?.writeChatMemory) {
|
|
31
|
-
const message = await this.resolveTemplateToChatMessage(request);
|
|
32
|
-
await this.writePrivateChatMemory(message, request.to);
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
catch (error) {
|
|
36
|
-
this.logger.error(`Error sending WhatsApp message: ${error}`);
|
|
37
|
-
}
|
|
20
|
+
throw new Error('Not implemented');
|
|
38
21
|
}
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
const template = await this.handleGetWhatsAppTemplate(request);
|
|
42
|
-
return template;
|
|
43
|
-
}
|
|
44
|
-
catch (error) {
|
|
45
|
-
this.logger.error(error);
|
|
46
|
-
throw new Error('Error getting WhatsApp template:', { cause: error });
|
|
47
|
-
}
|
|
22
|
+
getWhatsAppTemplate(request) {
|
|
23
|
+
throw new Error('Not implemented');
|
|
48
24
|
}
|
|
49
|
-
async
|
|
50
|
-
const template = await this.
|
|
25
|
+
async mapTemplateToChatMessage(request) {
|
|
26
|
+
const template = await this.getWhatsAppTemplate({
|
|
51
27
|
from: request.from,
|
|
52
28
|
templateName: request.templateMessage.templateName,
|
|
53
29
|
languageCode: request.templateMessage.languageCode,
|
|
@@ -55,7 +31,10 @@ class WhatsAppSender {
|
|
|
55
31
|
if (!template) {
|
|
56
32
|
throw new Error(`WhatsAppTemplate with name ${request.templateMessage.templateName} and language ${request.templateMessage.languageCode} not found`);
|
|
57
33
|
}
|
|
58
|
-
const components = template.components
|
|
34
|
+
const components = template.components
|
|
35
|
+
.filter((x) => x.text != null)
|
|
36
|
+
.map((x) => x.text)
|
|
37
|
+
.join('\n');
|
|
59
38
|
return {
|
|
60
39
|
text: this.replaceTemplateParameters(components, request.templateMessage.parameters),
|
|
61
40
|
senderName: request.senderName,
|
|
@@ -68,16 +47,16 @@ class WhatsAppSender {
|
|
|
68
47
|
channelName: 'WhatsAppChannel',
|
|
69
48
|
};
|
|
70
49
|
const chat = await this.chatResolver.resolve(chatConnection);
|
|
71
|
-
const chatMemory = await this.chatRepository.findMemory(chat.
|
|
50
|
+
const chatMemory = await this.chatRepository.findMemory(chat.id);
|
|
72
51
|
const chatItem = new ChatItem({
|
|
73
|
-
type: '
|
|
74
|
-
|
|
52
|
+
type: 'botMessage',
|
|
53
|
+
botMessage: message,
|
|
75
54
|
});
|
|
76
55
|
await chatMemory.create(chatItem);
|
|
77
56
|
}
|
|
78
57
|
replaceTemplateParameters(template, data) {
|
|
79
58
|
let result = template;
|
|
80
|
-
data.forEach(param => {
|
|
59
|
+
data.forEach((param) => {
|
|
81
60
|
if (param.type === 'text' && param.parameter_name) {
|
|
82
61
|
const tag = `{{${param.parameter_name}}}`;
|
|
83
62
|
result = result.split(tag).join(param.text);
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { Logger } from '../../../../core/logger/Logger.js';
|
|
2
|
+
import { json } from 'express';
|
|
3
|
+
import { WhatsAppReceiver } from '../WhatsAppReceiver.js';
|
|
4
|
+
|
|
5
|
+
class WhatsAppReceiverByCloudApi extends WhatsAppReceiver {
|
|
6
|
+
expressProvider;
|
|
7
|
+
whatsAppRepository;
|
|
8
|
+
listeners = new Map();
|
|
9
|
+
expressApp;
|
|
10
|
+
logger = new Logger('wabot:whatsapp-receiver-by-webhook');
|
|
11
|
+
webhookPath = '/whatsapp/web-hook/:slug';
|
|
12
|
+
constructor(expressProvider, whatsAppRepository) {
|
|
13
|
+
super();
|
|
14
|
+
this.expressProvider = expressProvider;
|
|
15
|
+
this.whatsAppRepository = whatsAppRepository;
|
|
16
|
+
this.expressApp = this.expressProvider.getExpress();
|
|
17
|
+
}
|
|
18
|
+
async connect() {
|
|
19
|
+
this.expressApp.get(this.webhookPath, json(), async (req, res) => {
|
|
20
|
+
try {
|
|
21
|
+
let mode = req.query['hub.mode'];
|
|
22
|
+
let token = req.query['hub.verify_token'];
|
|
23
|
+
let challenge = req.query['hub.challenge'];
|
|
24
|
+
if (!mode || !token || !challenge) {
|
|
25
|
+
res.sendStatus(400);
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
28
|
+
const whatsApp = await this.whatsAppRepository.findBySlug(req.params.slug);
|
|
29
|
+
if (!whatsApp || mode !== 'subscribe' || token !== whatsApp.getVerifyToken()) {
|
|
30
|
+
res.sendStatus(403);
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
res.status(200).send(challenge);
|
|
34
|
+
}
|
|
35
|
+
catch (e) {
|
|
36
|
+
this.logger.error(e);
|
|
37
|
+
res.sendStatus(500);
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
this.expressApp.post(this.webhookPath, json(), (req, res) => {
|
|
42
|
+
const payload = req.body;
|
|
43
|
+
this.handlePayload(payload);
|
|
44
|
+
res.sendStatus(200);
|
|
45
|
+
});
|
|
46
|
+
this.expressProvider.listen();
|
|
47
|
+
}
|
|
48
|
+
listenMessage(request) {
|
|
49
|
+
this.listeners.set(request.to, request.listener);
|
|
50
|
+
}
|
|
51
|
+
async handlePayload(payload) {
|
|
52
|
+
try {
|
|
53
|
+
for (const entry of payload.entry) {
|
|
54
|
+
for (const change of entry.changes) {
|
|
55
|
+
if (change.field !== 'messages' || !change.value.messages || !change.value.contacts) {
|
|
56
|
+
continue;
|
|
57
|
+
}
|
|
58
|
+
for (const message of change.value.messages) {
|
|
59
|
+
const contact = change.value.contacts.find((x) => x.wa_id === message.from);
|
|
60
|
+
if (!contact) {
|
|
61
|
+
continue;
|
|
62
|
+
}
|
|
63
|
+
await this.emmitMessage(change.value.metadata, message, contact);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
catch (err) {
|
|
69
|
+
this.logger.error(err);
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
async emmitMessage(metadata, message, contact) {
|
|
73
|
+
const listener = this.listeners.get(metadata.display_phone_number);
|
|
74
|
+
if (!listener) {
|
|
75
|
+
return;
|
|
76
|
+
}
|
|
77
|
+
if (message.type !== 'text') {
|
|
78
|
+
this.logger.error(`message type ${message.type} is not supported yet`);
|
|
79
|
+
return;
|
|
80
|
+
}
|
|
81
|
+
const channelName = 'WhatsAppChannel';
|
|
82
|
+
const chatConnection = {
|
|
83
|
+
id: contact.wa_id,
|
|
84
|
+
chatType: 'PRIVATE',
|
|
85
|
+
channelName,
|
|
86
|
+
};
|
|
87
|
+
await listener({
|
|
88
|
+
chatConnection,
|
|
89
|
+
message: {
|
|
90
|
+
senderName: contact.profile.name,
|
|
91
|
+
text: message.text.body,
|
|
92
|
+
},
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
export { WhatsAppReceiverByCloudApi };
|
|
@@ -1,20 +1,24 @@
|
|
|
1
1
|
import { __decorate, __metadata } from 'tslib';
|
|
2
|
-
import { Logger } from '
|
|
3
|
-
import { WhatsAppSender } from '
|
|
4
|
-
import {
|
|
5
|
-
import '
|
|
6
|
-
import { ChatResolver } from '
|
|
7
|
-
import '
|
|
8
|
-
import {
|
|
9
|
-
import '
|
|
10
|
-
import
|
|
11
|
-
import
|
|
2
|
+
import { Logger } from '../../../../core/logger/Logger.js';
|
|
3
|
+
import { WhatsAppSender } from '../WhatsAppSender.js';
|
|
4
|
+
import { singleton } from '../../../../core/injection/index.js';
|
|
5
|
+
import '../../../../feature/chat-controller/metadata/ControllerMetadataStore.js';
|
|
6
|
+
import { ChatResolver } from '../../../../feature/chat-controller/ChatResolver.js';
|
|
7
|
+
import '../../../../feature/chat-bot/ChatBot.js';
|
|
8
|
+
import { ChatRepository } from '../../../../feature/chat-bot/ChatRepository.js';
|
|
9
|
+
import 'uuid';
|
|
10
|
+
import '../../../../feature/chat-bot/metadata/ChatBotMetadataStore.js';
|
|
11
|
+
import 'reflect-metadata';
|
|
12
|
+
import '../../../../feature/mindset/metadata/MindsetMetadataStore.js';
|
|
13
|
+
import '../../../../feature/mindset/MindsetOperator.js';
|
|
14
|
+
import { WhatsAppRepository } from '../WhatsAppRepository.js';
|
|
12
15
|
|
|
13
16
|
let WhatsAppSenderByCloudApi = class WhatsAppSenderByCloudApi extends WhatsAppSender {
|
|
17
|
+
logger = new Logger('wabot:whatsapp-sender-by-cloud-api');
|
|
14
18
|
constructor(chatRepository, chatResolver, whatsAppRepository) {
|
|
15
|
-
super(
|
|
19
|
+
super(chatRepository, chatResolver, whatsAppRepository);
|
|
16
20
|
}
|
|
17
|
-
async
|
|
21
|
+
async sendWhatsApp(request, options) {
|
|
18
22
|
const whatsApp = await this.whatsAppRepository.findByBusinessNumber(request.from);
|
|
19
23
|
if (!whatsApp) {
|
|
20
24
|
throw new Error(`not found WhatsApp with bussiness number '${request.from}'`);
|
|
@@ -43,8 +47,11 @@ let WhatsAppSenderByCloudApi = class WhatsAppSenderByCloudApi extends WhatsAppSe
|
|
|
43
47
|
if (!response.ok) {
|
|
44
48
|
throw new Error(JSON.stringify(data));
|
|
45
49
|
}
|
|
50
|
+
if (options?.writeChatMemory) {
|
|
51
|
+
await this.writePrivateChatMemory(request.message, request.to);
|
|
52
|
+
}
|
|
46
53
|
}
|
|
47
|
-
async
|
|
54
|
+
async sendWhatsAppTemplate(request, options) {
|
|
48
55
|
const whatsApp = await this.whatsAppRepository.findByBusinessNumber(request.from);
|
|
49
56
|
if (!whatsApp) {
|
|
50
57
|
throw new Error(`not found WhatsApp with bussiness number '${request.from}'`);
|
|
@@ -80,8 +87,12 @@ let WhatsAppSenderByCloudApi = class WhatsAppSenderByCloudApi extends WhatsAppSe
|
|
|
80
87
|
if (!response.ok) {
|
|
81
88
|
throw new Error(JSON.stringify(data));
|
|
82
89
|
}
|
|
90
|
+
if (options?.writeChatMemory) {
|
|
91
|
+
const message = await this.mapTemplateToChatMessage(request);
|
|
92
|
+
await this.writePrivateChatMemory(message, request.to);
|
|
93
|
+
}
|
|
83
94
|
}
|
|
84
|
-
async
|
|
95
|
+
async getWhatsAppTemplate(request) {
|
|
85
96
|
const whatsApp = await this.whatsAppRepository.findByBusinessNumber(request.from);
|
|
86
97
|
if (!whatsApp) {
|
|
87
98
|
throw new Error(`not found WhatsApp with bussiness number '${request.from}'`);
|
|
@@ -104,7 +115,7 @@ let WhatsAppSenderByCloudApi = class WhatsAppSenderByCloudApi extends WhatsAppSe
|
|
|
104
115
|
return template;
|
|
105
116
|
}
|
|
106
117
|
catch (error) {
|
|
107
|
-
|
|
118
|
+
this.logger.error(error);
|
|
108
119
|
throw error;
|
|
109
120
|
}
|
|
110
121
|
}
|
|
@@ -115,10 +126,5 @@ WhatsAppSenderByCloudApi = __decorate([
|
|
|
115
126
|
ChatResolver,
|
|
116
127
|
WhatsAppRepository])
|
|
117
128
|
], WhatsAppSenderByCloudApi);
|
|
118
|
-
if (!WabotDevConnection.isTokenAvailable()) {
|
|
119
|
-
container.register(WhatsAppSender, {
|
|
120
|
-
useClass: WhatsAppSenderByCloudApi,
|
|
121
|
-
});
|
|
122
|
-
}
|
|
123
129
|
|
|
124
130
|
export { WhatsAppSenderByCloudApi };
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
const WHATSAPP_PROXY_SEND_MESSAGE_EVENT = 'sendMessage';
|
|
2
|
+
const WHATSAPP_PROXY_LISTEN_MESSAGE_EVENT = 'listenMessage';
|
|
3
|
+
const WHATSAPP_MESSAGE_EVENT = 'message';
|
|
4
|
+
|
|
5
|
+
export { WHATSAPP_MESSAGE_EVENT, WHATSAPP_PROXY_LISTEN_MESSAGE_EVENT, WHATSAPP_PROXY_SEND_MESSAGE_EVENT };
|