diff --git a/.github/ISSUE_TEMPLATE/bot-framework-composer-bug.md b/.github/ISSUE_TEMPLATE/bot-framework-composer-bug.md index 4b16cb7a72..2514bdd103 100644 --- a/.github/ISSUE_TEMPLATE/bot-framework-composer-bug.md +++ b/.github/ISSUE_TEMPLATE/bot-framework-composer-bug.md @@ -9,7 +9,7 @@ assignees: '' --- ## Version -What version of the Emulator are you using. +What version of the Composer are you using? Paste the build SHA found on the about page. ## Describe the bug Give a clear and concise description of what the bug is. @@ -29,5 +29,3 @@ If applicable, add screenshots to help explain your problem. ## Additional context Add any other context about the problem here. - -[bug] diff --git a/.github/ISSUE_TEMPLATE/bot-framework-composer-feature-request.md b/.github/ISSUE_TEMPLATE/bot-framework-composer-feature-request.md index b2a98611aa..8b5785c30c 100644 --- a/.github/ISSUE_TEMPLATE/bot-framework-composer-feature-request.md +++ b/.github/ISSUE_TEMPLATE/bot-framework-composer-feature-request.md @@ -2,7 +2,7 @@ name: Bot Framework Composer Feature request about: Suggest an idea for the Bot Framework Composer title: '' -labels: Enhancement, Needs-triage +labels: 'Type: suggestion, Needs-triage' assignees: '' --- diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index bbf73bef83..aa50459e9f 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -1,16 +1,17 @@ ## Description -Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. +Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. -If this is a bug fix, please describe the root cause and analysis of this problem. +If this is a bug fix, please describe the root cause and analysis of this problem. ## Task Item -Please include the link to the related work item, like fix [Something is not working](http://url.here) +Please include a link to the related issue. [Ex. `Closes #`](https://help.github.com/en/articles/closing-issues-using-keywords) ## Type of change Please delete options that are not relevant. + - [ ] Bug fix (non-breaking change which fixes an issue) - [ ] New feature (non-breaking change which adds functionality) - [ ] Code refactor (non-breaking change which improve code quality, clean up, add tests, etc) @@ -24,6 +25,6 @@ Please delete options that are not relevant. - [ ] I have commented my code, particularly in hard-to-understand areas - [ ] I have functionally tested my change -## Screenshots +## Screenshots Please include screenshots or gifs if your PR include UX changes. diff --git a/.gitignore b/.gitignore index 2fefe8cd23..907bd96e96 100644 --- a/.gitignore +++ b/.gitignore @@ -389,11 +389,14 @@ typings/ # Local sample bots SampleBots/Local* SampleBots/__Test* -SampleBots/*/generated/ -SampleBots/*/settings +SampleBots/*/*/generated +SampleBots/*/*/settings #tmp.zip *.zip +#DS_Store +*.DS_Store + # VsCode Composer/.vscode/ diff --git a/BotProject/CSharp/BotManager.cs b/BotProject/CSharp/BotManager.cs index ff146c99d0..10c5b620ef 100644 --- a/BotProject/CSharp/BotManager.cs +++ b/BotProject/CSharp/BotManager.cs @@ -1,11 +1,13 @@ using Microsoft.Bot.Builder.BotFramework; using Microsoft.Bot.Builder.Dialogs; +using Microsoft.Bot.Builder.Dialogs.Adaptive; using Microsoft.Bot.Builder.Dialogs.Debugging; using Microsoft.Bot.Builder.Dialogs.Declarative; using Microsoft.Bot.Builder.Dialogs.Declarative.Resources; using Microsoft.Bot.Builder.Integration.AspNet.Core; using Microsoft.Bot.Connector.Authentication; using Microsoft.Extensions.Configuration; +using Microsoft.Bot.Builder.LanguageGeneration; using Newtonsoft.Json; using Newtonsoft.Json.Linq; using System; @@ -16,7 +18,7 @@ using System.Reflection; using System.Threading.Tasks; -namespace Microsoft.Bot.Builder.TestBot.Json +namespace Microsoft.Bot.Builder.ComposerBot.json { public interface IBotManager { @@ -69,11 +71,11 @@ public void SetCurrent(string botDir) adapter .UseStorage(storage) .UseState(userState, conversationState) - .UseLanguageGeneration(resourceExplorer) - .UseDebugger(4712) + .UseAdaptiveDialogs() + .UseResourceExplorer(resourceExplorer) + .UseLanguageGeneration(resourceExplorer, "common.lg") .Use(new RegisterClassMiddleware(Config)) - .Use(new InspectionMiddleware(inspectionState, userState, conversationState, credentials)) - .UseResourceExplorer(resourceExplorer); + .Use(new InspectionMiddleware(inspectionState, userState, conversationState, credentials)); adapter.OnTurnError = async (turnContext, exception) => { @@ -84,7 +86,7 @@ public void SetCurrent(string botDir) }; CurrentAdapter = adapter; - CurrentBot = new TestBot("Main.dialog", conversationState, userState, resourceExplorer, DebugSupport.SourceRegistry); + CurrentBot = new ComposerBot("Main.dialog", conversationState, userState, resourceExplorer, DebugSupport.SourceMap); } public void SetCurrent(Stream fileStream, string endpointKey = null, string appPwd = null) diff --git a/BotProject/CSharp/BotProject.csproj b/BotProject/CSharp/BotProject.csproj index 0164fcb07a..a9f4389b69 100644 --- a/BotProject/CSharp/BotProject.csproj +++ b/BotProject/CSharp/BotProject.csproj @@ -21,13 +21,13 @@ - - - - - - - + + + + + + + diff --git a/BotProject/CSharp/TestBot.cs b/BotProject/CSharp/ComposerBot.cs similarity index 78% rename from BotProject/CSharp/TestBot.cs rename to BotProject/CSharp/ComposerBot.cs index 14d398b8ea..539de2c65b 100644 --- a/BotProject/CSharp/TestBot.cs +++ b/BotProject/CSharp/ComposerBot.cs @@ -12,15 +12,17 @@ using Microsoft.Bot.Builder.Dialogs.Debugging; using Microsoft.Bot.Builder.Dialogs.Declarative; using Microsoft.Bot.Builder.Dialogs.Declarative.Resources; +using Microsoft.Bot.Builder.Dialogs.Debugging; +using Microsoft.Bot.Builder.LanguageGeneration; using Microsoft.Bot.Schema; using Microsoft.Extensions.Configuration; using Microsoft.Recognizers.Text; using Newtonsoft.Json; +using Microsoft.Bot.Builder.AI.QnA; - -namespace Microsoft.Bot.Builder.TestBot.Json +namespace Microsoft.Bot.Builder.ComposerBot.json { - public class TestBot : ActivityHandler + public class ComposerBot : ActivityHandler { private AdaptiveDialog rootDialog; private readonly ResourceExplorer resourceExplorer; @@ -28,17 +30,18 @@ public class TestBot : ActivityHandler private DialogManager dialogManager; private ConversationState conversationState; private IStatePropertyAccessor dialogState; - private Source.IRegistry registry; + private ISourceMap sourceMap; private string rootDialogFile { get; set; } - public TestBot(string rootDialogFile, ConversationState conversationState, UserState userState, ResourceExplorer resourceExplorer, Source.IRegistry registry) + public ComposerBot(string rootDialogFile, ConversationState conversationState, UserState userState, ResourceExplorer resourceExplorer, ISourceMap sourceMap) { this.conversationState = conversationState; this.userState = userState; this.dialogState = conversationState.CreateProperty("DialogState"); - this.registry = registry; + this.sourceMap = sourceMap; this.resourceExplorer = resourceExplorer; this.rootDialogFile = rootDialogFile; + DeclarativeTypeLoader.AddComponent(new QnAMakerComponentRegistration()); // auto reload dialogs when file changes this.resourceExplorer.Changed += (resources) => { @@ -46,15 +49,14 @@ public TestBot(string rootDialogFile, ConversationState conversationState, UserS { Task.Run(() => this.LoadRootDialogAsync()); } - }; - + }; LoadRootDialogAsync(); } private void LoadRootDialogAsync() { var rootFile = resourceExplorer.GetResource(rootDialogFile); - rootDialog = DeclarativeTypeLoader.Load(rootFile, resourceExplorer, registry); + rootDialog = DeclarativeTypeLoader.Load(rootFile, resourceExplorer, sourceMap); this.dialogManager = new DialogManager(rootDialog); } diff --git a/BotProject/CSharp/ComposerData/README.md b/BotProject/CSharp/ComposerData/README.md deleted file mode 100644 index db8c858ced..0000000000 --- a/BotProject/CSharp/ComposerData/README.md +++ /dev/null @@ -1,2 +0,0 @@ -Copy all files from your Composer bot project to this folder before deploying - diff --git a/BotProject/CSharp/Controllers/BotAdminController.cs b/BotProject/CSharp/Controllers/BotAdminController.cs index 2e59745215..3a3a078f9a 100644 --- a/BotProject/CSharp/Controllers/BotAdminController.cs +++ b/BotProject/CSharp/Controllers/BotAdminController.cs @@ -6,7 +6,7 @@ using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc; -namespace Microsoft.Bot.Builder.TestBot.Json +namespace Microsoft.Bot.Builder.ComposerBot.json { [Route("api/admin")] [ApiController] diff --git a/BotProject/CSharp/Controllers/BotController.cs b/BotProject/CSharp/Controllers/BotController.cs index 50568ae2f5..2127be1778 100644 --- a/BotProject/CSharp/Controllers/BotController.cs +++ b/BotProject/CSharp/Controllers/BotController.cs @@ -10,7 +10,7 @@ using Microsoft.Bot.Builder.Dialogs.Debugging; using Microsoft.Bot.Builder.Integration.AspNet.Core; -namespace Microsoft.Bot.Builder.TestBot.Json +namespace Microsoft.Bot.Builder.ComposerBot.json { // This ASP Controller is created to handle a request. Dependency Injection will provide the Adapter and IBot // implementation at runtime. Multiple different IBot implementations running at different endpoints can be diff --git a/BotProject/CSharp/LuisConfig.cs b/BotProject/CSharp/LuisConfig.cs index 5cecd8b1db..290d00b0ce 100644 --- a/BotProject/CSharp/LuisConfig.cs +++ b/BotProject/CSharp/LuisConfig.cs @@ -3,7 +3,7 @@ using System.Linq; using System.Threading.Tasks; -namespace Microsoft.Bot.Builder.TestBot.Json +namespace Microsoft.Bot.Builder.ComposerBot.json { public class LuisCustomConfig { diff --git a/BotProject/CSharp/NuGet.Config b/BotProject/CSharp/NuGet.Config index 2ef4fea8a2..11ff1952c1 100644 --- a/BotProject/CSharp/NuGet.Config +++ b/BotProject/CSharp/NuGet.Config @@ -2,6 +2,6 @@ - + diff --git a/BotProject/CSharp/Program.cs b/BotProject/CSharp/Program.cs index 46eca57aa0..7d62e09553 100644 --- a/BotProject/CSharp/Program.cs +++ b/BotProject/CSharp/Program.cs @@ -7,7 +7,7 @@ using System; using System.IO; -namespace Microsoft.Bot.Builder.TestBot.Json +namespace Microsoft.Bot.Builder.ComposerBot.json { public class Program { diff --git a/BotProject/CSharp/Properties/launchSettings.json b/BotProject/CSharp/Properties/launchSettings.json index f018ff223d..33c8346152 100644 --- a/BotProject/CSharp/Properties/launchSettings.json +++ b/BotProject/CSharp/Properties/launchSettings.json @@ -18,10 +18,10 @@ "BotProject": { "commandName": "Project", "launchBrowser": true, + "applicationUrl": "http://localhost:3979", "environmentVariables": { "ASPNETCORE_ENVIRONMENT": "Development" - }, - "applicationUrl": "http://localhost:3979" + } } } } \ No newline at end of file diff --git a/BotProject/CSharp/Recognizers/RuleRecognizer.cs b/BotProject/CSharp/Recognizers/RuleRecognizer.cs deleted file mode 100644 index c4b0599769..0000000000 --- a/BotProject/CSharp/Recognizers/RuleRecognizer.cs +++ /dev/null @@ -1,40 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading; -using System.Threading.Tasks; - -namespace Microsoft.Bot.Builder.TestBot.Json.Recognizers -{ - public class RuleRecognizer : IRecognizer - { - public Dictionary Rules { get; set; } = new Dictionary(); - - private const string defaultIntent = "None"; - - public Task RecognizeAsync(ITurnContext turnContext, CancellationToken cancellationToken) - { - string intent = defaultIntent; - - if (Rules.TryGetValue(turnContext.Activity.Text, out string value)) - { - intent = value; - } - - return Task.FromResult(new RecognizerResult() - { - Text = turnContext.Activity.Text, - AlteredText = turnContext.Activity.Text, - Intents = new Dictionary() - { - { intent, new IntentScore() { Score = 1.0} } - } - }); - } - - public Task RecognizeAsync(ITurnContext turnContext, CancellationToken cancellationToken) where T : IRecognizerConvert, new() - { - throw new NotImplementedException(); - } - } -} diff --git a/BotProject/CSharp/Schemas/sdk.schema b/BotProject/CSharp/Schemas/sdk.schema index c071385d77..fc90997234 100644 --- a/BotProject/CSharp/Schemas/sdk.schema +++ b/BotProject/CSharp/Schemas/sdk.schema @@ -5,9 +5,14 @@ "title": "Component types", "description": "These are all of the types that can be created by the loader.", "oneOf": [ + { + "title": "Microsoft.ActivityTemplate", + "description": "", + "$ref": "#/definitions/Microsoft.ActivityTemplate" + }, { "title": "Microsoft.AdaptiveDialog", - "description": "Configures a data driven dialog via a collection of actions/dialogs.", + "description": "Flexible, data driven dialog that can adapt to the conversation.", "$ref": "#/definitions/Microsoft.AdaptiveDialog" }, { @@ -17,22 +22,22 @@ }, { "title": "Microsoft.AttachmentInput", - "description": "This represents a dialog which gathers an attachment such as image or music", + "description": "Collect information - Ask for a file or image.", "$ref": "#/definitions/Microsoft.AttachmentInput" }, { "title": "Microsoft.BeginDialog", - "description": "Action which begins another dialog (and when that dialog is done, it will return the caller).", + "description": "Begin another dialog.", "$ref": "#/definitions/Microsoft.BeginDialog" }, { "title": "Microsoft.CancelAllDialogs", - "description": "Command to cancel all of the current dialogs by emitting an event which must be caught to prevent cancelation from propagating.", + "description": "Cancel all active dialogs. All dialogs in the dialog chain will need a trigger to capture the event configured in this action.", "$ref": "#/definitions/Microsoft.CancelAllDialogs" }, { "title": "Microsoft.ChoiceInput", - "description": "This represents a dialog which gathers a choice responses", + "description": "Collect information - Pick from a list of choices", "$ref": "#/definitions/Microsoft.ChoiceInput" }, { @@ -42,7 +47,7 @@ }, { "title": "Microsoft.ConfirmInput", - "description": "This represents a dialog which gathers a yes/no style responses", + "description": "Collect information - Ask for confirmation (yes or no).", "$ref": "#/definitions/Microsoft.ConfirmInput" }, { @@ -62,17 +67,17 @@ }, { "title": "Microsoft.DateTimeInput", - "description": "This represents a dialog which gathers Date or Time or DateTime from the user", + "description": "Collect information - Ask for date and/ or time", "$ref": "#/definitions/Microsoft.DateTimeInput" }, { "title": "Microsoft.DebugBreak", - "description": "If debugger is attached, do a debugger break at this point", + "description": "If debugger is attached, stop the execution at this point in the conversation.", "$ref": "#/definitions/Microsoft.DebugBreak" }, { "title": "Microsoft.DeleteProperty", - "description": "This is a action which allows you to remove a property from memory", + "description": "Delete a property and any value it holds.", "$ref": "#/definitions/Microsoft.DeleteProperty" }, { @@ -82,12 +87,12 @@ }, { "title": "Microsoft.EditActions", - "description": "Edit current dialog with changeType and Actions", + "description": "Edit the current list of actions.", "$ref": "#/definitions/Microsoft.EditActions" }, { "title": "Microsoft.EditArray", - "description": "This is a action which allows you to modify an array in memory", + "description": "Modify an array in memory", "$ref": "#/definitions/Microsoft.EditArray" }, { @@ -97,12 +102,12 @@ }, { "title": "Microsoft.EmitEvent", - "description": "This is a action which allows you to emit an event", + "description": "Emit an event. Capture this event with a trigger.", "$ref": "#/definitions/Microsoft.EmitEvent" }, { "title": "Microsoft.EndDialog", - "description": "Command which ends the current dialog, returning the resultProperty as the result of the dialog.", + "description": "End this dialog.", "$ref": "#/definitions/Microsoft.EndDialog" }, { @@ -117,12 +122,12 @@ }, { "title": "Microsoft.Foreach", - "description": "Action which executes actions per item in a collection.", + "description": "Execute actions on each item in an a collection.", "$ref": "#/definitions/Microsoft.Foreach" }, { "title": "Microsoft.ForeachPage", - "description": "Action which execute actions per item page in a collection.", + "description": "Execute actions on each page (collection of items) in an array.", "$ref": "#/definitions/Microsoft.ForeachPage" }, { @@ -137,17 +142,17 @@ }, { "title": "Microsoft.HttpRequest", - "description": "This is a action which replaces the current dialog with the target dialog", + "description": "Make a HTTP request.", "$ref": "#/definitions/Microsoft.HttpRequest" }, { "title": "Microsoft.IfCondition", - "description": "Action which conditionally decides which action to execute next.", + "description": "Two-way branch the conversation flow based on a condition.", "$ref": "#/definitions/Microsoft.IfCondition" }, { "title": "Microsoft.InitProperty", - "description": "This action allows you to innitial a property to either an object or array", + "description": "Define and initialize a property to be an array or object.", "$ref": "#/definitions/Microsoft.InitProperty" }, { @@ -157,12 +162,12 @@ }, { "title": "Microsoft.LanguagePolicy", - "description": "This represents a dialog which gathers a DateTime in a specified range", + "description": "This represents a policy map for locales lookups to use for language", "$ref": "#/definitions/Microsoft.LanguagePolicy" }, { "title": "Microsoft.LogAction", - "description": "This is a action which writes to console.log and optional creates a TraceActivity around a text binding", + "description": "Log a message to the host application. Send a TraceActivity to Bot Framework Emulator (optional).", "$ref": "#/definitions/Microsoft.LogAction" }, { @@ -182,7 +187,7 @@ }, { "title": "Microsoft.MultiLanguageRecognizer", - "description": "Recognizer which allows you to configure the recognizer per language, and to define the policy for using them", + "description": "Configure one recognizer per language and the specify the language fallback policy.", "$ref": "#/definitions/Microsoft.MultiLanguageRecognizer" }, { @@ -192,7 +197,7 @@ }, { "title": "Microsoft.NumberInput", - "description": "This represents a dialog which gathers a decimal number in a specified range", + "description": "Collect information - Ask for a number.", "$ref": "#/definitions/Microsoft.NumberInput" }, { @@ -202,87 +207,107 @@ }, { "title": "Microsoft.OAuthInput", - "description": "This represents a dialog which gathers an OAuth token from user", + "description": "Collect login information.", "$ref": "#/definitions/Microsoft.OAuthInput" }, { "title": "Microsoft.OnActivity", - "description": "This defines the actions to take when an custom activity is received", + "description": "Actions to perform on receipt of a generic activity.", "$ref": "#/definitions/Microsoft.OnActivity" }, { "title": "Microsoft.OnBeginDialog", - "description": "This defines the actions to take when a dialog is started via BeginDialog()", + "description": "Actions to perform when this dialog begins.", "$ref": "#/definitions/Microsoft.OnBeginDialog" }, + { + "title": "Microsoft.OnCancelDialog", + "description": "Actions to perform on cancel dialog event.", + "$ref": "#/definitions/Microsoft.OnCancelDialog" + }, + { + "title": "Microsoft.OnCondition", + "description": "Actions to perform when specified condition is true.", + "$ref": "#/definitions/Microsoft.OnCondition" + }, { "title": "Microsoft.OnConversationUpdateActivity", - "description": "This defines the actions to take when an ConversationUpdate activity is received", + "description": "Actions to perform on receipt of an activity with type 'ConversationUpdate'.", "$ref": "#/definitions/Microsoft.OnConversationUpdateActivity" }, + { + "title": "Microsoft.OnCustomEvent", + "description": "Actions to perform when a custom event is detected. Use 'Emit a custom event' action to raise a custom event.", + "$ref": "#/definitions/Microsoft.OnCustomEvent" + }, { "title": "Microsoft.OnDialogEvent", - "description": "Defines a rule for an event which is triggered by some source", + "description": "Actions to perform when a specific dialog event occurs.", "$ref": "#/definitions/Microsoft.OnDialogEvent" }, { "title": "Microsoft.OnEndOfConversationActivity", - "description": "This defines the actions to take when an EndOfConversation Activity is received", + "description": "Actions to perform on receipt of an activity with type 'EndOfConversation'.", "$ref": "#/definitions/Microsoft.OnEndOfConversationActivity" }, { - "title": "Microsoft.OnEvent", - "description": "Defines a rule for an event which is triggered by some source", - "$ref": "#/definitions/Microsoft.OnEvent" + "title": "Microsoft.OnError", + "description": "Action to perform when an 'Error' dialog event occurs.", + "$ref": "#/definitions/Microsoft.OnError" }, { "title": "Microsoft.OnEventActivity", - "description": "This defines the actions to take when an Event activity is received", + "description": "Actions to perform on receipt of an activity with type 'Event'.", "$ref": "#/definitions/Microsoft.OnEventActivity" }, { "title": "Microsoft.OnHandoffActivity", - "description": "This defines the actions to take when an Handoff activity is received", + "description": "Actions to perform on receipt of an activity with type 'HandOff'.", "$ref": "#/definitions/Microsoft.OnHandoffActivity" }, { "title": "Microsoft.OnIntent", - "description": "This defines the actions to take when an Intent is recognized (and optionally entities)", + "description": "Actions to perform when specified intent is recognized.", "$ref": "#/definitions/Microsoft.OnIntent" }, { "title": "Microsoft.OnInvokeActivity", - "description": "This defines the actions to take when an Invoke activity is received", + "description": "Actions to perform on receipt of an activity with type 'Invoke'.", "$ref": "#/definitions/Microsoft.OnInvokeActivity" }, { "title": "Microsoft.OnMessageActivity", - "description": "This defines the actions to take when an Message activity is received. NOTE: If this triggers it will override any Recognizer/Intent rule calculation", + "description": "Actions to perform on receipt of an activity with type 'Message'. Overrides Intent trigger.", "$ref": "#/definitions/Microsoft.OnMessageActivity" }, { "title": "Microsoft.OnMessageDeleteActivity", - "description": "This defines the actions to take when an MessageDelete activity is received", + "description": "Actions to perform on receipt of an activity with type 'MessageDelete'.", "$ref": "#/definitions/Microsoft.OnMessageDeleteActivity" }, { "title": "Microsoft.OnMessageReactionActivity", - "description": "This defines the actions to take when a MessageReaction activity is received", + "description": "Actions to perform on receipt of an activity with type 'MessageReaction'.", "$ref": "#/definitions/Microsoft.OnMessageReactionActivity" }, { "title": "Microsoft.OnMessageUpdateActivity", - "description": "This defines the actions to take when an MessageUpdate ctivity is received", + "description": "Actions to perform on receipt of an activity with type 'MessageUpdate'.", "$ref": "#/definitions/Microsoft.OnMessageUpdateActivity" }, + { + "title": "Microsoft.OnRepromptDialog", + "description": "Actions to perform when 'RepromptDialog' event occurs.", + "$ref": "#/definitions/Microsoft.OnRepromptDialog" + }, { "title": "Microsoft.OnTypingActivity", - "description": "This defines the actions to take when a Typing activity is received", + "description": "Actions to perform on receipt of an activity with type 'Typing'.", "$ref": "#/definitions/Microsoft.OnTypingActivity" }, { "title": "Microsoft.OnUnknownIntent", - "description": "This defines the actions to take when an utterence is not recognized (aka, the None Intent). NOTE: UnknownIntent will defer to any specific intent that fires in a parent dialog", + "description": "Action to perform when user input is unrecognized and if none of the 'on intent recognition' triggers match recognized intent.", "$ref": "#/definitions/Microsoft.OnUnknownIntent" }, { @@ -302,7 +327,7 @@ }, { "title": "Microsoft.QnAMakerDialog", - "description": "This represents a dialog which is driven by a call to QnAMaker.ai knowledge base", + "description": "Dialog which uses QnAMAker knowledge base to answer questions.", "$ref": "#/definitions/Microsoft.QnAMakerDialog" }, { @@ -311,38 +336,43 @@ "$ref": "#/definitions/Microsoft.RandomSelector" }, { - "title": "Microsoft.RegexEntityRecognizer", + "title": "Microsoft.RegExEntityRecognizer", "description": "Recognizer which recognizes patterns of input based on regex.", - "$ref": "#/definitions/Microsoft.RegexEntityRecognizer" + "$ref": "#/definitions/Microsoft.RegExEntityRecognizer" }, { "title": "Microsoft.RegexRecognizer", - "description": "Recognizer which uses regex expressions to generate intents and entities.", + "description": "Use regular expressions to recognize intents and entities from user input.", "$ref": "#/definitions/Microsoft.RegexRecognizer" }, { "title": "Microsoft.RepeatDialog", - "description": "This is a action which repeats the current dialog with the same dialog.", + "description": "Repeat current dialog.", "$ref": "#/definitions/Microsoft.RepeatDialog" }, { "title": "Microsoft.ReplaceDialog", - "description": "This is a action which replaces the current dialog with the target dialog", + "description": "Replace current dialog with another dialog.", "$ref": "#/definitions/Microsoft.ReplaceDialog" }, { "title": "Microsoft.SendActivity", - "description": "This is a action which sends an activity to the user", + "description": "Respond with an activity.", "$ref": "#/definitions/Microsoft.SendActivity" }, { "title": "Microsoft.SetProperty", - "description": "This action allows you to set memory to the value of an expression", + "description": "Set property to a value.", "$ref": "#/definitions/Microsoft.SetProperty" }, + { + "title": "Microsoft.StaticActivityTemplate", + "description": "This allows you to define a static Activity object", + "$ref": "#/definitions/Microsoft.StaticActivityTemplate" + }, { "title": "Microsoft.SwitchCondition", - "description": "Action which conditionally decides which action to execute next.", + "description": "Execute different actions based on the value of a property.", "$ref": "#/definitions/Microsoft.SwitchCondition" }, { @@ -352,12 +382,17 @@ }, { "title": "Microsoft.TextInput", - "description": "This represents a dialog which gathers a text from the user", + "description": "Collection information - Ask for a word or sentence.", "$ref": "#/definitions/Microsoft.TextInput" }, + { + "title": "Microsoft.TextTemplate", + "description": "Lg tempalte to evaluate to create text", + "$ref": "#/definitions/Microsoft.TextTemplate" + }, { "title": "Microsoft.TraceActivity", - "description": "This is a action which sends an TraceActivity to the transcript", + "description": "Send a trace activity to the transcript logger and/ or Bot Framework Emulator.", "$ref": "#/definitions/Microsoft.TraceActivity" }, { @@ -372,10 +407,67 @@ } ], "definitions": { + "Microsoft.ActivityTemplate": { + "$role": "unionType(Microsoft.IActivityTemplate)", + "title": "Microsoft ActivityTemplate", + "type": "object", + "properties": { + "$type": { + "title": "$type", + "description": "Defines the valid properties for the component you are configuring (from a dialog .schema file)", + "type": "string", + "pattern": "^[a-zA-Z][a-zA-Z0-9.]*$", + "const": "Microsoft.ActivityTemplate" + }, + "$copy": { + "title": "$copy", + "description": "Copy the definition by id from a .dialog file.", + "type": "string", + "pattern": "^(([a-zA-Z][a-zA-Z0-9.]*)?(#[a-zA-Z][a-zA-Z0-9.]*)?)$" + }, + "$id": { + "title": "$id", + "description": "Inline id for reuse of an inline definition", + "type": "string", + "pattern": "^([a-zA-Z][a-zA-Z0-9.]*)$" + }, + "$designer": { + "title": "$designer", + "type": "object", + "description": "Extra information for the Bot Framework Designer." + }, + "template": { + "title": "Template", + "Description": "Language Generator template to use to create the activity", + "type": "string" + } + }, + "additionalProperties": false, + "patternProperties": { + "^\\$": { + "type": "string" + } + }, + "anyOf": [ + { + "title": "Reference", + "required": [ + "$copy" + ] + }, + { + "title": "Type", + "required": [ + "template", + "$type" + ] + } + ] + }, "Microsoft.AdaptiveDialog": { "$role": "unionType(Microsoft.IDialog)", "title": "Adaptive Dialog", - "description": "Configures a data driven dialog via a collection of actions/dialogs.", + "description": "Flexible, data driven dialog that can adapt to the conversation.", "type": "object", "properties": { "$type": { @@ -400,85 +492,50 @@ "$designer": { "title": "$designer", "type": "object", - "description": "Extra information for the Bot Framework Composer." + "description": "Extra information for the Bot Framework Designer." }, "id": { "type": "string", "title": "Id", - "description": "(Optional) id for the dialog", - "examples": [ - "Dialog2" - ] - }, - "tags": { - "type": "array", - "title": "Tags", - "description": "Tags are optional strings that you can use to organize components", - "examples": [ - "input", - "confirmation" - ], - "items": { - "type": "string" - } - }, - "inputBindings": { - "type": "object", - "title": "Input Bindings", - "description": "This defines properties which be passed as arguments to this dialog", - "examples": [ - "value.birthday" - ], - "additionalProperties": { - "type": "string" - } - }, - "outputBinding": { - "$role": "memoryPath", - "title": "Output Property binding", - "description": "This is the property which the EndDialog(result) will be set to when EndDialog() is called", - "examples": [ - "value.birthday" - ], - "type": "string", - "pattern": "^[a-zA-Z][a-zA-Z0-9.]*$" + "description": "Optional dialog ID." }, "autoEndDialog": { "type": "boolean", - "title": "Auto End Dialog", - "description": "If this is true the dialog will automatically end when there are no more actions to run. If this is false it is the responsbility of the author to call EndDialog at an appropriate time.", + "title": "Auto end dialog", + "description": "If set to true the dialog will automatically end when there are no further actions. If set to false, remember to manually end the dialog using EndDialog action.", "default": "true" }, "defaultResultProperty": { "type": "string", - "title": "Default Result Property", - "description": "Property path to the memory to return as the result of this dialog ending because AutoEndDialog is true and there are no more actions to execute.", + "title": "Default result property", + "description": "Value that will be passed back to the parent dialog.", "default": "dialog.result" }, "recognizer": { "$type": "Microsoft.IRecognizer", "title": "Recognizer", - "description": "Configured recognizer to generate intent and entites from user utterance", + "description": "Language Understanding recognizer that interprets user input into intent and entities.", "$ref": "#/definitions/Microsoft.IRecognizer" }, "generator": { "$type": "Microsoft.ILanguageGenerator", "title": "Language Generator", - "description": "Language generator to use for this dialog. (aka: LG file)", + "description": "Language generator that generates bot responses.", "$ref": "#/definitions/Microsoft.ILanguageGenerator" }, "selector": { - "$type": "Microsoft.IEventSelector", + "$type": "Microsoft.ITriggerSelector", "title": "Selector", - "description": "Policy for how to select rule to execute next", - "$ref": "#/definitions/Microsoft.IEventSelector" + "description": "Policy to determine which trigger is executed. Defaults to a 'best match' selector (optional).", + "$ref": "#/definitions/Microsoft.ITriggerSelector" }, - "events": { + "triggers": { "type": "array", - "description": "Events to use to evaluate conversation", + "description": "List of triggers defined for this dialog.", + "title": "Triggers", "items": { - "$type": "Microsoft.IOnEvent", - "$ref": "#/definitions/Microsoft.IOnEvent" + "$type": "Microsoft.ITriggerCondition", + "$ref": "#/definitions/Microsoft.ITriggerCondition" } } }, @@ -504,7 +561,7 @@ ] }, "Microsoft.AgeEntityRecognizer": { - "$role": "unionType(Microsoft.EntityRecognizer)", + "$role": "unionType(Microsoft.EntityRecognizers)", "title": "Age Entity Recognizer", "description": "Recognizer which recognizes age.", "type": "object", @@ -531,7 +588,7 @@ "$designer": { "title": "$designer", "type": "object", - "description": "Extra information for the Bot Framework Composer." + "description": "Extra information for the Bot Framework Designer." } }, "additionalProperties": false, @@ -557,8 +614,8 @@ }, "Microsoft.AttachmentInput": { "$role": "unionType(Microsoft.IDialog)", - "title": "AttachmentInput Dialog", - "description": "This represents a dialog which gathers an attachment such as image or music", + "title": "Attachment input dialog", + "description": "Collect information - Ask for a file or image.", "type": "object", "properties": { "$type": { @@ -583,32 +640,17 @@ "$designer": { "title": "$designer", "type": "object", - "description": "Extra information for the Bot Framework Composer." + "description": "Extra information for the Bot Framework Designer." }, "id": { "type": "string", "title": "Id", - "description": "(Optional) id for the dialog", - "examples": [ - "Dialog2" - ] - }, - "tags": { - "type": "array", - "title": "Tags", - "description": "Tags are optional strings that you can use to organize components", - "examples": [ - "input", - "confirmation" - ], - "items": { - "type": "string" - } + "description": "Optional id for the dialog" }, "prompt": { "$type": "Microsoft.IActivityTemplate", - "title": "Initial Prompt", - "description": "The message to send to as prompt for this input.", + "title": "Initial prompt", + "description": "Message to send to collect information.", "examples": [ "What is your birth date?" ], @@ -616,75 +658,80 @@ }, "unrecognizedPrompt": { "$type": "Microsoft.IActivityTemplate", - "title": "Unrecognized Prompt", - "description": "The message to send if the last input is not recognized.", + "title": "Unrecognized prompt", + "description": "Message to send if user response is not recognized.", "examples": [ - "Let's try again. What is your birth date?" + "Sorry, I do not understand '{turn.activity.text'}. Let's try again. What is your birth date?" ], "$ref": "#/definitions/Microsoft.IActivityTemplate" }, "invalidPrompt": { "$type": "Microsoft.IActivityTemplate", - "title": "Invalid Prompt", - "description": "The message to send to when then input was not valid for the input type.", + "title": "Invalid prompt", + "description": "Message to send if user response is invalid. Relies on specified validation expressions.", "examples": [ - "No date was recognized" + "Sorry, '{this.value}' does not work. I need a number between 1-150. What is your age?" ], "$ref": "#/definitions/Microsoft.IActivityTemplate" }, "defaultValueResponse": { "$type": "Microsoft.IActivityTemplate", - "title": "Default Value Response", - "description": "The message to send to when max turn count has been exceeded and the default value is selected as the value.", + "title": "Default value response", + "description": "Message to send when max turn count (if specified) has been exceeded and the default value is selected as the value.", "examples": [ - "I didn't understand your responses, so I will just use the default value of 10. Let me know if you want to change it." + "Sorry, I'm having trouble understanding you. I will just use {this.options.defaultValue} for now. You can say 'I'm 36 years old' to change it." ], "$ref": "#/definitions/Microsoft.IActivityTemplate" }, "maxTurnCount": { "type": "integer", - "title": "Max Turn Count", - "description": "The max retry count for this prompt.", - "default": 2147483647, + "title": "Max turn count", + "description": "Maximum number of re-prompt attempts to collect information.", + "default": 3, "examples": [ 3 ] }, "validations": { "type": "array", - "title": "Validation Expressions", - "description": "Expressions to validate an input.", + "title": "Validation expressions", + "description": "Expression to validate user input.", + "examples": [ + "int(this.value) > 1 && int(this.value) <= 150", + "count(this.value) < 300" + ], "items": { "$role": "expression", "type": "string", "description": "String must contain an expression." } }, - "value": { - "$role": "expression", - "title": "Value", - "description": "The expression that you evaluated for input.", - "type": "string" - }, "property": { "$role": "expression", "title": "Property", - "description": "Property that this input dialog is bound to", + "description": "Property to store collected information. Input will be skipped if property has value (unless 'Always prompt' is true).", "examples": [ - "$birthday" + "$birthday", + "user.name", + "conversation.issueTitle", + "dialog.favColor" ], "type": "string" }, "defaultValue": { "$role": "expression", - "title": "Default Value", - "description": "Value to return if the value expression can't be evaluated.", + "title": "Default value", + "description": "Expression to examine on each turn of the conversation as possible value to the property.", + "examples": [ + "@userName", + "coalesce(@number, @partySize)" + ], "type": "string" }, "alwaysPrompt": { "type": "boolean", - "title": "Always Prompt", - "description": "If set to true this will always prompt the user regardless if you already have the value or not.", + "title": "Always prompt", + "description": "Collect information even if the specified 'property' is not empty.", "default": false, "examples": [ false @@ -692,16 +739,11 @@ }, "allowInterruptions": { "type": "string", - "enum": [ - "always", - "never", - "notRecognized" - ], "title": "Allow Interruptions", - "description": "Always will always consult parent dialogs first, never will not consult parent dialogs, notRecognized will consult parent only when it's not recognized", - "default": "notRecognized", + "description": "A boolean expression that determines whether the parent should be allowed to interrupt the input.", + "default": "true", "examples": [ - "notRecognized" + "true" ] }, "outputFormat": { @@ -710,8 +752,8 @@ "all", "first" ], - "title": "Output Format", - "description": "The attachment output format.", + "title": "Output format", + "description": "Attachment output format.", "default": "first" } }, @@ -738,8 +780,8 @@ }, "Microsoft.BeginDialog": { "$role": "unionType(Microsoft.IDialog)", - "title": "Begin Dialog", - "description": "Action which begins another dialog (and when that dialog is done, it will return the caller).", + "title": "Begin a dialog", + "description": "Begin another dialog.", "type": "object", "properties": { "$type": { @@ -764,49 +806,32 @@ "$designer": { "title": "$designer", "type": "object", - "description": "Extra information for the Bot Framework Composer." - }, - "id": { - "type": "string", - "title": "Id", - "description": "(Optional) id for the dialog", - "examples": [ - "Dialog2" - ] - }, - "tags": { - "type": "array", - "title": "Tags", - "description": "Tags are optional strings that you can use to organize components", - "examples": [ - "input", - "confirmation" - ], - "items": { - "type": "string" - } + "description": "Extra information for the Bot Framework Designer." }, "dialog": { "$type": "Microsoft.IDialog", - "title": "Dialog", - "description": "This is the dialog to call.", + "title": "Dialog name", + "description": "Name of the dialog to call.", + "examples": [ + "AddToDoDialog" + ], "$ref": "#/definitions/Microsoft.IDialog" }, "options": { "type": "object", - "title": "Options binding", - "description": "Bindings to configure the options object to pass to the dialog.", + "title": "Options", + "description": "One or more options that are passed to the dialog that is called.", "additionalProperties": { "type": "string", "title": "Options" } }, - "property": { + "resultProperty": { "$role": "expression", "title": "Property", - "description": "The property to bind to the dialog and store the result in", + "description": "Property to store any value returned by the dialog that is called.", "examples": [ - "user.name" + "dialog.userName" ], "type": "string" } @@ -834,8 +859,8 @@ }, "Microsoft.CancelAllDialogs": { "$role": "unionType(Microsoft.IDialog)", - "title": "Cancel All Dialogs", - "description": "Command to cancel all of the current dialogs by emitting an event which must be caught to prevent cancelation from propagating.", + "title": "Cancel all dialogs", + "description": "Cancel all active dialogs. All dialogs in the dialog chain will need a trigger to capture the event configured in this action.", "type": "object", "properties": { "$type": { @@ -860,37 +885,17 @@ "$designer": { "title": "$designer", "type": "object", - "description": "Extra information for the Bot Framework Composer." - }, - "id": { - "type": "string", - "title": "Id", - "description": "(Optional) id for the dialog", - "examples": [ - "Dialog2" - ] - }, - "tags": { - "type": "array", - "title": "Tags", - "description": "Tags are optional strings that you can use to organize components", - "examples": [ - "input", - "confirmation" - ], - "items": { - "type": "string" - } + "description": "Extra information for the Bot Framework Designer." }, "eventName": { - "title": "Event Name", - "description": "The name of event to emit", + "title": "Event name", + "description": "Name of the event to emit.", "type": "string" }, "eventValue": { "type": "object", - "title": "Event Value", - "description": "Optional value to emit along with the event", + "title": "Event value", + "description": "Value to emit with the event (optional).", "additionalProperties": true } }, @@ -917,37 +922,9 @@ }, "Microsoft.ChoiceInput": { "$role": "unionType(Microsoft.IDialog)", - "title": "ChoiceInput Dialog", - "description": "This represents a dialog which gathers a choice responses", + "title": "Choice input dialog", + "description": "Collect information - Pick from a list of choices", "type": "object", - "definitions": { - "choice": { - "type": "object", - "properties": { - "value": { - "type": "string", - "title": "Value", - "description": "the value to return when selected." - }, - "action": { - "title": "Action", - "description": "Card action for the choice", - "type": "object" - }, - "synonyms": { - "type": "array", - "title": "Synonyms", - "description": "the list of synonyms to recognize in addition to the value. This is optional.", - "items": { - "type": "string" - } - } - } - }, - "cardAction": { - "type": "object" - } - }, "properties": { "$type": { "title": "$type", @@ -971,32 +948,17 @@ "$designer": { "title": "$designer", "type": "object", - "description": "Extra information for the Bot Framework Composer." + "description": "Extra information for the Bot Framework Designer." }, "id": { "type": "string", "title": "Id", - "description": "(Optional) id for the dialog", - "examples": [ - "Dialog2" - ] - }, - "tags": { - "type": "array", - "title": "Tags", - "description": "Tags are optional strings that you can use to organize components", - "examples": [ - "input", - "confirmation" - ], - "items": { - "type": "string" - } + "description": "Optional id for the dialog" }, "prompt": { "$type": "Microsoft.IActivityTemplate", - "title": "Initial Prompt", - "description": "The message to send to as prompt for this input.", + "title": "Initial prompt", + "description": "Message to send to collect information.", "examples": [ "What is your birth date?" ], @@ -1004,75 +966,80 @@ }, "unrecognizedPrompt": { "$type": "Microsoft.IActivityTemplate", - "title": "Unrecognized Prompt", - "description": "The message to send if the last input is not recognized.", + "title": "Unrecognized prompt", + "description": "Message to send if user response is not recognized.", "examples": [ - "Let's try again. What is your birth date?" + "Sorry, I do not understand '{turn.activity.text'}. Let's try again. What is your birth date?" ], "$ref": "#/definitions/Microsoft.IActivityTemplate" }, "invalidPrompt": { "$type": "Microsoft.IActivityTemplate", - "title": "Invalid Prompt", - "description": "The message to send to when then input was not valid for the input type.", + "title": "Invalid prompt", + "description": "Message to send if user response is invalid. Relies on specified validation expressions.", "examples": [ - "No date was recognized" + "Sorry, '{this.value}' does not work. I need a number between 1-150. What is your age?" ], "$ref": "#/definitions/Microsoft.IActivityTemplate" }, "defaultValueResponse": { "$type": "Microsoft.IActivityTemplate", - "title": "Default Value Response", - "description": "The message to send to when max turn count has been exceeded and the default value is selected as the value.", + "title": "Default value response", + "description": "Message to send when max turn count (if specified) has been exceeded and the default value is selected as the value.", "examples": [ - "I didn't understand your responses, so I will just use the default value of 10. Let me know if you want to change it." + "Sorry, I'm having trouble understanding you. I will just use {this.options.defaultValue} for now. You can say 'I'm 36 years old' to change it." ], "$ref": "#/definitions/Microsoft.IActivityTemplate" }, "maxTurnCount": { "type": "integer", - "title": "Max Turn Count", - "description": "The max retry count for this prompt.", - "default": 2147483647, + "title": "Max turn count", + "description": "Maximum number of re-prompt attempts to collect information.", + "default": 3, "examples": [ 3 ] }, "validations": { "type": "array", - "title": "Validation Expressions", - "description": "Expressions to validate an input.", + "title": "Validation expressions", + "description": "Expression to validate user input.", + "examples": [ + "int(this.value) > 1 && int(this.value) <= 150", + "count(this.value) < 300" + ], "items": { "$role": "expression", "type": "string", "description": "String must contain an expression." } }, - "value": { - "$role": "expression", - "title": "Value", - "description": "The expression that you evaluated for input.", - "type": "string" - }, "property": { "$role": "expression", "title": "Property", - "description": "Property that this input dialog is bound to", + "description": "Property to store collected information. Input will be skipped if property has value (unless 'Always prompt' is true).", "examples": [ - "$birthday" + "$birthday", + "user.name", + "conversation.issueTitle", + "dialog.favColor" ], "type": "string" }, "defaultValue": { "$role": "expression", - "title": "Default Value", - "description": "Value to return if the value expression can't be evaluated.", + "title": "Default value", + "description": "Expression to examine on each turn of the conversation as possible value to the property.", + "examples": [ + "@userName", + "coalesce(@number, @partySize)" + ], "type": "string" }, "alwaysPrompt": { "type": "boolean", - "title": "Always Prompt", - "description": "If set to true this will always prompt the user regardless if you already have the value or not.", + "title": "Always prompt", + "description": "Collect information even if the specified 'property' is not empty.", "default": false, "examples": [ false @@ -1080,16 +1047,11 @@ }, "allowInterruptions": { "type": "string", - "enum": [ - "always", - "never", - "notRecognized" - ], "title": "Allow Interruptions", - "description": "Always will always consult parent dialogs first, never will not consult parent dialogs, notRecognized will consult parent only when it's not recognized", - "default": "notRecognized", + "description": "A boolean expression that determines whether the parent should be allowed to interrupt the input.", + "default": "true", "examples": [ - "notRecognized" + "true" ] }, "outputFormat": { @@ -1098,48 +1060,66 @@ "value", "index" ], - "title": "Output Format", - "description": "The output format.", + "title": "Output format", + "description": "Choice output format.", "default": "value" }, "choices": { - "type": "array", - "items": [ + "anyOf": [ { - "type": "object", - "properties": { - "value": { - "type": "string", - "title": "Value", - "description": "the value to return when selected." - }, - "action": { - "title": "Action", - "description": "Card action for the choice", - "type": "object" - }, - "synonyms": { - "type": "array", - "title": "Synonyms", - "description": "the list of synonyms to recognize in addition to the value. This is optional.", - "items": { - "type": "string" + "$role": "expression", + "type": "string", + "description": "String must contain an expression." + }, + { + "type": "array", + "items": [ + { + "type": "string" + } + ] + }, + { + "type": "array", + "items": [ + { + "title": "Choice", + "type": "object", + "properties": { + "value": { + "type": "string", + "title": "Value", + "description": "Value to return when this choice is selected." + }, + "action": { + "type": "object", + "title": "Action", + "description": "Card action for the choice." + }, + "synonyms": { + "type": "array", + "title": "Synonyms", + "description": "List of synonyms to recognize in addition to the value (optional).", + "items": { + "type": "string" + } + } } } - } + ] } ] }, "appendChoices": { "type": "boolean", - "title": "Append Choices", + "title": "Append choices", "description": "Compose an output activity containing a set of choices", "default": "true" }, "defaultLocale": { "type": "string", - "title": "Default Locale", - "description": "The prompts default locale that should be recognized.", + "title": "Default locale", + "description": "Default locale.", "default": "en-us" }, "style": { @@ -1152,8 +1132,8 @@ "SuggestedAction", "HeroCard" ], - "title": "List Style", - "description": "The kind of choice list style to generate", + "title": "List style", + "description": "Style to render choices.", "default": "Auto" }, "choiceOptions": { @@ -1161,26 +1141,26 @@ "properties": { "inlineSeparator": { "type": "string", - "title": "Inline Seperator", + "title": "Inline separator", "description": "Character used to separate individual choices when there are more than 2 choices", "default": ", " }, "inlineOr": { "type": "string", - "title": "Inline Or", - "description": "Separator inserted between the choices when their are only 2 choices", + "title": "Inline or", + "description": "Separator inserted between the choices when there are only 2 choices", "default": " or " }, "inlineOrMore": { "type": "string", - "title": "Inline OrMore", + "title": "Inline or more", "description": "Separator inserted between the last 2 choices when their are more than 2 choices.", "default": ", or " }, "includeNumbers": { "type": "boolean", - "title": "Include Numbers", - "description": "If true, inline and list style choices will be prefixed with the index of the choice.", + "title": "Include numbers", + "description": "If true, 'inline' and 'list' list style will be prefixed with the index of the choice.", "default": true } } @@ -1190,13 +1170,13 @@ "properties": { "noValue": { "type": "boolean", - "title": "No Value", + "title": "No value", "description": "If true, the choices value field will NOT be search over", "default": false }, "noAction": { "type": "boolean", - "title": "No Action", + "title": "No action", "description": "If true, the the choices action.title field will NOT be searched over", "default": false } @@ -1225,8 +1205,8 @@ ] }, "Microsoft.ConditionalSelector": { - "$role": "unionType(Microsoft.IEventSelector)", - "title": "Condtional Event Selector", + "$role": "unionType(Microsoft.ITriggerSelector)", + "title": "Condtional Trigger Selector", "description": "Use a rule selector based on a condition", "type": "object", "properties": { @@ -1252,7 +1232,7 @@ "$designer": { "title": "$designer", "type": "object", - "description": "Extra information for the Bot Framework Composer." + "description": "Extra information for the Bot Framework Designer." }, "condition": { "$role": "expression", @@ -1260,12 +1240,12 @@ "description": "String must contain an expression." }, "ifTrue": { - "$type": "Microsoft.IEventSelector", - "$ref": "#/definitions/Microsoft.IEventSelector" + "$type": "Microsoft.ITriggerSelector", + "$ref": "#/definitions/Microsoft.ITriggerSelector" }, "ifFalse": { - "$type": "Microsoft.IEventSelector", - "$ref": "#/definitions/Microsoft.IEventSelector" + "$type": "Microsoft.ITriggerSelector", + "$ref": "#/definitions/Microsoft.ITriggerSelector" } }, "additionalProperties": false, @@ -1294,37 +1274,9 @@ }, "Microsoft.ConfirmInput": { "$role": "unionType(Microsoft.IDialog)", - "title": "ConfirmInput Dialog", - "description": "This represents a dialog which gathers a yes/no style responses", + "title": "Confirm input dialog", + "description": "Collect information - Ask for confirmation (yes or no).", "type": "object", - "definitions": { - "choice": { - "type": "object", - "properties": { - "value": { - "type": "string", - "title": "Value", - "description": "the value to return when selected." - }, - "action": { - "title": "Action", - "description": "Card action for the choice", - "type": "object" - }, - "synonyms": { - "type": "array", - "title": "Synonyms", - "description": "The list of synonyms to recognize in addition to the value. This is optional.", - "items": { - "type": "string" - } - } - } - }, - "CardAction": { - "type": "object" - } - }, "properties": { "$type": { "title": "$type", @@ -1348,32 +1300,17 @@ "$designer": { "title": "$designer", "type": "object", - "description": "Extra information for the Bot Framework Composer." + "description": "Extra information for the Bot Framework Designer." }, "id": { "type": "string", "title": "Id", - "description": "(Optional) id for the dialog", - "examples": [ - "Dialog2" - ] - }, - "tags": { - "type": "array", - "title": "Tags", - "description": "Tags are optional strings that you can use to organize components", - "examples": [ - "input", - "confirmation" - ], - "items": { - "type": "string" - } + "description": "Optional id for the dialog" }, "prompt": { "$type": "Microsoft.IActivityTemplate", - "title": "Initial Prompt", - "description": "The message to send to as prompt for this input.", + "title": "Initial prompt", + "description": "Message to send to collect information.", "examples": [ "What is your birth date?" ], @@ -1381,75 +1318,80 @@ }, "unrecognizedPrompt": { "$type": "Microsoft.IActivityTemplate", - "title": "Unrecognized Prompt", - "description": "The message to send if the last input is not recognized.", + "title": "Unrecognized prompt", + "description": "Message to send if user response is not recognized.", "examples": [ - "Let's try again. What is your birth date?" + "Sorry, I do not understand '{turn.activity.text'}. Let's try again. What is your birth date?" ], "$ref": "#/definitions/Microsoft.IActivityTemplate" }, "invalidPrompt": { "$type": "Microsoft.IActivityTemplate", - "title": "Invalid Prompt", - "description": "The message to send to when then input was not valid for the input type.", + "title": "Invalid prompt", + "description": "Message to send if user response is invalid. Relies on specified validation expressions.", "examples": [ - "No date was recognized" + "Sorry, '{this.value}' does not work. I need a number between 1-150. What is your age?" ], "$ref": "#/definitions/Microsoft.IActivityTemplate" }, "defaultValueResponse": { "$type": "Microsoft.IActivityTemplate", - "title": "Default Value Response", - "description": "The message to send to when max turn count has been exceeded and the default value is selected as the value.", + "title": "Default value response", + "description": "Message to send when max turn count (if specified) has been exceeded and the default value is selected as the value.", "examples": [ - "I didn't understand your responses, so I will just use the default value of 10. Let me know if you want to change it." + "Sorry, I'm having trouble understanding you. I will just use {this.options.defaultValue} for now. You can say 'I'm 36 years old' to change it." ], "$ref": "#/definitions/Microsoft.IActivityTemplate" }, "maxTurnCount": { "type": "integer", - "title": "Max Turn Count", - "description": "The max retry count for this prompt.", - "default": 2147483647, + "title": "Max turn count", + "description": "Maximum number of re-prompt attempts to collect information.", + "default": 3, "examples": [ 3 ] }, "validations": { "type": "array", - "title": "Validation Expressions", - "description": "Expressions to validate an input.", + "title": "Validation expressions", + "description": "Expression to validate user input.", + "examples": [ + "int(this.value) > 1 && int(this.value) <= 150", + "count(this.value) < 300" + ], "items": { "$role": "expression", "type": "string", "description": "String must contain an expression." } }, - "value": { - "$role": "expression", - "title": "Value", - "description": "The expression that you evaluated for input.", - "type": "string" - }, "property": { "$role": "expression", "title": "Property", - "description": "Property that this input dialog is bound to", + "description": "Property to store collected information. Input will be skipped if property has value (unless 'Always prompt' is true).", "examples": [ - "$birthday" + "$birthday", + "user.name", + "conversation.issueTitle", + "dialog.favColor" ], "type": "string" }, "defaultValue": { "$role": "expression", - "title": "Default Value", - "description": "Value to return if the value expression can't be evaluated.", + "title": "Default value", + "description": "Expression to examine on each turn of the conversation as possible value to the property.", + "examples": [ + "@userName", + "coalesce(@number, @partySize)" + ], "type": "string" }, "alwaysPrompt": { "type": "boolean", - "title": "Always Prompt", - "description": "If set to true this will always prompt the user regardless if you already have the value or not.", + "title": "Always prompt", + "description": "Collect information even if the specified 'property' is not empty.", "default": false, "examples": [ false @@ -1457,22 +1399,17 @@ }, "allowInterruptions": { "type": "string", - "enum": [ - "always", - "never", - "notRecognized" - ], "title": "Allow Interruptions", - "description": "Always will always consult parent dialogs first, never will not consult parent dialogs, notRecognized will consult parent only when it's not recognized", - "default": "notRecognized", + "description": "A boolean expression that determines whether the parent should be allowed to interrupt the input.", + "default": "true", "examples": [ - "notRecognized" + "true" ] }, "defaultLocale": { "type": "string", - "title": "Default Locale", - "description": "The prompts default locale that should be recognized.", + "title": "Default locale", + "description": "Default locale.", "default": "en-us" }, "style": { @@ -1485,8 +1422,8 @@ "SuggestedAction", "HeroCard" ], - "title": "List Style", - "description": "The kind of choice list style to generate", + "title": "List style", + "description": "Style to render choices.", "default": "Auto" }, "choiceOptions": { @@ -1494,25 +1431,25 @@ "properties": { "inlineSeparator": { "type": "string", - "title": "Inline Seperator", + "title": "Inline separator", "description": "Character used to separate individual choices when there are more than 2 choices", "default": ", " }, "inlineOr": { "type": "string", - "title": "Inline Or", + "title": "Inline or", "description": "Separator inserted between the choices when their are only 2 choices", "default": " or " }, "inlineOrMore": { "type": "string", - "title": "Inline OrMore", + "title": "Inline or more", "description": "Separator inserted between the last 2 choices when their are more than 2 choices.", "default": ", or " }, "includeNumbers": { "type": "boolean", - "title": "Include Numbers", + "title": "Include numbers", "description": "If true, inline and list style choices will be prefixed with the index of the choice.", "default": true } @@ -1527,17 +1464,17 @@ "value": { "type": "string", "title": "Value", - "description": "the value to return when selected." + "description": "Value to return when this choice is selected." }, "action": { + "type": "object", "title": "Action", - "description": "Card action for the choice", - "type": "object" + "description": "Card action for the choice" }, "synonyms": { "type": "array", "title": "Synonyms", - "description": "The list of synonyms to recognize in addition to the value. This is optional.", + "description": "List of synonyms to recognize in addition to the value (optional)", "items": { "type": "string" } @@ -1569,7 +1506,7 @@ ] }, "Microsoft.ConfirmationEntityRecognizer": { - "$role": "unionType(Microsoft.EntityRecognizer)", + "$role": "unionType(Microsoft.EntityRecognizers)", "title": "Confirmation Entity Recognizer", "description": "Recognizer which recognizes confirmation choices (yes/no).", "type": "object", @@ -1596,7 +1533,7 @@ "$designer": { "title": "$designer", "type": "object", - "description": "Extra information for the Bot Framework Composer." + "description": "Extra information for the Bot Framework Designer." } }, "additionalProperties": false, @@ -1621,7 +1558,7 @@ ] }, "Microsoft.CurrencyEntityRecognizer": { - "$role": "unionType(Microsoft.EntityRecognizer)", + "$role": "unionType(Microsoft.EntityRecognizers)", "title": "Currency Entity Recognizer", "description": "Recognizer which recognizes currency.", "type": "object", @@ -1648,7 +1585,7 @@ "$designer": { "title": "$designer", "type": "object", - "description": "Extra information for the Bot Framework Composer." + "description": "Extra information for the Bot Framework Designer." } }, "additionalProperties": false, @@ -1673,7 +1610,7 @@ ] }, "Microsoft.DateTimeEntityRecognizer": { - "$role": "unionType(Microsoft.EntityRecognizer)", + "$role": "unionType(Microsoft.EntityRecognizers)", "title": "DateTime Entity Recognizer", "description": "Recognizer which recognizes dates and time fragments.", "type": "object", @@ -1700,7 +1637,7 @@ "$designer": { "title": "$designer", "type": "object", - "description": "Extra information for the Bot Framework Composer." + "description": "Extra information for the Bot Framework Designer." } }, "additionalProperties": false, @@ -1726,8 +1663,8 @@ }, "Microsoft.DateTimeInput": { "$role": "unionType(Microsoft.IDialog)", - "title": "DateTimeInput Dialog", - "description": "This represents a dialog which gathers Date or Time or DateTime from the user", + "title": "Date/time input dialog", + "description": "Collect information - Ask for date and/ or time", "type": "object", "properties": { "$type": { @@ -1752,32 +1689,17 @@ "$designer": { "title": "$designer", "type": "object", - "description": "Extra information for the Bot Framework Composer." + "description": "Extra information for the Bot Framework Designer." }, "id": { "type": "string", "title": "Id", - "description": "(Optional) id for the dialog", - "examples": [ - "Dialog2" - ] - }, - "tags": { - "type": "array", - "title": "Tags", - "description": "Tags are optional strings that you can use to organize components", - "examples": [ - "input", - "confirmation" - ], - "items": { - "type": "string" - } + "description": "Optional id for the dialog" }, "prompt": { "$type": "Microsoft.IActivityTemplate", - "title": "Initial Prompt", - "description": "The message to send to as prompt for this input.", + "title": "Initial prompt", + "description": "Message to send to collect information.", "examples": [ "What is your birth date?" ], @@ -1785,75 +1707,80 @@ }, "unrecognizedPrompt": { "$type": "Microsoft.IActivityTemplate", - "title": "Unrecognized Prompt", - "description": "The message to send if the last input is not recognized.", + "title": "Unrecognized prompt", + "description": "Message to send if user response is not recognized.", "examples": [ - "Let's try again. What is your birth date?" + "Sorry, I do not understand '{turn.activity.text'}. Let's try again. What is your birth date?" ], "$ref": "#/definitions/Microsoft.IActivityTemplate" }, "invalidPrompt": { "$type": "Microsoft.IActivityTemplate", - "title": "Invalid Prompt", - "description": "The message to send to when then input was not valid for the input type.", + "title": "Invalid prompt", + "description": "Message to send if user response is invalid. Relies on specified validation expressions.", "examples": [ - "No date was recognized" + "Sorry, '{this.value}' does not work. I need a number between 1-150. What is your age?" ], "$ref": "#/definitions/Microsoft.IActivityTemplate" }, "defaultValueResponse": { "$type": "Microsoft.IActivityTemplate", - "title": "Default Value Response", - "description": "The message to send to when max turn count has been exceeded and the default value is selected as the value.", + "title": "Default value response", + "description": "Message to send when max turn count (if specified) has been exceeded and the default value is selected as the value.", "examples": [ - "I didn't understand your responses, so I will just use the default value of 10. Let me know if you want to change it." + "Sorry, I'm having trouble understanding you. I will just use {this.options.defaultValue} for now. You can say 'I'm 36 years old' to change it." ], "$ref": "#/definitions/Microsoft.IActivityTemplate" }, "maxTurnCount": { "type": "integer", - "title": "Max Turn Count", - "description": "The max retry count for this prompt.", - "default": 2147483647, + "title": "Max turn count", + "description": "Maximum number of re-prompt attempts to collect information.", + "default": 3, "examples": [ 3 ] }, "validations": { "type": "array", - "title": "Validation Expressions", - "description": "Expressions to validate an input.", + "title": "Validation expressions", + "description": "Expression to validate user input.", + "examples": [ + "int(this.value) > 1 && int(this.value) <= 150", + "count(this.value) < 300" + ], "items": { "$role": "expression", "type": "string", "description": "String must contain an expression." } }, - "value": { - "$role": "expression", - "title": "Value", - "description": "The expression that you evaluated for input.", - "type": "string" - }, "property": { "$role": "expression", "title": "Property", - "description": "Property that this input dialog is bound to", + "description": "Property to store collected information. Input will be skipped if property has value (unless 'Always prompt' is true).", "examples": [ - "$birthday" + "$birthday", + "user.name", + "conversation.issueTitle", + "dialog.favColor" ], "type": "string" }, "defaultValue": { "$role": "expression", - "title": "Default Value", - "description": "Value to return if the value expression can't be evaluated.", + "title": "Default value", + "description": "Expression to examine on each turn of the conversation as possible value to the property.", + "examples": [ + "@userName", + "coalesce(@number, @partySize)" + ], "type": "string" }, "alwaysPrompt": { "type": "boolean", - "title": "Always Prompt", - "description": "If set to true this will always prompt the user regardless if you already have the value or not.", + "title": "Always prompt", + "description": "Collect information even if the specified 'property' is not empty.", "default": false, "examples": [ false @@ -1861,22 +1788,17 @@ }, "allowInterruptions": { "type": "string", - "enum": [ - "always", - "never", - "notRecognized" - ], "title": "Allow Interruptions", - "description": "Always will always consult parent dialogs first, never will not consult parent dialogs, notRecognized will consult parent only when it's not recognized", - "default": "notRecognized", + "description": "A boolean expression that determines whether the parent should be allowed to interrupt the input.", + "default": "true", "examples": [ - "notRecognized" + "true" ] }, "defaultLocale": { "type": "string", - "title": "Default Locale", - "description": "The prompts default locale that should be recognized.", + "title": "Default locale", + "description": "Default locale.", "default": "en-us" } }, @@ -1903,8 +1825,8 @@ }, "Microsoft.DebugBreak": { "$role": "unionType(Microsoft.IDialog)", - "title": "Debugger Break Action", - "description": "If debugger is attached, do a debugger break at this point", + "title": "Debugger break", + "description": "If debugger is attached, stop the execution at this point in the conversation.", "type": "object", "properties": { "$type": { @@ -1929,27 +1851,7 @@ "$designer": { "title": "$designer", "type": "object", - "description": "Extra information for the Bot Framework Composer." - }, - "id": { - "type": "string", - "title": "Id", - "description": "(Optional) id for the dialog", - "examples": [ - "Dialog2" - ] - }, - "tags": { - "type": "array", - "title": "Tags", - "description": "Tags are optional strings that you can use to organize components", - "examples": [ - "input", - "confirmation" - ], - "items": { - "type": "string" - } + "description": "Extra information for the Bot Framework Designer." } }, "additionalProperties": false, @@ -1976,7 +1878,7 @@ "Microsoft.DeleteProperty": { "$role": "unionType(Microsoft.IDialog)", "title": "Delete Property", - "description": "This is a action which allows you to remove a property from memory", + "description": "Delete a property and any value it holds.", "type": "object", "properties": { "$type": { @@ -2001,32 +1903,12 @@ "$designer": { "title": "$designer", "type": "object", - "description": "Extra information for the Bot Framework Composer." - }, - "id": { - "type": "string", - "title": "Id", - "description": "(Optional) id for the dialog", - "examples": [ - "Dialog2" - ] - }, - "tags": { - "type": "array", - "title": "Tags", - "description": "Tags are optional strings that you can use to organize components", - "examples": [ - "input", - "confirmation" - ], - "items": { - "type": "string" - } + "description": "Extra information for the Bot Framework Designer." }, "property": { "$role": "expression", "title": "Property", - "description": "The Memory property path to delete", + "description": "Property to delete.", "type": "string" } }, @@ -2053,7 +1935,7 @@ ] }, "Microsoft.DimensionEntityRecognizer": { - "$role": "unionType(Microsoft.EntityRecognizer)", + "$role": "unionType(Microsoft.EntityRecognizers)", "title": "Dimension Entity Recognizer", "description": "Recognizer which recognizes dimension.", "type": "object", @@ -2080,7 +1962,7 @@ "$designer": { "title": "$designer", "type": "object", - "description": "Extra information for the Bot Framework Composer." + "description": "Extra information for the Bot Framework Designer." } }, "additionalProperties": false, @@ -2106,8 +1988,8 @@ }, "Microsoft.EditActions": { "$role": "unionType(Microsoft.IDialog)", - "title": "EditActions Action", - "description": "Edit current dialog with changeType and Actions", + "title": "Edit actions.", + "description": "Edit the current list of actions.", "type": "object", "properties": { "$type": { @@ -2132,32 +2014,12 @@ "$designer": { "title": "$designer", "type": "object", - "description": "Extra information for the Bot Framework Composer." - }, - "id": { - "type": "string", - "title": "Id", - "description": "(Optional) id for the dialog", - "examples": [ - "Dialog2" - ] - }, - "tags": { - "type": "array", - "title": "Tags", - "description": "Tags are optional strings that you can use to organize components", - "examples": [ - "input", - "confirmation" - ], - "items": { - "type": "string" - } + "description": "Extra information for the Bot Framework Designer." }, "changeType": { "type": "string", - "title": "Change Type", - "description": "The change type to apply to current dialog", + "title": "Type of change", + "description": "Type of change to apply to the current actions.", "enum": [ "InsertActions", "InsertActionsBeforeTags", @@ -2169,7 +2031,7 @@ "actions": { "type": "array", "title": "Actions", - "description": "Actions to execute", + "description": "Actions to apply.", "items": { "$type": "Microsoft.IDialog", "$ref": "#/definitions/Microsoft.IDialog" @@ -2201,8 +2063,8 @@ }, "Microsoft.EditArray": { "$role": "unionType(Microsoft.IDialog)", - "title": "Edit Array Action", - "description": "This is a action which allows you to modify an array in memory", + "title": "Edit array", + "description": "Modify an array in memory", "type": "object", "properties": { "$type": { @@ -2227,32 +2089,12 @@ "$designer": { "title": "$designer", "type": "object", - "description": "Extra information for the Bot Framework Composer." - }, - "id": { - "type": "string", - "title": "Id", - "description": "(Optional) id for the dialog", - "examples": [ - "Dialog2" - ] - }, - "tags": { - "type": "array", - "title": "Tags", - "description": "Tags are optional strings that you can use to organize components", - "examples": [ - "input", - "confirmation" - ], - "items": { - "type": "string" - } + "description": "Extra information for the Bot Framework Designer." }, "changeType": { "type": "string", - "title": "Change Type", - "description": "The array operation to perform", + "title": "Type of change", + "description": "Type of change to the array in memory.", "enum": [ "Push", "Pop", @@ -2261,24 +2103,26 @@ "Clear" ] }, - "arrayProperty": { + "itemsProperty": { "$role": "expression", - "title": "Array Property", - "description": "Memory expression of the array to manipulate.", + "title": "Items property", + "description": "Property that holds the array to update.", "type": "string" }, "resultProperty": { "$role": "expression", "title": "Result Property", - "description": "Memory expression of the result of this action.", + "description": "Property to store the result of this action.", "type": "string" }, "value": { "$role": "expression", - "title": "Value of the Item", - "description": "Expression to evaluate.", + "title": "Value", + "description": "New value or expression.", "examples": [ - "dialog.todo" + "'milk'", + "dialog.favColor", + "dialog.favColor == 'red'" ], "type": "string" } @@ -2300,14 +2144,14 @@ "title": "Type", "required": [ "changeType", - "arrayProperty", + "itemsProperty", "$type" ] } ] }, "Microsoft.EmailEntityRecognizer": { - "$role": "unionType(Microsoft.EntityRecognizer)", + "$role": "unionType(Microsoft.EntityRecognizers)", "title": "Email Entity Recognizer", "description": "Recognizer which recognizes email.", "type": "object", @@ -2334,7 +2178,7 @@ "$designer": { "title": "$designer", "type": "object", - "description": "Extra information for the Bot Framework Composer." + "description": "Extra information for the Bot Framework Designer." } }, "additionalProperties": false, @@ -2360,8 +2204,8 @@ }, "Microsoft.EmitEvent": { "$role": "unionType(Microsoft.IDialog)", - "title": "Emit Event Action", - "description": "This is a action which allows you to emit an event", + "title": "Emit a custom event", + "description": "Emit an event. Capture this event with a trigger.", "type": "object", "properties": { "$type": { @@ -2386,31 +2230,11 @@ "$designer": { "title": "$designer", "type": "object", - "description": "Extra information for the Bot Framework Composer." - }, - "id": { - "type": "string", - "title": "Id", - "description": "(Optional) id for the dialog", - "examples": [ - "Dialog2" - ] - }, - "tags": { - "type": "array", - "title": "Tags", - "description": "Tags are optional strings that you can use to organize components", - "examples": [ - "input", - "confirmation" - ], - "items": { - "type": "string" - } + "description": "Extra information for the Bot Framework Designer." }, "eventName": { - "title": "Event Name", - "description": "The name of event to emit", + "title": "Event name", + "description": "Name of the event to emit.", "anyOf": [ { "enum": [ @@ -2435,14 +2259,14 @@ }, "eventValue": { "type": "object", - "title": "Event Value", - "description": "Optional value to emit along with the event", + "title": "Event value", + "description": "Value to emit with the event (optional).", "additionalProperties": true }, "bubbleEvent": { "type": "boolean", - "title": "Bubble Event", - "description": "If true this event should propagate to parent dialogs" + "title": "Bubble event", + "description": "If true this event is passed on to parent dialogs." } }, "additionalProperties": false, @@ -2469,8 +2293,8 @@ }, "Microsoft.EndDialog": { "$role": "unionType(Microsoft.IDialog)", - "title": "End Dialog", - "description": "Command which ends the current dialog, returning the resultProperty as the result of the dialog.", + "title": "End dialog", + "description": "End this dialog.", "type": "object", "properties": { "$type": { @@ -2495,33 +2319,15 @@ "$designer": { "title": "$designer", "type": "object", - "description": "Extra information for the Bot Framework Composer." - }, - "id": { - "type": "string", - "title": "Id", - "description": "(Optional) id for the dialog", - "examples": [ - "Dialog2" - ] - }, - "tags": { - "type": "array", - "title": "Tags", - "description": "Tags are optional strings that you can use to organize components", - "examples": [ - "input", - "confirmation" - ], - "items": { - "type": "string" - } + "description": "Extra information for the Bot Framework Designer." }, - "property": { + "value": { "$role": "expression", - "description": "Specifies a path to memory should be returned as the result to the calling dialog.", + "title": "Value", + "description": "Result value returned to the parent dialog.", "examples": [ - "dialog.name" + "dialog.userName", + "'tomato'" ], "type": "string" } @@ -2549,7 +2355,7 @@ }, "Microsoft.EndTurn": { "$role": "unionType(Microsoft.IDialog)", - "title": "End Turn", + "title": "End turn", "description": "End the current turn without ending the dialog.", "type": "object", "properties": { @@ -2575,27 +2381,7 @@ "$designer": { "title": "$designer", "type": "object", - "description": "Extra information for the Bot Framework Composer." - }, - "id": { - "type": "string", - "title": "Id", - "description": "(Optional) id for the dialog", - "examples": [ - "Dialog2" - ] - }, - "tags": { - "type": "array", - "title": "Tags", - "description": "Tags are optional strings that you can use to organize components", - "examples": [ - "input", - "confirmation" - ], - "items": { - "type": "string" - } + "description": "Extra information for the Bot Framework Designer." } }, "additionalProperties": false, @@ -2619,9 +2405,9 @@ } ] }, - "Microsoft.EntityRecognizer": { + "Microsoft.EntityRecognizers": { "$role": "unionType", - "title": "Entity Recognizer", + "title": "Entity Recognizers", "description": "Union of components which derive from EntityRecognizer abstract class.", "type": "object", "oneOf": [ @@ -2701,9 +2487,9 @@ "$ref": "#/definitions/Microsoft.PhoneNumberEntityRecognizer" }, { - "title": "Microsoft.RegexEntityRecognizer", + "title": "Microsoft.RegExEntityRecognizer", "description": "Recognizer which recognizes patterns of input based on regex.", - "$ref": "#/definitions/Microsoft.RegexEntityRecognizer" + "$ref": "#/definitions/Microsoft.RegExEntityRecognizer" }, { "title": "Microsoft.TemperatureEntityRecognizer", @@ -2718,8 +2504,8 @@ ] }, "Microsoft.FirstSelector": { - "$role": "unionType(Microsoft.IEventSelector)", - "title": "First Event Selector", + "$role": "unionType(Microsoft.ITriggerSelector)", + "title": "First Trigger Selector", "description": "Selector for first true rule", "type": "object", "properties": { @@ -2745,7 +2531,7 @@ "$designer": { "title": "$designer", "type": "object", - "description": "Extra information for the Bot Framework Composer." + "description": "Extra information for the Bot Framework Designer." } }, "additionalProperties": false, @@ -2771,8 +2557,8 @@ }, "Microsoft.Foreach": { "$role": "unionType(Microsoft.IDialog)", - "title": "Foreach Action", - "description": "Action which executes actions per item in a collection.", + "title": "For each item", + "description": "Execute actions on each item in an a collection.", "type": "object", "properties": { "$type": { @@ -2797,32 +2583,12 @@ "$designer": { "title": "$designer", "type": "object", - "description": "Extra information for the Bot Framework Composer." - }, - "id": { - "type": "string", - "title": "Id", - "description": "(Optional) id for the dialog", - "examples": [ - "Dialog2" - ] + "description": "Extra information for the Bot Framework Designer." }, - "tags": { - "type": "array", - "title": "Tags", - "description": "Tags are optional strings that you can use to organize components", - "examples": [ - "input", - "confirmation" - ], - "items": { - "type": "string" - } - }, - "listProperty": { + "itemsProperty": { "$role": "expression", - "title": "ListProperty", - "description": "Expression to evaluate.", + "title": "Items property", + "description": "Property that holds the array.", "examples": [ "user.todoList" ], @@ -2831,25 +2597,11 @@ "actions": { "type": "array", "title": "Actions", - "description": "Actions to execute", + "description": "Actions to execute for each item. Use '$foreach.value' to access the value of each item. Use '$foreach.index' to access the index of each item.", "items": { "$type": "Microsoft.IDialog", "$ref": "#/definitions/Microsoft.IDialog" } - }, - "indexProperty": { - "$role": "expression", - "title": "Index Property", - "description": "The memory path which refers to the index of the item", - "default": "dialog.index", - "type": "string" - }, - "valueProperty": { - "$role": "expression", - "title": "Value Property", - "description": "The memory path which refers to the value of the item", - "default": "dialog.value", - "type": "string" } }, "additionalProperties": false, @@ -2868,7 +2620,7 @@ { "title": "Type", "required": [ - "listProperty", + "itemsProperty", "actions", "$type" ] @@ -2877,8 +2629,8 @@ }, "Microsoft.ForeachPage": { "$role": "unionType(Microsoft.IDialog)", - "title": "Foreach Page Action", - "description": "Action which execute actions per item page in a collection.", + "title": "For each page", + "description": "Execute actions on each page (collection of items) in an array.", "type": "object", "properties": { "$type": { @@ -2903,32 +2655,12 @@ "$designer": { "title": "$designer", "type": "object", - "description": "Extra information for the Bot Framework Composer." - }, - "id": { - "type": "string", - "title": "Id", - "description": "(Optional) id for the dialog", - "examples": [ - "Dialog2" - ] - }, - "tags": { - "type": "array", - "title": "Tags", - "description": "Tags are optional strings that you can use to organize components", - "examples": [ - "input", - "confirmation" - ], - "items": { - "type": "string" - } + "description": "Extra information for the Bot Framework Designer." }, - "listProperty": { + "itemsProperty": { "$role": "expression", - "title": "ListProperty", - "description": "Expression to evaluate.", + "title": "Items property", + "description": "Property that holds the array.", "examples": [ "user.todoList" ], @@ -2937,7 +2669,7 @@ "actions": { "type": "array", "title": "Actions", - "description": "Actions to execute", + "description": "Actions to execute for each page. Use '$foreach.page' to access each page.", "items": { "$type": "Microsoft.IDialog", "$ref": "#/definitions/Microsoft.IDialog" @@ -2945,16 +2677,9 @@ }, "pageSize": { "type": "integer", - "title": "Page Size", - "description": "The page size", + "title": "Page size", + "description": "Number of items in each page.", "default": 10 - }, - "valueProperty": { - "$role": "expression", - "title": "Value Property", - "description": "The memory path which refers to the value of the item", - "default": "dialog.value", - "type": "string" } }, "additionalProperties": false, @@ -2973,7 +2698,7 @@ { "title": "Type", "required": [ - "listProperty", + "itemsProperty", "actions", "$type" ] @@ -2981,7 +2706,7 @@ ] }, "Microsoft.GuidEntityRecognizer": { - "$role": "unionType(Microsoft.EntityRecognizer)", + "$role": "unionType(Microsoft.EntityRecognizers)", "title": "Guid Entity Recognizer", "description": "Recognizer which recognizes guids.", "type": "object", @@ -3008,7 +2733,7 @@ "$designer": { "title": "$designer", "type": "object", - "description": "Extra information for the Bot Framework Composer." + "description": "Extra information for the Bot Framework Designer." } }, "additionalProperties": false, @@ -3033,7 +2758,7 @@ ] }, "Microsoft.HashtagEntityRecognizer": { - "$role": "unionType(Microsoft.EntityRecognizer)", + "$role": "unionType(Microsoft.EntityRecognizers)", "title": "Hashtag Entity Recognizer", "description": "Recognizer which recognizes Hashtags.", "type": "object", @@ -3060,7 +2785,7 @@ "$designer": { "title": "$designer", "type": "object", - "description": "Extra information for the Bot Framework Composer." + "description": "Extra information for the Bot Framework Designer." } }, "additionalProperties": false, @@ -3087,8 +2812,8 @@ "Microsoft.HttpRequest": { "$role": "unionType(Microsoft.IDialog)", "type": "object", - "title": "Http Request", - "description": "This is a action which replaces the current dialog with the target dialog", + "title": "HTTP request", + "description": "Make a HTTP request.", "properties": { "$type": { "title": "$type", @@ -3112,35 +2837,18 @@ "$designer": { "title": "$designer", "type": "object", - "description": "Extra information for the Bot Framework Composer." - }, - "id": { - "type": "string", - "title": "Id", - "description": "(Optional) id for the dialog", - "examples": [ - "Dialog2" - ] - }, - "tags": { - "type": "array", - "title": "Tags", - "description": "Tags are optional strings that you can use to organize components", - "examples": [ - "input", - "confirmation" - ], - "items": { - "type": "string" - } + "description": "Extra information for the Bot Framework Designer." }, "method": { "type": "string", - "title": "Method", - "description": "The HTTP method to use", + "title": "HTTP method", + "description": "HTTP method to use.", "enum": [ "GET", - "POST" + "POST", + "PATCH", + "PUT", + "DELETE" ], "examples": [ "GET", @@ -3150,7 +2858,7 @@ "url": { "type": "string", "title": "Url", - "description": "The url to call (supports data binding)", + "description": "URL to call (supports data binding).", "examples": [ "https://contoso.com" ] @@ -3158,13 +2866,13 @@ "body": { "type": "object", "title": "Body", - "description": "The body to send in the HTTP call (supports data binding)", + "description": "Body to include in the HTTP call (supports data binding).", "additionalProperties": true }, - "property": { + "resultProperty": { "$role": "expression", - "title": "Property", - "description": "The property to store the result of the HTTP call in. The result will have 4 properties from the http response: statusCode|reasonPhrase|content|headers. If the content is json it will be an deserialized object, otherwise it will be a string", + "title": "Result property", + "description": "Property to store the result of this action. The result includes 4 properties from the http response: statusCode, reasonPhrase, content and headers. If the content is json it will be a deserialized object.", "examples": [ "dialog.contosodata" ], @@ -3173,13 +2881,13 @@ "headers": { "type": "object", "additionProperties": true, - "title": "Http headers", - "description": "Http headers to include with the HTTP request (supports data binding)" + "title": "Headers", + "description": "One or more headers to include in the request (supports data binding)." }, "responseType": { "type": "string", - "title": "Response Type", - "description": "Describes how to parse the response from the http request. If Activity or Activities, then the they will be sent to the user.", + "title": "Response type", + "description": "Defines the type of HTTP response. Automatically calls the 'Send a response' action if set to 'Activity' or 'Activities'.", "enum": [ "None", "Json", @@ -3213,86 +2921,94 @@ ] }, "Microsoft.IActivityTemplate": { - "title": "Microsoft ActivityTemplate", - "description": "Union of components which implement the IActivityTemplate interface", + "title": "Microsoft ActivityTemplates", + "description": "Components which are IActivityTemplates", "$role": "unionType", "oneOf": [ { - "$role": "lg", + "title": "Microsoft.ActivityTemplate", + "description": "", + "$ref": "#/definitions/Microsoft.ActivityTemplate" + }, + { + "title": "Microsoft.StaticActivityTemplate", + "description": "This allows you to define a static Activity object", + "$ref": "#/definitions/Microsoft.StaticActivityTemplate" + }, + { "type": "string", - "description": "String is used for language generation.", "title": "string" } ] }, "Microsoft.IDialog": { - "title": "Microsoft IDialog", - "description": "Union of components which implement the IDialog interface", + "title": "Microsoft Dialogs", + "description": "Union of components which implement the Dialog contract", "$role": "unionType", "oneOf": [ { "title": "Microsoft.AdaptiveDialog", - "description": "Configures a data driven dialog via a collection of actions/dialogs.", + "description": "Flexible, data driven dialog that can adapt to the conversation.", "$ref": "#/definitions/Microsoft.AdaptiveDialog" }, { "title": "Microsoft.AttachmentInput", - "description": "This represents a dialog which gathers an attachment such as image or music", + "description": "Collect information - Ask for a file or image.", "$ref": "#/definitions/Microsoft.AttachmentInput" }, { "title": "Microsoft.BeginDialog", - "description": "Action which begins another dialog (and when that dialog is done, it will return the caller).", + "description": "Begin another dialog.", "$ref": "#/definitions/Microsoft.BeginDialog" }, { "title": "Microsoft.CancelAllDialogs", - "description": "Command to cancel all of the current dialogs by emitting an event which must be caught to prevent cancelation from propagating.", + "description": "Cancel all active dialogs. All dialogs in the dialog chain will need a trigger to capture the event configured in this action.", "$ref": "#/definitions/Microsoft.CancelAllDialogs" }, { "title": "Microsoft.ChoiceInput", - "description": "This represents a dialog which gathers a choice responses", + "description": "Collect information - Pick from a list of choices", "$ref": "#/definitions/Microsoft.ChoiceInput" }, { "title": "Microsoft.ConfirmInput", - "description": "This represents a dialog which gathers a yes/no style responses", + "description": "Collect information - Ask for confirmation (yes or no).", "$ref": "#/definitions/Microsoft.ConfirmInput" }, { "title": "Microsoft.DateTimeInput", - "description": "This represents a dialog which gathers Date or Time or DateTime from the user", + "description": "Collect information - Ask for date and/ or time", "$ref": "#/definitions/Microsoft.DateTimeInput" }, { "title": "Microsoft.DebugBreak", - "description": "If debugger is attached, do a debugger break at this point", + "description": "If debugger is attached, stop the execution at this point in the conversation.", "$ref": "#/definitions/Microsoft.DebugBreak" }, { "title": "Microsoft.DeleteProperty", - "description": "This is a action which allows you to remove a property from memory", + "description": "Delete a property and any value it holds.", "$ref": "#/definitions/Microsoft.DeleteProperty" }, { "title": "Microsoft.EditActions", - "description": "Edit current dialog with changeType and Actions", + "description": "Edit the current list of actions.", "$ref": "#/definitions/Microsoft.EditActions" }, { "title": "Microsoft.EditArray", - "description": "This is a action which allows you to modify an array in memory", + "description": "Modify an array in memory", "$ref": "#/definitions/Microsoft.EditArray" }, { "title": "Microsoft.EmitEvent", - "description": "This is a action which allows you to emit an event", + "description": "Emit an event. Capture this event with a trigger.", "$ref": "#/definitions/Microsoft.EmitEvent" }, { "title": "Microsoft.EndDialog", - "description": "Command which ends the current dialog, returning the resultProperty as the result of the dialog.", + "description": "End this dialog.", "$ref": "#/definitions/Microsoft.EndDialog" }, { @@ -3302,82 +3018,82 @@ }, { "title": "Microsoft.Foreach", - "description": "Action which executes actions per item in a collection.", + "description": "Execute actions on each item in an a collection.", "$ref": "#/definitions/Microsoft.Foreach" }, { "title": "Microsoft.ForeachPage", - "description": "Action which execute actions per item page in a collection.", + "description": "Execute actions on each page (collection of items) in an array.", "$ref": "#/definitions/Microsoft.ForeachPage" }, { "title": "Microsoft.HttpRequest", - "description": "This is a action which replaces the current dialog with the target dialog", + "description": "Make a HTTP request.", "$ref": "#/definitions/Microsoft.HttpRequest" }, { "title": "Microsoft.IfCondition", - "description": "Action which conditionally decides which action to execute next.", + "description": "Two-way branch the conversation flow based on a condition.", "$ref": "#/definitions/Microsoft.IfCondition" }, { "title": "Microsoft.InitProperty", - "description": "This action allows you to innitial a property to either an object or array", + "description": "Define and initialize a property to be an array or object.", "$ref": "#/definitions/Microsoft.InitProperty" }, { "title": "Microsoft.LogAction", - "description": "This is a action which writes to console.log and optional creates a TraceActivity around a text binding", + "description": "Log a message to the host application. Send a TraceActivity to Bot Framework Emulator (optional).", "$ref": "#/definitions/Microsoft.LogAction" }, { "title": "Microsoft.NumberInput", - "description": "This represents a dialog which gathers a decimal number in a specified range", + "description": "Collect information - Ask for a number.", "$ref": "#/definitions/Microsoft.NumberInput" }, { "title": "Microsoft.OAuthInput", - "description": "This represents a dialog which gathers an OAuth token from user", + "description": "Collect login information.", "$ref": "#/definitions/Microsoft.OAuthInput" }, { "title": "Microsoft.QnAMakerDialog", - "description": "This represents a dialog which is driven by a call to QnAMaker.ai knowledge base", + "description": "Dialog which uses QnAMAker knowledge base to answer questions.", "$ref": "#/definitions/Microsoft.QnAMakerDialog" }, { "title": "Microsoft.RepeatDialog", - "description": "This is a action which repeats the current dialog with the same dialog.", + "description": "Repeat current dialog.", "$ref": "#/definitions/Microsoft.RepeatDialog" }, { "title": "Microsoft.ReplaceDialog", - "description": "This is a action which replaces the current dialog with the target dialog", + "description": "Replace current dialog with another dialog.", "$ref": "#/definitions/Microsoft.ReplaceDialog" }, { "title": "Microsoft.SendActivity", - "description": "This is a action which sends an activity to the user", + "description": "Respond with an activity.", "$ref": "#/definitions/Microsoft.SendActivity" }, { "title": "Microsoft.SetProperty", - "description": "This action allows you to set memory to the value of an expression", + "description": "Set property to a value.", "$ref": "#/definitions/Microsoft.SetProperty" }, { "title": "Microsoft.SwitchCondition", - "description": "Action which conditionally decides which action to execute next.", + "description": "Execute different actions based on the value of a property.", "$ref": "#/definitions/Microsoft.SwitchCondition" }, { "title": "Microsoft.TextInput", - "description": "This represents a dialog which gathers a text from the user", + "description": "Collection information - Ask for a word or sentence.", "$ref": "#/definitions/Microsoft.TextInput" }, { "title": "Microsoft.TraceActivity", - "description": "This is a action which sends an TraceActivity to the transcript", + "description": "Send a trace activity to the transcript logger and/ or Bot Framework Emulator.", "$ref": "#/definitions/Microsoft.TraceActivity" }, { @@ -3386,58 +3102,52 @@ } ] }, - "Microsoft.IEventSelector": { - "title": "Microsoft IEventSelector", - "description": "Union of components which implement the IEventSelector interface", + "Microsoft.ILanguageGenerator": { + "title": "Microsoft ILanguageGenerator", + "description": "Union of components which implement the ILanguageGenerator interface", "$role": "unionType", "oneOf": [ { - "title": "Microsoft.ConditionalSelector", - "description": "Use a rule selector based on a condition", - "$ref": "#/definitions/Microsoft.ConditionalSelector" - }, + "type": "string", + "title": "string" + } + ] + }, + "Microsoft.IRecognizer": { + "title": "Microsoft IRecognizer", + "description": "Union of components which implement the IRecognizer interface", + "$role": "unionType", + "oneOf": [ { - "title": "Microsoft.FirstSelector", - "description": "Selector for first true rule", - "$ref": "#/definitions/Microsoft.FirstSelector" + "title": "Microsoft.LuisRecognizer", + "description": "LUIS recognizer.", + "$ref": "#/definitions/Microsoft.LuisRecognizer" }, { - "title": "Microsoft.MostSpecificSelector", - "description": "Select most specific true events with optional additional selector", - "$ref": "#/definitions/Microsoft.MostSpecificSelector" + "title": "Microsoft.MultiLanguageRecognizer", + "description": "Configure one recognizer per language and the specify the language fallback policy.", + "$ref": "#/definitions/Microsoft.MultiLanguageRecognizer" }, { - "title": "Microsoft.RandomSelector", - "description": "Select most specific true rule", - "$ref": "#/definitions/Microsoft.RandomSelector" + "title": "Microsoft.RegexRecognizer", + "description": "Use regular expressions to recognize intents and entities from user input.", + "$ref": "#/definitions/Microsoft.RegexRecognizer" }, - { - "title": "Microsoft.TrueSelector", - "description": "Selector for all true events", - "$ref": "#/definitions/Microsoft.TrueSelector" - } - ] - }, - "Microsoft.ILanguageGenerator": { - "title": "Microsoft ILanguageGenerator", - "description": "Union of components which implement the ILanguageGenerator interface", - "$role": "unionType", - "oneOf": [ { "type": "string", "title": "string" } ] }, - "Microsoft.ILanguagePolicy": { - "title": "Microsoft Language Policy", - "description": "Union of components which implement the ILanguagePolicy interface", + "Microsoft.ITextTemplate": { + "title": "Microsoft TextTemplate", + "description": "Union of components which implement the TextTemplate", "$role": "unionType", "oneOf": [ { - "title": "Microsoft.LanguagePolicy", - "description": "This represents a dialog which gathers a DateTime in a specified range", - "$ref": "#/definitions/Microsoft.LanguagePolicy" + "title": "Microsoft.TextTemplate", + "description": "Lg tempalte to evaluate to create text", + "$ref": "#/definitions/Microsoft.TextTemplate" }, { "type": "string", @@ -3445,134 +3155,149 @@ } ] }, - "Microsoft.IOnEvent": { - "title": "Microsoft IOnEvent", - "description": "Union of components which implement the IOnEvent interface", + "Microsoft.ITriggerCondition": { "$role": "unionType", + "title": "Microsoft Triggers", + "description": "Union of components which implement the OnCondition", "oneOf": [ { "title": "Microsoft.OnActivity", - "description": "This defines the actions to take when an custom activity is received", + "description": "Actions to perform on receipt of a generic activity.", "$ref": "#/definitions/Microsoft.OnActivity" }, { "title": "Microsoft.OnBeginDialog", - "description": "This defines the actions to take when a dialog is started via BeginDialog()", + "description": "Actions to perform when this dialog begins.", "$ref": "#/definitions/Microsoft.OnBeginDialog" }, + { + "title": "Microsoft.OnCancelDialog", + "description": "Actions to perform on cancel dialog event.", + "$ref": "#/definitions/Microsoft.OnCancelDialog" + }, + { + "title": "Microsoft.OnCondition", + "description": "Actions to perform when specified condition is true.", + "$ref": "#/definitions/Microsoft.OnCondition" + }, { "title": "Microsoft.OnConversationUpdateActivity", - "description": "This defines the actions to take when an ConversationUpdate activity is received", + "description": "Actions to perform on receipt of an activity with type 'ConversationUpdate'.", "$ref": "#/definitions/Microsoft.OnConversationUpdateActivity" }, + { + "title": "Microsoft.OnCustomEvent", + "description": "Actions to perform when a custom event is detected. Use 'Emit a custom event' action to raise a custom event.", + "$ref": "#/definitions/Microsoft.OnCustomEvent" + }, { "title": "Microsoft.OnDialogEvent", - "description": "Defines a rule for an event which is triggered by some source", + "description": "Actions to perform when a specific dialog event occurs.", "$ref": "#/definitions/Microsoft.OnDialogEvent" }, { "title": "Microsoft.OnEndOfConversationActivity", - "description": "This defines the actions to take when an EndOfConversation Activity is received", + "description": "Actions to perform on receipt of an activity with type 'EndOfConversation'.", "$ref": "#/definitions/Microsoft.OnEndOfConversationActivity" }, { - "title": "Microsoft.OnEvent", - "description": "Defines a rule for an event which is triggered by some source", - "$ref": "#/definitions/Microsoft.OnEvent" + "title": "Microsoft.OnError", + "description": "Action to perform when an 'Error' dialog event occurs.", + "$ref": "#/definitions/Microsoft.OnError" }, { "title": "Microsoft.OnEventActivity", - "description": "This defines the actions to take when an Event activity is received", + "description": "Actions to perform on receipt of an activity with type 'Event'.", "$ref": "#/definitions/Microsoft.OnEventActivity" }, { "title": "Microsoft.OnHandoffActivity", - "description": "This defines the actions to take when an Handoff activity is received", + "description": "Actions to perform on receipt of an activity with type 'HandOff'.", "$ref": "#/definitions/Microsoft.OnHandoffActivity" }, { "title": "Microsoft.OnIntent", - "description": "This defines the actions to take when an Intent is recognized (and optionally entities)", + "description": "Actions to perform when specified intent is recognized.", "$ref": "#/definitions/Microsoft.OnIntent" }, { "title": "Microsoft.OnInvokeActivity", - "description": "This defines the actions to take when an Invoke activity is received", + "description": "Actions to perform on receipt of an activity with type 'Invoke'.", "$ref": "#/definitions/Microsoft.OnInvokeActivity" }, { "title": "Microsoft.OnMessageActivity", - "description": "This defines the actions to take when an Message activity is received. NOTE: If this triggers it will override any Recognizer/Intent rule calculation", + "description": "Actions to perform on receipt of an activity with type 'Message'. Overrides Intent trigger.", "$ref": "#/definitions/Microsoft.OnMessageActivity" }, { "title": "Microsoft.OnMessageDeleteActivity", - "description": "This defines the actions to take when an MessageDelete activity is received", + "description": "Actions to perform on receipt of an activity with type 'MessageDelete'.", "$ref": "#/definitions/Microsoft.OnMessageDeleteActivity" }, { "title": "Microsoft.OnMessageReactionActivity", - "description": "This defines the actions to take when a MessageReaction activity is received", + "description": "Actions to perform on receipt of an activity with type 'MessageReaction'.", "$ref": "#/definitions/Microsoft.OnMessageReactionActivity" }, { "title": "Microsoft.OnMessageUpdateActivity", - "description": "This defines the actions to take when an MessageUpdate ctivity is received", + "description": "Actions to perform on receipt of an activity with type 'MessageUpdate'.", "$ref": "#/definitions/Microsoft.OnMessageUpdateActivity" }, + { + "title": "Microsoft.OnRepromptDialog", + "description": "Actions to perform when 'RepromptDialog' event occurs.", + "$ref": "#/definitions/Microsoft.OnRepromptDialog" + }, { "title": "Microsoft.OnTypingActivity", - "description": "This defines the actions to take when a Typing activity is received", + "description": "Actions to perform on receipt of an activity with type 'Typing'.", "$ref": "#/definitions/Microsoft.OnTypingActivity" }, { "title": "Microsoft.OnUnknownIntent", - "description": "This defines the actions to take when an utterence is not recognized (aka, the None Intent). NOTE: UnknownIntent will defer to any specific intent that fires in a parent dialog", + "description": "Action to perform when user input is unrecognized and if none of the 'on intent recognition' triggers match recognized intent.", "$ref": "#/definitions/Microsoft.OnUnknownIntent" } ] }, - "Microsoft.IRecognizer": { - "title": "Microsoft IRecognizer", - "description": "Union of components which implement the IRecognizer interface", + "Microsoft.ITriggerSelector": { "$role": "unionType", + "title": "Selectors", + "description": "Union of components which are trigger selectors", "oneOf": [ { - "title": "Microsoft.LuisRecognizer", - "description": "LUIS recognizer.", - "$ref": "#/definitions/Microsoft.LuisRecognizer" + "title": "Microsoft.ConditionalSelector", + "description": "Use a rule selector based on a condition", + "$ref": "#/definitions/Microsoft.ConditionalSelector" }, { - "title": "Microsoft.MultiLanguageRecognizer", - "description": "Recognizer which allows you to configure the recognizer per language, and to define the policy for using them", - "$ref": "#/definitions/Microsoft.MultiLanguageRecognizer" + "title": "Microsoft.FirstSelector", + "description": "Selector for first true rule", + "$ref": "#/definitions/Microsoft.FirstSelector" }, { - "title": "Microsoft.RegexRecognizer", - "description": "Recognizer which uses regex expressions to generate intents and entities.", - "$ref": "#/definitions/Microsoft.RegexRecognizer" + "title": "Microsoft.MostSpecificSelector", + "description": "Select most specific true events with optional additional selector", + "$ref": "#/definitions/Microsoft.MostSpecificSelector" }, { - "type": "string", - "title": "string" - } - ] - }, - "Microsoft.ITextTemplate": { - "title": "Microsoft TextTemplate", - "description": "Union of components which implement the ITextTemplate interface", - "$role": "unionType", - "oneOf": [ + "title": "Microsoft.RandomSelector", + "description": "Select most specific true rule", + "$ref": "#/definitions/Microsoft.RandomSelector" + }, { - "type": "string", - "title": "string" + "title": "Microsoft.TrueSelector", + "description": "Selector for all true events", + "$ref": "#/definitions/Microsoft.TrueSelector" } ] }, "Microsoft.IfCondition": { "$role": "unionType(Microsoft.IDialog)", - "title": "If Condition Action", - "description": "Action which conditionally decides which action to execute next.", + "title": "If condition", + "description": "Two-way branch the conversation flow based on a condition.", "type": "object", "properties": { "$type": { @@ -3597,27 +3322,7 @@ "$designer": { "title": "$designer", "type": "object", - "description": "Extra information for the Bot Framework Composer." - }, - "id": { - "type": "string", - "title": "Id", - "description": "(Optional) id for the dialog", - "examples": [ - "Dialog2" - ] - }, - "tags": { - "type": "array", - "title": "Tags", - "description": "Tags are optional strings that you can use to organize components", - "examples": [ - "input", - "confirmation" - ], - "items": { - "type": "string" - } + "description": "Extra information for the Bot Framework Designer." }, "condition": { "$role": "expression", @@ -3631,7 +3336,7 @@ "actions": { "type": "array", "title": "Actions", - "description": "Action to execute if condition is true.", + "description": "Actions to execute if condition is true.", "items": { "$type": "Microsoft.IDialog", "$ref": "#/definitions/Microsoft.IDialog" @@ -3639,8 +3344,8 @@ }, "elseActions": { "type": "array", - "title": "Else Actions", - "description": "Action to execute if condition is false.", + "title": "Else", + "description": "Actions to execute if condition is false.", "items": { "$type": "Microsoft.IDialog", "$ref": "#/definitions/Microsoft.IDialog" @@ -3672,8 +3377,8 @@ }, "Microsoft.InitProperty": { "$role": "unionType(Microsoft.IDialog)", - "title": "Init Property Action", - "description": "This action allows you to innitial a property to either an object or array", + "title": "Initialize property", + "description": "Define and initialize a property to be an array or object.", "type": "object", "properties": { "$type": { @@ -3698,32 +3403,12 @@ "$designer": { "title": "$designer", "type": "object", - "description": "Extra information for the Bot Framework Composer." - }, - "id": { - "type": "string", - "title": "Id", - "description": "(Optional) id for the dialog", - "examples": [ - "Dialog2" - ] - }, - "tags": { - "type": "array", - "title": "Tags", - "description": "Tags are optional strings that you can use to organize components", - "examples": [ - "input", - "confirmation" - ], - "items": { - "type": "string" - } + "description": "Extra information for the Bot Framework Designer." }, "property": { "$role": "expression", "title": "Property", - "description": "The property to set the value of", + "description": "Property (named location to store information).", "examples": [ "user.age" ], @@ -3731,8 +3416,8 @@ }, "type": { "type": "string", - "title": "type", - "description": "type of value to set the property to, object or array.", + "title": "Type", + "description": "Type of value.", "enum": [ "object", "array" @@ -3763,7 +3448,7 @@ ] }, "Microsoft.IpEntityRecognizer": { - "$role": "unionType(Microsoft.EntityRecognizer)", + "$role": "unionType(Microsoft.EntityRecognizers)", "title": "Ip Entity Recognizer", "description": "Recognizer which recognizes internet IP patterns (like 192.1.1.1).", "type": "object", @@ -3790,7 +3475,7 @@ "$designer": { "title": "$designer", "type": "object", - "description": "Extra information for the Bot Framework Composer." + "description": "Extra information for the Bot Framework Designer." } }, "additionalProperties": false, @@ -3815,9 +3500,8 @@ ] }, "Microsoft.LanguagePolicy": { - "$role": "unionType(Microsoft.ILanguagePolicy)", "title": "Language Policy", - "description": "This represents a dialog which gathers a DateTime in a specified range", + "description": "This represents a policy map for locales lookups to use for language", "type": "object", "additionalProperties": false, "properties": { @@ -3843,7 +3527,7 @@ "$designer": { "title": "$designer", "type": "object", - "description": "Extra information for the Bot Framework Composer." + "description": "Extra information for the Bot Framework Designer." } }, "patternProperties": { @@ -3868,8 +3552,8 @@ }, "Microsoft.LogAction": { "$role": "unionType(Microsoft.IDialog)", - "title": "Log Action", - "description": "This is a action which writes to console.log and optional creates a TraceActivity around a text binding", + "title": "Log to console", + "description": "Log a message to the host application. Send a TraceActivity to Bot Framework Emulator (optional).", "type": "object", "properties": { "$type": { @@ -3894,37 +3578,17 @@ "$designer": { "title": "$designer", "type": "object", - "description": "Extra information for the Bot Framework Composer." - }, - "id": { - "type": "string", - "title": "Id", - "description": "(Optional) id for the dialog", - "examples": [ - "Dialog2" - ] - }, - "tags": { - "type": "array", - "title": "Tags", - "description": "Tags are optional strings that you can use to organize components", - "examples": [ - "input", - "confirmation" - ], - "items": { - "type": "string" - } + "description": "Extra information for the Bot Framework Designer." }, "text": { "type": "string", "title": "Text", - "description": "LG Expression to write to the log" + "description": "Information to log." }, "traceActivity": { "type": "boolean", "title": "Send Trace Activity", - "description": "Set to true to also create a TraceActivity with the log text", + "description": "If true, automatically sends a TraceActivity (view in Bot Framework Emulator).", "default": false } }, @@ -3979,7 +3643,7 @@ "$designer": { "title": "$designer", "type": "object", - "description": "Extra information for the Bot Framework Composer." + "description": "Extra information for the Bot Framework Designer." }, "applicationId": { "type": "string" @@ -4015,7 +3679,7 @@ ] }, "Microsoft.MentionEntityRecognizer": { - "$role": "unionType(Microsoft.EntityRecognizer)", + "$role": "unionType(Microsoft.EntityRecognizers)", "title": "Mentions Entity Recognizer", "description": "Recognizer which recognizes @Mentions", "type": "object", @@ -4042,7 +3706,7 @@ "$designer": { "title": "$designer", "type": "object", - "description": "Extra information for the Bot Framework Composer." + "description": "Extra information for the Bot Framework Designer." } }, "additionalProperties": false, @@ -4067,8 +3731,8 @@ ] }, "Microsoft.MostSpecificSelector": { - "$role": "unionType(Microsoft.IEventSelector)", - "title": "Most Specific Event Selector", + "$role": "unionType(Microsoft.ITriggerSelector)", + "title": "Most Specific Trigger Selector", "description": "Select most specific true events with optional additional selector", "type": "object", "properties": { @@ -4094,11 +3758,11 @@ "$designer": { "title": "$designer", "type": "object", - "description": "Extra information for the Bot Framework Composer." + "description": "Extra information for the Bot Framework Designer." }, "selector": { - "$type": "Microsoft.IEventSelector", - "$ref": "#/definitions/Microsoft.IEventSelector" + "$type": "Microsoft.ITriggerSelector", + "$ref": "#/definitions/Microsoft.ITriggerSelector" } }, "additionalProperties": false, @@ -4124,8 +3788,8 @@ }, "Microsoft.MultiLanguageRecognizer": { "$role": "unionType(Microsoft.IRecognizer)", - "title": "Multi Language Recognizer", - "description": "Recognizer which allows you to configure the recognizer per language, and to define the policy for using them", + "title": "Multi-language recognizer", + "description": "Configure one recognizer per language and the specify the language fallback policy.", "type": "object", "properties": { "$type": { @@ -4150,14 +3814,14 @@ "$designer": { "title": "$designer", "type": "object", - "description": "Extra information for the Bot Framework Composer." + "description": "Extra information for the Bot Framework Designer." }, "languagePolicy": { - "$type": "Microsoft.ILanguagePolicy", + "$type": "Microsoft.LanguagePolicy", "type": "object", - "title": "Language Policy", - "description": "Defines languages to try per language.", - "$ref": "#/definitions/Microsoft.ILanguagePolicy" + "title": "Language policy", + "description": "Defines fall back languages to try per user input language.", + "$ref": "#/definitions/Microsoft.LanguagePolicy" }, "recognizers": { "type": "object", @@ -4192,7 +3856,7 @@ ] }, "Microsoft.NumberEntityRecognizer": { - "$role": "unionType(Microsoft.EntityRecognizer)", + "$role": "unionType(Microsoft.EntityRecognizers)", "title": "Number Entity Recognizer", "description": "Recognizer which recognizes numbers.", "type": "object", @@ -4219,7 +3883,7 @@ "$designer": { "title": "$designer", "type": "object", - "description": "Extra information for the Bot Framework Composer." + "description": "Extra information for the Bot Framework Designer." } }, "additionalProperties": false, @@ -4245,8 +3909,8 @@ }, "Microsoft.NumberInput": { "$role": "unionType(Microsoft.IDialog)", - "title": "NumberInput Dialog", - "description": "This represents a dialog which gathers a decimal number in a specified range", + "title": "Number input dialog", + "description": "Collect information - Ask for a number.", "type": "object", "properties": { "$type": { @@ -4271,32 +3935,17 @@ "$designer": { "title": "$designer", "type": "object", - "description": "Extra information for the Bot Framework Composer." + "description": "Extra information for the Bot Framework Designer." }, "id": { "type": "string", "title": "Id", - "description": "(Optional) id for the dialog", - "examples": [ - "Dialog2" - ] - }, - "tags": { - "type": "array", - "title": "Tags", - "description": "Tags are optional strings that you can use to organize components", - "examples": [ - "input", - "confirmation" - ], - "items": { - "type": "string" - } + "description": "Optional id for the dialog" }, "prompt": { "$type": "Microsoft.IActivityTemplate", - "title": "Initial Prompt", - "description": "The message to send to as prompt for this input.", + "title": "Initial prompt", + "description": "Message to send to collect information.", "examples": [ "What is your birth date?" ], @@ -4304,75 +3953,80 @@ }, "unrecognizedPrompt": { "$type": "Microsoft.IActivityTemplate", - "title": "Unrecognized Prompt", - "description": "The message to send if the last input is not recognized.", + "title": "Unrecognized prompt", + "description": "Message to send if user response is not recognized.", "examples": [ - "Let's try again. What is your birth date?" + "Sorry, I do not understand '{turn.activity.text'}. Let's try again. What is your birth date?" ], "$ref": "#/definitions/Microsoft.IActivityTemplate" }, "invalidPrompt": { "$type": "Microsoft.IActivityTemplate", - "title": "Invalid Prompt", - "description": "The message to send to when then input was not valid for the input type.", + "title": "Invalid prompt", + "description": "Message to send if user response is invalid. Relies on specified validation expressions.", "examples": [ - "No date was recognized" + "Sorry, '{this.value}' does not work. I need a number between 1-150. What is your age?" ], "$ref": "#/definitions/Microsoft.IActivityTemplate" }, "defaultValueResponse": { "$type": "Microsoft.IActivityTemplate", - "title": "Default Value Response", - "description": "The message to send to when max turn count has been exceeded and the default value is selected as the value.", + "title": "Default value response", + "description": "Message to send when max turn count (if specified) has been exceeded and the default value is selected as the value.", "examples": [ - "I didn't understand your responses, so I will just use the default value of 10. Let me know if you want to change it." + "Sorry, I'm having trouble understanding you. I will just use {this.options.defaultValue} for now. You can say 'I'm 36 years old' to change it." ], "$ref": "#/definitions/Microsoft.IActivityTemplate" }, "maxTurnCount": { "type": "integer", - "title": "Max Turn Count", - "description": "The max retry count for this prompt.", - "default": 2147483647, + "title": "Max turn count", + "description": "Maximum number of re-prompt attempts to collect information.", + "default": 3, "examples": [ 3 ] }, "validations": { "type": "array", - "title": "Validation Expressions", - "description": "Expressions to validate an input.", + "title": "Validation expressions", + "description": "Expression to validate user input.", + "examples": [ + "int(this.value) > 1 && int(this.value) <= 150", + "count(this.value) < 300" + ], "items": { "$role": "expression", "type": "string", "description": "String must contain an expression." } }, - "value": { - "$role": "expression", - "title": "Value", - "description": "The expression that you evaluated for input.", - "type": "string" - }, "property": { "$role": "expression", "title": "Property", - "description": "Property that this input dialog is bound to", + "description": "Property to store collected information. Input will be skipped if property has value (unless 'Always prompt' is true).", "examples": [ - "$birthday" + "$birthday", + "user.name", + "conversation.issueTitle", + "dialog.favColor" ], "type": "string" }, "defaultValue": { "$role": "expression", - "title": "Default Value", - "description": "Value to return if the value expression can't be evaluated.", + "title": "Default value", + "description": "Expression to examine on each turn of the conversation as possible value to the property.", + "examples": [ + "@userName", + "coalesce(@number, @partySize)" + ], "type": "string" }, "alwaysPrompt": { "type": "boolean", - "title": "Always Prompt", - "description": "If set to true this will always prompt the user regardless if you already have the value or not.", + "title": "Always prompt", + "description": "Collect information even if the specified 'property' is not empty.", "default": false, "examples": [ false @@ -4380,16 +4034,11 @@ }, "allowInterruptions": { "type": "string", - "enum": [ - "always", - "never", - "notRecognized" - ], "title": "Allow Interruptions", - "description": "Always will always consult parent dialogs first, never will not consult parent dialogs, notRecognized will consult parent only when it's not recognized", - "default": "notRecognized", + "description": "A boolean expression that determines whether the parent should be allowed to interrupt the input.", + "default": "true", "examples": [ - "notRecognized" + "true" ] }, "outputFormat": { @@ -4398,14 +4047,14 @@ "float", "integer" ], - "title": "Output Format", - "description": "The NumberInput output format.", + "title": "Output format", + "description": "Number output format.", "default": "float" }, "defaultLocale": { "type": "string", - "title": "Default Locale", - "description": "The prompts default locale that should be recognized.", + "title": "Default locale", + "description": "Default locale.", "default": "en-us" } }, @@ -4431,7 +4080,7 @@ ] }, "Microsoft.NumberRangeEntityRecognizer": { - "$role": "unionType(Microsoft.EntityRecognizer)", + "$role": "unionType(Microsoft.EntityRecognizers)", "title": "NumberRange Entity Recognizer", "description": "Recognizer which recognizes ranges of numbers (Example:2 to 5).", "type": "object", @@ -4458,7 +4107,7 @@ "$designer": { "title": "$designer", "type": "object", - "description": "Extra information for the Bot Framework Composer." + "description": "Extra information for the Bot Framework Designer." } }, "additionalProperties": false, @@ -4485,7 +4134,7 @@ "Microsoft.OAuthInput": { "$role": "unionType(Microsoft.IDialog)", "title": "OAuthInput Dialog", - "description": "This represents a dialog which gathers an OAuth token from user", + "description": "Collect login information.", "type": "object", "properties": { "$type": { @@ -4510,147 +4159,46 @@ "$designer": { "title": "$designer", "type": "object", - "description": "Extra information for the Bot Framework Composer." - }, - "id": { - "type": "string", - "title": "Id", - "description": "(Optional) id for the dialog", - "examples": [ - "Dialog2" - ] - }, - "tags": { - "type": "array", - "title": "Tags", - "description": "Tags are optional strings that you can use to organize components", - "examples": [ - "input", - "confirmation" - ], - "items": { - "type": "string" - } - }, - "prompt": { - "$type": "Microsoft.IActivityTemplate", - "title": "Initial Prompt", - "description": "The message to send to as prompt for this input.", - "examples": [ - "What is your birth date?" - ], - "$ref": "#/definitions/Microsoft.IActivityTemplate" - }, - "unrecognizedPrompt": { - "$type": "Microsoft.IActivityTemplate", - "title": "Unrecognized Prompt", - "description": "The message to send if the last input is not recognized.", - "examples": [ - "Let's try again. What is your birth date?" - ], - "$ref": "#/definitions/Microsoft.IActivityTemplate" - }, - "invalidPrompt": { - "$type": "Microsoft.IActivityTemplate", - "title": "Invalid Prompt", - "description": "The message to send to when then input was not valid for the input type.", - "examples": [ - "No date was recognized" - ], - "$ref": "#/definitions/Microsoft.IActivityTemplate" - }, - "defaultValueResponse": { - "$type": "Microsoft.IActivityTemplate", - "title": "Default Value Response", - "description": "The message to send to when max turn count has been exceeded and the default value is selected as the value.", - "examples": [ - "I didn't understand your responses, so I will just use the default value of 10. Let me know if you want to change it." - ], - "$ref": "#/definitions/Microsoft.IActivityTemplate" - }, - "maxTurnCount": { - "type": "integer", - "title": "Max Turn Count", - "description": "The max retry count for this prompt.", - "default": 2147483647, - "examples": [ - 3 - ] - }, - "validations": { - "type": "array", - "title": "Validation Expressions", - "description": "Expressions to validate an input.", - "items": { - "$role": "expression", - "type": "string", - "description": "String must contain an expression." - } - }, - "value": { - "$role": "expression", - "title": "Value", - "description": "The expression that you evaluated for input.", - "type": "string" - }, - "property": { - "$role": "expression", - "title": "Property", - "description": "Property that this input dialog is bound to", - "examples": [ - "$birthday" - ], - "type": "string" - }, - "defaultValue": { - "$role": "expression", - "title": "Default Value", - "description": "Value to return if the value expression can't be evaluated.", - "type": "string" - }, - "alwaysPrompt": { - "type": "boolean", - "title": "Always Prompt", - "description": "If set to true this will always prompt the user regardless if you already have the value or not.", - "default": false, - "examples": [ - false - ] + "description": "Extra information for the Bot Framework Designer." }, - "allowInterruptions": { + "connectionName": { "type": "string", - "enum": [ - "always", - "never", - "notRecognized" - ], - "title": "Allow Interruptions", - "description": "Always will always consult parent dialogs first, never will not consult parent dialogs, notRecognized will consult parent only when it's not recognized", - "default": "notRecognized", + "title": "Connection name", + "description": "The connection name configured in Azure Web App Bot OAuth settings.", "examples": [ - "notRecognized" + "msgraphOAuthConnection" ] }, - "connectionName": { - "type": "string", - "title": "Connection Name", - "description": "The connection name configured in Azure Web App Bot OAuth settings." - }, "text": { "type": "string", "title": "Text", - "description": "Text shown in the OAuth signin card." + "description": "Text shown in the OAuth signin card.", + "examples": [ + "Please sign in. " + ] }, "title": { "type": "string", "title": "Title", - "description": "Title shown in the OAuth signin card." + "description": "Title shown in the OAuth signin card.", + "examples": [ + "Login" + ] }, "timeout": { "type": "integer", "title": "Timeout", "description": "Time out setting for the OAuth signin card.", "default": "900000" + }, + "tokenProperty": { + "$role": "expression", + "title": "Token property", + "description": "Property to store the OAuth token result.", + "examples": [ + "dialog.token" + ], + "type": "string" } }, "additionalProperties": false, @@ -4669,15 +4217,16 @@ { "title": "Type", "required": [ + "connectionName", "$type" ] } ] }, "Microsoft.OnActivity": { - "$role": "unionType(Microsoft.IOnEvent)", - "title": "OnActivity", - "description": "This defines the actions to take when an custom activity is received", + "$role": "unionType(Microsoft.ITriggerCondition)", + "title": "On activity", + "description": "Actions to perform on receipt of a generic activity.", "type": "object", "properties": { "$type": { @@ -4702,12 +4251,12 @@ "$designer": { "title": "$designer", "type": "object", - "description": "Extra information for the Bot Framework Composer." + "description": "Extra information for the Bot Framework Designer." }, - "constraint": { + "condition": { "$role": "expression", - "title": "Constraint", - "description": "Optional constraint to which must be met for this rule to fire", + "title": "Condition", + "description": "Condition (expression).", "examples": [ "user.vip == true" ], @@ -4715,7 +4264,7 @@ }, "actions": { "type": "array", - "description": "Sequence of actions or dialogs to execute", + "description": "Sequence of actions to execute.", "items": { "$type": "Microsoft.IDialog", "$ref": "#/definitions/Microsoft.IDialog" @@ -4723,8 +4272,8 @@ }, "type": { "type": "string", - "title": "Type", - "description": "Activity type" + "title": "Activity type", + "description": "The Activity.Type to match" } }, "additionalProperties": false, @@ -4751,9 +4300,9 @@ ] }, "Microsoft.OnBeginDialog": { - "title": "OnBeginDialog", - "description": "This defines the actions to take when a dialog is started via BeginDialog()", - "$role": "unionType(Microsoft.IOnEvent)", + "$role": "unionType(Microsoft.ITriggerCondition)", + "title": "On begin dialog", + "description": "Actions to perform when this dialog begins.", "type": "object", "properties": { "$type": { @@ -4778,12 +4327,12 @@ "$designer": { "title": "$designer", "type": "object", - "description": "Extra information for the Bot Framework Composer." + "description": "Extra information for the Bot Framework Designer." }, - "constraint": { + "condition": { "$role": "expression", - "title": "Constraint", - "description": "Optional constraint to which must be met for this rule to fire", + "title": "Condition", + "description": "Condition (expression).", "examples": [ "user.vip == true" ], @@ -4791,7 +4340,7 @@ }, "actions": { "type": "array", - "description": "Sequence of actions or dialogs to execute", + "description": "Sequence of actions to execute.", "items": { "$type": "Microsoft.IDialog", "$ref": "#/definitions/Microsoft.IDialog" @@ -4820,10 +4369,10 @@ } ] }, - "Microsoft.OnConversationUpdateActivity": { - "$role": "unionType(Microsoft.IOnEvent)", - "title": "OnConversationUpdateActivity", - "description": "This defines the actions to take when an ConversationUpdate activity is received", + "Microsoft.OnCancelDialog": { + "$role": "unionType(Microsoft.ITriggerCondition)", + "title": "On cancel dialog", + "description": "Actions to perform on cancel dialog event.", "type": "object", "properties": { "$type": { @@ -4831,7 +4380,7 @@ "description": "Defines the valid properties for the component you are configuring (from a dialog .schema file)", "type": "string", "pattern": "^[a-zA-Z][a-zA-Z0-9.]*$", - "const": "Microsoft.OnConversationUpdateActivity" + "const": "Microsoft.OnCancelDialog" }, "$copy": { "title": "$copy", @@ -4848,12 +4397,12 @@ "$designer": { "title": "$designer", "type": "object", - "description": "Extra information for the Bot Framework Composer." + "description": "Extra information for the Bot Framework Designer." }, - "constraint": { + "condition": { "$role": "expression", - "title": "Constraint", - "description": "Optional constraint to which must be met for this rule to fire", + "title": "Condition", + "description": "Condition (expression).", "examples": [ "user.vip == true" ], @@ -4861,7 +4410,7 @@ }, "actions": { "type": "array", - "description": "Sequence of actions or dialogs to execute", + "description": "Sequence of actions to execute.", "items": { "$type": "Microsoft.IDialog", "$ref": "#/definitions/Microsoft.IDialog" @@ -4890,18 +4439,18 @@ } ] }, - "Microsoft.OnDialogEvent": { - "title": "Event Event", - "description": "Defines a rule for an event which is triggered by some source", + "Microsoft.OnCondition": { + "$role": "unionType(Microsoft.ITriggerCondition)", + "title": "On condition", + "description": "Actions to perform when specified condition is true.", "type": "object", - "$role": "unionType(Microsoft.IOnEvent)", "properties": { "$type": { "title": "$type", "description": "Defines the valid properties for the component you are configuring (from a dialog .schema file)", "type": "string", "pattern": "^[a-zA-Z][a-zA-Z0-9.]*$", - "const": "Microsoft.OnDialogEvent" + "const": "Microsoft.OnCondition" }, "$copy": { "title": "$copy", @@ -4918,12 +4467,12 @@ "$designer": { "title": "$designer", "type": "object", - "description": "Extra information for the Bot Framework Composer." + "description": "Extra information for the Bot Framework Designer." }, - "constraint": { + "condition": { "$role": "expression", - "title": "Constraint", - "description": "Optional constraint to which must be met for this rule to fire", + "title": "Condition", + "description": "Condition (expression).", "examples": [ "user.vip == true" ], @@ -4931,30 +4480,11 @@ }, "actions": { "type": "array", - "description": "Sequence of actions or dialogs to execute", + "description": "Sequence of actions to execute.", "items": { "$type": "Microsoft.IDialog", "$ref": "#/definitions/Microsoft.IDialog" } - }, - "events": { - "type": "array", - "description": "Events to trigger this rule for", - "items": { - "type": "string", - "enum": [ - "beginDialog", - "consultDialog", - "cancelDialog", - "activityReceived", - "recognizedIntent", - "unknownIntent", - "actionsStarted", - "actionsSaved", - "actionsEnded", - "actionsResumed" - ] - } } }, "additionalProperties": false, @@ -4974,16 +4504,15 @@ "title": "Type", "required": [ "actions", - "events", "$type" ] } ] }, - "Microsoft.OnEndOfConversationActivity": { - "$role": "unionType(Microsoft.IOnEvent)", - "title": "OnEndOfConversationActivity", - "description": "This defines the actions to take when an EndOfConversation Activity is received", + "Microsoft.OnConversationUpdateActivity": { + "$role": "unionType(Microsoft.ITriggerCondition)", + "title": "On ConversationUpdate activity", + "description": "Actions to perform on receipt of an activity with type 'ConversationUpdate'.", "type": "object", "properties": { "$type": { @@ -4991,7 +4520,7 @@ "description": "Defines the valid properties for the component you are configuring (from a dialog .schema file)", "type": "string", "pattern": "^[a-zA-Z][a-zA-Z0-9.]*$", - "const": "Microsoft.OnEndOfConversationActivity" + "const": "Microsoft.OnConversationUpdateActivity" }, "$copy": { "title": "$copy", @@ -5008,12 +4537,12 @@ "$designer": { "title": "$designer", "type": "object", - "description": "Extra information for the Bot Framework Composer." + "description": "Extra information for the Bot Framework Designer." }, - "constraint": { + "condition": { "$role": "expression", - "title": "Constraint", - "description": "Optional constraint to which must be met for this rule to fire", + "title": "Condition", + "description": "Condition (expression).", "examples": [ "user.vip == true" ], @@ -5021,7 +4550,7 @@ }, "actions": { "type": "array", - "description": "Sequence of actions or dialogs to execute", + "description": "Sequence of actions to execute.", "items": { "$type": "Microsoft.IDialog", "$ref": "#/definitions/Microsoft.IDialog" @@ -5050,10 +4579,10 @@ } ] }, - "Microsoft.OnEvent": { - "$role": "unionType(Microsoft.IOnEvent)", - "title": "Event Event", - "description": "Defines a rule for an event which is triggered by some source", + "Microsoft.OnCustomEvent": { + "$role": "unionType(Microsoft.ITriggerCondition)", + "title": "On custom event", + "description": "Actions to perform when a custom event is detected. Use 'Emit a custom event' action to raise a custom event.", "type": "object", "properties": { "$type": { @@ -5061,7 +4590,7 @@ "description": "Defines the valid properties for the component you are configuring (from a dialog .schema file)", "type": "string", "pattern": "^[a-zA-Z][a-zA-Z0-9.]*$", - "const": "Microsoft.OnEvent" + "const": "Microsoft.OnCustomEvent" }, "$copy": { "title": "$copy", @@ -5078,12 +4607,12 @@ "$designer": { "title": "$designer", "type": "object", - "description": "Extra information for the Bot Framework Composer." + "description": "Extra information for the Bot Framework Designer." }, - "constraint": { + "condition": { "$role": "expression", - "title": "Constraint", - "description": "Optional constraint to which must be met for this rule to fire", + "title": "Condition", + "description": "Condition (expression).", "examples": [ "user.vip == true" ], @@ -5091,11 +4620,16 @@ }, "actions": { "type": "array", - "description": "Sequence of actions or dialogs to execute", + "description": "Sequence of actions to execute.", "items": { "$type": "Microsoft.IDialog", "$ref": "#/definitions/Microsoft.IDialog" } + }, + "event": { + "type": "string", + "title": "Custom event name", + "description": "Name of the custom event." } }, "additionalProperties": false, @@ -5115,15 +4649,16 @@ "title": "Type", "required": [ "actions", + "event", "$type" ] } ] }, - "Microsoft.OnEventActivity": { - "$role": "unionType(Microsoft.IOnEvent)", - "title": "OnEventActivity", - "description": "This defines the actions to take when an Event activity is received", + "Microsoft.OnDialogEvent": { + "$role": "unionType(Microsoft.ITriggerCondition)", + "title": "On dialog event", + "description": "Actions to perform when a specific dialog event occurs.", "type": "object", "properties": { "$type": { @@ -5131,7 +4666,7 @@ "description": "Defines the valid properties for the component you are configuring (from a dialog .schema file)", "type": "string", "pattern": "^[a-zA-Z][a-zA-Z0-9.]*$", - "const": "Microsoft.OnEventActivity" + "const": "Microsoft.OnDialogEvent" }, "$copy": { "title": "$copy", @@ -5148,12 +4683,12 @@ "$designer": { "title": "$designer", "type": "object", - "description": "Extra information for the Bot Framework Composer." + "description": "Extra information for the Bot Framework Designer." }, - "constraint": { + "condition": { "$role": "expression", - "title": "Constraint", - "description": "Optional constraint to which must be met for this rule to fire", + "title": "Condition", + "description": "Condition (expression).", "examples": [ "user.vip == true" ], @@ -5161,11 +4696,16 @@ }, "actions": { "type": "array", - "description": "Sequence of actions or dialogs to execute", + "description": "Sequence of actions to execute.", "items": { "$type": "Microsoft.IDialog", "$ref": "#/definitions/Microsoft.IDialog" } + }, + "event": { + "type": "string", + "title": "Dialog event name", + "description": "Name of dialog event." } }, "additionalProperties": false, @@ -5185,15 +4725,16 @@ "title": "Type", "required": [ "actions", + "event", "$type" ] } ] }, - "Microsoft.OnHandoffActivity": { - "$role": "unionType(Microsoft.IOnEvent)", - "title": "OnHandoffActivity", - "description": "This defines the actions to take when an Handoff activity is received", + "Microsoft.OnEndOfConversationActivity": { + "$role": "unionType(Microsoft.ITriggerCondition)", + "title": "On EndOfConversation activity", + "description": "Actions to perform on receipt of an activity with type 'EndOfConversation'.", "type": "object", "properties": { "$type": { @@ -5201,7 +4742,7 @@ "description": "Defines the valid properties for the component you are configuring (from a dialog .schema file)", "type": "string", "pattern": "^[a-zA-Z][a-zA-Z0-9.]*$", - "const": "Microsoft.OnHandoffActivity" + "const": "Microsoft.OnEndOfConversationActivity" }, "$copy": { "title": "$copy", @@ -5218,12 +4759,12 @@ "$designer": { "title": "$designer", "type": "object", - "description": "Extra information for the Bot Framework Composer." + "description": "Extra information for the Bot Framework Designer." }, - "constraint": { + "condition": { "$role": "expression", - "title": "Constraint", - "description": "Optional constraint to which must be met for this rule to fire", + "title": "Condition", + "description": "Condition (expression).", "examples": [ "user.vip == true" ], @@ -5231,7 +4772,7 @@ }, "actions": { "type": "array", - "description": "Sequence of actions or dialogs to execute", + "description": "Sequence of actions to execute.", "items": { "$type": "Microsoft.IDialog", "$ref": "#/definitions/Microsoft.IDialog" @@ -5260,10 +4801,10 @@ } ] }, - "Microsoft.OnIntent": { - "$role": "unionType(Microsoft.IOnEvent)", - "title": "Intent Event", - "description": "This defines the actions to take when an Intent is recognized (and optionally entities)", + "Microsoft.OnError": { + "$role": "unionType(Microsoft.ITriggerCondition)", + "title": "On Error", + "description": "Action to perform when an 'Error' dialog event occurs.", "type": "object", "properties": { "$type": { @@ -5271,7 +4812,7 @@ "description": "Defines the valid properties for the component you are configuring (from a dialog .schema file)", "type": "string", "pattern": "^[a-zA-Z][a-zA-Z0-9.]*$", - "const": "Microsoft.OnIntent" + "const": "Microsoft.OnError" }, "$copy": { "title": "$copy", @@ -5288,12 +4829,12 @@ "$designer": { "title": "$designer", "type": "object", - "description": "Extra information for the Bot Framework Composer." + "description": "Extra information for the Bot Framework Designer." }, - "constraint": { + "condition": { "$role": "expression", - "title": "Constraint", - "description": "Optional constraint to which must be met for this rule to fire", + "title": "Condition", + "description": "Condition (expression).", "examples": [ "user.vip == true" ], @@ -5301,24 +4842,11 @@ }, "actions": { "type": "array", - "description": "Sequence of actions or dialogs to execute", + "description": "Sequence of actions to execute.", "items": { "$type": "Microsoft.IDialog", "$ref": "#/definitions/Microsoft.IDialog" } - }, - "intent": { - "type": "string", - "title": "Intent", - "description": "Intent name to trigger on" - }, - "entities": { - "type": "array", - "title": "Entities", - "description": "The entities required to trigger this rule", - "items": { - "type": "string" - } } }, "additionalProperties": false, @@ -5338,16 +4866,15 @@ "title": "Type", "required": [ "actions", - "intent", "$type" ] } ] }, - "Microsoft.OnInvokeActivity": { - "$role": "unionType(Microsoft.IOnEvent)", - "title": "OnInvokeActivity", - "description": "This defines the actions to take when an Invoke activity is received", + "Microsoft.OnEventActivity": { + "$role": "unionType(Microsoft.ITriggerCondition)", + "title": "On Event activity", + "description": "Actions to perform on receipt of an activity with type 'Event'.", "type": "object", "properties": { "$type": { @@ -5355,7 +4882,7 @@ "description": "Defines the valid properties for the component you are configuring (from a dialog .schema file)", "type": "string", "pattern": "^[a-zA-Z][a-zA-Z0-9.]*$", - "const": "Microsoft.OnInvokeActivity" + "const": "Microsoft.OnEventActivity" }, "$copy": { "title": "$copy", @@ -5372,12 +4899,12 @@ "$designer": { "title": "$designer", "type": "object", - "description": "Extra information for the Bot Framework Composer." + "description": "Extra information for the Bot Framework Designer." }, - "constraint": { + "condition": { "$role": "expression", - "title": "Constraint", - "description": "Optional constraint to which must be met for this rule to fire", + "title": "Condition", + "description": "Condition (expression).", "examples": [ "user.vip == true" ], @@ -5385,7 +4912,7 @@ }, "actions": { "type": "array", - "description": "Sequence of actions or dialogs to execute", + "description": "Sequence of actions to execute.", "items": { "$type": "Microsoft.IDialog", "$ref": "#/definitions/Microsoft.IDialog" @@ -5414,10 +4941,10 @@ } ] }, - "Microsoft.OnMessageActivity": { - "$role": "unionType(Microsoft.IOnEvent)", - "title": "OnMessageActivity", - "description": "This defines the actions to take when an Message activity is received. NOTE: If this triggers it will override any Recognizer/Intent rule calculation", + "Microsoft.OnHandoffActivity": { + "$role": "unionType(Microsoft.ITriggerCondition)", + "title": "On Handoff activity", + "description": "Actions to perform on receipt of an activity with type 'HandOff'.", "type": "object", "properties": { "$type": { @@ -5425,7 +4952,7 @@ "description": "Defines the valid properties for the component you are configuring (from a dialog .schema file)", "type": "string", "pattern": "^[a-zA-Z][a-zA-Z0-9.]*$", - "const": "Microsoft.OnMessageActivity" + "const": "Microsoft.OnHandoffActivity" }, "$copy": { "title": "$copy", @@ -5442,12 +4969,12 @@ "$designer": { "title": "$designer", "type": "object", - "description": "Extra information for the Bot Framework Composer." + "description": "Extra information for the Bot Framework Designer." }, - "constraint": { + "condition": { "$role": "expression", - "title": "Constraint", - "description": "Optional constraint to which must be met for this rule to fire", + "title": "Condition", + "description": "Condition (expression).", "examples": [ "user.vip == true" ], @@ -5455,7 +4982,7 @@ }, "actions": { "type": "array", - "description": "Sequence of actions or dialogs to execute", + "description": "Sequence of actions to execute.", "items": { "$type": "Microsoft.IDialog", "$ref": "#/definitions/Microsoft.IDialog" @@ -5484,10 +5011,10 @@ } ] }, - "Microsoft.OnMessageDeleteActivity": { - "$role": "unionType(Microsoft.IOnEvent)", - "title": "MessageDeleteActivity", - "description": "This defines the actions to take when an MessageDelete activity is received", + "Microsoft.OnIntent": { + "$role": "unionType(Microsoft.ITriggerCondition)", + "title": "On intent recognition", + "description": "Actions to perform when specified intent is recognized.", "type": "object", "properties": { "$type": { @@ -5495,7 +5022,7 @@ "description": "Defines the valid properties for the component you are configuring (from a dialog .schema file)", "type": "string", "pattern": "^[a-zA-Z][a-zA-Z0-9.]*$", - "const": "Microsoft.OnMessageDeleteActivity" + "const": "Microsoft.OnIntent" }, "$copy": { "title": "$copy", @@ -5512,12 +5039,12 @@ "$designer": { "title": "$designer", "type": "object", - "description": "Extra information for the Bot Framework Composer." + "description": "Extra information for the Bot Framework Designer." }, - "constraint": { + "condition": { "$role": "expression", - "title": "Constraint", - "description": "Optional constraint to which must be met for this rule to fire", + "title": "Condition", + "description": "Condition (expression).", "examples": [ "user.vip == true" ], @@ -5525,11 +5052,24 @@ }, "actions": { "type": "array", - "description": "Sequence of actions or dialogs to execute", + "description": "Sequence of actions to execute.", "items": { "$type": "Microsoft.IDialog", "$ref": "#/definitions/Microsoft.IDialog" } + }, + "intent": { + "type": "string", + "title": "Intent", + "description": "Name of intent." + }, + "entities": { + "type": "array", + "title": "Entities", + "description": "Required entities.", + "items": { + "type": "string" + } } }, "additionalProperties": false, @@ -5549,15 +5089,16 @@ "title": "Type", "required": [ "actions", + "intent", "$type" ] } ] }, - "Microsoft.OnMessageReactionActivity": { - "$role": "unionType(Microsoft.IOnEvent)", - "title": "MessageReactionActivity", - "description": "This defines the actions to take when a MessageReaction activity is received", + "Microsoft.OnInvokeActivity": { + "$role": "unionType(Microsoft.ITriggerCondition)", + "title": "On Invoke activity", + "description": "Actions to perform on receipt of an activity with type 'Invoke'.", "type": "object", "properties": { "$type": { @@ -5565,7 +5106,7 @@ "description": "Defines the valid properties for the component you are configuring (from a dialog .schema file)", "type": "string", "pattern": "^[a-zA-Z][a-zA-Z0-9.]*$", - "const": "Microsoft.OnMessageReactionActivity" + "const": "Microsoft.OnInvokeActivity" }, "$copy": { "title": "$copy", @@ -5582,12 +5123,12 @@ "$designer": { "title": "$designer", "type": "object", - "description": "Extra information for the Bot Framework Composer." + "description": "Extra information for the Bot Framework Designer." }, - "constraint": { + "condition": { "$role": "expression", - "title": "Constraint", - "description": "Optional constraint to which must be met for this rule to fire", + "title": "Condition", + "description": "Condition (expression).", "examples": [ "user.vip == true" ], @@ -5595,7 +5136,7 @@ }, "actions": { "type": "array", - "description": "Sequence of actions or dialogs to execute", + "description": "Sequence of actions to execute.", "items": { "$type": "Microsoft.IDialog", "$ref": "#/definitions/Microsoft.IDialog" @@ -5624,10 +5165,10 @@ } ] }, - "Microsoft.OnMessageUpdateActivity": { - "$role": "unionType(Microsoft.IOnEvent)", - "title": "MessageUpdateActivity", - "description": "This defines the actions to take when an MessageUpdate ctivity is received", + "Microsoft.OnMessageActivity": { + "$role": "unionType(Microsoft.ITriggerCondition)", + "title": "On Message activity", + "description": "Actions to perform on receipt of an activity with type 'Message'. Overrides Intent trigger.", "type": "object", "properties": { "$type": { @@ -5635,7 +5176,7 @@ "description": "Defines the valid properties for the component you are configuring (from a dialog .schema file)", "type": "string", "pattern": "^[a-zA-Z][a-zA-Z0-9.]*$", - "const": "Microsoft.OnMessageUpdateActivity" + "const": "Microsoft.OnMessageActivity" }, "$copy": { "title": "$copy", @@ -5652,12 +5193,12 @@ "$designer": { "title": "$designer", "type": "object", - "description": "Extra information for the Bot Framework Composer." + "description": "Extra information for the Bot Framework Designer." }, - "constraint": { + "condition": { "$role": "expression", - "title": "Constraint", - "description": "Optional constraint to which must be met for this rule to fire", + "title": "Condition", + "description": "Condition (expression).", "examples": [ "user.vip == true" ], @@ -5665,7 +5206,7 @@ }, "actions": { "type": "array", - "description": "Sequence of actions or dialogs to execute", + "description": "Sequence of actions to execute.", "items": { "$type": "Microsoft.IDialog", "$ref": "#/definitions/Microsoft.IDialog" @@ -5694,10 +5235,10 @@ } ] }, - "Microsoft.OnTypingActivity": { - "$role": "unionType(Microsoft.IOnEvent)", - "title": "TypingActivity", - "description": "This defines the actions to take when a Typing activity is received", + "Microsoft.OnMessageDeleteActivity": { + "$role": "unionType(Microsoft.ITriggerCondition)", + "title": "On MessageDelete activity", + "description": "Actions to perform on receipt of an activity with type 'MessageDelete'.", "type": "object", "properties": { "$type": { @@ -5705,7 +5246,7 @@ "description": "Defines the valid properties for the component you are configuring (from a dialog .schema file)", "type": "string", "pattern": "^[a-zA-Z][a-zA-Z0-9.]*$", - "const": "Microsoft.OnTypingActivity" + "const": "Microsoft.OnMessageDeleteActivity" }, "$copy": { "title": "$copy", @@ -5722,12 +5263,12 @@ "$designer": { "title": "$designer", "type": "object", - "description": "Extra information for the Bot Framework Composer." + "description": "Extra information for the Bot Framework Designer." }, - "constraint": { + "condition": { "$role": "expression", - "title": "Constraint", - "description": "Optional constraint to which must be met for this rule to fire", + "title": "Condition", + "description": "Condition (expression).", "examples": [ "user.vip == true" ], @@ -5735,7 +5276,7 @@ }, "actions": { "type": "array", - "description": "Sequence of actions or dialogs to execute", + "description": "Sequence of actions to execute.", "items": { "$type": "Microsoft.IDialog", "$ref": "#/definitions/Microsoft.IDialog" @@ -5764,10 +5305,10 @@ } ] }, - "Microsoft.OnUnknownIntent": { - "title": "OnUnknownIntent", - "description": "This defines the actions to take when an utterence is not recognized (aka, the None Intent). NOTE: UnknownIntent will defer to any specific intent that fires in a parent dialog", - "$role": "unionType(Microsoft.IOnEvent)", + "Microsoft.OnMessageReactionActivity": { + "$role": "unionType(Microsoft.ITriggerCondition)", + "title": "On MessageReaction activity", + "description": "Actions to perform on receipt of an activity with type 'MessageReaction'.", "type": "object", "properties": { "$type": { @@ -5775,7 +5316,7 @@ "description": "Defines the valid properties for the component you are configuring (from a dialog .schema file)", "type": "string", "pattern": "^[a-zA-Z][a-zA-Z0-9.]*$", - "const": "Microsoft.OnUnknownIntent" + "const": "Microsoft.OnMessageReactionActivity" }, "$copy": { "title": "$copy", @@ -5792,12 +5333,12 @@ "$designer": { "title": "$designer", "type": "object", - "description": "Extra information for the Bot Framework Composer." + "description": "Extra information for the Bot Framework Designer." }, - "constraint": { + "condition": { "$role": "expression", - "title": "Constraint", - "description": "Optional constraint to which must be met for this rule to fire", + "title": "Condition", + "description": "Condition (expression).", "examples": [ "user.vip == true" ], @@ -5805,7 +5346,7 @@ }, "actions": { "type": "array", - "description": "Sequence of actions or dialogs to execute", + "description": "Sequence of actions to execute.", "items": { "$type": "Microsoft.IDialog", "$ref": "#/definitions/Microsoft.IDialog" @@ -5829,16 +5370,295 @@ "title": "Type", "required": [ "actions", - "type", "$type" ] } ] }, - "Microsoft.OrdinalEntityRecognizer": { - "$role": "unionType(Microsoft.EntityRecognizer)", - "title": "Ordinal Entity Recognizer", - "description": "Recognizer which recognizes ordinals (example: first, second, 3rd).", + "Microsoft.OnMessageUpdateActivity": { + "$role": "unionType(Microsoft.ITriggerCondition)", + "title": "On MessageUpdate activity", + "description": "Actions to perform on receipt of an activity with type 'MessageUpdate'.", + "type": "object", + "properties": { + "$type": { + "title": "$type", + "description": "Defines the valid properties for the component you are configuring (from a dialog .schema file)", + "type": "string", + "pattern": "^[a-zA-Z][a-zA-Z0-9.]*$", + "const": "Microsoft.OnMessageUpdateActivity" + }, + "$copy": { + "title": "$copy", + "description": "Copy the definition by id from a .dialog file.", + "type": "string", + "pattern": "^(([a-zA-Z][a-zA-Z0-9.]*)?(#[a-zA-Z][a-zA-Z0-9.]*)?)$" + }, + "$id": { + "title": "$id", + "description": "Inline id for reuse of an inline definition", + "type": "string", + "pattern": "^([a-zA-Z][a-zA-Z0-9.]*)$" + }, + "$designer": { + "title": "$designer", + "type": "object", + "description": "Extra information for the Bot Framework Designer." + }, + "condition": { + "$role": "expression", + "title": "Condition", + "description": "Condition (expression).", + "examples": [ + "user.vip == true" + ], + "type": "string" + }, + "actions": { + "type": "array", + "description": "Sequence of actions to execute.", + "items": { + "$type": "Microsoft.IDialog", + "$ref": "#/definitions/Microsoft.IDialog" + } + } + }, + "additionalProperties": false, + "patternProperties": { + "^\\$": { + "type": "string" + } + }, + "anyOf": [ + { + "title": "Reference", + "required": [ + "$copy" + ] + }, + { + "title": "Type", + "required": [ + "actions", + "$type" + ] + } + ] + }, + "Microsoft.OnRepromptDialog": { + "$role": "unionType(Microsoft.ITriggerCondition)", + "title": "On RepromptDialog", + "description": "Actions to perform when 'RepromptDialog' event occurs.", + "type": "object", + "properties": { + "$type": { + "title": "$type", + "description": "Defines the valid properties for the component you are configuring (from a dialog .schema file)", + "type": "string", + "pattern": "^[a-zA-Z][a-zA-Z0-9.]*$", + "const": "Microsoft.OnRepromptDialog" + }, + "$copy": { + "title": "$copy", + "description": "Copy the definition by id from a .dialog file.", + "type": "string", + "pattern": "^(([a-zA-Z][a-zA-Z0-9.]*)?(#[a-zA-Z][a-zA-Z0-9.]*)?)$" + }, + "$id": { + "title": "$id", + "description": "Inline id for reuse of an inline definition", + "type": "string", + "pattern": "^([a-zA-Z][a-zA-Z0-9.]*)$" + }, + "$designer": { + "title": "$designer", + "type": "object", + "description": "Extra information for the Bot Framework Designer." + }, + "condition": { + "$role": "expression", + "title": "Condition", + "description": "Condition (expression).", + "examples": [ + "user.vip == true" + ], + "type": "string" + }, + "actions": { + "type": "array", + "description": "Sequence of actions to execute.", + "items": { + "$type": "Microsoft.IDialog", + "$ref": "#/definitions/Microsoft.IDialog" + } + } + }, + "additionalProperties": false, + "patternProperties": { + "^\\$": { + "type": "string" + } + }, + "anyOf": [ + { + "title": "Reference", + "required": [ + "$copy" + ] + }, + { + "title": "Type", + "required": [ + "actions", + "$type" + ] + } + ] + }, + "Microsoft.OnTypingActivity": { + "$role": "unionType(Microsoft.ITriggerCondition)", + "title": "On Typing activity", + "description": "Actions to perform on receipt of an activity with type 'Typing'.", + "type": "object", + "properties": { + "$type": { + "title": "$type", + "description": "Defines the valid properties for the component you are configuring (from a dialog .schema file)", + "type": "string", + "pattern": "^[a-zA-Z][a-zA-Z0-9.]*$", + "const": "Microsoft.OnTypingActivity" + }, + "$copy": { + "title": "$copy", + "description": "Copy the definition by id from a .dialog file.", + "type": "string", + "pattern": "^(([a-zA-Z][a-zA-Z0-9.]*)?(#[a-zA-Z][a-zA-Z0-9.]*)?)$" + }, + "$id": { + "title": "$id", + "description": "Inline id for reuse of an inline definition", + "type": "string", + "pattern": "^([a-zA-Z][a-zA-Z0-9.]*)$" + }, + "$designer": { + "title": "$designer", + "type": "object", + "description": "Extra information for the Bot Framework Designer." + }, + "condition": { + "$role": "expression", + "title": "Condition", + "description": "Condition (expression).", + "examples": [ + "user.vip == true" + ], + "type": "string" + }, + "actions": { + "type": "array", + "description": "Sequence of actions to execute.", + "items": { + "$type": "Microsoft.IDialog", + "$ref": "#/definitions/Microsoft.IDialog" + } + } + }, + "additionalProperties": false, + "patternProperties": { + "^\\$": { + "type": "string" + } + }, + "anyOf": [ + { + "title": "Reference", + "required": [ + "$copy" + ] + }, + { + "title": "Type", + "required": [ + "actions", + "$type" + ] + } + ] + }, + "Microsoft.OnUnknownIntent": { + "title": "On unknown intent", + "description": "Action to perform when user input is unrecognized and if none of the 'on intent recognition' triggers match recognized intent.", + "type": "object", + "$role": "unionType(Microsoft.ITriggerCondition)", + "properties": { + "$type": { + "title": "$type", + "description": "Defines the valid properties for the component you are configuring (from a dialog .schema file)", + "type": "string", + "pattern": "^[a-zA-Z][a-zA-Z0-9.]*$", + "const": "Microsoft.OnUnknownIntent" + }, + "$copy": { + "title": "$copy", + "description": "Copy the definition by id from a .dialog file.", + "type": "string", + "pattern": "^(([a-zA-Z][a-zA-Z0-9.]*)?(#[a-zA-Z][a-zA-Z0-9.]*)?)$" + }, + "$id": { + "title": "$id", + "description": "Inline id for reuse of an inline definition", + "type": "string", + "pattern": "^([a-zA-Z][a-zA-Z0-9.]*)$" + }, + "$designer": { + "title": "$designer", + "type": "object", + "description": "Extra information for the Bot Framework Designer." + }, + "condition": { + "$role": "expression", + "title": "Condition", + "description": "Condition (expression).", + "examples": [ + "user.vip == true" + ], + "type": "string" + }, + "actions": { + "type": "array", + "description": "Sequence of actions to execute.", + "items": { + "$type": "Microsoft.IDialog", + "$ref": "#/definitions/Microsoft.IDialog" + } + } + }, + "additionalProperties": false, + "patternProperties": { + "^\\$": { + "type": "string" + } + }, + "anyOf": [ + { + "title": "Reference", + "required": [ + "$copy" + ] + }, + { + "title": "Type", + "required": [ + "actions", + "$type" + ] + } + ] + }, + "Microsoft.OrdinalEntityRecognizer": { + "$role": "unionType(Microsoft.EntityRecognizers)", + "title": "Ordinal Entity Recognizer", + "description": "Recognizer which recognizes ordinals (example: first, second, 3rd).", "type": "object", "properties": { "$type": { @@ -5863,7 +5683,7 @@ "$designer": { "title": "$designer", "type": "object", - "description": "Extra information for the Bot Framework Composer." + "description": "Extra information for the Bot Framework Designer." } }, "additionalProperties": false, @@ -5888,7 +5708,7 @@ ] }, "Microsoft.PercentageEntityRecognizer": { - "$role": "unionType(Microsoft.EntityRecognizer)", + "$role": "unionType(Microsoft.EntityRecognizers)", "title": "Percentage Entity Recognizer", "description": "Recognizer which recognizes percentages.", "type": "object", @@ -5915,7 +5735,7 @@ "$designer": { "title": "$designer", "type": "object", - "description": "Extra information for the Bot Framework Composer." + "description": "Extra information for the Bot Framework Designer." } }, "additionalProperties": false, @@ -5940,7 +5760,7 @@ ] }, "Microsoft.PhoneNumberEntityRecognizer": { - "$role": "unionType(Microsoft.EntityRecognizer)", + "$role": "unionType(Microsoft.EntityRecognizers)", "title": "Phone Number Entity Recognizer", "description": "Recognizer which recognizes phone numbers.", "type": "object", @@ -5967,7 +5787,7 @@ "$designer": { "title": "$designer", "type": "object", - "description": "Extra information for the Bot Framework Composer." + "description": "Extra information for the Bot Framework Designer." } }, "additionalProperties": false, @@ -5994,7 +5814,7 @@ "Microsoft.QnAMakerDialog": { "$role": "unionType(Microsoft.IDialog)", "title": "QnAMaker Dialog", - "description": "This represents a dialog which is driven by a call to QnAMaker.ai knowledge base", + "description": "Dialog which uses QnAMAker knowledge base to answer questions.", "type": "object", "additionalProperties": false, "properties": { @@ -6020,47 +5840,70 @@ "$designer": { "title": "$designer", "type": "object", - "description": "Extra information for the Bot Framework Composer." + "description": "Extra information for the Bot Framework Designer." }, - "endpoint": { - "type": "object", - "title": "Endpoint", - "description": "This is the QnAMaker endpoint to use", - "required": [ - "knowledgeBaseId", - "endpointKey", - "host" + "knowledgeBaseId": { + "$role": "expression", + "title": "KnowledgeBase Id", + "description": "KnowledgeBase Id of your QnA Maker KnowledgeBase.", + "default": "settings.qna.knowledgebaseid", + "type": "string" + }, + "endpointKey": { + "$role": "expression", + "title": "Endpoint Key", + "description": "Endpoint key for the QnA Maker KB.", + "default": "settings.qna.endpointkey", + "type": "string" + }, + "hostname": { + "$role": "expression", + "title": "Hostname", + "description": "Hostname for your QnA Maker service.", + "default": "settings.qna.hostname", + "examples": [ + "https://yourserver.azurewebsites.net/qnamaker" ], - "properties": { - "knowledgeBaseId": { - "type": "string", - "title": "Knowledgebase Id", - "description": "the knowledge base ID." - }, - "endpointKey": { - "type": "string", - "title": "Endpoint Key", - "description": "sets the endpoint key for the knowledge base" - }, - "host": { - "type": "string", - "title": "Host", - "description": "sets the host path", - "examples": [ - "https://yourserver.azurewebsites.net/qnamaker" - ] - } - } + "type": "string" }, - "options": { - "type": "object", - "title": "Options", - "properties": { - "scoreThreshold": { - "type": "number", - "title": "Score Threshold", - "description": "\"sets the minimum score threshold, used to filter returned results. Scores are normalized to the range of 0.0 to 1.0" - } + "noAnswer": { + "$type": "Microsoft.IActivityTemplate", + "title": "Fallback answer", + "description": "Default answer to return when none found in KB.", + "default": "Sorry, I did not find an answer.", + "$ref": "#/definitions/Microsoft.IActivityTemplate" + }, + "threshold": { + "type": "number", + "title": "Threshold", + "description": "Threshold score to filter results.", + "default": 0.3 + }, + "activeLearningCardTitle": { + "type": "string", + "title": "Active learning card title", + "description": "Title for active learning suggestions card.", + "default": "Did you mean:" + }, + "cardNoMatchText": { + "type": "string", + "title": "Card no match text", + "description": "Text for no match option.", + "default": "None of the above." + }, + "cardNoMatchResponse ": { + "$type": "Microsoft.IActivityTemplate", + "title": "Card no match response", + "description": "Custom response when no match option was selected.", + "default": "Thanks for the feedback.", + "$ref": "#/definitions/Microsoft.IActivityTemplate" + }, + "strictFilters": { + "type": "array", + "title": "Strict Filter Property", + "description": "Memory property that holds strict filters to use when calling the QnA Maker KB.", + "items": { + "type": "object" } } }, @@ -6079,14 +5922,16 @@ { "title": "Type", "required": [ - "endpoint", + "knowledgeBaseId", + "endpointKey", + "hostname", "$type" ] } ] }, "Microsoft.RandomSelector": { - "$role": "unionType(Microsoft.IEventSelector)", + "$role": "unionType(Microsoft.ITriggerSelector)", "title": "Random rule selector", "description": "Select most specific true rule", "type": "object", @@ -6113,7 +5958,7 @@ "$designer": { "title": "$designer", "type": "object", - "description": "Extra information for the Bot Framework Composer." + "description": "Extra information for the Bot Framework Designer." }, "seed": { "type": "integer" @@ -6140,8 +5985,8 @@ } ] }, - "Microsoft.RegexEntityRecognizer": { - "$role": "unionType(Microsoft.EntityRecognizer)", + "Microsoft.RegExEntityRecognizer": { + "$role": "unionType(Microsoft.EntityRecognizers)", "title": "Regex Entity Recognizer", "description": "Recognizer which recognizes patterns of input based on regex.", "type": "object", @@ -6151,7 +5996,7 @@ "description": "Defines the valid properties for the component you are configuring (from a dialog .schema file)", "type": "string", "pattern": "^[a-zA-Z][a-zA-Z0-9.]*$", - "const": "Microsoft.RegexEntityRecognizer" + "const": "Microsoft.RegExEntityRecognizer" }, "$copy": { "title": "$copy", @@ -6168,7 +6013,7 @@ "$designer": { "title": "$designer", "type": "object", - "description": "Extra information for the Bot Framework Composer." + "description": "Extra information for the Bot Framework Designer." }, "name": { "type": "string", @@ -6206,8 +6051,8 @@ }, "Microsoft.RegexRecognizer": { "$role": "unionType(Microsoft.IRecognizer)", - "title": "Regex Recognizer", - "description": "Recognizer which uses regex expressions to generate intents and entities.", + "title": "Regex recognizer", + "description": "Use regular expressions to recognize intents and entities from user input.", "type": "object", "properties": { "$type": { @@ -6232,35 +6077,35 @@ "$designer": { "title": "$designer", "type": "object", - "description": "Extra information for the Bot Framework Composer." + "description": "Extra information for the Bot Framework Designer." }, "intents": { "type": "array", "title": "RegEx patterns to intents", - "description": "Collection of patterns to match intents", + "description": "Collection of patterns to match for an intent.", "items": { "type": "object", "properties": { "intent": { "type": "string", "title": "Intent", - "description": "The intent name" + "description": "The intent name." }, "pattern": { "type": "string", "title": "Pattern", - "description": "The regular expression pattern for matching" + "description": "The regular expression pattern." } } } }, "entities": { "type": "array", - "title": "Entitie Recognizers", - "description": "Entity Recognizers to use", + "title": "Entity recognizers", + "description": "Collection of entity recognizers to use.", "items": { - "$type": "Microsoft.EntityRecognizer", - "$ref": "#/definitions/Microsoft.EntityRecognizer" + "$type": "Microsoft.EntityRecognizers", + "$ref": "#/definitions/Microsoft.EntityRecognizers" } } }, @@ -6289,8 +6134,8 @@ "Microsoft.RepeatDialog": { "$role": "unionType(Microsoft.IDialog)", "type": "object", - "title": "Repeat Dialog", - "description": "This is a action which repeats the current dialog with the same dialog.", + "title": "Repeat dialog", + "description": "Repeat current dialog.", "properties": { "$type": { "title": "$type", @@ -6314,27 +6159,7 @@ "$designer": { "title": "$designer", "type": "object", - "description": "Extra information for the Bot Framework Composer." - }, - "id": { - "type": "string", - "title": "Id", - "description": "(Optional) id for the dialog", - "examples": [ - "Dialog2" - ] - }, - "tags": { - "type": "array", - "title": "Tags", - "description": "Tags are optional strings that you can use to organize components", - "examples": [ - "input", - "confirmation" - ], - "items": { - "type": "string" - } + "description": "Extra information for the Bot Framework Designer." } }, "additionalProperties": false, @@ -6361,8 +6186,8 @@ "Microsoft.ReplaceDialog": { "$role": "unionType(Microsoft.IDialog)", "type": "object", - "title": "Replace Dialog", - "description": "This is a action which replaces the current dialog with the target dialog", + "title": "Replace dialog", + "description": "Replace current dialog with another dialog.", "properties": { "$type": { "title": "$type", @@ -6386,50 +6211,22 @@ "$designer": { "title": "$designer", "type": "object", - "description": "Extra information for the Bot Framework Composer." - }, - "id": { - "type": "string", - "title": "Id", - "description": "(Optional) id for the dialog", - "examples": [ - "Dialog2" - ] - }, - "tags": { - "type": "array", - "title": "Tags", - "description": "Tags are optional strings that you can use to organize components", - "examples": [ - "input", - "confirmation" - ], - "items": { - "type": "string" - } + "description": "Extra information for the Bot Framework Designer." }, "dialog": { "$type": "Microsoft.IDialog", - "title": "Dialog", - "description": "This is the dialog to switch to.", + "title": "Dialog name", + "description": "Current dialog will be replaced by this dialog.", "$ref": "#/definitions/Microsoft.IDialog" }, "options": { "type": "object", - "title": "Options binding", - "description": "Bindings to configure the options object to pass to the dialog.", + "title": "Options", + "description": "One or more options that are passed to the dialog that is called.", "additionalProperties": { "type": "string", "title": "Options" } - }, - "property": { - "$role": "expression", - "description": "The property to bind to the dialog and store the result in", - "examples": [ - "user.name" - ], - "type": "string" } }, "additionalProperties": false, @@ -6455,8 +6252,8 @@ }, "Microsoft.SendActivity": { "$role": "unionType(Microsoft.IDialog)", - "title": "Send Activity Action", - "description": "This is a action which sends an activity to the user", + "title": "Send an activity", + "description": "Respond with an activity.", "type": "object", "properties": { "$type": { @@ -6481,32 +6278,12 @@ "$designer": { "title": "$designer", "type": "object", - "description": "Extra information for the Bot Framework Composer." - }, - "id": { - "type": "string", - "title": "Id", - "description": "(Optional) id for the dialog", - "examples": [ - "Dialog2" - ] - }, - "tags": { - "type": "array", - "title": "Tags", - "description": "Tags are optional strings that you can use to organize components", - "examples": [ - "input", - "confirmation" - ], - "items": { - "type": "string" - } + "description": "Extra information for the Bot Framework Designer." }, "activity": { "$type": "Microsoft.IActivityTemplate", "title": "Activity", - "description": "Activity to send to the user", + "description": "Activity to send.", "$ref": "#/definitions/Microsoft.IActivityTemplate" } }, @@ -6533,8 +6310,8 @@ }, "Microsoft.SetProperty": { "$role": "unionType(Microsoft.IDialog)", - "title": "Set Property Action", - "description": "This action allows you to set memory to the value of an expression", + "title": "Set property", + "description": "Set property to a value.", "type": "object", "properties": { "$type": { @@ -6559,32 +6336,12 @@ "$designer": { "title": "$designer", "type": "object", - "description": "Extra information for the Bot Framework Composer." - }, - "id": { - "type": "string", - "title": "Id", - "description": "(Optional) id for the dialog", - "examples": [ - "Dialog2" - ] - }, - "tags": { - "type": "array", - "title": "Tags", - "description": "Tags are optional strings that you can use to organize components", - "examples": [ - "input", - "confirmation" - ], - "items": { - "type": "string" - } + "description": "Extra information for the Bot Framework Designer." }, "property": { "$role": "expression", "title": "Property", - "description": "The property to set the value of", + "description": "Property (named location to store information).", "examples": [ "user.age" ], @@ -6593,9 +6350,11 @@ "value": { "$role": "expression", "title": "Value", - "description": "Expression against memory to use to get the value.", + "description": "New value or expression.", "examples": [ - "dialog.result" + "'milk'", + "dialog.favColor", + "dialog.favColor == 'red'" ], "type": "string" } @@ -6623,10 +6382,10 @@ } ] }, - "Microsoft.SwitchCondition": { - "$role": "unionType(Microsoft.IDialog)", - "title": "Switch Action", - "description": "Action which conditionally decides which action to execute next.", + "Microsoft.StaticActivityTemplate": { + "$role": "unionType(Microsoft.IActivityTemplate)", + "title": "Microsoft Static Activity Template", + "description": "This allows you to define a static Activity object", "type": "object", "properties": { "$type": { @@ -6634,7 +6393,7 @@ "description": "Defines the valid properties for the component you are configuring (from a dialog .schema file)", "type": "string", "pattern": "^[a-zA-Z][a-zA-Z0-9.]*$", - "const": "Microsoft.SwitchCondition" + "const": "Microsoft.StaticActivityTemplate" }, "$copy": { "title": "$copy", @@ -6651,41 +6410,79 @@ "$designer": { "title": "$designer", "type": "object", - "description": "Extra information for the Bot Framework Composer." + "description": "Extra information for the Bot Framework Designer." }, - "id": { - "type": "string", - "title": "Id", - "description": "(Optional) id for the dialog", - "examples": [ - "Dialog2" + "activity": { + "type": "object", + "title": "Activity", + "Description": "A static Activity to used" + } + }, + "additionalProperties": false, + "patternProperties": { + "^\\$": { + "type": "string" + } + }, + "anyOf": [ + { + "title": "Reference", + "required": [ + "$copy" ] }, - "tags": { - "type": "array", - "title": "Tags", - "description": "Tags are optional strings that you can use to organize components", - "examples": [ - "input", - "confirmation" - ], - "items": { - "type": "string" - } + { + "title": "Type", + "required": [ + "activity", + "$type" + ] + } + ] + }, + "Microsoft.SwitchCondition": { + "$role": "unionType(Microsoft.IDialog)", + "title": "Switch condition", + "description": "Execute different actions based on the value of a property.", + "type": "object", + "properties": { + "$type": { + "title": "$type", + "description": "Defines the valid properties for the component you are configuring (from a dialog .schema file)", + "type": "string", + "pattern": "^[a-zA-Z][a-zA-Z0-9.]*$", + "const": "Microsoft.SwitchCondition" + }, + "$copy": { + "title": "$copy", + "description": "Copy the definition by id from a .dialog file.", + "type": "string", + "pattern": "^(([a-zA-Z][a-zA-Z0-9.]*)?(#[a-zA-Z][a-zA-Z0-9.]*)?)$" + }, + "$id": { + "title": "$id", + "description": "Inline id for reuse of an inline definition", + "type": "string", + "pattern": "^([a-zA-Z][a-zA-Z0-9.]*)$" + }, + "$designer": { + "title": "$designer", + "type": "object", + "description": "Extra information for the Bot Framework Designer." }, "condition": { "$role": "expression", "title": "Condition", - "description": "Expression to evaluate to switch on.", + "description": "Property to evaluate.", "examples": [ - "user.age > 3" + "user.favColor" ], "type": "string" }, "cases": { "type": "array", "title": "Cases", - "desc": "Cases to evaluate against condition", + "desc": "Actions for each possible condition.", "items": { "type": "object", "required": [ @@ -6696,13 +6493,17 @@ "value": { "$role": "expression", "title": "Value", - "description": "Value which must match the condition property", + "description": "Value.", + "examples": [ + "'red'", + "dialog.colors.red" + ], "type": "string" }, "actions": { "type": "array", "title": "Actions", - "description": "Actions to execute if case is equal to condition", + "description": "Actions to execute.", "items": { "$type": "Microsoft.IDialog", "$ref": "#/definitions/Microsoft.IDialog" @@ -6714,7 +6515,7 @@ "default": { "type": "array", "title": "Default", - "description": "Action to execute if no case is equal to condition", + "description": "Actions to execute if none of the cases meet the condition.", "items": { "$type": "Microsoft.IDialog", "$ref": "#/definitions/Microsoft.IDialog" @@ -6744,7 +6545,7 @@ ] }, "Microsoft.TemperatureEntityRecognizer": { - "$role": "unionType(Microsoft.EntityRecognizer)", + "$role": "unionType(Microsoft.EntityRecognizers)", "title": "Temperature Entity Recognizer", "description": "Recognizer which recognizes temperatures.", "type": "object", @@ -6771,7 +6572,7 @@ "$designer": { "title": "$designer", "type": "object", - "description": "Extra information for the Bot Framework Composer." + "description": "Extra information for the Bot Framework Designer." } }, "additionalProperties": false, @@ -6797,9 +6598,9 @@ }, "Microsoft.TextInput": { "$role": "unionType(Microsoft.IDialog)", - "title": "TextInput Dialog", - "description": "This represents a dialog which gathers a text from the user", "type": "object", + "title": "Text input dialog", + "description": "Collection information - Ask for a word or sentence.", "properties": { "$type": { "title": "$type", @@ -6823,32 +6624,17 @@ "$designer": { "title": "$designer", "type": "object", - "description": "Extra information for the Bot Framework Composer." + "description": "Extra information for the Bot Framework Designer." }, "id": { "type": "string", "title": "Id", - "description": "(Optional) id for the dialog", - "examples": [ - "Dialog2" - ] - }, - "tags": { - "type": "array", - "title": "Tags", - "description": "Tags are optional strings that you can use to organize components", - "examples": [ - "input", - "confirmation" - ], - "items": { - "type": "string" - } + "description": "Optional id for the dialog" }, "prompt": { "$type": "Microsoft.IActivityTemplate", - "title": "Initial Prompt", - "description": "The message to send to as prompt for this input.", + "title": "Initial prompt", + "description": "Message to send to collect information.", "examples": [ "What is your birth date?" ], @@ -6856,75 +6642,80 @@ }, "unrecognizedPrompt": { "$type": "Microsoft.IActivityTemplate", - "title": "Unrecognized Prompt", - "description": "The message to send if the last input is not recognized.", + "title": "Unrecognized prompt", + "description": "Message to send if user response is not recognized.", "examples": [ - "Let's try again. What is your birth date?" + "Sorry, I do not understand '{turn.activity.text'}. Let's try again. What is your birth date?" ], "$ref": "#/definitions/Microsoft.IActivityTemplate" }, "invalidPrompt": { "$type": "Microsoft.IActivityTemplate", - "title": "Invalid Prompt", - "description": "The message to send to when then input was not valid for the input type.", + "title": "Invalid prompt", + "description": "Message to send if user response is invalid. Relies on specified validation expressions.", "examples": [ - "No date was recognized" + "Sorry, '{this.value}' does not work. I need a number between 1-150. What is your age?" ], "$ref": "#/definitions/Microsoft.IActivityTemplate" }, "defaultValueResponse": { "$type": "Microsoft.IActivityTemplate", - "title": "Default Value Response", - "description": "The message to send to when max turn count has been exceeded and the default value is selected as the value.", + "title": "Default value response", + "description": "Message to send when max turn count (if specified) has been exceeded and the default value is selected as the value.", "examples": [ - "I didn't understand your responses, so I will just use the default value of 10. Let me know if you want to change it." + "Sorry, I'm having trouble understanding you. I will just use {this.options.defaultValue} for now. You can say 'I'm 36 years old' to change it." ], "$ref": "#/definitions/Microsoft.IActivityTemplate" }, "maxTurnCount": { "type": "integer", - "title": "Max Turn Count", - "description": "The max retry count for this prompt.", - "default": 2147483647, + "title": "Max turn count", + "description": "Maximum number of re-prompt attempts to collect information.", + "default": 3, "examples": [ 3 ] }, "validations": { "type": "array", - "title": "Validation Expressions", - "description": "Expressions to validate an input.", + "title": "Validation expressions", + "description": "Expression to validate user input.", + "examples": [ + "int(this.value) > 1 && int(this.value) <= 150", + "count(this.value) < 300" + ], "items": { "$role": "expression", "type": "string", "description": "String must contain an expression." } }, - "value": { - "$role": "expression", - "title": "Value", - "description": "The expression that you evaluated for input.", - "type": "string" - }, "property": { "$role": "expression", "title": "Property", - "description": "Property that this input dialog is bound to", + "description": "Property to store collected information. Input will be skipped if property has value (unless 'Always prompt' is true).", "examples": [ - "$birthday" + "$birthday", + "user.name", + "conversation.issueTitle", + "dialog.favColor" ], "type": "string" }, "defaultValue": { "$role": "expression", - "title": "Default Value", - "description": "Value to return if the value expression can't be evaluated.", + "title": "Default value", + "description": "Expression to examine on each turn of the conversation as possible value to the property.", + "examples": [ + "@userName", + "coalesce(@number, @partySize)" + ], "type": "string" }, "alwaysPrompt": { "type": "boolean", - "title": "Always Prompt", - "description": "If set to true this will always prompt the user regardless if you already have the value or not.", + "title": "Always prompt", + "description": "Collect information even if the specified 'property' is not empty.", "default": false, "examples": [ false @@ -6932,16 +6723,11 @@ }, "allowInterruptions": { "type": "string", - "enum": [ - "always", - "never", - "notRecognized" - ], "title": "Allow Interruptions", - "description": "Always will always consult parent dialogs first, never will not consult parent dialogs, notRecognized will consult parent only when it's not recognized", - "default": "notRecognized", + "description": "A boolean expression that determines whether the parent should be allowed to interrupt the input.", + "default": "true", "examples": [ - "notRecognized" + "true" ] }, "outputFormat": { @@ -6952,8 +6738,8 @@ "lowercase", "uppercase" ], - "title": "Output Format", - "description": "The TextInput output format.", + "title": "Output format", + "description": "Format of output.", "default": "none" } }, @@ -6978,10 +6764,10 @@ } ] }, - "Microsoft.TraceActivity": { - "$role": "unionType(Microsoft.IDialog)", - "title": "Trace Activity Action", - "description": "This is a action which sends an TraceActivity to the transcript", + "Microsoft.TextTemplate": { + "$role": "unionType(Microsoft.ITextTemplate)", + "title": "Microsoft TextTemplate", + "description": "Lg tempalte to evaluate to create text", "type": "object", "properties": { "$type": { @@ -6989,7 +6775,7 @@ "description": "Defines the valid properties for the component you are configuring (from a dialog .schema file)", "type": "string", "pattern": "^[a-zA-Z][a-zA-Z0-9.]*$", - "const": "Microsoft.TraceActivity" + "const": "Microsoft.TextTemplate" }, "$copy": { "title": "$copy", @@ -7006,27 +6792,65 @@ "$designer": { "title": "$designer", "type": "object", - "description": "Extra information for the Bot Framework Composer." + "description": "Extra information for the Bot Framework Designer." }, - "id": { - "type": "string", - "title": "Id", - "description": "(Optional) id for the dialog", - "examples": [ - "Dialog2" + "template": { + "title": "Template", + "Description": "Language Generator template to evaluate to create the text", + "type": "string" + } + }, + "additionalProperties": false, + "patternProperties": { + "^\\$": { + "type": "string" + } + }, + "anyOf": [ + { + "title": "Reference", + "required": [ + "$copy" ] }, - "tags": { - "type": "array", - "title": "Tags", - "description": "Tags are optional strings that you can use to organize components", - "examples": [ - "input", - "confirmation" - ], - "items": { - "type": "string" - } + { + "title": "Type", + "required": [ + "template", + "$type" + ] + } + ] + }, + "Microsoft.TraceActivity": { + "$role": "unionType(Microsoft.IDialog)", + "title": "Send a TraceActivity", + "description": "Send a trace activity to the transcript logger and/ or Bot Framework Emulator.", + "type": "object", + "properties": { + "$type": { + "title": "$type", + "description": "Defines the valid properties for the component you are configuring (from a dialog .schema file)", + "type": "string", + "pattern": "^[a-zA-Z][a-zA-Z0-9.]*$", + "const": "Microsoft.TraceActivity" + }, + "$copy": { + "title": "$copy", + "description": "Copy the definition by id from a .dialog file.", + "type": "string", + "pattern": "^(([a-zA-Z][a-zA-Z0-9.]*)?(#[a-zA-Z][a-zA-Z0-9.]*)?)$" + }, + "$id": { + "title": "$id", + "description": "Inline id for reuse of an inline definition", + "type": "string", + "pattern": "^([a-zA-Z][a-zA-Z0-9.]*)$" + }, + "$designer": { + "title": "$designer", + "type": "object", + "description": "Extra information for the Bot Framework Designer." }, "name": { "type": "string", @@ -7035,13 +6859,13 @@ }, "valueType": { "type": "string", - "title": "Value Type", - "description": "Value type of the trace activity" + "title": "Value type", + "description": "Type of value" }, "value": { "$role": "expression", "title": "Value", - "description": "Property path to memory object to send as the value of the trace activity", + "description": "Property that holds the value to send as trace activity.", "type": "string" } }, @@ -7067,8 +6891,8 @@ ] }, "Microsoft.TrueSelector": { - "$role": "unionType(Microsoft.IEventSelector)", - "title": "True Event Selector", + "$role": "unionType(Microsoft.ITriggerSelector)", + "title": "True Trigger Selector", "description": "Selector for all true events", "type": "object", "properties": { @@ -7094,7 +6918,7 @@ "$designer": { "title": "$designer", "type": "object", - "description": "Extra information for the Bot Framework Composer." + "description": "Extra information for the Bot Framework Designer." } }, "additionalProperties": false, @@ -7119,7 +6943,7 @@ ] }, "Microsoft.UrlEntityRecognizer": { - "$role": "unionType(Microsoft.EntityRecognizer)", + "$role": "unionType(Microsoft.EntityRecognizers)", "title": "Url Entity Recognizer", "description": "Recognizer which recognizes urls (example: http://bing.com)", "type": "object", @@ -7146,7 +6970,7 @@ "$designer": { "title": "$designer", "type": "object", - "description": "Extra information for the Bot Framework Composer." + "description": "Extra information for the Bot Framework Designer." } }, "additionalProperties": false, diff --git a/BotProject/CSharp/Startup.cs b/BotProject/CSharp/Startup.cs index 5562dd8d33..b2e07dd309 100644 --- a/BotProject/CSharp/Startup.cs +++ b/BotProject/CSharp/Startup.cs @@ -29,7 +29,7 @@ using Microsoft.Bot.Builder.BotFramework; using Microsoft.Bot.Builder.Dialogs.Declarative; -namespace Microsoft.Bot.Builder.TestBot.Json +namespace Microsoft.Bot.Builder.ComposerBot.json { public class Startup { diff --git a/BotProject/CSharp/Tests/ActionsTests.cs b/BotProject/CSharp/Tests/ActionsTests.cs index 6645a95de2..763fa702c2 100644 --- a/BotProject/CSharp/Tests/ActionsTests.cs +++ b/BotProject/CSharp/Tests/ActionsTests.cs @@ -6,12 +6,10 @@ using Microsoft.Bot.Builder.Dialogs.Declarative; using Microsoft.Bot.Builder.Dialogs.Declarative.Resources; using Microsoft.Bot.Builder.Dialogs.Declarative.Types; -using Microsoft.Bot.Builder.TestBot.Json; using Microsoft.Bot.Schema; using Microsoft.Extensions.Configuration; using Microsoft.VisualStudio.TestTools.UnitTesting; using System; -using System.Collections.Generic; using System.IO; using System.Threading.Tasks; @@ -34,7 +32,6 @@ private static string getFolderPath(string path) public static void ClassInitialize(TestContext context) { TypeFactory.Configuration = new ConfigurationBuilder().AddInMemoryCollection().Build(); - TypeFactory.RegisterAdaptiveTypes(); string path = Path.GetFullPath(Path.Combine(Environment.CurrentDirectory, samplesDirectory)); } @@ -45,7 +42,7 @@ public async Task Actions_01Actions() { await BuildTestFlow(getFolderPath("Steps_Samples")) .SendConversationUpdate() - .AssertReply("I can show you examples on how to use actions. Enter the number next to the entity that you with to see in action.\n01 - Actions\n02 - EndTurn\n03 - IfCondiftion\n04 - EditArray, Foreach\n05 - EndDialog\n06 - HttpRequest\n07 - SwitchCondition\n08 - RepeatDialog\n09 - TraceAndLog\n10 - EditActions\n11 - ReplaceDialog\n12 - EmitEvent\n") + .AssertReply(String.Format("I can show you examples on how to use actions. Enter the number next to the entity that you with to see in action.{0}01 - Actions{0}02 - EndTurn{0}03 - IfCondiftion{0}04 - EditArray, Foreach{0}05 - EndDialog{0}06 - HttpRequest{0}07 - SwitchCondition{0}08 - RepeatDialog{0}09 - TraceAndLog{0}10 - EditActions{0}11 - ReplaceDialog{0}12 - EmitEvent{0}", Environment.NewLine)) .Send("01") .AssertReply("Step 1") .AssertReply("Step 2") @@ -60,7 +57,7 @@ public async Task Actions_02EndTurn() { await BuildTestFlow(getFolderPath("Steps_Samples")) .SendConversationUpdate() - .AssertReply("I can show you examples on how to use actions. Enter the number next to the entity that you with to see in action.\n01 - Actions\n02 - EndTurn\n03 - IfCondiftion\n04 - EditArray, Foreach\n05 - EndDialog\n06 - HttpRequest\n07 - SwitchCondition\n08 - RepeatDialog\n09 - TraceAndLog\n10 - EditActions\n11 - ReplaceDialog\n12 - EmitEvent\n") + .AssertReply(String.Format("I can show you examples on how to use actions. Enter the number next to the entity that you with to see in action.{0}01 - Actions{0}02 - EndTurn{0}03 - IfCondiftion{0}04 - EditArray, Foreach{0}05 - EndDialog{0}06 - HttpRequest{0}07 - SwitchCondition{0}08 - RepeatDialog{0}09 - TraceAndLog{0}10 - EditActions{0}11 - ReplaceDialog{0}12 - EmitEvent{0}", Environment.NewLine)) .Send("02") .AssertReply("What's up?") .Send("Nothing") @@ -73,8 +70,7 @@ public async Task Actions_03IfCondition() { await BuildTestFlow(getFolderPath("Steps_Samples")) .SendConversationUpdate() - .AssertReply("I can show you examples on how to use actions. Enter the number next to the entity that you with to see in action.\n01 - Actions\n02 - EndTurn\n03 - IfCondiftion\n04 - EditArray, Foreach\n05 - EndDialog\n06 - HttpRequest\n07 - SwitchCondition\n08 - RepeatDialog\n09 - TraceAndLog\n10 - EditActions\n11 - ReplaceDialog\n12 - EmitEvent\n") - .Send("03") + .AssertReply(String.Format("I can show you examples on how to use actions. Enter the number next to the entity that you with to see in action.{0}01 - Actions{0}02 - EndTurn{0}03 - IfCondiftion{0}04 - EditArray, Foreach{0}05 - EndDialog{0}06 - HttpRequest{0}07 - SwitchCondition{0}08 - RepeatDialog{0}09 - TraceAndLog{0}10 - EditActions{0}11 - ReplaceDialog{0}12 - EmitEvent{0}", Environment.NewLine)).Send("03") .AssertReply("Hello, I'm Zoidberg. What is your name?") .Send("Carlos") .AssertReply("Hello Carlos, nice to talk to you!") @@ -86,8 +82,7 @@ public async Task Actions_04EditArray() { await BuildTestFlow(getFolderPath("Steps_Samples")) .SendConversationUpdate() - .AssertReply("I can show you examples on how to use actions. Enter the number next to the entity that you with to see in action.\n01 - Actions\n02 - EndTurn\n03 - IfCondiftion\n04 - EditArray, Foreach\n05 - EndDialog\n06 - HttpRequest\n07 - SwitchCondition\n08 - RepeatDialog\n09 - TraceAndLog\n10 - EditActions\n11 - ReplaceDialog\n12 - EmitEvent\n") - .Send("04") + .AssertReply(String.Format("I can show you examples on how to use actions. Enter the number next to the entity that you with to see in action.{0}01 - Actions{0}02 - EndTurn{0}03 - IfCondiftion{0}04 - EditArray, Foreach{0}05 - EndDialog{0}06 - HttpRequest{0}07 - SwitchCondition{0}08 - RepeatDialog{0}09 - TraceAndLog{0}10 - EditActions{0}11 - ReplaceDialog{0}12 - EmitEvent{0}", Environment.NewLine)).Send("04") .AssertReply("Here are the index and values in the array.") .AssertReply("0: 11111") .AssertReply("1: 40000") @@ -104,8 +99,7 @@ public async Task Actions_05EndDialog() { await BuildTestFlow(getFolderPath("Steps_Samples")) .SendConversationUpdate() - .AssertReply("I can show you examples on how to use actions. Enter the number next to the entity that you with to see in action.\n01 - Actions\n02 - EndTurn\n03 - IfCondiftion\n04 - EditArray, Foreach\n05 - EndDialog\n06 - HttpRequest\n07 - SwitchCondition\n08 - RepeatDialog\n09 - TraceAndLog\n10 - EditActions\n11 - ReplaceDialog\n12 - EmitEvent\n") - .Send("05") + .AssertReply(String.Format("I can show you examples on how to use actions. Enter the number next to the entity that you with to see in action.{0}01 - Actions{0}02 - EndTurn{0}03 - IfCondiftion{0}04 - EditArray, Foreach{0}05 - EndDialog{0}06 - HttpRequest{0}07 - SwitchCondition{0}08 - RepeatDialog{0}09 - TraceAndLog{0}10 - EditActions{0}11 - ReplaceDialog{0}12 - EmitEvent{0}", Environment.NewLine)).Send("05") .AssertReply("Hello, I'm Zoidberg. What is your name?") .Send("luhan") .AssertReply("Hello luhan, nice to talk to you!") @@ -122,8 +116,7 @@ public async Task Actions_06SwitchCondition() { await BuildTestFlow(getFolderPath("Steps_Samples")) .SendConversationUpdate() - .AssertReply("I can show you examples on how to use actions. Enter the number next to the entity that you with to see in action.\n01 - Actions\n02 - EndTurn\n03 - IfCondiftion\n04 - EditArray, Foreach\n05 - EndDialog\n06 - HttpRequest\n07 - SwitchCondition\n08 - RepeatDialog\n09 - TraceAndLog\n10 - EditActions\n11 - ReplaceDialog\n12 - EmitEvent\n") - .Send("07") + .AssertReply(String.Format("I can show you examples on how to use actions. Enter the number next to the entity that you with to see in action.{0}01 - Actions{0}02 - EndTurn{0}03 - IfCondiftion{0}04 - EditArray, Foreach{0}05 - EndDialog{0}06 - HttpRequest{0}07 - SwitchCondition{0}08 - RepeatDialog{0}09 - TraceAndLog{0}10 - EditActions{0}11 - ReplaceDialog{0}12 - EmitEvent{0}", Environment.NewLine)).Send("07") .AssertReply("Please select a value from below:\n\n 1. Test1\n 2. Test2\n 3. Test3") .Send("Test1") .AssertReply("You select: Test1") @@ -136,15 +129,11 @@ public async Task Actions_07RepeatDialog() { await BuildTestFlow(getFolderPath("Steps_Samples")) .SendConversationUpdate() - .AssertReply("I can show you examples on how to use actions. Enter the number next to the entity that you with to see in action.\n01 - Actions\n02 - EndTurn\n03 - IfCondiftion\n04 - EditArray, Foreach\n05 - EndDialog\n06 - HttpRequest\n07 - SwitchCondition\n08 - RepeatDialog\n09 - TraceAndLog\n10 - EditActions\n11 - ReplaceDialog\n12 - EmitEvent\n") - .Send("08") - .AssertReply("Hello, what is your name?") - .Send("luhan") - .AssertReply("Hello luhan, nice to meet you!") - .Send("hi") - .AssertReply("Hello, what is your name?") - .Send("luhan") - .AssertReply("Hello luhan, nice to meet you!") + .AssertReply(String.Format("I can show you examples on how to use actions. Enter the number next to the entity that you with to see in action.{0}01 - Actions{0}02 - EndTurn{0}03 - IfCondiftion{0}04 - EditArray, Foreach{0}05 - EndDialog{0}06 - HttpRequest{0}07 - SwitchCondition{0}08 - RepeatDialog{0}09 - TraceAndLog{0}10 - EditActions{0}11 - ReplaceDialog{0}12 - EmitEvent{0}", Environment.NewLine)).Send("08") + .AssertReply("Do you want to repeat this dialog, yes to repeat, no to end this dialog (1) Yes or (2) No") + .Send("Yes") + .AssertReply("Do you want to repeat this dialog, yes to repeat, no to end this dialog (1) Yes or (2) No") + .Send("No") .StartTestAsync(); } @@ -153,15 +142,12 @@ public async Task Actions_08TraceAndLog() { await BuildTestFlow(getFolderPath("Steps_Samples"), sendTrace: true) .SendConversationUpdate() - .AssertReply("I can show you examples on how to use actions. Enter the number next to the entity that you with to see in action.\n01 - Actions\n02 - EndTurn\n03 - IfCondiftion\n04 - EditArray, Foreach\n05 - EndDialog\n06 - HttpRequest\n07 - SwitchCondition\n08 - RepeatDialog\n09 - TraceAndLog\n10 - EditActions\n11 - ReplaceDialog\n12 - EmitEvent\n") - .Send("09") - .AssertReply("Hello, what is your name?") - .Send("luhan") + .AssertReply(String.Format("I can show you examples on how to use actions. Enter the number next to the entity that you with to see in action.{0}01 - Actions{0}02 - EndTurn{0}03 - IfCondiftion{0}04 - EditArray, Foreach{0}05 - EndDialog{0}06 - HttpRequest{0}07 - SwitchCondition{0}08 - RepeatDialog{0}09 - TraceAndLog{0}10 - EditActions{0}11 - ReplaceDialog{0}12 - EmitEvent{0}", Environment.NewLine)).Send("09") + .Send("luhan") .AssertReply(activity => { var trace = (Activity)activity; Assert.AreEqual(ActivityTypes.Trace, trace.Type, "should be trace activity"); - Assert.AreEqual("memory", trace.ValueType, "value type should be memory"); }) .StartTestAsync(); } @@ -171,8 +157,7 @@ public async Task Actions_09EditActions() { await BuildTestFlow(getFolderPath("Steps_Samples")) .SendConversationUpdate() - .AssertReply("I can show you examples on how to use actions. Enter the number next to the entity that you with to see in action.\n01 - Actions\n02 - EndTurn\n03 - IfCondiftion\n04 - EditArray, Foreach\n05 - EndDialog\n06 - HttpRequest\n07 - SwitchCondition\n08 - RepeatDialog\n09 - TraceAndLog\n10 - EditActions\n11 - ReplaceDialog\n12 - EmitEvent\n") - .Send("10") + .AssertReply(String.Format("I can show you examples on how to use actions. Enter the number next to the entity that you with to see in action.{0}01 - Actions{0}02 - EndTurn{0}03 - IfCondiftion{0}04 - EditArray, Foreach{0}05 - EndDialog{0}06 - HttpRequest{0}07 - SwitchCondition{0}08 - RepeatDialog{0}09 - TraceAndLog{0}10 - EditActions{0}11 - ReplaceDialog{0}12 - EmitEvent{0}", Environment.NewLine)).Send("10") .AssertReply("Hello, I'm Zoidberg. What is your name?") .Send("luhan") .AssertReply("Hello luhan, nice to talk to you!") @@ -185,11 +170,10 @@ public async Task Actions_10ReplaceDialog() { await BuildTestFlow(getFolderPath("Steps_Samples")) .SendConversationUpdate() - .AssertReply("I can show you examples on how to use actions. Enter the number next to the entity that you with to see in action.\n01 - Actions\n02 - EndTurn\n03 - IfCondiftion\n04 - EditArray, Foreach\n05 - EndDialog\n06 - HttpRequest\n07 - SwitchCondition\n08 - RepeatDialog\n09 - TraceAndLog\n10 - EditActions\n11 - ReplaceDialog\n12 - EmitEvent\n") - .Send("11") + .AssertReply(String.Format("I can show you examples on how to use actions. Enter the number next to the entity that you with to see in action.{0}01 - Actions{0}02 - EndTurn{0}03 - IfCondiftion{0}04 - EditArray, Foreach{0}05 - EndDialog{0}06 - HttpRequest{0}07 - SwitchCondition{0}08 - RepeatDialog{0}09 - TraceAndLog{0}10 - EditActions{0}11 - ReplaceDialog{0}12 - EmitEvent{0}", Environment.NewLine)).Send("11") .AssertReply("Hello, I'm Zoidberg. What is your name?") .Send("luhan") - .AssertReply("Hello luhan, nice to talk to you!") + .AssertReply("Hello luhan, nice to talk to you! Please either enter 'joke' or 'fortune' to replace the dialog you want.") .Send("joke") .AssertReply("Why did the chicken cross the road?") .Send("Why?") @@ -206,8 +190,7 @@ public async Task Actions_11EmitEvent() { await BuildTestFlow(getFolderPath("Steps_Samples")) .SendConversationUpdate() - .AssertReply("I can show you examples on how to use actions. Enter the number next to the entity that you with to see in action.\n01 - Actions\n02 - EndTurn\n03 - IfCondiftion\n04 - EditArray, Foreach\n05 - EndDialog\n06 - HttpRequest\n07 - SwitchCondition\n08 - RepeatDialog\n09 - TraceAndLog\n10 - EditActions\n11 - ReplaceDialog\n12 - EmitEvent\n") - .Send("12") + .AssertReply(String.Format("I can show you examples on how to use actions. Enter the number next to the entity that you with to see in action.{0}01 - Actions{0}02 - EndTurn{0}03 - IfCondiftion{0}04 - EditArray, Foreach{0}05 - EndDialog{0}06 - HttpRequest{0}07 - SwitchCondition{0}08 - RepeatDialog{0}09 - TraceAndLog{0}10 - EditActions{0}11 - ReplaceDialog{0}12 - EmitEvent{0}", Environment.NewLine)).Send("12") .AssertReply("Say moo to get a response, say emit to emit a event.") .Send("moo") .AssertReply("Yippee ki-yay!") @@ -228,12 +211,13 @@ private TestFlow BuildTestFlow(string folderPath, bool sendTrace = false) adapter .UseStorage(storage) .UseState(userState, convoState) - .UseLanguageGeneration(resourceExplorer) + .UseAdaptiveDialogs() + .UseLanguageGeneration(resourceExplorer, "common.lg") .UseResourceExplorer(resourceExplorer) .Use(new TranscriptLoggerMiddleware(new FileTranscriptLogger())); var resource = resourceExplorer.GetResource("Main.dialog"); - var dialog = DeclarativeTypeLoader.Load(resource, resourceExplorer, DebugSupport.SourceRegistry); + var dialog = DeclarativeTypeLoader.Load(resource, resourceExplorer, DebugSupport.SourceMap); DialogManager dm = new DialogManager(dialog); return new TestFlow(adapter, async (turnContext, cancellationToken) => diff --git a/BotProject/CSharp/Tests/ControllingConversationTests.cs b/BotProject/CSharp/Tests/ControllingConversationTests.cs index 324952b1b6..e5e273f546 100644 --- a/BotProject/CSharp/Tests/ControllingConversationTests.cs +++ b/BotProject/CSharp/Tests/ControllingConversationTests.cs @@ -6,7 +6,8 @@ using Microsoft.Bot.Builder.Dialogs.Declarative; using Microsoft.Bot.Builder.Dialogs.Declarative.Resources; using Microsoft.Bot.Builder.Dialogs.Declarative.Types; -using Microsoft.Bot.Builder.TestBot.Json; +using Microsoft.Bot.Builder.LanguageGeneration; +using Microsoft.Bot.Builder.ComposerBot.json; using Microsoft.Bot.Schema; using Microsoft.Extensions.Configuration; using Microsoft.VisualStudio.TestTools.UnitTesting; @@ -31,7 +32,6 @@ public class ControllingConversationTests public static void ClassInitialize(TestContext context) { TypeFactory.Configuration = new ConfigurationBuilder().AddInMemoryCollection().Build(); - TypeFactory.RegisterAdaptiveTypes(); string path = Path.GetFullPath(Path.Combine(Environment.CurrentDirectory, samplesDirectory, "ControllingConversation")); resourceExplorer.AddFolder(path); } @@ -49,7 +49,7 @@ public async Task ControllingConversationBotTest() { await BuildTestFlow() .SendConversationUpdate() - .AssertReply("Welcome to BFD controlling conversation flow. You can choose one of the following branching options to try:\n01 - IfCondition\n02 - SwitchCondition\n03 - ForeachStep\n04 - ForeachPageStep\n05 - Cancel\n06 - Endturn\n07 - RepeatDialog\nYou can also type \"Cancel\" to cancel any dialog or \"Endturn\" to explicitly accept an input.\n") + .AssertReply(String.Format("Welcome to the Controlling Conversation sample. Choose from the list below to try.{0}You can also type \"Cancel\" to cancel any dialog or \"Endturn\" to explicitly accept an input.", Environment.NewLine)) .Send("01") .AssertReply("Hello, What's your age?") .Send("18") @@ -92,12 +92,13 @@ private TestFlow BuildTestFlow(bool sendTrace = false) adapter .UseStorage(storage) .UseState(userState, convoState) - .UseLanguageGeneration(resourceExplorer) + .UseAdaptiveDialogs() + .UseLanguageGeneration(resourceExplorer, "common.lg") .UseResourceExplorer(resourceExplorer) .Use(new TranscriptLoggerMiddleware(new FileTranscriptLogger())); var resource = resourceExplorer.GetResource("Main.dialog"); - var dialog = DeclarativeTypeLoader.Load(resource, resourceExplorer, DebugSupport.SourceRegistry); + var dialog = DeclarativeTypeLoader.Load(resource, resourceExplorer, DebugSupport.SourceMap); DialogManager dm = new DialogManager(dialog); return new TestFlow(adapter, async (turnContext, cancellationToken) => diff --git a/BotProject/CSharp/Tests/InputsTests.cs b/BotProject/CSharp/Tests/InputsTests.cs index 60266ed97f..4c586c8380 100644 --- a/BotProject/CSharp/Tests/InputsTests.cs +++ b/BotProject/CSharp/Tests/InputsTests.cs @@ -6,7 +6,8 @@ using Microsoft.Bot.Builder.Dialogs.Declarative; using Microsoft.Bot.Builder.Dialogs.Declarative.Resources; using Microsoft.Bot.Builder.Dialogs.Declarative.Types; -using Microsoft.Bot.Builder.TestBot.Json; +using Microsoft.Bot.Builder.LanguageGeneration; +using Microsoft.Bot.Builder.ComposerBot.json; using Microsoft.Bot.Schema; using Microsoft.Extensions.Configuration; using Microsoft.VisualStudio.TestTools.UnitTesting; @@ -31,7 +32,6 @@ public class InputsTests public static void ClassInitialize(TestContext context) { TypeFactory.Configuration = new ConfigurationBuilder().AddInMemoryCollection().Build(); - TypeFactory.RegisterAdaptiveTypes(); string path = Path.GetFullPath(Path.Combine(Environment.CurrentDirectory, samplesDirectory, "Inputs_Samples")); resourceExplorer.AddFolder(path); } @@ -49,12 +49,11 @@ public async Task Inputs_01TextInput() { await BuildTestFlow() .SendConversationUpdate() - .AssertReply("Welcome to Input Sample Bot.\nI can show you examples on how to use actions, You can enter number 01-04\n01 - TextInput\n02 - NumberInput\n03 - ConfirmInput\n04 - ChoiceInput\n05 - AttachmentInput\n06 - DateTimeInput\n07 - OAuthInput\n") + .AssertReply(String.Format("Welcome to Input Sample Bot.{0}I can show you examples on how to use actions, You can enter number 01-04{0}01 - TextInput{0}02 - NumberInput{0}03 - ConfirmInput{0}04 - ChoiceInput{0}05 - AttachmentInput{0}06 - DateTimeInput{0}07 - OAuthInput{0}", Environment.NewLine)) .Send("01") - .AssertReply("Hello, I'm Zoidberg. What is your name?") + .AssertReply("Hello, I'm Zoidberg. What is your name? (This can't be interrupted)") .Send("02") .AssertReply("Hello 02, nice to talk to you!") - .AssertReply("Hello, I'm Zoidberg. What is your name?") .Send("02") .AssertReply("What is your age?") .StartTestAsync(); @@ -65,7 +64,7 @@ public async Task Inputs_02NumberInput() { await BuildTestFlow() .SendConversationUpdate() - .AssertReply("Welcome to Input Sample Bot.\nI can show you examples on how to use actions, You can enter number 01-04\n01 - TextInput\n02 - NumberInput\n03 - ConfirmInput\n04 - ChoiceInput\n05 - AttachmentInput\n06 - DateTimeInput\n07 - OAuthInput\n") + .AssertReply(String.Format("Welcome to Input Sample Bot.{0}I can show you examples on how to use actions, You can enter number 01-04{0}01 - TextInput{0}02 - NumberInput{0}03 - ConfirmInput{0}04 - ChoiceInput{0}05 - AttachmentInput{0}06 - DateTimeInput{0}07 - OAuthInput{0}", Environment.NewLine)) .Send("02") .AssertReply("What is your age?") .Send("18") @@ -81,16 +80,13 @@ public async Task Inputs_03ConfirmInput() { await BuildTestFlow() .SendConversationUpdate() - .AssertReply("Welcome to Input Sample Bot.\nI can show you examples on how to use actions, You can enter number 01-04\n01 - TextInput\n02 - NumberInput\n03 - ConfirmInput\n04 - ChoiceInput\n05 - AttachmentInput\n06 - DateTimeInput\n07 - OAuthInput\n") + .AssertReply(String.Format("Welcome to Input Sample Bot.{0}I can show you examples on how to use actions, You can enter number 01-04{0}01 - TextInput{0}02 - NumberInput{0}03 - ConfirmInput{0}04 - ChoiceInput{0}05 - AttachmentInput{0}06 - DateTimeInput{0}07 - OAuthInput{0}", Environment.NewLine)) .Send("03") .AssertReply("yes or no (1) Yes or (2) No") .Send("asdasd") .AssertReply("I need a yes or no. (1) Yes or (2) No") .Send("yes") .AssertReply("confirmation: True") - .AssertReply("yes or no (1) Yes or (2) No") - .Send("nope") - .AssertReply("confirmation: False") .StartTestAsync(); } @@ -99,8 +95,7 @@ public async Task Inputs_04ChoiceInput() { await BuildTestFlow() .SendConversationUpdate() - .AssertReply("Welcome to Input Sample Bot.\nI can show you examples on how to use actions, You can enter number 01-04\n01 - TextInput\n02 - NumberInput\n03 - ConfirmInput\n04 - ChoiceInput\n05 - AttachmentInput\n06 - DateTimeInput\n07 - OAuthInput\n") - .Send("04") + .AssertReply(String.Format("Welcome to Input Sample Bot.{0}I can show you examples on how to use actions, You can enter number 01-04{0}01 - TextInput{0}02 - NumberInput{0}03 - ConfirmInput{0}04 - ChoiceInput{0}05 - AttachmentInput{0}06 - DateTimeInput{0}07 - OAuthInput{0}", Environment.NewLine)).Send("04") .AssertReply("Please select a value from below:\n\n 1. Test1\n 2. Test2\n 3. Test3") .Send("Test1") .AssertReply("You select: Test1") @@ -112,8 +107,7 @@ public async Task Inputs_06DateTimeInput() { await BuildTestFlow() .SendConversationUpdate() - .AssertReply("Welcome to Input Sample Bot.\nI can show you examples on how to use actions, You can enter number 01-04\n01 - TextInput\n02 - NumberInput\n03 - ConfirmInput\n04 - ChoiceInput\n05 - AttachmentInput\n06 - DateTimeInput\n07 - OAuthInput\n") - .Send("06") + .AssertReply(String.Format("Welcome to Input Sample Bot.{0}I can show you examples on how to use actions, You can enter number 01-04{0}01 - TextInput{0}02 - NumberInput{0}03 - ConfirmInput{0}04 - ChoiceInput{0}05 - AttachmentInput{0}06 - DateTimeInput{0}07 - OAuthInput{0}", Environment.NewLine)).Send("06") .AssertReply("Please enter a date.") .Send("June 1st") .AssertReply("You entered: 2019-06-01") @@ -130,12 +124,13 @@ private TestFlow BuildTestFlow(bool sendTrace = false) adapter .UseStorage(storage) .UseState(userState, convoState) - .UseLanguageGeneration(resourceExplorer) + .UseAdaptiveDialogs() + .UseLanguageGeneration(resourceExplorer, "common.lg") .UseResourceExplorer(resourceExplorer) .Use(new TranscriptLoggerMiddleware(new FileTranscriptLogger())); var resource = resourceExplorer.GetResource("Main.dialog"); - var dialog = DeclarativeTypeLoader.Load(resource, resourceExplorer, DebugSupport.SourceRegistry); + var dialog = DeclarativeTypeLoader.Load(resource, resourceExplorer, DebugSupport.SourceMap); DialogManager dm = new DialogManager(dialog); return new TestFlow(adapter, async (turnContext, cancellationToken) => diff --git a/BotProject/CSharp/Tests/MessageTests.cs b/BotProject/CSharp/Tests/MessageTests.cs index 8045284d82..75e1275b5a 100644 --- a/BotProject/CSharp/Tests/MessageTests.cs +++ b/BotProject/CSharp/Tests/MessageTests.cs @@ -6,7 +6,8 @@ using Microsoft.Bot.Builder.Dialogs.Declarative; using Microsoft.Bot.Builder.Dialogs.Declarative.Resources; using Microsoft.Bot.Builder.Dialogs.Declarative.Types; -using Microsoft.Bot.Builder.TestBot.Json; +using Microsoft.Bot.Builder.LanguageGeneration; +using Microsoft.Bot.Builder.ComposerBot.json; using Microsoft.Bot.Schema; using Microsoft.Extensions.Configuration; using Microsoft.VisualStudio.TestTools.UnitTesting; @@ -31,7 +32,6 @@ public class MessageTests public static void ClassInitialize(TestContext context) { TypeFactory.Configuration = new ConfigurationBuilder().AddInMemoryCollection().Build(); - TypeFactory.RegisterAdaptiveTypes(); string path = Path.GetFullPath(Path.Combine(Environment.CurrentDirectory, samplesDirectory, "Message_Samples")); resourceExplorer.AddFolder(path); } @@ -80,12 +80,13 @@ private TestFlow BuildTestFlow(bool sendTrace = false) adapter .UseStorage(storage) .UseState(userState, convoState) - .UseLanguageGeneration(resourceExplorer) + .UseAdaptiveDialogs() + .UseLanguageGeneration(resourceExplorer, "common.lg") .UseResourceExplorer(resourceExplorer) .Use(new TranscriptLoggerMiddleware(new FileTranscriptLogger())); var resource = resourceExplorer.GetResource("Main.dialog"); - var dialog = DeclarativeTypeLoader.Load(resource, resourceExplorer, DebugSupport.SourceRegistry); + var dialog = DeclarativeTypeLoader.Load(resource, resourceExplorer, DebugSupport.SourceMap); DialogManager dm = new DialogManager(dialog); return new TestFlow(adapter, async (turnContext, cancellationToken) => diff --git a/BotProject/CSharp/Tests/ToDoBotTests.cs b/BotProject/CSharp/Tests/ToDoBotTests.cs index 59ce329f9a..70bc1a11cd 100644 --- a/BotProject/CSharp/Tests/ToDoBotTests.cs +++ b/BotProject/CSharp/Tests/ToDoBotTests.cs @@ -6,7 +6,8 @@ using Microsoft.Bot.Builder.Dialogs.Declarative; using Microsoft.Bot.Builder.Dialogs.Declarative.Resources; using Microsoft.Bot.Builder.Dialogs.Declarative.Types; -using Microsoft.Bot.Builder.TestBot.Json; +using Microsoft.Bot.Builder.LanguageGeneration; +using Microsoft.Bot.Builder.ComposerBot.json; using Microsoft.Bot.Schema; using Microsoft.Extensions.Configuration; using Microsoft.VisualStudio.TestTools.UnitTesting; @@ -31,7 +32,6 @@ public class ToDoBotTests public static void ClassInitialize(TestContext context) { TypeFactory.Configuration = new ConfigurationBuilder().AddInMemoryCollection().Build(); - TypeFactory.RegisterAdaptiveTypes(); string path = Path.GetFullPath(Path.Combine(Environment.CurrentDirectory, samplesDirectory, "ToDoBot")); resourceExplorer.AddFolder(path); } @@ -59,11 +59,11 @@ await BuildTestFlow() .Send("third") .AssertReply("Successfully added a todo named third") .Send("show todos") - .AssertReply("Your most recent 3 tasks are\n* first\n* second\n* third\n") + .AssertReply(String.Format("Your most recent 3 tasks are{0}* first\n* second\n* third", Environment.NewLine)) .Send("delete todo named second") .AssertReply("Successfully removed a todo named second") .Send("show todos") - .AssertReply("Your most recent 2 tasks are\n* first\n* third\n") + .AssertReply(String.Format("Your most recent 2 tasks are{0}* first\n* third", Environment.NewLine)) .StartTestAsync(); } @@ -77,12 +77,13 @@ private TestFlow BuildTestFlow(bool sendTrace = false) adapter .UseStorage(storage) .UseState(userState, convoState) - .UseLanguageGeneration(resourceExplorer) + .UseAdaptiveDialogs() + .UseLanguageGeneration(resourceExplorer, "common.lg") .UseResourceExplorer(resourceExplorer) .Use(new TranscriptLoggerMiddleware(new FileTranscriptLogger())); var resource = resourceExplorer.GetResource("Main.dialog"); - var dialog = DeclarativeTypeLoader.Load(resource, resourceExplorer, DebugSupport.SourceRegistry); + var dialog = DeclarativeTypeLoader.Load(resource, resourceExplorer, DebugSupport.SourceMap); DialogManager dm = new DialogManager(dialog); return new TestFlow(adapter, async (turnContext, cancellationToken) => diff --git a/BotProject/Templates/CSharp/.gitignore b/BotProject/Templates/CSharp/.gitignore new file mode 100644 index 0000000000..1557a3a3b1 --- /dev/null +++ b/BotProject/Templates/CSharp/.gitignore @@ -0,0 +1,9 @@ +# NuGet Packages +*.nupkg +# The packages folder can be ignored because of Package Restore +**/[Pp]ackages/* +# except build/, which is used as an MSBuild target. +!**/[Pp]ackages/build/ + +!Properties/launchSettings.json +!packages/packages.json diff --git a/BotProject/Templates/CSharp/BotProject.csproj b/BotProject/Templates/CSharp/BotProject.csproj new file mode 100644 index 0000000000..2bd4c67c09 --- /dev/null +++ b/BotProject/Templates/CSharp/BotProject.csproj @@ -0,0 +1,33 @@ + + + netcoreapp2.1 + + + + + + + + + + Always + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/BotProject/Templates/CSharp/BotProject.sln b/BotProject/Templates/CSharp/BotProject.sln new file mode 100644 index 0000000000..db73c02cd8 --- /dev/null +++ b/BotProject/Templates/CSharp/BotProject.sln @@ -0,0 +1,31 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 15 +VisualStudioVersion = 15.0.28307.136 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BotProject", "BotProject.csproj", "{80ACF5BE-4A04-46F8-A83E-530FB21948D5}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tests", "Tests\Tests.csproj", "{5AFADEA2-A18F-46DF-8080-2CA418880318}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {80ACF5BE-4A04-46F8-A83E-530FB21948D5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {80ACF5BE-4A04-46F8-A83E-530FB21948D5}.Debug|Any CPU.Build.0 = Debug|Any CPU + {80ACF5BE-4A04-46F8-A83E-530FB21948D5}.Release|Any CPU.ActiveCfg = Release|Any CPU + {80ACF5BE-4A04-46F8-A83E-530FB21948D5}.Release|Any CPU.Build.0 = Release|Any CPU + {5AFADEA2-A18F-46DF-8080-2CA418880318}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {5AFADEA2-A18F-46DF-8080-2CA418880318}.Debug|Any CPU.Build.0 = Debug|Any CPU + {5AFADEA2-A18F-46DF-8080-2CA418880318}.Release|Any CPU.ActiveCfg = Release|Any CPU + {5AFADEA2-A18F-46DF-8080-2CA418880318}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {B13FC467-1A63-4C8F-A29E-43B2D8B79B17} + EndGlobalSection +EndGlobal diff --git a/BotProject/Templates/CSharp/BotSettings.cs b/BotProject/Templates/CSharp/BotSettings.cs new file mode 100644 index 0000000000..4074a4cdb4 --- /dev/null +++ b/BotProject/Templates/CSharp/BotSettings.cs @@ -0,0 +1,38 @@ +using Microsoft.ApplicationInsights.Extensibility; +using Microsoft.Bot.Builder.Azure; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; + +namespace Microsoft.Bot.Builder.ComposerBot.json +{ + public class BotSettings + { + public BotSettings() + { + + } + + public BlobStorageConfiguration BlobStorage { get; set; } + + public string MicrosoftAppId { get; set; } + + public string MicrosoftAppPassword { get; set; } + + public CosmosDbStorageOptions CosmosDb { get; set; } + + public TelemetryConfiguration AppInsights { get; set; } + + public class BlobStorageConfiguration + { + public BlobStorageConfiguration() + { + + } + + public string ConnectionString { get; set; } + public string Container { get; set; } + } + } +} diff --git a/BotProject/Templates/CSharp/ComposerBot.cs b/BotProject/Templates/CSharp/ComposerBot.cs new file mode 100644 index 0000000000..6fa783fd53 --- /dev/null +++ b/BotProject/Templates/CSharp/ComposerBot.cs @@ -0,0 +1,67 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading; +using System.Threading.Tasks; +using Microsoft.Bot.Builder.Dialogs; +using Microsoft.Bot.Builder.Dialogs.Adaptive; +using Microsoft.Bot.Builder.Dialogs.Debugging; +using Microsoft.Bot.Builder.Dialogs.Declarative; +using Microsoft.Bot.Builder.Dialogs.Declarative.Resources; +using Microsoft.Bot.Builder.Dialogs.Debugging; +using Microsoft.Bot.Builder.LanguageGeneration; +using Microsoft.Bot.Schema; +using Microsoft.Extensions.Configuration; +using Microsoft.Recognizers.Text; +using Newtonsoft.Json; +using Microsoft.Bot.Builder.AI.QnA; + + +namespace Microsoft.Bot.Builder.ComposerBot.json +{ + public class ComposerBot : ActivityHandler + { + private AdaptiveDialog rootDialog; + private readonly ResourceExplorer resourceExplorer; + private UserState userState; + private DialogManager dialogManager; + private ConversationState conversationState; + private IStatePropertyAccessor dialogState; + private ISourceMap sourceMap; + private string rootDialogFile { get; set; } + private IBotTelemetryClient telemetryClient; + + public ComposerBot(string rootDialogFile, ConversationState conversationState, UserState userState, ResourceExplorer resourceExplorer, ISourceMap sourceMap, IBotTelemetryClient telemetryClient) + { + this.conversationState = conversationState; + this.userState = userState; + this.dialogState = conversationState.CreateProperty("DialogState"); + this.sourceMap = sourceMap; + this.resourceExplorer = resourceExplorer; + this.rootDialogFile = rootDialogFile; + this.telemetryClient = telemetryClient; + DeclarativeTypeLoader.AddComponent(new QnAMakerComponentRegistration()); + + LoadRootDialogAsync(); + } + + private void LoadRootDialogAsync() + { + var rootFile = resourceExplorer.GetResource(rootDialogFile); + rootDialog = DeclarativeTypeLoader.Load(rootFile, resourceExplorer, sourceMap); + this.dialogManager = new DialogManager(rootDialog); + } + + public override async Task OnTurnAsync(ITurnContext turnContext, CancellationToken cancellationToken = default(CancellationToken)) + { + this.telemetryClient.TrackTrace("Activity:" + turnContext.Activity.Text, Severity.Information, null); + await this.dialogManager.OnTurnAsync(turnContext, cancellationToken: cancellationToken); + await this.conversationState.SaveChangesAsync(turnContext, false, cancellationToken); + await this.userState.SaveChangesAsync(turnContext, false, cancellationToken); + } + } +} diff --git a/BotProject/Templates/CSharp/Controllers/BotController.cs b/BotProject/Templates/CSharp/Controllers/BotController.cs new file mode 100644 index 0000000000..27593f48f9 --- /dev/null +++ b/BotProject/Templates/CSharp/Controllers/BotController.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Generated with Bot Builder V4 SDK Template for Visual Studio EchoBot v4.3.0 + +using System.Threading.Tasks; +using Microsoft.AspNetCore.Hosting; +using Microsoft.AspNetCore.Mvc; +using Microsoft.Bot.Builder; +using Microsoft.Bot.Builder.Dialogs.Debugging; +using Microsoft.Bot.Builder.Integration.AspNet.Core; + +namespace Microsoft.Bot.Builder.ComposerBot.json +{ + // This ASP Controller is created to handle a request. Dependency Injection will provide the Adapter and IBot + // implementation at runtime. Multiple different IBot implementations running at different endpoints can be + // achieved by specifying a more specific type for the bot constructor argument. + [Route("api/messages")] + [ApiController] + public class BotController : ControllerBase + { + private readonly IBotFrameworkHttpAdapter _adapter; + + private readonly IBot _bot; + + public BotController(IBotFrameworkHttpAdapter adapter, IBot bot) + { + this._adapter = adapter; + this._bot = bot; + } + + [HttpPost] + public async Task PostAsync() + { + // Delegate the processing of the HTTP POST to the adapter. + // The adapter will invoke the bot. + await this._adapter.ProcessAsync(Request, Response, _bot); + } + } +} diff --git a/BotProject/Templates/CSharp/DeploymentTemplates/new-rg-parameters.json b/BotProject/Templates/CSharp/DeploymentTemplates/new-rg-parameters.json new file mode 100644 index 0000000000..ead3390932 --- /dev/null +++ b/BotProject/Templates/CSharp/DeploymentTemplates/new-rg-parameters.json @@ -0,0 +1,42 @@ +{ + "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "groupLocation": { + "value": "" + }, + "groupName": { + "value": "" + }, + "appId": { + "value": "" + }, + "appSecret": { + "value": "" + }, + "botId": { + "value": "" + }, + "botSku": { + "value": "" + }, + "newAppServicePlanName": { + "value": "" + }, + "newAppServicePlanSku": { + "value": { + "name": "S1", + "tier": "Standard", + "size": "S1", + "family": "S", + "capacity": 1 + } + }, + "newAppServicePlanLocation": { + "value": "" + }, + "newWebAppName": { + "value": "" + } + } +} \ No newline at end of file diff --git a/BotProject/Templates/CSharp/DeploymentTemplates/preexisting-rg-parameters.json b/BotProject/Templates/CSharp/DeploymentTemplates/preexisting-rg-parameters.json new file mode 100644 index 0000000000..b6f5114fcc --- /dev/null +++ b/BotProject/Templates/CSharp/DeploymentTemplates/preexisting-rg-parameters.json @@ -0,0 +1,39 @@ +{ + "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "appId": { + "value": "" + }, + "appSecret": { + "value": "" + }, + "botId": { + "value": "" + }, + "botSku": { + "value": "" + }, + "newAppServicePlanName": { + "value": "" + }, + "newAppServicePlanSku": { + "value": { + "name": "S1", + "tier": "Standard", + "size": "S1", + "family": "S", + "capacity": 1 + } + }, + "appServicePlanLocation": { + "value": "" + }, + "existingAppServicePlan": { + "value": "" + }, + "newWebAppName": { + "value": "" + } + } +} \ No newline at end of file diff --git a/BotProject/Templates/CSharp/DeploymentTemplates/template-with-new-rg.json b/BotProject/Templates/CSharp/DeploymentTemplates/template-with-new-rg.json new file mode 100644 index 0000000000..06b8284158 --- /dev/null +++ b/BotProject/Templates/CSharp/DeploymentTemplates/template-with-new-rg.json @@ -0,0 +1,183 @@ +{ + "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "groupLocation": { + "type": "string", + "metadata": { + "description": "Specifies the location of the Resource Group." + } + }, + "groupName": { + "type": "string", + "metadata": { + "description": "Specifies the name of the Resource Group." + } + }, + "appId": { + "type": "string", + "metadata": { + "description": "Active Directory App ID, set as MicrosoftAppId in the Web App's Application Settings." + } + }, + "appSecret": { + "type": "string", + "metadata": { + "description": "Active Directory App Password, set as MicrosoftAppPassword in the Web App's Application Settings." + } + }, + "botId": { + "type": "string", + "metadata": { + "description": "The globally unique and immutable bot ID. Also used to configure the displayName of the bot, which is mutable." + } + }, + "botSku": { + "type": "string", + "metadata": { + "description": "The pricing tier of the Bot Service Registration. Acceptable values are F0 and S1." + } + }, + "newAppServicePlanName": { + "type": "string", + "metadata": { + "description": "The name of the App Service Plan." + } + }, + "newAppServicePlanSku": { + "type": "object", + "defaultValue": { + "name": "S1", + "tier": "Standard", + "size": "S1", + "family": "S", + "capacity": 1 + }, + "metadata": { + "description": "The SKU of the App Service Plan. Defaults to Standard values." + } + }, + "newAppServicePlanLocation": { + "type": "string", + "metadata": { + "description": "The location of the App Service Plan. Defaults to \"westus\"." + } + }, + "newWebAppName": { + "type": "string", + "defaultValue": "", + "metadata": { + "description": "The globally unique name of the Web App. Defaults to the value passed in for \"botId\"." + } + } + }, + "variables": { + "appServicePlanName": "[parameters('newAppServicePlanName')]", + "resourcesLocation": "[parameters('newAppServicePlanLocation')]", + "webAppName": "[if(empty(parameters('newWebAppName')), parameters('botId'), parameters('newWebAppName'))]", + "siteHost": "[concat(variables('webAppName'), '.azurewebsites.net')]", + "botEndpoint": "[concat('https://', variables('siteHost'), '/api/messages')]" + }, + "resources": [ + { + "name": "[parameters('groupName')]", + "type": "Microsoft.Resources/resourceGroups", + "apiVersion": "2018-05-01", + "location": "[parameters('groupLocation')]", + "properties": { + } + }, + { + "type": "Microsoft.Resources/deployments", + "apiVersion": "2018-05-01", + "name": "storageDeployment", + "resourceGroup": "[parameters('groupName')]", + "dependsOn": [ + "[resourceId('Microsoft.Resources/resourceGroups/', parameters('groupName'))]" + ], + "properties": { + "mode": "Incremental", + "template": { + "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", + "parameters": {}, + "variables": {}, + "resources": [ + { + "comments": "Create a new App Service Plan", + "type": "Microsoft.Web/serverfarms", + "name": "[variables('appServicePlanName')]", + "apiVersion": "2018-02-01", + "location": "[variables('resourcesLocation')]", + "sku": "[parameters('newAppServicePlanSku')]", + "properties": { + "name": "[variables('appServicePlanName')]" + } + }, + { + "comments": "Create a Web App using the new App Service Plan", + "type": "Microsoft.Web/sites", + "apiVersion": "2015-08-01", + "location": "[variables('resourcesLocation')]", + "kind": "app", + "dependsOn": [ + "[resourceId('Microsoft.Web/serverfarms/', variables('appServicePlanName'))]" + ], + "name": "[variables('webAppName')]", + "properties": { + "name": "[variables('webAppName')]", + "serverFarmId": "[variables('appServicePlanName')]", + "siteConfig": { + "appSettings": [ + { + "name": "WEBSITE_NODE_DEFAULT_VERSION", + "value": "10.14.1" + }, + { + "name": "MicrosoftAppId", + "value": "[parameters('appId')]" + }, + { + "name": "MicrosoftAppPassword", + "value": "[parameters('appSecret')]" + } + ], + "cors": { + "allowedOrigins": [ + "https://botservice.hosting.portal.azure.net", + "https://hosting.onecloud.azure-test.net/" + ] + } + } + } + }, + { + "apiVersion": "2017-12-01", + "type": "Microsoft.BotService/botServices", + "name": "[parameters('botId')]", + "location": "global", + "kind": "bot", + "sku": { + "name": "[parameters('botSku')]" + }, + "properties": { + "name": "[parameters('botId')]", + "displayName": "[parameters('botId')]", + "endpoint": "[variables('botEndpoint')]", + "msaAppId": "[parameters('appId')]", + "developerAppInsightsApplicationId": null, + "developerAppInsightKey": null, + "publishingCredentials": null, + "storageResourceId": null + }, + "dependsOn": [ + "[resourceId('Microsoft.Web/sites/', variables('webAppName'))]" + ] + } + ], + "outputs": {} + } + } + } + ] +} \ No newline at end of file diff --git a/BotProject/Templates/CSharp/DeploymentTemplates/template-with-preexisting-rg.json b/BotProject/Templates/CSharp/DeploymentTemplates/template-with-preexisting-rg.json new file mode 100644 index 0000000000..0b2e257f48 --- /dev/null +++ b/BotProject/Templates/CSharp/DeploymentTemplates/template-with-preexisting-rg.json @@ -0,0 +1,300 @@ +{ + "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "name": { + "type": "string", + "defaultValue": "[resourceGroup().name]" + }, + "appId": { + "type": "string", + "metadata": { + "description": "Active Directory App ID, set as MicrosoftAppId in the Web App's Application Settings." + } + }, + "appSecret": { + "type": "string", + "metadata": { + "description": "Active Directory App Password, set as MicrosoftAppPassword in the Web App's Application Settings. Defaults to \"\"." + } + }, + "useCosmosDb": { + "type": "bool", + "defaultValue": true + }, + "cosmosDbName": { + "type": "string", + "defaultValue": "[resourceGroup().name]" + }, + "botId": { + "type": "string", + "metadata": { + "description": "The globally unique and immutable bot ID. Also used to configure the displayName of the bot, which is mutable." + } + }, + "botSku": { + "defaultValue": "F0", + "type": "string", + "metadata": { + "description": "The pricing tier of the Bot Service Registration. Acceptable values are F0 and S1." + } + }, + "newAppServicePlanName": { + "type": "string", + "defaultValue": "[resourceGroup().name]", + "metadata": { + "description": "The name of the new App Service Plan." + } + }, + "newAppServicePlanSku": { + "type": "object", + "defaultValue": { + "name": "S1", + "tier": "Standard", + "size": "S1", + "family": "S", + "capacity": 1 + }, + "metadata": { + "description": "The SKU of the App Service Plan. Defaults to Standard values." + } + }, + "appServicePlanLocation": { + "type": "string", + "metadata": { + "description": "The location of the App Service Plan." + } + }, + "existingAppServicePlan": { + "type": "string", + "defaultValue": "", + "metadata": { + "description": "Name of the existing App Service Plan used to create the Web App for the bot." + } + }, + "newWebAppName": { + "type": "string", + "defaultValue": "[resourceGroup().name]", + "metadata": { + "description": "The globally unique name of the Web App. Defaults to the value passed in for \"botId\"." + } + }, + "appInsightsName": { + "type": "string", + "defaultValue": "[resourceGroup().name]" + }, + "location": { + "type": "string", + "defaultValue": "[resourceGroup().location]" + }, + "appInsightsLocation": { + "type": "string", + "defaultValue": "[resourceGroup().location]" + }, + "useStorage": { + "type": "bool", + "defaultValue": true + }, + "storageAccountName": { + "type": "string", + "defaultValue": "[resourceGroup().name]" + }, + "luisServiceName": { + "type": "string", + "defaultValue": "[concat(resourceGroup().name, '-luis')]" + }, + "luisServiceAuthoringSku": { + "type": "string", + "defaultValue": "F0" + }, + "luisServiceRunTimeSku": { + "type": "string", + "defaultValue": "S0" + }, + "luisServiceLocation": { + "type": "string", + "defaultValue": "[resourceGroup().location]" + } + }, + "variables": { + "defaultAppServicePlanName": "[if(empty(parameters('existingAppServicePlan')), 'createNewAppServicePlan', parameters('existingAppServicePlan'))]", + "useExistingAppServicePlan": "[not(equals(variables('defaultAppServicePlanName'), 'createNewAppServicePlan'))]", + "servicePlanName": "[if(variables('useExistingAppServicePlan'), parameters('existingAppServicePlan'), parameters('newAppServicePlanName'))]", + "resourcesLocation": "[parameters('appServicePlanLocation')]", + "cosmosDbAccountName": "[toLower(take(replace(parameters('cosmosDbName'), '_', ''), 31))]", + "webAppName": "[if(empty(parameters('newWebAppName')), parameters('botId'), parameters('newWebAppName'))]", + "siteHost": "[concat(variables('webAppName'), '.azurewebsites.net')]", + "botEndpoint": "[concat('https://', variables('siteHost'), '/api/messages')]", + "storageAccountName": "[toLower(take(replace(replace(parameters('storageAccountName'), '-', ''), '_', ''), 24))]", + "LuisAuthoringAccountName": "[concat(parameters('luisServiceName'), '-Authoring')]" + }, + "resources": [ + { + "comments": "Create a new App Service Plan if no existing App Service Plan name was passed in.", + "type": "Microsoft.Web/serverfarms", + "condition": "[not(variables('useExistingAppServicePlan'))]", + "name": "[variables('servicePlanName')]", + "apiVersion": "2018-02-01", + "location": "[variables('resourcesLocation')]", + "sku": "[parameters('newAppServicePlanSku')]", + "properties": { + "name": "[variables('servicePlanName')]" + } + }, + { + "comments": "Create a Web App using an App Service Plan", + "type": "Microsoft.Web/sites", + "apiVersion": "2015-08-01", + "location": "[variables('resourcesLocation')]", + "kind": "app", + "dependsOn": [ + "[resourceId('Microsoft.Web/serverfarms/', variables('servicePlanName'))]" + ], + "name": "[variables('webAppName')]", + "properties": { + "name": "[variables('webAppName')]", + "serverFarmId": "[variables('servicePlanName')]", + "siteConfig": { + "appSettings": [ + { + "name": "WEBSITE_NODE_DEFAULT_VERSION", + "value": "10.14.1" + }, + { + "name": "MicrosoftAppId", + "value": "[parameters('appId')]" + }, + { + "name": "MicrosoftAppPassword", + "value": "[parameters('appSecret')]" + } + ], + "cors": { + "allowedOrigins": [ + "https://botservice.hosting.portal.azure.net", + "https://hosting.onecloud.azure-test.net/" + ] + } + } + } + }, + { + "comments": "CosmosDB for bot state.", + "type": "Microsoft.DocumentDB/databaseAccounts", + "kind": "GlobalDocumentDB", + "apiVersion": "2015-04-08", + "name": "[variables('cosmosDbAccountName')]", + "location": "[parameters('location')]", + "properties": { + "databaseAccountOfferType": "Standard", + "locations": [ + { + "locationName": "[parameters('location')]", + "failoverPriority": 0 + } + ] + }, + "condition": "[parameters('useCosmosDb')]" + }, + { + "apiVersion": "2017-12-01", + "type": "Microsoft.BotService/botServices", + "name": "[parameters('botId')]", + "location": "global", + "kind": "bot", + "sku": { + "name": "[parameters('botSku')]" + }, + "properties": { + "name": "[parameters('botId')]", + "displayName": "[parameters('botId')]", + "endpoint": "[variables('botEndpoint')]", + "msaAppId": "[parameters('appId')]", + "developerAppInsightsApplicationId": null, + "developerAppInsightKey": null, + "publishingCredentials": null, + "storageResourceId": null + }, + "dependsOn": [ + "[resourceId('Microsoft.Web/sites/', variables('webAppName'))]" + ] + }, + { + "comments": "app insights", + "type": "Microsoft.Insights/components", + "kind": "web", + "apiVersion": "2015-05-01", + "name": "[parameters('appInsightsName')]", + "location": "[parameters('appInsightsLocation')]", + "properties": { + "Application_Type": "web" + } + }, + { + "comments": "storage account", + "type": "Microsoft.Storage/storageAccounts", + "kind": "StorageV2", + "apiVersion": "2018-07-01", + "name": "[variables('storageAccountName')]", + "location": "[parameters('location')]", + "sku": { + "name": "Standard_LRS" + }, + "condition": "[parameters('useStorage')]" + }, + { + "comments": "Cognitive service authoring key for all LUIS apps.", + "apiVersion": "2017-04-18", + "name": "[variables('LuisAuthoringAccountName')]", + "location": "[parameters('luisServiceLocation')]", + "type": "Microsoft.CognitiveServices/accounts", + "kind": "LUIS.Authoring", + "sku": { + "name": "[parameters('luisServiceAuthoringSku')]" + } + }, + { + "comments": "Cognitive service endpoint key for all LUIS apps.", + "type": "Microsoft.CognitiveServices/accounts", + "kind": "LUIS", + "apiVersion": "2017-04-18", + "name": "[parameters('luisServiceName')]", + "location": "[parameters('luisServiceLocation')]", + "sku": { + "name": "[parameters('luisServiceRunTimeSku')]" + } + } + ], + "outputs": { + "ApplicationInsights": { + "type": "object", + "value": { + "InstrumentationKey": "[reference(resourceId('Microsoft.Insights/components', parameters('appInsightsName'))).InstrumentationKey]" + } + }, + "cosmosDb": { + "type": "object", + "value": { + "cosmosDBEndpoint": "[if(parameters('useCosmosDb'), reference(resourceId('Microsoft.DocumentDB/databaseAccounts', variables('cosmosDbAccountName'))).documentEndpoint, '')]", + "authKey": "[if(parameters('useCosmosDb'), listKeys(resourceId('Microsoft.DocumentDB/databaseAccounts', variables('cosmosDbAccountName')), '2015-04-08').primaryMasterKey, '')]", + "databaseId": "botstate-db", + "collectionId": "botstate-collection" + } + }, + "blobStorage": { + "type": "object", + "value": { + "connectionString": "[if(parameters('useStorage'), concat('DefaultEndpointsProtocol=https;AccountName=', variables('storageAccountName'), ';AccountKey=', listKeys(resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName')), '2018-07-01').keys[0].value, ';EndpointSuffix=core.windows.net'), '')]", + "container": "transcripts" + } + }, + "luis": { + "type": "object", + "value": { + "endpointKey": "[listKeys(resourceId('Microsoft.CognitiveServices/accounts', parameters('luisServiceName')),'2017-04-18').key1]", + "authoringKey": "[listKeys(resourceId('Microsoft.CognitiveServices/accounts', variables('LuisAuthoringAccountName')),'2017-04-18').key1]", + "region": "[parameters('luisServiceLocation')]" + } + } + } +} \ No newline at end of file diff --git a/BotProject/Templates/CSharp/LuisConfig.cs b/BotProject/Templates/CSharp/LuisConfig.cs new file mode 100644 index 0000000000..290d00b0ce --- /dev/null +++ b/BotProject/Templates/CSharp/LuisConfig.cs @@ -0,0 +1,47 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; + +namespace Microsoft.Bot.Builder.ComposerBot.json +{ + public class LuisCustomConfig + { + public Dictionary Luis { get; set; } + } + + public class LuisKey + { + public string Key { get; set; } + } + + public class LuConfigFile + { + public string Name { get; set; } + + public string DefaultLanguage { get; set; } + + public List Models { get; set; } + + public string AuthoringKey { get; set; } + + public bool Dialogs { get; set; } + + public string Environment { get; set; } + + public bool Autodelete { get; set; } + + public string AuthoringRegion { get; set; } + + public string Folder { get; set; } + + public bool Help { get; set; } + + public bool Force { get; set; } + + public string Config { get; set; } + + public string EndpointKeys { get; set; } + } + +} diff --git a/BotProject/Templates/CSharp/NuGet.Config b/BotProject/Templates/CSharp/NuGet.Config new file mode 100644 index 0000000000..11ff1952c1 --- /dev/null +++ b/BotProject/Templates/CSharp/NuGet.Config @@ -0,0 +1,7 @@ + + + + + + + diff --git a/BotProject/Templates/CSharp/Program.cs b/BotProject/Templates/CSharp/Program.cs new file mode 100644 index 0000000000..31f74f0583 --- /dev/null +++ b/BotProject/Templates/CSharp/Program.cs @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using Microsoft.AspNetCore; +using Microsoft.AspNetCore.Hosting; +using Microsoft.Extensions.Configuration; +using System; +using System.IO; + +namespace Microsoft.Bot.Builder.ComposerBot.json +{ + public class Program + { + public static void Main(string[] args) + { + BuildWebHost(args).Run(); + } + + public static IWebHost BuildWebHost(string[] args) => + WebHost.CreateDefaultBuilder(args) + .ConfigureAppConfiguration((hostingContext, config) => + { + var env = hostingContext.HostingEnvironment; + var luisAuthoringRegion = Environment.GetEnvironmentVariable("LUIS_AUTHORING_REGION") ?? "westus"; + config + .AddJsonFile("appsettings.json", optional: true, reloadOnChange: true) + .AddJsonFile($"appsettings.{env.EnvironmentName}.json", optional: true, reloadOnChange: true) + .AddJsonFile($"luis.settings.{env.EnvironmentName}.{luisAuthoringRegion}.json", optional: true, reloadOnChange: true) + .AddJsonFile($"luis.settings.{Environment.UserName}.{luisAuthoringRegion}.json", optional: true, reloadOnChange: true); + + if (env.IsDevelopment()) + { + config.AddUserSecrets(); + } + + config + .AddEnvironmentVariables() + .AddCommandLine(args); + + }).UseStartup() + .Build(); + } +} diff --git a/BotProject/Templates/CSharp/Properties/launchSettings.json b/BotProject/Templates/CSharp/Properties/launchSettings.json new file mode 100644 index 0000000000..bc05ba6986 --- /dev/null +++ b/BotProject/Templates/CSharp/Properties/launchSettings.json @@ -0,0 +1,27 @@ +{ + "iisSettings": { + "windowsAuthentication": false, + "anonymousAuthentication": true, + "iisExpress": { + "applicationUrl": "http://localhost:3979/", + "sslPort": 0 + } + }, + "profiles": { + "IIS Express": { + "commandName": "IISExpress", + "launchBrowser": true, + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + }, + "BotProject": { + "commandName": "Project", + "launchBrowser": true, + "applicationUrl": "http://localhost:3979", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + } + } +} \ No newline at end of file diff --git a/BotProject/Templates/CSharp/README.md b/BotProject/Templates/CSharp/README.md new file mode 100644 index 0000000000..9326104c3e --- /dev/null +++ b/BotProject/Templates/CSharp/README.md @@ -0,0 +1,55 @@ +## Bot Project +Bot project is the launcher project for the bots written in declarative form (JSON), using the Composer, for the Bot Framework SDK. They follow pattern defined in [OBI](https://github.com/Microsoft/botframework-obi) format. + +## Instructions for setting up the Bot Project runtime +The Bot Project is a regular Bot Framework SDK V4 project. Before you can launch it from the emulator, you need to make sure you can run the bot. + +### Prerequisite: +* Install .Netcore 2 + +### Commands: + +* from root folder +* cd BotProject +* cd CSharp +* dotnet restore // for the package updates +* dotnet build // build +* dotnet run // start the bot +* It will start a web server and listening at http://localhost:3979. + +### Test bot +* You can set you emulator to connect to http://localhost:3979/api/messages. + +### config your bot +This setup is required for local testing of your Bot Runtime. +* The only thing you need to config is appsetting.json, which has a bot setting to launch the bot: + +``` +appsettings.json: +"bot": { + "provider": "localDisk", + "path": "../../Bots/SampleBot3/bot3.botproj" +} +``` + +## .botproj folder structure +``` +bot.botproj, bot project got the rootDialog from "entry" +{ + "services": [{ + "type": "luis", + "id": "1", + "name": "TodoBotLuis", + "lufile": "todo.lu", + "applicationId": "TodoBotLuis.applicationId", + "endpointKey": "TodoBotLuis.endpointKey", + "endpoint": "TodoBotLuis.endpoint" + }], + "files": [ + "*.dialog", + "*.lg" + ], + "entry": "main.dialog" +} +``` +* Please refer to [Samples](https://github.com/Microsoft/BotFramework-Composer/tree/master/SampleBots) for more samples. diff --git a/BotProject/Templates/CSharp/Schemas/sdk.schema b/BotProject/Templates/CSharp/Schemas/sdk.schema new file mode 100644 index 0000000000..57a748a677 --- /dev/null +++ b/BotProject/Templates/CSharp/Schemas/sdk.schema @@ -0,0 +1,6998 @@ +{ + "$schema": "https://raw.githubusercontent.com/microsoft/botbuilder-dotnet/4.Future/schemas/component.schema", + "$id": "sdk.schema", + "type": "object", + "title": "Component types", + "description": "These are all of the types that can be created by the loader.", + "oneOf": [ + { + "title": "Microsoft.ActivityTemplate", + "description": "", + "$ref": "#/definitions/Microsoft.ActivityTemplate" + }, + { + "title": "Microsoft.AdaptiveDialog", + "description": "Flexible, data driven dialog that can adapt to the conversation.", + "$ref": "#/definitions/Microsoft.AdaptiveDialog" + }, + { + "title": "Microsoft.AgeEntityRecognizer", + "description": "Recognizer which recognizes age.", + "$ref": "#/definitions/Microsoft.AgeEntityRecognizer" + }, + { + "title": "Microsoft.AttachmentInput", + "description": "Collect information - Ask for a file or image.", + "$ref": "#/definitions/Microsoft.AttachmentInput" + }, + { + "title": "Microsoft.BeginDialog", + "description": "Begin another dialog.", + "$ref": "#/definitions/Microsoft.BeginDialog" + }, + { + "title": "Microsoft.CancelAllDialogs", + "description": "Cancel all active dialogs. All dialogs in the dialog chain will need a trigger to capture the event configured in this action.", + "$ref": "#/definitions/Microsoft.CancelAllDialogs" + }, + { + "title": "Microsoft.ChoiceInput", + "description": "Collect information - Pick from a list of choices", + "$ref": "#/definitions/Microsoft.ChoiceInput" + }, + { + "title": "Microsoft.ConditionalSelector", + "description": "Use a rule selector based on a condition", + "$ref": "#/definitions/Microsoft.ConditionalSelector" + }, + { + "title": "Microsoft.ConfirmInput", + "description": "Collect information - Ask for confirmation (yes or no).", + "$ref": "#/definitions/Microsoft.ConfirmInput" + }, + { + "title": "Microsoft.ConfirmationEntityRecognizer", + "description": "Recognizer which recognizes confirmation choices (yes/no).", + "$ref": "#/definitions/Microsoft.ConfirmationEntityRecognizer" + }, + { + "title": "Microsoft.CurrencyEntityRecognizer", + "description": "Recognizer which recognizes currency.", + "$ref": "#/definitions/Microsoft.CurrencyEntityRecognizer" + }, + { + "title": "Microsoft.DateTimeEntityRecognizer", + "description": "Recognizer which recognizes dates and time fragments.", + "$ref": "#/definitions/Microsoft.DateTimeEntityRecognizer" + }, + { + "title": "Microsoft.DateTimeInput", + "description": "Collect information - Ask for date and/ or time", + "$ref": "#/definitions/Microsoft.DateTimeInput" + }, + { + "title": "Microsoft.DebugBreak", + "description": "If debugger is attached, stop the execution at this point in the conversation.", + "$ref": "#/definitions/Microsoft.DebugBreak" + }, + { + "title": "Microsoft.DeleteProperty", + "description": "Delete a property and any value it holds.", + "$ref": "#/definitions/Microsoft.DeleteProperty" + }, + { + "title": "Microsoft.DimensionEntityRecognizer", + "description": "Recognizer which recognizes dimension.", + "$ref": "#/definitions/Microsoft.DimensionEntityRecognizer" + }, + { + "title": "Microsoft.EditActions", + "description": "Edit the current list of actions.", + "$ref": "#/definitions/Microsoft.EditActions" + }, + { + "title": "Microsoft.EditArray", + "description": "Modify an array in memory", + "$ref": "#/definitions/Microsoft.EditArray" + }, + { + "title": "Microsoft.EmailEntityRecognizer", + "description": "Recognizer which recognizes email.", + "$ref": "#/definitions/Microsoft.EmailEntityRecognizer" + }, + { + "title": "Microsoft.EmitEvent", + "description": "Emit an event. Capture this event with a trigger.", + "$ref": "#/definitions/Microsoft.EmitEvent" + }, + { + "title": "Microsoft.EndDialog", + "description": "End this dialog.", + "$ref": "#/definitions/Microsoft.EndDialog" + }, + { + "title": "Microsoft.EndTurn", + "description": "End the current turn without ending the dialog.", + "$ref": "#/definitions/Microsoft.EndTurn" + }, + { + "title": "Microsoft.FirstSelector", + "description": "Selector for first true rule", + "$ref": "#/definitions/Microsoft.FirstSelector" + }, + { + "title": "Microsoft.Foreach", + "description": "Execute actions on each item in an a collection.", + "$ref": "#/definitions/Microsoft.Foreach" + }, + { + "title": "Microsoft.ForeachPage", + "description": "Execute actions on each page (collection of items) in an array.", + "$ref": "#/definitions/Microsoft.ForeachPage" + }, + { + "title": "Microsoft.GuidEntityRecognizer", + "description": "Recognizer which recognizes guids.", + "$ref": "#/definitions/Microsoft.GuidEntityRecognizer" + }, + { + "title": "Microsoft.HashtagEntityRecognizer", + "description": "Recognizer which recognizes Hashtags.", + "$ref": "#/definitions/Microsoft.HashtagEntityRecognizer" + }, + { + "title": "Microsoft.HttpRequest", + "description": "Make a HTTP request.", + "$ref": "#/definitions/Microsoft.HttpRequest" + }, + { + "title": "Microsoft.IfCondition", + "description": "Two-way branch the conversation flow based on a condition.", + "$ref": "#/definitions/Microsoft.IfCondition" + }, + { + "title": "Microsoft.InitProperty", + "description": "Define and initialize a property to be an array or object.", + "$ref": "#/definitions/Microsoft.InitProperty" + }, + { + "title": "Microsoft.IpEntityRecognizer", + "description": "Recognizer which recognizes internet IP patterns (like 192.1.1.1).", + "$ref": "#/definitions/Microsoft.IpEntityRecognizer" + }, + { + "title": "Microsoft.LanguagePolicy", + "description": "This represents a policy map for locales lookups to use for language", + "$ref": "#/definitions/Microsoft.LanguagePolicy" + }, + { + "title": "Microsoft.LogAction", + "description": "Log a message to the host application. Send a TraceActivity to Bot Framework Emulator (optional).", + "$ref": "#/definitions/Microsoft.LogAction" + }, + { + "title": "Microsoft.LuisRecognizer", + "description": "LUIS recognizer.", + "$ref": "#/definitions/Microsoft.LuisRecognizer" + }, + { + "title": "Microsoft.MentionEntityRecognizer", + "description": "Recognizer which recognizes @Mentions", + "$ref": "#/definitions/Microsoft.MentionEntityRecognizer" + }, + { + "title": "Microsoft.MostSpecificSelector", + "description": "Select most specific true events with optional additional selector", + "$ref": "#/definitions/Microsoft.MostSpecificSelector" + }, + { + "title": "Microsoft.MultiLanguageRecognizer", + "description": "Configure one recognizer per language and the specify the language fallback policy.", + "$ref": "#/definitions/Microsoft.MultiLanguageRecognizer" + }, + { + "title": "Microsoft.NumberEntityRecognizer", + "description": "Recognizer which recognizes numbers.", + "$ref": "#/definitions/Microsoft.NumberEntityRecognizer" + }, + { + "title": "Microsoft.NumberInput", + "description": "Collect information - Ask for a number.", + "$ref": "#/definitions/Microsoft.NumberInput" + }, + { + "title": "Microsoft.NumberRangeEntityRecognizer", + "description": "Recognizer which recognizes ranges of numbers (Example:2 to 5).", + "$ref": "#/definitions/Microsoft.NumberRangeEntityRecognizer" + }, + { + "title": "Microsoft.OAuthInput", + "description": "Collect login information.", + "$ref": "#/definitions/Microsoft.OAuthInput" + }, + { + "title": "Microsoft.OnActivity", + "description": "Actions to perform on receipt of a generic activity.", + "$ref": "#/definitions/Microsoft.OnActivity" + }, + { + "title": "Microsoft.OnBeginDialog", + "description": "Actions to perform when this dialog begins.", + "$ref": "#/definitions/Microsoft.OnBeginDialog" + }, + { + "title": "Microsoft.OnCancelDialog", + "description": "Actions to perform on cancel dialog event.", + "$ref": "#/definitions/Microsoft.OnCancelDialog" + }, + { + "title": "Microsoft.OnCondition", + "description": "Actions to perform when specified condition is true.", + "$ref": "#/definitions/Microsoft.OnCondition" + }, + { + "title": "Microsoft.OnConversationUpdateActivity", + "description": "Actions to perform on receipt of an activity with type 'ConversationUpdate'.", + "$ref": "#/definitions/Microsoft.OnConversationUpdateActivity" + }, + { + "title": "Microsoft.OnCustomEvent", + "description": "Actions to perform when a custom event is detected. Use 'Emit a custom event' action to raise a custom event.", + "$ref": "#/definitions/Microsoft.OnCustomEvent" + }, + { + "title": "Microsoft.OnDialogEvent", + "description": "Actions to perform when a specific dialog event occurs.", + "$ref": "#/definitions/Microsoft.OnDialogEvent" + }, + { + "title": "Microsoft.OnEndOfConversationActivity", + "description": "Actions to perform on receipt of an activity with type 'EndOfConversation'.", + "$ref": "#/definitions/Microsoft.OnEndOfConversationActivity" + }, + { + "title": "Microsoft.OnError", + "description": "Action to perform when an 'Error' dialog event occurs.", + "$ref": "#/definitions/Microsoft.OnError" + }, + { + "title": "Microsoft.OnEventActivity", + "description": "Actions to perform on receipt of an activity with type 'Event'.", + "$ref": "#/definitions/Microsoft.OnEventActivity" + }, + { + "title": "Microsoft.OnHandoffActivity", + "description": "Actions to perform on receipt of an activity with type 'HandOff'.", + "$ref": "#/definitions/Microsoft.OnHandoffActivity" + }, + { + "title": "Microsoft.OnIntent", + "description": "Actions to perform when specified intent is recognized.", + "$ref": "#/definitions/Microsoft.OnIntent" + }, + { + "title": "Microsoft.OnInvokeActivity", + "description": "Actions to perform on receipt of an activity with type 'Invoke'.", + "$ref": "#/definitions/Microsoft.OnInvokeActivity" + }, + { + "title": "Microsoft.OnMessageActivity", + "description": "Actions to perform on receipt of an activity with type 'Message'. Overrides Intent trigger.", + "$ref": "#/definitions/Microsoft.OnMessageActivity" + }, + { + "title": "Microsoft.OnMessageDeleteActivity", + "description": "Actions to perform on receipt of an activity with type 'MessageDelete'.", + "$ref": "#/definitions/Microsoft.OnMessageDeleteActivity" + }, + { + "title": "Microsoft.OnMessageReactionActivity", + "description": "Actions to perform on receipt of an activity with type 'MessageReaction'.", + "$ref": "#/definitions/Microsoft.OnMessageReactionActivity" + }, + { + "title": "Microsoft.OnMessageUpdateActivity", + "description": "Actions to perform on receipt of an activity with type 'MessageUpdate'.", + "$ref": "#/definitions/Microsoft.OnMessageUpdateActivity" + }, + { + "title": "Microsoft.OnRepromptDialog", + "description": "Actions to perform when 'RepromptDialog' event occurs.", + "$ref": "#/definitions/Microsoft.OnRepromptDialog" + }, + { + "title": "Microsoft.OnTypingActivity", + "description": "Actions to perform on receipt of an activity with type 'Typing'.", + "$ref": "#/definitions/Microsoft.OnTypingActivity" + }, + { + "title": "Microsoft.OnUnknownIntent", + "description": "Action to perform when user input is unrecognized and if none of the 'on intent recognition' triggers match recognized intent.", + "$ref": "#/definitions/Microsoft.OnUnknownIntent" + }, + { + "title": "Microsoft.OrdinalEntityRecognizer", + "description": "Recognizer which recognizes ordinals (example: first, second, 3rd).", + "$ref": "#/definitions/Microsoft.OrdinalEntityRecognizer" + }, + { + "title": "Microsoft.PercentageEntityRecognizer", + "description": "Recognizer which recognizes percentages.", + "$ref": "#/definitions/Microsoft.PercentageEntityRecognizer" + }, + { + "title": "Microsoft.PhoneNumberEntityRecognizer", + "description": "Recognizer which recognizes phone numbers.", + "$ref": "#/definitions/Microsoft.PhoneNumberEntityRecognizer" + }, + { + "title": "Microsoft.QnAMakerDialog", + "description": "Dialog which uses QnAMAker knowledge base to answer questions.", + "$ref": "#/definitions/Microsoft.QnAMakerDialog" + }, + { + "title": "Microsoft.RandomSelector", + "description": "Select most specific true rule", + "$ref": "#/definitions/Microsoft.RandomSelector" + }, + { + "title": "Microsoft.RegExEntityRecognizer", + "description": "Recognizer which recognizes patterns of input based on regex.", + "$ref": "#/definitions/Microsoft.RegExEntityRecognizer" + }, + { + "title": "Microsoft.RegexRecognizer", + "description": "Use regular expressions to recognize intents and entities from user input.", + "$ref": "#/definitions/Microsoft.RegexRecognizer" + }, + { + "title": "Microsoft.RepeatDialog", + "description": "Repeat current dialog.", + "$ref": "#/definitions/Microsoft.RepeatDialog" + }, + { + "title": "Microsoft.ReplaceDialog", + "description": "Replace current dialog with another dialog.", + "$ref": "#/definitions/Microsoft.ReplaceDialog" + }, + { + "title": "Microsoft.SendActivity", + "description": "Respond with an activity.", + "$ref": "#/definitions/Microsoft.SendActivity" + }, + { + "title": "Microsoft.SetProperty", + "description": "Set property to a value.", + "$ref": "#/definitions/Microsoft.SetProperty" + }, + { + "title": "Microsoft.StaticActivityTemplate", + "description": "This allows you to define a static Activity object", + "$ref": "#/definitions/Microsoft.StaticActivityTemplate" + }, + { + "title": "Microsoft.SwitchCondition", + "description": "Execute different actions based on the value of a property.", + "$ref": "#/definitions/Microsoft.SwitchCondition" + }, + { + "title": "Microsoft.TemperatureEntityRecognizer", + "description": "Recognizer which recognizes temperatures.", + "$ref": "#/definitions/Microsoft.TemperatureEntityRecognizer" + }, + { + "title": "Microsoft.TextInput", + "description": "Collection information - Ask for a word or sentence.", + "$ref": "#/definitions/Microsoft.TextInput" + }, + { + "title": "Microsoft.TextTemplate", + "description": "Lg tempalte to evaluate to create text", + "$ref": "#/definitions/Microsoft.TextTemplate" + }, + { + "title": "Microsoft.TraceActivity", + "description": "Send a trace activity to the transcript logger and/ or Bot Framework Emulator.", + "$ref": "#/definitions/Microsoft.TraceActivity" + }, + { + "title": "Microsoft.TrueSelector", + "description": "Selector for all true events", + "$ref": "#/definitions/Microsoft.TrueSelector" + }, + { + "title": "Microsoft.UrlEntityRecognizer", + "description": "Recognizer which recognizes urls (example: http://bing.com)", + "$ref": "#/definitions/Microsoft.UrlEntityRecognizer" + } + ], + "definitions": { + "Microsoft.ActivityTemplate": { + "$role": "unionType(Microsoft.IActivityTemplate)", + "title": "Microsoft ActivityTemplate", + "type": "object", + "properties": { + "$type": { + "title": "$type", + "description": "Defines the valid properties for the component you are configuring (from a dialog .schema file)", + "type": "string", + "pattern": "^[a-zA-Z][a-zA-Z0-9.]*$", + "const": "Microsoft.ActivityTemplate" + }, + "$copy": { + "title": "$copy", + "description": "Copy the definition by id from a .dialog file.", + "type": "string", + "pattern": "^(([a-zA-Z][a-zA-Z0-9.]*)?(#[a-zA-Z][a-zA-Z0-9.]*)?)$" + }, + "$id": { + "title": "$id", + "description": "Inline id for reuse of an inline definition", + "type": "string", + "pattern": "^([a-zA-Z][a-zA-Z0-9.]*)$" + }, + "$designer": { + "title": "$designer", + "type": "object", + "description": "Extra information for the Bot Framework Designer." + }, + "template": { + "title": "Template", + "Description": "Language Generator template to use to create the activity", + "type": "string" + } + }, + "additionalProperties": false, + "patternProperties": { + "^\\$": { + "type": "string" + } + }, + "anyOf": [ + { + "title": "Reference", + "required": [ + "$copy" + ] + }, + { + "title": "Type", + "required": [ + "template", + "$type" + ] + } + ] + }, + "Microsoft.AdaptiveDialog": { + "$role": "unionType(Microsoft.IDialog)", + "title": "Adaptive Dialog", + "description": "Flexible, data driven dialog that can adapt to the conversation.", + "type": "object", + "properties": { + "$type": { + "title": "$type", + "description": "Defines the valid properties for the component you are configuring (from a dialog .schema file)", + "type": "string", + "pattern": "^[a-zA-Z][a-zA-Z0-9.]*$", + "const": "Microsoft.AdaptiveDialog" + }, + "$copy": { + "title": "$copy", + "description": "Copy the definition by id from a .dialog file.", + "type": "string", + "pattern": "^(([a-zA-Z][a-zA-Z0-9.]*)?(#[a-zA-Z][a-zA-Z0-9.]*)?)$" + }, + "$id": { + "title": "$id", + "description": "Inline id for reuse of an inline definition", + "type": "string", + "pattern": "^([a-zA-Z][a-zA-Z0-9.]*)$" + }, + "$designer": { + "title": "$designer", + "type": "object", + "description": "Extra information for the Bot Framework Designer." + }, + "id": { + "type": "string", + "title": "Id", + "description": "Optional dialog ID." + }, + "autoEndDialog": { + "type": "boolean", + "title": "Auto end dialog", + "description": "If set to true the dialog will automatically end when there are no further actions. If set to false, remember to manually end the dialog using EndDialog action.", + "default": "true" + }, + "defaultResultProperty": { + "type": "string", + "title": "Default result property", + "description": "Value that will be passed back to the parent dialog.", + "default": "dialog.result" + }, + "recognizer": { + "$type": "Microsoft.IRecognizer", + "title": "Recognizer", + "description": "Language Understanding recognizer that interprets user input into intent and entities.", + "$ref": "#/definitions/Microsoft.IRecognizer" + }, + "generator": { + "$type": "Microsoft.ILanguageGenerator", + "title": "Language Generator", + "description": "Language generator that generates bot responses.", + "$ref": "#/definitions/Microsoft.ILanguageGenerator" + }, + "selector": { + "$type": "Microsoft.ITriggerSelector", + "title": "Selector", + "description": "Policy to determine which trigger is executed. Defaults to a 'best match' selector (optional).", + "$ref": "#/definitions/Microsoft.ITriggerSelector" + }, + "triggers": { + "type": "array", + "description": "List of triggers defined for this dialog.", + "title": "Triggers", + "items": { + "$type": "Microsoft.ITriggerCondition", + "$ref": "#/definitions/Microsoft.ITriggerCondition" + } + } + }, + "additionalProperties": false, + "patternProperties": { + "^\\$": { + "type": "string" + } + }, + "anyOf": [ + { + "title": "Reference", + "required": [ + "$copy" + ] + }, + { + "title": "Type", + "required": [ + "$type" + ] + } + ] + }, + "Microsoft.AgeEntityRecognizer": { + "$role": "unionType(Microsoft.EntityRecognizers)", + "title": "Age Entity Recognizer", + "description": "Recognizer which recognizes age.", + "type": "object", + "properties": { + "$type": { + "title": "$type", + "description": "Defines the valid properties for the component you are configuring (from a dialog .schema file)", + "type": "string", + "pattern": "^[a-zA-Z][a-zA-Z0-9.]*$", + "const": "Microsoft.AgeEntityRecognizer" + }, + "$copy": { + "title": "$copy", + "description": "Copy the definition by id from a .dialog file.", + "type": "string", + "pattern": "^(([a-zA-Z][a-zA-Z0-9.]*)?(#[a-zA-Z][a-zA-Z0-9.]*)?)$" + }, + "$id": { + "title": "$id", + "description": "Inline id for reuse of an inline definition", + "type": "string", + "pattern": "^([a-zA-Z][a-zA-Z0-9.]*)$" + }, + "$designer": { + "title": "$designer", + "type": "object", + "description": "Extra information for the Bot Framework Designer." + } + }, + "additionalProperties": false, + "patternProperties": { + "^\\$": { + "type": "string" + } + }, + "anyOf": [ + { + "title": "Reference", + "required": [ + "$copy" + ] + }, + { + "title": "Type", + "required": [ + "$type" + ] + } + ] + }, + "Microsoft.AttachmentInput": { + "$role": "unionType(Microsoft.IDialog)", + "title": "Attachment input dialog", + "description": "Collect information - Ask for a file or image.", + "type": "object", + "properties": { + "$type": { + "title": "$type", + "description": "Defines the valid properties for the component you are configuring (from a dialog .schema file)", + "type": "string", + "pattern": "^[a-zA-Z][a-zA-Z0-9.]*$", + "const": "Microsoft.AttachmentInput" + }, + "$copy": { + "title": "$copy", + "description": "Copy the definition by id from a .dialog file.", + "type": "string", + "pattern": "^(([a-zA-Z][a-zA-Z0-9.]*)?(#[a-zA-Z][a-zA-Z0-9.]*)?)$" + }, + "$id": { + "title": "$id", + "description": "Inline id for reuse of an inline definition", + "type": "string", + "pattern": "^([a-zA-Z][a-zA-Z0-9.]*)$" + }, + "$designer": { + "title": "$designer", + "type": "object", + "description": "Extra information for the Bot Framework Designer." + }, + "id": { + "type": "string", + "title": "Id", + "description": "Optional id for the dialog" + }, + "prompt": { + "$type": "Microsoft.IActivityTemplate", + "title": "Initial prompt", + "description": "Message to send to collect information.", + "examples": [ + "What is your birth date?" + ], + "$ref": "#/definitions/Microsoft.IActivityTemplate" + }, + "unrecognizedPrompt": { + "$type": "Microsoft.IActivityTemplate", + "title": "Unrecognized prompt", + "description": "Message to send if user response is not recognized.", + "examples": [ + "Sorry, I do not understand '{turn.activity.text'}. Let's try again. What is your birth date?" + ], + "$ref": "#/definitions/Microsoft.IActivityTemplate" + }, + "invalidPrompt": { + "$type": "Microsoft.IActivityTemplate", + "title": "Invalid prompt", + "description": "Message to send if user response is invalid. Relies on specified validation expressions.", + "examples": [ + "Sorry, '{this.value}' does not work. I need a number between 1-150. What is your age?" + ], + "$ref": "#/definitions/Microsoft.IActivityTemplate" + }, + "defaultValueResponse": { + "$type": "Microsoft.IActivityTemplate", + "title": "Default value response", + "description": "Message to send when max turn count (if specified) has been exceeded and the default value is selected as the value.", + "examples": [ + "Sorry, I'm having trouble understanding you. I will just use {this.options.defaultValue} for now. You can say 'I'm 36 years old' to change it." + ], + "$ref": "#/definitions/Microsoft.IActivityTemplate" + }, + "maxTurnCount": { + "type": "integer", + "title": "Max turn count", + "description": "Maximum number of re-prompt attempts to collect information.", + "default": 3, + "examples": [ + 3 + ] + }, + "validations": { + "type": "array", + "title": "Validation expressions", + "description": "Expression to validate user input.", + "examples": [ + "int(this.value) > 1 && int(this.value) <= 150", + "count(this.value) < 300" + ], + "items": { + "$role": "expression", + "type": "string", + "description": "String must contain an expression." + } + }, + "property": { + "$role": "expression", + "title": "Property", + "description": "Property to store collected information. Input will be skipped if property has value (unless 'Always prompt' is true).", + "examples": [ + "$birthday", + "user.name", + "conversation.issueTitle", + "dialog.favColor" + ], + "type": "string" + }, + "defaultValue": { + "$role": "expression", + "title": "Default value", + "description": "Expression to examine on each turn of the conversation as possible value to the property.", + "examples": [ + "@userName", + "coalesce(@number, @partySize)" + ], + "type": "string" + }, + "alwaysPrompt": { + "type": "boolean", + "title": "Always prompt", + "description": "Collect information even if the specified 'property' is not empty.", + "default": false, + "examples": [ + false + ] + }, + "allowInterruptions": { + "type": "string", + "title": "Allow Interruptions", + "description": "A boolean expression that determines whether the parent should be allowed to interrupt the input.", + "default": "true", + "examples": [ + "true" + ] + }, + "outputFormat": { + "type": "string", + "enum": [ + "all", + "first" + ], + "title": "Output format", + "description": "Attachment output format.", + "default": "first" + } + }, + "additionalProperties": false, + "patternProperties": { + "^\\$": { + "type": "string" + } + }, + "anyOf": [ + { + "title": "Reference", + "required": [ + "$copy" + ] + }, + { + "title": "Type", + "required": [ + "$type" + ] + } + ] + }, + "Microsoft.BeginDialog": { + "$role": "unionType(Microsoft.IDialog)", + "title": "Begin a dialog", + "description": "Begin another dialog.", + "type": "object", + "properties": { + "$type": { + "title": "$type", + "description": "Defines the valid properties for the component you are configuring (from a dialog .schema file)", + "type": "string", + "pattern": "^[a-zA-Z][a-zA-Z0-9.]*$", + "const": "Microsoft.BeginDialog" + }, + "$copy": { + "title": "$copy", + "description": "Copy the definition by id from a .dialog file.", + "type": "string", + "pattern": "^(([a-zA-Z][a-zA-Z0-9.]*)?(#[a-zA-Z][a-zA-Z0-9.]*)?)$" + }, + "$id": { + "title": "$id", + "description": "Inline id for reuse of an inline definition", + "type": "string", + "pattern": "^([a-zA-Z][a-zA-Z0-9.]*)$" + }, + "$designer": { + "title": "$designer", + "type": "object", + "description": "Extra information for the Bot Framework Designer." + }, + "dialog": { + "$type": "Microsoft.IDialog", + "title": "Dialog name", + "description": "Name of the dialog to call.", + "examples": [ + "AddToDoDialog" + ], + "$ref": "#/definitions/Microsoft.IDialog" + }, + "options": { + "type": "object", + "title": "Options", + "description": "One or more options that are passed to the dialog that is called.", + "additionalProperties": { + "type": "string", + "title": "Options" + } + }, + "resultProperty": { + "$role": "expression", + "title": "Property", + "description": "Property to store any value returned by the dialog that is called.", + "examples": [ + "dialog.userName" + ], + "type": "string" + } + }, + "additionalProperties": false, + "patternProperties": { + "^\\$": { + "type": "string" + } + }, + "anyOf": [ + { + "title": "Reference", + "required": [ + "$copy" + ] + }, + { + "title": "Type", + "required": [ + "$type" + ] + } + ] + }, + "Microsoft.CancelAllDialogs": { + "$role": "unionType(Microsoft.IDialog)", + "title": "Cancel all dialogs", + "description": "Cancel all active dialogs. All dialogs in the dialog chain will need a trigger to capture the event configured in this action.", + "type": "object", + "properties": { + "$type": { + "title": "$type", + "description": "Defines the valid properties for the component you are configuring (from a dialog .schema file)", + "type": "string", + "pattern": "^[a-zA-Z][a-zA-Z0-9.]*$", + "const": "Microsoft.CancelAllDialogs" + }, + "$copy": { + "title": "$copy", + "description": "Copy the definition by id from a .dialog file.", + "type": "string", + "pattern": "^(([a-zA-Z][a-zA-Z0-9.]*)?(#[a-zA-Z][a-zA-Z0-9.]*)?)$" + }, + "$id": { + "title": "$id", + "description": "Inline id for reuse of an inline definition", + "type": "string", + "pattern": "^([a-zA-Z][a-zA-Z0-9.]*)$" + }, + "$designer": { + "title": "$designer", + "type": "object", + "description": "Extra information for the Bot Framework Designer." + }, + "eventName": { + "title": "Event name", + "description": "Name of the event to emit.", + "type": "string" + }, + "eventValue": { + "type": "object", + "title": "Event value", + "description": "Value to emit with the event (optional).", + "additionalProperties": true + } + }, + "additionalProperties": false, + "patternProperties": { + "^\\$": { + "type": "string" + } + }, + "anyOf": [ + { + "title": "Reference", + "required": [ + "$copy" + ] + }, + { + "title": "Type", + "required": [ + "$type" + ] + } + ] + }, + "Microsoft.ChoiceInput": { + "$role": "unionType(Microsoft.IDialog)", + "title": "Choice input dialog", + "description": "Collect information - Pick from a list of choices", + "type": "object", + "properties": { + "$type": { + "title": "$type", + "description": "Defines the valid properties for the component you are configuring (from a dialog .schema file)", + "type": "string", + "pattern": "^[a-zA-Z][a-zA-Z0-9.]*$", + "const": "Microsoft.ChoiceInput" + }, + "$copy": { + "title": "$copy", + "description": "Copy the definition by id from a .dialog file.", + "type": "string", + "pattern": "^(([a-zA-Z][a-zA-Z0-9.]*)?(#[a-zA-Z][a-zA-Z0-9.]*)?)$" + }, + "$id": { + "title": "$id", + "description": "Inline id for reuse of an inline definition", + "type": "string", + "pattern": "^([a-zA-Z][a-zA-Z0-9.]*)$" + }, + "$designer": { + "title": "$designer", + "type": "object", + "description": "Extra information for the Bot Framework Designer." + }, + "id": { + "type": "string", + "title": "Id", + "description": "Optional id for the dialog" + }, + "prompt": { + "$type": "Microsoft.IActivityTemplate", + "title": "Initial prompt", + "description": "Message to send to collect information.", + "examples": [ + "What is your birth date?" + ], + "$ref": "#/definitions/Microsoft.IActivityTemplate" + }, + "unrecognizedPrompt": { + "$type": "Microsoft.IActivityTemplate", + "title": "Unrecognized prompt", + "description": "Message to send if user response is not recognized.", + "examples": [ + "Sorry, I do not understand '{turn.activity.text'}. Let's try again. What is your birth date?" + ], + "$ref": "#/definitions/Microsoft.IActivityTemplate" + }, + "invalidPrompt": { + "$type": "Microsoft.IActivityTemplate", + "title": "Invalid prompt", + "description": "Message to send if user response is invalid. Relies on specified validation expressions.", + "examples": [ + "Sorry, '{this.value}' does not work. I need a number between 1-150. What is your age?" + ], + "$ref": "#/definitions/Microsoft.IActivityTemplate" + }, + "defaultValueResponse": { + "$type": "Microsoft.IActivityTemplate", + "title": "Default value response", + "description": "Message to send when max turn count (if specified) has been exceeded and the default value is selected as the value.", + "examples": [ + "Sorry, I'm having trouble understanding you. I will just use {this.options.defaultValue} for now. You can say 'I'm 36 years old' to change it." + ], + "$ref": "#/definitions/Microsoft.IActivityTemplate" + }, + "maxTurnCount": { + "type": "integer", + "title": "Max turn count", + "description": "Maximum number of re-prompt attempts to collect information.", + "default": 3, + "examples": [ + 3 + ] + }, + "validations": { + "type": "array", + "title": "Validation expressions", + "description": "Expression to validate user input.", + "examples": [ + "int(this.value) > 1 && int(this.value) <= 150", + "count(this.value) < 300" + ], + "items": { + "$role": "expression", + "type": "string", + "description": "String must contain an expression." + } + }, + "property": { + "$role": "expression", + "title": "Property", + "description": "Property to store collected information. Input will be skipped if property has value (unless 'Always prompt' is true).", + "examples": [ + "$birthday", + "user.name", + "conversation.issueTitle", + "dialog.favColor" + ], + "type": "string" + }, + "defaultValue": { + "$role": "expression", + "title": "Default value", + "description": "Expression to examine on each turn of the conversation as possible value to the property.", + "examples": [ + "@userName", + "coalesce(@number, @partySize)" + ], + "type": "string" + }, + "alwaysPrompt": { + "type": "boolean", + "title": "Always prompt", + "description": "Collect information even if the specified 'property' is not empty.", + "default": false, + "examples": [ + false + ] + }, + "allowInterruptions": { + "type": "string", + "title": "Allow Interruptions", + "description": "A boolean expression that determines whether the parent should be allowed to interrupt the input.", + "default": "true", + "examples": [ + "true" + ] + }, + "outputFormat": { + "type": "string", + "enum": [ + "value", + "index" + ], + "title": "Output format", + "description": "Choice output format.", + "default": "value" + }, + "choices": { + "anyOf": [ + { + "$role": "expression", + "type": "string", + "description": "String must contain an expression." + }, + { + "type": "array", + "items": [ + { + "type": "string" + } + ] + }, + { + "type": "array", + "items": [ + { + "title": "Choice", + "type": "object", + "properties": { + "value": { + "type": "string", + "title": "Value", + "description": "Value to return when this choice is selected." + }, + "action": { + "type": "object", + "title": "Action", + "description": "Card action for the choice." + }, + "synonyms": { + "type": "array", + "title": "Synonyms", + "description": "List of synonyms to recognize in addition to the value (optional).", + "items": { + "type": "string" + } + } + } + } + ] + } + ] + }, + "appendChoices": { + "type": "boolean", + "title": "Append choices", + "description": "Compose an output activity containing a set of choices", + "default": "true" + }, + "defaultLocale": { + "type": "string", + "title": "Default locale", + "description": "Default locale.", + "default": "en-us" + }, + "style": { + "type": "string", + "enum": [ + "None", + "Auto", + "Inline", + "List", + "SuggestedAction", + "HeroCard" + ], + "title": "List style", + "description": "Style to render choices.", + "default": "Auto" + }, + "choiceOptions": { + "type": "object", + "properties": { + "inlineSeparator": { + "type": "string", + "title": "Inline separator", + "description": "Character used to separate individual choices when there are more than 2 choices", + "default": ", " + }, + "inlineOr": { + "type": "string", + "title": "Inline or", + "description": "Separator inserted between the choices when there are only 2 choices", + "default": " or " + }, + "inlineOrMore": { + "type": "string", + "title": "Inline or more", + "description": "Separator inserted between the last 2 choices when their are more than 2 choices.", + "default": ", or " + }, + "includeNumbers": { + "type": "boolean", + "title": "Include numbers", + "description": "If true, 'inline' and 'list' list style will be prefixed with the index of the choice.", + "default": true + } + } + }, + "recognizerOptions": { + "type": "object", + "properties": { + "noValue": { + "type": "boolean", + "title": "No value", + "description": "If true, the choices value field will NOT be search over", + "default": false + }, + "noAction": { + "type": "boolean", + "title": "No action", + "description": "If true, the the choices action.title field will NOT be searched over", + "default": false + } + } + } + }, + "additionalProperties": false, + "patternProperties": { + "^\\$": { + "type": "string" + } + }, + "anyOf": [ + { + "title": "Reference", + "required": [ + "$copy" + ] + }, + { + "title": "Type", + "required": [ + "$type" + ] + } + ] + }, + "Microsoft.ConditionalSelector": { + "$role": "unionType(Microsoft.ITriggerSelector)", + "title": "Condtional Trigger Selector", + "description": "Use a rule selector based on a condition", + "type": "object", + "properties": { + "$type": { + "title": "$type", + "description": "Defines the valid properties for the component you are configuring (from a dialog .schema file)", + "type": "string", + "pattern": "^[a-zA-Z][a-zA-Z0-9.]*$", + "const": "Microsoft.ConditionalSelector" + }, + "$copy": { + "title": "$copy", + "description": "Copy the definition by id from a .dialog file.", + "type": "string", + "pattern": "^(([a-zA-Z][a-zA-Z0-9.]*)?(#[a-zA-Z][a-zA-Z0-9.]*)?)$" + }, + "$id": { + "title": "$id", + "description": "Inline id for reuse of an inline definition", + "type": "string", + "pattern": "^([a-zA-Z][a-zA-Z0-9.]*)$" + }, + "$designer": { + "title": "$designer", + "type": "object", + "description": "Extra information for the Bot Framework Designer." + }, + "condition": { + "$role": "expression", + "type": "string", + "description": "String must contain an expression." + }, + "ifTrue": { + "$type": "Microsoft.ITriggerSelector", + "$ref": "#/definitions/Microsoft.ITriggerSelector" + }, + "ifFalse": { + "$type": "Microsoft.ITriggerSelector", + "$ref": "#/definitions/Microsoft.ITriggerSelector" + } + }, + "additionalProperties": false, + "patternProperties": { + "^\\$": { + "type": "string" + } + }, + "anyOf": [ + { + "title": "Reference", + "required": [ + "$copy" + ] + }, + { + "title": "Type", + "required": [ + "condition", + "ifTrue", + "ifFalse", + "$type" + ] + } + ] + }, + "Microsoft.ConfirmInput": { + "$role": "unionType(Microsoft.IDialog)", + "title": "Confirm input dialog", + "description": "Collect information - Ask for confirmation (yes or no).", + "type": "object", + "properties": { + "$type": { + "title": "$type", + "description": "Defines the valid properties for the component you are configuring (from a dialog .schema file)", + "type": "string", + "pattern": "^[a-zA-Z][a-zA-Z0-9.]*$", + "const": "Microsoft.ConfirmInput" + }, + "$copy": { + "title": "$copy", + "description": "Copy the definition by id from a .dialog file.", + "type": "string", + "pattern": "^(([a-zA-Z][a-zA-Z0-9.]*)?(#[a-zA-Z][a-zA-Z0-9.]*)?)$" + }, + "$id": { + "title": "$id", + "description": "Inline id for reuse of an inline definition", + "type": "string", + "pattern": "^([a-zA-Z][a-zA-Z0-9.]*)$" + }, + "$designer": { + "title": "$designer", + "type": "object", + "description": "Extra information for the Bot Framework Designer." + }, + "id": { + "type": "string", + "title": "Id", + "description": "Optional id for the dialog" + }, + "prompt": { + "$type": "Microsoft.IActivityTemplate", + "title": "Initial prompt", + "description": "Message to send to collect information.", + "examples": [ + "What is your birth date?" + ], + "$ref": "#/definitions/Microsoft.IActivityTemplate" + }, + "unrecognizedPrompt": { + "$type": "Microsoft.IActivityTemplate", + "title": "Unrecognized prompt", + "description": "Message to send if user response is not recognized.", + "examples": [ + "Sorry, I do not understand '{turn.activity.text'}. Let's try again. What is your birth date?" + ], + "$ref": "#/definitions/Microsoft.IActivityTemplate" + }, + "invalidPrompt": { + "$type": "Microsoft.IActivityTemplate", + "title": "Invalid prompt", + "description": "Message to send if user response is invalid. Relies on specified validation expressions.", + "examples": [ + "Sorry, '{this.value}' does not work. I need a number between 1-150. What is your age?" + ], + "$ref": "#/definitions/Microsoft.IActivityTemplate" + }, + "defaultValueResponse": { + "$type": "Microsoft.IActivityTemplate", + "title": "Default value response", + "description": "Message to send when max turn count (if specified) has been exceeded and the default value is selected as the value.", + "examples": [ + "Sorry, I'm having trouble understanding you. I will just use {this.options.defaultValue} for now. You can say 'I'm 36 years old' to change it." + ], + "$ref": "#/definitions/Microsoft.IActivityTemplate" + }, + "maxTurnCount": { + "type": "integer", + "title": "Max turn count", + "description": "Maximum number of re-prompt attempts to collect information.", + "default": 3, + "examples": [ + 3 + ] + }, + "validations": { + "type": "array", + "title": "Validation expressions", + "description": "Expression to validate user input.", + "examples": [ + "int(this.value) > 1 && int(this.value) <= 150", + "count(this.value) < 300" + ], + "items": { + "$role": "expression", + "type": "string", + "description": "String must contain an expression." + } + }, + "property": { + "$role": "expression", + "title": "Property", + "description": "Property to store collected information. Input will be skipped if property has value (unless 'Always prompt' is true).", + "examples": [ + "$birthday", + "user.name", + "conversation.issueTitle", + "dialog.favColor" + ], + "type": "string" + }, + "defaultValue": { + "$role": "expression", + "title": "Default value", + "description": "Expression to examine on each turn of the conversation as possible value to the property.", + "examples": [ + "@userName", + "coalesce(@number, @partySize)" + ], + "type": "string" + }, + "alwaysPrompt": { + "type": "boolean", + "title": "Always prompt", + "description": "Collect information even if the specified 'property' is not empty.", + "default": false, + "examples": [ + false + ] + }, + "allowInterruptions": { + "type": "string", + "title": "Allow Interruptions", + "description": "A boolean expression that determines whether the parent should be allowed to interrupt the input.", + "default": "true", + "examples": [ + "true" + ] + }, + "defaultLocale": { + "type": "string", + "title": "Default locale", + "description": "Default locale.", + "default": "en-us" + }, + "style": { + "type": "string", + "enum": [ + "None", + "Auto", + "Inline", + "List", + "SuggestedAction", + "HeroCard" + ], + "title": "List style", + "description": "Style to render choices.", + "default": "Auto" + }, + "choiceOptions": { + "type": "object", + "properties": { + "inlineSeparator": { + "type": "string", + "title": "Inline separator", + "description": "Character used to separate individual choices when there are more than 2 choices", + "default": ", " + }, + "inlineOr": { + "type": "string", + "title": "Inline or", + "description": "Separator inserted between the choices when their are only 2 choices", + "default": " or " + }, + "inlineOrMore": { + "type": "string", + "title": "Inline or more", + "description": "Separator inserted between the last 2 choices when their are more than 2 choices.", + "default": ", or " + }, + "includeNumbers": { + "type": "boolean", + "title": "Include numbers", + "description": "If true, inline and list style choices will be prefixed with the index of the choice.", + "default": true + } + } + }, + "confirmChoices": { + "type": "array", + "items": [ + { + "type": "object", + "properties": { + "value": { + "type": "string", + "title": "Value", + "description": "Value to return when this choice is selected." + }, + "action": { + "type": "object", + "title": "Action", + "description": "Card action for the choice" + }, + "synonyms": { + "type": "array", + "title": "Synonyms", + "description": "List of synonyms to recognize in addition to the value (optional)", + "items": { + "type": "string" + } + } + } + } + ] + } + }, + "additionalProperties": false, + "patternProperties": { + "^\\$": { + "type": "string" + } + }, + "anyOf": [ + { + "title": "Reference", + "required": [ + "$copy" + ] + }, + { + "title": "Type", + "required": [ + "$type" + ] + } + ] + }, + "Microsoft.ConfirmationEntityRecognizer": { + "$role": "unionType(Microsoft.EntityRecognizers)", + "title": "Confirmation Entity Recognizer", + "description": "Recognizer which recognizes confirmation choices (yes/no).", + "type": "object", + "properties": { + "$type": { + "title": "$type", + "description": "Defines the valid properties for the component you are configuring (from a dialog .schema file)", + "type": "string", + "pattern": "^[a-zA-Z][a-zA-Z0-9.]*$", + "const": "Microsoft.ConfirmationEntityRecognizer" + }, + "$copy": { + "title": "$copy", + "description": "Copy the definition by id from a .dialog file.", + "type": "string", + "pattern": "^(([a-zA-Z][a-zA-Z0-9.]*)?(#[a-zA-Z][a-zA-Z0-9.]*)?)$" + }, + "$id": { + "title": "$id", + "description": "Inline id for reuse of an inline definition", + "type": "string", + "pattern": "^([a-zA-Z][a-zA-Z0-9.]*)$" + }, + "$designer": { + "title": "$designer", + "type": "object", + "description": "Extra information for the Bot Framework Designer." + } + }, + "additionalProperties": false, + "patternProperties": { + "^\\$": { + "type": "string" + } + }, + "anyOf": [ + { + "title": "Reference", + "required": [ + "$copy" + ] + }, + { + "title": "Type", + "required": [ + "$type" + ] + } + ] + }, + "Microsoft.CurrencyEntityRecognizer": { + "$role": "unionType(Microsoft.EntityRecognizers)", + "title": "Currency Entity Recognizer", + "description": "Recognizer which recognizes currency.", + "type": "object", + "properties": { + "$type": { + "title": "$type", + "description": "Defines the valid properties for the component you are configuring (from a dialog .schema file)", + "type": "string", + "pattern": "^[a-zA-Z][a-zA-Z0-9.]*$", + "const": "Microsoft.CurrencyEntityRecognizer" + }, + "$copy": { + "title": "$copy", + "description": "Copy the definition by id from a .dialog file.", + "type": "string", + "pattern": "^(([a-zA-Z][a-zA-Z0-9.]*)?(#[a-zA-Z][a-zA-Z0-9.]*)?)$" + }, + "$id": { + "title": "$id", + "description": "Inline id for reuse of an inline definition", + "type": "string", + "pattern": "^([a-zA-Z][a-zA-Z0-9.]*)$" + }, + "$designer": { + "title": "$designer", + "type": "object", + "description": "Extra information for the Bot Framework Designer." + } + }, + "additionalProperties": false, + "patternProperties": { + "^\\$": { + "type": "string" + } + }, + "anyOf": [ + { + "title": "Reference", + "required": [ + "$copy" + ] + }, + { + "title": "Type", + "required": [ + "$type" + ] + } + ] + }, + "Microsoft.DateTimeEntityRecognizer": { + "$role": "unionType(Microsoft.EntityRecognizers)", + "title": "DateTime Entity Recognizer", + "description": "Recognizer which recognizes dates and time fragments.", + "type": "object", + "properties": { + "$type": { + "title": "$type", + "description": "Defines the valid properties for the component you are configuring (from a dialog .schema file)", + "type": "string", + "pattern": "^[a-zA-Z][a-zA-Z0-9.]*$", + "const": "Microsoft.DateTimeEntityRecognizer" + }, + "$copy": { + "title": "$copy", + "description": "Copy the definition by id from a .dialog file.", + "type": "string", + "pattern": "^(([a-zA-Z][a-zA-Z0-9.]*)?(#[a-zA-Z][a-zA-Z0-9.]*)?)$" + }, + "$id": { + "title": "$id", + "description": "Inline id for reuse of an inline definition", + "type": "string", + "pattern": "^([a-zA-Z][a-zA-Z0-9.]*)$" + }, + "$designer": { + "title": "$designer", + "type": "object", + "description": "Extra information for the Bot Framework Designer." + } + }, + "additionalProperties": false, + "patternProperties": { + "^\\$": { + "type": "string" + } + }, + "anyOf": [ + { + "title": "Reference", + "required": [ + "$copy" + ] + }, + { + "title": "Type", + "required": [ + "$type" + ] + } + ] + }, + "Microsoft.DateTimeInput": { + "$role": "unionType(Microsoft.IDialog)", + "title": "Date/time input dialog", + "description": "Collect information - Ask for date and/ or time", + "type": "object", + "properties": { + "$type": { + "title": "$type", + "description": "Defines the valid properties for the component you are configuring (from a dialog .schema file)", + "type": "string", + "pattern": "^[a-zA-Z][a-zA-Z0-9.]*$", + "const": "Microsoft.DateTimeInput" + }, + "$copy": { + "title": "$copy", + "description": "Copy the definition by id from a .dialog file.", + "type": "string", + "pattern": "^(([a-zA-Z][a-zA-Z0-9.]*)?(#[a-zA-Z][a-zA-Z0-9.]*)?)$" + }, + "$id": { + "title": "$id", + "description": "Inline id for reuse of an inline definition", + "type": "string", + "pattern": "^([a-zA-Z][a-zA-Z0-9.]*)$" + }, + "$designer": { + "title": "$designer", + "type": "object", + "description": "Extra information for the Bot Framework Designer." + }, + "id": { + "type": "string", + "title": "Id", + "description": "Optional id for the dialog" + }, + "prompt": { + "$type": "Microsoft.IActivityTemplate", + "title": "Initial prompt", + "description": "Message to send to collect information.", + "examples": [ + "What is your birth date?" + ], + "$ref": "#/definitions/Microsoft.IActivityTemplate" + }, + "unrecognizedPrompt": { + "$type": "Microsoft.IActivityTemplate", + "title": "Unrecognized prompt", + "description": "Message to send if user response is not recognized.", + "examples": [ + "Sorry, I do not understand '{turn.activity.text'}. Let's try again. What is your birth date?" + ], + "$ref": "#/definitions/Microsoft.IActivityTemplate" + }, + "invalidPrompt": { + "$type": "Microsoft.IActivityTemplate", + "title": "Invalid prompt", + "description": "Message to send if user response is invalid. Relies on specified validation expressions.", + "examples": [ + "Sorry, '{this.value}' does not work. I need a number between 1-150. What is your age?" + ], + "$ref": "#/definitions/Microsoft.IActivityTemplate" + }, + "defaultValueResponse": { + "$type": "Microsoft.IActivityTemplate", + "title": "Default value response", + "description": "Message to send when max turn count (if specified) has been exceeded and the default value is selected as the value.", + "examples": [ + "Sorry, I'm having trouble understanding you. I will just use {this.options.defaultValue} for now. You can say 'I'm 36 years old' to change it." + ], + "$ref": "#/definitions/Microsoft.IActivityTemplate" + }, + "maxTurnCount": { + "type": "integer", + "title": "Max turn count", + "description": "Maximum number of re-prompt attempts to collect information.", + "default": 3, + "examples": [ + 3 + ] + }, + "validations": { + "type": "array", + "title": "Validation expressions", + "description": "Expression to validate user input.", + "examples": [ + "int(this.value) > 1 && int(this.value) <= 150", + "count(this.value) < 300" + ], + "items": { + "$role": "expression", + "type": "string", + "description": "String must contain an expression." + } + }, + "property": { + "$role": "expression", + "title": "Property", + "description": "Property to store collected information. Input will be skipped if property has value (unless 'Always prompt' is true).", + "examples": [ + "$birthday", + "user.name", + "conversation.issueTitle", + "dialog.favColor" + ], + "type": "string" + }, + "defaultValue": { + "$role": "expression", + "title": "Default value", + "description": "Expression to examine on each turn of the conversation as possible value to the property.", + "examples": [ + "@userName", + "coalesce(@number, @partySize)" + ], + "type": "string" + }, + "alwaysPrompt": { + "type": "boolean", + "title": "Always prompt", + "description": "Collect information even if the specified 'property' is not empty.", + "default": false, + "examples": [ + false + ] + }, + "allowInterruptions": { + "type": "string", + "title": "Allow Interruptions", + "description": "A boolean expression that determines whether the parent should be allowed to interrupt the input.", + "default": "true", + "examples": [ + "true" + ] + }, + "defaultLocale": { + "type": "string", + "title": "Default locale", + "description": "Default locale.", + "default": "en-us" + } + }, + "additionalProperties": false, + "patternProperties": { + "^\\$": { + "type": "string" + } + }, + "anyOf": [ + { + "title": "Reference", + "required": [ + "$copy" + ] + }, + { + "title": "Type", + "required": [ + "$type" + ] + } + ] + }, + "Microsoft.DebugBreak": { + "$role": "unionType(Microsoft.IDialog)", + "title": "Debugger break", + "description": "If debugger is attached, stop the execution at this point in the conversation.", + "type": "object", + "properties": { + "$type": { + "title": "$type", + "description": "Defines the valid properties for the component you are configuring (from a dialog .schema file)", + "type": "string", + "pattern": "^[a-zA-Z][a-zA-Z0-9.]*$", + "const": "Microsoft.DebugBreak" + }, + "$copy": { + "title": "$copy", + "description": "Copy the definition by id from a .dialog file.", + "type": "string", + "pattern": "^(([a-zA-Z][a-zA-Z0-9.]*)?(#[a-zA-Z][a-zA-Z0-9.]*)?)$" + }, + "$id": { + "title": "$id", + "description": "Inline id for reuse of an inline definition", + "type": "string", + "pattern": "^([a-zA-Z][a-zA-Z0-9.]*)$" + }, + "$designer": { + "title": "$designer", + "type": "object", + "description": "Extra information for the Bot Framework Designer." + } + }, + "additionalProperties": false, + "patternProperties": { + "^\\$": { + "type": "string" + } + }, + "anyOf": [ + { + "title": "Reference", + "required": [ + "$copy" + ] + }, + { + "title": "Type", + "required": [ + "$type" + ] + } + ] + }, + "Microsoft.DeleteProperty": { + "$role": "unionType(Microsoft.IDialog)", + "title": "Delete Property", + "description": "Delete a property and any value it holds.", + "type": "object", + "properties": { + "$type": { + "title": "$type", + "description": "Defines the valid properties for the component you are configuring (from a dialog .schema file)", + "type": "string", + "pattern": "^[a-zA-Z][a-zA-Z0-9.]*$", + "const": "Microsoft.DeleteProperty" + }, + "$copy": { + "title": "$copy", + "description": "Copy the definition by id from a .dialog file.", + "type": "string", + "pattern": "^(([a-zA-Z][a-zA-Z0-9.]*)?(#[a-zA-Z][a-zA-Z0-9.]*)?)$" + }, + "$id": { + "title": "$id", + "description": "Inline id for reuse of an inline definition", + "type": "string", + "pattern": "^([a-zA-Z][a-zA-Z0-9.]*)$" + }, + "$designer": { + "title": "$designer", + "type": "object", + "description": "Extra information for the Bot Framework Designer." + }, + "property": { + "$role": "expression", + "title": "Property", + "description": "Property to delete.", + "type": "string" + } + }, + "additionalProperties": false, + "patternProperties": { + "^\\$": { + "type": "string" + } + }, + "anyOf": [ + { + "title": "Reference", + "required": [ + "$copy" + ] + }, + { + "title": "Type", + "required": [ + "property", + "$type" + ] + } + ] + }, + "Microsoft.DimensionEntityRecognizer": { + "$role": "unionType(Microsoft.EntityRecognizers)", + "title": "Dimension Entity Recognizer", + "description": "Recognizer which recognizes dimension.", + "type": "object", + "properties": { + "$type": { + "title": "$type", + "description": "Defines the valid properties for the component you are configuring (from a dialog .schema file)", + "type": "string", + "pattern": "^[a-zA-Z][a-zA-Z0-9.]*$", + "const": "Microsoft.DimensionEntityRecognizer" + }, + "$copy": { + "title": "$copy", + "description": "Copy the definition by id from a .dialog file.", + "type": "string", + "pattern": "^(([a-zA-Z][a-zA-Z0-9.]*)?(#[a-zA-Z][a-zA-Z0-9.]*)?)$" + }, + "$id": { + "title": "$id", + "description": "Inline id for reuse of an inline definition", + "type": "string", + "pattern": "^([a-zA-Z][a-zA-Z0-9.]*)$" + }, + "$designer": { + "title": "$designer", + "type": "object", + "description": "Extra information for the Bot Framework Designer." + } + }, + "additionalProperties": false, + "patternProperties": { + "^\\$": { + "type": "string" + } + }, + "anyOf": [ + { + "title": "Reference", + "required": [ + "$copy" + ] + }, + { + "title": "Type", + "required": [ + "$type" + ] + } + ] + }, + "Microsoft.EditActions": { + "$role": "unionType(Microsoft.IDialog)", + "title": "Edit actions.", + "description": "Edit the current list of actions.", + "type": "object", + "properties": { + "$type": { + "title": "$type", + "description": "Defines the valid properties for the component you are configuring (from a dialog .schema file)", + "type": "string", + "pattern": "^[a-zA-Z][a-zA-Z0-9.]*$", + "const": "Microsoft.EditActions" + }, + "$copy": { + "title": "$copy", + "description": "Copy the definition by id from a .dialog file.", + "type": "string", + "pattern": "^(([a-zA-Z][a-zA-Z0-9.]*)?(#[a-zA-Z][a-zA-Z0-9.]*)?)$" + }, + "$id": { + "title": "$id", + "description": "Inline id for reuse of an inline definition", + "type": "string", + "pattern": "^([a-zA-Z][a-zA-Z0-9.]*)$" + }, + "$designer": { + "title": "$designer", + "type": "object", + "description": "Extra information for the Bot Framework Designer." + }, + "changeType": { + "type": "string", + "title": "Type of change", + "description": "Type of change to apply to the current actions.", + "enum": [ + "InsertActions", + "InsertActionsBeforeTags", + "AppendActions", + "EndSequence", + "ReplaceSequence" + ] + }, + "actions": { + "type": "array", + "title": "Actions", + "description": "Actions to apply.", + "items": { + "$type": "Microsoft.IDialog", + "$ref": "#/definitions/Microsoft.IDialog" + } + } + }, + "additionalProperties": false, + "patternProperties": { + "^\\$": { + "type": "string" + } + }, + "anyOf": [ + { + "title": "Reference", + "required": [ + "$copy" + ] + }, + { + "title": "Type", + "required": [ + "changeType", + "actions", + "$type" + ] + } + ] + }, + "Microsoft.EditArray": { + "$role": "unionType(Microsoft.IDialog)", + "title": "Edit array", + "description": "Modify an array in memory", + "type": "object", + "properties": { + "$type": { + "title": "$type", + "description": "Defines the valid properties for the component you are configuring (from a dialog .schema file)", + "type": "string", + "pattern": "^[a-zA-Z][a-zA-Z0-9.]*$", + "const": "Microsoft.EditArray" + }, + "$copy": { + "title": "$copy", + "description": "Copy the definition by id from a .dialog file.", + "type": "string", + "pattern": "^(([a-zA-Z][a-zA-Z0-9.]*)?(#[a-zA-Z][a-zA-Z0-9.]*)?)$" + }, + "$id": { + "title": "$id", + "description": "Inline id for reuse of an inline definition", + "type": "string", + "pattern": "^([a-zA-Z][a-zA-Z0-9.]*)$" + }, + "$designer": { + "title": "$designer", + "type": "object", + "description": "Extra information for the Bot Framework Designer." + }, + "changeType": { + "type": "string", + "title": "Type of change", + "description": "Type of change to the array in memory.", + "enum": [ + "Push", + "Pop", + "Take", + "Remove", + "Clear" + ] + }, + "itemsProperty": { + "$role": "expression", + "title": "Items property", + "description": "Property that holds the array to update.", + "type": "string" + }, + "resultProperty": { + "$role": "expression", + "title": "Result Property", + "description": "Property to store the result of this action.", + "type": "string" + }, + "value": { + "$role": "expression", + "title": "Value", + "description": "New value or expression.", + "examples": [ + "'milk'", + "dialog.favColor", + "dialog.favColor == 'red'" + ], + "type": "string" + } + }, + "additionalProperties": false, + "patternProperties": { + "^\\$": { + "type": "string" + } + }, + "anyOf": [ + { + "title": "Reference", + "required": [ + "$copy" + ] + }, + { + "title": "Type", + "required": [ + "changeType", + "itemsProperty", + "$type" + ] + } + ] + }, + "Microsoft.EmailEntityRecognizer": { + "$role": "unionType(Microsoft.EntityRecognizers)", + "title": "Email Entity Recognizer", + "description": "Recognizer which recognizes email.", + "type": "object", + "properties": { + "$type": { + "title": "$type", + "description": "Defines the valid properties for the component you are configuring (from a dialog .schema file)", + "type": "string", + "pattern": "^[a-zA-Z][a-zA-Z0-9.]*$", + "const": "Microsoft.EmailEntityRecognizer" + }, + "$copy": { + "title": "$copy", + "description": "Copy the definition by id from a .dialog file.", + "type": "string", + "pattern": "^(([a-zA-Z][a-zA-Z0-9.]*)?(#[a-zA-Z][a-zA-Z0-9.]*)?)$" + }, + "$id": { + "title": "$id", + "description": "Inline id for reuse of an inline definition", + "type": "string", + "pattern": "^([a-zA-Z][a-zA-Z0-9.]*)$" + }, + "$designer": { + "title": "$designer", + "type": "object", + "description": "Extra information for the Bot Framework Designer." + } + }, + "additionalProperties": false, + "patternProperties": { + "^\\$": { + "type": "string" + } + }, + "anyOf": [ + { + "title": "Reference", + "required": [ + "$copy" + ] + }, + { + "title": "Type", + "required": [ + "$type" + ] + } + ] + }, + "Microsoft.EmitEvent": { + "$role": "unionType(Microsoft.IDialog)", + "title": "Emit a custom event", + "description": "Emit an event. Capture this event with a trigger.", + "type": "object", + "properties": { + "$type": { + "title": "$type", + "description": "Defines the valid properties for the component you are configuring (from a dialog .schema file)", + "type": "string", + "pattern": "^[a-zA-Z][a-zA-Z0-9.]*$", + "const": "Microsoft.EmitEvent" + }, + "$copy": { + "title": "$copy", + "description": "Copy the definition by id from a .dialog file.", + "type": "string", + "pattern": "^(([a-zA-Z][a-zA-Z0-9.]*)?(#[a-zA-Z][a-zA-Z0-9.]*)?)$" + }, + "$id": { + "title": "$id", + "description": "Inline id for reuse of an inline definition", + "type": "string", + "pattern": "^([a-zA-Z][a-zA-Z0-9.]*)$" + }, + "$designer": { + "title": "$designer", + "type": "object", + "description": "Extra information for the Bot Framework Designer." + }, + "eventName": { + "title": "Event name", + "description": "Name of the event to emit.", + "anyOf": [ + { + "enum": [ + "beginDialog", + "resumeDialog", + "repromptDialog", + "cancelDialog", + "endDialog", + "activityReceived", + "recognizedIntent", + "unknownIntent", + "actionsStarted", + "actionsSaved", + "actionsEnded", + "actionsResumed" + ] + }, + { + "type": "string" + } + ] + }, + "eventValue": { + "type": "object", + "title": "Event value", + "description": "Value to emit with the event (optional).", + "additionalProperties": true + }, + "bubbleEvent": { + "type": "boolean", + "title": "Bubble event", + "description": "If true this event is passed on to parent dialogs." + } + }, + "additionalProperties": false, + "patternProperties": { + "^\\$": { + "type": "string" + } + }, + "anyOf": [ + { + "title": "Reference", + "required": [ + "$copy" + ] + }, + { + "title": "Type", + "required": [ + "eventName", + "$type" + ] + } + ] + }, + "Microsoft.EndDialog": { + "$role": "unionType(Microsoft.IDialog)", + "title": "End dialog", + "description": "End this dialog.", + "type": "object", + "properties": { + "$type": { + "title": "$type", + "description": "Defines the valid properties for the component you are configuring (from a dialog .schema file)", + "type": "string", + "pattern": "^[a-zA-Z][a-zA-Z0-9.]*$", + "const": "Microsoft.EndDialog" + }, + "$copy": { + "title": "$copy", + "description": "Copy the definition by id from a .dialog file.", + "type": "string", + "pattern": "^(([a-zA-Z][a-zA-Z0-9.]*)?(#[a-zA-Z][a-zA-Z0-9.]*)?)$" + }, + "$id": { + "title": "$id", + "description": "Inline id for reuse of an inline definition", + "type": "string", + "pattern": "^([a-zA-Z][a-zA-Z0-9.]*)$" + }, + "$designer": { + "title": "$designer", + "type": "object", + "description": "Extra information for the Bot Framework Designer." + }, + "value": { + "$role": "expression", + "title": "Value", + "description": "Result value returned to the parent dialog.", + "examples": [ + "dialog.userName", + "'tomato'" + ], + "type": "string" + } + }, + "additionalProperties": false, + "patternProperties": { + "^\\$": { + "type": "string" + } + }, + "anyOf": [ + { + "title": "Reference", + "required": [ + "$copy" + ] + }, + { + "title": "Type", + "required": [ + "$type" + ] + } + ] + }, + "Microsoft.EndTurn": { + "$role": "unionType(Microsoft.IDialog)", + "title": "End turn", + "description": "End the current turn without ending the dialog.", + "type": "object", + "properties": { + "$type": { + "title": "$type", + "description": "Defines the valid properties for the component you are configuring (from a dialog .schema file)", + "type": "string", + "pattern": "^[a-zA-Z][a-zA-Z0-9.]*$", + "const": "Microsoft.EndTurn" + }, + "$copy": { + "title": "$copy", + "description": "Copy the definition by id from a .dialog file.", + "type": "string", + "pattern": "^(([a-zA-Z][a-zA-Z0-9.]*)?(#[a-zA-Z][a-zA-Z0-9.]*)?)$" + }, + "$id": { + "title": "$id", + "description": "Inline id for reuse of an inline definition", + "type": "string", + "pattern": "^([a-zA-Z][a-zA-Z0-9.]*)$" + }, + "$designer": { + "title": "$designer", + "type": "object", + "description": "Extra information for the Bot Framework Designer." + } + }, + "additionalProperties": false, + "patternProperties": { + "^\\$": { + "type": "string" + } + }, + "anyOf": [ + { + "title": "Reference", + "required": [ + "$copy" + ] + }, + { + "title": "Type", + "required": [ + "$type" + ] + } + ] + }, + "Microsoft.EntityRecognizers": { + "$role": "unionType", + "title": "Entity Recognizers", + "description": "Union of components which derive from EntityRecognizer abstract class.", + "type": "object", + "oneOf": [ + { + "title": "Microsoft.AgeEntityRecognizer", + "description": "Recognizer which recognizes age.", + "$ref": "#/definitions/Microsoft.AgeEntityRecognizer" + }, + { + "title": "Microsoft.ConfirmationEntityRecognizer", + "description": "Recognizer which recognizes confirmation choices (yes/no).", + "$ref": "#/definitions/Microsoft.ConfirmationEntityRecognizer" + }, + { + "title": "Microsoft.CurrencyEntityRecognizer", + "description": "Recognizer which recognizes currency.", + "$ref": "#/definitions/Microsoft.CurrencyEntityRecognizer" + }, + { + "title": "Microsoft.DateTimeEntityRecognizer", + "description": "Recognizer which recognizes dates and time fragments.", + "$ref": "#/definitions/Microsoft.DateTimeEntityRecognizer" + }, + { + "title": "Microsoft.DimensionEntityRecognizer", + "description": "Recognizer which recognizes dimension.", + "$ref": "#/definitions/Microsoft.DimensionEntityRecognizer" + }, + { + "title": "Microsoft.EmailEntityRecognizer", + "description": "Recognizer which recognizes email.", + "$ref": "#/definitions/Microsoft.EmailEntityRecognizer" + }, + { + "title": "Microsoft.GuidEntityRecognizer", + "description": "Recognizer which recognizes guids.", + "$ref": "#/definitions/Microsoft.GuidEntityRecognizer" + }, + { + "title": "Microsoft.HashtagEntityRecognizer", + "description": "Recognizer which recognizes Hashtags.", + "$ref": "#/definitions/Microsoft.HashtagEntityRecognizer" + }, + { + "title": "Microsoft.IpEntityRecognizer", + "description": "Recognizer which recognizes internet IP patterns (like 192.1.1.1).", + "$ref": "#/definitions/Microsoft.IpEntityRecognizer" + }, + { + "title": "Microsoft.MentionEntityRecognizer", + "description": "Recognizer which recognizes @Mentions", + "$ref": "#/definitions/Microsoft.MentionEntityRecognizer" + }, + { + "title": "Microsoft.NumberEntityRecognizer", + "description": "Recognizer which recognizes numbers.", + "$ref": "#/definitions/Microsoft.NumberEntityRecognizer" + }, + { + "title": "Microsoft.NumberRangeEntityRecognizer", + "description": "Recognizer which recognizes ranges of numbers (Example:2 to 5).", + "$ref": "#/definitions/Microsoft.NumberRangeEntityRecognizer" + }, + { + "title": "Microsoft.OrdinalEntityRecognizer", + "description": "Recognizer which recognizes ordinals (example: first, second, 3rd).", + "$ref": "#/definitions/Microsoft.OrdinalEntityRecognizer" + }, + { + "title": "Microsoft.PercentageEntityRecognizer", + "description": "Recognizer which recognizes percentages.", + "$ref": "#/definitions/Microsoft.PercentageEntityRecognizer" + }, + { + "title": "Microsoft.PhoneNumberEntityRecognizer", + "description": "Recognizer which recognizes phone numbers.", + "$ref": "#/definitions/Microsoft.PhoneNumberEntityRecognizer" + }, + { + "title": "Microsoft.RegExEntityRecognizer", + "description": "Recognizer which recognizes patterns of input based on regex.", + "$ref": "#/definitions/Microsoft.RegExEntityRecognizer" + }, + { + "title": "Microsoft.TemperatureEntityRecognizer", + "description": "Recognizer which recognizes temperatures.", + "$ref": "#/definitions/Microsoft.TemperatureEntityRecognizer" + }, + { + "title": "Microsoft.UrlEntityRecognizer", + "description": "Recognizer which recognizes urls (example: http://bing.com)", + "$ref": "#/definitions/Microsoft.UrlEntityRecognizer" + } + ] + }, + "Microsoft.FirstSelector": { + "$role": "unionType(Microsoft.ITriggerSelector)", + "title": "First Trigger Selector", + "description": "Selector for first true rule", + "type": "object", + "properties": { + "$type": { + "title": "$type", + "description": "Defines the valid properties for the component you are configuring (from a dialog .schema file)", + "type": "string", + "pattern": "^[a-zA-Z][a-zA-Z0-9.]*$", + "const": "Microsoft.FirstSelector" + }, + "$copy": { + "title": "$copy", + "description": "Copy the definition by id from a .dialog file.", + "type": "string", + "pattern": "^(([a-zA-Z][a-zA-Z0-9.]*)?(#[a-zA-Z][a-zA-Z0-9.]*)?)$" + }, + "$id": { + "title": "$id", + "description": "Inline id for reuse of an inline definition", + "type": "string", + "pattern": "^([a-zA-Z][a-zA-Z0-9.]*)$" + }, + "$designer": { + "title": "$designer", + "type": "object", + "description": "Extra information for the Bot Framework Designer." + } + }, + "additionalProperties": false, + "patternProperties": { + "^\\$": { + "type": "string" + } + }, + "anyOf": [ + { + "title": "Reference", + "required": [ + "$copy" + ] + }, + { + "title": "Type", + "required": [ + "$type" + ] + } + ] + }, + "Microsoft.Foreach": { + "$role": "unionType(Microsoft.IDialog)", + "title": "For each item", + "description": "Execute actions on each item in an a collection.", + "type": "object", + "properties": { + "$type": { + "title": "$type", + "description": "Defines the valid properties for the component you are configuring (from a dialog .schema file)", + "type": "string", + "pattern": "^[a-zA-Z][a-zA-Z0-9.]*$", + "const": "Microsoft.Foreach" + }, + "$copy": { + "title": "$copy", + "description": "Copy the definition by id from a .dialog file.", + "type": "string", + "pattern": "^(([a-zA-Z][a-zA-Z0-9.]*)?(#[a-zA-Z][a-zA-Z0-9.]*)?)$" + }, + "$id": { + "title": "$id", + "description": "Inline id for reuse of an inline definition", + "type": "string", + "pattern": "^([a-zA-Z][a-zA-Z0-9.]*)$" + }, + "$designer": { + "title": "$designer", + "type": "object", + "description": "Extra information for the Bot Framework Designer." + }, + "itemsProperty": { + "$role": "expression", + "title": "Items property", + "description": "Property that holds the array.", + "examples": [ + "user.todoList" + ], + "type": "string" + }, + "actions": { + "type": "array", + "title": "Actions", + "description": "Actions to execute for each item. Use '$foreach.value' to access the value of each item. Use '$foreach.index' to access the index of each item.", + "items": { + "$type": "Microsoft.IDialog", + "$ref": "#/definitions/Microsoft.IDialog" + } + } + }, + "additionalProperties": false, + "patternProperties": { + "^\\$": { + "type": "string" + } + }, + "anyOf": [ + { + "title": "Reference", + "required": [ + "$copy" + ] + }, + { + "title": "Type", + "required": [ + "itemsProperty", + "actions", + "$type" + ] + } + ] + }, + "Microsoft.ForeachPage": { + "$role": "unionType(Microsoft.IDialog)", + "title": "For each page", + "description": "Execute actions on each page (collection of items) in an array.", + "type": "object", + "properties": { + "$type": { + "title": "$type", + "description": "Defines the valid properties for the component you are configuring (from a dialog .schema file)", + "type": "string", + "pattern": "^[a-zA-Z][a-zA-Z0-9.]*$", + "const": "Microsoft.ForeachPage" + }, + "$copy": { + "title": "$copy", + "description": "Copy the definition by id from a .dialog file.", + "type": "string", + "pattern": "^(([a-zA-Z][a-zA-Z0-9.]*)?(#[a-zA-Z][a-zA-Z0-9.]*)?)$" + }, + "$id": { + "title": "$id", + "description": "Inline id for reuse of an inline definition", + "type": "string", + "pattern": "^([a-zA-Z][a-zA-Z0-9.]*)$" + }, + "$designer": { + "title": "$designer", + "type": "object", + "description": "Extra information for the Bot Framework Designer." + }, + "itemsProperty": { + "$role": "expression", + "title": "Items property", + "description": "Property that holds the array.", + "examples": [ + "user.todoList" + ], + "type": "string" + }, + "actions": { + "type": "array", + "title": "Actions", + "description": "Actions to execute for each page. Use '$foreach.page' to access each page.", + "items": { + "$type": "Microsoft.IDialog", + "$ref": "#/definitions/Microsoft.IDialog" + } + }, + "pageSize": { + "type": "integer", + "title": "Page size", + "description": "Number of items in each page.", + "default": 10 + } + }, + "additionalProperties": false, + "patternProperties": { + "^\\$": { + "type": "string" + } + }, + "anyOf": [ + { + "title": "Reference", + "required": [ + "$copy" + ] + }, + { + "title": "Type", + "required": [ + "itemsProperty", + "actions", + "$type" + ] + } + ] + }, + "Microsoft.GuidEntityRecognizer": { + "$role": "unionType(Microsoft.EntityRecognizers)", + "title": "Guid Entity Recognizer", + "description": "Recognizer which recognizes guids.", + "type": "object", + "properties": { + "$type": { + "title": "$type", + "description": "Defines the valid properties for the component you are configuring (from a dialog .schema file)", + "type": "string", + "pattern": "^[a-zA-Z][a-zA-Z0-9.]*$", + "const": "Microsoft.GuidEntityRecognizer" + }, + "$copy": { + "title": "$copy", + "description": "Copy the definition by id from a .dialog file.", + "type": "string", + "pattern": "^(([a-zA-Z][a-zA-Z0-9.]*)?(#[a-zA-Z][a-zA-Z0-9.]*)?)$" + }, + "$id": { + "title": "$id", + "description": "Inline id for reuse of an inline definition", + "type": "string", + "pattern": "^([a-zA-Z][a-zA-Z0-9.]*)$" + }, + "$designer": { + "title": "$designer", + "type": "object", + "description": "Extra information for the Bot Framework Designer." + } + }, + "additionalProperties": false, + "patternProperties": { + "^\\$": { + "type": "string" + } + }, + "anyOf": [ + { + "title": "Reference", + "required": [ + "$copy" + ] + }, + { + "title": "Type", + "required": [ + "$type" + ] + } + ] + }, + "Microsoft.HashtagEntityRecognizer": { + "$role": "unionType(Microsoft.EntityRecognizers)", + "title": "Hashtag Entity Recognizer", + "description": "Recognizer which recognizes Hashtags.", + "type": "object", + "properties": { + "$type": { + "title": "$type", + "description": "Defines the valid properties for the component you are configuring (from a dialog .schema file)", + "type": "string", + "pattern": "^[a-zA-Z][a-zA-Z0-9.]*$", + "const": "Microsoft.HashtagEntityRecognizer" + }, + "$copy": { + "title": "$copy", + "description": "Copy the definition by id from a .dialog file.", + "type": "string", + "pattern": "^(([a-zA-Z][a-zA-Z0-9.]*)?(#[a-zA-Z][a-zA-Z0-9.]*)?)$" + }, + "$id": { + "title": "$id", + "description": "Inline id for reuse of an inline definition", + "type": "string", + "pattern": "^([a-zA-Z][a-zA-Z0-9.]*)$" + }, + "$designer": { + "title": "$designer", + "type": "object", + "description": "Extra information for the Bot Framework Designer." + } + }, + "additionalProperties": false, + "patternProperties": { + "^\\$": { + "type": "string" + } + }, + "anyOf": [ + { + "title": "Reference", + "required": [ + "$copy" + ] + }, + { + "title": "Type", + "required": [ + "$type" + ] + } + ] + }, + "Microsoft.HttpRequest": { + "$role": "unionType(Microsoft.IDialog)", + "type": "object", + "title": "HTTP request", + "description": "Make a HTTP request.", + "properties": { + "$type": { + "title": "$type", + "description": "Defines the valid properties for the component you are configuring (from a dialog .schema file)", + "type": "string", + "pattern": "^[a-zA-Z][a-zA-Z0-9.]*$", + "const": "Microsoft.HttpRequest" + }, + "$copy": { + "title": "$copy", + "description": "Copy the definition by id from a .dialog file.", + "type": "string", + "pattern": "^(([a-zA-Z][a-zA-Z0-9.]*)?(#[a-zA-Z][a-zA-Z0-9.]*)?)$" + }, + "$id": { + "title": "$id", + "description": "Inline id for reuse of an inline definition", + "type": "string", + "pattern": "^([a-zA-Z][a-zA-Z0-9.]*)$" + }, + "$designer": { + "title": "$designer", + "type": "object", + "description": "Extra information for the Bot Framework Designer." + }, + "method": { + "type": "string", + "title": "HTTP method", + "description": "HTTP method to use.", + "enum": [ + "GET", + "POST", + "PATCH", + "PUT", + "DELETE" + ], + "examples": [ + "GET", + "POST" + ] + }, + "url": { + "type": "string", + "title": "Url", + "description": "URL to call (supports data binding).", + "examples": [ + "https://contoso.com" + ] + }, + "body": { + "type": "object", + "title": "Body", + "description": "Body to include in the HTTP call (supports data binding).", + "additionalProperties": true + }, + "resultProperty": { + "$role": "expression", + "title": "Result property", + "description": "Property to store the result of this action. The result includes 4 properties from the http response: statusCode, reasonPhrase, content and headers. If the content is json it will be a deserialized object.", + "examples": [ + "dialog.contosodata" + ], + "type": "string" + }, + "headers": { + "type": "object", + "additionProperties": true, + "title": "Headers", + "description": "One or more headers to include in the request (supports data binding)." + }, + "responseType": { + "type": "string", + "title": "Response type", + "description": "Defines the type of HTTP response. Automatically calls the 'Send a response' action if set to 'Activity' or 'Activities'.", + "enum": [ + "None", + "Json", + "Activity", + "Activities" + ], + "default": "Json" + } + }, + "additionalProperties": false, + "patternProperties": { + "^\\$": { + "type": "string" + } + }, + "anyOf": [ + { + "title": "Reference", + "required": [ + "$copy" + ] + }, + { + "title": "Type", + "required": [ + "url", + "method", + "$type" + ] + } + ] + }, + "Microsoft.IActivityTemplate": { + "title": "Microsoft ActivityTemplates", + "description": "Components which are IActivityTemplates", + "$role": "unionType", + "oneOf": [ + { + "title": "Microsoft.ActivityTemplate", + "description": "", + "$ref": "#/definitions/Microsoft.ActivityTemplate" + }, + { + "title": "Microsoft.StaticActivityTemplate", + "description": "This allows you to define a static Activity object", + "$ref": "#/definitions/Microsoft.StaticActivityTemplate" + }, + { + "type": "string", + "title": "string" + } + ] + }, + "Microsoft.IDialog": { + "title": "Microsoft Dialogs", + "description": "Union of components which implement the Dialog contract", + "$role": "unionType", + "oneOf": [ + { + "title": "Microsoft.AdaptiveDialog", + "description": "Flexible, data driven dialog that can adapt to the conversation.", + "$ref": "#/definitions/Microsoft.AdaptiveDialog" + }, + { + "title": "Microsoft.AttachmentInput", + "description": "Collect information - Ask for a file or image.", + "$ref": "#/definitions/Microsoft.AttachmentInput" + }, + { + "title": "Microsoft.BeginDialog", + "description": "Begin another dialog.", + "$ref": "#/definitions/Microsoft.BeginDialog" + }, + { + "title": "Microsoft.CancelAllDialogs", + "description": "Cancel all active dialogs. All dialogs in the dialog chain will need a trigger to capture the event configured in this action.", + "$ref": "#/definitions/Microsoft.CancelAllDialogs" + }, + { + "title": "Microsoft.ChoiceInput", + "description": "Collect information - Pick from a list of choices", + "$ref": "#/definitions/Microsoft.ChoiceInput" + }, + { + "title": "Microsoft.ConfirmInput", + "description": "Collect information - Ask for confirmation (yes or no).", + "$ref": "#/definitions/Microsoft.ConfirmInput" + }, + { + "title": "Microsoft.DateTimeInput", + "description": "Collect information - Ask for date and/ or time", + "$ref": "#/definitions/Microsoft.DateTimeInput" + }, + { + "title": "Microsoft.DebugBreak", + "description": "If debugger is attached, stop the execution at this point in the conversation.", + "$ref": "#/definitions/Microsoft.DebugBreak" + }, + { + "title": "Microsoft.DeleteProperty", + "description": "Delete a property and any value it holds.", + "$ref": "#/definitions/Microsoft.DeleteProperty" + }, + { + "title": "Microsoft.EditActions", + "description": "Edit the current list of actions.", + "$ref": "#/definitions/Microsoft.EditActions" + }, + { + "title": "Microsoft.EditArray", + "description": "Modify an array in memory", + "$ref": "#/definitions/Microsoft.EditArray" + }, + { + "title": "Microsoft.EmitEvent", + "description": "Emit an event. Capture this event with a trigger.", + "$ref": "#/definitions/Microsoft.EmitEvent" + }, + { + "title": "Microsoft.EndDialog", + "description": "End this dialog.", + "$ref": "#/definitions/Microsoft.EndDialog" + }, + { + "title": "Microsoft.EndTurn", + "description": "End the current turn without ending the dialog.", + "$ref": "#/definitions/Microsoft.EndTurn" + }, + { + "title": "Microsoft.Foreach", + "description": "Execute actions on each item in an a collection.", + "$ref": "#/definitions/Microsoft.Foreach" + }, + { + "title": "Microsoft.ForeachPage", + "description": "Execute actions on each page (collection of items) in an array.", + "$ref": "#/definitions/Microsoft.ForeachPage" + }, + { + "title": "Microsoft.HttpRequest", + "description": "Make a HTTP request.", + "$ref": "#/definitions/Microsoft.HttpRequest" + }, + { + "title": "Microsoft.IfCondition", + "description": "Two-way branch the conversation flow based on a condition.", + "$ref": "#/definitions/Microsoft.IfCondition" + }, + { + "title": "Microsoft.InitProperty", + "description": "Define and initialize a property to be an array or object.", + "$ref": "#/definitions/Microsoft.InitProperty" + }, + { + "title": "Microsoft.LogAction", + "description": "Log a message to the host application. Send a TraceActivity to Bot Framework Emulator (optional).", + "$ref": "#/definitions/Microsoft.LogAction" + }, + { + "title": "Microsoft.NumberInput", + "description": "Collect information - Ask for a number.", + "$ref": "#/definitions/Microsoft.NumberInput" + }, + { + "title": "Microsoft.OAuthInput", + "description": "Collect login information.", + "$ref": "#/definitions/Microsoft.OAuthInput" + }, + { + "title": "Microsoft.QnAMakerDialog", + "description": "Dialog which uses QnAMAker knowledge base to answer questions.", + "$ref": "#/definitions/Microsoft.QnAMakerDialog" + }, + { + "title": "Microsoft.RepeatDialog", + "description": "Repeat current dialog.", + "$ref": "#/definitions/Microsoft.RepeatDialog" + }, + { + "title": "Microsoft.ReplaceDialog", + "description": "Replace current dialog with another dialog.", + "$ref": "#/definitions/Microsoft.ReplaceDialog" + }, + { + "title": "Microsoft.SendActivity", + "description": "Respond with an activity.", + "$ref": "#/definitions/Microsoft.SendActivity" + }, + { + "title": "Microsoft.SetProperty", + "description": "Set property to a value.", + "$ref": "#/definitions/Microsoft.SetProperty" + }, + { + "title": "Microsoft.SwitchCondition", + "description": "Execute different actions based on the value of a property.", + "$ref": "#/definitions/Microsoft.SwitchCondition" + }, + { + "title": "Microsoft.TextInput", + "description": "Collection information - Ask for a word or sentence.", + "$ref": "#/definitions/Microsoft.TextInput" + }, + { + "title": "Microsoft.TraceActivity", + "description": "Send a trace activity to the transcript logger and/ or Bot Framework Emulator.", + "$ref": "#/definitions/Microsoft.TraceActivity" + }, + { + "type": "string", + "title": "string" + } + ] + }, + "Microsoft.ILanguageGenerator": { + "title": "Microsoft ILanguageGenerator", + "description": "Union of components which implement the ILanguageGenerator interface", + "$role": "unionType", + "oneOf": [ + { + "type": "string", + "title": "string" + } + ] + }, + "Microsoft.IRecognizer": { + "title": "Microsoft IRecognizer", + "description": "Union of components which implement the IRecognizer interface", + "$role": "unionType", + "oneOf": [ + { + "title": "Microsoft.LuisRecognizer", + "description": "LUIS recognizer.", + "$ref": "#/definitions/Microsoft.LuisRecognizer" + }, + { + "title": "Microsoft.MultiLanguageRecognizer", + "description": "Configure one recognizer per language and the specify the language fallback policy.", + "$ref": "#/definitions/Microsoft.MultiLanguageRecognizer" + }, + { + "title": "Microsoft.RegexRecognizer", + "description": "Use regular expressions to recognize intents and entities from user input.", + "$ref": "#/definitions/Microsoft.RegexRecognizer" + }, + { + "type": "string", + "title": "string" + } + ] + }, + "Microsoft.ITextTemplate": { + "title": "Microsoft TextTemplate", + "description": "Union of components which implement the TextTemplate", + "$role": "unionType", + "oneOf": [ + { + "title": "Microsoft.TextTemplate", + "description": "Lg tempalte to evaluate to create text", + "$ref": "#/definitions/Microsoft.TextTemplate" + }, + { + "type": "string", + "title": "string" + } + ] + }, + "Microsoft.ITriggerCondition": { + "$role": "unionType", + "title": "Microsoft Triggers", + "description": "Union of components which implement the OnCondition", + "oneOf": [ + { + "title": "Microsoft.OnActivity", + "description": "Actions to perform on receipt of a generic activity.", + "$ref": "#/definitions/Microsoft.OnActivity" + }, + { + "title": "Microsoft.OnBeginDialog", + "description": "Actions to perform when this dialog begins.", + "$ref": "#/definitions/Microsoft.OnBeginDialog" + }, + { + "title": "Microsoft.OnCancelDialog", + "description": "Actions to perform on cancel dialog event.", + "$ref": "#/definitions/Microsoft.OnCancelDialog" + }, + { + "title": "Microsoft.OnCondition", + "description": "Actions to perform when specified condition is true.", + "$ref": "#/definitions/Microsoft.OnCondition" + }, + { + "title": "Microsoft.OnConversationUpdateActivity", + "description": "Actions to perform on receipt of an activity with type 'ConversationUpdate'.", + "$ref": "#/definitions/Microsoft.OnConversationUpdateActivity" + }, + { + "title": "Microsoft.OnCustomEvent", + "description": "Actions to perform when a custom event is detected. Use 'Emit a custom event' action to raise a custom event.", + "$ref": "#/definitions/Microsoft.OnCustomEvent" + }, + { + "title": "Microsoft.OnDialogEvent", + "description": "Actions to perform when a specific dialog event occurs.", + "$ref": "#/definitions/Microsoft.OnDialogEvent" + }, + { + "title": "Microsoft.OnEndOfConversationActivity", + "description": "Actions to perform on receipt of an activity with type 'EndOfConversation'.", + "$ref": "#/definitions/Microsoft.OnEndOfConversationActivity" + }, + { + "title": "Microsoft.OnError", + "description": "Action to perform when an 'Error' dialog event occurs.", + "$ref": "#/definitions/Microsoft.OnError" + }, + { + "title": "Microsoft.OnEventActivity", + "description": "Actions to perform on receipt of an activity with type 'Event'.", + "$ref": "#/definitions/Microsoft.OnEventActivity" + }, + { + "title": "Microsoft.OnHandoffActivity", + "description": "Actions to perform on receipt of an activity with type 'HandOff'.", + "$ref": "#/definitions/Microsoft.OnHandoffActivity" + }, + { + "title": "Microsoft.OnIntent", + "description": "Actions to perform when specified intent is recognized.", + "$ref": "#/definitions/Microsoft.OnIntent" + }, + { + "title": "Microsoft.OnInvokeActivity", + "description": "Actions to perform on receipt of an activity with type 'Invoke'.", + "$ref": "#/definitions/Microsoft.OnInvokeActivity" + }, + { + "title": "Microsoft.OnMessageActivity", + "description": "Actions to perform on receipt of an activity with type 'Message'. Overrides Intent trigger.", + "$ref": "#/definitions/Microsoft.OnMessageActivity" + }, + { + "title": "Microsoft.OnMessageDeleteActivity", + "description": "Actions to perform on receipt of an activity with type 'MessageDelete'.", + "$ref": "#/definitions/Microsoft.OnMessageDeleteActivity" + }, + { + "title": "Microsoft.OnMessageReactionActivity", + "description": "Actions to perform on receipt of an activity with type 'MessageReaction'.", + "$ref": "#/definitions/Microsoft.OnMessageReactionActivity" + }, + { + "title": "Microsoft.OnMessageUpdateActivity", + "description": "Actions to perform on receipt of an activity with type 'MessageUpdate'.", + "$ref": "#/definitions/Microsoft.OnMessageUpdateActivity" + }, + { + "title": "Microsoft.OnRepromptDialog", + "description": "Actions to perform when 'RepromptDialog' event occurs.", + "$ref": "#/definitions/Microsoft.OnRepromptDialog" + }, + { + "title": "Microsoft.OnTypingActivity", + "description": "Actions to perform on receipt of an activity with type 'Typing'.", + "$ref": "#/definitions/Microsoft.OnTypingActivity" + }, + { + "title": "Microsoft.OnUnknownIntent", + "description": "Action to perform when user input is unrecognized and if none of the 'on intent recognition' triggers match recognized intent.", + "$ref": "#/definitions/Microsoft.OnUnknownIntent" + } + ] + }, + "Microsoft.ITriggerSelector": { + "$role": "unionType", + "title": "Selectors", + "description": "Union of components which are trigger selectors", + "oneOf": [ + { + "title": "Microsoft.ConditionalSelector", + "description": "Use a rule selector based on a condition", + "$ref": "#/definitions/Microsoft.ConditionalSelector" + }, + { + "title": "Microsoft.FirstSelector", + "description": "Selector for first true rule", + "$ref": "#/definitions/Microsoft.FirstSelector" + }, + { + "title": "Microsoft.MostSpecificSelector", + "description": "Select most specific true events with optional additional selector", + "$ref": "#/definitions/Microsoft.MostSpecificSelector" + }, + { + "title": "Microsoft.RandomSelector", + "description": "Select most specific true rule", + "$ref": "#/definitions/Microsoft.RandomSelector" + }, + { + "title": "Microsoft.TrueSelector", + "description": "Selector for all true events", + "$ref": "#/definitions/Microsoft.TrueSelector" + } + ] + }, + "Microsoft.IfCondition": { + "$role": "unionType(Microsoft.IDialog)", + "title": "If condition", + "description": "Two-way branch the conversation flow based on a condition.", + "type": "object", + "properties": { + "$type": { + "title": "$type", + "description": "Defines the valid properties for the component you are configuring (from a dialog .schema file)", + "type": "string", + "pattern": "^[a-zA-Z][a-zA-Z0-9.]*$", + "const": "Microsoft.IfCondition" + }, + "$copy": { + "title": "$copy", + "description": "Copy the definition by id from a .dialog file.", + "type": "string", + "pattern": "^(([a-zA-Z][a-zA-Z0-9.]*)?(#[a-zA-Z][a-zA-Z0-9.]*)?)$" + }, + "$id": { + "title": "$id", + "description": "Inline id for reuse of an inline definition", + "type": "string", + "pattern": "^([a-zA-Z][a-zA-Z0-9.]*)$" + }, + "$designer": { + "title": "$designer", + "type": "object", + "description": "Extra information for the Bot Framework Designer." + }, + "condition": { + "$role": "expression", + "title": "Condition", + "description": "Expression to evaluate.", + "examples": [ + "user.age > 3" + ], + "type": "string" + }, + "actions": { + "type": "array", + "title": "Actions", + "description": "Actions to execute if condition is true.", + "items": { + "$type": "Microsoft.IDialog", + "$ref": "#/definitions/Microsoft.IDialog" + } + }, + "elseActions": { + "type": "array", + "title": "Else", + "description": "Actions to execute if condition is false.", + "items": { + "$type": "Microsoft.IDialog", + "$ref": "#/definitions/Microsoft.IDialog" + } + } + }, + "additionalProperties": false, + "patternProperties": { + "^\\$": { + "type": "string" + } + }, + "anyOf": [ + { + "title": "Reference", + "required": [ + "$copy" + ] + }, + { + "title": "Type", + "required": [ + "condition", + "actions", + "$type" + ] + } + ] + }, + "Microsoft.InitProperty": { + "$role": "unionType(Microsoft.IDialog)", + "title": "Initialize property", + "description": "Define and initialize a property to be an array or object.", + "type": "object", + "properties": { + "$type": { + "title": "$type", + "description": "Defines the valid properties for the component you are configuring (from a dialog .schema file)", + "type": "string", + "pattern": "^[a-zA-Z][a-zA-Z0-9.]*$", + "const": "Microsoft.InitProperty" + }, + "$copy": { + "title": "$copy", + "description": "Copy the definition by id from a .dialog file.", + "type": "string", + "pattern": "^(([a-zA-Z][a-zA-Z0-9.]*)?(#[a-zA-Z][a-zA-Z0-9.]*)?)$" + }, + "$id": { + "title": "$id", + "description": "Inline id for reuse of an inline definition", + "type": "string", + "pattern": "^([a-zA-Z][a-zA-Z0-9.]*)$" + }, + "$designer": { + "title": "$designer", + "type": "object", + "description": "Extra information for the Bot Framework Designer." + }, + "property": { + "$role": "expression", + "title": "Property", + "description": "Property (named location to store information).", + "examples": [ + "user.age" + ], + "type": "string" + }, + "type": { + "type": "string", + "title": "Type", + "description": "Type of value.", + "enum": [ + "object", + "array" + ] + } + }, + "additionalProperties": false, + "patternProperties": { + "^\\$": { + "type": "string" + } + }, + "anyOf": [ + { + "title": "Reference", + "required": [ + "$copy" + ] + }, + { + "title": "Type", + "required": [ + "property", + "type", + "$type" + ] + } + ] + }, + "Microsoft.IpEntityRecognizer": { + "$role": "unionType(Microsoft.EntityRecognizers)", + "title": "Ip Entity Recognizer", + "description": "Recognizer which recognizes internet IP patterns (like 192.1.1.1).", + "type": "object", + "properties": { + "$type": { + "title": "$type", + "description": "Defines the valid properties for the component you are configuring (from a dialog .schema file)", + "type": "string", + "pattern": "^[a-zA-Z][a-zA-Z0-9.]*$", + "const": "Microsoft.IpEntityRecognizer" + }, + "$copy": { + "title": "$copy", + "description": "Copy the definition by id from a .dialog file.", + "type": "string", + "pattern": "^(([a-zA-Z][a-zA-Z0-9.]*)?(#[a-zA-Z][a-zA-Z0-9.]*)?)$" + }, + "$id": { + "title": "$id", + "description": "Inline id for reuse of an inline definition", + "type": "string", + "pattern": "^([a-zA-Z][a-zA-Z0-9.]*)$" + }, + "$designer": { + "title": "$designer", + "type": "object", + "description": "Extra information for the Bot Framework Designer." + } + }, + "additionalProperties": false, + "patternProperties": { + "^\\$": { + "type": "string" + } + }, + "anyOf": [ + { + "title": "Reference", + "required": [ + "$copy" + ] + }, + { + "title": "Type", + "required": [ + "$type" + ] + } + ] + }, + "Microsoft.LanguagePolicy": { + "title": "Language Policy", + "description": "This represents a policy map for locales lookups to use for language", + "type": "object", + "additionalProperties": false, + "properties": { + "$type": { + "title": "$type", + "description": "Defines the valid properties for the component you are configuring (from a dialog .schema file)", + "type": "string", + "pattern": "^[a-zA-Z][a-zA-Z0-9.]*$", + "const": "Microsoft.LanguagePolicy" + }, + "$copy": { + "title": "$copy", + "description": "Copy the definition by id from a .dialog file.", + "type": "string", + "pattern": "^(([a-zA-Z][a-zA-Z0-9.]*)?(#[a-zA-Z][a-zA-Z0-9.]*)?)$" + }, + "$id": { + "title": "$id", + "description": "Inline id for reuse of an inline definition", + "type": "string", + "pattern": "^([a-zA-Z][a-zA-Z0-9.]*)$" + }, + "$designer": { + "title": "$designer", + "type": "object", + "description": "Extra information for the Bot Framework Designer." + } + }, + "patternProperties": { + "^\\$": { + "type": "string" + } + }, + "anyOf": [ + { + "title": "Reference", + "required": [ + "$copy" + ] + }, + { + "title": "Type", + "required": [ + "$type" + ] + } + ] + }, + "Microsoft.LogAction": { + "$role": "unionType(Microsoft.IDialog)", + "title": "Log to console", + "description": "Log a message to the host application. Send a TraceActivity to Bot Framework Emulator (optional).", + "type": "object", + "properties": { + "$type": { + "title": "$type", + "description": "Defines the valid properties for the component you are configuring (from a dialog .schema file)", + "type": "string", + "pattern": "^[a-zA-Z][a-zA-Z0-9.]*$", + "const": "Microsoft.LogAction" + }, + "$copy": { + "title": "$copy", + "description": "Copy the definition by id from a .dialog file.", + "type": "string", + "pattern": "^(([a-zA-Z][a-zA-Z0-9.]*)?(#[a-zA-Z][a-zA-Z0-9.]*)?)$" + }, + "$id": { + "title": "$id", + "description": "Inline id for reuse of an inline definition", + "type": "string", + "pattern": "^([a-zA-Z][a-zA-Z0-9.]*)$" + }, + "$designer": { + "title": "$designer", + "type": "object", + "description": "Extra information for the Bot Framework Designer." + }, + "text": { + "type": "string", + "title": "Text", + "description": "Information to log." + }, + "traceActivity": { + "type": "boolean", + "title": "Send Trace Activity", + "description": "If true, automatically sends a TraceActivity (view in Bot Framework Emulator).", + "default": false + } + }, + "additionalProperties": false, + "patternProperties": { + "^\\$": { + "type": "string" + } + }, + "anyOf": [ + { + "title": "Reference", + "required": [ + "$copy" + ] + }, + { + "title": "Type", + "required": [ + "text", + "$type" + ] + } + ] + }, + "Microsoft.LuisRecognizer": { + "$role": "unionType(Microsoft.IRecognizer)", + "title": "LUIS Recognizer", + "description": "LUIS recognizer.", + "type": "object", + "additionalProperties": false, + "properties": { + "$type": { + "title": "$type", + "description": "Defines the valid properties for the component you are configuring (from a dialog .schema file)", + "type": "string", + "pattern": "^[a-zA-Z][a-zA-Z0-9.]*$", + "const": "Microsoft.LuisRecognizer" + }, + "$copy": { + "title": "$copy", + "description": "Copy the definition by id from a .dialog file.", + "type": "string", + "pattern": "^(([a-zA-Z][a-zA-Z0-9.]*)?(#[a-zA-Z][a-zA-Z0-9.]*)?)$" + }, + "$id": { + "title": "$id", + "description": "Inline id for reuse of an inline definition", + "type": "string", + "pattern": "^([a-zA-Z][a-zA-Z0-9.]*)$" + }, + "$designer": { + "title": "$designer", + "type": "object", + "description": "Extra information for the Bot Framework Designer." + }, + "applicationId": { + "type": "string" + }, + "endpoint": { + "type": "string" + }, + "endpointKey": { + "type": "string" + } + }, + "patternProperties": { + "^\\$": { + "type": "string" + } + }, + "anyOf": [ + { + "title": "Reference", + "required": [ + "$copy" + ] + }, + { + "title": "Type", + "required": [ + "applicationId", + "endpoint", + "endpointKey", + "$type" + ] + } + ] + }, + "Microsoft.MentionEntityRecognizer": { + "$role": "unionType(Microsoft.EntityRecognizers)", + "title": "Mentions Entity Recognizer", + "description": "Recognizer which recognizes @Mentions", + "type": "object", + "properties": { + "$type": { + "title": "$type", + "description": "Defines the valid properties for the component you are configuring (from a dialog .schema file)", + "type": "string", + "pattern": "^[a-zA-Z][a-zA-Z0-9.]*$", + "const": "Microsoft.MentionEntityRecognizer" + }, + "$copy": { + "title": "$copy", + "description": "Copy the definition by id from a .dialog file.", + "type": "string", + "pattern": "^(([a-zA-Z][a-zA-Z0-9.]*)?(#[a-zA-Z][a-zA-Z0-9.]*)?)$" + }, + "$id": { + "title": "$id", + "description": "Inline id for reuse of an inline definition", + "type": "string", + "pattern": "^([a-zA-Z][a-zA-Z0-9.]*)$" + }, + "$designer": { + "title": "$designer", + "type": "object", + "description": "Extra information for the Bot Framework Designer." + } + }, + "additionalProperties": false, + "patternProperties": { + "^\\$": { + "type": "string" + } + }, + "anyOf": [ + { + "title": "Reference", + "required": [ + "$copy" + ] + }, + { + "title": "Type", + "required": [ + "$type" + ] + } + ] + }, + "Microsoft.MostSpecificSelector": { + "$role": "unionType(Microsoft.ITriggerSelector)", + "title": "Most Specific Trigger Selector", + "description": "Select most specific true events with optional additional selector", + "type": "object", + "properties": { + "$type": { + "title": "$type", + "description": "Defines the valid properties for the component you are configuring (from a dialog .schema file)", + "type": "string", + "pattern": "^[a-zA-Z][a-zA-Z0-9.]*$", + "const": "Microsoft.MostSpecificSelector" + }, + "$copy": { + "title": "$copy", + "description": "Copy the definition by id from a .dialog file.", + "type": "string", + "pattern": "^(([a-zA-Z][a-zA-Z0-9.]*)?(#[a-zA-Z][a-zA-Z0-9.]*)?)$" + }, + "$id": { + "title": "$id", + "description": "Inline id for reuse of an inline definition", + "type": "string", + "pattern": "^([a-zA-Z][a-zA-Z0-9.]*)$" + }, + "$designer": { + "title": "$designer", + "type": "object", + "description": "Extra information for the Bot Framework Designer." + }, + "selector": { + "$type": "Microsoft.ITriggerSelector", + "$ref": "#/definitions/Microsoft.ITriggerSelector" + } + }, + "additionalProperties": false, + "patternProperties": { + "^\\$": { + "type": "string" + } + }, + "anyOf": [ + { + "title": "Reference", + "required": [ + "$copy" + ] + }, + { + "title": "Type", + "required": [ + "$type" + ] + } + ] + }, + "Microsoft.MultiLanguageRecognizer": { + "$role": "unionType(Microsoft.IRecognizer)", + "title": "Multi-language recognizer", + "description": "Configure one recognizer per language and the specify the language fallback policy.", + "type": "object", + "properties": { + "$type": { + "title": "$type", + "description": "Defines the valid properties for the component you are configuring (from a dialog .schema file)", + "type": "string", + "pattern": "^[a-zA-Z][a-zA-Z0-9.]*$", + "const": "Microsoft.MultiLanguageRecognizer" + }, + "$copy": { + "title": "$copy", + "description": "Copy the definition by id from a .dialog file.", + "type": "string", + "pattern": "^(([a-zA-Z][a-zA-Z0-9.]*)?(#[a-zA-Z][a-zA-Z0-9.]*)?)$" + }, + "$id": { + "title": "$id", + "description": "Inline id for reuse of an inline definition", + "type": "string", + "pattern": "^([a-zA-Z][a-zA-Z0-9.]*)$" + }, + "$designer": { + "title": "$designer", + "type": "object", + "description": "Extra information for the Bot Framework Designer." + }, + "languagePolicy": { + "$type": "Microsoft.LanguagePolicy", + "type": "object", + "title": "Language policy", + "description": "Defines fall back languages to try per user input language.", + "$ref": "#/definitions/Microsoft.LanguagePolicy" + }, + "recognizers": { + "type": "object", + "title": "Recognizers", + "description": "Map of language -> IRecognizer", + "additionalProperties": { + "$type": "Microsoft.IRecognizer", + "$ref": "#/definitions/Microsoft.IRecognizer" + } + } + }, + "additionalProperties": false, + "patternProperties": { + "^\\$": { + "type": "string" + } + }, + "anyOf": [ + { + "title": "Reference", + "required": [ + "$copy" + ] + }, + { + "title": "Type", + "required": [ + "recognizers", + "$type" + ] + } + ] + }, + "Microsoft.NumberEntityRecognizer": { + "$role": "unionType(Microsoft.EntityRecognizers)", + "title": "Number Entity Recognizer", + "description": "Recognizer which recognizes numbers.", + "type": "object", + "properties": { + "$type": { + "title": "$type", + "description": "Defines the valid properties for the component you are configuring (from a dialog .schema file)", + "type": "string", + "pattern": "^[a-zA-Z][a-zA-Z0-9.]*$", + "const": "Microsoft.NumberEntityRecognizer" + }, + "$copy": { + "title": "$copy", + "description": "Copy the definition by id from a .dialog file.", + "type": "string", + "pattern": "^(([a-zA-Z][a-zA-Z0-9.]*)?(#[a-zA-Z][a-zA-Z0-9.]*)?)$" + }, + "$id": { + "title": "$id", + "description": "Inline id for reuse of an inline definition", + "type": "string", + "pattern": "^([a-zA-Z][a-zA-Z0-9.]*)$" + }, + "$designer": { + "title": "$designer", + "type": "object", + "description": "Extra information for the Bot Framework Designer." + } + }, + "additionalProperties": false, + "patternProperties": { + "^\\$": { + "type": "string" + } + }, + "anyOf": [ + { + "title": "Reference", + "required": [ + "$copy" + ] + }, + { + "title": "Type", + "required": [ + "$type" + ] + } + ] + }, + "Microsoft.NumberInput": { + "$role": "unionType(Microsoft.IDialog)", + "title": "Number input dialog", + "description": "Collect information - Ask for a number.", + "type": "object", + "properties": { + "$type": { + "title": "$type", + "description": "Defines the valid properties for the component you are configuring (from a dialog .schema file)", + "type": "string", + "pattern": "^[a-zA-Z][a-zA-Z0-9.]*$", + "const": "Microsoft.NumberInput" + }, + "$copy": { + "title": "$copy", + "description": "Copy the definition by id from a .dialog file.", + "type": "string", + "pattern": "^(([a-zA-Z][a-zA-Z0-9.]*)?(#[a-zA-Z][a-zA-Z0-9.]*)?)$" + }, + "$id": { + "title": "$id", + "description": "Inline id for reuse of an inline definition", + "type": "string", + "pattern": "^([a-zA-Z][a-zA-Z0-9.]*)$" + }, + "$designer": { + "title": "$designer", + "type": "object", + "description": "Extra information for the Bot Framework Designer." + }, + "id": { + "type": "string", + "title": "Id", + "description": "Optional id for the dialog" + }, + "prompt": { + "$type": "Microsoft.IActivityTemplate", + "title": "Initial prompt", + "description": "Message to send to collect information.", + "examples": [ + "What is your birth date?" + ], + "$ref": "#/definitions/Microsoft.IActivityTemplate" + }, + "unrecognizedPrompt": { + "$type": "Microsoft.IActivityTemplate", + "title": "Unrecognized prompt", + "description": "Message to send if user response is not recognized.", + "examples": [ + "Sorry, I do not understand '{turn.activity.text'}. Let's try again. What is your birth date?" + ], + "$ref": "#/definitions/Microsoft.IActivityTemplate" + }, + "invalidPrompt": { + "$type": "Microsoft.IActivityTemplate", + "title": "Invalid prompt", + "description": "Message to send if user response is invalid. Relies on specified validation expressions.", + "examples": [ + "Sorry, '{this.value}' does not work. I need a number between 1-150. What is your age?" + ], + "$ref": "#/definitions/Microsoft.IActivityTemplate" + }, + "defaultValueResponse": { + "$type": "Microsoft.IActivityTemplate", + "title": "Default value response", + "description": "Message to send when max turn count (if specified) has been exceeded and the default value is selected as the value.", + "examples": [ + "Sorry, I'm having trouble understanding you. I will just use {this.options.defaultValue} for now. You can say 'I'm 36 years old' to change it." + ], + "$ref": "#/definitions/Microsoft.IActivityTemplate" + }, + "maxTurnCount": { + "type": "integer", + "title": "Max turn count", + "description": "Maximum number of re-prompt attempts to collect information.", + "default": 3, + "examples": [ + 3 + ] + }, + "validations": { + "type": "array", + "title": "Validation expressions", + "description": "Expression to validate user input.", + "examples": [ + "int(this.value) > 1 && int(this.value) <= 150", + "count(this.value) < 300" + ], + "items": { + "$role": "expression", + "type": "string", + "description": "String must contain an expression." + } + }, + "property": { + "$role": "expression", + "title": "Property", + "description": "Property to store collected information. Input will be skipped if property has value (unless 'Always prompt' is true).", + "examples": [ + "$birthday", + "user.name", + "conversation.issueTitle", + "dialog.favColor" + ], + "type": "string" + }, + "defaultValue": { + "$role": "expression", + "title": "Default value", + "description": "Expression to examine on each turn of the conversation as possible value to the property.", + "examples": [ + "@userName", + "coalesce(@number, @partySize)" + ], + "type": "string" + }, + "alwaysPrompt": { + "type": "boolean", + "title": "Always prompt", + "description": "Collect information even if the specified 'property' is not empty.", + "default": false, + "examples": [ + false + ] + }, + "allowInterruptions": { + "type": "string", + "title": "Allow Interruptions", + "description": "A boolean expression that determines whether the parent should be allowed to interrupt the input.", + "default": "true", + "examples": [ + "true" + ] + }, + "outputFormat": { + "type": "string", + "enum": [ + "float", + "integer" + ], + "title": "Output format", + "description": "Number output format.", + "default": "float" + }, + "defaultLocale": { + "type": "string", + "title": "Default locale", + "description": "Default locale.", + "default": "en-us" + } + }, + "additionalProperties": false, + "patternProperties": { + "^\\$": { + "type": "string" + } + }, + "anyOf": [ + { + "title": "Reference", + "required": [ + "$copy" + ] + }, + { + "title": "Type", + "required": [ + "$type" + ] + } + ] + }, + "Microsoft.NumberRangeEntityRecognizer": { + "$role": "unionType(Microsoft.EntityRecognizers)", + "title": "NumberRange Entity Recognizer", + "description": "Recognizer which recognizes ranges of numbers (Example:2 to 5).", + "type": "object", + "properties": { + "$type": { + "title": "$type", + "description": "Defines the valid properties for the component you are configuring (from a dialog .schema file)", + "type": "string", + "pattern": "^[a-zA-Z][a-zA-Z0-9.]*$", + "const": "Microsoft.NumberRangeEntityRecognizer" + }, + "$copy": { + "title": "$copy", + "description": "Copy the definition by id from a .dialog file.", + "type": "string", + "pattern": "^(([a-zA-Z][a-zA-Z0-9.]*)?(#[a-zA-Z][a-zA-Z0-9.]*)?)$" + }, + "$id": { + "title": "$id", + "description": "Inline id for reuse of an inline definition", + "type": "string", + "pattern": "^([a-zA-Z][a-zA-Z0-9.]*)$" + }, + "$designer": { + "title": "$designer", + "type": "object", + "description": "Extra information for the Bot Framework Designer." + } + }, + "additionalProperties": false, + "patternProperties": { + "^\\$": { + "type": "string" + } + }, + "anyOf": [ + { + "title": "Reference", + "required": [ + "$copy" + ] + }, + { + "title": "Type", + "required": [ + "$type" + ] + } + ] + }, + "Microsoft.OAuthInput": { + "$role": "unionType(Microsoft.IDialog)", + "title": "OAuthInput Dialog", + "description": "Collect login information.", + "type": "object", + "properties": { + "$type": { + "title": "$type", + "description": "Defines the valid properties for the component you are configuring (from a dialog .schema file)", + "type": "string", + "pattern": "^[a-zA-Z][a-zA-Z0-9.]*$", + "const": "Microsoft.OAuthInput" + }, + "$copy": { + "title": "$copy", + "description": "Copy the definition by id from a .dialog file.", + "type": "string", + "pattern": "^(([a-zA-Z][a-zA-Z0-9.]*)?(#[a-zA-Z][a-zA-Z0-9.]*)?)$" + }, + "$id": { + "title": "$id", + "description": "Inline id for reuse of an inline definition", + "type": "string", + "pattern": "^([a-zA-Z][a-zA-Z0-9.]*)$" + }, + "$designer": { + "title": "$designer", + "type": "object", + "description": "Extra information for the Bot Framework Designer." + }, + "connectionName": { + "type": "string", + "title": "Connection name", + "description": "The connection name configured in Azure Web App Bot OAuth settings.", + "examples": [ + "msgraphOAuthConnection" + ] + }, + "text": { + "type": "string", + "title": "Text", + "description": "Text shown in the OAuth signin card.", + "examples": [ + "Please sign in. " + ] + }, + "title": { + "type": "string", + "title": "Title", + "description": "Title shown in the OAuth signin card.", + "examples": [ + "Login" + ] + }, + "timeout": { + "type": "integer", + "title": "Timeout", + "description": "Time out setting for the OAuth signin card.", + "default": "900000" + }, + "tokenProperty": { + "$role": "expression", + "title": "Token property", + "description": "Property to store the OAuth token result.", + "examples": [ + "dialog.token" + ], + "type": "string" + } + }, + "additionalProperties": false, + "patternProperties": { + "^\\$": { + "type": "string" + } + }, + "anyOf": [ + { + "title": "Reference", + "required": [ + "$copy" + ] + }, + { + "title": "Type", + "required": [ + "connectionName", + "$type" + ] + } + ] + }, + "Microsoft.OnActivity": { + "$role": "unionType(Microsoft.ITriggerCondition)", + "title": "On activity", + "description": "Actions to perform on receipt of a generic activity.", + "type": "object", + "properties": { + "$type": { + "title": "$type", + "description": "Defines the valid properties for the component you are configuring (from a dialog .schema file)", + "type": "string", + "pattern": "^[a-zA-Z][a-zA-Z0-9.]*$", + "const": "Microsoft.OnActivity" + }, + "$copy": { + "title": "$copy", + "description": "Copy the definition by id from a .dialog file.", + "type": "string", + "pattern": "^(([a-zA-Z][a-zA-Z0-9.]*)?(#[a-zA-Z][a-zA-Z0-9.]*)?)$" + }, + "$id": { + "title": "$id", + "description": "Inline id for reuse of an inline definition", + "type": "string", + "pattern": "^([a-zA-Z][a-zA-Z0-9.]*)$" + }, + "$designer": { + "title": "$designer", + "type": "object", + "description": "Extra information for the Bot Framework Designer." + }, + "condition": { + "$role": "expression", + "title": "Condition", + "description": "Condition (expression).", + "examples": [ + "user.vip == true" + ], + "type": "string" + }, + "actions": { + "type": "array", + "description": "Sequence of actions to execute.", + "items": { + "$type": "Microsoft.IDialog", + "$ref": "#/definitions/Microsoft.IDialog" + } + }, + "type": { + "type": "string", + "title": "Activity type", + "description": "The Activity.Type to match" + } + }, + "additionalProperties": false, + "patternProperties": { + "^\\$": { + "type": "string" + } + }, + "anyOf": [ + { + "title": "Reference", + "required": [ + "$copy" + ] + }, + { + "title": "Type", + "required": [ + "actions", + "type", + "$type" + ] + } + ] + }, + "Microsoft.OnBeginDialog": { + "$role": "unionType(Microsoft.ITriggerCondition)", + "title": "On begin dialog", + "description": "Actions to perform when this dialog begins.", + "type": "object", + "properties": { + "$type": { + "title": "$type", + "description": "Defines the valid properties for the component you are configuring (from a dialog .schema file)", + "type": "string", + "pattern": "^[a-zA-Z][a-zA-Z0-9.]*$", + "const": "Microsoft.OnBeginDialog" + }, + "$copy": { + "title": "$copy", + "description": "Copy the definition by id from a .dialog file.", + "type": "string", + "pattern": "^(([a-zA-Z][a-zA-Z0-9.]*)?(#[a-zA-Z][a-zA-Z0-9.]*)?)$" + }, + "$id": { + "title": "$id", + "description": "Inline id for reuse of an inline definition", + "type": "string", + "pattern": "^([a-zA-Z][a-zA-Z0-9.]*)$" + }, + "$designer": { + "title": "$designer", + "type": "object", + "description": "Extra information for the Bot Framework Designer." + }, + "condition": { + "$role": "expression", + "title": "Condition", + "description": "Condition (expression).", + "examples": [ + "user.vip == true" + ], + "type": "string" + }, + "actions": { + "type": "array", + "description": "Sequence of actions to execute.", + "items": { + "$type": "Microsoft.IDialog", + "$ref": "#/definitions/Microsoft.IDialog" + } + } + }, + "additionalProperties": false, + "patternProperties": { + "^\\$": { + "type": "string" + } + }, + "anyOf": [ + { + "title": "Reference", + "required": [ + "$copy" + ] + }, + { + "title": "Type", + "required": [ + "actions", + "$type" + ] + } + ] + }, + "Microsoft.OnCancelDialog": { + "$role": "unionType(Microsoft.ITriggerCondition)", + "title": "On cancel dialog", + "description": "Actions to perform on cancel dialog event.", + "type": "object", + "properties": { + "$type": { + "title": "$type", + "description": "Defines the valid properties for the component you are configuring (from a dialog .schema file)", + "type": "string", + "pattern": "^[a-zA-Z][a-zA-Z0-9.]*$", + "const": "Microsoft.OnCancelDialog" + }, + "$copy": { + "title": "$copy", + "description": "Copy the definition by id from a .dialog file.", + "type": "string", + "pattern": "^(([a-zA-Z][a-zA-Z0-9.]*)?(#[a-zA-Z][a-zA-Z0-9.]*)?)$" + }, + "$id": { + "title": "$id", + "description": "Inline id for reuse of an inline definition", + "type": "string", + "pattern": "^([a-zA-Z][a-zA-Z0-9.]*)$" + }, + "$designer": { + "title": "$designer", + "type": "object", + "description": "Extra information for the Bot Framework Designer." + }, + "condition": { + "$role": "expression", + "title": "Condition", + "description": "Condition (expression).", + "examples": [ + "user.vip == true" + ], + "type": "string" + }, + "actions": { + "type": "array", + "description": "Sequence of actions to execute.", + "items": { + "$type": "Microsoft.IDialog", + "$ref": "#/definitions/Microsoft.IDialog" + } + } + }, + "additionalProperties": false, + "patternProperties": { + "^\\$": { + "type": "string" + } + }, + "anyOf": [ + { + "title": "Reference", + "required": [ + "$copy" + ] + }, + { + "title": "Type", + "required": [ + "actions", + "$type" + ] + } + ] + }, + "Microsoft.OnCondition": { + "$role": "unionType(Microsoft.ITriggerCondition)", + "title": "On condition", + "description": "Actions to perform when specified condition is true.", + "type": "object", + "properties": { + "$type": { + "title": "$type", + "description": "Defines the valid properties for the component you are configuring (from a dialog .schema file)", + "type": "string", + "pattern": "^[a-zA-Z][a-zA-Z0-9.]*$", + "const": "Microsoft.OnCondition" + }, + "$copy": { + "title": "$copy", + "description": "Copy the definition by id from a .dialog file.", + "type": "string", + "pattern": "^(([a-zA-Z][a-zA-Z0-9.]*)?(#[a-zA-Z][a-zA-Z0-9.]*)?)$" + }, + "$id": { + "title": "$id", + "description": "Inline id for reuse of an inline definition", + "type": "string", + "pattern": "^([a-zA-Z][a-zA-Z0-9.]*)$" + }, + "$designer": { + "title": "$designer", + "type": "object", + "description": "Extra information for the Bot Framework Designer." + }, + "condition": { + "$role": "expression", + "title": "Condition", + "description": "Condition (expression).", + "examples": [ + "user.vip == true" + ], + "type": "string" + }, + "actions": { + "type": "array", + "description": "Sequence of actions to execute.", + "items": { + "$type": "Microsoft.IDialog", + "$ref": "#/definitions/Microsoft.IDialog" + } + } + }, + "additionalProperties": false, + "patternProperties": { + "^\\$": { + "type": "string" + } + }, + "anyOf": [ + { + "title": "Reference", + "required": [ + "$copy" + ] + }, + { + "title": "Type", + "required": [ + "actions", + "$type" + ] + } + ] + }, + "Microsoft.OnConversationUpdateActivity": { + "$role": "unionType(Microsoft.ITriggerCondition)", + "title": "On ConversationUpdate activity", + "description": "Actions to perform on receipt of an activity with type 'ConversationUpdate'.", + "type": "object", + "properties": { + "$type": { + "title": "$type", + "description": "Defines the valid properties for the component you are configuring (from a dialog .schema file)", + "type": "string", + "pattern": "^[a-zA-Z][a-zA-Z0-9.]*$", + "const": "Microsoft.OnConversationUpdateActivity" + }, + "$copy": { + "title": "$copy", + "description": "Copy the definition by id from a .dialog file.", + "type": "string", + "pattern": "^(([a-zA-Z][a-zA-Z0-9.]*)?(#[a-zA-Z][a-zA-Z0-9.]*)?)$" + }, + "$id": { + "title": "$id", + "description": "Inline id for reuse of an inline definition", + "type": "string", + "pattern": "^([a-zA-Z][a-zA-Z0-9.]*)$" + }, + "$designer": { + "title": "$designer", + "type": "object", + "description": "Extra information for the Bot Framework Designer." + }, + "condition": { + "$role": "expression", + "title": "Condition", + "description": "Condition (expression).", + "examples": [ + "user.vip == true" + ], + "type": "string" + }, + "actions": { + "type": "array", + "description": "Sequence of actions to execute.", + "items": { + "$type": "Microsoft.IDialog", + "$ref": "#/definitions/Microsoft.IDialog" + } + } + }, + "additionalProperties": false, + "patternProperties": { + "^\\$": { + "type": "string" + } + }, + "anyOf": [ + { + "title": "Reference", + "required": [ + "$copy" + ] + }, + { + "title": "Type", + "required": [ + "actions", + "$type" + ] + } + ] + }, + "Microsoft.OnCustomEvent": { + "$role": "unionType(Microsoft.ITriggerCondition)", + "title": "On custom event", + "description": "Actions to perform when a custom event is detected. Use 'Emit a custom event' action to raise a custom event.", + "type": "object", + "properties": { + "$type": { + "title": "$type", + "description": "Defines the valid properties for the component you are configuring (from a dialog .schema file)", + "type": "string", + "pattern": "^[a-zA-Z][a-zA-Z0-9.]*$", + "const": "Microsoft.OnCustomEvent" + }, + "$copy": { + "title": "$copy", + "description": "Copy the definition by id from a .dialog file.", + "type": "string", + "pattern": "^(([a-zA-Z][a-zA-Z0-9.]*)?(#[a-zA-Z][a-zA-Z0-9.]*)?)$" + }, + "$id": { + "title": "$id", + "description": "Inline id for reuse of an inline definition", + "type": "string", + "pattern": "^([a-zA-Z][a-zA-Z0-9.]*)$" + }, + "$designer": { + "title": "$designer", + "type": "object", + "description": "Extra information for the Bot Framework Designer." + }, + "condition": { + "$role": "expression", + "title": "Condition", + "description": "Condition (expression).", + "examples": [ + "user.vip == true" + ], + "type": "string" + }, + "actions": { + "type": "array", + "description": "Sequence of actions to execute.", + "items": { + "$type": "Microsoft.IDialog", + "$ref": "#/definitions/Microsoft.IDialog" + } + }, + "event": { + "type": "string", + "title": "Custom event name", + "description": "Name of the custom event." + } + }, + "additionalProperties": false, + "patternProperties": { + "^\\$": { + "type": "string" + } + }, + "anyOf": [ + { + "title": "Reference", + "required": [ + "$copy" + ] + }, + { + "title": "Type", + "required": [ + "actions", + "event", + "$type" + ] + } + ] + }, + "Microsoft.OnDialogEvent": { + "$role": "unionType(Microsoft.ITriggerCondition)", + "title": "On dialog event", + "description": "Actions to perform when a specific dialog event occurs.", + "type": "object", + "properties": { + "$type": { + "title": "$type", + "description": "Defines the valid properties for the component you are configuring (from a dialog .schema file)", + "type": "string", + "pattern": "^[a-zA-Z][a-zA-Z0-9.]*$", + "const": "Microsoft.OnDialogEvent" + }, + "$copy": { + "title": "$copy", + "description": "Copy the definition by id from a .dialog file.", + "type": "string", + "pattern": "^(([a-zA-Z][a-zA-Z0-9.]*)?(#[a-zA-Z][a-zA-Z0-9.]*)?)$" + }, + "$id": { + "title": "$id", + "description": "Inline id for reuse of an inline definition", + "type": "string", + "pattern": "^([a-zA-Z][a-zA-Z0-9.]*)$" + }, + "$designer": { + "title": "$designer", + "type": "object", + "description": "Extra information for the Bot Framework Designer." + }, + "condition": { + "$role": "expression", + "title": "Condition", + "description": "Condition (expression).", + "examples": [ + "user.vip == true" + ], + "type": "string" + }, + "actions": { + "type": "array", + "description": "Sequence of actions to execute.", + "items": { + "$type": "Microsoft.IDialog", + "$ref": "#/definitions/Microsoft.IDialog" + } + }, + "event": { + "type": "string", + "title": "Dialog event name", + "description": "Name of dialog event." + } + }, + "additionalProperties": false, + "patternProperties": { + "^\\$": { + "type": "string" + } + }, + "anyOf": [ + { + "title": "Reference", + "required": [ + "$copy" + ] + }, + { + "title": "Type", + "required": [ + "actions", + "event", + "$type" + ] + } + ] + }, + "Microsoft.OnEndOfConversationActivity": { + "$role": "unionType(Microsoft.ITriggerCondition)", + "title": "On EndOfConversation activity", + "description": "Actions to perform on receipt of an activity with type 'EndOfConversation'.", + "type": "object", + "properties": { + "$type": { + "title": "$type", + "description": "Defines the valid properties for the component you are configuring (from a dialog .schema file)", + "type": "string", + "pattern": "^[a-zA-Z][a-zA-Z0-9.]*$", + "const": "Microsoft.OnEndOfConversationActivity" + }, + "$copy": { + "title": "$copy", + "description": "Copy the definition by id from a .dialog file.", + "type": "string", + "pattern": "^(([a-zA-Z][a-zA-Z0-9.]*)?(#[a-zA-Z][a-zA-Z0-9.]*)?)$" + }, + "$id": { + "title": "$id", + "description": "Inline id for reuse of an inline definition", + "type": "string", + "pattern": "^([a-zA-Z][a-zA-Z0-9.]*)$" + }, + "$designer": { + "title": "$designer", + "type": "object", + "description": "Extra information for the Bot Framework Designer." + }, + "condition": { + "$role": "expression", + "title": "Condition", + "description": "Condition (expression).", + "examples": [ + "user.vip == true" + ], + "type": "string" + }, + "actions": { + "type": "array", + "description": "Sequence of actions to execute.", + "items": { + "$type": "Microsoft.IDialog", + "$ref": "#/definitions/Microsoft.IDialog" + } + } + }, + "additionalProperties": false, + "patternProperties": { + "^\\$": { + "type": "string" + } + }, + "anyOf": [ + { + "title": "Reference", + "required": [ + "$copy" + ] + }, + { + "title": "Type", + "required": [ + "actions", + "$type" + ] + } + ] + }, + "Microsoft.OnError": { + "$role": "unionType(Microsoft.ITriggerCondition)", + "title": "On Error", + "description": "Action to perform when an 'Error' dialog event occurs.", + "type": "object", + "properties": { + "$type": { + "title": "$type", + "description": "Defines the valid properties for the component you are configuring (from a dialog .schema file)", + "type": "string", + "pattern": "^[a-zA-Z][a-zA-Z0-9.]*$", + "const": "Microsoft.OnError" + }, + "$copy": { + "title": "$copy", + "description": "Copy the definition by id from a .dialog file.", + "type": "string", + "pattern": "^(([a-zA-Z][a-zA-Z0-9.]*)?(#[a-zA-Z][a-zA-Z0-9.]*)?)$" + }, + "$id": { + "title": "$id", + "description": "Inline id for reuse of an inline definition", + "type": "string", + "pattern": "^([a-zA-Z][a-zA-Z0-9.]*)$" + }, + "$designer": { + "title": "$designer", + "type": "object", + "description": "Extra information for the Bot Framework Designer." + }, + "condition": { + "$role": "expression", + "title": "Condition", + "description": "Condition (expression).", + "examples": [ + "user.vip == true" + ], + "type": "string" + }, + "actions": { + "type": "array", + "description": "Sequence of actions to execute.", + "items": { + "$type": "Microsoft.IDialog", + "$ref": "#/definitions/Microsoft.IDialog" + } + } + }, + "additionalProperties": false, + "patternProperties": { + "^\\$": { + "type": "string" + } + }, + "anyOf": [ + { + "title": "Reference", + "required": [ + "$copy" + ] + }, + { + "title": "Type", + "required": [ + "actions", + "$type" + ] + } + ] + }, + "Microsoft.OnEventActivity": { + "$role": "unionType(Microsoft.ITriggerCondition)", + "title": "On Event activity", + "description": "Actions to perform on receipt of an activity with type 'Event'.", + "type": "object", + "properties": { + "$type": { + "title": "$type", + "description": "Defines the valid properties for the component you are configuring (from a dialog .schema file)", + "type": "string", + "pattern": "^[a-zA-Z][a-zA-Z0-9.]*$", + "const": "Microsoft.OnEventActivity" + }, + "$copy": { + "title": "$copy", + "description": "Copy the definition by id from a .dialog file.", + "type": "string", + "pattern": "^(([a-zA-Z][a-zA-Z0-9.]*)?(#[a-zA-Z][a-zA-Z0-9.]*)?)$" + }, + "$id": { + "title": "$id", + "description": "Inline id for reuse of an inline definition", + "type": "string", + "pattern": "^([a-zA-Z][a-zA-Z0-9.]*)$" + }, + "$designer": { + "title": "$designer", + "type": "object", + "description": "Extra information for the Bot Framework Designer." + }, + "condition": { + "$role": "expression", + "title": "Condition", + "description": "Condition (expression).", + "examples": [ + "user.vip == true" + ], + "type": "string" + }, + "actions": { + "type": "array", + "description": "Sequence of actions to execute.", + "items": { + "$type": "Microsoft.IDialog", + "$ref": "#/definitions/Microsoft.IDialog" + } + } + }, + "additionalProperties": false, + "patternProperties": { + "^\\$": { + "type": "string" + } + }, + "anyOf": [ + { + "title": "Reference", + "required": [ + "$copy" + ] + }, + { + "title": "Type", + "required": [ + "actions", + "$type" + ] + } + ] + }, + "Microsoft.OnHandoffActivity": { + "$role": "unionType(Microsoft.ITriggerCondition)", + "title": "On Handoff activity", + "description": "Actions to perform on receipt of an activity with type 'HandOff'.", + "type": "object", + "properties": { + "$type": { + "title": "$type", + "description": "Defines the valid properties for the component you are configuring (from a dialog .schema file)", + "type": "string", + "pattern": "^[a-zA-Z][a-zA-Z0-9.]*$", + "const": "Microsoft.OnHandoffActivity" + }, + "$copy": { + "title": "$copy", + "description": "Copy the definition by id from a .dialog file.", + "type": "string", + "pattern": "^(([a-zA-Z][a-zA-Z0-9.]*)?(#[a-zA-Z][a-zA-Z0-9.]*)?)$" + }, + "$id": { + "title": "$id", + "description": "Inline id for reuse of an inline definition", + "type": "string", + "pattern": "^([a-zA-Z][a-zA-Z0-9.]*)$" + }, + "$designer": { + "title": "$designer", + "type": "object", + "description": "Extra information for the Bot Framework Designer." + }, + "condition": { + "$role": "expression", + "title": "Condition", + "description": "Condition (expression).", + "examples": [ + "user.vip == true" + ], + "type": "string" + }, + "actions": { + "type": "array", + "description": "Sequence of actions to execute.", + "items": { + "$type": "Microsoft.IDialog", + "$ref": "#/definitions/Microsoft.IDialog" + } + } + }, + "additionalProperties": false, + "patternProperties": { + "^\\$": { + "type": "string" + } + }, + "anyOf": [ + { + "title": "Reference", + "required": [ + "$copy" + ] + }, + { + "title": "Type", + "required": [ + "actions", + "$type" + ] + } + ] + }, + "Microsoft.OnIntent": { + "$role": "unionType(Microsoft.ITriggerCondition)", + "title": "On intent recognition", + "description": "Actions to perform when specified intent is recognized.", + "type": "object", + "properties": { + "$type": { + "title": "$type", + "description": "Defines the valid properties for the component you are configuring (from a dialog .schema file)", + "type": "string", + "pattern": "^[a-zA-Z][a-zA-Z0-9.]*$", + "const": "Microsoft.OnIntent" + }, + "$copy": { + "title": "$copy", + "description": "Copy the definition by id from a .dialog file.", + "type": "string", + "pattern": "^(([a-zA-Z][a-zA-Z0-9.]*)?(#[a-zA-Z][a-zA-Z0-9.]*)?)$" + }, + "$id": { + "title": "$id", + "description": "Inline id for reuse of an inline definition", + "type": "string", + "pattern": "^([a-zA-Z][a-zA-Z0-9.]*)$" + }, + "$designer": { + "title": "$designer", + "type": "object", + "description": "Extra information for the Bot Framework Designer." + }, + "condition": { + "$role": "expression", + "title": "Condition", + "description": "Condition (expression).", + "examples": [ + "user.vip == true" + ], + "type": "string" + }, + "actions": { + "type": "array", + "description": "Sequence of actions to execute.", + "items": { + "$type": "Microsoft.IDialog", + "$ref": "#/definitions/Microsoft.IDialog" + } + }, + "intent": { + "type": "string", + "title": "Intent", + "description": "Name of intent." + }, + "entities": { + "type": "array", + "title": "Entities", + "description": "Required entities.", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false, + "patternProperties": { + "^\\$": { + "type": "string" + } + }, + "anyOf": [ + { + "title": "Reference", + "required": [ + "$copy" + ] + }, + { + "title": "Type", + "required": [ + "actions", + "intent", + "$type" + ] + } + ] + }, + "Microsoft.OnInvokeActivity": { + "$role": "unionType(Microsoft.ITriggerCondition)", + "title": "On Invoke activity", + "description": "Actions to perform on receipt of an activity with type 'Invoke'.", + "type": "object", + "properties": { + "$type": { + "title": "$type", + "description": "Defines the valid properties for the component you are configuring (from a dialog .schema file)", + "type": "string", + "pattern": "^[a-zA-Z][a-zA-Z0-9.]*$", + "const": "Microsoft.OnInvokeActivity" + }, + "$copy": { + "title": "$copy", + "description": "Copy the definition by id from a .dialog file.", + "type": "string", + "pattern": "^(([a-zA-Z][a-zA-Z0-9.]*)?(#[a-zA-Z][a-zA-Z0-9.]*)?)$" + }, + "$id": { + "title": "$id", + "description": "Inline id for reuse of an inline definition", + "type": "string", + "pattern": "^([a-zA-Z][a-zA-Z0-9.]*)$" + }, + "$designer": { + "title": "$designer", + "type": "object", + "description": "Extra information for the Bot Framework Designer." + }, + "condition": { + "$role": "expression", + "title": "Condition", + "description": "Condition (expression).", + "examples": [ + "user.vip == true" + ], + "type": "string" + }, + "actions": { + "type": "array", + "description": "Sequence of actions to execute.", + "items": { + "$type": "Microsoft.IDialog", + "$ref": "#/definitions/Microsoft.IDialog" + } + } + }, + "additionalProperties": false, + "patternProperties": { + "^\\$": { + "type": "string" + } + }, + "anyOf": [ + { + "title": "Reference", + "required": [ + "$copy" + ] + }, + { + "title": "Type", + "required": [ + "actions", + "$type" + ] + } + ] + }, + "Microsoft.OnMessageActivity": { + "$role": "unionType(Microsoft.ITriggerCondition)", + "title": "On Message activity", + "description": "Actions to perform on receipt of an activity with type 'Message'. Overrides Intent trigger.", + "type": "object", + "properties": { + "$type": { + "title": "$type", + "description": "Defines the valid properties for the component you are configuring (from a dialog .schema file)", + "type": "string", + "pattern": "^[a-zA-Z][a-zA-Z0-9.]*$", + "const": "Microsoft.OnMessageActivity" + }, + "$copy": { + "title": "$copy", + "description": "Copy the definition by id from a .dialog file.", + "type": "string", + "pattern": "^(([a-zA-Z][a-zA-Z0-9.]*)?(#[a-zA-Z][a-zA-Z0-9.]*)?)$" + }, + "$id": { + "title": "$id", + "description": "Inline id for reuse of an inline definition", + "type": "string", + "pattern": "^([a-zA-Z][a-zA-Z0-9.]*)$" + }, + "$designer": { + "title": "$designer", + "type": "object", + "description": "Extra information for the Bot Framework Designer." + }, + "condition": { + "$role": "expression", + "title": "Condition", + "description": "Condition (expression).", + "examples": [ + "user.vip == true" + ], + "type": "string" + }, + "actions": { + "type": "array", + "description": "Sequence of actions to execute.", + "items": { + "$type": "Microsoft.IDialog", + "$ref": "#/definitions/Microsoft.IDialog" + } + } + }, + "additionalProperties": false, + "patternProperties": { + "^\\$": { + "type": "string" + } + }, + "anyOf": [ + { + "title": "Reference", + "required": [ + "$copy" + ] + }, + { + "title": "Type", + "required": [ + "actions", + "$type" + ] + } + ] + }, + "Microsoft.OnMessageDeleteActivity": { + "$role": "unionType(Microsoft.ITriggerCondition)", + "title": "On MessageDelete activity", + "description": "Actions to perform on receipt of an activity with type 'MessageDelete'.", + "type": "object", + "properties": { + "$type": { + "title": "$type", + "description": "Defines the valid properties for the component you are configuring (from a dialog .schema file)", + "type": "string", + "pattern": "^[a-zA-Z][a-zA-Z0-9.]*$", + "const": "Microsoft.OnMessageDeleteActivity" + }, + "$copy": { + "title": "$copy", + "description": "Copy the definition by id from a .dialog file.", + "type": "string", + "pattern": "^(([a-zA-Z][a-zA-Z0-9.]*)?(#[a-zA-Z][a-zA-Z0-9.]*)?)$" + }, + "$id": { + "title": "$id", + "description": "Inline id for reuse of an inline definition", + "type": "string", + "pattern": "^([a-zA-Z][a-zA-Z0-9.]*)$" + }, + "$designer": { + "title": "$designer", + "type": "object", + "description": "Extra information for the Bot Framework Designer." + }, + "condition": { + "$role": "expression", + "title": "Condition", + "description": "Condition (expression).", + "examples": [ + "user.vip == true" + ], + "type": "string" + }, + "actions": { + "type": "array", + "description": "Sequence of actions to execute.", + "items": { + "$type": "Microsoft.IDialog", + "$ref": "#/definitions/Microsoft.IDialog" + } + } + }, + "additionalProperties": false, + "patternProperties": { + "^\\$": { + "type": "string" + } + }, + "anyOf": [ + { + "title": "Reference", + "required": [ + "$copy" + ] + }, + { + "title": "Type", + "required": [ + "actions", + "$type" + ] + } + ] + }, + "Microsoft.OnMessageReactionActivity": { + "$role": "unionType(Microsoft.ITriggerCondition)", + "title": "On MessageReaction activity", + "description": "Actions to perform on receipt of an activity with type 'MessageReaction'.", + "type": "object", + "properties": { + "$type": { + "title": "$type", + "description": "Defines the valid properties for the component you are configuring (from a dialog .schema file)", + "type": "string", + "pattern": "^[a-zA-Z][a-zA-Z0-9.]*$", + "const": "Microsoft.OnMessageReactionActivity" + }, + "$copy": { + "title": "$copy", + "description": "Copy the definition by id from a .dialog file.", + "type": "string", + "pattern": "^(([a-zA-Z][a-zA-Z0-9.]*)?(#[a-zA-Z][a-zA-Z0-9.]*)?)$" + }, + "$id": { + "title": "$id", + "description": "Inline id for reuse of an inline definition", + "type": "string", + "pattern": "^([a-zA-Z][a-zA-Z0-9.]*)$" + }, + "$designer": { + "title": "$designer", + "type": "object", + "description": "Extra information for the Bot Framework Designer." + }, + "condition": { + "$role": "expression", + "title": "Condition", + "description": "Condition (expression).", + "examples": [ + "user.vip == true" + ], + "type": "string" + }, + "actions": { + "type": "array", + "description": "Sequence of actions to execute.", + "items": { + "$type": "Microsoft.IDialog", + "$ref": "#/definitions/Microsoft.IDialog" + } + } + }, + "additionalProperties": false, + "patternProperties": { + "^\\$": { + "type": "string" + } + }, + "anyOf": [ + { + "title": "Reference", + "required": [ + "$copy" + ] + }, + { + "title": "Type", + "required": [ + "actions", + "$type" + ] + } + ] + }, + "Microsoft.OnMessageUpdateActivity": { + "$role": "unionType(Microsoft.ITriggerCondition)", + "title": "On MessageUpdate activity", + "description": "Actions to perform on receipt of an activity with type 'MessageUpdate'.", + "type": "object", + "properties": { + "$type": { + "title": "$type", + "description": "Defines the valid properties for the component you are configuring (from a dialog .schema file)", + "type": "string", + "pattern": "^[a-zA-Z][a-zA-Z0-9.]*$", + "const": "Microsoft.OnMessageUpdateActivity" + }, + "$copy": { + "title": "$copy", + "description": "Copy the definition by id from a .dialog file.", + "type": "string", + "pattern": "^(([a-zA-Z][a-zA-Z0-9.]*)?(#[a-zA-Z][a-zA-Z0-9.]*)?)$" + }, + "$id": { + "title": "$id", + "description": "Inline id for reuse of an inline definition", + "type": "string", + "pattern": "^([a-zA-Z][a-zA-Z0-9.]*)$" + }, + "$designer": { + "title": "$designer", + "type": "object", + "description": "Extra information for the Bot Framework Designer." + }, + "condition": { + "$role": "expression", + "title": "Condition", + "description": "Condition (expression).", + "examples": [ + "user.vip == true" + ], + "type": "string" + }, + "actions": { + "type": "array", + "description": "Sequence of actions to execute.", + "items": { + "$type": "Microsoft.IDialog", + "$ref": "#/definitions/Microsoft.IDialog" + } + } + }, + "additionalProperties": false, + "patternProperties": { + "^\\$": { + "type": "string" + } + }, + "anyOf": [ + { + "title": "Reference", + "required": [ + "$copy" + ] + }, + { + "title": "Type", + "required": [ + "actions", + "$type" + ] + } + ] + }, + "Microsoft.OnRepromptDialog": { + "$role": "unionType(Microsoft.ITriggerCondition)", + "title": "On RepromptDialog", + "description": "Actions to perform when 'RepromptDialog' event occurs.", + "type": "object", + "properties": { + "$type": { + "title": "$type", + "description": "Defines the valid properties for the component you are configuring (from a dialog .schema file)", + "type": "string", + "pattern": "^[a-zA-Z][a-zA-Z0-9.]*$", + "const": "Microsoft.OnRepromptDialog" + }, + "$copy": { + "title": "$copy", + "description": "Copy the definition by id from a .dialog file.", + "type": "string", + "pattern": "^(([a-zA-Z][a-zA-Z0-9.]*)?(#[a-zA-Z][a-zA-Z0-9.]*)?)$" + }, + "$id": { + "title": "$id", + "description": "Inline id for reuse of an inline definition", + "type": "string", + "pattern": "^([a-zA-Z][a-zA-Z0-9.]*)$" + }, + "$designer": { + "title": "$designer", + "type": "object", + "description": "Extra information for the Bot Framework Designer." + }, + "condition": { + "$role": "expression", + "title": "Condition", + "description": "Condition (expression).", + "examples": [ + "user.vip == true" + ], + "type": "string" + }, + "actions": { + "type": "array", + "description": "Sequence of actions to execute.", + "items": { + "$type": "Microsoft.IDialog", + "$ref": "#/definitions/Microsoft.IDialog" + } + } + }, + "additionalProperties": false, + "patternProperties": { + "^\\$": { + "type": "string" + } + }, + "anyOf": [ + { + "title": "Reference", + "required": [ + "$copy" + ] + }, + { + "title": "Type", + "required": [ + "actions", + "$type" + ] + } + ] + }, + "Microsoft.OnTypingActivity": { + "$role": "unionType(Microsoft.ITriggerCondition)", + "title": "On Typing activity", + "description": "Actions to perform on receipt of an activity with type 'Typing'.", + "type": "object", + "properties": { + "$type": { + "title": "$type", + "description": "Defines the valid properties for the component you are configuring (from a dialog .schema file)", + "type": "string", + "pattern": "^[a-zA-Z][a-zA-Z0-9.]*$", + "const": "Microsoft.OnTypingActivity" + }, + "$copy": { + "title": "$copy", + "description": "Copy the definition by id from a .dialog file.", + "type": "string", + "pattern": "^(([a-zA-Z][a-zA-Z0-9.]*)?(#[a-zA-Z][a-zA-Z0-9.]*)?)$" + }, + "$id": { + "title": "$id", + "description": "Inline id for reuse of an inline definition", + "type": "string", + "pattern": "^([a-zA-Z][a-zA-Z0-9.]*)$" + }, + "$designer": { + "title": "$designer", + "type": "object", + "description": "Extra information for the Bot Framework Designer." + }, + "condition": { + "$role": "expression", + "title": "Condition", + "description": "Condition (expression).", + "examples": [ + "user.vip == true" + ], + "type": "string" + }, + "actions": { + "type": "array", + "description": "Sequence of actions to execute.", + "items": { + "$type": "Microsoft.IDialog", + "$ref": "#/definitions/Microsoft.IDialog" + } + } + }, + "additionalProperties": false, + "patternProperties": { + "^\\$": { + "type": "string" + } + }, + "anyOf": [ + { + "title": "Reference", + "required": [ + "$copy" + ] + }, + { + "title": "Type", + "required": [ + "actions", + "$type" + ] + } + ] + }, + "Microsoft.OnUnknownIntent": { + "title": "On unknown intent", + "description": "Action to perform when user input is unrecognized and if none of the 'on intent recognition' triggers match recognized intent.", + "type": "object", + "$role": "unionType(Microsoft.ITriggerCondition)", + "properties": { + "$type": { + "title": "$type", + "description": "Defines the valid properties for the component you are configuring (from a dialog .schema file)", + "type": "string", + "pattern": "^[a-zA-Z][a-zA-Z0-9.]*$", + "const": "Microsoft.OnUnknownIntent" + }, + "$copy": { + "title": "$copy", + "description": "Copy the definition by id from a .dialog file.", + "type": "string", + "pattern": "^(([a-zA-Z][a-zA-Z0-9.]*)?(#[a-zA-Z][a-zA-Z0-9.]*)?)$" + }, + "$id": { + "title": "$id", + "description": "Inline id for reuse of an inline definition", + "type": "string", + "pattern": "^([a-zA-Z][a-zA-Z0-9.]*)$" + }, + "$designer": { + "title": "$designer", + "type": "object", + "description": "Extra information for the Bot Framework Designer." + }, + "condition": { + "$role": "expression", + "title": "Condition", + "description": "Condition (expression).", + "examples": [ + "user.vip == true" + ], + "type": "string" + }, + "actions": { + "type": "array", + "description": "Sequence of actions to execute.", + "items": { + "$type": "Microsoft.IDialog", + "$ref": "#/definitions/Microsoft.IDialog" + } + } + }, + "additionalProperties": false, + "patternProperties": { + "^\\$": { + "type": "string" + } + }, + "anyOf": [ + { + "title": "Reference", + "required": [ + "$copy" + ] + }, + { + "title": "Type", + "required": [ + "actions", + "$type" + ] + } + ] + }, + "Microsoft.OrdinalEntityRecognizer": { + "$role": "unionType(Microsoft.EntityRecognizers)", + "title": "Ordinal Entity Recognizer", + "description": "Recognizer which recognizes ordinals (example: first, second, 3rd).", + "type": "object", + "properties": { + "$type": { + "title": "$type", + "description": "Defines the valid properties for the component you are configuring (from a dialog .schema file)", + "type": "string", + "pattern": "^[a-zA-Z][a-zA-Z0-9.]*$", + "const": "Microsoft.OrdinalEntityRecognizer" + }, + "$copy": { + "title": "$copy", + "description": "Copy the definition by id from a .dialog file.", + "type": "string", + "pattern": "^(([a-zA-Z][a-zA-Z0-9.]*)?(#[a-zA-Z][a-zA-Z0-9.]*)?)$" + }, + "$id": { + "title": "$id", + "description": "Inline id for reuse of an inline definition", + "type": "string", + "pattern": "^([a-zA-Z][a-zA-Z0-9.]*)$" + }, + "$designer": { + "title": "$designer", + "type": "object", + "description": "Extra information for the Bot Framework Designer." + } + }, + "additionalProperties": false, + "patternProperties": { + "^\\$": { + "type": "string" + } + }, + "anyOf": [ + { + "title": "Reference", + "required": [ + "$copy" + ] + }, + { + "title": "Type", + "required": [ + "$type" + ] + } + ] + }, + "Microsoft.PercentageEntityRecognizer": { + "$role": "unionType(Microsoft.EntityRecognizers)", + "title": "Percentage Entity Recognizer", + "description": "Recognizer which recognizes percentages.", + "type": "object", + "properties": { + "$type": { + "title": "$type", + "description": "Defines the valid properties for the component you are configuring (from a dialog .schema file)", + "type": "string", + "pattern": "^[a-zA-Z][a-zA-Z0-9.]*$", + "const": "Microsoft.PercentageEntityRecognizer" + }, + "$copy": { + "title": "$copy", + "description": "Copy the definition by id from a .dialog file.", + "type": "string", + "pattern": "^(([a-zA-Z][a-zA-Z0-9.]*)?(#[a-zA-Z][a-zA-Z0-9.]*)?)$" + }, + "$id": { + "title": "$id", + "description": "Inline id for reuse of an inline definition", + "type": "string", + "pattern": "^([a-zA-Z][a-zA-Z0-9.]*)$" + }, + "$designer": { + "title": "$designer", + "type": "object", + "description": "Extra information for the Bot Framework Designer." + } + }, + "additionalProperties": false, + "patternProperties": { + "^\\$": { + "type": "string" + } + }, + "anyOf": [ + { + "title": "Reference", + "required": [ + "$copy" + ] + }, + { + "title": "Type", + "required": [ + "$type" + ] + } + ] + }, + "Microsoft.PhoneNumberEntityRecognizer": { + "$role": "unionType(Microsoft.EntityRecognizers)", + "title": "Phone Number Entity Recognizer", + "description": "Recognizer which recognizes phone numbers.", + "type": "object", + "properties": { + "$type": { + "title": "$type", + "description": "Defines the valid properties for the component you are configuring (from a dialog .schema file)", + "type": "string", + "pattern": "^[a-zA-Z][a-zA-Z0-9.]*$", + "const": "Microsoft.PhoneNumberEntityRecognizer" + }, + "$copy": { + "title": "$copy", + "description": "Copy the definition by id from a .dialog file.", + "type": "string", + "pattern": "^(([a-zA-Z][a-zA-Z0-9.]*)?(#[a-zA-Z][a-zA-Z0-9.]*)?)$" + }, + "$id": { + "title": "$id", + "description": "Inline id for reuse of an inline definition", + "type": "string", + "pattern": "^([a-zA-Z][a-zA-Z0-9.]*)$" + }, + "$designer": { + "title": "$designer", + "type": "object", + "description": "Extra information for the Bot Framework Designer." + } + }, + "additionalProperties": false, + "patternProperties": { + "^\\$": { + "type": "string" + } + }, + "anyOf": [ + { + "title": "Reference", + "required": [ + "$copy" + ] + }, + { + "title": "Type", + "required": [ + "$type" + ] + } + ] + }, + "Microsoft.QnAMakerDialog": { + "$role": "unionType(Microsoft.IDialog)", + "title": "QnAMaker Dialog", + "description": "Dialog which uses QnAMAker knowledge base to answer questions.", + "type": "object", + "additionalProperties": false, + "properties": { + "$type": { + "title": "$type", + "description": "Defines the valid properties for the component you are configuring (from a dialog .schema file)", + "type": "string", + "pattern": "^[a-zA-Z][a-zA-Z0-9.]*$", + "const": "Microsoft.QnAMakerDialog" + }, + "$copy": { + "title": "$copy", + "description": "Copy the definition by id from a .dialog file.", + "type": "string", + "pattern": "^(([a-zA-Z][a-zA-Z0-9.]*)?(#[a-zA-Z][a-zA-Z0-9.]*)?)$" + }, + "$id": { + "title": "$id", + "description": "Inline id for reuse of an inline definition", + "type": "string", + "pattern": "^([a-zA-Z][a-zA-Z0-9.]*)$" + }, + "$designer": { + "title": "$designer", + "type": "object", + "description": "Extra information for the Bot Framework Designer." + }, + "knowledgeBaseId": { + "$role": "expression", + "title": "KnowledgeBase Id", + "description": "KnowledgeBase Id of your QnA Maker KnowledgeBase.", + "default": "settings.qna.knowledgebaseid", + "type": "string" + }, + "endpointKey": { + "$role": "expression", + "title": "Endpoint Key", + "description": "Endpoint key for the QnA Maker KB.", + "default": "settings.qna.endpointkey", + "type": "string" + }, + "hostname": { + "$role": "expression", + "title": "Hostname", + "description": "Hostname for your QnA Maker service.", + "default": "settings.qna.hostname", + "examples": [ + "https://yourserver.azurewebsites.net/qnamaker" + ], + "type": "string" + }, + "noAnswer": { + "$type": "Microsoft.IActivityTemplate", + "title": "Fallback answer", + "description": "Default answer to return when none found in KB.", + "default": "Sorry, I did not find an answer.", + "$ref": "#/definitions/Microsoft.IActivityTemplate" + }, + "threshold": { + "type": "number", + "title": "Threshold", + "description": "Threshold score to filter results.", + "default": 0.3 + }, + "activeLearningCardTitle": { + "type": "string", + "title": "Active learning card title", + "description": "Title for active learning suggestions card.", + "default": "Did you mean:" + }, + "cardNoMatchText": { + "type": "string", + "title": "Card no match text", + "description": "Text for no match option.", + "default": "None of the above." + }, + "cardNoMatchResponse ": { + "$type": "Microsoft.IActivityTemplate", + "title": "Card no match response", + "description": "Custom response when no match option was selected.", + "default": "Thanks for the feedback.", + "$ref": "#/definitions/Microsoft.IActivityTemplate" + }, + "strictFilters": { + "type": "array", + "title": "Strict Filter Property", + "description": "Memory property that holds strict filters to use when calling the QnA Maker KB.", + "items": { + "type": "object" + } + } + }, + "patternProperties": { + "^\\$": { + "type": "string" + } + }, + "anyOf": [ + { + "title": "Reference", + "required": [ + "$copy" + ] + }, + { + "title": "Type", + "required": [ + "knowledgeBaseId", + "endpointKey", + "hostname", + "$type" + ] + } + ] + }, + "Microsoft.RandomSelector": { + "$role": "unionType(Microsoft.ITriggerSelector)", + "title": "Random rule selector", + "description": "Select most specific true rule", + "type": "object", + "properties": { + "$type": { + "title": "$type", + "description": "Defines the valid properties for the component you are configuring (from a dialog .schema file)", + "type": "string", + "pattern": "^[a-zA-Z][a-zA-Z0-9.]*$", + "const": "Microsoft.RandomSelector" + }, + "$copy": { + "title": "$copy", + "description": "Copy the definition by id from a .dialog file.", + "type": "string", + "pattern": "^(([a-zA-Z][a-zA-Z0-9.]*)?(#[a-zA-Z][a-zA-Z0-9.]*)?)$" + }, + "$id": { + "title": "$id", + "description": "Inline id for reuse of an inline definition", + "type": "string", + "pattern": "^([a-zA-Z][a-zA-Z0-9.]*)$" + }, + "$designer": { + "title": "$designer", + "type": "object", + "description": "Extra information for the Bot Framework Designer." + }, + "seed": { + "type": "integer" + } + }, + "additionalProperties": false, + "patternProperties": { + "^\\$": { + "type": "string" + } + }, + "anyOf": [ + { + "title": "Reference", + "required": [ + "$copy" + ] + }, + { + "title": "Type", + "required": [ + "$type" + ] + } + ] + }, + "Microsoft.RegExEntityRecognizer": { + "$role": "unionType(Microsoft.EntityRecognizers)", + "title": "Regex Entity Recognizer", + "description": "Recognizer which recognizes patterns of input based on regex.", + "type": "object", + "properties": { + "$type": { + "title": "$type", + "description": "Defines the valid properties for the component you are configuring (from a dialog .schema file)", + "type": "string", + "pattern": "^[a-zA-Z][a-zA-Z0-9.]*$", + "const": "Microsoft.RegExEntityRecognizer" + }, + "$copy": { + "title": "$copy", + "description": "Copy the definition by id from a .dialog file.", + "type": "string", + "pattern": "^(([a-zA-Z][a-zA-Z0-9.]*)?(#[a-zA-Z][a-zA-Z0-9.]*)?)$" + }, + "$id": { + "title": "$id", + "description": "Inline id for reuse of an inline definition", + "type": "string", + "pattern": "^([a-zA-Z][a-zA-Z0-9.]*)$" + }, + "$designer": { + "title": "$designer", + "type": "object", + "description": "Extra information for the Bot Framework Designer." + }, + "name": { + "type": "string", + "title": "Name", + "description": "Name of the entity" + }, + "pattern": { + "type": "string", + "title": "Pattern", + "description": "Pattern expressed as regular expression." + } + }, + "additionalProperties": false, + "patternProperties": { + "^\\$": { + "type": "string" + } + }, + "anyOf": [ + { + "title": "Reference", + "required": [ + "$copy" + ] + }, + { + "title": "Type", + "required": [ + "name", + "pattern", + "$type" + ] + } + ] + }, + "Microsoft.RegexRecognizer": { + "$role": "unionType(Microsoft.IRecognizer)", + "title": "Regex recognizer", + "description": "Use regular expressions to recognize intents and entities from user input.", + "type": "object", + "properties": { + "$type": { + "title": "$type", + "description": "Defines the valid properties for the component you are configuring (from a dialog .schema file)", + "type": "string", + "pattern": "^[a-zA-Z][a-zA-Z0-9.]*$", + "const": "Microsoft.RegexRecognizer" + }, + "$copy": { + "title": "$copy", + "description": "Copy the definition by id from a .dialog file.", + "type": "string", + "pattern": "^(([a-zA-Z][a-zA-Z0-9.]*)?(#[a-zA-Z][a-zA-Z0-9.]*)?)$" + }, + "$id": { + "title": "$id", + "description": "Inline id for reuse of an inline definition", + "type": "string", + "pattern": "^([a-zA-Z][a-zA-Z0-9.]*)$" + }, + "$designer": { + "title": "$designer", + "type": "object", + "description": "Extra information for the Bot Framework Designer." + }, + "intents": { + "type": "array", + "title": "RegEx patterns to intents", + "description": "Collection of patterns to match for an intent.", + "items": { + "type": "object", + "properties": { + "intent": { + "type": "string", + "title": "Intent", + "description": "The intent name." + }, + "pattern": { + "type": "string", + "title": "Pattern", + "description": "The regular expression pattern." + } + } + } + }, + "entities": { + "type": "array", + "title": "Entity recognizers", + "description": "Collection of entity recognizers to use.", + "items": { + "$type": "Microsoft.EntityRecognizers", + "$ref": "#/definitions/Microsoft.EntityRecognizers" + } + } + }, + "additionalProperties": false, + "patternProperties": { + "^\\$": { + "type": "string" + } + }, + "anyOf": [ + { + "title": "Reference", + "required": [ + "$copy" + ] + }, + { + "title": "Type", + "required": [ + "intents", + "$type" + ] + } + ] + }, + "Microsoft.RepeatDialog": { + "$role": "unionType(Microsoft.IDialog)", + "type": "object", + "title": "Repeat dialog", + "description": "Repeat current dialog.", + "properties": { + "$type": { + "title": "$type", + "description": "Defines the valid properties for the component you are configuring (from a dialog .schema file)", + "type": "string", + "pattern": "^[a-zA-Z][a-zA-Z0-9.]*$", + "const": "Microsoft.RepeatDialog" + }, + "$copy": { + "title": "$copy", + "description": "Copy the definition by id from a .dialog file.", + "type": "string", + "pattern": "^(([a-zA-Z][a-zA-Z0-9.]*)?(#[a-zA-Z][a-zA-Z0-9.]*)?)$" + }, + "$id": { + "title": "$id", + "description": "Inline id for reuse of an inline definition", + "type": "string", + "pattern": "^([a-zA-Z][a-zA-Z0-9.]*)$" + }, + "$designer": { + "title": "$designer", + "type": "object", + "description": "Extra information for the Bot Framework Designer." + } + }, + "additionalProperties": false, + "patternProperties": { + "^\\$": { + "type": "string" + } + }, + "anyOf": [ + { + "title": "Reference", + "required": [ + "$copy" + ] + }, + { + "title": "Type", + "required": [ + "$type" + ] + } + ] + }, + "Microsoft.ReplaceDialog": { + "$role": "unionType(Microsoft.IDialog)", + "type": "object", + "title": "Replace dialog", + "description": "Replace current dialog with another dialog.", + "properties": { + "$type": { + "title": "$type", + "description": "Defines the valid properties for the component you are configuring (from a dialog .schema file)", + "type": "string", + "pattern": "^[a-zA-Z][a-zA-Z0-9.]*$", + "const": "Microsoft.ReplaceDialog" + }, + "$copy": { + "title": "$copy", + "description": "Copy the definition by id from a .dialog file.", + "type": "string", + "pattern": "^(([a-zA-Z][a-zA-Z0-9.]*)?(#[a-zA-Z][a-zA-Z0-9.]*)?)$" + }, + "$id": { + "title": "$id", + "description": "Inline id for reuse of an inline definition", + "type": "string", + "pattern": "^([a-zA-Z][a-zA-Z0-9.]*)$" + }, + "$designer": { + "title": "$designer", + "type": "object", + "description": "Extra information for the Bot Framework Designer." + }, + "dialog": { + "$type": "Microsoft.IDialog", + "title": "Dialog name", + "description": "Current dialog will be replaced by this dialog.", + "$ref": "#/definitions/Microsoft.IDialog" + }, + "options": { + "type": "object", + "title": "Options", + "description": "One or more options that are passed to the dialog that is called.", + "additionalProperties": { + "type": "string", + "title": "Options" + } + } + }, + "additionalProperties": false, + "patternProperties": { + "^\\$": { + "type": "string" + } + }, + "anyOf": [ + { + "title": "Reference", + "required": [ + "$copy" + ] + }, + { + "title": "Type", + "required": [ + "$type" + ] + } + ] + }, + "Microsoft.SendActivity": { + "$role": "unionType(Microsoft.IDialog)", + "title": "Send an activity", + "description": "Respond with an activity.", + "type": "object", + "properties": { + "$type": { + "title": "$type", + "description": "Defines the valid properties for the component you are configuring (from a dialog .schema file)", + "type": "string", + "pattern": "^[a-zA-Z][a-zA-Z0-9.]*$", + "const": "Microsoft.SendActivity" + }, + "$copy": { + "title": "$copy", + "description": "Copy the definition by id from a .dialog file.", + "type": "string", + "pattern": "^(([a-zA-Z][a-zA-Z0-9.]*)?(#[a-zA-Z][a-zA-Z0-9.]*)?)$" + }, + "$id": { + "title": "$id", + "description": "Inline id for reuse of an inline definition", + "type": "string", + "pattern": "^([a-zA-Z][a-zA-Z0-9.]*)$" + }, + "$designer": { + "title": "$designer", + "type": "object", + "description": "Extra information for the Bot Framework Designer." + }, + "activity": { + "$type": "Microsoft.IActivityTemplate", + "title": "Activity", + "description": "Activity to send.", + "$ref": "#/definitions/Microsoft.IActivityTemplate" + } + }, + "additionalProperties": false, + "patternProperties": { + "^\\$": { + "type": "string" + } + }, + "anyOf": [ + { + "title": "Reference", + "required": [ + "$copy" + ] + }, + { + "title": "Type", + "required": [ + "$type" + ] + } + ] + }, + "Microsoft.SetProperty": { + "$role": "unionType(Microsoft.IDialog)", + "title": "Set property", + "description": "Set property to a value.", + "type": "object", + "properties": { + "$type": { + "title": "$type", + "description": "Defines the valid properties for the component you are configuring (from a dialog .schema file)", + "type": "string", + "pattern": "^[a-zA-Z][a-zA-Z0-9.]*$", + "const": "Microsoft.SetProperty" + }, + "$copy": { + "title": "$copy", + "description": "Copy the definition by id from a .dialog file.", + "type": "string", + "pattern": "^(([a-zA-Z][a-zA-Z0-9.]*)?(#[a-zA-Z][a-zA-Z0-9.]*)?)$" + }, + "$id": { + "title": "$id", + "description": "Inline id for reuse of an inline definition", + "type": "string", + "pattern": "^([a-zA-Z][a-zA-Z0-9.]*)$" + }, + "$designer": { + "title": "$designer", + "type": "object", + "description": "Extra information for the Bot Framework Designer." + }, + "property": { + "$role": "expression", + "title": "Property", + "description": "Property (named location to store information).", + "examples": [ + "user.age" + ], + "type": "string" + }, + "value": { + "$role": "expression", + "title": "Value", + "description": "New value or expression.", + "examples": [ + "'milk'", + "dialog.favColor", + "dialog.favColor == 'red'" + ], + "type": "string" + } + }, + "additionalProperties": false, + "patternProperties": { + "^\\$": { + "type": "string" + } + }, + "anyOf": [ + { + "title": "Reference", + "required": [ + "$copy" + ] + }, + { + "title": "Type", + "required": [ + "property", + "value", + "$type" + ] + } + ] + }, + "Microsoft.StaticActivityTemplate": { + "$role": "unionType(Microsoft.IActivityTemplate)", + "title": "Microsoft Static Activity Template", + "description": "This allows you to define a static Activity object", + "type": "object", + "properties": { + "$type": { + "title": "$type", + "description": "Defines the valid properties for the component you are configuring (from a dialog .schema file)", + "type": "string", + "pattern": "^[a-zA-Z][a-zA-Z0-9.]*$", + "const": "Microsoft.StaticActivityTemplate" + }, + "$copy": { + "title": "$copy", + "description": "Copy the definition by id from a .dialog file.", + "type": "string", + "pattern": "^(([a-zA-Z][a-zA-Z0-9.]*)?(#[a-zA-Z][a-zA-Z0-9.]*)?)$" + }, + "$id": { + "title": "$id", + "description": "Inline id for reuse of an inline definition", + "type": "string", + "pattern": "^([a-zA-Z][a-zA-Z0-9.]*)$" + }, + "$designer": { + "title": "$designer", + "type": "object", + "description": "Extra information for the Bot Framework Designer." + }, + "activity": { + "type": "object", + "title": "Activity", + "Description": "A static Activity to used" + } + }, + "additionalProperties": false, + "patternProperties": { + "^\\$": { + "type": "string" + } + }, + "anyOf": [ + { + "title": "Reference", + "required": [ + "$copy" + ] + }, + { + "title": "Type", + "required": [ + "activity", + "$type" + ] + } + ] + }, + "Microsoft.SwitchCondition": { + "$role": "unionType(Microsoft.IDialog)", + "title": "Switch condition", + "description": "Execute different actions based on the value of a property.", + "type": "object", + "properties": { + "$type": { + "title": "$type", + "description": "Defines the valid properties for the component you are configuring (from a dialog .schema file)", + "type": "string", + "pattern": "^[a-zA-Z][a-zA-Z0-9.]*$", + "const": "Microsoft.SwitchCondition" + }, + "$copy": { + "title": "$copy", + "description": "Copy the definition by id from a .dialog file.", + "type": "string", + "pattern": "^(([a-zA-Z][a-zA-Z0-9.]*)?(#[a-zA-Z][a-zA-Z0-9.]*)?)$" + }, + "$id": { + "title": "$id", + "description": "Inline id for reuse of an inline definition", + "type": "string", + "pattern": "^([a-zA-Z][a-zA-Z0-9.]*)$" + }, + "$designer": { + "title": "$designer", + "type": "object", + "description": "Extra information for the Bot Framework Designer." + }, + "condition": { + "$role": "expression", + "title": "Condition", + "description": "Property to evaluate.", + "examples": [ + "user.favColor" + ], + "type": "string" + }, + "cases": { + "type": "array", + "title": "Cases", + "desc": "Actions for each possible condition.", + "items": { + "type": "object", + "required": [ + "value", + "case" + ], + "properties": { + "value": { + "$role": "expression", + "title": "Value", + "description": "Value.", + "examples": [ + "'red'", + "dialog.colors.red" + ], + "type": "string" + }, + "actions": { + "type": "array", + "title": "Actions", + "description": "Actions to execute.", + "items": { + "$type": "Microsoft.IDialog", + "$ref": "#/definitions/Microsoft.IDialog" + } + } + } + } + }, + "default": { + "type": "array", + "title": "Default", + "description": "Actions to execute if none of the cases meet the condition.", + "items": { + "$type": "Microsoft.IDialog", + "$ref": "#/definitions/Microsoft.IDialog" + } + } + }, + "additionalProperties": false, + "patternProperties": { + "^\\$": { + "type": "string" + } + }, + "anyOf": [ + { + "title": "Reference", + "required": [ + "$copy" + ] + }, + { + "title": "Type", + "required": [ + "condition", + "$type" + ] + } + ] + }, + "Microsoft.TemperatureEntityRecognizer": { + "$role": "unionType(Microsoft.EntityRecognizers)", + "title": "Temperature Entity Recognizer", + "description": "Recognizer which recognizes temperatures.", + "type": "object", + "properties": { + "$type": { + "title": "$type", + "description": "Defines the valid properties for the component you are configuring (from a dialog .schema file)", + "type": "string", + "pattern": "^[a-zA-Z][a-zA-Z0-9.]*$", + "const": "Microsoft.TemperatureEntityRecognizer" + }, + "$copy": { + "title": "$copy", + "description": "Copy the definition by id from a .dialog file.", + "type": "string", + "pattern": "^(([a-zA-Z][a-zA-Z0-9.]*)?(#[a-zA-Z][a-zA-Z0-9.]*)?)$" + }, + "$id": { + "title": "$id", + "description": "Inline id for reuse of an inline definition", + "type": "string", + "pattern": "^([a-zA-Z][a-zA-Z0-9.]*)$" + }, + "$designer": { + "title": "$designer", + "type": "object", + "description": "Extra information for the Bot Framework Designer." + } + }, + "additionalProperties": false, + "patternProperties": { + "^\\$": { + "type": "string" + } + }, + "anyOf": [ + { + "title": "Reference", + "required": [ + "$copy" + ] + }, + { + "title": "Type", + "required": [ + "$type" + ] + } + ] + }, + "Microsoft.TextInput": { + "$role": "unionType(Microsoft.IDialog)", + "type": "object", + "title": "Text input dialog", + "description": "Collection information - Ask for a word or sentence.", + "properties": { + "$type": { + "title": "$type", + "description": "Defines the valid properties for the component you are configuring (from a dialog .schema file)", + "type": "string", + "pattern": "^[a-zA-Z][a-zA-Z0-9.]*$", + "const": "Microsoft.TextInput" + }, + "$copy": { + "title": "$copy", + "description": "Copy the definition by id from a .dialog file.", + "type": "string", + "pattern": "^(([a-zA-Z][a-zA-Z0-9.]*)?(#[a-zA-Z][a-zA-Z0-9.]*)?)$" + }, + "$id": { + "title": "$id", + "description": "Inline id for reuse of an inline definition", + "type": "string", + "pattern": "^([a-zA-Z][a-zA-Z0-9.]*)$" + }, + "$designer": { + "title": "$designer", + "type": "object", + "description": "Extra information for the Bot Framework Designer." + }, + "id": { + "type": "string", + "title": "Id", + "description": "Optional id for the dialog" + }, + "prompt": { + "$type": "Microsoft.IActivityTemplate", + "title": "Initial prompt", + "description": "Message to send to collect information.", + "examples": [ + "What is your birth date?" + ], + "$ref": "#/definitions/Microsoft.IActivityTemplate" + }, + "unrecognizedPrompt": { + "$type": "Microsoft.IActivityTemplate", + "title": "Unrecognized prompt", + "description": "Message to send if user response is not recognized.", + "examples": [ + "Sorry, I do not understand '{turn.activity.text'}. Let's try again. What is your birth date?" + ], + "$ref": "#/definitions/Microsoft.IActivityTemplate" + }, + "invalidPrompt": { + "$type": "Microsoft.IActivityTemplate", + "title": "Invalid prompt", + "description": "Message to send if user response is invalid. Relies on specified validation expressions.", + "examples": [ + "Sorry, '{this.value}' does not work. I need a number between 1-150. What is your age?" + ], + "$ref": "#/definitions/Microsoft.IActivityTemplate" + }, + "defaultValueResponse": { + "$type": "Microsoft.IActivityTemplate", + "title": "Default value response", + "description": "Message to send when max turn count (if specified) has been exceeded and the default value is selected as the value.", + "examples": [ + "Sorry, I'm having trouble understanding you. I will just use {this.options.defaultValue} for now. You can say 'I'm 36 years old' to change it." + ], + "$ref": "#/definitions/Microsoft.IActivityTemplate" + }, + "maxTurnCount": { + "type": "integer", + "title": "Max turn count", + "description": "Maximum number of re-prompt attempts to collect information.", + "default": 3, + "examples": [ + 3 + ] + }, + "validations": { + "type": "array", + "title": "Validation expressions", + "description": "Expression to validate user input.", + "examples": [ + "int(this.value) > 1 && int(this.value) <= 150", + "count(this.value) < 300" + ], + "items": { + "$role": "expression", + "type": "string", + "description": "String must contain an expression." + } + }, + "property": { + "$role": "expression", + "title": "Property", + "description": "Property to store collected information. Input will be skipped if property has value (unless 'Always prompt' is true).", + "examples": [ + "$birthday", + "user.name", + "conversation.issueTitle", + "dialog.favColor" + ], + "type": "string" + }, + "defaultValue": { + "$role": "expression", + "title": "Default value", + "description": "Expression to examine on each turn of the conversation as possible value to the property.", + "examples": [ + "@userName", + "coalesce(@number, @partySize)" + ], + "type": "string" + }, + "alwaysPrompt": { + "type": "boolean", + "title": "Always prompt", + "description": "Collect information even if the specified 'property' is not empty.", + "default": false, + "examples": [ + false + ] + }, + "allowInterruptions": { + "type": "string", + "title": "Allow Interruptions", + "description": "A boolean expression that determines whether the parent should be allowed to interrupt the input.", + "default": "true", + "examples": [ + "true" + ] + }, + "outputFormat": { + "type": "string", + "enum": [ + "none", + "trim", + "lowercase", + "uppercase" + ], + "title": "Output format", + "description": "Format of output.", + "default": "none" + } + }, + "additionalProperties": false, + "patternProperties": { + "^\\$": { + "type": "string" + } + }, + "anyOf": [ + { + "title": "Reference", + "required": [ + "$copy" + ] + }, + { + "title": "Type", + "required": [ + "$type" + ] + } + ] + }, + "Microsoft.TextTemplate": { + "$role": "unionType(Microsoft.ITextTemplate)", + "title": "Microsoft TextTemplate", + "description": "Lg tempalte to evaluate to create text", + "type": "object", + "properties": { + "$type": { + "title": "$type", + "description": "Defines the valid properties for the component you are configuring (from a dialog .schema file)", + "type": "string", + "pattern": "^[a-zA-Z][a-zA-Z0-9.]*$", + "const": "Microsoft.TextTemplate" + }, + "$copy": { + "title": "$copy", + "description": "Copy the definition by id from a .dialog file.", + "type": "string", + "pattern": "^(([a-zA-Z][a-zA-Z0-9.]*)?(#[a-zA-Z][a-zA-Z0-9.]*)?)$" + }, + "$id": { + "title": "$id", + "description": "Inline id for reuse of an inline definition", + "type": "string", + "pattern": "^([a-zA-Z][a-zA-Z0-9.]*)$" + }, + "$designer": { + "title": "$designer", + "type": "object", + "description": "Extra information for the Bot Framework Designer." + }, + "template": { + "title": "Template", + "Description": "Language Generator template to evaluate to create the text", + "type": "string" + } + }, + "additionalProperties": false, + "patternProperties": { + "^\\$": { + "type": "string" + } + }, + "anyOf": [ + { + "title": "Reference", + "required": [ + "$copy" + ] + }, + { + "title": "Type", + "required": [ + "template", + "$type" + ] + } + ] + }, + "Microsoft.TraceActivity": { + "$role": "unionType(Microsoft.IDialog)", + "title": "Send a TraceActivity", + "description": "Send a trace activity to the transcript logger and/ or Bot Framework Emulator.", + "type": "object", + "properties": { + "$type": { + "title": "$type", + "description": "Defines the valid properties for the component you are configuring (from a dialog .schema file)", + "type": "string", + "pattern": "^[a-zA-Z][a-zA-Z0-9.]*$", + "const": "Microsoft.TraceActivity" + }, + "$copy": { + "title": "$copy", + "description": "Copy the definition by id from a .dialog file.", + "type": "string", + "pattern": "^(([a-zA-Z][a-zA-Z0-9.]*)?(#[a-zA-Z][a-zA-Z0-9.]*)?)$" + }, + "$id": { + "title": "$id", + "description": "Inline id for reuse of an inline definition", + "type": "string", + "pattern": "^([a-zA-Z][a-zA-Z0-9.]*)$" + }, + "$designer": { + "title": "$designer", + "type": "object", + "description": "Extra information for the Bot Framework Designer." + }, + "name": { + "type": "string", + "title": "Name", + "description": "Name of the trace activity" + }, + "valueType": { + "type": "string", + "title": "Value type", + "description": "Type of value" + }, + "value": { + "$role": "expression", + "title": "Value", + "description": "Property that holds the value to send as trace activity.", + "type": "string" + } + }, + "additionalProperties": false, + "patternProperties": { + "^\\$": { + "type": "string" + } + }, + "anyOf": [ + { + "title": "Reference", + "required": [ + "$copy" + ] + }, + { + "title": "Type", + "required": [ + "$type" + ] + } + ] + }, + "Microsoft.TrueSelector": { + "$role": "unionType(Microsoft.ITriggerSelector)", + "title": "True Trigger Selector", + "description": "Selector for all true events", + "type": "object", + "properties": { + "$type": { + "title": "$type", + "description": "Defines the valid properties for the component you are configuring (from a dialog .schema file)", + "type": "string", + "pattern": "^[a-zA-Z][a-zA-Z0-9.]*$", + "const": "Microsoft.TrueSelector" + }, + "$copy": { + "title": "$copy", + "description": "Copy the definition by id from a .dialog file.", + "type": "string", + "pattern": "^(([a-zA-Z][a-zA-Z0-9.]*)?(#[a-zA-Z][a-zA-Z0-9.]*)?)$" + }, + "$id": { + "title": "$id", + "description": "Inline id for reuse of an inline definition", + "type": "string", + "pattern": "^([a-zA-Z][a-zA-Z0-9.]*)$" + }, + "$designer": { + "title": "$designer", + "type": "object", + "description": "Extra information for the Bot Framework Designer." + } + }, + "additionalProperties": false, + "patternProperties": { + "^\\$": { + "type": "string" + } + }, + "anyOf": [ + { + "title": "Reference", + "required": [ + "$copy" + ] + }, + { + "title": "Type", + "required": [ + "$type" + ] + } + ] + }, + "Microsoft.UrlEntityRecognizer": { + "$role": "unionType(Microsoft.EntityRecognizers)", + "title": "Url Entity Recognizer", + "description": "Recognizer which recognizes urls (example: http://bing.com)", + "type": "object", + "properties": { + "$type": { + "title": "$type", + "description": "Defines the valid properties for the component you are configuring (from a dialog .schema file)", + "type": "string", + "pattern": "^[a-zA-Z][a-zA-Z0-9.]*$", + "const": "Microsoft.UrlEntityRecognizer" + }, + "$copy": { + "title": "$copy", + "description": "Copy the definition by id from a .dialog file.", + "type": "string", + "pattern": "^(([a-zA-Z][a-zA-Z0-9.]*)?(#[a-zA-Z][a-zA-Z0-9.]*)?)$" + }, + "$id": { + "title": "$id", + "description": "Inline id for reuse of an inline definition", + "type": "string", + "pattern": "^([a-zA-Z][a-zA-Z0-9.]*)$" + }, + "$designer": { + "title": "$designer", + "type": "object", + "description": "Extra information for the Bot Framework Designer." + } + }, + "additionalProperties": false, + "patternProperties": { + "^\\$": { + "type": "string" + } + }, + "anyOf": [ + { + "title": "Reference", + "required": [ + "$copy" + ] + }, + { + "title": "Type", + "required": [ + "$type" + ] + } + ] + } + } +} diff --git a/BotProject/Templates/CSharp/Scripts/create.ps1 b/BotProject/Templates/CSharp/Scripts/create.ps1 new file mode 100644 index 0000000000..477a46eaff --- /dev/null +++ b/BotProject/Templates/CSharp/Scripts/create.ps1 @@ -0,0 +1,189 @@ +Param( + [string] $name, + [string] $location, + [string] $appId, + [string] $appPassword, + [string] $environment, + [string] $projDir = $(Get-Location), + [string] $logFile = $(Join-Path $PSScriptRoot .. "create_log.txt") +) + +if ($PSVersionTable.PSVersion.Major -lt 6){ + Write-Host "! Powershell 6 is required, current version is $($PSVersionTable.PSVersion.Major), please refer following documents for help." + Write-Host "For Windows - https://docs.microsoft.com/en-us/powershell/scripting/install/installing-powershell-core-on-windows?view=powershell-6" + Write-Host "For Mac - https://docs.microsoft.com/en-us/powershell/scripting/install/installing-powershell-core-on-macos?view=powershell-6" + Break +} + +# Reset log file +if (Test-Path $logFile) { + Clear-Content $logFile -Force | Out-Null +} +else { + New-Item -Path $logFile | Out-Null +} + +if (-not (Test-Path (Join-Path $projDir 'appsettings.json'))) +{ + Write-Host "! Could not find an 'appsettings.json' file in the current directory." -ForegroundColor DarkRed + Write-Host "+ Please re-run this script from your project directory." -ForegroundColor Magenta + Break +} + +# Get mandatory parameters +if (-not $name) { + $name = Read-Host "? Bot Name (used as default name for resource group and deployed resources)" +} + +if (-not $environment) +{ + $environment = Read-Host "? Environment Name (single word, all lowercase)" + $environment = $environment.ToLower().Split(" ") | Select-Object -First 1 +} + +if (-not $location) { + $location = Read-Host "? Azure resource group region" +} + +if (-not $appPassword) { + $appPassword = Read-Host "? Password for MSA app registration (must be at least 16 characters long, contain at least 1 special character, and contain at least 1 numeric character)" +} + +if (-not $appId) { + # Create app registration + $app = (az ad app create ` + --display-name $name ` + --password `"$($appPassword)`" ` + --available-to-other-tenants ` + --reply-urls 'https://token.botframework.com/.auth/web/redirect' ` + --output json) + + # Retrieve AppId + if ($app) { + $appId = ($app | ConvertFrom-Json) | Select-Object -ExpandProperty appId + } + + if(-not $appId) { + Write-Host "! Could not provision Microsoft App Registration automatically. Review the log for more information." -ForegroundColor DarkRed + Write-Host "! Log: $($logFile)" -ForegroundColor DarkRed + Write-Host "+ Provision an app manually in the Azure Portal, then try again providing the -appId and -appPassword arguments. See https://aka.ms/vamanualappcreation for more information." -ForegroundColor Magenta + Break + } +} + +$resourceGroup = "$name-$environment" +$servicePlanName = "$name-$environment" + +# Get timestamp +$timestamp = Get-Date -f MMddyyyyHHmmss + +# Create resource group +Write-Host "> Creating resource group ..." +(az group create --name $resourceGroup --location $location --output json) 2>> $logFile | Out-Null + +# Deploy Azure services +Write-Host "> Validating Azure deployment ..." +$validation = az group deployment validate ` + --resource-group $resourcegroup ` + --template-file "$(Join-Path $PSScriptRoot '..' 'DeploymentTemplates' 'template-with-preexisting-rg.json')" ` + --parameters appId=$appId appSecret="`"$($appPassword)`"" appServicePlanLocation=$location botId=$name ` + --output json + +if ($validation) { + $validation >> $logFile + $validation = $validation | ConvertFrom-Json + + if (-not $validation.error) { + Write-Host "> Deploying Azure services (this could take a while)..." -ForegroundColor Yellow + $deployment = az group deployment create ` + --name $timestamp ` + --resource-group $resourceGroup ` + --template-file "$(Join-Path $PSScriptRoot '..' 'DeploymentTemplates' 'template-with-preexisting-rg.json')" ` + --parameters appId=$appId appSecret="`"$($appPassword)`"" appServicePlanLocation=$location botId=$name ` + --output json + } + else { + Write-Host "! Template is not valid with provided parameters. Review the log for more information." -ForegroundColor DarkRed + Write-Host "! Error: $($validation.error.message)" -ForegroundColor DarkRed + Write-Host "! Log: $($logFile)" -ForegroundColor DarkRed + Write-Host "+ To delete this resource group, run 'az group delete -g $($resourceGroup) --no-wait'" -ForegroundColor Magenta + Break + } +} + + +# Get deployment outputs +$outputs = (az group deployment show ` + --name $timestamp ` + --resource-group $resourceGroup ` + --output json) 2>> $logFile + +# If it succeeded then we perform the remainder of the steps +if ($outputs) +{ + # Log and convert to JSON + $outputs >> $logFile + $outputs = $outputs | ConvertFrom-Json + $outputs = $outputs.properties.outputs + $outputMap = @{} + $outputs.PSObject.Properties | Foreach-Object { $outputMap[$_.Name] = $_.Value } + + # Update appsettings.json + Write-Host "> Updating appsettings.json ..." + if (Test-Path $(Join-Path $projDir appsettings.json)) { + $settings = Get-Content $(Join-Path $projDir appsettings.json) | ConvertFrom-Json + } + else { + $settings = New-Object PSObject + } + + $settings | Add-Member -Type NoteProperty -Force -Name 'microsoftAppId' -Value $appId + + dotnet user-secrets init --project $projDir + dotnet user-secrets set "MicrosoftAppPassword" $appPassword --project $projDir + + $settings | Add-Member -Type NoteProperty -Force -Name 'bot' -Value "ComposerDialogs" + + foreach ($key in $outputMap.Keys) { $settings | Add-Member -Type NoteProperty -Force -Name $key -Value $outputMap[$key].value } + $settings | ConvertTo-Json -depth 100 | Out-File $(Join-Path $projDir appsettings.json) + + Write-Host "> Done." + Write-Host "- App Id: $appId" + Write-Host "- App Password: $appPassword" + Write-Host "- Resource Group: $resourceGroup" + Write-Host "- ServicePlan: $servicePlanName" + Write-Host "- Bot Name: $name" + Write-Host "- Web App Name : $name" +} +else +{ + # Check for failed deployments + $operations = az group deployment operation list -g $resourceGroup -n $timestamp --output json 2>> $logFile | Out-Null + + if ($operations) { + $operations = $operations | ConvertFrom-Json + $failedOperations = $operations | Where { $_.properties.statusmessage.error -ne $null } + if ($failedOperations) { + foreach ($operation in $failedOperations) { + switch ($operation.properties.statusmessage.error.code) { + "MissingRegistrationForLocation" { + Write-Host "! Deployment failed for resource of type $($operation.properties.targetResource.resourceType). This resource is not avaliable in the location provided." -ForegroundColor DarkRed + Write-Host "+ Update the .\Deployment\Resources\parameters.template.json file with a valid region for this resource and provide the file path in the -parametersFile parameter." -ForegroundColor Magenta + } + default { + Write-Host "! Deployment failed for resource of type $($operation.properties.targetResource.resourceType)." + Write-Host "! Code: $($operation.properties.statusMessage.error.code)." + Write-Host "! Message: $($operation.properties.statusMessage.error.message)." + } + } + } + } + } + else { + Write-Host "! Deployment failed. Please refer to the log file for more information." -ForegroundColor DarkRed + Write-Host "! Log: $($logFile)" -ForegroundColor DarkRed + } + + Write-Host "+ To delete this resource group, run 'az group delete -g $($resourceGroup) --no-wait'" -ForegroundColor Magenta + Break +} \ No newline at end of file diff --git a/BotProject/Templates/CSharp/Scripts/deploy.ps1 b/BotProject/Templates/CSharp/Scripts/deploy.ps1 new file mode 100644 index 0000000000..adb45434a8 --- /dev/null +++ b/BotProject/Templates/CSharp/Scripts/deploy.ps1 @@ -0,0 +1,223 @@ +Param( + [string] $name, + [string] $environment, + [string] $luisAuthoringKey, + [string] $luisAuthoringRegion, + [string] $projFolder = $(Get-Location), + [string] $botPath, + [string] $logFile = $(Join-Path $PSScriptRoot .. "deploy_log.txt") +) + +if ($PSVersionTable.PSVersion.Major -lt 6) { + Write-Host "! Powershell 6 is required, current version is $($PSVersionTable.PSVersion.Major), please refer following documents for help." + Write-Host "For Windows - https://docs.microsoft.com/en-us/powershell/scripting/install/installing-powershell-core-on-windows?view=powershell-6" + Write-Host "For Mac - https://docs.microsoft.com/en-us/powershell/scripting/install/installing-powershell-core-on-macos?view=powershell-6" + Break +} + +# Get mandatory parameters +if (-not $name) { + $name = Read-Host "? Bot Web App Name" +} + +if (-not $environment) { + $environment = Read-Host "? Environment Name (single word, all lowercase)" + $environment = $environment.ToLower().Split(" ") | Select-Object -First 1 +} + + +# Reset log file +if (Test-Path $logFile) { + Clear-Content $logFile -Force | Out-Null +} +else { + New-Item -Path $logFile | Out-Null +} + +# Check for existing deployment files +if (-not (Test-Path (Join-Path $projFolder '.deployment'))) { + # Add needed deployment files for az + az bot prepare-deploy --lang Csharp --code-dir $projFolder --proj-file-path BotProject.csproj --output json | Out-Null +} + +# Delete src zip, if it exists +$zipPath = $(Join-Path $projFolder 'code.zip') +if (Test-Path $zipPath) { + Remove-Item $zipPath -Force | Out-Null +} + +# Init user secret id +dotnet user-secrets init + +# Perform dotnet publish step ahead of zipping up +$publishFolder = $(Join-Path $projFolder 'bin\Release\netcoreapp2.2') +dotnet publish -c release -o $publishFolder -v q > $logFile + + +# Copy bot files to running folder +$remoteBotPath = $(Join-Path $publishFolder "ComposerDialogs") +$localBotPath = $(Join-Path $projFolder "ComposerDialogs") +Remove-Item $remoteBotPath -Recurse -ErrorAction Ignore + +if ($botPath) { + Write-Host "Publishing dialogs from external bot project: $($botPath)" + Copy-Item -Path $botPath -Recurse -Destination $remoteBotPath -Container -Force +} +else { + Copy-Item -Path $localBotPath -Recurse -Destination $publishFolder -Container -Force +} + +# Merge from custom config files +$customConfigFiles = Get-ChildItem -Path $remoteBotPath -Include "appsettings.json" -Recurse -Force +if ($customConfigFiles) { + if (Test-Path $(Join-Path $publishFolder appsettings.json)) { + $settings = Get-Content $(Join-Path $publishFolder appsettings.json) | ConvertFrom-Json + } + else { + $settings = New-Object PSObject + } + + $customConfig = @{ } + $customSetting = Get-Content $customConfigFiles.FullName | ConvertFrom-Json + $customSetting.PSObject.Properties | Foreach-Object { $customConfig[$_.Name] = $_.Value } + foreach ($key in $customConfig.Keys) { $settings | Add-Member -Type NoteProperty -Force -Name $key -Value $customConfig[$key] } + + $settings | ConvertTo-Json -depth 100 | Out-File $(Join-Path $publishFolder appsettings.json) +} + +# Try to get luis config from appsettings +$settings = Get-Content $(Join-Path $projFolder appsettings.json) | ConvertFrom-Json +$luisSettings = $settings.luis + +if (-not $luisAuthoringKey) { + $luisAuthoringKey = $luisSettings.authoringKey +} + +if (-not $luisEndpointKey) { + $luisEndpointKey = $luisSettings.endpointKey +} + +if (-not $luisAuthoringRegion) { + $luisAuthoringRegion = $luisSettings.region +} + +# Add Luis Config to appsettings +if ($luisAuthoringKey -and $luisAuthoringRegion) { + + Set-Location -Path $remoteBotPath + $models = Get-ChildItem $remoteBotPath -Recurse -Filter "*.lu" | Resolve-Path -Relative + + $noneEmptyModels = [System.Collections.ArrayList]@() + + foreach ($model in $models) { + $stringContent = Get-Content $model | Out-String + if ($stringContent.Length -gt 0) { + $noneEmptyModels.Add($model) + } + } + + # Generate Luconfig.json file + $luconfigjson = @{ + "name" = $name; + "defaultLanguage" = "en-us"; + "models" = $noneEmptyModels + } + + $luconfigjson | ConvertTo-Json -Depth 100 | Out-File $(Join-Path $remoteBotPath luconfig.json) + + # Execute lubuild command + if (Get-Command lubuild -errorAction SilentlyContinue) { + lubuild --authoringKey $luisAuthoringKey + } + else { + Write-Host "lubuild does not exist, use the following command to install lubuild:" + Write-Host "npm install -g https://botbuilder.myget.org/F/botbuilder-declarative/npm/lubuild/-/1.0.3-preview.tgz" + Break + } + + Set-Location -Path $projFolder + + # change setting file in publish folder + if (Test-Path $(Join-Path $publishFolder appsettings.json)) { + $settings = Get-Content $(Join-Path $publishFolder appsettings.json) | ConvertFrom-Json + } + else { + $settings = New-Object PSObject + } + + $luisConfigFiles = Get-ChildItem -Path $publishFolder -Include "luis.settings*" -Recurse -Force + + $luisAppIds = @{ } + + foreach ($luisConfigFile in $luisConfigFiles) { + $luisSetting = Get-Content $luisConfigFile.FullName | ConvertFrom-Json + $luis = $luisSetting.luis + $luis.PSObject.Properties | Foreach-Object { $luisAppIds[$_.Name] = $_.Value } + } + + $luisEndpoint = "https://$luisAuthoringRegion.api.cognitive.microsoft.com" + + $luisConfig = @{ } + + $luisConfig["endpoint"] = $luisEndpoint + $luisConfig["endpointKey"] = $luisEndpointKey + + foreach ($key in $luisAppIds.Keys) { $luisConfig[$key] = $luisAppIds[$key] } + + $settings | Add-Member -Type NoteProperty -Force -Name 'luis' -Value $luisConfig + + $settings | ConvertTo-Json -depth 100 | Out-File $(Join-Path $publishFolder appsettings.json) + + $tokenResponse = (az account get-access-token) | ConvertFrom-Json + $token = $tokenResponse.accessToken + + Write-Host "Getting Luis accounts..." + $luisAccountEndpoint = "$luisEndpoint/luis/api/v2.0/azureaccounts" + $luisAccounts = Invoke-WebRequest -Method GET -Uri $luisAccountEndpoint -Headers @{"Authorization" = "Bearer $token"; "Ocp-Apim-Subscription-Key" = $luisAuthoringKey } | ConvertFrom-Json + + $luisAccount = $null + foreach ($account in $luisAccounts) { + if ($account.AccountName -eq "$name-$environment-luis") { + $luisAccount = $account + break + } + } + + $luisAccountBody = $luisAccount | ConvertTo-Json + + # Assign each luis id in luisAppIds with the endpoint key + foreach ($k in $luisAppIds.Keys) { + $luisAppId = $luisAppIds.Item($k) + Write-Host "Assigning to Luis app id: $luisAppId" + $luisAssignEndpoint = "$luisEndpoint/luis/api/v2.0/apps/$luisAppId/azureaccounts" + $response = Invoke-WebRequest -Method POST -ContentType application/json -Body $luisAccountBody -Uri $luisAssignEndpoint -Headers @{"Authorization" = "Bearer $token"; "Ocp-Apim-Subscription-Key" = $luisAuthoringKey } | ConvertFrom-Json + Write-Host $response + } +} + +$resourceGroup = "$name-$environment" + +if ($?) { + # Compress source code + Get-ChildItem -Path "$($publishFolder)" | Compress-Archive -DestinationPath "$($zipPath)" -Force | Out-Null + + # Publish zip to Azure + Write-Host "> Publishing to Azure ..." -ForegroundColor Green + $deployment = (az webapp deployment source config-zip ` + --resource-group $resourceGroup ` + --name "$name-$environment" ` + --src $zipPath ` + --output json) 2>> $logFile + + if ($deployment) { + Write-Host "Publish Success" + } + else { + Write-Host "! Deploy failed. Review the log for more information." -ForegroundColor DarkRed + Write-Host "! Log: $($logFile)" -ForegroundColor DarkRed + } +} +else { + Write-Host "! Could not deploy automatically to Azure. Review the log for more information." -ForegroundColor DarkRed + Write-Host "! Log: $($logFile)" -ForegroundColor DarkRed +} \ No newline at end of file diff --git a/BotProject/Templates/CSharp/Startup.cs b/BotProject/Templates/CSharp/Startup.cs new file mode 100644 index 0000000000..6dcf3090ee --- /dev/null +++ b/BotProject/Templates/CSharp/Startup.cs @@ -0,0 +1,156 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading; +using System.Threading.Tasks; +using Microsoft.ApplicationInsights.Extensibility; +using Microsoft.AspNetCore.Builder; +using Microsoft.AspNetCore.Hosting; +using Microsoft.Bot.Builder; +using Microsoft.Bot.Builder.Dialogs; +using Microsoft.Bot.Builder.Dialogs.Debugging; +using Microsoft.Bot.Builder.Dialogs.Declarative.Resources; +using Microsoft.Bot.Builder.Dialogs.Declarative.Types; +using Microsoft.Bot.Builder.Integration; +using Microsoft.Bot.Builder.Integration.AspNet.Core; +using Microsoft.Bot.Schema; +using Microsoft.Bot.Connector.Authentication; +using Microsoft.Extensions.Configuration; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Logging.Debug; +using System.Diagnostics; +using System.IO; +using Microsoft.Extensions.Logging; +using Microsoft.Extensions.Options; +using Microsoft.AspNetCore.Mvc; +using Microsoft.Bot.Builder.BotFramework; +using Microsoft.Bot.Builder.Dialogs.Declarative; +using Microsoft.Bot.Builder.Azure; +using Microsoft.AspNetCore.Http.Connections.Internal; +using Microsoft.Bot.Builder.ApplicationInsights; +using Microsoft.ApplicationInsights; +using Microsoft.Bot.Builder.Integration.ApplicationInsights.Core; +using Microsoft.Bot.Builder.Dialogs.Adaptive; + +namespace Microsoft.Bot.Builder.ComposerBot.json +{ + public class Startup + { + public Startup(IHostingEnvironment env, IConfiguration configuration) + { + this.HostingEnvironment = env; + this.Configuration = configuration; + } + + public IHostingEnvironment HostingEnvironment { get; } + + public IConfiguration Configuration { get; } + + // This method gets called by the runtime. Use this method to add services to the container. + public void ConfigureServices(IServiceCollection services) + { + services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_1); + + services.AddSingleton(this.Configuration); + + // Create the credential provider to be used with the Bot Framework Adapter. + services.AddSingleton(); + + services.AddSingleton(); + + // Load settings + var settings = new BotSettings(); + Configuration.Bind(settings); + + IStorage storage = null; + + // Configure storage for deployment + if (!string.IsNullOrEmpty(settings.CosmosDb.AuthKey)) + { + storage = new CosmosDbStorage(settings.CosmosDb); + } + else + { + Console.WriteLine("The settings of CosmosDbStorage is incomplete, please check following settings: settings.CosmosDb"); + storage = new MemoryStorage(); + } + + services.AddSingleton(storage); + var userState = new UserState(storage); + var conversationState = new ConversationState(storage); + var inspectionState = new InspectionState(storage); + + // Configure telemetry + services.AddApplicationInsightsTelemetry(); + var telemetryClient = new BotTelemetryClient(new TelemetryClient()); + services.AddSingleton(telemetryClient); + services.AddBotApplicationInsights(telemetryClient); + + var botFile = Configuration.GetSection("bot").Get(); + + TypeFactory.Configuration = this.Configuration; + + // manage all bot resources + var resourceExplorer = new ResourceExplorer().AddFolder(botFile); + + var credentials = new MicrosoftAppCredentials(this.Configuration["MicrosoftAppId"], this.Configuration["MicrosoftAppPassword"]); + + services.AddSingleton((s) => + { + var adapter = new BotFrameworkHttpAdapter(new ConfigurationCredentialProvider(this.Configuration)); + adapter + .UseStorage(storage) + .UseState(userState, conversationState) + .UseAdaptiveDialogs() + .UseResourceExplorer(resourceExplorer) + .UseLanguageGeneration(resourceExplorer, "common.lg") + .Use(new RegisterClassMiddleware(Configuration)) + .Use(new InspectionMiddleware(inspectionState, userState, conversationState, credentials)); + + if (!string.IsNullOrEmpty(settings.BlobStorage.ConnectionString) && !string.IsNullOrEmpty(settings.BlobStorage.Container)) + { + adapter.Use(new TranscriptLoggerMiddleware(new AzureBlobTranscriptStore(settings.BlobStorage.ConnectionString, settings.BlobStorage.Container))); + } + else + { + Console.WriteLine("The settings of TranscriptLoggerMiddleware is incomplete, please check following settings: settings.BlobStorage.ConnectionString, settings.BlobStorage.Container"); + } + + + + adapter.OnTurnError = async (turnContext, exception) => + { + await turnContext.SendActivityAsync(exception.Message).ConfigureAwait(false); + telemetryClient.TrackException(new Exception("Exceptions: " + exception.Message)); + await conversationState.ClearStateAsync(turnContext).ConfigureAwait(false); + await conversationState.SaveChangesAsync(turnContext).ConfigureAwait(false); + }; + return adapter; + }); + + services.AddSingleton((sp) => new ComposerBot("Main.dialog", conversationState, userState, resourceExplorer, DebugSupport.SourceMap, telemetryClient)); + } + + // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. + public void Configure(IApplicationBuilder app, IHostingEnvironment env) + { + if (env.IsDevelopment()) + { + app.UseDeveloperExceptionPage(); + } + else + { + app.UseHsts(); + } + + app.UseDefaultFiles(); + app.UseStaticFiles(); + + //app.UseHttpsRedirection(); + app.UseMvc(); + } + } +} diff --git a/BotProject/Templates/CSharp/Tests/ActionsTests.cs b/BotProject/Templates/CSharp/Tests/ActionsTests.cs new file mode 100644 index 0000000000..2d80ec2732 --- /dev/null +++ b/BotProject/Templates/CSharp/Tests/ActionsTests.cs @@ -0,0 +1,232 @@ +using Microsoft.Bot.Builder; +using Microsoft.Bot.Builder.Adapters; +using Microsoft.Bot.Builder.Dialogs; +using Microsoft.Bot.Builder.Dialogs.Adaptive; +using Microsoft.Bot.Builder.Dialogs.Debugging; +using Microsoft.Bot.Builder.Dialogs.Declarative; +using Microsoft.Bot.Builder.Dialogs.Declarative.Resources; +using Microsoft.Bot.Builder.Dialogs.Declarative.Types; +using Microsoft.Bot.Schema; +using Microsoft.Extensions.Configuration; +using Microsoft.VisualStudio.TestTools.UnitTesting; +using System; +using System.IO; +using System.Threading.Tasks; + +namespace Tests +{ + [TestClass] + public class ActionsTests + { + private static string getOsPath(string path) => Path.Combine(path.TrimEnd('\\').Split('\\')); + + private static readonly string samplesDirectory = getOsPath(@"..\..\..\..\..\..\SampleBots"); + + private static string getFolderPath(string path) + { + return Path.Combine(samplesDirectory, path); + } + + + [ClassInitialize] + public static void ClassInitialize(TestContext context) + { + TypeFactory.Configuration = new ConfigurationBuilder().AddInMemoryCollection().Build(); + string path = Path.GetFullPath(Path.Combine(Environment.CurrentDirectory, samplesDirectory)); + } + + public TestContext TestContext { get; set; } + + [TestMethod] + public async Task Actions_01Actions() + { + await BuildTestFlow(getFolderPath("Steps_Samples")) + .SendConversationUpdate() + .AssertReply(String.Format("I can show you examples on how to use actions. Enter the number next to the entity that you with to see in action.{0}01 - Actions{0}02 - EndTurn{0}03 - IfCondiftion{0}04 - EditArray, Foreach{0}05 - EndDialog{0}06 - HttpRequest{0}07 - SwitchCondition{0}08 - RepeatDialog{0}09 - TraceAndLog{0}10 - EditActions{0}11 - ReplaceDialog{0}12 - EmitEvent{0}", Environment.NewLine)) + .Send("01") + .AssertReply("Step 1") + .AssertReply("Step 2") + .AssertReply("Step 3") + .AssertReply("user.age is set to 18") + .AssertReply("user.age is set to null") + .StartTestAsync(); + } + + [TestMethod] + public async Task Actions_02EndTurn() + { + await BuildTestFlow(getFolderPath("Steps_Samples")) + .SendConversationUpdate() + .AssertReply(String.Format("I can show you examples on how to use actions. Enter the number next to the entity that you with to see in action.{0}01 - Actions{0}02 - EndTurn{0}03 - IfCondiftion{0}04 - EditArray, Foreach{0}05 - EndDialog{0}06 - HttpRequest{0}07 - SwitchCondition{0}08 - RepeatDialog{0}09 - TraceAndLog{0}10 - EditActions{0}11 - ReplaceDialog{0}12 - EmitEvent{0}", Environment.NewLine)) + .Send("02") + .AssertReply("What's up?") + .Send("Nothing") + .AssertReply("Oh I see!") + .StartTestAsync(); + } + + [TestMethod] + public async Task Actions_03IfCondition() + { + await BuildTestFlow(getFolderPath("Steps_Samples")) + .SendConversationUpdate() + .AssertReply(String.Format("I can show you examples on how to use actions. Enter the number next to the entity that you with to see in action.{0}01 - Actions{0}02 - EndTurn{0}03 - IfCondiftion{0}04 - EditArray, Foreach{0}05 - EndDialog{0}06 - HttpRequest{0}07 - SwitchCondition{0}08 - RepeatDialog{0}09 - TraceAndLog{0}10 - EditActions{0}11 - ReplaceDialog{0}12 - EmitEvent{0}", Environment.NewLine)).Send("03") + .AssertReply("Hello, I'm Zoidberg. What is your name?") + .Send("Carlos") + .AssertReply("Hello Carlos, nice to talk to you!") + .StartTestAsync(); + } + + [TestMethod] + public async Task Actions_04EditArray() + { + await BuildTestFlow(getFolderPath("Steps_Samples")) + .SendConversationUpdate() + .AssertReply(String.Format("I can show you examples on how to use actions. Enter the number next to the entity that you with to see in action.{0}01 - Actions{0}02 - EndTurn{0}03 - IfCondiftion{0}04 - EditArray, Foreach{0}05 - EndDialog{0}06 - HttpRequest{0}07 - SwitchCondition{0}08 - RepeatDialog{0}09 - TraceAndLog{0}10 - EditActions{0}11 - ReplaceDialog{0}12 - EmitEvent{0}", Environment.NewLine)).Send("04") + .AssertReply("Here are the index and values in the array.") + .AssertReply("0: 11111") + .AssertReply("1: 40000") + .AssertReply("2: 222222") + .AssertReply("If each page shows two items, here are the index and values") + .AssertReply("0: 11111") + .AssertReply("1: 40000") + .AssertReply("0: 222222") + .StartTestAsync(); + } + + [TestMethod] + public async Task Actions_05EndDialog() + { + await BuildTestFlow(getFolderPath("Steps_Samples")) + .SendConversationUpdate() + .AssertReply(String.Format("I can show you examples on how to use actions. Enter the number next to the entity that you with to see in action.{0}01 - Actions{0}02 - EndTurn{0}03 - IfCondiftion{0}04 - EditArray, Foreach{0}05 - EndDialog{0}06 - HttpRequest{0}07 - SwitchCondition{0}08 - RepeatDialog{0}09 - TraceAndLog{0}10 - EditActions{0}11 - ReplaceDialog{0}12 - EmitEvent{0}", Environment.NewLine)).Send("05") + .AssertReply("Hello, I'm Zoidberg. What is your name?") + .Send("luhan") + .AssertReply("Hello luhan, nice to talk to you!") + .AssertReply("I'm a joke bot. To get started say \"joke\".") + .Send("joke") + .AssertReply("Why did the chicken cross the road?") + .Send("I don't know") + .AssertReply("To get to the other side!") + .StartTestAsync(); + } + + [TestMethod] + public async Task Actions_06SwitchCondition() + { + await BuildTestFlow(getFolderPath("Steps_Samples")) + .SendConversationUpdate() + .AssertReply(String.Format("I can show you examples on how to use actions. Enter the number next to the entity that you with to see in action.{0}01 - Actions{0}02 - EndTurn{0}03 - IfCondiftion{0}04 - EditArray, Foreach{0}05 - EndDialog{0}06 - HttpRequest{0}07 - SwitchCondition{0}08 - RepeatDialog{0}09 - TraceAndLog{0}10 - EditActions{0}11 - ReplaceDialog{0}12 - EmitEvent{0}", Environment.NewLine)).Send("07") + .AssertReply("Please select a value from below:\n\n 1. Test1\n 2. Test2\n 3. Test3") + .Send("Test1") + .AssertReply("You select: Test1") + .AssertReply("You select: 1") + .StartTestAsync(); + } + + [TestMethod] + public async Task Actions_07RepeatDialog() + { + await BuildTestFlow(getFolderPath("Steps_Samples")) + .SendConversationUpdate() + .AssertReply(String.Format("I can show you examples on how to use actions. Enter the number next to the entity that you with to see in action.{0}01 - Actions{0}02 - EndTurn{0}03 - IfCondiftion{0}04 - EditArray, Foreach{0}05 - EndDialog{0}06 - HttpRequest{0}07 - SwitchCondition{0}08 - RepeatDialog{0}09 - TraceAndLog{0}10 - EditActions{0}11 - ReplaceDialog{0}12 - EmitEvent{0}", Environment.NewLine)).Send("08") + .AssertReply("Do you want to repeat this dialog, yes to repeat, no to end this dialog (1) Yes or (2) No") + .Send("Yes") + .AssertReply("Do you want to repeat this dialog, yes to repeat, no to end this dialog (1) Yes or (2) No") + .Send("No") + .StartTestAsync(); + } + + [TestMethod] + public async Task Actions_08TraceAndLog() + { + await BuildTestFlow(getFolderPath("Steps_Samples"), sendTrace: true) + .SendConversationUpdate() + .AssertReply(String.Format("I can show you examples on how to use actions. Enter the number next to the entity that you with to see in action.{0}01 - Actions{0}02 - EndTurn{0}03 - IfCondiftion{0}04 - EditArray, Foreach{0}05 - EndDialog{0}06 - HttpRequest{0}07 - SwitchCondition{0}08 - RepeatDialog{0}09 - TraceAndLog{0}10 - EditActions{0}11 - ReplaceDialog{0}12 - EmitEvent{0}", Environment.NewLine)).Send("09") + .Send("luhan") + .AssertReply(activity => + { + var trace = (Activity)activity; + Assert.AreEqual(ActivityTypes.Trace, trace.Type, "should be trace activity"); + }) + .StartTestAsync(); + } + + [TestMethod] + public async Task Actions_09EditActions() + { + await BuildTestFlow(getFolderPath("Steps_Samples")) + .SendConversationUpdate() + .AssertReply(String.Format("I can show you examples on how to use actions. Enter the number next to the entity that you with to see in action.{0}01 - Actions{0}02 - EndTurn{0}03 - IfCondiftion{0}04 - EditArray, Foreach{0}05 - EndDialog{0}06 - HttpRequest{0}07 - SwitchCondition{0}08 - RepeatDialog{0}09 - TraceAndLog{0}10 - EditActions{0}11 - ReplaceDialog{0}12 - EmitEvent{0}", Environment.NewLine)).Send("10") + .AssertReply("Hello, I'm Zoidberg. What is your name?") + .Send("luhan") + .AssertReply("Hello luhan, nice to talk to you!") + .AssertReply("Goodbye!") + .StartTestAsync(); + } + + [TestMethod] + public async Task Actions_10ReplaceDialog() + { + await BuildTestFlow(getFolderPath("Steps_Samples")) + .SendConversationUpdate() + .AssertReply(String.Format("I can show you examples on how to use actions. Enter the number next to the entity that you with to see in action.{0}01 - Actions{0}02 - EndTurn{0}03 - IfCondiftion{0}04 - EditArray, Foreach{0}05 - EndDialog{0}06 - HttpRequest{0}07 - SwitchCondition{0}08 - RepeatDialog{0}09 - TraceAndLog{0}10 - EditActions{0}11 - ReplaceDialog{0}12 - EmitEvent{0}", Environment.NewLine)).Send("11") + .AssertReply("Hello, I'm Zoidberg. What is your name?") + .Send("luhan") + .AssertReply("Hello luhan, nice to talk to you! Please either enter 'joke' or 'fortune' to replace the dialog you want.") + .Send("joke") + .AssertReply("Why did the chicken cross the road?") + .Send("Why?") + .AssertReply("To get to the other side!") + .Send("future") + .AssertReply("Seeing into your future...") + .AssertReply("I see great things in your future!") + .AssertReply("Potentially a successful demo") + .StartTestAsync(); + } + + [TestMethod] + public async Task Actions_11EmitEvent() + { + await BuildTestFlow(getFolderPath("Steps_Samples")) + .SendConversationUpdate() + .AssertReply(String.Format("I can show you examples on how to use actions. Enter the number next to the entity that you with to see in action.{0}01 - Actions{0}02 - EndTurn{0}03 - IfCondiftion{0}04 - EditArray, Foreach{0}05 - EndDialog{0}06 - HttpRequest{0}07 - SwitchCondition{0}08 - RepeatDialog{0}09 - TraceAndLog{0}10 - EditActions{0}11 - ReplaceDialog{0}12 - EmitEvent{0}", Environment.NewLine)).Send("12") + .AssertReply("Say moo to get a response, say emit to emit a event.") + .Send("moo") + .AssertReply("Yippee ki-yay!") + .Send("emit") + .AssertReply("CustomEvent Fired.") + .StartTestAsync(); + } + + private TestFlow BuildTestFlow(string folderPath, bool sendTrace = false) + { + TypeFactory.Configuration = new ConfigurationBuilder().Build(); + var storage = new MemoryStorage(); + var convoState = new ConversationState(storage); + var userState = new UserState(storage); + var adapter = new TestAdapter(TestAdapter.CreateConversation(TestContext.TestName), sendTrace); + var resourceExplorer = new ResourceExplorer(); + resourceExplorer.AddFolder(folderPath); + adapter + .UseStorage(storage) + .UseState(userState, convoState) + .UseAdaptiveDialogs() + .UseLanguageGeneration(resourceExplorer, "common.lg") + .UseResourceExplorer(resourceExplorer) + .Use(new TranscriptLoggerMiddleware(new FileTranscriptLogger())); + + var resource = resourceExplorer.GetResource("Main.dialog"); + var dialog = DeclarativeTypeLoader.Load(resource, resourceExplorer, DebugSupport.SourceMap); + DialogManager dm = new DialogManager(dialog); + + return new TestFlow(adapter, async (turnContext, cancellationToken) => + { + if (dialog is AdaptiveDialog planningDialog) + { + await dm.OnTurnAsync(turnContext, null, cancellationToken).ConfigureAwait(false); + } + }); + } + } +} diff --git a/BotProject/Templates/CSharp/Tests/ControllingConversationTests.cs b/BotProject/Templates/CSharp/Tests/ControllingConversationTests.cs new file mode 100644 index 0000000000..bd19f32374 --- /dev/null +++ b/BotProject/Templates/CSharp/Tests/ControllingConversationTests.cs @@ -0,0 +1,113 @@ +using Microsoft.Bot.Builder; +using Microsoft.Bot.Builder.Adapters; +using Microsoft.Bot.Builder.Dialogs; +using Microsoft.Bot.Builder.Dialogs.Adaptive; +using Microsoft.Bot.Builder.Dialogs.Debugging; +using Microsoft.Bot.Builder.Dialogs.Declarative; +using Microsoft.Bot.Builder.Dialogs.Declarative.Resources; +using Microsoft.Bot.Builder.Dialogs.Declarative.Types; +using Microsoft.Bot.Builder.LanguageGeneration; +using Microsoft.Bot.Builder.ComposerBot.json; +using Microsoft.Bot.Schema; +using Microsoft.Extensions.Configuration; +using Microsoft.VisualStudio.TestTools.UnitTesting; +using System; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; + +namespace Tests +{ + [TestClass] + public class ControllingConversationTests + { + private static string getOsPath(string path) => Path.Combine(path.TrimEnd('\\').Split('\\')); + + private static readonly string samplesDirectory = getOsPath(@"..\..\..\..\..\..\SampleBots"); + + private static ResourceExplorer resourceExplorer = new ResourceExplorer(); + + + [ClassInitialize] + public static void ClassInitialize(TestContext context) + { + TypeFactory.Configuration = new ConfigurationBuilder().AddInMemoryCollection().Build(); + string path = Path.GetFullPath(Path.Combine(Environment.CurrentDirectory, samplesDirectory, "ControllingConversation")); + resourceExplorer.AddFolder(path); + } + + [ClassCleanup] + public static void ClassCleanup() + { + resourceExplorer.Dispose(); + } + + public TestContext TestContext { get; set; } + + [TestMethod] + public async Task ControllingConversationBotTest() + { + await BuildTestFlow() + .SendConversationUpdate() + .AssertReply("Welcome to the Controlling Conversation sample. Choose from the list below to try.\nYou can also type \"Cancel\" to cancel any dialog or \"Endturn\" to explicitly accept an input.") + .Send("01") + .AssertReply("Hello, What's your age?") + .Send("18") + .AssertReply("Your age is 18 which satisified the condition that was evaluated") + .Send("02") + .AssertReply("Who are your?\n\n 1. Susan\n 2. Nick\n 3. Tom") + .Send("2") + .AssertReply("You selected Nick") + .AssertReply("This is the logic inside the \"Nick\" switch block.") + .Send("03") + .AssertReply("Pushed dialog.id into a list") + .AssertReply("0: 11111") + .AssertReply("1: 40000") + .AssertReply("2: 222222") + .Send("04") + .AssertReply("Pushed dialog.ids into a list") + .AssertReply("0: 11111") + .AssertReply("1: 40000") + .AssertReply("0: 222222") + .Send("06") + .Send("hi") + .Send("07") + .AssertReply("Do you want to repeat this dialog, yes to repeat, no to end this dialog (1) Yes or (2) No") + .Send("Yes") + .AssertReply("Do you want to repeat this dialog, yes to repeat, no to end this dialog (1) Yes or (2) No") + .Send("No") + .Send("05") + .AssertReply("Canceled.") + .StartTestAsync(); + } + + + private TestFlow BuildTestFlow(bool sendTrace = false) + { + TypeFactory.Configuration = new ConfigurationBuilder().Build(); + var storage = new MemoryStorage(); + var convoState = new ConversationState(storage); + var userState = new UserState(storage); + var adapter = new TestAdapter(TestAdapter.CreateConversation(TestContext.TestName), sendTrace); + adapter + .UseStorage(storage) + .UseState(userState, convoState) + .UseAdaptiveDialogs() + .UseLanguageGeneration(resourceExplorer, "common.lg") + .UseResourceExplorer(resourceExplorer) + .Use(new TranscriptLoggerMiddleware(new FileTranscriptLogger())); + + var resource = resourceExplorer.GetResource("Main.dialog"); + var dialog = DeclarativeTypeLoader.Load(resource, resourceExplorer, DebugSupport.SourceMap); + DialogManager dm = new DialogManager(dialog); + + return new TestFlow(adapter, async (turnContext, cancellationToken) => + { + if (dialog is AdaptiveDialog planningDialog) + { + await dm.OnTurnAsync(turnContext, null, cancellationToken).ConfigureAwait(false); + } + }); + } + } +} diff --git a/BotProject/Templates/CSharp/Tests/InputsTests.cs b/BotProject/Templates/CSharp/Tests/InputsTests.cs new file mode 100644 index 0000000000..4c586c8380 --- /dev/null +++ b/BotProject/Templates/CSharp/Tests/InputsTests.cs @@ -0,0 +1,145 @@ +using Microsoft.Bot.Builder; +using Microsoft.Bot.Builder.Adapters; +using Microsoft.Bot.Builder.Dialogs; +using Microsoft.Bot.Builder.Dialogs.Adaptive; +using Microsoft.Bot.Builder.Dialogs.Debugging; +using Microsoft.Bot.Builder.Dialogs.Declarative; +using Microsoft.Bot.Builder.Dialogs.Declarative.Resources; +using Microsoft.Bot.Builder.Dialogs.Declarative.Types; +using Microsoft.Bot.Builder.LanguageGeneration; +using Microsoft.Bot.Builder.ComposerBot.json; +using Microsoft.Bot.Schema; +using Microsoft.Extensions.Configuration; +using Microsoft.VisualStudio.TestTools.UnitTesting; +using System; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; + +namespace Tests +{ + [TestClass] + public class InputsTests + { + private static string getOsPath(string path) => Path.Combine(path.TrimEnd('\\').Split('\\')); + + private static readonly string samplesDirectory = getOsPath(@"..\..\..\..\..\..\SampleBots"); + + private static ResourceExplorer resourceExplorer = new ResourceExplorer(); + + + [ClassInitialize] + public static void ClassInitialize(TestContext context) + { + TypeFactory.Configuration = new ConfigurationBuilder().AddInMemoryCollection().Build(); + string path = Path.GetFullPath(Path.Combine(Environment.CurrentDirectory, samplesDirectory, "Inputs_Samples")); + resourceExplorer.AddFolder(path); + } + + [ClassCleanup] + public static void ClassCleanup() + { + resourceExplorer.Dispose(); + } + + public TestContext TestContext { get; set; } + + [TestMethod] + public async Task Inputs_01TextInput() + { + await BuildTestFlow() + .SendConversationUpdate() + .AssertReply(String.Format("Welcome to Input Sample Bot.{0}I can show you examples on how to use actions, You can enter number 01-04{0}01 - TextInput{0}02 - NumberInput{0}03 - ConfirmInput{0}04 - ChoiceInput{0}05 - AttachmentInput{0}06 - DateTimeInput{0}07 - OAuthInput{0}", Environment.NewLine)) + .Send("01") + .AssertReply("Hello, I'm Zoidberg. What is your name? (This can't be interrupted)") + .Send("02") + .AssertReply("Hello 02, nice to talk to you!") + .Send("02") + .AssertReply("What is your age?") + .StartTestAsync(); + } + + [TestMethod] + public async Task Inputs_02NumberInput() + { + await BuildTestFlow() + .SendConversationUpdate() + .AssertReply(String.Format("Welcome to Input Sample Bot.{0}I can show you examples on how to use actions, You can enter number 01-04{0}01 - TextInput{0}02 - NumberInput{0}03 - ConfirmInput{0}04 - ChoiceInput{0}05 - AttachmentInput{0}06 - DateTimeInput{0}07 - OAuthInput{0}", Environment.NewLine)) + .Send("02") + .AssertReply("What is your age?") + .Send("18") + .AssertReply("Hello, your age is 18!") + .AssertReply("2 * 2.2 equals?") + .Send("4.4") + .AssertReply("2 * 2.2 equals 4.4, that's right!") + .StartTestAsync(); + } + + [TestMethod] + public async Task Inputs_03ConfirmInput() + { + await BuildTestFlow() + .SendConversationUpdate() + .AssertReply(String.Format("Welcome to Input Sample Bot.{0}I can show you examples on how to use actions, You can enter number 01-04{0}01 - TextInput{0}02 - NumberInput{0}03 - ConfirmInput{0}04 - ChoiceInput{0}05 - AttachmentInput{0}06 - DateTimeInput{0}07 - OAuthInput{0}", Environment.NewLine)) + .Send("03") + .AssertReply("yes or no (1) Yes or (2) No") + .Send("asdasd") + .AssertReply("I need a yes or no. (1) Yes or (2) No") + .Send("yes") + .AssertReply("confirmation: True") + .StartTestAsync(); + } + + [TestMethod] + public async Task Inputs_04ChoiceInput() + { + await BuildTestFlow() + .SendConversationUpdate() + .AssertReply(String.Format("Welcome to Input Sample Bot.{0}I can show you examples on how to use actions, You can enter number 01-04{0}01 - TextInput{0}02 - NumberInput{0}03 - ConfirmInput{0}04 - ChoiceInput{0}05 - AttachmentInput{0}06 - DateTimeInput{0}07 - OAuthInput{0}", Environment.NewLine)).Send("04") + .AssertReply("Please select a value from below:\n\n 1. Test1\n 2. Test2\n 3. Test3") + .Send("Test1") + .AssertReply("You select: Test1") + .StartTestAsync(); + } + + [TestMethod] + public async Task Inputs_06DateTimeInput() + { + await BuildTestFlow() + .SendConversationUpdate() + .AssertReply(String.Format("Welcome to Input Sample Bot.{0}I can show you examples on how to use actions, You can enter number 01-04{0}01 - TextInput{0}02 - NumberInput{0}03 - ConfirmInput{0}04 - ChoiceInput{0}05 - AttachmentInput{0}06 - DateTimeInput{0}07 - OAuthInput{0}", Environment.NewLine)).Send("06") + .AssertReply("Please enter a date.") + .Send("June 1st") + .AssertReply("You entered: 2019-06-01") + .StartTestAsync(); + } + + private TestFlow BuildTestFlow(bool sendTrace = false) + { + TypeFactory.Configuration = new ConfigurationBuilder().Build(); + var storage = new MemoryStorage(); + var convoState = new ConversationState(storage); + var userState = new UserState(storage); + var adapter = new TestAdapter(TestAdapter.CreateConversation(TestContext.TestName), sendTrace); + adapter + .UseStorage(storage) + .UseState(userState, convoState) + .UseAdaptiveDialogs() + .UseLanguageGeneration(resourceExplorer, "common.lg") + .UseResourceExplorer(resourceExplorer) + .Use(new TranscriptLoggerMiddleware(new FileTranscriptLogger())); + + var resource = resourceExplorer.GetResource("Main.dialog"); + var dialog = DeclarativeTypeLoader.Load(resource, resourceExplorer, DebugSupport.SourceMap); + DialogManager dm = new DialogManager(dialog); + + return new TestFlow(adapter, async (turnContext, cancellationToken) => + { + if (dialog is AdaptiveDialog planningDialog) + { + await dm.OnTurnAsync(turnContext, null, cancellationToken).ConfigureAwait(false); + } + }); + } + } +} diff --git a/BotProject/Templates/CSharp/Tests/MessageTests.cs b/BotProject/Templates/CSharp/Tests/MessageTests.cs new file mode 100644 index 0000000000..75e1275b5a --- /dev/null +++ b/BotProject/Templates/CSharp/Tests/MessageTests.cs @@ -0,0 +1,101 @@ +using Microsoft.Bot.Builder; +using Microsoft.Bot.Builder.Adapters; +using Microsoft.Bot.Builder.Dialogs; +using Microsoft.Bot.Builder.Dialogs.Adaptive; +using Microsoft.Bot.Builder.Dialogs.Debugging; +using Microsoft.Bot.Builder.Dialogs.Declarative; +using Microsoft.Bot.Builder.Dialogs.Declarative.Resources; +using Microsoft.Bot.Builder.Dialogs.Declarative.Types; +using Microsoft.Bot.Builder.LanguageGeneration; +using Microsoft.Bot.Builder.ComposerBot.json; +using Microsoft.Bot.Schema; +using Microsoft.Extensions.Configuration; +using Microsoft.VisualStudio.TestTools.UnitTesting; +using System; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; + +namespace Tests +{ + [TestClass] + public class MessageTests + { + private static string getOsPath(string path) => Path.Combine(path.TrimEnd('\\').Split('\\')); + + private static readonly string samplesDirectory = getOsPath(@"..\..\..\..\..\..\SampleBots"); + + private static ResourceExplorer resourceExplorer = new ResourceExplorer(); + + + [ClassInitialize] + public static void ClassInitialize(TestContext context) + { + TypeFactory.Configuration = new ConfigurationBuilder().AddInMemoryCollection().Build(); + string path = Path.GetFullPath(Path.Combine(Environment.CurrentDirectory, samplesDirectory, "Message_Samples")); + resourceExplorer.AddFolder(path); + } + + [ClassCleanup] + public static void ClassCleanup() + { + resourceExplorer.Dispose(); + } + + public TestContext TestContext { get; set; } + + [TestMethod] + public async Task MessageTest() + { + await BuildTestFlow() + .SendConversationUpdate() + .AssertReply("What type of message would you like to send?\n\n 1. Simple Text\n 2. Text With Memory\n 3. Text With LG\n 4. LGWithParam\n 5. LGComposition") + .Send("1") + .AssertReply("Here is a simple text message.") + .AssertReply("What type of message would you like to send?\n\n 1. Simple Text\n 2. Text With Memory\n 3. Text With LG\n 4. LGWithParam\n 5. LGComposition") + .Send("2") + .AssertReply("This is a text saved in memory.") + .AssertReply("What type of message would you like to send?\n\n 1. Simple Text\n 2. Text With Memory\n 3. Text With LG\n 4. LGWithParam\n 5. LGComposition") + .Send("3") + .AssertReplyOneOf(new string[] { "Hello, this is a text with LG", "Hi, this is a text with LG", "Hey, this is a text with LG" }) + .AssertReply("What type of message would you like to send?\n\n 1. Simple Text\n 2. Text With Memory\n 3. Text With LG\n 4. LGWithParam\n 5. LGComposition") + .Send("4") + .AssertReply("Hello, I'm Zoidberg. What is your name?") + .Send("luhan") + .AssertReply("Hello luhan, nice to talk to you!") + .AssertReply("What type of message would you like to send?\n\n 1. Simple Text\n 2. Text With Memory\n 3. Text With LG\n 4. LGWithParam\n 5. LGComposition") + .Send("5") + .AssertReply("luhan nice to talk to you!") + .AssertReply("What type of message would you like to send?\n\n 1. Simple Text\n 2. Text With Memory\n 3. Text With LG\n 4. LGWithParam\n 5. LGComposition") + .StartTestAsync(); + } + + private TestFlow BuildTestFlow(bool sendTrace = false) + { + TypeFactory.Configuration = new ConfigurationBuilder().Build(); + var storage = new MemoryStorage(); + var convoState = new ConversationState(storage); + var userState = new UserState(storage); + var adapter = new TestAdapter(TestAdapter.CreateConversation(TestContext.TestName), sendTrace); + adapter + .UseStorage(storage) + .UseState(userState, convoState) + .UseAdaptiveDialogs() + .UseLanguageGeneration(resourceExplorer, "common.lg") + .UseResourceExplorer(resourceExplorer) + .Use(new TranscriptLoggerMiddleware(new FileTranscriptLogger())); + + var resource = resourceExplorer.GetResource("Main.dialog"); + var dialog = DeclarativeTypeLoader.Load(resource, resourceExplorer, DebugSupport.SourceMap); + DialogManager dm = new DialogManager(dialog); + + return new TestFlow(adapter, async (turnContext, cancellationToken) => + { + if (dialog is AdaptiveDialog planningDialog) + { + await dm.OnTurnAsync(turnContext, null, cancellationToken).ConfigureAwait(false); + } + }); + } + } +} diff --git a/BotProject/Templates/CSharp/Tests/Tests.csproj b/BotProject/Templates/CSharp/Tests/Tests.csproj new file mode 100644 index 0000000000..968618d2d8 --- /dev/null +++ b/BotProject/Templates/CSharp/Tests/Tests.csproj @@ -0,0 +1,19 @@ + + + + netcoreapp2.1 + + false + + + + + + + + + + + + + diff --git a/BotProject/Templates/CSharp/Tests/ToDoBotTests.cs b/BotProject/Templates/CSharp/Tests/ToDoBotTests.cs new file mode 100644 index 0000000000..70bc1a11cd --- /dev/null +++ b/BotProject/Templates/CSharp/Tests/ToDoBotTests.cs @@ -0,0 +1,98 @@ +using Microsoft.Bot.Builder; +using Microsoft.Bot.Builder.Adapters; +using Microsoft.Bot.Builder.Dialogs; +using Microsoft.Bot.Builder.Dialogs.Adaptive; +using Microsoft.Bot.Builder.Dialogs.Debugging; +using Microsoft.Bot.Builder.Dialogs.Declarative; +using Microsoft.Bot.Builder.Dialogs.Declarative.Resources; +using Microsoft.Bot.Builder.Dialogs.Declarative.Types; +using Microsoft.Bot.Builder.LanguageGeneration; +using Microsoft.Bot.Builder.ComposerBot.json; +using Microsoft.Bot.Schema; +using Microsoft.Extensions.Configuration; +using Microsoft.VisualStudio.TestTools.UnitTesting; +using System; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; + +namespace Tests +{ + [TestClass] + public class ToDoBotTests + { + private static string getOsPath(string path) => Path.Combine(path.TrimEnd('\\').Split('\\')); + + private static readonly string samplesDirectory = getOsPath(@"..\..\..\..\..\..\SampleBots"); + + private static ResourceExplorer resourceExplorer = new ResourceExplorer(); + + + [ClassInitialize] + public static void ClassInitialize(TestContext context) + { + TypeFactory.Configuration = new ConfigurationBuilder().AddInMemoryCollection().Build(); + string path = Path.GetFullPath(Path.Combine(Environment.CurrentDirectory, samplesDirectory, "ToDoBot")); + resourceExplorer.AddFolder(path); + } + + [ClassCleanup] + public static void ClassCleanup() + { + resourceExplorer.Dispose(); + } + + public TestContext TestContext { get; set; } + + [TestMethod] + public async Task ToDoBotTest() + { + await BuildTestFlow() + .SendConversationUpdate() + .AssertReply("Hi! I'm a ToDo bot. Say \"add a todo named first\" to get started.") + .Send("add a todo named first") + .AssertReply("Successfully added a todo named first") + .Send("add a todo named second") + .AssertReply("Successfully added a todo named second") + .Send("add a todo") + .AssertReply("OK, please enter the title of your todo.") + .Send("third") + .AssertReply("Successfully added a todo named third") + .Send("show todos") + .AssertReply(String.Format("Your most recent 3 tasks are{0}* first\n* second\n* third", Environment.NewLine)) + .Send("delete todo named second") + .AssertReply("Successfully removed a todo named second") + .Send("show todos") + .AssertReply(String.Format("Your most recent 2 tasks are{0}* first\n* third", Environment.NewLine)) + .StartTestAsync(); + } + + private TestFlow BuildTestFlow(bool sendTrace = false) + { + TypeFactory.Configuration = new ConfigurationBuilder().Build(); + var storage = new MemoryStorage(); + var convoState = new ConversationState(storage); + var userState = new UserState(storage); + var adapter = new TestAdapter(TestAdapter.CreateConversation(TestContext.TestName), sendTrace); + adapter + .UseStorage(storage) + .UseState(userState, convoState) + .UseAdaptiveDialogs() + .UseLanguageGeneration(resourceExplorer, "common.lg") + .UseResourceExplorer(resourceExplorer) + .Use(new TranscriptLoggerMiddleware(new FileTranscriptLogger())); + + var resource = resourceExplorer.GetResource("Main.dialog"); + var dialog = DeclarativeTypeLoader.Load(resource, resourceExplorer, DebugSupport.SourceMap); + DialogManager dm = new DialogManager(dialog); + + return new TestFlow(adapter, async (turnContext, cancellationToken) => + { + if (dialog is AdaptiveDialog planningDialog) + { + await dm.OnTurnAsync(turnContext, null, cancellationToken).ConfigureAwait(false); + } + }); + } + } +} diff --git a/BotProject/Templates/CSharp/appsettings.Development.json b/BotProject/Templates/CSharp/appsettings.Development.json new file mode 100644 index 0000000000..e203e9407e --- /dev/null +++ b/BotProject/Templates/CSharp/appsettings.Development.json @@ -0,0 +1,9 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Debug", + "System": "Information", + "Microsoft": "Information" + } + } +} diff --git a/BotProject/Templates/CSharp/appsettings.json b/BotProject/Templates/CSharp/appsettings.json new file mode 100644 index 0000000000..cc17071455 --- /dev/null +++ b/BotProject/Templates/CSharp/appsettings.json @@ -0,0 +1,17 @@ +{ + "microsoftAppId": "", + "bot": "ComposerDialogs", + "cosmosDb": { + "authKey": "", + "collectionId": "botstate-collection", + "cosmosDBEndpoint": "", + "databaseId": "botstate-db" + }, + "applicationInsights": { + "InstrumentationKey": "" + }, + "blobStorage": { + "connectionString": "", + "container": "transcripts" + } +} diff --git a/Composer/packages/server/__tests__/mocks/asset/projects/SampleBot/a.lu b/BotProject/Templates/CSharp/packages/packages.json similarity index 100% rename from Composer/packages/server/__tests__/mocks/asset/projects/SampleBot/a.lu rename to BotProject/Templates/CSharp/packages/packages.json diff --git a/BotProject/Templates/CSharp/wwwroot/default.htm b/BotProject/Templates/CSharp/wwwroot/default.htm new file mode 100644 index 0000000000..636f6eab84 --- /dev/null +++ b/BotProject/Templates/CSharp/wwwroot/default.htm @@ -0,0 +1,364 @@ + + + + + + + __PROJECT_NAME__ + + + + + +
+
+
+
__PROJECT_NAME__
+
+
+
+
+
Your bot is ready!
+
You can test your bot in the Bot Framework Emulator
+ by connecting to http://localhost:3978/api/messages.
+ +
Visit Azure + Bot Service to register your bot and add it to
+ various channels. The bot's endpoint URL typically looks + like this:
+
https://your_bots_hostname/api/messages
+
+
+
+
+ +
+ + + \ No newline at end of file diff --git a/Composer/.eslintrc.js b/Composer/.eslintrc.js index e4ca61f48e..9f597c4cfe 100644 --- a/Composer/.eslintrc.js +++ b/Composer/.eslintrc.js @@ -1,51 +1,75 @@ module.exports = { - extends: ['eslint:recommended', 'plugin:prettier/recommended'], - plugins: ['import', 'notice'], + extends: [ + 'eslint:recommended', + 'plugin:prettier/recommended', + 'plugin:@typescript-eslint/recommended', + 'plugin:@typescript-eslint/recommended-requiring-type-checking', + 'plugin:@typescript-eslint/eslint-recommended', + 'prettier/@typescript-eslint', + ], + plugins: ['import', 'notice', 'security'], env: { browser: true, es6: true, node: true, }, rules: { + '@typescript-eslint/ban-ts-ignore': 'warn', + '@typescript-eslint/explicit-function-return-type': 'off', + '@typescript-eslint/interface-name-prefix': 'off', + '@typescript-eslint/no-unnecessary-type-assertion': 'off', + '@typescript-eslint/no-use-before-define': 'warn', + // eslint rules 'no-dupe-class-members': 'off', - 'no-undef': 'off', // ts compiler catches this 'prefer-const': 'error', 'no-var': 'error', 'no-console': 'warn', 'dot-notation': 'error', yoda: 'error', - eqeqeq: 'warn', + // eqeqeq: 'error', // plugin: import 'import/first': 'error', 'import/order': ['error', { 'newlines-between': 'always' }], + + // security + 'security/detect-buffer-noassert': 'error', + 'security/detect-child-process': 'error', + 'security/detect-disable-mustache-escape': 'error', + 'security/detect-eval-with-expression': 'error', + 'security/detect-new-buffer': 'error', + 'security/detect-no-csrf-before-method-override': 'error', + 'security/detect-non-literal-fs-filename': 'error', + 'security/detect-non-literal-regexp': 'error', + 'security/detect-non-literal-require': 'error', + 'security/detect-object-injection': 'off', + 'security/detect-possible-timing-attacks': 'error', + 'security/detect-pseudoRandomBytes': 'error', + 'security/detect-unsafe-regex': 'error', }, overrides: [ - { - files: ['**/*.+(ts|tsx)'], - parser: '@typescript-eslint/parser', - plugins: ['@typescript-eslint', 'prettier'], - rules: { - '@typescript-eslint/interface-name-prefix': 'off', - '@typescript-eslint/explicit-function-return-type': 'off', - '@typescript-eslint/no-unused-vars': ['error', { argsIgnorePattern: '^_' }], - '@typescript-eslint/no-explicit-any': ['warn'], - }, - }, - { - files: ['**/*.+(js|jsx)'], - parser: 'babel-eslint', - }, { files: ['**/*.+(test|spec).+(js|jsx|ts|tsx)'], env: { jest: true, }, rules: { - 'typescript/class-name-casing': 'off', - 'typescript/no-explicit-any': 'off', '@typescript-eslint/no-object-literal-type-assertion': 'off', + + 'security/detect-buffer-noassert': 'off', + 'security/detect-child-process': 'off', + 'security/detect-disable-mustache-escape': 'off', + 'security/detect-eval-with-expression': 'off', + 'security/detect-new-buffer': 'off', + 'security/detect-no-csrf-before-method-override': 'off', + 'security/detect-non-literal-fs-filename': 'off', + 'security/detect-non-literal-regexp': 'off', + 'security/detect-non-literal-require': 'off', + 'security/detect-object-injection': 'off', + 'security/detect-possible-timing-attacks': 'off', + 'security/detect-pseudoRandomBytes': 'off', + 'security/detect-unsafe-regex': 'off', }, }, ], diff --git a/Composer/.eslintrc.react.js b/Composer/.eslintrc.react.js index 69aff4acae..e6b9ee820e 100644 --- a/Composer/.eslintrc.react.js +++ b/Composer/.eslintrc.react.js @@ -3,7 +3,7 @@ module.exports = { plugins: ['react-hooks', 'format-message'], settings: { react: { - version: 'detect', + version: '16.9.0', }, }, parserOptions: { @@ -14,15 +14,17 @@ module.exports = { }, }, rules: { - 'react/no-deprecated': 'warn', - 'react-hooks/rules-of-hooks': 'error', - 'react-hooks/exhaustive-deps': 'off', - - 'react/prop-types': 'warn', - 'format-message/literal-pattern': 'error', 'format-message/no-invalid-pattern': 'error', 'format-message/no-missing-params': ['error', { allowNonLiteral: false }], + + 'react-hooks/exhaustive-deps': 'off', + 'react-hooks/rules-of-hooks': 'error', + + 'react/display-name': 'off', + 'react/no-danger': 'error', + 'react/no-deprecated': 'warn', + 'react/prop-types': 'warn', }, overrides: [ { @@ -36,6 +38,7 @@ module.exports = { rules: { 'react/display-name': 'off', 'react/prop-types': 'off', + 'react/no-danger': 'off', }, }, ], diff --git a/Composer/Dockerfile b/Composer/Dockerfile index 1d6799787e..aa3010f6d2 100644 --- a/Composer/Dockerfile +++ b/Composer/Dockerfile @@ -10,17 +10,16 @@ COPY yarn.lock ./packages/server/ COPY packages/server/package.json ./packages/server/ COPY packages/lib/package.json ./packages/lib/ COPY packages/lib/code-editor/package.json ./packages/lib/code-editor/ -COPY packages/lib/shared-menus/package.json ./packages/lib/shared-menus/ +COPY packages/lib/shared/package.json ./packages/lib/shared/ COPY packages/extensions/package.json ./packages/extensions/ COPY packages/extensions/obiformeditor/package.json ./packages/extensions/obiformeditor/ -COPY packages/extensions/sample-json-editor/package.json ./packages/extensions/sample-json-editor/ COPY packages/extensions/visual-designer/package.json ./packages/extensions/visual-designer/ # run yarn install as a distinct layer RUN yarn install COPY . . -RUN yarn build +RUN yarn build:prod # use a multi-stage build to reduce the final image size FROM node:10-alpine diff --git a/Composer/README.md b/Composer/README.md index 9a5989e9fb..b741313d15 100644 --- a/Composer/README.md +++ b/Composer/README.md @@ -26,6 +26,9 @@ If you want to test bot, you should have your bot runtime running for composer t If you run into the issue of `There appears to be trouble with your network connection. Retrying...` when running `yarn install`, plese run `yarn install --network-timeout 1000000` instead to bypass the issue. +## Documentation +The documentation for Composer [can be found here](/blob/master/docs/). + ## Extension Framework Composer is built on top of an extension framework, which allows anyone to provide an extension as the editor of certain type of bot assets. diff --git a/Composer/babel.config.js b/Composer/babel.config.js index abbd567431..8d6062d167 100644 --- a/Composer/babel.config.js +++ b/Composer/babel.config.js @@ -13,6 +13,7 @@ module.exports = { ], '@babel/preset-react', '@babel/preset-typescript', + '@emotion/babel-preset-css-prop', ], plugins: ['@babel/plugin-proposal-class-properties', '@babel/plugin-transform-runtime'], }, diff --git a/Composer/cypress/integration/Breadcrumb.spec.js b/Composer/cypress/integration/Breadcrumb.spec.js index 6ac7dd16e3..7ac2eeca9b 100644 --- a/Composer/cypress/integration/Breadcrumb.spec.js +++ b/Composer/cypress/integration/Breadcrumb.spec.js @@ -1,39 +1,76 @@ /// context('breadcrumb', () => { - beforeEach(() => { + before(() => { cy.visit(Cypress.env('COMPOSER_URL')); cy.openBot('ToDoBot'); + cy.wait(100); + }); + + beforeEach(() => { + // Return to Main.dialog + cy.get('[data-testid="ProjectTree"]').within(() => { + cy.wait(1000); + cy.getByText('ToDoBot.Main').click(); + cy.wait(1000); + }); }); it('can show dialog name in breadcrumb', () => { + // Should path = main dialog at first render cy.getByTestId('Breadcrumb') .invoke('text') .should('contain', 'ToDoBot.Main'); + // Click on AddToDo dialog cy.get('[data-testid="ProjectTree"]').within(() => { cy.getByText('AddToDo').click(); }); - cy.getByTestId('Breadcrumb') .invoke('text') .should('contain', 'AddToDo'); + // Return to Main.dialog cy.get('[data-testid="ProjectTree"]').within(() => { cy.getByText('ToDoBot.Main').click(); - cy.getByText('#AddIntent').click(); + cy.wait(100); }); - cy.withinEditor('VisualEditor', () => { - cy.getByText('AddIntent').click(); + cy.getByTestId('Breadcrumb') + .invoke('text') + .should('contain', 'ToDoBot'); + }); + + it('can show event name in breadcrumb', () => { + cy.get('[data-testid="ProjectTree"]').within(() => { + cy.getByText('AddToDo').click(); cy.wait(100); + cy.getByText('Handle an Event: BeginDialog').click(); + cy.wait(100); + }); + + cy.getByTestId('Breadcrumb') + .invoke('text') + .should('match', /AddToDo.*Handle an Event.*/); + }); + + it('can show action name in breadcrumb', () => { + cy.wait(100); + cy.get('[data-testid="ProjectTree"]').within(() => { + cy.getByText('Handle an Event: BeginDialog').click(); + cy.wait(500); + }); + + // Click on an action + cy.withinEditor('VisualEditor', () => { cy.getByTestId('RuleEditor').within(() => { - cy.getByText('AddToDo').click(); + cy.getByText('Send an Activity').click(); + cy.wait(500); }); }); cy.getByTestId('Breadcrumb') .invoke('text') - .should('match', /ToDoBot.+AddToDo/); + .should('match', /ToDoBot.+Send an Activity/); }); }); diff --git a/Composer/cypress/integration/CreateNewBot.spec.js b/Composer/cypress/integration/CreateNewBot.spec.js index 24d47ef25e..98336733e4 100644 --- a/Composer/cypress/integration/CreateNewBot.spec.js +++ b/Composer/cypress/integration/CreateNewBot.spec.js @@ -3,13 +3,20 @@ context('Creating a new bot', () => { beforeEach(() => { cy.visit(Cypress.env('COMPOSER_URL')); + cy.wait(1000); + cy.get('[data-testid="LeftNav-CommandBarButtonHome"]').click(); + cy.wait(5000); + cy.get('[data-testid="homePage-ToolBar-New"]').within(() => { + cy.getByText('New').click(); + }); + cy.wait(5000); }); it('can create a new bot', () => { - cy.get('[data-testid="LeftNav-CommandBarButtonHome"]').click(); - cy.get('[data-testid="homePage-ToolBar-New"]').click(); cy.get('input[data-testid="Create from scratch"]').click(); + cy.wait(100); cy.get('button[data-testid="NextStepButton"]').click(); + cy.wait(100); cy.get('input[data-testid="NewDialogName"]').type('__TestNewProject'); cy.get('input[data-testid="NewDialogName"]').type('{enter}'); cy.get('[data-testid="ProjectTree"]').within(() => { @@ -18,10 +25,12 @@ context('Creating a new bot', () => { }); it('can create a bot from the ToDo template', () => { - cy.get('[data-testid="homePage-ToolBar-New"]').click(); cy.get('input[data-testid="Create from template"]').click({ force: true }); + cy.wait(100); cy.get('[data-testid="ToDoBot"]').click(); + cy.wait(100); cy.get('button[data-testid="NextStepButton"]').click(); + cy.wait(100); cy.get('input[data-testid="NewDialogName"]').type('__TestNewProject'); cy.get('input[data-testid="NewDialogName"]').type('{enter}'); cy.get('[data-testid="ProjectTree"]').within(() => { diff --git a/Composer/cypress/integration/CursorMove.spec.js b/Composer/cypress/integration/CursorMove.spec.js deleted file mode 100644 index 759176fc1a..0000000000 --- a/Composer/cypress/integration/CursorMove.spec.js +++ /dev/null @@ -1,73 +0,0 @@ -/// -require('cypress-plugin-tab'); - -// this test is too unstable right now -// re-enable when stablized -context('Cursor move', () => { - beforeEach(() => { - cy.visit(Cypress.env('COMPOSER_URL')); - cy.openBot('ToDoBot'); - }); - it('can move cursor by pressing direction key or tab', () => { - cy.get('[data-testid="ProjectTree"]').within(() => { - cy.getByText('AddToDo').click(); - cy.wait(100); - }); - - cy.withinEditor('VisualEditor', () => { - cy.get('[data-is-node=true]').as('selectedNodes'); - cy.get('@selectedNodes') - .eq(1) - .click(); - - // down arrow - cy.get('[data-test-id="keyboard-zone"]').type('{downarrow}'); - cy.wait(100); - cy.get('@selectedNodes') - .eq(2) - .should('have.class', 'step-renderer-container--selected'); - - cy.wait(100); - - // right arrow - cy.get('[data-test-id="keyboard-zone"]').type('{rightarrow}'); - cy.wait(100); - cy.get('@selectedNodes') - .eq(4) - .should('have.class', 'step-renderer-container--selected'); - - cy.wait(100); - - // left arrow - cy.get('[data-test-id="keyboard-zone"]').type('{leftarrow}'); - cy.wait(100); - cy.get('@selectedNodes') - .eq(5) - .should('have.class', 'step-renderer-container--selected'); - - cy.wait(100); - - // up arrow - cy.get('[data-test-id="keyboard-zone"]').type('{uparrow}'); - cy.wait(100); - cy.get('@selectedNodes') - .eq(3) - .should('have.class', 'step-renderer-container--selected'); - cy.wait(100); - - cy.get('[data-is-selectable=true]').as('selectedElements'); - - cy.get('@selectedElements') - .eq(1) - .click(); - - // tab - cy.get('[data-test-id="keyboard-zone"]').tab(); - cy.wait(100); - cy.get('@selectedElements') - .eq(2) - .should('have.class', 'step-renderer-container--selected'); - cy.wait(100); - }); - }); -}); diff --git a/Composer/cypress/integration/LUPage.spec.js b/Composer/cypress/integration/LUPage.spec.js index 1d07fca875..e0ae983f8c 100644 --- a/Composer/cypress/integration/LUPage.spec.js +++ b/Composer/cypress/integration/LUPage.spec.js @@ -1,7 +1,7 @@ /// context('check language understanding page', () => { - beforeEach(() => { + before(() => { cy.visit(Cypress.env('COMPOSER_URL')); cy.openBot('ToDoLuisBot'); }); diff --git a/Composer/cypress/integration/LuisDeploy.spec.js b/Composer/cypress/integration/LuisDeploy.spec.js index dd32c89bab..8b2b546c16 100644 --- a/Composer/cypress/integration/LuisDeploy.spec.js +++ b/Composer/cypress/integration/LuisDeploy.spec.js @@ -31,6 +31,7 @@ context('Luis Deploy', () => { response: 'fixture:luPublish/success', }); cy.getByText('Start Bot').click(); + cy.wait(5000); // clear its settings before cy.get('[data-testid="ProjectNameInput"]') .clear() @@ -44,6 +45,7 @@ context('Luis Deploy', () => { // wait for the debounce interval of sync settings cy.wait(1000); cy.getByText('Publish').click(); + cy.wait(1000); cy.getByText('Restart Bot').should('exist'); cy.getByText('Test in Emulator').should('exist'); @@ -54,7 +56,9 @@ context('Luis Deploy', () => { response: 'fixture:luPublish/error', }); cy.getByText('Restart Bot').click(); + cy.wait(1000); cy.getByText('Try again').click(); + cy.wait(1000); cy.get('[data-testid="AuthoringKeyInput"]').type('no-id'); cy.getByText('Publish').click(); }); diff --git a/Composer/cypress/integration/RemoveDialog.spec.js b/Composer/cypress/integration/RemoveDialog.spec.js index 31bd85e20b..1fc4c24dbe 100644 --- a/Composer/cypress/integration/RemoveDialog.spec.js +++ b/Composer/cypress/integration/RemoveDialog.spec.js @@ -16,7 +16,9 @@ context('RemoveDialog', () => { .invoke('attr', 'style', 'visibility: visible') .click(); }); - cy.getByText('Delete').click(); + cy.get('.ms-ContextualMenu-linkContent > .ms-ContextualMenu-itemText').within(() => { + cy.getByText('Delete').click(); + }); cy.getByText('Yes').click(); cy.get('[data-testid="ProjectTree"]').within(() => { cy.get('[title="AddItem"]').should('not.exist'); diff --git a/Composer/cypress/integration/ToDoBot.spec.js b/Composer/cypress/integration/ToDoBot.spec.js index d611562a40..ffae862f35 100644 --- a/Composer/cypress/integration/ToDoBot.spec.js +++ b/Composer/cypress/integration/ToDoBot.spec.js @@ -1,7 +1,7 @@ /// context('ToDo Bot', () => { - beforeEach(() => { + before(() => { cy.visit(Cypress.env('COMPOSER_URL')); cy.openBot('ToDoBot'); }); @@ -9,9 +9,10 @@ context('ToDo Bot', () => { it('can open the main dialog', () => { cy.get('[data-testid="ProjectTree"]').within(() => { cy.getByText('ToDoBot.Main').click(); + cy.wait(100); }); cy.withinEditor('FormEditor', () => { - cy.getByText('ToDoBot.Main').should('exist'); + cy.getByDisplayValue('ToDoBot.Main').should('exist'); }); }); @@ -22,50 +23,40 @@ context('ToDo Bot', () => { }); cy.withinEditor('FormEditor', () => { - cy.getByText('AddToDo').should('exist'); - }); - - cy.withinEditor('VisualEditor', () => { - cy.getByText(/Successfully added a todo named/).should('exist'); + cy.getByDisplayValue('AddToDo').should('exist'); }); }); it('can open the ClearToDos dialog', () => { cy.get('[data-testid="ProjectTree"]').within(() => { cy.getByText('ClearToDos').click(); + cy.wait(100); }); cy.withinEditor('FormEditor', () => { - cy.getByText('ClearToDos').should('exist'); - }); - cy.withinEditor('VisualEditor', () => { - cy.getByText(/Successfully cleared items/).should('exist'); + cy.getByDisplayValue('ClearToDos').should('exist'); }); }); it('can open the DeleteToDo dialog', () => { cy.get('[data-testid="ProjectTree"]').within(() => { cy.getByText('DeleteToDo').click(); + cy.wait(100); }); cy.withinEditor('FormEditor', () => { - cy.getByText('DeleteToDo').should('exist'); - }); - cy.withinEditor('VisualEditor', () => { - cy.getByText('Edit an Array Property').should('exist'); + cy.getByDisplayValue('DeleteToDo').should('exist'); }); }); it('can open the ShowToDos dialog', () => { cy.get('[data-testid="ProjectTree"]').within(() => { cy.getByText('ShowToDos').click(); + cy.wait(100); }); cy.withinEditor('FormEditor', () => { - cy.getByText('ShowToDos').should('exist'); - }); - cy.withinEditor('VisualEditor', () => { - cy.getByText('You have no todos.').should('exist'); + cy.getByDisplayValue('ShowToDos').should('exist'); }); }); }); diff --git a/Composer/cypress/integration/VisualDesigner.spec.js b/Composer/cypress/integration/VisualDesigner.spec.js index d77fafec8e..2aa9c78579 100644 --- a/Composer/cypress/integration/VisualDesigner.spec.js +++ b/Composer/cypress/integration/VisualDesigner.spec.js @@ -1,39 +1,28 @@ /// context('Visual Designer', () => { - beforeEach(() => { + before(() => { cy.visit(Cypress.env('COMPOSER_URL')); - cy.startFromTemplate('EmptyBot', 'VisualDesignerTest'); - }); - - //will remove skip after add trigger is ok - it('can add a rule from the visual designer', () => { - cy.addEventHandler('Handle a Dialog Event'); - cy.wait(100); - - cy.withinEditor('VisualEditor', () => { - cy.contains('Handle a Dialog Event').should('exist'); - }); - - cy.addEventHandler('Handle an Intent'); + cy.openBot('ToDoBot'); cy.wait(100); + }); - cy.withinEditor('VisualEditor', () => { - cy.contains('Handle an Intent').should('exist'); + beforeEach(() => { + // Return to Main.dialog + cy.get('[data-testid="ProjectTree"]').within(() => { + cy.getByText('ToDoBot.Main').click(); + cy.wait(100); }); + }); - cy.addEventHandler('Handle Unknown Intent'); - cy.wait(100); - - cy.withinEditor('VisualEditor', () => { - cy.contains('Handle Unknown Intent').should('exist'); + it('can find Visual Designer default trigger in container', () => { + cy.get('[data-testid="ProjectTree"]').within(() => { + cy.getByText('Handle ConversationUpdate').click(); + cy.wait(500); }); - cy.addEventHandler('Handle ConversationUpdate'); - cy.wait(100); - cy.withinEditor('VisualEditor', () => { - cy.contains('Handle ConversationUpdate').should('exist'); + cy.getByText('Trigger').should('exist'); }); }); }); diff --git a/Composer/cypress/support/commands.js b/Composer/cypress/support/commands.js index e351efa57c..0318a076c6 100644 --- a/Composer/cypress/support/commands.js +++ b/Composer/cypress/support/commands.js @@ -26,12 +26,13 @@ import 'cypress-testing-library/add-commands'; Cypress.Commands.add('openBot', botName => { cy.get('[data-testid="LeftNav-CommandBarButtonHome"]').click(); - cy.getByText('Open').click(); + cy.get('[data-testid="homePage-ToolBar-Open"]').within(() => { + cy.getByText('Open').click(); + }); cy.get('[data-testid="SelectLocation"]').within(() => { cy.get(`[aria-label="${botName}"]`).click({ force: true }); cy.wait(500); }); - cy.getByTestId('SelectLocationOpen').click({ force: true }); cy.wait(500); }); @@ -67,9 +68,14 @@ Cypress.Commands.add('copyBot', (bot, name) => { }); Cypress.Commands.add('addEventHandler', handler => { - cy.getByTestId('AddNewTrigger').click(); + cy.get('[data-testid="ProjectTree"]').within(() => { + cy.getByText(/New Trigger ../).click(); + }); cy.get(`[data-testid="triggerTypeDropDown"]`).click(); cy.getByText(handler).click(); - cy.get('input[data-testid="triggerName"]').type(`__TestTrigger`); + if (handler === 'Handle a Dialog Event') { + cy.get(`[data-testid="eventTypeDropDown"]`).click(); + cy.getByText('consultDialog').click(); + } cy.get(`[data-testid="triggerFormSubmit"]`).click(); }); diff --git a/Composer/jest.config.js b/Composer/jest.config.js index bda1afee23..22c7c202fd 100644 --- a/Composer/jest.config.js +++ b/Composer/jest.config.js @@ -40,9 +40,8 @@ module.exports = { '/packages/server', '/packages/extensions/obiformeditor', '/packages/extensions/visual-designer', - '/packages/extensions/sample-json-editor', '/packages/lib/code-editor', '/packages/lib/component-scaffold', - '/packages/lib/shared-menus', + '/packages/lib/shared', ], }; diff --git a/Composer/package.json b/Composer/package.json index fbcbc80db9..fd49d3bd4e 100644 --- a/Composer/package.json +++ b/Composer/package.json @@ -13,16 +13,18 @@ "packages/lib/*" ], "scripts": { - "build": "yarn build:dev && yarn build:server && yarn build:client", + "build": "yarn build:dev", + "build:prod": "yarn build:lib && yarn build:extensions && yarn build:server && yarn build:client", "build:dev": "yarn build:lib && yarn build:extensions", "build:lib": "cd packages/lib && yarn build:all", "build:extensions": "cd packages/extensions && yarn build:all", "build:server": "cd packages/server && yarn build", "build:client": "cd packages/client && yarn build", "start": "concurrently --kill-others-on-fail \"npm:start:*\"", + "startall": "concurrently --kill-others-on-fail \"npm:start:*\" \"npm:runtime\"", "start:client": "cd packages/client && yarn start", "start:server": "cd packages/server && yarn start", - "start:obieditor": "cd packages/extensions/obiformeditor && yarn start -- --no-clear", + "runtime": "cd ../BotProject/CSharp/ && dotnet build && dotnet run", "test": "yarn typecheck && jest", "test:coverage": "yarn test --coverage --no-cache --reporters=default --reporters=jest-junit", "test:integration": "start-server-and-test test:integration:start http://localhost:5000 test:integration:run", @@ -56,11 +58,25 @@ "@babel/preset-env": "7.3.0", "@babel/preset-react": "^7.0.0", "@babel/preset-typescript": "^7.3.3", + "@emotion/babel-preset-css-prop": "^10.0.17", + "@typescript-eslint/eslint-plugin": "2.4.0", + "@typescript-eslint/parser": "2.4.0", "babel-jest": "24.0.0", "concurrently": "^4.1.0", "cypress": "3.4.0", - "cypress-testing-library": "^3.0.1", "cypress-plugin-tab": "^1.0.1", + "cypress-testing-library": "^3.0.1", + "eslint": "^5.15.1", + "eslint-config-prettier": "^4.1.0", + "eslint-plugin-format-message": "^6.2.3", + "eslint-plugin-import": "^2.16.0", + "eslint-plugin-jsx-a11y": "6.1.2", + "eslint-plugin-notice": "^0.7.8", + "eslint-plugin-prettier": "^3.0.1", + "eslint-plugin-react": "7.12.4", + "eslint-plugin-react-hooks": "^1.6.0", + "eslint-plugin-security": "^1.4.0", + "eslint-plugin-typescript": "^0.14.0", "husky": "^1.3.1", "jest": "24.0.0", "jest-dom": "^3.1.3", @@ -73,6 +89,7 @@ "react-testing-library": "^6.0.2", "rimraf": "^2.6.3", "start-server-and-test": "^1.9.0", + "typescript": "3.6.4", "wsrun": "^3.6.4" } } diff --git a/Composer/packages/client/.eslintrc.js b/Composer/packages/client/.eslintrc.js index 8cc1ea5d78..5a86f04754 100644 --- a/Composer/packages/client/.eslintrc.js +++ b/Composer/packages/client/.eslintrc.js @@ -1,3 +1,7 @@ module.exports = { extends: '../../.eslintrc.react.js', + parserOptions: { + project: './tsconfig.json', + tsconfigRootDir: __dirname, + }, }; diff --git a/Composer/packages/client/__tests__/constants.json b/Composer/packages/client/__tests__/constants.json index 329e14379f..e52e23af4e 100644 --- a/Composer/packages/client/__tests__/constants.json +++ b/Composer/packages/client/__tests__/constants.json @@ -12,8 +12,7 @@ { "$type": "Microsoft.OnEvent", "$designer": { - "id": "335456", - "updatedAt": "2019-07-22T08:10:44.402Z" + "id": "335456" }, "steps": [] } @@ -41,8 +40,7 @@ { "$type": "Microsoft.OnEvent", "$designer": { - "id": "480162", - "updatedAt": "2019-07-22T08:10:50.068Z" + "id": "480162" }, "events": [ "beginDialog" @@ -245,4 +243,4 @@ } ] } -]} \ No newline at end of file +]} diff --git a/Composer/packages/client/babel.config.js b/Composer/packages/client/babel.config.js index ddb23fa70a..24a670dc81 100644 --- a/Composer/packages/client/babel.config.js +++ b/Composer/packages/client/babel.config.js @@ -23,6 +23,7 @@ module.exports = { }, ], '@babel/preset-react', + '@emotion/babel-preset-css-prop', ], plugins: ['@babel/plugin-proposal-class-properties', '@babel/plugin-transform-runtime'], }, diff --git a/Composer/packages/client/config/webpack.config.js b/Composer/packages/client/config/webpack.config.js index a3e4237ae9..d7e11d067e 100644 --- a/Composer/packages/client/config/webpack.config.js +++ b/Composer/packages/client/config/webpack.config.js @@ -29,9 +29,6 @@ const paths = require('./paths'); // Source maps are resource heavy and can cause out of memory issue for large source files. const shouldUseSourceMap = process.env.GENERATE_SOURCEMAP !== 'false'; -// Some apps do not need the benefits of saving a web request, so not inlining the chunk -// makes for a smoother build process. -const shouldInlineRuntimeChunk = process.env.INLINE_RUNTIME_CHUNK !== 'false'; // Check if TypeScript is setup const useTypeScript = fs.existsSync(paths.appTsConfig); @@ -284,6 +281,7 @@ module.exports = function(webpackEnv) { options: { formatter: require.resolve('react-dev-utils/eslintFormatter'), eslintPath: require.resolve('eslint'), + quiet: true, }, loader: require.resolve('eslint-loader'), }, @@ -413,7 +411,7 @@ module.exports = function(webpackEnv) { plugins: [ new MonacoWebpackPlugin({ // available options are documented at https://github.com/Microsoft/monaco-editor-webpack-plugin#options - languages: ['markdown', 'botbuilderlg'], + languages: ['markdown', 'botbuilderlg', 'json'], }), // Generates an `index.html` file with the + + <% } %> -