feat(DialogKeywords): integrate MinIO client for file handling in gbcluster mode
Some checks failed
GBCI / build (push) Failing after 3h14m23s
Some checks failed
GBCI / build (push) Failing after 3h14m23s
This commit is contained in:
parent
7035c6799f
commit
d2851aabd6
1 changed files with 210 additions and 201 deletions
|
@ -501,8 +501,7 @@ export class GBMinService {
|
|||
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)) {
|
||||
|
|
Loading…
Add table
Reference in a new issue