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

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

View file

@ -170,7 +170,7 @@ export class GBAdminService implements IGBAdminService {
// .gbot packages are handled using storage API, so no download
// of local resources is required.
const gbai = DialogKeywords.getGBAIPath(min.instance.botId);
await deployer['undeployPackageFromPackageName'](min.instance, packageName);
await deployer['downloadFolder'](min,
Path.join('work', `${gbai}`),
Path.basename(localFolder));

View file

@ -662,7 +662,15 @@ export class GBDeployer implements IGBDeployer {
}
}
/**
* Removes the package local files from cache.
*/
public async cleanupPackage(instance: IGBInstance, packageName: string) {
const path = DialogKeywords.getGBAIPath(instance.botId, null, packageName);
const localFolder = Path.join('work', path);
rimraf.sync(localFolder);
}
/**
* Removes the package from the storage and local work folders.
*/

View file

@ -1019,7 +1019,7 @@ export class KBService implements IGBKBService {
const packageName = Path.basename(localPath);
const instance = await core.loadInstanceByBotId(min.botId);
GBLog.info(`[GBDeployer] Importing: ${localPath}`);
await deployer['cleanupPackage'](min.instance, packageName);
const p = await deployer.deployPackageToStorage(instance.instanceId, packageName);
await this.importKbPackage(min, localPath, p, instance);
GBDeployer.mountGBKBAssets(packageName, min.botId, localPath);