fix(all): Now keyword, autostart dialog, prod size optimization.
This commit is contained in:
parent
ec1ec20175
commit
a17f21e073
7 changed files with 2403 additions and 1558 deletions
|
@ -111,6 +111,7 @@ IF EXIST "%DEPLOYMENT_TARGET%\deploy\default.gbui\package.json" (
|
||||||
echo [General Bots Deployer] Building default.gbui...
|
echo [General Bots Deployer] Building default.gbui...
|
||||||
call :ExecuteCmd !NPM_CMD! run build
|
call :ExecuteCmd !NPM_CMD! run build
|
||||||
IF !ERRORLEVEL! NEQ 0 goto error
|
IF !ERRORLEVEL! NEQ 0 goto error
|
||||||
|
RMDIR /s /q "%DEPLOYMENT_TARGET%\deploy\default.gbui\node_modules"
|
||||||
popd
|
popd
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
3818
package-lock.json
generated
3818
package-lock.json
generated
File diff suppressed because it is too large
Load diff
75
package.json
75
package.json
|
@ -48,16 +48,15 @@
|
||||||
"commit": "git-cz"
|
"commit": "git-cz"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@azure/ms-rest-js": "2.0.4",
|
"@azure/ms-rest-js": "2.1.0",
|
||||||
"node-cron": "2.0.3",
|
"@microsoft/microsoft-graph-client": "2.1.1",
|
||||||
"@microsoft/microsoft-graph-client": "2.0.0",
|
"@semantic-release/changelog": "5.0.1",
|
||||||
"@semantic-release/changelog": "^5.0.1",
|
"@semantic-release/exec": "5.0.0",
|
||||||
"@semantic-release/exec": "^5.0.0",
|
"@semantic-release/git": "9.0.0",
|
||||||
"@semantic-release/git": "^9.0.0",
|
|
||||||
"@types/validator": "13.1.0",
|
"@types/validator": "13.1.0",
|
||||||
"adal-node": "0.2.1",
|
"adal-node": "0.2.1",
|
||||||
"any-shell-escape": "^0.1.1",
|
"any-shell-escape": "0.1.1",
|
||||||
"async-promises": "0.2.2",
|
"async-promises": "0.2.3",
|
||||||
"azure-arm-cognitiveservices": "3.0.0",
|
"azure-arm-cognitiveservices": "3.0.0",
|
||||||
"azure-arm-resource": "7.4.0",
|
"azure-arm-resource": "7.4.0",
|
||||||
"azure-arm-search": "1.3.0-preview",
|
"azure-arm-search": "1.3.0-preview",
|
||||||
|
@ -66,29 +65,28 @@
|
||||||
"azure-search-client": "3.1.5",
|
"azure-search-client": "3.1.5",
|
||||||
"bluebird": "3.7.2",
|
"bluebird": "3.7.2",
|
||||||
"body-parser": "1.19.0",
|
"body-parser": "1.19.0",
|
||||||
"botbuilder": "4.7.0",
|
"botbuilder": "4.11.0",
|
||||||
"botbuilder-ai": "4.7.0",
|
"botbuilder-ai": "4.11.0",
|
||||||
"botbuilder-dialogs": "4.7.0",
|
"botbuilder-dialogs": "4.11.0",
|
||||||
"botframework-connector": "4.7.0",
|
"botframework-connector": "4.11.0",
|
||||||
"botlib": "1.6.7",
|
"botlib": "1.7.0",
|
||||||
"cli-spinner": "0.2.10",
|
"cli-spinner": "0.2.10",
|
||||||
"core-js": "^3.6.5",
|
"core-js": "3.7.0",
|
||||||
"dotenv-extended": "2.8.0",
|
"dotenv-extended": "2.9.0",
|
||||||
"exceljs": "4.1.0",
|
"exceljs": "4.2.0",
|
||||||
"express": "4.17.1",
|
"express": "4.17.1",
|
||||||
"express-remove-route": "1.0.0",
|
"express-remove-route": "1.0.0",
|
||||||
"ffmpeg-static": "4.2.5",
|
"ffmpeg-static": "4.2.7",
|
||||||
"google-libphonenumber": "3.2.10",
|
"google-libphonenumber": "3.2.15",
|
||||||
"ibm-watson": "^5.6.2",
|
"ibm-watson": "5.7.1",
|
||||||
"js-beautify": "1.11.0",
|
"js-beautify": "1.13.0",
|
||||||
"marked": "1.1.0",
|
"marked": "1.2.5",
|
||||||
"microsoft-cognitiveservices-speech-sdk": "^1.13.1",
|
"microsoft-cognitiveservices-speech-sdk": "1.14.1",
|
||||||
"ms-rest-azure": "3.0.0",
|
"ms-rest-azure": "3.0.0",
|
||||||
"nexmo": "2.8.0",
|
"nexmo": "2.9.1",
|
||||||
"ngrok": "3.2.7",
|
"node-cron": "2.0.3",
|
||||||
"npm": "6.14.6",
|
|
||||||
"opn": "6.0.0",
|
"opn": "6.0.0",
|
||||||
"phone": "^2.4.14",
|
"phone": "2.4.17",
|
||||||
"pragmatismo-io-framework": "1.0.20",
|
"pragmatismo-io-framework": "1.0.20",
|
||||||
"prism-media": "1.2.2",
|
"prism-media": "1.2.2",
|
||||||
"public-ip": "4.0.2",
|
"public-ip": "4.0.2",
|
||||||
|
@ -98,37 +96,38 @@
|
||||||
"request-promise-native": "1.0.8",
|
"request-promise-native": "1.0.8",
|
||||||
"rimraf": "3.0.2",
|
"rimraf": "3.0.2",
|
||||||
"safe-buffer": "5.2.1",
|
"safe-buffer": "5.2.1",
|
||||||
"scanf": "1.1.1",
|
"scanf": "1.1.2",
|
||||||
"sequelize": "5.21.5",
|
"sequelize": "5.21.5",
|
||||||
"sequelize-typescript": "1.1.0",
|
"sequelize-typescript": "1.1.0",
|
||||||
"simple-commit-message": "^4.0.13",
|
"simple-git": "2.23.0",
|
||||||
"simple-git": "2.12.0",
|
"sppull": "2.6.7",
|
||||||
"sppull": "2.6.5",
|
|
||||||
"strict-password-generator": "1.1.2",
|
"strict-password-generator": "1.1.2",
|
||||||
"swagger-client": "2.1.18",
|
"swagger-client": "2.1.18",
|
||||||
"tedious": "8.3.0",
|
"tedious": "9.2.1",
|
||||||
"textract": "2.5.0",
|
"textract": "2.5.0",
|
||||||
"typescript": "3.9.6",
|
"typescript": "4.1.2",
|
||||||
"url-join": "4.0.1",
|
"url-join": "4.0.1",
|
||||||
"vbscript-to-typescript": "1.0.8",
|
"vbscript-to-typescript": "1.0.8",
|
||||||
"walk-promise": "0.2.0",
|
"walk-promise": "0.2.0",
|
||||||
"washyourmouthoutwithsoap": "1.0.2"
|
"washyourmouthoutwithsoap": "1.0.2"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"typedoc": "0.17.8",
|
"ngrok": "3.3.0",
|
||||||
|
"typedoc": "0.19.2",
|
||||||
|
"simple-commit-message": "4.0.13",
|
||||||
"@types/url-join": "4.0.0",
|
"@types/url-join": "4.0.0",
|
||||||
"@types/winston": "2.4.4",
|
"@types/winston": "2.4.4",
|
||||||
"ban-sensitive-files": "1.9.7",
|
"ban-sensitive-files": "1.9.14",
|
||||||
"commitizen": "4.1.2",
|
"commitizen": "4.2.2",
|
||||||
"cz-conventional-changelog": "3.2.0",
|
"cz-conventional-changelog": "3.3.0",
|
||||||
"dependency-check": "4.1.0",
|
"dependency-check": "4.1.0",
|
||||||
"git-issues": "1.3.1",
|
"git-issues": "1.3.1",
|
||||||
"license-checker": "25.0.1",
|
"license-checker": "25.0.1",
|
||||||
"nsp": "3.2.1",
|
"nsp": "3.2.1",
|
||||||
"prettier-standard": "16.4.1",
|
"prettier-standard": "16.4.1",
|
||||||
"semantic-release": "17.1.1",
|
"semantic-release": "17.2.4",
|
||||||
"travis-deploy-once": "5.0.11",
|
"travis-deploy-once": "5.0.11",
|
||||||
"ts-node": "8.10.2",
|
"ts-node": "9.0.0",
|
||||||
"tslint": "6.1.2"
|
"tslint": "6.1.2"
|
||||||
},
|
},
|
||||||
"eslintConfig": {
|
"eslintConfig": {
|
||||||
|
|
|
@ -208,9 +208,6 @@ export class GBConversationalService {
|
||||||
public static async getTextFromAudioBuffer(speechKey, cloudRegion, buffer, locale): Promise<string> {
|
public static async getTextFromAudioBuffer(speechKey, cloudRegion, buffer, locale): Promise<string> {
|
||||||
return new Promise<string>(async (resolve, reject) => {
|
return new Promise<string>(async (resolve, reject) => {
|
||||||
try {
|
try {
|
||||||
let subscriptionKey = speechKey;
|
|
||||||
let serviceRegion = cloudRegion;
|
|
||||||
|
|
||||||
const oggFile = new Readable();
|
const oggFile = new Readable();
|
||||||
oggFile._read = () => {}; // _read is required but you can noop it
|
oggFile._read = () => {}; // _read is required but you can noop it
|
||||||
oggFile.push(buffer);
|
oggFile.push(buffer);
|
||||||
|
|
|
@ -541,12 +541,16 @@ export class GBDeployer implements IGBDeployer {
|
||||||
public setupDefaultGBUI() {
|
public setupDefaultGBUI() {
|
||||||
const root = 'packages/default.gbui';
|
const root = 'packages/default.gbui';
|
||||||
const npm = urlJoin(process.env.PWD, 'node_modules', '.bin', 'npm');
|
const npm = urlJoin(process.env.PWD, 'node_modules', '.bin', 'npm');
|
||||||
if (!Fs.existsSync(`${root}/build`)) {
|
if (!Fs.existsSync(`${root}/build`) && process.env.DISABLE_WEB !== 'true'){
|
||||||
GBLog.info(`Preparing default.gbui (it may take some additional time for the first time)...`);
|
GBLog.info(`Installing modules default.gbui (It may take a few minutes)...`);
|
||||||
Fs.writeFileSync(`${root}/.env`, 'SKIP_PREFLIGHT_CHECK=true');
|
Fs.writeFileSync(`${root}/.env`, 'SKIP_PREFLIGHT_CHECK=true');
|
||||||
child_process.execSync(`${npm} install`, { cwd: root });
|
child_process.execSync(`${npm} install`, { cwd: root });
|
||||||
|
GBLog.info(`Transpiling default.gbui...`);
|
||||||
child_process.execSync(`${npm} run build`, { cwd: root });
|
child_process.execSync(`${npm} run build`, { cwd: root });
|
||||||
|
GBLog.info(`Cleaning default.gbui node_modules...`);
|
||||||
}
|
}
|
||||||
|
const nodeModules = urlJoin(root, 'node_modules');
|
||||||
|
rimraf.sync(nodeModules);
|
||||||
}
|
}
|
||||||
|
|
||||||
private async deployDataPackages(
|
private async deployDataPackages(
|
||||||
|
|
|
@ -169,7 +169,16 @@ export class GBMinService {
|
||||||
id,
|
id,
|
||||||
`Olá! Seja bem-vinda(o)!\nMe chamo ${activeMin.instance.title}. Como posso ajudar? Pode me falar que eu te ouço, me manda um aúdio.`
|
`Olá! Seja bem-vinda(o)!\nMe chamo ${activeMin.instance.title}. Como posso ajudar? Pode me falar que eu te ouço, me manda um aúdio.`
|
||||||
);
|
);
|
||||||
|
|
||||||
|
let startDialog = activeMin.core.getParam(activeMin.instance, 'Start Dialog', null);
|
||||||
|
GBLog.info(`Auto start dialog is now being called: ${startDialog}...`);
|
||||||
|
if (startDialog) {
|
||||||
|
req.body.messages[0].body = `/${startDialog}`;
|
||||||
|
await (activeMin as any).whatsAppDirectLine.received(req, res);
|
||||||
|
}
|
||||||
|
else {
|
||||||
res.end();
|
res.end();
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
// User wants to switch bots.
|
// User wants to switch bots.
|
||||||
if (toSwitchMin !== undefined) {
|
if (toSwitchMin !== undefined) {
|
||||||
|
@ -181,7 +190,14 @@ export class GBMinService {
|
||||||
id,
|
id,
|
||||||
`Agora falando com ${activeMin.instance.title}...`
|
`Agora falando com ${activeMin.instance.title}...`
|
||||||
);
|
);
|
||||||
|
let startDialog = activeMin.core.getParam(activeMin.instance, 'Start Dialog', null);
|
||||||
|
if (startDialog) {
|
||||||
|
GBLog.info(`Auto start dialog is now being called: ${startDialog}...`); req.body.messages[0].body = `/${startDialog}`;
|
||||||
|
await (activeMin as any).whatsAppDirectLine.received(req, res);
|
||||||
|
}
|
||||||
|
else {
|
||||||
res.end();
|
res.end();
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
activeMin = GBServer.globals.minInstances.filter(p => p.instance.instanceId === user.instanceId)[0];
|
activeMin = GBServer.globals.minInstances.filter(p => p.instance.instanceId === user.instanceId)[0];
|
||||||
if (activeMin === undefined) {
|
if (activeMin === undefined) {
|
||||||
|
|
|
@ -152,11 +152,10 @@ export class GBVMService extends GBService {
|
||||||
public convertGBASICToVBS(code: string) {
|
public convertGBASICToVBS(code: string) {
|
||||||
// Start and End of VB2TS tags of processing.
|
// Start and End of VB2TS tags of processing.
|
||||||
|
|
||||||
|
|
||||||
code = `<%\n
|
code = `<%\n
|
||||||
|
|
||||||
from = this.getFrom(step)
|
from = this.getFrom(step)
|
||||||
today = this.getToday(step)
|
|
||||||
now = this.getNow(step)
|
|
||||||
id = sys().getRandomId()
|
id = sys().getRandomId()
|
||||||
username = this.getUserName(step);
|
username = this.getUserName(step);
|
||||||
mobile = this.getUserMobile(step);
|
mobile = this.getUserMobile(step);
|
||||||
|
@ -323,11 +322,14 @@ export class GBVMService extends GBService {
|
||||||
|
|
||||||
parsedCode = this.handleThisAndAwait(parsedCode);
|
parsedCode = this.handleThisAndAwait(parsedCode);
|
||||||
|
|
||||||
|
parsedCode = parsedCode.replace(/(now)(?=(?:[^"]|"[^"]*")*$)/, 'await this.getNow(step)');
|
||||||
|
parsedCode = parsedCode.replace(/(today)(?=(?:[^"]|"[^"]*")*$)/, 'await this.getToday(step)');
|
||||||
|
|
||||||
parsedCode = beautify(parsedCode, { indent_size: 2, space_in_empty_paren: true });
|
parsedCode = beautify(parsedCode, { indent_size: 2, space_in_empty_paren: true });
|
||||||
fs.writeFileSync(jsfile, parsedCode);
|
fs.writeFileSync(jsfile, parsedCode);
|
||||||
|
|
||||||
this.executeJS(min, deployer, parsedCode, mainName);
|
this.executeJS(min, deployer, parsedCode, mainName);
|
||||||
GBLog.info(`[GBVMService] Finished loading of ${filename}`);
|
GBLog.info(`[GBVMService] Finished loading of ${filename}, JavaScript from Word: ${parsedCode}`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -394,14 +396,12 @@ export class GBVMService extends GBService {
|
||||||
const opts = await promise(step, step.result);
|
const opts = await promise(step, step.result);
|
||||||
return await step.replaceDialog('/hear', opts);
|
return await step.replaceDialog('/hear', opts);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
GBLog.error(`Error running BASIC code: ${error}`);
|
GBLog.error(`Error in BASIC code: ${error}`);
|
||||||
const locale = step.context.activity.locale;
|
const locale = step.context.activity.locale;
|
||||||
min.conversationalService.sendText(min, step, Messages[locale].very_sorry_about_error);
|
min.conversationalService.sendText(min, step, Messages[locale].very_sorry_about_error);
|
||||||
return await step.replaceDialog('/ask', { isReturning: true });
|
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
await step.replaceDialog('/ask', { isReturning: true });
|
|
||||||
}
|
}
|
||||||
|
return await step.endDialog();
|
||||||
}
|
}
|
||||||
])
|
])
|
||||||
);
|
);
|
||||||
|
|
Loading…
Add table
Reference in a new issue