@wabot-dev/framework 0.1.0-beta.29 → 0.1.0-beta.30
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/chat-bot/claude/ClaudeChatBotAdapter.js +107 -0
- package/dist/src/addon/chat-bot/deepseek/DeepSeekChatBotAdapter.js +103 -0
- package/dist/src/{ai → addon/chat-bot}/openia/OpenaiChatAdapter.js +3 -3
- package/dist/src/{pre-made/repository/chat → addon/chat-bot}/pg/PgChatMemory.js +5 -4
- package/dist/src/{pre-made/repository/chat → addon/chat-bot}/pg/PgChatRepository.js +5 -5
- package/dist/src/{pre-made/repository/chat → addon/chat-bot}/ram/RamChatRepository.js +1 -1
- package/dist/src/addon/chat-controller/cmd/@cmd.js +22 -0
- package/dist/src/{channels → addon/chat-controller}/cmd/CmdChannel.js +5 -27
- package/dist/src/{channels → addon/chat-controller}/socket/@socket.js +8 -4
- package/dist/src/{channels → addon/chat-controller}/socket/SocketChannel.js +6 -24
- package/dist/src/{channels → addon/chat-controller}/socket/SocketChannelConfig.js +1 -1
- package/dist/src/{channels → addon/chat-controller}/telegram/@telegram.js +8 -4
- package/dist/src/{channels → addon/chat-controller}/telegram/TelegramChannel.js +5 -23
- package/dist/src/{channels → addon/chat-controller}/whatsapp/@whatsapp.js +8 -4
- package/dist/src/{channels → addon/chat-controller}/whatsapp/EnvWhatsAppRepository.js +2 -2
- package/dist/src/{channels → addon/chat-controller}/whatsapp/PgWhatsAppRepository.js +1 -1
- package/dist/src/{channels/wabot → addon/chat-controller/whatsapp}/WabotDevConnection.js +2 -2
- package/dist/src/{channels → addon/chat-controller}/whatsapp/WhatsApp.js +1 -3
- package/dist/src/{channels → addon/chat-controller}/whatsapp/WhatsAppChannel.js +6 -18
- package/dist/src/{channels → addon/chat-controller}/whatsapp/WhatsAppReceiver.js +13 -10
- package/dist/src/{channels → addon/chat-controller}/whatsapp/WhatsAppReceiverByDevConnection.js +3 -9
- package/dist/src/{channels → addon/chat-controller}/whatsapp/WhatsAppReceiverByWebHook.js +2 -9
- package/dist/src/{channels → addon/chat-controller}/whatsapp/WhatsAppSender.js +12 -7
- package/dist/src/{channels → addon/chat-controller}/whatsapp/WhatsAppSenderByCloudApi.js +10 -7
- package/dist/src/{channels → addon/chat-controller}/whatsapp/WhatsAppSenderByDevConnection.js +12 -9
- package/dist/src/{pre-made/module → addon/mindset}/html/HtmlModule.js +6 -6
- package/dist/src/{repository → addon/repository}/pg/PgCrudRepository.js +1 -1
- package/dist/src/addon/rest-controller/jwt/@jwtGuard.js +17 -0
- package/dist/src/{jwt → addon/rest-controller/jwt}/Jwt.js +7 -2
- package/dist/src/{jwt → addon/rest-controller/jwt}/JwtAccessAndRefreshTokenDto.js +3 -3
- package/dist/src/{jwt → addon/rest-controller/jwt}/JwtConfig.js +2 -2
- package/dist/src/{jwt → addon/rest-controller/jwt}/JwtGuardMiddleware.js +8 -3
- package/dist/src/addon/rest-controller/jwt/JwtRefreshToken.js +9 -0
- package/dist/src/{jwt → addon/rest-controller/jwt}/JwtRefreshTokenRepository.js +2 -2
- package/dist/src/{jwt → addon/rest-controller/jwt}/JwtSigner.js +2 -2
- package/dist/src/{jwt → addon/rest-controller/jwt}/JwtTokenDto.js +5 -5
- package/dist/src/{validation/metadata → addon/validation/is-boolean}/@isBoolean.js +3 -3
- package/dist/src/{validation/metadata → addon/validation/is-date}/@isDate.js +3 -3
- package/dist/src/{validation/metadata → addon/validation/is-not-empty}/@isNotEmpty.js +3 -3
- package/dist/src/{validation/metadata → addon/validation/is-number}/@isNumber.js +3 -3
- package/dist/src/{validation/metadata → addon/validation/is-present}/@isPresent.js +3 -3
- package/dist/src/{validation/metadata → addon/validation/is-string}/@isString.js +3 -3
- package/dist/src/{validation/metadata → addon/validation/max}/@max.js +3 -3
- package/dist/src/{validation/metadata → addon/validation/min}/@min.js +3 -3
- package/dist/src/core/{Entity.js → entity/Entity.js} +1 -1
- package/dist/src/{mapper → core/mapper}/Mapper.js +1 -3
- package/dist/src/{async → feature/async}/@command.js +1 -1
- package/dist/src/{async → feature/async}/@commandHandler.js +1 -1
- package/dist/src/{async → feature/async}/Async.js +1 -1
- package/dist/src/feature/async/Command.js +9 -0
- package/dist/src/{async → feature/async}/CommandMetadataStore.js +1 -1
- package/dist/src/{async → feature/async}/Job.js +2 -4
- package/dist/src/feature/async/JobRepository.js +31 -0
- package/dist/src/{async → feature/async}/JobRunner.js +1 -1
- package/dist/src/{async → feature/async}/JobsEventsHub.js +1 -1
- package/dist/src/{async → feature/async}/runCommandHandlers.js +1 -1
- package/dist/src/{core/chat → feature/chat-bot}/Chat.js +1 -1
- package/dist/src/feature/chat-bot/ChatAdapter.js +7 -0
- package/dist/src/feature/chat-bot/ChatBot.js +50 -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 +5 -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 +1 -1
- package/dist/src/{channels → feature}/http/HttpServerProvider.js +1 -1
- package/dist/src/{mindset → feature/mindset}/MindsetOperator.js +2 -61
- 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/{auth → feature/rest-controller/auth}/Auth.js +2 -2
- package/dist/src/{rest-controller → feature/rest-controller}/metadata/@get.js +1 -1
- package/dist/src/{rest-controller → feature/rest-controller}/metadata/@middleware.js +1 -1
- package/dist/src/{rest-controller → feature/rest-controller}/metadata/@post.js +1 -1
- package/dist/src/{rest-controller → feature/rest-controller}/metadata/@restController.js +1 -1
- package/dist/src/{rest-controller → feature/rest-controller}/metadata/RestControllerMetadataStore.js +1 -1
- package/dist/src/{rest-controller → feature/rest-controller}/runRestControllers.js +6 -24
- package/dist/src/{channels → feature}/socket/SocketServerProvider.js +1 -1
- package/dist/src/index.d.ts +550 -724
- package/dist/src/index.js +118 -133
- package/package.json +1 -1
- package/dist/src/ai/claude/ClaudeChatBotAdapter.js +0 -112
- package/dist/src/ai/deepseek/DeepSeekChatBotAdapter.js +0 -107
- package/dist/src/ai/openia/OpenaiChatBotAdapter.js +0 -88
- package/dist/src/async/Command.js +0 -11
- package/dist/src/async/JobRepository.js +0 -21
- package/dist/src/channels/cmd/@cmd.js +0 -18
- package/dist/src/chatbot/ChatBot.js +0 -50
- package/dist/src/chatbot/ChatBotAdapter.js +0 -70
- 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/IChatAdapter.js +0 -3
- 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/jwt/@jwtGuard.js +0 -34
- package/dist/src/jwt/JwtRefreshToken.js +0 -11
- 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/wabot → addon/chat-controller/whatsapp}/WabotDevSocketContracts.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/{repository → addon/repository}/pg/PgRepositoryBase.js +0 -0
- /package/dist/src/{validation/validators → addon/validation/is-boolean}/validateIsBoolean.js +0 -0
- /package/dist/src/{validation/validators → addon/validation/is-date}/validateIsDate.js +0 -0
- /package/dist/src/{validation/validators → addon/validation/is-not-empty}/validateIsNotEmpty.js +0 -0
- /package/dist/src/{validation/validators → addon/validation/is-number}/validateIsNumber.js +0 -0
- /package/dist/src/{validation/validators → addon/validation/is-present}/validateIsPresent.js +0 -0
- /package/dist/src/{validation/validators → addon/validation/is-string}/validateIsString.js +0 -0
- /package/dist/src/{validation/validators → addon/validation/max}/validateMax.js +0 -0
- /package/dist/src/{validation/validators → addon/validation/min}/validateMin.js +0 -0
- /package/dist/src/{env → core/env}/Env.js +0 -0
- /package/dist/src/{error → core/error}/CustomError.js +0 -0
- /package/dist/src/{injection → core/injection}/Container.js +0 -0
- /package/dist/src/{injection → core/injection}/index.js +0 -0
- /package/dist/src/{logger → core/logger}/Logger.js +0 -0
- /package/dist/src/{random → core/random}/Random.js +0 -0
- /package/dist/src/core/{Storable.js → storable/Storable.js} +0 -0
- /package/dist/src/{validation → core/validation}/metadata/@isArray.js +0 -0
- /package/dist/src/{validation → core/validation}/metadata/@isModel.js +0 -0
- /package/dist/src/{validation → core/validation}/metadata/@isOptional.js +0 -0
- /package/dist/src/{validation → core/validation}/metadata/ValidationMetadataStore.js +0 -0
- /package/dist/src/{validation → core/validation}/modelInfo.js +0 -0
- /package/dist/src/{validation → core/validation}/validate.js +0 -0
- /package/dist/src/{validation → core/validation}/validators/validateArray.js +0 -0
- /package/dist/src/{validation → core/validation}/validators/validateIsOptional.js +0 -0
- /package/dist/src/{validation → core/validation}/validators/validateModel.js +0 -0
- /package/dist/src/{mindset → feature/mindset}/IMindset.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,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);
|
|
@@ -37,16 +37,19 @@ class WhatsAppReceiver {
|
|
|
37
37
|
this.logger.error(`message type ${message.type} is not supported yet`);
|
|
38
38
|
return;
|
|
39
39
|
}
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
40
|
+
const channelName = 'WhatsAppChannel';
|
|
41
|
+
const chatConnection = {
|
|
42
|
+
id: contact.wa_id,
|
|
43
|
+
chatType: 'PRIVATE',
|
|
44
|
+
channelName,
|
|
45
|
+
};
|
|
46
|
+
await listener({
|
|
47
|
+
chatConnection,
|
|
48
|
+
message: {
|
|
49
|
+
senderName: contact.profile.name,
|
|
50
|
+
text: message.text.body,
|
|
51
|
+
},
|
|
52
|
+
});
|
|
50
53
|
}
|
|
51
54
|
}
|
|
52
55
|
|
package/dist/src/{channels → addon/chat-controller}/whatsapp/WhatsAppReceiverByDevConnection.js
RENAMED
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { __decorate, __metadata } from 'tslib';
|
|
2
|
-
import { Logger } from '
|
|
2
|
+
import { Logger } from '../../../core/logger/Logger.js';
|
|
3
3
|
import { WhatsAppReceiver } from './WhatsAppReceiver.js';
|
|
4
|
-
import { WabotDevConnection } from '../wabot/WabotDevConnection.js';
|
|
5
|
-
import { devListentEvent } from '../wabot/WabotDevSocketContracts.js';
|
|
6
4
|
import { singleton } from 'tsyringe';
|
|
7
|
-
import {
|
|
5
|
+
import { WabotDevConnection } from './WabotDevConnection.js';
|
|
6
|
+
import { devListentEvent } from './WabotDevSocketContracts.js';
|
|
8
7
|
|
|
9
8
|
let WhatsAppReceiverByDevConnection = class WhatsAppReceiverByDevConnection extends WhatsAppReceiver {
|
|
10
9
|
wabotDevConnection;
|
|
@@ -23,10 +22,5 @@ WhatsAppReceiverByDevConnection = __decorate([
|
|
|
23
22
|
singleton(),
|
|
24
23
|
__metadata("design:paramtypes", [WabotDevConnection])
|
|
25
24
|
], WhatsAppReceiverByDevConnection);
|
|
26
|
-
if (WabotDevConnection.isTokenAvailable()) {
|
|
27
|
-
container.register(WhatsAppReceiver, {
|
|
28
|
-
useClass: WhatsAppReceiverByDevConnection,
|
|
29
|
-
});
|
|
30
|
-
}
|
|
31
25
|
|
|
32
26
|
export { WhatsAppReceiverByDevConnection };
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
import { __decorate, __metadata } from 'tslib';
|
|
2
|
-
import { Logger } from '
|
|
2
|
+
import { Logger } from '../../../core/logger/Logger.js';
|
|
3
3
|
import { WhatsAppReceiver } from './WhatsAppReceiver.js';
|
|
4
4
|
import { singleton } from 'tsyringe';
|
|
5
|
-
import { ExpressProvider } from '
|
|
5
|
+
import { ExpressProvider } from '../../../feature/express/ExpressProvider.js';
|
|
6
6
|
import { WhatsAppRepository } from './WhatsAppRepository.js';
|
|
7
|
-
import { WabotDevConnection } from '../wabot/WabotDevConnection.js';
|
|
8
|
-
import { container } from '../../injection/index.js';
|
|
9
7
|
|
|
10
8
|
let WhatsAppReceiverByWebHook = class WhatsAppReceiverByWebHook extends WhatsAppReceiver {
|
|
11
9
|
expressProvider;
|
|
@@ -54,10 +52,5 @@ WhatsAppReceiverByWebHook = __decorate([
|
|
|
54
52
|
__metadata("design:paramtypes", [ExpressProvider,
|
|
55
53
|
WhatsAppRepository])
|
|
56
54
|
], WhatsAppReceiverByWebHook);
|
|
57
|
-
if (!WabotDevConnection.isTokenAvailable()) {
|
|
58
|
-
container.register(WhatsAppReceiver, {
|
|
59
|
-
useClass: WhatsAppReceiverByWebHook,
|
|
60
|
-
});
|
|
61
|
-
}
|
|
62
55
|
|
|
63
56
|
export { WhatsAppReceiverByWebHook };
|
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
import { ChatItem } from '../../../feature/chat-bot/ChatItem.js';
|
|
2
|
+
import '../../../core/injection/index.js';
|
|
3
|
+
import 'uuid';
|
|
4
|
+
import '../../../feature/chat-bot/metadata/ChatBotMetadataStore.js';
|
|
5
|
+
|
|
1
6
|
class WhatsAppSender {
|
|
2
7
|
logger;
|
|
3
8
|
chatRepository;
|
|
@@ -68,7 +73,7 @@ class WhatsAppSender {
|
|
|
68
73
|
.join('\n');
|
|
69
74
|
return {
|
|
70
75
|
text: this.replaceTemplateParameters(components, request.templateMessage.parameters),
|
|
71
|
-
|
|
76
|
+
senderName: request.senderName,
|
|
72
77
|
};
|
|
73
78
|
}
|
|
74
79
|
async writePrivateChatMemory(message, to) {
|
|
@@ -78,12 +83,12 @@ class WhatsAppSender {
|
|
|
78
83
|
channelName: 'WhatsAppChannel',
|
|
79
84
|
};
|
|
80
85
|
const chat = await this.chatResolver.resolve(chatConnection);
|
|
81
|
-
await this.chatRepository.findMemory(chat.id);
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
86
|
+
const chatMemory = await this.chatRepository.findMemory(chat.id);
|
|
87
|
+
const chatItem = new ChatItem({
|
|
88
|
+
type: 'botMessage',
|
|
89
|
+
botMessage: message
|
|
90
|
+
});
|
|
91
|
+
await chatMemory.create(chatItem);
|
|
87
92
|
}
|
|
88
93
|
replaceTemplateParameters(template, data) {
|
|
89
94
|
let result = template;
|
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
import { __decorate, __metadata } from 'tslib';
|
|
2
|
-
import { Logger } from '
|
|
2
|
+
import { Logger } from '../../../core/logger/Logger.js';
|
|
3
3
|
import { WhatsAppSender } from './WhatsAppSender.js';
|
|
4
|
-
import {
|
|
5
|
-
import '
|
|
6
|
-
import {
|
|
7
|
-
import '
|
|
8
|
-
import
|
|
9
|
-
import '
|
|
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 { ChatRepository } from '../../../feature/chat-bot/ChatRepository.js';
|
|
8
|
+
import 'uuid';
|
|
9
|
+
import '../../../feature/chat-bot/metadata/ChatBotMetadataStore.js';
|
|
10
|
+
import 'reflect-metadata';
|
|
11
|
+
import '../../../feature/mindset/metadata/MindsetMetadataStore.js';
|
|
12
|
+
import '../../../feature/mindset/MindsetOperator.js';
|
|
10
13
|
import { WhatsAppRepository } from './WhatsAppRepository.js';
|
|
11
14
|
|
|
12
15
|
let WhatsAppSenderByCloudApi = class WhatsAppSenderByCloudApi extends WhatsAppSender {
|
package/dist/src/{channels → addon/chat-controller}/whatsapp/WhatsAppSenderByDevConnection.js
RENAMED
|
@@ -1,15 +1,18 @@
|
|
|
1
1
|
import { __decorate, __metadata } from 'tslib';
|
|
2
2
|
import { WhatsAppSender } from './WhatsAppSender.js';
|
|
3
|
-
import {
|
|
4
|
-
import '
|
|
5
|
-
import {
|
|
6
|
-
import '
|
|
7
|
-
import
|
|
8
|
-
import '
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
3
|
+
import { singleton } from '../../../core/injection/index.js';
|
|
4
|
+
import '../../../feature/chat-controller/metadata/ControllerMetadataStore.js';
|
|
5
|
+
import { ChatResolver } from '../../../feature/chat-controller/ChatResolver.js';
|
|
6
|
+
import { ChatRepository } from '../../../feature/chat-bot/ChatRepository.js';
|
|
7
|
+
import 'uuid';
|
|
8
|
+
import '../../../feature/chat-bot/metadata/ChatBotMetadataStore.js';
|
|
9
|
+
import 'reflect-metadata';
|
|
10
|
+
import '../../../feature/mindset/metadata/MindsetMetadataStore.js';
|
|
11
|
+
import '../../../feature/mindset/MindsetOperator.js';
|
|
12
|
+
import { Logger } from '../../../core/logger/Logger.js';
|
|
12
13
|
import { WhatsAppRepository } from './WhatsAppRepository.js';
|
|
14
|
+
import { WabotDevConnection } from './WabotDevConnection.js';
|
|
15
|
+
import { devEmitEvent } from './WabotDevSocketContracts.js';
|
|
13
16
|
|
|
14
17
|
let WhatsAppSenderByDevConnection = class WhatsAppSenderByDevConnection extends WhatsAppSender {
|
|
15
18
|
wabotDevConnection;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { __decorate, __metadata } from 'tslib';
|
|
2
|
-
import { mindsetFunction } from '../../../mindset/metadata/functions/@mindsetFunction.js';
|
|
2
|
+
import { mindsetFunction } from '../../../feature/mindset/metadata/functions/@mindsetFunction.js';
|
|
3
3
|
import 'reflect-metadata';
|
|
4
|
-
import '../../../injection/index.js';
|
|
5
|
-
import '../../../mindset/metadata/MindsetMetadataStore.js';
|
|
6
|
-
import { mindsetModule } from '../../../mindset/metadata/modules/@mindsetModule.js';
|
|
7
|
-
import { param } from '../../../mindset/metadata/params/@param.js';
|
|
8
|
-
import '../../../mindset/MindsetOperator.js';
|
|
4
|
+
import '../../../core/injection/index.js';
|
|
5
|
+
import '../../../feature/mindset/metadata/MindsetMetadataStore.js';
|
|
6
|
+
import { mindsetModule } from '../../../feature/mindset/metadata/modules/@mindsetModule.js';
|
|
7
|
+
import { param } from '../../../feature/mindset/metadata/params/@param.js';
|
|
8
|
+
import '../../../feature/mindset/MindsetOperator.js';
|
|
9
9
|
import { convert } from 'html-to-text';
|
|
10
10
|
|
|
11
11
|
function toPascalCaseFunctionName(title) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as shortUUID from 'short-uuid';
|
|
2
2
|
import { PgRepositoryBase } from './PgRepositoryBase.js';
|
|
3
|
-
import { CustomError } from '
|
|
3
|
+
import { CustomError } from '../../../core/error/CustomError.js';
|
|
4
4
|
|
|
5
5
|
class PgCrudRepository extends PgRepositoryBase {
|
|
6
6
|
config;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import '../../../core/injection/index.js';
|
|
2
|
+
import '../../../feature/rest-controller/metadata/RestControllerMetadataStore.js';
|
|
3
|
+
import { middleware } from '../../../feature/rest-controller/metadata/@middleware.js';
|
|
4
|
+
import 'path';
|
|
5
|
+
import 'debug';
|
|
6
|
+
import '../../../feature/express/ExpressProvider.js';
|
|
7
|
+
import '../../../core/validation/metadata/ValidationMetadataStore.js';
|
|
8
|
+
import '../../../feature/rest-controller/auth/Auth.js';
|
|
9
|
+
import { JwtGuardMiddleware } from './JwtGuardMiddleware.js';
|
|
10
|
+
|
|
11
|
+
function jwtGuard() {
|
|
12
|
+
return function (target, propertyKey) {
|
|
13
|
+
middleware(JwtGuardMiddleware)(target, propertyKey);
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export { jwtGuard };
|
|
@@ -1,9 +1,14 @@
|
|
|
1
1
|
import { __decorate, __metadata } from 'tslib';
|
|
2
|
-
import { Auth } from '../auth/Auth.js';
|
|
3
2
|
import { JwtSigner } from './JwtSigner.js';
|
|
4
3
|
import { JwtRefreshTokenRepository } from './JwtRefreshTokenRepository.js';
|
|
5
4
|
import { JwtRefreshToken } from './JwtRefreshToken.js';
|
|
6
|
-
import { injectable } from '
|
|
5
|
+
import { injectable } from '../../../core/injection/index.js';
|
|
6
|
+
import '../../../feature/rest-controller/metadata/RestControllerMetadataStore.js';
|
|
7
|
+
import 'path';
|
|
8
|
+
import 'debug';
|
|
9
|
+
import '../../../feature/express/ExpressProvider.js';
|
|
10
|
+
import '../../../core/validation/metadata/ValidationMetadataStore.js';
|
|
11
|
+
import { Auth } from '../../../feature/rest-controller/auth/Auth.js';
|
|
7
12
|
|
|
8
13
|
let Jwt = class Jwt {
|
|
9
14
|
auth;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { __decorate, __metadata } from 'tslib';
|
|
2
|
-
import '
|
|
3
|
-
import '
|
|
4
|
-
import
|
|
2
|
+
import { isModel } from '../../../core/validation/metadata/@isModel.js';
|
|
3
|
+
import '../../../core/injection/index.js';
|
|
4
|
+
import '../../../core/validation/metadata/ValidationMetadataStore.js';
|
|
5
5
|
import { JwtTokenDto } from './JwtTokenDto.js';
|
|
6
6
|
|
|
7
7
|
class JwtAccessAndRefreshTokenDto {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { __decorate, __metadata } from 'tslib';
|
|
2
|
-
import { Env } from '
|
|
3
|
-
import { singleton } from '
|
|
2
|
+
import { Env } from '../../../core/env/Env.js';
|
|
3
|
+
import { singleton } from '../../../core/injection/index.js';
|
|
4
4
|
|
|
5
5
|
let JwtConfig = class JwtConfig {
|
|
6
6
|
secretOrPublicKey;
|
|
@@ -1,9 +1,14 @@
|
|
|
1
1
|
import { __decorate, __metadata } from 'tslib';
|
|
2
|
-
import {
|
|
2
|
+
import { CustomError } from '../../../core/error/CustomError.js';
|
|
3
|
+
import { injectable } from '../../../core/injection/index.js';
|
|
4
|
+
import '../../../feature/rest-controller/metadata/RestControllerMetadataStore.js';
|
|
5
|
+
import 'path';
|
|
6
|
+
import 'debug';
|
|
7
|
+
import '../../../feature/express/ExpressProvider.js';
|
|
8
|
+
import '../../../core/validation/metadata/ValidationMetadataStore.js';
|
|
9
|
+
import { Auth } from '../../../feature/rest-controller/auth/Auth.js';
|
|
3
10
|
import jwt from 'jsonwebtoken';
|
|
4
11
|
import { JwtConfig } from './JwtConfig.js';
|
|
5
|
-
import { injectable } from '../injection/index.js';
|
|
6
|
-
import { CustomError } from '../error/CustomError.js';
|
|
7
12
|
|
|
8
13
|
let JwtGuardMiddleware = class JwtGuardMiddleware {
|
|
9
14
|
config;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { __decorate, __metadata } from 'tslib';
|
|
2
|
-
import { singleton } from '
|
|
2
|
+
import { singleton } from '../../../core/injection/index.js';
|
|
3
3
|
import { JwtRefreshToken } from './JwtRefreshToken.js';
|
|
4
4
|
import { Pool } from 'pg';
|
|
5
|
-
import { PgCrudRepository } from '
|
|
5
|
+
import { PgCrudRepository } from '../../repository/pg/PgCrudRepository.js';
|
|
6
6
|
|
|
7
7
|
let JwtRefreshTokenRepository = class JwtRefreshTokenRepository extends PgCrudRepository {
|
|
8
8
|
constructor(pool) {
|
|
@@ -4,8 +4,8 @@ import jwt from 'jsonwebtoken';
|
|
|
4
4
|
import { JwtTokenDto } from './JwtTokenDto.js';
|
|
5
5
|
import { JwtRefreshToken } from './JwtRefreshToken.js';
|
|
6
6
|
import { JwtAccessAndRefreshTokenDto } from './JwtAccessAndRefreshTokenDto.js';
|
|
7
|
-
import { injectable } from '
|
|
8
|
-
import { Mapper } from '
|
|
7
|
+
import { injectable } from '../../../core/injection/index.js';
|
|
8
|
+
import { Mapper } from '../../../core/mapper/Mapper.js';
|
|
9
9
|
|
|
10
10
|
let JwtSigner = class JwtSigner {
|
|
11
11
|
config;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { __decorate, __metadata } from 'tslib';
|
|
2
|
-
import '
|
|
3
|
-
import '
|
|
4
|
-
import { isDate } from '
|
|
5
|
-
import { isNotEmpty } from '
|
|
6
|
-
import { isString } from '
|
|
2
|
+
import '../../../core/injection/index.js';
|
|
3
|
+
import '../../../core/validation/metadata/ValidationMetadataStore.js';
|
|
4
|
+
import { isDate } from '../../validation/is-date/@isDate.js';
|
|
5
|
+
import { isNotEmpty } from '../../validation/is-not-empty/@isNotEmpty.js';
|
|
6
|
+
import { isString } from '../../validation/is-string/@isString.js';
|
|
7
7
|
|
|
8
8
|
class JwtTokenDto {
|
|
9
9
|
token;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { container } from '
|
|
2
|
-
import { ValidationMetadataStore } from '
|
|
3
|
-
import { validateIsBoolean } from '
|
|
1
|
+
import { container } from '../../../core/injection/index.js';
|
|
2
|
+
import { ValidationMetadataStore } from '../../../core/validation/metadata/ValidationMetadataStore.js';
|
|
3
|
+
import { validateIsBoolean } from './validateIsBoolean.js';
|
|
4
4
|
|
|
5
5
|
function isBoolean() {
|
|
6
6
|
return function (target, propertyKey) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { container } from '
|
|
2
|
-
import { validateIsDate } from '
|
|
3
|
-
import { ValidationMetadataStore } from '
|
|
1
|
+
import { container } from '../../../core/injection/index.js';
|
|
2
|
+
import { validateIsDate } from './validateIsDate.js';
|
|
3
|
+
import { ValidationMetadataStore } from '../../../core/validation/metadata/ValidationMetadataStore.js';
|
|
4
4
|
|
|
5
5
|
function isDate() {
|
|
6
6
|
return function (target, propertyKey) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { container } from '
|
|
2
|
-
import { ValidationMetadataStore } from '
|
|
3
|
-
import { validateIsNotEmpty } from '
|
|
1
|
+
import { container } from '../../../core/injection/index.js';
|
|
2
|
+
import { ValidationMetadataStore } from '../../../core/validation/metadata/ValidationMetadataStore.js';
|
|
3
|
+
import { validateIsNotEmpty } from './validateIsNotEmpty.js';
|
|
4
4
|
|
|
5
5
|
function isNotEmpty() {
|
|
6
6
|
return function (target, propertyKey) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { container } from '
|
|
2
|
-
import { validateIsNumber } from '
|
|
3
|
-
import { ValidationMetadataStore } from '
|
|
1
|
+
import { container } from '../../../core/injection/index.js';
|
|
2
|
+
import { validateIsNumber } from './validateIsNumber.js';
|
|
3
|
+
import { ValidationMetadataStore } from '../../../core/validation/metadata/ValidationMetadataStore.js';
|
|
4
4
|
|
|
5
5
|
function isNumber() {
|
|
6
6
|
return function (target, propertyKey) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { container } from '
|
|
2
|
-
import { ValidationMetadataStore } from '
|
|
3
|
-
import { validateIsPresent } from '
|
|
1
|
+
import { container } from '../../../core/injection/index.js';
|
|
2
|
+
import { ValidationMetadataStore } from '../../../core/validation/metadata/ValidationMetadataStore.js';
|
|
3
|
+
import { validateIsPresent } from './validateIsPresent.js';
|
|
4
4
|
|
|
5
5
|
function isPresent() {
|
|
6
6
|
return function (target, propertyKey) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { container } from '
|
|
2
|
-
import { ValidationMetadataStore } from '
|
|
3
|
-
import { validateIsString } from '
|
|
1
|
+
import { container } from '../../../core/injection/index.js';
|
|
2
|
+
import { ValidationMetadataStore } from '../../../core/validation/metadata/ValidationMetadataStore.js';
|
|
3
|
+
import { validateIsString } from './validateIsString.js';
|
|
4
4
|
|
|
5
5
|
function isString() {
|
|
6
6
|
return function (target, propertyKey) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { container } from '
|
|
2
|
-
import { ValidationMetadataStore } from '
|
|
3
|
-
import { validateMax } from '
|
|
1
|
+
import { container } from '../../../core/injection/index.js';
|
|
2
|
+
import { ValidationMetadataStore } from '../../../core/validation/metadata/ValidationMetadataStore.js';
|
|
3
|
+
import { validateMax } from './validateMax.js';
|
|
4
4
|
|
|
5
5
|
function max(limit) {
|
|
6
6
|
return function (target, propertyKey) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { container } from '
|
|
2
|
-
import { ValidationMetadataStore } from '
|
|
3
|
-
import { validateMin } from '
|
|
1
|
+
import { container } from '../../../core/injection/index.js';
|
|
2
|
+
import { ValidationMetadataStore } from '../../../core/validation/metadata/ValidationMetadataStore.js';
|
|
3
|
+
import { validateMin } from './validateMin.js';
|
|
4
4
|
|
|
5
5
|
function min(limit) {
|
|
6
6
|
return function (target, propertyKey) {
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
import '../
|
|
2
|
-
import { Storable } from '../core/Storable.js';
|
|
3
|
-
import '../core/user/IUserRepository.js';
|
|
1
|
+
import { Storable } from '../storable/Storable.js';
|
|
4
2
|
import { CustomError } from '../error/CustomError.js';
|
|
5
3
|
import '../injection/index.js';
|
|
6
4
|
import '../validation/metadata/ValidationMetadataStore.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { CommandMetadataStore } from './CommandMetadataStore.js';
|
|
2
|
-
import { container, injectable } from '
|
|
2
|
+
import { container, injectable } from '../../core/injection/index.js';
|
|
3
3
|
|
|
4
4
|
function commandHandler(config) {
|
|
5
5
|
return function (target) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { __decorate, __metadata } from 'tslib';
|
|
2
|
-
import { singleton } from '
|
|
2
|
+
import { singleton } from '../../core/injection/index.js';
|
|
3
3
|
import { CommandMetadataStore } from './CommandMetadataStore.js';
|
|
4
4
|
import { Job } from './Job.js';
|
|
5
5
|
import { JobRepository } from './JobRepository.js';
|
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
import '
|
|
2
|
-
import {
|
|
3
|
-
import '../core/user/IUserRepository.js';
|
|
4
|
-
import { CustomError } from '../error/CustomError.js';
|
|
1
|
+
import { Entity } from '../../core/entity/Entity.js';
|
|
2
|
+
import { CustomError } from '../../core/error/CustomError.js';
|
|
5
3
|
|
|
6
4
|
class Job extends Entity {
|
|
7
5
|
get commandName() {
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { __decorate } from 'tslib';
|
|
2
|
+
import { singleton } from '../../core/injection/index.js';
|
|
3
|
+
|
|
4
|
+
let JobRepository = class JobRepository {
|
|
5
|
+
find(id) {
|
|
6
|
+
throw new Error('Method not implemented.');
|
|
7
|
+
}
|
|
8
|
+
findOrThrow(id) {
|
|
9
|
+
throw new Error('Method not implemented.');
|
|
10
|
+
}
|
|
11
|
+
findByIds(ids) {
|
|
12
|
+
throw new Error('Method not implemented.');
|
|
13
|
+
}
|
|
14
|
+
findAll(id) {
|
|
15
|
+
throw new Error('Method not implemented.');
|
|
16
|
+
}
|
|
17
|
+
create(item) {
|
|
18
|
+
throw new Error('Method not implemented.');
|
|
19
|
+
}
|
|
20
|
+
update(item) {
|
|
21
|
+
throw new Error('Method not implemented.');
|
|
22
|
+
}
|
|
23
|
+
discard(item) {
|
|
24
|
+
throw new Error('Method not implemented.');
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
JobRepository = __decorate([
|
|
28
|
+
singleton()
|
|
29
|
+
], JobRepository);
|
|
30
|
+
|
|
31
|
+
export { JobRepository };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { __decorate, __metadata } from 'tslib';
|
|
2
2
|
import { CommandMetadataStore } from './CommandMetadataStore.js';
|
|
3
3
|
import { JobRepository } from './JobRepository.js';
|
|
4
|
-
import { singleton, container } from '
|
|
4
|
+
import { singleton, container } from '../../core/injection/index.js';
|
|
5
5
|
|
|
6
6
|
let JobRunner = class JobRunner {
|
|
7
7
|
jobRepository;
|
|
@@ -2,7 +2,7 @@ import { JobsEventsHub } from './JobsEventsHub.js';
|
|
|
2
2
|
import { JobRunner } from './JobRunner.js';
|
|
3
3
|
import { CommandMetadataStore } from './CommandMetadataStore.js';
|
|
4
4
|
import { JobRepository } from './JobRepository.js';
|
|
5
|
-
import { container } from '
|
|
5
|
+
import { container } from '../../core/injection/index.js';
|
|
6
6
|
|
|
7
7
|
function runAsyncCommandHandlers(handlers) {
|
|
8
8
|
const eventsHub = container.resolve(JobsEventsHub);
|