new(all): Google Translator fix and security fix.
This commit is contained in:
parent
ba796c86a7
commit
9b94b08167
5 changed files with 419 additions and 552 deletions
906
package-lock.json
generated
906
package-lock.json
generated
File diff suppressed because it is too large
Load diff
10
package.json
10
package.json
|
@ -68,12 +68,12 @@
|
|||
"azure-search-client": "3.1.5",
|
||||
"bluebird": "3.7.2",
|
||||
"body-parser": "1.19.0",
|
||||
"botbuilder": "4.13.5",
|
||||
"botbuilder": "4.11.0",
|
||||
"botbuilder-adapter-facebook": "1.0.11",
|
||||
"botbuilder-ai": "4.13.5",
|
||||
"botbuilder-dialogs": "4.13.5",
|
||||
"botframework-connector": "4.13.5",
|
||||
"botlib": "1.9.2",
|
||||
"botbuilder-ai": "4.11.0",
|
||||
"botbuilder-dialogs": "4.11.0",
|
||||
"botframework-connector": "4.11.0",
|
||||
"botlib": "1.9.3",
|
||||
"cli-spinner": "0.2.10",
|
||||
"core-js": "3.14.0",
|
||||
"dotenv-extended": "2.9.0",
|
||||
|
|
|
@ -762,7 +762,7 @@ export class GBConversationalService {
|
|||
const endPoint = min.core.getParam<string>(min.instance, 'translatorEndpoint', null);
|
||||
const key = min.core.getParam<string>(min.instance, 'translatorKey', null);
|
||||
|
||||
if (endPoint === null || !translatorEnabled() || process.env.TRANSLATOR_DISABLED === 'true') {
|
||||
if ((endPoint === null && !min.instance.googleProjectId) || !translatorEnabled() || process.env.TRANSLATOR_DISABLED === 'true') {
|
||||
return text;
|
||||
}
|
||||
|
||||
|
|
|
@ -638,7 +638,7 @@ export class GBMinService {
|
|||
if (GBServer.globals.minBoot === undefined) {
|
||||
GBServer.globals.minBoot = min;
|
||||
}
|
||||
|
||||
|
||||
if (min.instance.facebookWorkplaceVerifyToken) {
|
||||
min['fbAdapter'] = new FacebookAdapter({
|
||||
verify_token: min.instance.facebookWorkplaceVerifyToken,
|
||||
|
@ -706,15 +706,16 @@ export class GBMinService {
|
|||
min.dialogs = new DialogSet(dialogState);
|
||||
min.dialogs.add(new TextPrompt('textPrompt'));
|
||||
min.dialogs.add(new ConfirmPrompt('confirmPrompt'));
|
||||
min.dialogs.add(
|
||||
new OAuthPrompt('oAuthPrompt', {
|
||||
connectionName: 'OAuth2',
|
||||
text: 'Please sign in to General Bots.',
|
||||
title: 'Sign in',
|
||||
timeout: 300000
|
||||
})
|
||||
);
|
||||
|
||||
if (process.env.ENABLE_AUTH) {
|
||||
min.dialogs.add(
|
||||
new OAuthPrompt('oAuthPrompt', {
|
||||
connectionName: 'OAuth2',
|
||||
text: 'Please sign in to General Bots.',
|
||||
title: 'Sign in',
|
||||
timeout: 300000
|
||||
})
|
||||
);
|
||||
}
|
||||
return { min, adapter, conversationState };
|
||||
}
|
||||
|
||||
|
@ -870,7 +871,7 @@ export class GBMinService {
|
|||
GBLog.info(`Auto start (teams) dialog is now being called: ${startDialog} for ${min.instance.botId}...`);
|
||||
await GBVMService.callVM(startDialog.toLowerCase(), min, step, this.deployer);
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1227,16 +1228,19 @@ export class GBMinService {
|
|||
|
||||
if (text !== startDialog) {
|
||||
let nextDialog = null;
|
||||
let data = {
|
||||
query: text,
|
||||
step: step,
|
||||
notTranslatedQuery: originalText,
|
||||
message: message ? message['dataValues'] : null,
|
||||
user: user ? user.dataValues : null
|
||||
};
|
||||
await CollectionUtil.asyncForEach(min.appPackages, async (e: IGBPackage) => {
|
||||
nextDialog = await e.onExchangeData(min, 'handleAnswer', {
|
||||
query: text,
|
||||
step: step,
|
||||
notTranslatedQuery: originalText,
|
||||
message: message ? message['dataValues'] : null,
|
||||
user: user ? user.dataValues : null
|
||||
});
|
||||
nextDialog = await e.onExchangeData(min, 'handleAnswer', data);
|
||||
});
|
||||
|
||||
await step.beginDialog(nextDialog ? nextDialog : '/answer', {
|
||||
data: data,
|
||||
query: text,
|
||||
user: user ? user.dataValues : null,
|
||||
message: message
|
||||
|
|
|
@ -41,7 +41,7 @@ import urlJoin = require('url-join');
|
|||
import { GBDialogStep, GBLog, GBMinInstance, IGBCoreService, IGBPackage } from 'botlib';
|
||||
import { Sequelize } from 'sequelize-typescript';
|
||||
import { OAuthDialog } from './dialogs/OAuthDialog';
|
||||
import {ProfileDialog} from './dialogs/ProfileDialog';
|
||||
import { ProfileDialog } from './dialogs/ProfileDialog';
|
||||
import { GuaribasGroup, GuaribasUser, GuaribasUserGroup } from './models';
|
||||
|
||||
/**
|
||||
|
@ -50,14 +50,19 @@ import { GuaribasGroup, GuaribasUser, GuaribasUserGroup } from './models';
|
|||
export class GBSecurityPackage implements IGBPackage {
|
||||
public sysPackages: IGBPackage[];
|
||||
public async getDialogs(min: GBMinInstance) {
|
||||
return [
|
||||
|
||||
let out = [
|
||||
ProfileDialog.getNameDialog(min),
|
||||
ProfileDialog.getEmailDialog(min),
|
||||
ProfileDialog.getMobileDialog(min),
|
||||
ProfileDialog.getMobileConfirmDialog(min),
|
||||
OAuthDialog.getOAuthDialog(min)
|
||||
ProfileDialog.getMobileConfirmDialog(min)
|
||||
];
|
||||
|
||||
if (process.env.ENABLE_AUTH) {
|
||||
out.push(OAuthDialog.getOAuthDialog(min));
|
||||
}
|
||||
return out;
|
||||
|
||||
}
|
||||
public async unloadPackage(core: IGBCoreService): Promise<void> {
|
||||
GBLog.verbose(`unloadPackage called.`);
|
||||
|
|
Loading…
Add table
Reference in a new issue