This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { ChatConnector, LuisRecognizer, UniversalBot } from "botbuilder"; | |
| import { appId, appPassword, luisAppUrl } from "../settings"; | |
| import colour from "./dialogs/colour"; | |
| import defaultDialog from "./dialogs/default"; | |
| // Create chat connector for communicating with the Bot Framework Service | |
| const connector = new ChatConnector({ | |
| appId, | |
| appPassword | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { IPromptChoiceResult, Library, ListStyle, Prompts } from "botbuilder"; | |
| import { format } from "util"; | |
| import strings from "../../strings"; | |
| import { setColour } from "../data/userData"; | |
| const lib = new Library("colour"); | |
| lib | |
| .dialog("setFavourite", [ | |
| session => { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { Library, Session } from "botbuilder"; | |
| import strings from "../../strings"; | |
| const lib = new Library("global"); | |
| lib | |
| .dialog("help", (session: Session) => { | |
| session.endDialog(strings.global.help.message); | |
| }) | |
| .triggerAction({ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { ChatConnector, UniversalBot } from "botbuilder"; | |
| import { appId, appPassword } from "../settings"; | |
| import defaultDialog from "./dialogs/default"; | |
| import storage from "./storage"; | |
| // Create chat connector for communicating with the Bot Framework Service | |
| const connector = new ChatConnector({ | |
| appId, | |
| appPassword | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { Library } from "botbuilder"; | |
| import strings from "../../strings"; | |
| import { getFirstRun, setFirstRun } from "../data/userData"; | |
| const lib = new Library("greetings"); | |
| // Universal channel support for first run, see https://docs.microsoft.com/en-us/bot-framework/nodejs/bot-builder-nodejs-handle-conversation-events#add-a-first-run-dialog | |
| lib | |
| .dialog("firstRun", session => { | |
| setFirstRun(session, true); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { Library, Session } from "botbuilder"; | |
| import strings from "../../strings"; | |
| const lib = new Library("global"); | |
| lib | |
| .dialog("help", (session: Session) => { | |
| session.endDialog(strings.global.help.message); | |
| }) | |
| .triggerAction({ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var inMemoryStorage = new builder.MemoryBotStorage(); | |
| // This is a dinner reservation bot that uses multiple dialogs to prompt users for input. | |
| var bot = new builder.UniversalBot(connector, [ | |
| function (session) { | |
| session.send("Welcome to the dinner reservation."); | |
| session.beginDialog('askForDateTime'); | |
| }, | |
| function (session, results) { | |
| session.dialogData.reservationDate = builder.EntityRecognizer.resolveTime([results.response]); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { validate } from "class-validator"; | |
| import Site from "./Site"; | |
| const params = { | |
| // Causing max length error | |
| name: | |
| "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam aliquam tortor vitae neque iaculis tincidunt.", | |
| // Causing not valid email address error | |
| emailAddress: "invalidemail", | |
| url: "http://test.com", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { IsEmail, IsNotEmpty, IsUrl, MaxLength } from "class-validator"; | |
| interface ISite { | |
| readonly name: string; | |
| readonly url: string; | |
| readonly emailAddress: string; | |
| readonly password: string; | |
| } | |
| export default class Site implements ISite { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { Dispatch } from "redux"; | |
| import { | |
| signIn as signInToApi, | |
| signOut as signOutFromApi | |
| } from "../../api/authenticationApi"; | |
| import IStoreState from "../../store/IStoreState"; | |
| import keys from "../ActionTypeKeys"; | |
| import { | |
| ISignInFailAction, | |
| ISignInInProgressAction, |