diff --git a/package.json b/package.json index 8bb1d66..709868f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "botlib", - "version": "0.0.28", + "version": "0.0.29", "description": "General Bot base library for building Node.js TypeScript Apps packages (.gbapp)", "main": "dist/src/index.js", "types": "dist/src/index.d.ts", @@ -16,7 +16,12 @@ }, "dependencies": { "async": "^2.6.1", - "botbuilder": "^3.15.0", + "botbuilder": "^4.0.0-preview1.2", + "botbuilder-ai": "^4.0.0-preview1.2", + "botbuilder-azure": "^4.0.0-preview1.2", + "botbuilder-choices": "^4.0.0-preview1.2", + "botbuilder-dialogs": "^4.0.0-preview1.2", + "botbuilder-prompts": "^4.0.0-preview1.2", "botbuilder-location": "^2.0.0", "chrono-node": "^1.3.5", "dotenv-extended": "^2.0.2", diff --git a/src/GBMinInstance.ts b/src/GBMinInstance.ts index a3d7699..e4580a9 100644 --- a/src/GBMinInstance.ts +++ b/src/GBMinInstance.ts @@ -31,7 +31,8 @@ \*****************************************************************************/ -import { UniversalBot } from "botbuilder"; +import { BotAdapter, UserState } from "botbuilder"; +import { DialogSet } from "botbuilder-dialogs" import { IGBInstance } from "./IGBinstance"; import { IGBCoreService } from "./IGBCoreService"; import { IGBConversationalService, IGBPackage } from "."; @@ -46,9 +47,12 @@ export class GBMinInstance { core: IGBCoreService; conversationalService: IGBConversationalService; textServices: AzureText; - bot: UniversalBot; - + bot: BotAdapter; + dialogs: DialogSet; + userState: UserState; + constructor() { this.packages = []; + this.dialogs = new DialogSet(); } } \ No newline at end of file diff --git a/src/IGBConversationalService.ts b/src/IGBConversationalService.ts index 9af7f31..b5e79c5 100644 --- a/src/IGBConversationalService.ts +++ b/src/IGBConversationalService.ts @@ -32,14 +32,14 @@ "use strict"; -import { UniversalBot, Session } from "botbuilder"; import { GBMinInstance } from "./GBMinInstance"; import { GBServiceCallback } from "./GBService"; +import { DialogContext } from "botbuilder-dialogs"; export interface IGBConversationalService { - sendEvent(session: Session, name: string, value: any); + sendEvent(dc:any, name: string, value: any); runNLP( - session: Session, + dc:any, min: GBMinInstance, text: string, cb: GBServiceCallback diff --git a/src/IGBCoreService.ts b/src/IGBCoreService.ts index b220e37..ad87abb 100644 --- a/src/IGBCoreService.ts +++ b/src/IGBCoreService.ts @@ -32,7 +32,6 @@ "use strict"; -import { UniversalBot, Session } from "botbuilder"; import { GBMinInstance } from "./GBMinInstance"; import { GBServiceCallback } from "./GBService"; import { Sequelize } from "sequelize-typescript"; diff --git a/src/IGBDialog.ts b/src/IGBDialog.ts index 33e792e..7dc176c 100644 --- a/src/IGBDialog.ts +++ b/src/IGBDialog.ts @@ -1,3 +1,4 @@ +import { BotAdapter } from 'botbuilder'; /*****************************************************************************\ | ( )_ _ | | _ _ _ __ _ _ __ ___ ___ _ _ | ,_)(_) ___ ___ _ | @@ -32,21 +33,12 @@ "use strict"; -import { - IChatConnectorSettings, - IDialogResult, - IFindMatchResult, - Session, - Prompts, - ChatConnector, - UniversalBot -} from "botbuilder"; import { GBService } from "./GBService"; export class IGBDialog { - bot: UniversalBot; + bot: BotAdapter; service: GBService; - constructor(bot: UniversalBot) { + constructor(bot: BotAdapter) { } } diff --git a/src/IGBInstance.ts b/src/IGBInstance.ts index e496dd0..65b0673 100644 --- a/src/IGBInstance.ts +++ b/src/IGBInstance.ts @@ -53,6 +53,8 @@ export interface IGBInstance { theme: string; ui: string; kb: string; + nlpAppId: string; + nlpSubscriptionKey: string; nlpServerUrl: string; speechKey: string; spellcheckerKey: string; diff --git a/src/IGBPackage.ts b/src/IGBPackage.ts index e56703f..e5c0806 100644 --- a/src/IGBPackage.ts +++ b/src/IGBPackage.ts @@ -34,7 +34,6 @@ import { IGBCoreService } from './IGBCoreService'; import { Sequelize, Model } from 'sequelize-typescript'; import { GBMinInstance } from '.'; -import { Session } from 'botbuilder'; "use strict"; @@ -55,7 +54,7 @@ export interface IGBPackage{ /** Called whenever a bot instance needs to be shutdown. */ unloadBot(min: GBMinInstance): void; - /** Called in each new session. */ - onNewSession(min: GBMinInstance, session: Session): void; + /** Called in each new dc. */ + onNewSession(min: GBMinInstance, dc: any): void; } \ No newline at end of file