Skip to content

Commit

Permalink
fix(all): sendFile working after path fix.
Browse files Browse the repository at this point in the history
  • Loading branch information
rodrigorodriguez committed Oct 14, 2020
1 parent d8c5458 commit 2c901f4
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 10 deletions.
3 changes: 1 addition & 2 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@
"node_modules/**/*.js"
],
"outFiles": [
"${workspaceRoot}/dist/*.js"
],
"${workspaceRoot}/dist/**/*.js"],
"stopOnEntry": false,
"console": "integratedTerminal"
}
Expand Down
16 changes: 11 additions & 5 deletions packages/core.gbapp/services/GBAPIService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,7 @@ class SysClass {
await timeout(seconds * 1000);
}


public async set(file: string, address:string, value: any): Promise<any> {
public async set(file: string, address: string, value: any): Promise<any> {
try {
let token = await this.min.adminService.acquireElevatedToken(this.min.instance.instanceId);

Expand All @@ -122,7 +121,7 @@ class SysClass {
if (document === undefined) {
throw `File '${file}' specified on save GBasic command SET not found. Check the .gbdata or the .gbdialog associated.`;
}

let body = { values: [[]] };
body.values[0][0] = value;

Expand Down Expand Up @@ -226,7 +225,7 @@ class SysClass {
)
.get();

return results.text[0][0];
return results.text[0][0];
} catch (error) {
GBLog.error(error);
}
Expand Down Expand Up @@ -441,7 +440,14 @@ export class DialogClass {
}

public async sendFile(step, filename, caption) {
let url = urlJoin(GBServer.globals.publicAddress, 'kb', this.min.botId + '.gbkb', 'assets', filename);
let url = urlJoin(
GBServer.globals.publicAddress,
'kb',
`${this.min.botId}.gbai`,
`${this.min.botId}.gbkb`,
'assets',
filename
);
await this.min.conversationalService.sendFile(this.min, step, null, url, caption);
}

Expand Down
4 changes: 2 additions & 2 deletions packages/core.gbapp/services/GBConversationalService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@

'use strict';

import { MessageFactory, RecognizerResult } from 'botbuilder';
import { MessageFactory, RecognizerResult, TurnContext } from 'botbuilder';
import { LuisRecognizer } from 'botbuilder-ai';
import { GBDialogStep, GBLog, GBMinInstance, IGBCoreService } from 'botlib';
import { GBServer } from '../../../src/app';
Expand Down Expand Up @@ -517,7 +517,7 @@ export class GBConversationalService {

try {
step.activeDialog.state.otptions.entities = nlp.entities;
await step.replaceDialog(`/${intent}`, step.activeDialog.state.options );
await step.replaceDialog(`/${intent}`, step.activeDialog.state.options);

return true;
} catch (error) {
Expand Down
3 changes: 2 additions & 1 deletion packages/core.gbapp/services/GBMinService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,8 @@ export class GBMinService {
GBServer.globals.minInstances.push(min);

await this.deployer.deployPackage(min, 'packages/default.gbtheme');



// Install per bot deployed packages.

let packagePath = `work/${min.botId}.gbai/${min.botId}.gbdialog`;
Expand Down

0 comments on commit 2c901f4

Please sign in to comment.