fix(basic.gblib): update ChatServices.ts #420

Closed
eltociear wants to merge 2540 commits from patch-1 into main
2 changed files with 15 additions and 3 deletions
Showing only changes of commit d7e00a2154 - Show all commits

View file

@ -108,6 +108,10 @@ export class GBDeployer implements IGBDeployer {
if (min['cacheToken']) { if (min['cacheToken']) {
return min['cacheToken']; return min['cacheToken'];
} else { } else {
// Get token as root only if the bot does not have
// an custom tenant for retrieving packages.
token = await (min.adminService as any)['acquireElevatedToken'] token = await (min.adminService as any)['acquireElevatedToken']
(min.instance.instanceId, min.instance.authenticatorTenant?false:true); (min.instance.instanceId, min.instance.authenticatorTenant?false:true);

View file

@ -60,10 +60,18 @@ export class GBImporter {
localPath: string, localPath: string,
additionalInstance: IGBInstance = null additionalInstance: IGBInstance = null
) { ) {
const settingsJson = JSON.parse(Fs.readFileSync(urlJoin(localPath, 'settings.json'), 'utf8')); const file = urlJoin(localPath, 'settings.json');
if (botId === undefined) {
botId = settingsJson.botId; let settingsJson = {botId: botId};
if (Fs.existsSync(file)){
settingsJson = JSON.parse(Fs.readFileSync(file, 'utf8'));
if (botId === undefined) {
botId = settingsJson.botId;
}
} }
let instance: IGBInstance; let instance: IGBInstance;
if (botId === undefined) { if (botId === undefined) {
botId = GBConfigService.get('BOT_ID'); botId = GBConfigService.get('BOT_ID');