Merge branch 'main' of https://github.com/GeneralBots/BotServer
This commit is contained in:
commit
2d4b735724
6 changed files with 38 additions and 15 deletions
|
@ -1,3 +1,10 @@
|
||||||
|
## [2.4.15](https://github.com/GeneralBots/BotServer/compare/2.4.14...2.4.15) (2023-07-19)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **all:** Create bot working again. ([4eecd5a](https://github.com/GeneralBots/BotServer/commit/4eecd5acec56547e5b5ab064f52dc81eb451e1a4))
|
||||||
|
|
||||||
## [2.4.14](https://github.com/GeneralBots/BotServer/compare/2.4.13...2.4.14) (2023-07-18)
|
## [2.4.14](https://github.com/GeneralBots/BotServer/compare/2.4.13...2.4.14) (2023-07-18)
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "botserver",
|
"name": "botserver",
|
||||||
"version": "2.4.14",
|
"version": "2.4.15",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"description": "General Bot Community Edition open-core server.",
|
"description": "General Bot Community Edition open-core server.",
|
||||||
"main": "./boot.mjs",
|
"main": "./boot.mjs",
|
||||||
|
|
|
@ -224,9 +224,12 @@ export class GBAdminService implements IGBAdminService {
|
||||||
return obj.value;
|
return obj.value;
|
||||||
}
|
}
|
||||||
|
|
||||||
public async acquireElevatedToken(instanceId: number): Promise<string> {
|
public async acquireElevatedToken(instanceId: number, root: boolean = false): Promise<string> {
|
||||||
const minBoot = GBServer.globals.minBoot;
|
|
||||||
instanceId = minBoot.instance.instanceId;
|
if (root){
|
||||||
|
const minBoot = GBServer.globals.minBoot;
|
||||||
|
instanceId = minBoot.instance.instanceId;
|
||||||
|
}
|
||||||
let expiresOnV;
|
let expiresOnV;
|
||||||
try {
|
try {
|
||||||
expiresOnV = await this.getValue(instanceId, 'expiresOn');
|
expiresOnV = await this.getValue(instanceId, 'expiresOn');
|
||||||
|
|
|
@ -104,7 +104,7 @@ export class GBDeployer implements IGBDeployer {
|
||||||
* Retrives token and initialize drive client API.
|
* Retrives token and initialize drive client API.
|
||||||
*/
|
*/
|
||||||
public static async internalGetDriveClient(min: GBMinInstance) {
|
public static async internalGetDriveClient(min: GBMinInstance) {
|
||||||
const token = await min.adminService.acquireElevatedToken(min.instance.instanceId);
|
const token = await min.adminService['acquireElevatedToken'](min.instance.instanceId, true);
|
||||||
const siteId = process.env.STORAGE_SITE_ID;
|
const siteId = process.env.STORAGE_SITE_ID;
|
||||||
const libraryId = process.env.STORAGE_LIBRARY;
|
const libraryId = process.env.STORAGE_LIBRARY;
|
||||||
|
|
||||||
|
@ -209,7 +209,7 @@ export class GBDeployer implements IGBDeployer {
|
||||||
|
|
||||||
// Gets the access token to perform service operations.
|
// Gets the access token to perform service operations.
|
||||||
|
|
||||||
const accessToken = await GBServer.globals.minBoot.adminService.acquireElevatedToken(bootInstance.instanceId);
|
const accessToken = await min.adminService['acquireElevatedToken'](min.instance.instanceId, true);
|
||||||
|
|
||||||
// Creates the MSFT application that will be associated to the bot.
|
// Creates the MSFT application that will be associated to the bot.
|
||||||
|
|
||||||
|
@ -401,7 +401,7 @@ export class GBDeployer implements IGBDeployer {
|
||||||
|
|
||||||
// Connects to MSFT storage.
|
// Connects to MSFT storage.
|
||||||
|
|
||||||
const token = await min.adminService.acquireElevatedToken(min.instance.instanceId);
|
const token = await min.adminService['acquireElevatedToken'](min.instance.instanceId, true);
|
||||||
const client = MicrosoftGraph.Client.init({
|
const client = MicrosoftGraph.Client.init({
|
||||||
authProvider: done => {
|
authProvider: done => {
|
||||||
done(null, token);
|
done(null, token);
|
||||||
|
|
|
@ -725,7 +725,7 @@ export class GBMinService {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
min.appPackages = await this.core['getApplicationsByInstanceId'] (appPackages, min.instance.instanceId);
|
min.appPackages = await this.core['getApplicationsByInstanceId'](appPackages, min.instance.instanceId);
|
||||||
|
|
||||||
// Creates a hub of services available in .gbapps.
|
// Creates a hub of services available in .gbapps.
|
||||||
|
|
||||||
|
@ -1050,8 +1050,7 @@ export class GBMinService {
|
||||||
await this.processEventActivity(min, user, context, step);
|
await this.processEventActivity(min, user, context, step);
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
const msg = `ERROR: ${error.message} ${error.stack} ${error.error ? error.error.body : ''} ${error.error ? (error.error.stack ? error.error.stack : '') : ''
|
const msg = `ERROR: ${error.message} ${error.stack} ${error.error ? error.error.body : ''} ${error.error ? (error.error.stack ? error.error.stack : '') : '' }`;
|
||||||
}`;
|
|
||||||
GBLog.error(msg);
|
GBLog.error(msg);
|
||||||
|
|
||||||
await min.conversationalService.sendText(
|
await min.conversationalService.sendText(
|
||||||
|
@ -1477,7 +1476,21 @@ export class GBMinService {
|
||||||
|
|
||||||
// If there is a dialog in course, continue to the next step.
|
// If there is a dialog in course, continue to the next step.
|
||||||
else if (step.activeDialog !== undefined) {
|
else if (step.activeDialog !== undefined) {
|
||||||
await step.continueDialog();
|
|
||||||
|
try {
|
||||||
|
await step.continueDialog();
|
||||||
|
|
||||||
|
} catch (error) {
|
||||||
|
const msg = `ERROR: ${error.message} ${error.stack} ${error.error ? error.error.body : ''} ${error.error ? (error.error.stack ? error.error.stack : '') : '' }`;
|
||||||
|
GBLog.error(msg);
|
||||||
|
await min.conversationalService.sendText(
|
||||||
|
min,
|
||||||
|
step,
|
||||||
|
Messages[step.context.activity.locale].very_sorry_about_error
|
||||||
|
);
|
||||||
|
await step.beginDialog('/ask', { isReturning: true });
|
||||||
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
const startDialog = user.hearOnDialog
|
const startDialog = user.hearOnDialog
|
||||||
? user.hearOnDialog
|
? user.hearOnDialog
|
||||||
|
|
|
@ -179,7 +179,7 @@ export class SecService extends GBService {
|
||||||
await CollectionUtil.asyncForEach(list, async item => {
|
await CollectionUtil.asyncForEach(list, async item => {
|
||||||
if (
|
if (
|
||||||
item !== undefined &&
|
item !== undefined &&
|
||||||
agentSystemId === undefined &&
|
!agentSystemId &&
|
||||||
item !== userSystemId &&
|
item !== userSystemId &&
|
||||||
!(await this.isAgentSystemId(item))
|
!(await this.isAgentSystemId(item))
|
||||||
) {
|
) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue