new(core.gbapp):New BASIC keywords and saving to MSExcel.
This commit is contained in:
parent
0218a0c0f3
commit
31ea0e541c
6 changed files with 9 additions and 9 deletions
|
@ -64,7 +64,7 @@ export class SwitchBotDialog extends IGBDialog {
|
||||||
let sec = new SecService();
|
let sec = new SecService();
|
||||||
let from = step.context.activity.from.id;
|
let from = step.context.activity.from.id;
|
||||||
const botId = step.result;
|
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 sec.updateUserInstance(from, instance.instanceId);
|
||||||
await step.context.sendActivity(`Opa, vamos lá!`);
|
await step.context.sendActivity(`Opa, vamos lá!`);
|
||||||
|
|
||||||
|
|
|
@ -233,7 +233,7 @@ export class GBCoreService implements IGBCoreService {
|
||||||
/**
|
/**
|
||||||
* Loads just one Bot instance.
|
* Loads just one Bot instance.
|
||||||
*/
|
*/
|
||||||
public async loadInstance(botId: string): Promise<IGBInstance> {
|
public async loadInstanceByBotId(botId: string): Promise<IGBInstance> {
|
||||||
const options = { where: {} };
|
const options = { where: {} };
|
||||||
options.where = { botId: botId };
|
options.where = { botId: botId };
|
||||||
|
|
||||||
|
|
|
@ -213,7 +213,7 @@ export class GBDeployer implements IGBDeployer {
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
let botId = GBConfigService.get('BOT_ID');
|
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.searchHost = bootInstance.searchHost;
|
||||||
instance.searchIndex = bootInstance.searchIndex;
|
instance.searchIndex = bootInstance.searchIndex;
|
||||||
|
|
|
@ -61,7 +61,7 @@ export class GBImporter {
|
||||||
if (botId === undefined) {
|
if (botId === undefined) {
|
||||||
botId = GBConfigService.get('BOT_ID');
|
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) {
|
if (instance != null && instance.botId === null) {
|
||||||
console.log(`Null BotId after load instance with botId: ${botId}.`);
|
console.log(`Null BotId after load instance with botId: ${botId}.`);
|
||||||
|
|
|
@ -147,7 +147,7 @@ export class GBMinService {
|
||||||
activeMin = toSwitchMin ? toSwitchMin : GBServer.globals.minBoot;
|
activeMin = toSwitchMin ? toSwitchMin : GBServer.globals.minBoot;
|
||||||
|
|
||||||
let sec = new SecService();
|
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);
|
let user = await sec.getUserFromSystemId(id);
|
||||||
|
|
||||||
if (user === null) {
|
if (user === null) {
|
||||||
|
@ -158,7 +158,7 @@ export class GBMinService {
|
||||||
// User wants to switch bots.
|
// User wants to switch bots.
|
||||||
if (toSwitchMin !== undefined) {
|
if (toSwitchMin !== undefined) {
|
||||||
const botId = text;
|
const botId = text;
|
||||||
const instance = await this.core.loadInstance(botId);
|
const instance = await this.core.loadInstanceByBotId(botId);
|
||||||
await sec.updateUserInstance(id, instance.instanceId);
|
await sec.updateUserInstance(id, instance.instanceId);
|
||||||
|
|
||||||
await (activeMin as any).whatsAppDirectLine.resetConversationId(id);
|
await (activeMin as any).whatsAppDirectLine.resetConversationId(id);
|
||||||
|
@ -300,7 +300,7 @@ export class GBMinService {
|
||||||
if (botId === '[default]' || botId === undefined) {
|
if (botId === '[default]' || botId === undefined) {
|
||||||
botId = GBConfigService.get('BOT_ID');
|
botId = GBConfigService.get('BOT_ID');
|
||||||
}
|
}
|
||||||
const instance = await this.core.loadInstance(botId);
|
const instance = await this.core.loadInstanceByBotId(botId);
|
||||||
if (instance !== null) {
|
if (instance !== null) {
|
||||||
const webchatTokenContainer = await this.getWebchatToken(instance);
|
const webchatTokenContainer = await this.getWebchatToken(instance);
|
||||||
const speechToken = instance.speechKey != null ? await this.getSTSToken(instance) : null;
|
const speechToken = instance.speechKey != null ? await this.getSTSToken(instance) : null;
|
||||||
|
@ -411,7 +411,7 @@ export class GBMinService {
|
||||||
min.adminService = this.adminService;
|
min.adminService = this.adminService;
|
||||||
min.deployService = this.deployer;
|
min.deployService = this.deployer;
|
||||||
min.kbService = new KBService(this.core.sequelize);
|
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.cbMap = {};
|
||||||
min.scriptMap = {};
|
min.scriptMap = {};
|
||||||
min.sandBoxMap = {};
|
min.sandBoxMap = {};
|
||||||
|
|
|
@ -560,7 +560,7 @@ export class KBService implements IGBKBService {
|
||||||
GBLog.info(`[GBDeployer] Opening package: ${localPath}`);
|
GBLog.info(`[GBDeployer] Opening package: ${localPath}`);
|
||||||
const packageObject = JSON.parse(Fs.readFileSync(urlJoin(localPath, 'package.json'), 'utf8'));
|
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}`);
|
GBLog.info(`[GBDeployer] Importing: ${localPath}`);
|
||||||
const p = await deployer.deployPackageToStorage(instance.instanceId, packageName);
|
const p = await deployer.deployPackageToStorage(instance.instanceId, packageName);
|
||||||
await this.importKbPackage(localPath, p, instance);
|
await this.importKbPackage(localPath, p, instance);
|
||||||
|
|
Loading…
Add table
Reference in a new issue