fix(core.gbapp): Refactoring in MD fix in disabling auto-compiling of .gbapps.

This commit is contained in:
Rodrigo Rodriguez 2020-03-31 09:11:04 -03:00
parent ade960ac3e
commit d9857b9880
6 changed files with 56 additions and 50 deletions

16
package-lock.json generated
View file

@ -3118,9 +3118,9 @@
},
"dependencies": {
"@types/node": {
"version": "10.17.17",
"resolved": "https://registry.npmjs.org/@types/node/-/node-10.17.17.tgz",
"integrity": "sha512-gpNnRnZP3VWzzj5k3qrpRC6Rk3H/uclhAVo1aIvwzK5p5cOrs9yEyQ8H/HBsBY0u5rrWxXEiVPQ0dEB6pkjE8Q=="
"version": "10.17.18",
"resolved": "https://registry.npmjs.org/@types/node/-/node-10.17.18.tgz",
"integrity": "sha512-DQ2hl/Jl3g33KuAUOcMrcAOtsbzb+y/ufakzAdeK9z/H/xsvkpbETZZbPNMIiQuk24f5ZRMCcZIViAwyFIiKmg=="
}
}
},
@ -3250,9 +3250,9 @@
}
},
"botlib": {
"version": "1.4.2",
"resolved": "https://registry.npmjs.org/botlib/-/botlib-1.4.2.tgz",
"integrity": "sha512-38e/6nA0+BlZZqDitXkJZhdQoyd1BGf0ActvMjk8SljqHp6mPTwN6kgnJSccFhMSJeFgOwu+bYC+R5RVUmS+mg==",
"version": "1.4.3",
"resolved": "https://registry.npmjs.org/botlib/-/botlib-1.4.3.tgz",
"integrity": "sha512-XLE6ZarAYomTfTsOsU+UeK38ec/yTgJTakNFUqzxz51srpLC35HitKH2crUr6tHv3d6Q4wfTinhclRv+1HBONA==",
"requires": {
"async": "3.1.0",
"botbuilder": "4.7.0",
@ -3266,8 +3266,8 @@
"pragmatismo-io-framework": "1.0.20",
"reflect-metadata": "0.1.13",
"sequelize": "5.21.5",
"sequelize-typescript": "^1.1.0",
"underscore": "^1.9.1",
"sequelize-typescript": "1.1.0",
"underscore": "1.9.1",
"wait-until": "0.0.2",
"winston": "3.2.1"
},

View file

@ -63,7 +63,7 @@
"botbuilder-ai": "4.7.0",
"botbuilder-dialogs": "4.7.0",
"botframework-connector": "4.7.0",
"botlib": "1.4.2",
"botlib": "1.4.4",
"chai": "4.2.0",
"cli-spinner": "0.2.10",
"csv-parse": "4.8.3",

View file

@ -80,7 +80,7 @@ export class GBConversationalService implements IGBConversationalService {
return step.context.activity.locale;
}
public async sendFile(min: GBMinInstance, step: GBDialogStep, url: string): Promise<any> {
public async sendFile(min: GBMinInstance, step: GBDialogStep, url: string, caption: string): Promise<any> {
const mobile = step.context.activity.from.id;
const filename = url.substring(url.lastIndexOf('/') + 1);
await min.whatsAppDirectLine.sendFileToDevice(mobile, url, filename);
@ -199,7 +199,8 @@ export class GBConversationalService implements IGBConversationalService {
if (c === ')') {
state = State.InText;
let url = urlJoin(GBServer.globals.publicAddress, currentImage);
await this.sendFile(min, step, url);
let caption = null; // TODO: Parse.
await this.sendFile(min, step, url, caption);
await sleep(5000);
currentImage = '';
}

View file

@ -114,7 +114,7 @@ export class GBMinService {
if (process.env.DISABLE_WEB !== 'true') {
let url = GBServer.globals.wwwroot ?
GBServer.globals.wwwroot :
urlJoin(GBDeployer.deployFolder, GBMinService.uiPackage, 'build');
urlJoin(GBDeployer.deployFolder, GBMinService.uiPackage, 'build');
GBServer.globals.server.use('/', express.static(url));
}
@ -544,14 +544,17 @@ export class GBMinService {
private async processMessageActivity(context, min: GBMinInstance, step: GBDialogStep) {
// Adds message to the analytics layer.
if (process.env.PRIVACY_STORE_MESSAGES === "true") {
const analytics = new AnalyticsService();
const user = await min.userProfile.get(context, {});
analytics.createMessage(min.instance.instanceId,
user.conversation, user.systemUser,
context.activity.text);
// Adds message to the analytics layer.
const analytics = new AnalyticsService();
const user = await min.userProfile.get(context, {});
analytics.createMessage(min.instance.instanceId,
user.conversation, user.systemUser,
context.activity.text);
}
// Checks for global exit kewywords cancelling any active dialogs.
const globalQuit = (locale, utterance) => {
@ -568,7 +571,12 @@ export class GBMinService {
} else if (isVMCall) {
await GBMinService.callVM(context.activity.text, min, step);
} else if (context.activity.text.charAt(0) === '/') {
await step.beginDialog(context.activity.text);
let text = context.activity.text;
let parts = text.split(' ');
let dialogName = parts[0];
parts.splice(0, 1);
let args = parts.join(' ');
await step.beginDialog(dialogName, { args: args });
} else if (globalQuit(step.context.activity.locale, context.activity.text)) {
await step.cancelAllDialogs();

View file

@ -1,6 +1,6 @@
{
"name": "default.gbui",
"version": "0.0.12",
"version": "1.0.0",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
@ -2818,15 +2818,6 @@
"resolved": "https://registry.npmjs.org/brorand/-/brorand-1.1.0.tgz",
"integrity": "sha1-EsJe/kCkXjwyPrhnWgoM5XsiNx8="
},
"browser-id": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/browser-id/-/browser-id-1.1.0.tgz",
"integrity": "sha512-MuvthhJ8pDjIYpJzHwYOrlFtTPhEOF3wk9AVvy19pLQwmS/OdGWptuhzjkgLnDJS3WgV2m7bLDvlCwufg1jWBA==",
"requires": {
"uuid": "^3.3.3",
"versioned-storage": "^1.1.0"
}
},
"browser-process-hrtime": {
"version": "0.1.3",
"resolved": "https://registry.npmjs.org/browser-process-hrtime/-/browser-process-hrtime-0.1.3.tgz",
@ -6067,11 +6058,6 @@
"locate-path": "^3.0.0"
}
},
"fingerprintjs2": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/fingerprintjs2/-/fingerprintjs2-2.1.0.tgz",
"integrity": "sha512-H1k/ESTD2rJ3liupyqWBPjZC+LKfCGixQzz/NDN4dkgbmG1bVFyMOh7luKSkVDoyfhgvRm62pviNMPI+eJTZcQ=="
},
"flat-cache": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-2.0.1.tgz",
@ -7653,7 +7639,8 @@
},
"ansi-regex": {
"version": "2.1.1",
"bundled": true
"bundled": true,
"optional": true
},
"aproba": {
"version": "1.2.0",
@ -7690,7 +7677,8 @@
},
"code-point-at": {
"version": "1.1.0",
"bundled": true
"bundled": true,
"optional": true
},
"concat-map": {
"version": "0.0.1",
@ -7699,7 +7687,8 @@
},
"console-control-strings": {
"version": "1.1.0",
"bundled": true
"bundled": true,
"optional": true
},
"core-util-is": {
"version": "1.0.2",
@ -7802,7 +7791,8 @@
},
"inherits": {
"version": "2.0.4",
"bundled": true
"bundled": true,
"optional": true
},
"ini": {
"version": "1.3.5",
@ -7812,6 +7802,7 @@
"is-fullwidth-code-point": {
"version": "1.0.0",
"bundled": true,
"optional": true,
"requires": {
"number-is-nan": "^1.0.0"
}
@ -7831,11 +7822,13 @@
},
"minimist": {
"version": "0.0.8",
"bundled": true
"bundled": true,
"optional": true
},
"minipass": {
"version": "2.9.0",
"bundled": true,
"optional": true,
"requires": {
"safe-buffer": "^5.1.2",
"yallist": "^3.0.0"
@ -7852,6 +7845,7 @@
"mkdirp": {
"version": "0.5.1",
"bundled": true,
"optional": true,
"requires": {
"minimist": "0.0.8"
}
@ -7932,7 +7926,8 @@
},
"number-is-nan": {
"version": "1.0.1",
"bundled": true
"bundled": true,
"optional": true
},
"object-assign": {
"version": "4.1.1",
@ -7942,6 +7937,7 @@
"once": {
"version": "1.4.0",
"bundled": true,
"optional": true,
"requires": {
"wrappy": "1"
}
@ -8017,7 +8013,8 @@
},
"safe-buffer": {
"version": "5.1.2",
"bundled": true
"bundled": true,
"optional": true
},
"safer-buffer": {
"version": "2.1.2",
@ -8047,6 +8044,7 @@
"string-width": {
"version": "1.0.2",
"bundled": true,
"optional": true,
"requires": {
"code-point-at": "^1.0.0",
"is-fullwidth-code-point": "^1.0.0",
@ -8064,6 +8062,7 @@
"strip-ansi": {
"version": "3.0.1",
"bundled": true,
"optional": true,
"requires": {
"ansi-regex": "^2.0.0"
}
@ -8102,11 +8101,13 @@
},
"wrappy": {
"version": "1.0.2",
"bundled": true
"bundled": true,
"optional": true
},
"yallist": {
"version": "3.1.1",
"bundled": true
"bundled": true,
"optional": true
}
}
}
@ -14282,11 +14283,6 @@
"extsprintf": "^1.2.0"
}
},
"versioned-storage": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/versioned-storage/-/versioned-storage-1.1.0.tgz",
"integrity": "sha512-oS+unMiWJjaVAFCkNJvmHiu6LDb8KrzT8YmfrQpAmn8/yKnW4Roq3lcVMxQofT9Oidqg8oWChbGYl4FGQJyPPg=="
},
"vfile": {
"version": "3.0.1",
"resolved": "https://registry.npmjs.org/vfile/-/vfile-3.0.1.tgz",

View file

@ -231,7 +231,7 @@ export class WhatsappDirectLine extends GBService {
return `${attachment.content.title} - ${attachment.content.text}`;
}
public async sendFileToDevice(to, url, filename) {
public async sendFileToDevice(to, url, filename, caption) {
const options = {
method: 'POST',
url: urlJoin(this.whatsappServiceUrl, 'sendFile'),
@ -239,7 +239,8 @@ export class WhatsappDirectLine extends GBService {
token: this.whatsappServiceKey,
phone: to,
body: url,
filename: filename
filename: filename,
caption: caption
},
headers: {
'cache-control': 'no-cache'