Merge branch 'master' of https://github.com/GeneralBots/BotServer
This commit is contained in:
commit
6d68d212bf
5 changed files with 1576 additions and 1575 deletions
|
@ -255,7 +255,8 @@ export class GBConversationalService {
|
|||
}
|
||||
|
||||
public async sendEvent(min: GBMinInstance, step: GBDialogStep, name: string, value: Object): Promise<any> {
|
||||
if (!this.userMobile(step)) {
|
||||
if (!this.userMobile(step) &&
|
||||
step.context.activity.channelId !== 'msteams') {
|
||||
GBLog.info(`Sending event ${name}:${typeof value === 'object' ? JSON.stringify(value) :
|
||||
value ? value : ''} to client...`);
|
||||
const msg = MessageFactory.text('');
|
||||
|
|
|
@ -34,27 +34,27 @@
|
|||
* @fileoverview General Bots server core.
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
const { DialogSet, TextPrompt } = require('botbuilder-dialogs');
|
||||
const express = require('express');
|
||||
const Fs = require('fs');
|
||||
const request = require('request-promise-native');
|
||||
const removeRoute = require('express-remove-route');
|
||||
const ssrForBots = require("ssr-for-bots").default;
|
||||
const AuthenticationContext = require('adal-node').AuthenticationContext;
|
||||
const wash = require('washyourmouthoutwithsoap');
|
||||
const { FacebookAdapter } = require('botbuilder-adapter-facebook');
|
||||
const path = require('path');
|
||||
import {
|
||||
'use strict';
|
||||
const { DialogSet, TextPrompt } = require('botbuilder-dialogs');
|
||||
const express = require('express');
|
||||
const Fs = require('fs');
|
||||
const request = require('request-promise-native');
|
||||
const removeRoute = require('express-remove-route');
|
||||
const ssrForBots = require("ssr-for-bots").default;
|
||||
const AuthenticationContext = require('adal-node').AuthenticationContext;
|
||||
const wash = require('washyourmouthoutwithsoap');
|
||||
const { FacebookAdapter } = require('botbuilder-adapter-facebook');
|
||||
const path = require('path');
|
||||
import {
|
||||
AutoSaveStateMiddleware,
|
||||
BotFrameworkAdapter,
|
||||
ConversationState,
|
||||
MemoryStorage,
|
||||
TurnContext,
|
||||
UserState
|
||||
} from 'botbuilder';
|
||||
import { ConfirmPrompt, OAuthPrompt, WaterfallDialog } from 'botbuilder-dialogs';
|
||||
import {
|
||||
} from 'botbuilder';
|
||||
import { ConfirmPrompt, OAuthPrompt, WaterfallDialog } from 'botbuilder-dialogs';
|
||||
import {
|
||||
GBDialogStep,
|
||||
GBLog,
|
||||
GBMinInstance,
|
||||
|
@ -63,32 +63,32 @@
|
|||
IGBCoreService,
|
||||
IGBInstance,
|
||||
IGBPackage
|
||||
} from 'botlib';
|
||||
import { CollectionUtil } from 'pragmatismo-io-framework';
|
||||
import { MicrosoftAppCredentials } from 'botframework-connector';
|
||||
import { GBServer } from '../../../src/app';
|
||||
import { GBAdminService } from '../../admin.gbapp/services/GBAdminService';
|
||||
import { GuaribasConversationMessage } from '../../analytics.gblib/models';
|
||||
import { AnalyticsService } from '../../analytics.gblib/services/AnalyticsService';
|
||||
import { GBVMService } from '../../basic.gblib/services/GBVMService';
|
||||
import { AskDialogArgs } from '../../kb.gbapp/dialogs/AskDialog';
|
||||
import { KBService } from '../../kb.gbapp/services/KBService';
|
||||
import { SecService } from '../../security.gbapp/services/SecService';
|
||||
import { WhatsappDirectLine } from '../../whatsapp.gblib/services/WhatsappDirectLine';
|
||||
import { Messages } from '../strings';
|
||||
import { GBConfigService } from './GBConfigService';
|
||||
import { GBConversationalService } from './GBConversationalService';
|
||||
import { GBDeployer } from './GBDeployer';
|
||||
import urlJoin = require('url-join');
|
||||
import fs = require('fs');
|
||||
import { GoogleChatDirectLine } from '../../google-chat.gblib/services/GoogleChatDirectLine';
|
||||
import { ScheduleServices } from '../../basic.gblib/services/ScheduleServices';
|
||||
import { SystemKeywords } from '../../basic.gblib/services/SystemKeywords';
|
||||
} from 'botlib';
|
||||
import { CollectionUtil } from 'pragmatismo-io-framework';
|
||||
import { MicrosoftAppCredentials } from 'botframework-connector';
|
||||
import { GBServer } from '../../../src/app';
|
||||
import { GBAdminService } from '../../admin.gbapp/services/GBAdminService';
|
||||
import { GuaribasConversationMessage } from '../../analytics.gblib/models';
|
||||
import { AnalyticsService } from '../../analytics.gblib/services/AnalyticsService';
|
||||
import { GBVMService } from '../../basic.gblib/services/GBVMService';
|
||||
import { AskDialogArgs } from '../../kb.gbapp/dialogs/AskDialog';
|
||||
import { KBService } from '../../kb.gbapp/services/KBService';
|
||||
import { SecService } from '../../security.gbapp/services/SecService';
|
||||
import { WhatsappDirectLine } from '../../whatsapp.gblib/services/WhatsappDirectLine';
|
||||
import { Messages } from '../strings';
|
||||
import { GBConfigService } from './GBConfigService';
|
||||
import { GBConversationalService } from './GBConversationalService';
|
||||
import { GBDeployer } from './GBDeployer';
|
||||
import urlJoin = require('url-join');
|
||||
import fs = require('fs');
|
||||
import { GoogleChatDirectLine } from '../../google-chat.gblib/services/GoogleChatDirectLine';
|
||||
import { ScheduleServices } from '../../basic.gblib/services/ScheduleServices';
|
||||
import { SystemKeywords } from '../../basic.gblib/services/SystemKeywords';
|
||||
|
||||
/**
|
||||
/**
|
||||
* Minimal service layer for a bot and encapsulation of BOT Framework calls.
|
||||
*/
|
||||
export class GBMinService {
|
||||
export class GBMinService {
|
||||
|
||||
/**
|
||||
* Default General Bots User Interface package.
|
||||
|
@ -1350,7 +1350,7 @@
|
|||
} else {
|
||||
|
||||
const startDialog = user.hearOnDialog ?
|
||||
user.hecallbackarOnDialog :
|
||||
user.hearOnDialog :
|
||||
min.core.getParam(min.instance, 'Start Dialog', null);
|
||||
|
||||
if (text !== startDialog) {
|
||||
|
@ -1381,5 +1381,4 @@
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -34,21 +34,21 @@
|
|||
* @fileoverview General Bots server core.
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
'use strict';
|
||||
|
||||
import { BotAdapter } from 'botbuilder';
|
||||
import { WaterfallDialog } from 'botbuilder-dialogs';
|
||||
import { GBMinInstance, IGBDialog } from 'botlib';
|
||||
import { GBMinService } from '../../core.gbapp/services/GBMinService';
|
||||
import { AnalyticsService } from '../../analytics.gblib/services/AnalyticsService';
|
||||
import { SecService } from '../../security.gbapp/services/SecService';
|
||||
import { CSService } from '../services/CSService';
|
||||
import { Messages } from '../strings';
|
||||
import { BotAdapter } from 'botbuilder';
|
||||
import { WaterfallDialog } from 'botbuilder-dialogs';
|
||||
import { GBMinInstance, IGBDialog } from 'botlib';
|
||||
import { GBMinService } from '../../core.gbapp/services/GBMinService';
|
||||
import { AnalyticsService } from '../../analytics.gblib/services/AnalyticsService';
|
||||
import { SecService } from '../../security.gbapp/services/SecService';
|
||||
import { CSService } from '../services/CSService';
|
||||
import { Messages } from '../strings';
|
||||
|
||||
/**
|
||||
/**
|
||||
* Dialog for feedback collecting.
|
||||
*/
|
||||
export class FeedbackDialog extends IGBDialog {
|
||||
export class FeedbackDialog extends IGBDialog {
|
||||
/**
|
||||
* Setup dialogs flows and define services call.
|
||||
*
|
||||
|
@ -257,4 +257,5 @@ export class FeedbackDialog extends IGBDialog {
|
|||
])
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -188,9 +188,9 @@ export class AskDialog extends IGBDialog {
|
|||
const locale = step.context.activity.locale;
|
||||
|
||||
// Stops any content on projector.
|
||||
|
||||
if (step.context.activity.channelId !== 'msteams') {
|
||||
await min.conversationalService.sendEvent(min, step, 'stop', undefined);
|
||||
|
||||
}
|
||||
// Handle extra text from FAQ.
|
||||
|
||||
if (step.options && step.options.query) {
|
||||
|
|
|
@ -182,9 +182,9 @@ export class SecService extends GBService {
|
|||
|
||||
await CollectionUtil.asyncForEach(list, async item => {
|
||||
if (
|
||||
!(item !== undefined &&
|
||||
item !== undefined &&
|
||||
agentSystemId === undefined &&
|
||||
item !== userSystemId && await this.isAgentSystemId(item))
|
||||
item !== userSystemId && !await this.isAgentSystemId(item)
|
||||
) {
|
||||
// TODO: Optimize loop.
|
||||
agentSystemId = item;
|
||||
|
|
Loading…
Add table
Reference in a new issue