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

View file

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

View file

@ -80,7 +80,7 @@ export class GBConversationalService implements IGBConversationalService {
return step.context.activity.locale; 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 mobile = step.context.activity.from.id;
const filename = url.substring(url.lastIndexOf('/') + 1); const filename = url.substring(url.lastIndexOf('/') + 1);
await min.whatsAppDirectLine.sendFileToDevice(mobile, url, filename); await min.whatsAppDirectLine.sendFileToDevice(mobile, url, filename);
@ -199,7 +199,8 @@ export class GBConversationalService implements IGBConversationalService {
if (c === ')') { if (c === ')') {
state = State.InText; state = State.InText;
let url = urlJoin(GBServer.globals.publicAddress, currentImage); 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); await sleep(5000);
currentImage = ''; currentImage = '';
} }

View file

@ -544,6 +544,8 @@ export class GBMinService {
private async processMessageActivity(context, min: GBMinInstance, step: GBDialogStep) { private async processMessageActivity(context, min: GBMinInstance, step: GBDialogStep) {
if (process.env.PRIVACY_STORE_MESSAGES === "true") {
// Adds message to the analytics layer. // Adds message to the analytics layer.
const analytics = new AnalyticsService(); const analytics = new AnalyticsService();
@ -551,6 +553,7 @@ export class GBMinService {
analytics.createMessage(min.instance.instanceId, analytics.createMessage(min.instance.instanceId,
user.conversation, user.systemUser, user.conversation, user.systemUser,
context.activity.text); context.activity.text);
}
// Checks for global exit kewywords cancelling any active dialogs. // Checks for global exit kewywords cancelling any active dialogs.
@ -568,7 +571,12 @@ export class GBMinService {
} else if (isVMCall) { } else if (isVMCall) {
await GBMinService.callVM(context.activity.text, min, step); await GBMinService.callVM(context.activity.text, min, step);
} else if (context.activity.text.charAt(0) === '/') { } 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)) { } else if (globalQuit(step.context.activity.locale, context.activity.text)) {
await step.cancelAllDialogs(); await step.cancelAllDialogs();

View file

@ -1,6 +1,6 @@
{ {
"name": "default.gbui", "name": "default.gbui",
"version": "0.0.12", "version": "1.0.0",
"lockfileVersion": 1, "lockfileVersion": 1,
"requires": true, "requires": true,
"dependencies": { "dependencies": {
@ -2818,15 +2818,6 @@
"resolved": "https://registry.npmjs.org/brorand/-/brorand-1.1.0.tgz", "resolved": "https://registry.npmjs.org/brorand/-/brorand-1.1.0.tgz",
"integrity": "sha1-EsJe/kCkXjwyPrhnWgoM5XsiNx8=" "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": { "browser-process-hrtime": {
"version": "0.1.3", "version": "0.1.3",
"resolved": "https://registry.npmjs.org/browser-process-hrtime/-/browser-process-hrtime-0.1.3.tgz", "resolved": "https://registry.npmjs.org/browser-process-hrtime/-/browser-process-hrtime-0.1.3.tgz",
@ -6067,11 +6058,6 @@
"locate-path": "^3.0.0" "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": { "flat-cache": {
"version": "2.0.1", "version": "2.0.1",
"resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-2.0.1.tgz", "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-2.0.1.tgz",
@ -7653,7 +7639,8 @@
}, },
"ansi-regex": { "ansi-regex": {
"version": "2.1.1", "version": "2.1.1",
"bundled": true "bundled": true,
"optional": true
}, },
"aproba": { "aproba": {
"version": "1.2.0", "version": "1.2.0",
@ -7690,7 +7677,8 @@
}, },
"code-point-at": { "code-point-at": {
"version": "1.1.0", "version": "1.1.0",
"bundled": true "bundled": true,
"optional": true
}, },
"concat-map": { "concat-map": {
"version": "0.0.1", "version": "0.0.1",
@ -7699,7 +7687,8 @@
}, },
"console-control-strings": { "console-control-strings": {
"version": "1.1.0", "version": "1.1.0",
"bundled": true "bundled": true,
"optional": true
}, },
"core-util-is": { "core-util-is": {
"version": "1.0.2", "version": "1.0.2",
@ -7802,7 +7791,8 @@
}, },
"inherits": { "inherits": {
"version": "2.0.4", "version": "2.0.4",
"bundled": true "bundled": true,
"optional": true
}, },
"ini": { "ini": {
"version": "1.3.5", "version": "1.3.5",
@ -7812,6 +7802,7 @@
"is-fullwidth-code-point": { "is-fullwidth-code-point": {
"version": "1.0.0", "version": "1.0.0",
"bundled": true, "bundled": true,
"optional": true,
"requires": { "requires": {
"number-is-nan": "^1.0.0" "number-is-nan": "^1.0.0"
} }
@ -7831,11 +7822,13 @@
}, },
"minimist": { "minimist": {
"version": "0.0.8", "version": "0.0.8",
"bundled": true "bundled": true,
"optional": true
}, },
"minipass": { "minipass": {
"version": "2.9.0", "version": "2.9.0",
"bundled": true, "bundled": true,
"optional": true,
"requires": { "requires": {
"safe-buffer": "^5.1.2", "safe-buffer": "^5.1.2",
"yallist": "^3.0.0" "yallist": "^3.0.0"
@ -7852,6 +7845,7 @@
"mkdirp": { "mkdirp": {
"version": "0.5.1", "version": "0.5.1",
"bundled": true, "bundled": true,
"optional": true,
"requires": { "requires": {
"minimist": "0.0.8" "minimist": "0.0.8"
} }
@ -7932,7 +7926,8 @@
}, },
"number-is-nan": { "number-is-nan": {
"version": "1.0.1", "version": "1.0.1",
"bundled": true "bundled": true,
"optional": true
}, },
"object-assign": { "object-assign": {
"version": "4.1.1", "version": "4.1.1",
@ -7942,6 +7937,7 @@
"once": { "once": {
"version": "1.4.0", "version": "1.4.0",
"bundled": true, "bundled": true,
"optional": true,
"requires": { "requires": {
"wrappy": "1" "wrappy": "1"
} }
@ -8017,7 +8013,8 @@
}, },
"safe-buffer": { "safe-buffer": {
"version": "5.1.2", "version": "5.1.2",
"bundled": true "bundled": true,
"optional": true
}, },
"safer-buffer": { "safer-buffer": {
"version": "2.1.2", "version": "2.1.2",
@ -8047,6 +8044,7 @@
"string-width": { "string-width": {
"version": "1.0.2", "version": "1.0.2",
"bundled": true, "bundled": true,
"optional": true,
"requires": { "requires": {
"code-point-at": "^1.0.0", "code-point-at": "^1.0.0",
"is-fullwidth-code-point": "^1.0.0", "is-fullwidth-code-point": "^1.0.0",
@ -8064,6 +8062,7 @@
"strip-ansi": { "strip-ansi": {
"version": "3.0.1", "version": "3.0.1",
"bundled": true, "bundled": true,
"optional": true,
"requires": { "requires": {
"ansi-regex": "^2.0.0" "ansi-regex": "^2.0.0"
} }
@ -8102,11 +8101,13 @@
}, },
"wrappy": { "wrappy": {
"version": "1.0.2", "version": "1.0.2",
"bundled": true "bundled": true,
"optional": true
}, },
"yallist": { "yallist": {
"version": "3.1.1", "version": "3.1.1",
"bundled": true "bundled": true,
"optional": true
} }
} }
} }
@ -14282,11 +14283,6 @@
"extsprintf": "^1.2.0" "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": { "vfile": {
"version": "3.0.1", "version": "3.0.1",
"resolved": "https://registry.npmjs.org/vfile/-/vfile-3.0.1.tgz", "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}`; return `${attachment.content.title} - ${attachment.content.text}`;
} }
public async sendFileToDevice(to, url, filename) { public async sendFileToDevice(to, url, filename, caption) {
const options = { const options = {
method: 'POST', method: 'POST',
url: urlJoin(this.whatsappServiceUrl, 'sendFile'), url: urlJoin(this.whatsappServiceUrl, 'sendFile'),
@ -239,7 +239,8 @@ export class WhatsappDirectLine extends GBService {
token: this.whatsappServiceKey, token: this.whatsappServiceKey,
phone: to, phone: to,
body: url, body: url,
filename: filename filename: filename,
caption: caption
}, },
headers: { headers: {
'cache-control': 'no-cache' 'cache-control': 'no-cache'