feat(DialogKeywords): integrate MinIO client for file handling in gbcluster mode
Some checks failed
GBCI / build (push) Failing after 4m4s
Some checks failed
GBCI / build (push) Failing after 4m4s
This commit is contained in:
parent
0a69ff1d8b
commit
7035c6799f
2 changed files with 11 additions and 4 deletions
|
|
@ -1528,9 +1528,9 @@ export class DialogKeywords {
|
||||||
|
|
||||||
|
|
||||||
const ext = path.extname(filename);
|
const ext = path.extname(filename);
|
||||||
const gbaiName = GBUtil.getGBAIPath(min.botId);
|
|
||||||
|
|
||||||
const fileUrl = urlJoin('/', gbaiName, `${min.botId}.gbdrive`, filename);
|
const fileUrl = urlJoin('/', `${min.botId}.gbdrive`, filename);
|
||||||
GBLogEx.info(min, `Direct send from .gbdrive: ${fileUrl} to ${mobile}.`);
|
GBLogEx.info(min, `Direct send from .gbdrive: ${fileUrl} to ${mobile}.`);
|
||||||
|
|
||||||
const fileOnly = fileUrl.substring(fileUrl.lastIndexOf('/') + 1);
|
const fileOnly = fileUrl.substring(fileUrl.lastIndexOf('/') + 1);
|
||||||
|
|
|
||||||
|
|
@ -1075,11 +1075,19 @@ export class GBMinService {
|
||||||
let user = await sec.ensureUser(min, member.id, member.name, '', 'web', member.name, null);
|
let user = await sec.ensureUser(min, member.id, member.name, '', 'web', member.name, null);
|
||||||
const userId = user.userId;
|
const userId = user.userId;
|
||||||
const params = user.params ? JSON.parse(user.params) : {};
|
const params = user.params ? JSON.parse(user.params) : {};
|
||||||
|
const t = new SystemKeywords();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const conversationReference = JSON.stringify(TurnContext.getConversationReference(context.activity));
|
const conversationReference = JSON.stringify(TurnContext.getConversationReference(context.activity));
|
||||||
user = await sec.updateConversationReferenceById(user.userId, conversationReference);
|
user = await sec.updateConversationReferenceById(user.userId, conversationReference);
|
||||||
|
|
||||||
|
const auth = min.core.getParam(min.instance, 'Enable Authentication', null);
|
||||||
|
|
||||||
|
if (auth && await t.find({pid: pid, "users.csv", `key={member.id}`})){
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// First time processing.
|
// First time processing.
|
||||||
|
|
||||||
if (!params.loaded) {
|
if (!params.loaded) {
|
||||||
|
|
@ -1158,7 +1166,6 @@ export class GBMinService {
|
||||||
);
|
);
|
||||||
const botToken = await credentials.getToken();
|
const botToken = await credentials.getToken();
|
||||||
const headers = { Authorization: `Bearer ${botToken}` };
|
const headers = { Authorization: `Bearer ${botToken}` };
|
||||||
const t = new SystemKeywords();
|
|
||||||
const data = await t.getByHttp({
|
const data = await t.getByHttp({
|
||||||
pid: 0,
|
pid: 0,
|
||||||
url: file.contentUrl,
|
url: file.contentUrl,
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue