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
| 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 { 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 { 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 { 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, 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 { 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 { 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
| { | |
| "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", | |
| "contentVersion": "1.0.0.0", | |
| "parameters": { | |
| "environmentName": { | |
| "type": "string", | |
| "defaultValue": "dev", | |
| "allowedValues": [ | |
| "dev", | |
| "prod" |
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
| #!/bin/bash | |
| # Setting -e and -v as pert https://docs.travis-ci.com/user/customizing-the-build/#Implementing-Complex-Build-Steps | |
| # -e: immediately exit if any command has a non-zero exit status | |
| # -v: print all lines in the script before executing them | |
| # -o: prevents errors in a pipeline from being masked | |
| set -euo pipefail | |
| # IFS new value is less likely to cause confusing bugs when looping arrays or arguments (e.g. $@) | |
| IFS=$'\n\t' |