new(core.gbapp):New BASIC keywords and saving to MSExcel.

This commit is contained in:
Rodrigo Rodriguez 2020-05-11 10:46:01 -03:00
parent 0218a0c0f3
commit 31ea0e541c
6 changed files with 9 additions and 9 deletions

View file

@ -64,7 +64,7 @@ export class SwitchBotDialog extends IGBDialog {
let sec = new SecService();
let from = step.context.activity.from.id;
const botId = step.result;
const instance = await min.core.loadInstance(botId);
const instance = await min.core.loadInstanceByBotId(botId);
await sec.updateUserInstance(from, instance.instanceId);
await step.context.sendActivity(`Opa, vamos lá!`);

View file

@ -233,7 +233,7 @@ export class GBCoreService implements IGBCoreService {
/**
* Loads just one Bot instance.
*/
public async loadInstance(botId: string): Promise<IGBInstance> {
public async loadInstanceByBotId(botId: string): Promise<IGBInstance> {
const options = { where: {} };
options.where = { botId: botId };

View file

@ -213,7 +213,7 @@ export class GBDeployer implements IGBDeployer {
} else {
let botId = GBConfigService.get('BOT_ID');
let bootInstance = await this.core.loadInstance(botId);
let bootInstance = await this.core.loadInstanceByBotId(botId);
instance.searchHost = bootInstance.searchHost;
instance.searchIndex = bootInstance.searchIndex;

View file

@ -61,7 +61,7 @@ export class GBImporter {
if (botId === undefined) {
botId = GBConfigService.get('BOT_ID');
}
const instance = await this.core.loadInstance(botId);
const instance = await this.core.loadInstanceByBotId(botId);
if (instance != null && instance.botId === null) {
console.log(`Null BotId after load instance with botId: ${botId}.`);

View file

@ -147,7 +147,7 @@ export class GBMinService {
activeMin = toSwitchMin ? toSwitchMin : GBServer.globals.minBoot;
let sec = new SecService();
const instance = await this.core.loadInstance(activeMin.botId);
const instance = await this.core.loadInstanceByBotId(activeMin.botId);
let user = await sec.getUserFromSystemId(id);
if (user === null) {
@ -158,7 +158,7 @@ export class GBMinService {
// User wants to switch bots.
if (toSwitchMin !== undefined) {
const botId = text;
const instance = await this.core.loadInstance(botId);
const instance = await this.core.loadInstanceByBotId(botId);
await sec.updateUserInstance(id, instance.instanceId);
await (activeMin as any).whatsAppDirectLine.resetConversationId(id);
@ -300,7 +300,7 @@ export class GBMinService {
if (botId === '[default]' || botId === undefined) {
botId = GBConfigService.get('BOT_ID');
}
const instance = await this.core.loadInstance(botId);
const instance = await this.core.loadInstanceByBotId(botId);
if (instance !== null) {
const webchatTokenContainer = await this.getWebchatToken(instance);
const speechToken = instance.speechKey != null ? await this.getSTSToken(instance) : null;
@ -411,7 +411,7 @@ export class GBMinService {
min.adminService = this.adminService;
min.deployService = this.deployer;
min.kbService = new KBService(this.core.sequelize);
min.instance = await this.core.loadInstance(min.botId);
min.instance = await this.core.loadInstanceByBotId(min.botId);
min.cbMap = {};
min.scriptMap = {};
min.sandBoxMap = {};

View file

@ -560,7 +560,7 @@ export class KBService implements IGBKBService {
GBLog.info(`[GBDeployer] Opening package: ${localPath}`);
const packageObject = JSON.parse(Fs.readFileSync(urlJoin(localPath, 'package.json'), 'utf8'));
const instance = await core.loadInstance(packageObject.botId);
const instance = await core.loadInstanceByBotId(packageObject.botId);
GBLog.info(`[GBDeployer] Importing: ${localPath}`);
const p = await deployer.deployPackageToStorage(instance.instanceId, packageName);
await this.importKbPackage(localPath, p, instance);