feat(DialogKeywords): integrate MinIO client for file handling in gbcluster mode
Some checks failed
GBCI / build (push) Failing after 3h14m23s

This commit is contained in:
Rodrigo Rodriguez (Pragmatismo) 2025-04-15 13:56:56 -03:00
parent 7035c6799f
commit d2851aabd6

View file

@ -496,13 +496,12 @@ export class GBMinService {
if (!req.body.object) {
if (req.body.To){
if (req.body.To) {
const to = req.body.To.replace(/whatsapp\:\+/gi, '');
whatsAppDirectLine = WhatsappDirectLine.botsByNumber[to];
}
else
{
else {
const minBoot = GBServer.globals.minBoot as GBMinInstance;
whatsAppDirectLine = minBoot.whatsAppDirectLine;
}
@ -1080,11 +1079,37 @@ export class GBMinService {
try {
const conversationReference = JSON.stringify(TurnContext.getConversationReference(context.activity));
user = await sec.updateConversationReferenceById(user.userId, conversationReference);
let conversationId = step.context.activity.conversation.id;
let pid = GBMinService.pidsConversation[conversationId];
if (!pid) {
pid = step.context.activity['pid'];
if (!pid) {
pid = WhatsappDirectLine.pidByNumber[context.activity.from.id];
if (!pid) {
pid = GBVMService.createProcessInfo(user, min, step.context.activity.channelId, null, step);
}
}
}
GBMinService.pidsConversation[conversationId] = pid;
step.context.activity['pid'] = pid;
const auth = min.core.getParam(min.instance, 'Enable Authentication', null);
if (auth && await t.find({pid: pid, "users.csv", `key={member.id}`})){
if (auth) {
const res = await t.find({ pid: pid, handle: "users.csv", args: [`key={member.id}`] });
if (!res) {
await min.conversationalService.sendText(
min,
step,
'Sorry, not authorized.'
);
res.end();
}
}
@ -1132,22 +1157,6 @@ export class GBMinService {
}
}
let conversationId = step.context.activity.conversation.id;
let pid = GBMinService.pidsConversation[conversationId];
if (!pid) {
pid = step.context.activity['pid'];
if (!pid) {
pid = WhatsappDirectLine.pidByNumber[context.activity.from.id];
if (!pid) {
pid = GBVMService.createProcessInfo(user, min, step.context.activity.channelId, null, step);
}
}
}
GBMinService.pidsConversation[conversationId] = pid;
step.context.activity['pid'] = pid;
const notes = min.core.getParam(min.instance, 'Notes', null);
if (await this.handleUploads(min, step, user, params, notes != null)) {