From 6e4516a8c5882b8665003faf1d82fd0a7c173870 Mon Sep 17 00:00:00 2001 From: Gabo Gilabert Date: Thu, 24 Sep 2020 14:48:38 -0400 Subject: [PATCH 1/2] Refactored and cleaned up ShowTypingMiddleware to better align with JS. Added virtual CreateTurnContext method to TestAdapter (that method is present in JS) to make it easier to manipulate the TrunContext in tests. Renamed and cleaned up ShowTypingMiddlewareTests. --- .../Adapters/TestAdapter.cs | 22 +- .../ShowTypingMiddleware.cs | 8 +- .../ShowTypingMiddlewareTests.cs | 159 ++ .../ShowTyping_MiddlewareTests.cs | 191 -- tests/tests.schema | 2366 ++++++++--------- 5 files changed, 1346 insertions(+), 1400 deletions(-) create mode 100644 tests/Microsoft.Bot.Builder.Tests/ShowTypingMiddlewareTests.cs delete mode 100644 tests/Microsoft.Bot.Builder.Tests/ShowTyping_MiddlewareTests.cs diff --git a/libraries/Microsoft.Bot.Builder/Adapters/TestAdapter.cs b/libraries/Microsoft.Bot.Builder/Adapters/TestAdapter.cs index 83fd247e31..6c952f3bfd 100644 --- a/libraries/Microsoft.Bot.Builder/Adapters/TestAdapter.cs +++ b/libraries/Microsoft.Bot.Builder/Adapters/TestAdapter.cs @@ -188,7 +188,7 @@ public async Task ProcessActivityAsync(Activity activity, BotCallbackHandler cal activity.LocalTimestamp = DateTimeOffset.Now; } - using (var context = new TurnContext(this, activity)) + using (var context = CreateTurnContext(activity)) { await RunPipelineAsync(context, callback, cancellationToken).ConfigureAwait(false); } @@ -373,7 +373,7 @@ public Task CreateConversationAsync(string channelId, BotCallbackHandler callbac var update = Activity.CreateConversationUpdateActivity(); update.ChannelId = channelId; update.Conversation = new ConversationAccount { Id = Guid.NewGuid().ToString("n") }; - using (var context = new TurnContext(this, (Activity)update)) + using (var context = CreateTurnContext((Activity)update)) { return callback(context, cancellationToken); } @@ -589,11 +589,9 @@ public virtual Task GetUserTokenAsync(ITurnContext turnContext, A Token = token, }); } - else - { - // not found - return Task.FromResult(null); - } + + // not found + return Task.FromResult(null); } /// Attempts to retrieve the token for a user that's in a login flow, using the bot's AppCredentials. @@ -883,6 +881,16 @@ public Task ExchangeTokenAsync(ITurnContext turnContext, AppCrede return Task.FromResult(null); } } + + /// + /// Creates the turn context for the adapter. + /// + /// An instance for the turn. + /// A instance to be used by the adapter. + protected virtual TurnContext CreateTurnContext(Activity activity) + { + return new TurnContext(this, activity); + } private void Enqueue(Activity activity) { diff --git a/libraries/Microsoft.Bot.Builder/ShowTypingMiddleware.cs b/libraries/Microsoft.Bot.Builder/ShowTypingMiddleware.cs index 81456e64c9..30187cd0b9 100644 --- a/libraries/Microsoft.Bot.Builder/ShowTypingMiddleware.cs +++ b/libraries/Microsoft.Bot.Builder/ShowTypingMiddleware.cs @@ -63,8 +63,8 @@ public async Task OnTurnAsync(ITurnContext turnContext, NextDelegate next, Cance Task typingTask = null; try { - // If the incoming activity is a MessageActivity, start a timer to periodically send the typing activity. - if (IsNotRunningAsSkill(turnContext) && turnContext.Activity.Type == ActivityTypes.Message) + // Start a timer to periodically send the typing activity (bots running as skills should not send typing activity) + if (!IsSkillBot(turnContext) && turnContext.Activity.Type == ActivityTypes.Message) { // do not await task - we want this to run in the background and we will cancel it when its done typingTask = SendTypingAsync(turnContext, _delay, _period, cts.Token); @@ -83,10 +83,10 @@ public async Task OnTurnAsync(ITurnContext turnContext, NextDelegate next, Cance } } - private static bool IsNotRunningAsSkill(ITurnContext turnContext) + private static bool IsSkillBot(ITurnContext turnContext) { return turnContext.TurnState.Get(BotAdapter.BotIdentityKey) is ClaimsIdentity claimIdentity - && SkillValidation.IsSkillClaim(claimIdentity.Claims) == false; + && SkillValidation.IsSkillClaim(claimIdentity.Claims); } private static async Task SendTypingAsync(ITurnContext turnContext, TimeSpan delay, TimeSpan period, CancellationToken cancellationToken) diff --git a/tests/Microsoft.Bot.Builder.Tests/ShowTypingMiddlewareTests.cs b/tests/Microsoft.Bot.Builder.Tests/ShowTypingMiddlewareTests.cs new file mode 100644 index 0000000000..385d0ba467 --- /dev/null +++ b/tests/Microsoft.Bot.Builder.Tests/ShowTypingMiddlewareTests.cs @@ -0,0 +1,159 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.Security.Claims; +using System.Threading.Tasks; +using Microsoft.Bot.Builder.Adapters; +using Microsoft.Bot.Connector.Authentication; +using Microsoft.Bot.Schema; +using Xunit; + +namespace Microsoft.Bot.Builder.Tests +{ + public class ShowTypingMiddlewareTests + { + [Fact] + public void ConstructorValidation() + { + Assert.Throws(() => new ShowTypingMiddleware(-100, 1000)); + Assert.Throws(() => new ShowTypingMiddleware(100, -1000)); + } + + [Fact] + public async Task OneSecondInterval() + { + var adapter = new TestAdapter(TestAdapter.CreateConversation("One_Second_Interval")) + .Use(new ShowTypingMiddleware(100, 1000)); + + await new TestFlow(adapter, async (context, cancellationToken) => + { + await Task.Delay(TimeSpan.FromMilliseconds(2800), cancellationToken); + + // note the ShowTypingMiddleware should not cause the Responded flag to be set + Assert.False(context.Responded); + + await context.SendActivityAsync("Message sent after delay", cancellationToken: cancellationToken); + await Task.CompletedTask; + }) + .Send("foo") + .AssertReply(ValidateTypingActivity, "check typing activity") + .AssertReply(ValidateTypingActivity, "check typing activity") + .AssertReply(ValidateTypingActivity, "check typing activity") + .AssertReply("Message sent after delay") + .StartTestAsync(); + } + + [Fact] + public async Task ContextCompletesBeforeTypingInterval() + { + var adapter = new TestAdapter(TestAdapter.CreateConversation("Context_Completes_Before_Typing_Interval")) + .Use(new ShowTypingMiddleware(100, 5000)); + + await new TestFlow(adapter, async (context, cancellationToken) => + { + await Task.Delay(TimeSpan.FromMilliseconds(2000), cancellationToken); + await context.SendActivityAsync("Message sent after delay", cancellationToken: cancellationToken); + await Task.CompletedTask; + }) + .Send("foo") + .AssertReply(ValidateTypingActivity, "check typing activity") + .AssertReply("Message sent after delay") + .StartTestAsync(); + } + + [Fact] + public async Task ImmediateResponseFiveSecondInterval() + { + var adapter = new TestAdapter(TestAdapter.CreateConversation("ImmediateResponse_5SecondInterval")) + .Use(new ShowTypingMiddleware(2000, 5000)); + + await new TestFlow(adapter, async (context, cancellationToken) => + { + await context.SendActivityAsync("Message sent after delay", cancellationToken: cancellationToken); + await Task.CompletedTask; + }) + .Send("foo") + .AssertReply("Message sent after delay") + .StartTestAsync(); + } + + [Fact] + public async Task ImmediateResponseWhenRunningAsSkill() + { + var adapter = new SkillTestAdapter(TestAdapter.CreateConversation("1_Second_Interval")) + .Use(new ShowTypingMiddleware(100, 1000)); + + await new TestFlow(adapter, async (context, cancellationToken) => + { + await Task.Delay(TimeSpan.FromMilliseconds(2800), cancellationToken); + + // note the ShowTypingMiddleware should not cause the Responded flag to be set + Assert.False(context.Responded); + + await context.SendActivityAsync("Message sent after delay", cancellationToken: cancellationToken); + await Task.CompletedTask; + }) + .Send("foo") + .AssertReply("Message sent after delay") + .StartTestAsync(); + } + + [Fact] + public void ZeroFrequency() + { + try + { + _ = new TestAdapter(TestAdapter.CreateConversation("ZeroFrequency")) + .Use(new ShowTypingMiddleware(-100, 0)); + } + catch (Exception ex) + { + Assert.IsType(ex); + } + } + + private void ValidateTypingActivity(IActivity obj) + { + var activity = obj.AsTypingActivity(); + if (activity != null) + { + return; + } + + throw new Exception("Activity was not of type TypingActivity"); + } + + /// + /// A helper TestAdapter that injects skill claims in the turn so we can test skill use cases. + /// + private class SkillTestAdapter : TestAdapter + { + // An App ID for a parent bot. + private static readonly string _parentBotId = Guid.NewGuid().ToString(); + + // An App ID for a skill bot. + private static readonly string _skillBotId = Guid.NewGuid().ToString(); + + public SkillTestAdapter(ConversationReference conversation = null) + : base(conversation) + { + } + + protected override TurnContext CreateTurnContext(Activity activity) + { + // Get the default turnContext from the base. + var turnContext = base.CreateTurnContext(activity); + + // Create a skill ClaimsIdentity and put it in TurnState so SkillValidation.IsSkillClaim() returns true. + var claimsIdentity = new ClaimsIdentity(); + claimsIdentity.AddClaim(new Claim(AuthenticationConstants.VersionClaim, "2.0")); + claimsIdentity.AddClaim(new Claim(AuthenticationConstants.AudienceClaim, _parentBotId)); + claimsIdentity.AddClaim(new Claim(AuthenticationConstants.AuthorizedParty, _skillBotId)); + turnContext.TurnState.Add(BotIdentityKey, claimsIdentity); + + return turnContext; + } + } + } +} diff --git a/tests/Microsoft.Bot.Builder.Tests/ShowTyping_MiddlewareTests.cs b/tests/Microsoft.Bot.Builder.Tests/ShowTyping_MiddlewareTests.cs deleted file mode 100644 index 7d3f404863..0000000000 --- a/tests/Microsoft.Bot.Builder.Tests/ShowTyping_MiddlewareTests.cs +++ /dev/null @@ -1,191 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -using System; -using System.Security.Claims; -using System.Threading; -using System.Threading.Tasks; -using Microsoft.Bot.Builder.Adapters; -using Microsoft.Bot.Connector.Authentication; -using Microsoft.Bot.Schema; -using Xunit; - -namespace Microsoft.Bot.Builder.Tests -{ - public class ShowTyping_MiddlewareTests - { - /// - /// Enum to handle different test cases. - /// - public enum FlowTestCase - { - /// - /// RunAsync is executing on a root bot with no skills (typical standalone bot). - /// - RootBot, - - /// - /// RunAsync is executing in a skill. - /// - Skill - } - - [Fact] - public async Task ShowTyping_TestMiddleware_1_Second_Interval() - { - TestAdapter adapter = new TestAdapter(TestAdapter.CreateConversation("ShowTyping_TestMiddleware_1_Second_Interval")) - .Use(new MockBotIdentityMiddleware(FlowTestCase.RootBot)) - .Use(new ShowTypingMiddleware(100, 1000)); - - await new TestFlow(adapter, async (context, cancellationToken) => - { - await Task.Delay(TimeSpan.FromMilliseconds(2800)); - - // note the ShowTypingMiddleware should not cause the Responded flag to be set - Assert.False(context.Responded); - - await context.SendActivityAsync("Message sent after delay"); - await Task.CompletedTask; - }) - .Send("foo") - .AssertReply(ValidateTypingActivity, "check typing activity") - .AssertReply(ValidateTypingActivity, "check typing activity") - .AssertReply(ValidateTypingActivity, "check typing activity") - .AssertReply("Message sent after delay") - .StartTestAsync(); - } - - [Fact] - public async Task ShowTyping_TestMiddleware_Context_Completes_Before_Typing_Interval() - { - TestAdapter adapter = new TestAdapter(TestAdapter.CreateConversation("ShowTyping_TestMiddleware_Context_Completes_Before_Typing_Interval")) - .Use(new MockBotIdentityMiddleware(FlowTestCase.RootBot)) - .Use(new ShowTypingMiddleware(100, 5000)); - - await new TestFlow(adapter, async (context, cancellationToken) => - { - await Task.Delay(TimeSpan.FromMilliseconds(2000)); - await context.SendActivityAsync("Message sent after delay"); - await Task.CompletedTask; - }) - .Send("foo") - .AssertReply(ValidateTypingActivity, "check typing activity") - .AssertReply("Message sent after delay") - .StartTestAsync(); - } - - [Fact] - public async Task ShowTyping_TestMiddleware_ImmediateResponse_5SecondInterval() - { - TestAdapter adapter = new TestAdapter(TestAdapter.CreateConversation("ShowTyping_TestMiddleware_ImmediateResponse_5SecondInterval")) - .Use(new MockBotIdentityMiddleware(FlowTestCase.RootBot)) - .Use(new ShowTypingMiddleware(2000, 5000)); - - await new TestFlow(adapter, async (context, cancellationToken) => - { - await context.SendActivityAsync("Message sent after delay"); - await Task.CompletedTask; - }) - .Send("foo") - .AssertReply("Message sent after delay") - .StartTestAsync(); - } - - [Fact] - public async Task ShowTyping_TestMiddleware_ImmediateResponse_When_Running_As_Skill() - { - TestAdapter adapter = new TestAdapter(TestAdapter.CreateConversation("ShowTyping_TestMiddleware_1_Second_Interval")) - .Use(new MockBotIdentityMiddleware(FlowTestCase.Skill)) - .Use(new ShowTypingMiddleware(100, 1000)); - - await new TestFlow(adapter, async (context, cancellationToken) => - { - await Task.Delay(TimeSpan.FromMilliseconds(2800)); - - // note the ShowTypingMiddleware should not cause the Responded flag to be set - Assert.False(context.Responded); - - await context.SendActivityAsync("Message sent after delay"); - await Task.CompletedTask; - }) - .Send("foo") - .AssertReply("Message sent after delay") - .StartTestAsync(); - } - - [Fact] - public void ShowTyping_TestMiddleware_NegativeDelay() - { - try - { - TestAdapter adapter = new TestAdapter(TestAdapter.CreateConversation("ShowTyping_TestMiddleware_NegativeDelay")) - .Use(new MockBotIdentityMiddleware(FlowTestCase.RootBot)) - .Use(new ShowTypingMiddleware(-100, 1000)); - } - catch (Exception ex) - { - Assert.IsType(ex); - } - } - - [Fact] - public void ShowTyping_TestMiddleware_ZeroFrequency() - { - try - { - TestAdapter adapter = new TestAdapter(TestAdapter.CreateConversation("ShowTyping_TestMiddleware_ZeroFrequency")) - .Use(new ShowTypingMiddleware(-100, 0)); - } - catch (Exception ex) - { - Assert.IsType(ex); - } - } - - private void ValidateTypingActivity(IActivity obj) - { - var activity = obj.AsTypingActivity(); - if (activity != null) - { - return; - } - else - { - throw new Exception("Activity was not of type TypingActivity"); - } - } - - private class MockBotIdentityMiddleware : IMiddleware - { - private readonly FlowTestCase _flowTestCase; - - // An App ID for a parent bot. - private readonly string _parentBotId = Guid.NewGuid().ToString(); - - // An App ID for a skill bot. - private readonly string _skillBotId = Guid.NewGuid().ToString(); - - public MockBotIdentityMiddleware(FlowTestCase flowTestCase) - { - _flowTestCase = flowTestCase; - } - - public async Task OnTurnAsync(ITurnContext turnContext, NextDelegate next, CancellationToken cancellationToken = default) - { - // Create a skill ClaimsIdentity and put it in TurnState so SkillValidation.IsSkillClaim() returns true. - var claimsIdentity = new ClaimsIdentity(); - claimsIdentity.AddClaim(new Claim(AuthenticationConstants.VersionClaim, "2.0")); - claimsIdentity.AddClaim(new Claim(AuthenticationConstants.AudienceClaim, _parentBotId)); - - if (_flowTestCase == FlowTestCase.Skill) - { - claimsIdentity.AddClaim(new Claim(AuthenticationConstants.AuthorizedParty, _skillBotId)); - } - - turnContext.TurnState.Add(BotAdapter.BotIdentityKey, claimsIdentity); - - await next(cancellationToken).ConfigureAwait(false); - } - } - } -} diff --git a/tests/tests.schema b/tests/tests.schema index 3df31c7b0c..26ec69843d 100644 --- a/tests/tests.schema +++ b/tests/tests.schema @@ -734,7 +734,239 @@ "description": "Schema to fill in.", "anyOf": [ { - "$ref": "#/definitions/schema" + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "Core schema meta-schema", + "definitions": { + "schemaArray": { + "type": "array", + "minItems": 1, + "items": { + "$ref": "#/definitions/Microsoft.AdaptiveDialog/properties/schema/anyOf/0" + } + }, + "nonNegativeInteger": { + "type": "integer", + "minimum": 0 + }, + "nonNegativeIntegerDefault0": { + "type": "integer", + "minimum": 0, + "default": 0 + }, + "simpleTypes": { + "enum": [ + "array", + "boolean", + "integer", + "null", + "number", + "object", + "string" + ] + }, + "stringArray": { + "type": "array", + "uniqueItems": true, + "default": [], + "items": { + "type": "string" + } + } + }, + "type": [ + "object", + "boolean" + ], + "properties": { + "$schema": { + "type": "string", + "format": "uri" + }, + "$ref": { + "type": "string", + "format": "uri-reference" + }, + "$comment": { + "type": "string" + }, + "title": { + "type": "string" + }, + "description": { + "type": "string" + }, + "default": true, + "readOnly": { + "type": "boolean", + "default": false + }, + "writeOnly": { + "type": "boolean", + "default": false + }, + "examples": { + "type": "array", + "items": true + }, + "multipleOf": { + "type": "number", + "exclusiveMinimum": 0 + }, + "maximum": { + "type": "number" + }, + "exclusiveMaximum": { + "type": "number" + }, + "minimum": { + "type": "number" + }, + "exclusiveMinimum": { + "type": "number" + }, + "maxLength": { + "$ref": "#/definitions/Microsoft.AdaptiveDialog/properties/schema/anyOf/0/definitions/nonNegativeInteger" + }, + "minLength": { + "$ref": "#/definitions/Microsoft.AdaptiveDialog/properties/schema/anyOf/0/definitions/nonNegativeIntegerDefault0" + }, + "pattern": { + "type": "string", + "format": "regex" + }, + "additionalItems": { + "$ref": "#/definitions/Microsoft.AdaptiveDialog/properties/schema/anyOf/0" + }, + "items": { + "anyOf": [ + { + "$ref": "#/definitions/Microsoft.AdaptiveDialog/properties/schema/anyOf/0" + }, + { + "$ref": "#/definitions/Microsoft.AdaptiveDialog/properties/schema/anyOf/0/definitions/schemaArray" + } + ], + "default": true + }, + "maxItems": { + "$ref": "#/definitions/Microsoft.AdaptiveDialog/properties/schema/anyOf/0/definitions/nonNegativeInteger" + }, + "minItems": { + "$ref": "#/definitions/Microsoft.AdaptiveDialog/properties/schema/anyOf/0/definitions/nonNegativeIntegerDefault0" + }, + "uniqueItems": { + "type": "boolean", + "default": false + }, + "contains": { + "$ref": "#/definitions/Microsoft.AdaptiveDialog/properties/schema/anyOf/0" + }, + "maxProperties": { + "$ref": "#/definitions/Microsoft.AdaptiveDialog/properties/schema/anyOf/0/definitions/nonNegativeInteger" + }, + "minProperties": { + "$ref": "#/definitions/Microsoft.AdaptiveDialog/properties/schema/anyOf/0/definitions/nonNegativeIntegerDefault0" + }, + "required": { + "$ref": "#/definitions/Microsoft.AdaptiveDialog/properties/schema/anyOf/0/definitions/stringArray" + }, + "additionalProperties": { + "$ref": "#/definitions/Microsoft.AdaptiveDialog/properties/schema/anyOf/0" + }, + "definitions": { + "type": "object", + "default": {}, + "additionalProperties": { + "$ref": "#/definitions/Microsoft.AdaptiveDialog/properties/schema/anyOf/0" + } + }, + "properties": { + "type": "object", + "default": {}, + "additionalProperties": { + "$ref": "#/definitions/Microsoft.AdaptiveDialog/properties/schema/anyOf/0" + } + }, + "patternProperties": { + "type": "object", + "propertyNames": { + "format": "regex" + }, + "default": {}, + "additionalProperties": { + "$ref": "#/definitions/Microsoft.AdaptiveDialog/properties/schema/anyOf/0" + } + }, + "dependencies": { + "type": "object", + "additionalProperties": { + "anyOf": [ + { + "$ref": "#/definitions/Microsoft.AdaptiveDialog/properties/schema/anyOf/0" + }, + { + "$ref": "#/definitions/Microsoft.AdaptiveDialog/properties/schema/anyOf/0/definitions/stringArray" + } + ] + } + }, + "propertyNames": { + "$ref": "#/definitions/Microsoft.AdaptiveDialog/properties/schema/anyOf/0" + }, + "const": true, + "enum": { + "type": "array", + "minItems": 1, + "uniqueItems": true, + "items": true + }, + "type": { + "anyOf": [ + { + "$ref": "#/definitions/Microsoft.AdaptiveDialog/properties/schema/anyOf/0/definitions/simpleTypes" + }, + { + "type": "array", + "items": { + "$ref": "#/definitions/Microsoft.AdaptiveDialog/properties/schema/anyOf/0/definitions/simpleTypes" + }, + "minItems": 1, + "uniqueItems": true + } + ] + }, + "format": { + "type": "string" + }, + "contentMediaType": { + "type": "string" + }, + "contentEncoding": { + "type": "string" + }, + "if": { + "$ref": "#/definitions/Microsoft.AdaptiveDialog/properties/schema/anyOf/0" + }, + "then": { + "$ref": "#/definitions/Microsoft.AdaptiveDialog/properties/schema/anyOf/0" + }, + "else": { + "$ref": "#/definitions/Microsoft.AdaptiveDialog/properties/schema/anyOf/0" + }, + "allOf": { + "$ref": "#/definitions/Microsoft.AdaptiveDialog/properties/schema/anyOf/0/definitions/schemaArray" + }, + "anyOf": { + "$ref": "#/definitions/Microsoft.AdaptiveDialog/properties/schema/anyOf/0/definitions/schemaArray" + }, + "oneOf": { + "$ref": "#/definitions/Microsoft.AdaptiveDialog/properties/schema/anyOf/0/definitions/schemaArray" + }, + "not": { + "$ref": "#/definitions/Microsoft.AdaptiveDialog/properties/schema/anyOf/0" + } + }, + "default": true }, { "type": "string", @@ -889,7 +1121,7 @@ "description": "'Property' will be set to the object or the result of this expression when max turn count is exceeded.", "oneOf": [ { - "$ref": "#/definitions/botframework.json/definitions/Attachment", + "$ref": "#/definitions/Microsoft.Ask/properties/activity/oneOf/1/properties/attachments/items", "title": "Object", "description": "Attachment object." }, @@ -904,7 +1136,7 @@ "description": "'Property' will be set to the object or the result of this expression unless it evaluates to null.", "oneOf": [ { - "$ref": "#/definitions/botframework.json/definitions/Attachment", + "$ref": "#/definitions/Microsoft.Ask/properties/activity/oneOf/1/properties/attachments/items", "title": "Object", "description": "Attachment object." }, @@ -1509,7 +1741,7 @@ "description": "Value to return when this choice is selected." }, "action": { - "$ref": "#/definitions/botframework.json/definitions/CardAction", + "$ref": "#/definitions/Microsoft.Ask/properties/activity/oneOf/1/properties/suggestedActions/properties/actions/items", "title": "Action", "description": "Card action for the choice." }, @@ -1961,7 +2193,7 @@ "description": "Value to return when this choice is selected." }, "action": { - "$ref": "#/definitions/botframework.json/definitions/CardAction", + "$ref": "#/definitions/Microsoft.Ask/properties/activity/oneOf/1/properties/suggestedActions/properties/actions/items", "title": "Action", "description": "Card action for the choice." }, @@ -3588,181 +3820,684 @@ "type": "string" }, { - "$ref": "#/definitions/botframework.json/definitions/Activity", "required": [ "type" - ] - }, - { - "$ref": "#/definitions/Microsoft.ActivityTemplate" - }, - { - "$ref": "#/definitions/Microsoft.StaticActivityTemplate" - } - ] - }, - "Microsoft.IDialog": { - "title": "Microsoft Dialogs", - "description": "Components which derive from Dialog", - "$role": "interface", - "oneOf": [ - { - "type": "string" - }, - { - "$ref": "#/definitions/Microsoft.QnAMakerDialog" - }, - { - "$ref": "#/definitions/AzureQueues.ContinueConversationLater" - }, - { - "$ref": "#/definitions/Microsoft.AdaptiveDialog" - }, - { - "$ref": "#/definitions/Microsoft.Test.AssertCondition" - }, - { - "$ref": "#/definitions/Microsoft.Ask" - }, - { - "$ref": "#/definitions/Microsoft.AttachmentInput" - }, - { - "$ref": "#/definitions/Microsoft.ChoiceInput" - }, - { - "$ref": "#/definitions/Microsoft.ConfirmInput" - }, - { - "$ref": "#/definitions/Microsoft.DateTimeInput" - }, - { - "$ref": "#/definitions/Microsoft.NumberInput" - }, - { - "$ref": "#/definitions/Microsoft.OAuthInput" - }, - { - "$ref": "#/definitions/Microsoft.TextInput" - }, - { - "$ref": "#/definitions/Microsoft.BeginDialog" - }, - { - "$ref": "#/definitions/Microsoft.BeginSkill" - }, - { - "$ref": "#/definitions/Microsoft.BreakLoop" - }, - { - "$ref": "#/definitions/Microsoft.CancelAllDialogs" - }, - { - "$ref": "#/definitions/Microsoft.CancelDialog" - }, - { - "$ref": "#/definitions/Microsoft.ContinueLoop" - }, - { - "$ref": "#/definitions/Microsoft.DebugBreak" - }, - { - "$ref": "#/definitions/Microsoft.DeleteActivity" - }, - { - "$ref": "#/definitions/Microsoft.DeleteProperties" - }, - { - "$ref": "#/definitions/Microsoft.DeleteProperty" - }, - { - "$ref": "#/definitions/Microsoft.EditActions" - }, - { - "$ref": "#/definitions/Microsoft.EditArray" - }, - { - "$ref": "#/definitions/Microsoft.EmitEvent" - }, - { - "$ref": "#/definitions/Microsoft.EndDialog" - }, - { - "$ref": "#/definitions/Microsoft.EndTurn" - }, - { - "$ref": "#/definitions/Microsoft.Foreach" - }, - { - "$ref": "#/definitions/Microsoft.ForeachPage" - }, - { - "$ref": "#/definitions/Microsoft.GetActivityMembers" - }, - { - "$ref": "#/definitions/Microsoft.GetConversationMembers" - }, - { - "$ref": "#/definitions/Microsoft.GotoAction" - }, - { - "$ref": "#/definitions/Microsoft.HttpRequest" - }, - { - "$ref": "#/definitions/Microsoft.IfCondition" - }, - { - "$ref": "#/definitions/Microsoft.LogAction" - }, - { - "$ref": "#/definitions/Microsoft.RepeatDialog" - }, - { - "$ref": "#/definitions/Microsoft.ReplaceDialog" - }, - { - "$ref": "#/definitions/Microsoft.SendActivity" - }, - { - "$ref": "#/definitions/Microsoft.SetProperties" - }, - { - "$ref": "#/definitions/Microsoft.SetProperty" - }, - { - "$ref": "#/definitions/Microsoft.SignOutUser" - }, - { - "$ref": "#/definitions/Microsoft.SwitchCondition" - }, - { - "$ref": "#/definitions/Microsoft.TelemetryTrackEvent" - }, - { - "$ref": "#/definitions/Microsoft.ThrowException" - }, - { - "$ref": "#/definitions/Microsoft.TraceActivity" - }, - { - "$ref": "#/definitions/Microsoft.UpdateActivity" - }, - { - "$ref": "#/definitions/Testbot.JavascriptAction" - }, - { - "$ref": "#/definitions/Testbot.Multiply" - }, - { - "$ref": "#/definitions/CustomAction.dialog" - }, - { - "$ref": "#/definitions/CustomAction2.dialog" - } - ] - }, - "Microsoft.IEntityRecognizer": { - "$role": "interface", + ], + "description": "An Activity is the basic communication type for the Bot Framework 3.0 protocol.", + "title": "Activity", + "type": "object", + "properties": { + "type": { + "description": "Contains the activity type. Possible values include: 'message', 'contactRelationUpdate',\n'conversationUpdate', 'typing', 'endOfConversation', 'event', 'invoke', 'deleteUserData',\n'messageUpdate', 'messageDelete', 'installationUpdate', 'messageReaction', 'suggestion',\n'trace', 'handoff'", + "type": "string", + "title": "type" + }, + "id": { + "description": "Contains an ID that uniquely identifies the activity on the channel.", + "type": "string", + "title": "id" + }, + "timestamp": { + "description": "Contains the date and time that the message was sent, in UTC, expressed in ISO-8601 format.", + "type": "string", + "format": "date-time", + "title": "timestamp" + }, + "localTimestamp": { + "description": "Contains the date and time that the message was sent, in local time, expressed in ISO-8601\nformat.\nFor example, 2016-09-23T13:07:49.4714686-07:00.", + "type": "string", + "format": "date-time", + "title": "localTimestamp" + }, + "localTimezone": { + "description": "Contains the name of the timezone in which the message, in local time, expressed in IANA Time\nZone database format.\nFor example, America/Los_Angeles.", + "type": "string", + "title": "localTimezone" + }, + "serviceUrl": { + "description": "Contains the URL that specifies the channel's service endpoint. Set by the channel.", + "type": "string", + "title": "serviceUrl" + }, + "channelId": { + "description": "Contains an ID that uniquely identifies the channel. Set by the channel.", + "type": "string", + "title": "channelId" + }, + "from": { + "$ref": "#/definitions/Microsoft.Ask/properties/activity/oneOf/1/properties/membersAdded/items", + "description": "Identifies the sender of the message.", + "title": "from" + }, + "conversation": { + "description": "Identifies the conversation to which the activity belongs.", + "title": "conversation", + "type": "object", + "required": [ + "conversationType", + "id", + "isGroup", + "name" + ], + "properties": { + "isGroup": { + "description": "Indicates whether the conversation contains more than two participants at the time the\nactivity was generated", + "type": "boolean", + "title": "isGroup" + }, + "conversationType": { + "description": "Indicates the type of the conversation in channels that distinguish between conversation types", + "type": "string", + "title": "conversationType" + }, + "id": { + "description": "Channel id for the user or bot on this channel (Example: joe@smith.com, or @joesmith or\n123456)", + "type": "string", + "title": "id" + }, + "name": { + "description": "Display friendly name", + "type": "string", + "title": "name" + }, + "aadObjectId": { + "description": "This account's object ID within Azure Active Directory (AAD)", + "type": "string", + "title": "aadObjectId" + }, + "role": { + "description": "Role of the entity behind the account (Example: User, Bot, etc.). Possible values include:\n'user', 'bot'", + "enum": [ + "bot", + "user" + ], + "type": "string", + "title": "role" + } + } + }, + "recipient": { + "$ref": "#/definitions/Microsoft.Ask/properties/activity/oneOf/1/properties/membersAdded/items", + "description": "Identifies the recipient of the message.", + "title": "recipient" + }, + "textFormat": { + "description": "Format of text fields Default:markdown. Possible values include: 'markdown', 'plain', 'xml'", + "type": "string", + "title": "textFormat" + }, + "attachmentLayout": { + "description": "The layout hint for multiple attachments. Default: list. Possible values include: 'list',\n'carousel'", + "type": "string", + "title": "attachmentLayout" + }, + "membersAdded": { + "description": "The collection of members added to the conversation.", + "type": "array", + "title": "membersAdded", + "items": { + "description": "Channel account information needed to route a message", + "title": "ChannelAccount", + "type": "object", + "required": [ + "id", + "name" + ], + "properties": { + "id": { + "description": "Channel id for the user or bot on this channel (Example: joe@smith.com, or @joesmith or\n123456)", + "type": "string", + "title": "id" + }, + "name": { + "description": "Display friendly name", + "type": "string", + "title": "name" + }, + "aadObjectId": { + "description": "This account's object ID within Azure Active Directory (AAD)", + "type": "string", + "title": "aadObjectId" + }, + "role": { + "description": "Role of the entity behind the account (Example: User, Bot, etc.). Possible values include:\n'user', 'bot'", + "type": "string", + "title": "role" + } + } + } + }, + "membersRemoved": { + "description": "The collection of members removed from the conversation.", + "type": "array", + "title": "membersRemoved", + "items": { + "$ref": "#/definitions/Microsoft.Ask/properties/activity/oneOf/1/properties/membersAdded/items" + } + }, + "reactionsAdded": { + "description": "The collection of reactions added to the conversation.", + "type": "array", + "title": "reactionsAdded", + "items": { + "description": "Message reaction object", + "title": "MessageReaction", + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "description": "Message reaction type. Possible values include: 'like', 'plusOne'", + "type": "string", + "title": "type" + } + } + } + }, + "reactionsRemoved": { + "description": "The collection of reactions removed from the conversation.", + "type": "array", + "title": "reactionsRemoved", + "items": { + "$ref": "#/definitions/Microsoft.Ask/properties/activity/oneOf/1/properties/reactionsAdded/items" + } + }, + "topicName": { + "description": "The updated topic name of the conversation.", + "type": "string", + "title": "topicName" + }, + "historyDisclosed": { + "description": "Indicates whether the prior history of the channel is disclosed.", + "type": "boolean", + "title": "historyDisclosed" + }, + "locale": { + "description": "A locale name for the contents of the text field.\nThe locale name is a combination of an ISO 639 two- or three-letter culture code associated\nwith a language\nand an ISO 3166 two-letter subculture code associated with a country or region.\nThe locale name can also correspond to a valid BCP-47 language tag.", + "type": "string", + "title": "locale" + }, + "text": { + "description": "The text content of the message.", + "type": "string", + "title": "text" + }, + "speak": { + "description": "The text to speak.", + "type": "string", + "title": "speak" + }, + "inputHint": { + "description": "Indicates whether your bot is accepting,\nexpecting, or ignoring user input after the message is delivered to the client. Possible\nvalues include: 'acceptingInput', 'ignoringInput', 'expectingInput'", + "type": "string", + "title": "inputHint" + }, + "summary": { + "description": "The text to display if the channel cannot render cards.", + "type": "string", + "title": "summary" + }, + "suggestedActions": { + "description": "The suggested actions for the activity.", + "title": "suggestedActions", + "type": "object", + "required": [ + "actions", + "to" + ], + "properties": { + "to": { + "description": "Ids of the recipients that the actions should be shown to. These Ids are relative to the\nchannelId and a subset of all recipients of the activity", + "type": "array", + "title": "to", + "items": { + "title": "Id", + "description": "Id of recipient.", + "type": "string" + } + }, + "actions": { + "description": "Actions that can be shown to the user", + "type": "array", + "title": "actions", + "items": { + "description": "A clickable action", + "title": "CardAction", + "type": "object", + "required": [ + "title", + "type", + "value" + ], + "properties": { + "type": { + "description": "The type of action implemented by this button. Possible values include: 'openUrl', 'imBack',\n'postBack', 'playAudio', 'playVideo', 'showImage', 'downloadFile', 'signin', 'call',\n'payment', 'messageBack'", + "type": "string", + "title": "type" + }, + "title": { + "description": "Text description which appears on the button", + "type": "string", + "title": "title" + }, + "image": { + "description": "Image URL which will appear on the button, next to text label", + "type": "string", + "title": "image" + }, + "text": { + "description": "Text for this action", + "type": "string", + "title": "text" + }, + "displayText": { + "description": "(Optional) text to display in the chat feed if the button is clicked", + "type": "string", + "title": "displayText" + }, + "value": { + "description": "Supplementary parameter for action. Content of this property depends on the ActionType", + "title": "value" + }, + "channelData": { + "description": "Channel-specific data associated with this action", + "title": "channelData" + } + } + } + } + } + }, + "attachments": { + "description": "Attachments", + "type": "array", + "title": "attachments", + "items": { + "description": "An attachment within an activity", + "title": "Attachment", + "type": "object", + "required": [ + "contentType" + ], + "properties": { + "contentType": { + "description": "mimetype/Contenttype for the file", + "type": "string", + "title": "contentType" + }, + "contentUrl": { + "description": "Content Url", + "type": "string", + "title": "contentUrl" + }, + "content": { + "type": "object", + "description": "Embedded content", + "title": "content" + }, + "name": { + "description": "(OPTIONAL) The name of the attachment", + "type": "string", + "title": "name" + }, + "thumbnailUrl": { + "description": "(OPTIONAL) Thumbnail associated with attachment", + "type": "string", + "title": "thumbnailUrl" + } + } + } + }, + "entities": { + "description": "Represents the entities that were mentioned in the message.", + "type": "array", + "title": "entities", + "items": { + "description": "Metadata object pertaining to an activity", + "title": "Entity", + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "description": "Type of this entity (RFC 3987 IRI)", + "type": "string", + "title": "type" + } + } + } + }, + "channelData": { + "description": "Contains channel-specific content.", + "title": "channelData" + }, + "action": { + "description": "Indicates whether the recipient of a contactRelationUpdate was added or removed from the\nsender's contact list.", + "type": "string", + "title": "action" + }, + "replyToId": { + "description": "Contains the ID of the message to which this message is a reply.", + "type": "string", + "title": "replyToId" + }, + "label": { + "description": "A descriptive label for the activity.", + "type": "string", + "title": "label" + }, + "valueType": { + "description": "The type of the activity's value object.", + "type": "string", + "title": "valueType" + }, + "value": { + "description": "A value that is associated with the activity.", + "title": "value" + }, + "name": { + "description": "The name of the operation associated with an invoke or event activity.", + "type": "string", + "title": "name" + }, + "relatesTo": { + "description": "A reference to another conversation or activity.", + "title": "relatesTo", + "type": "object", + "required": [ + "bot", + "channelId", + "conversation", + "serviceUrl" + ], + "properties": { + "activityId": { + "description": "(Optional) ID of the activity to refer to", + "type": "string", + "title": "activityId" + }, + "user": { + "description": "(Optional) User participating in this conversation", + "$ref": "#/definitions/Microsoft.Ask/properties/activity/oneOf/1/properties/membersAdded/items", + "title": "user" + }, + "bot": { + "$ref": "#/definitions/Microsoft.Ask/properties/activity/oneOf/1/properties/membersAdded/items", + "description": "Bot participating in this conversation", + "title": "bot" + }, + "conversation": { + "$ref": "#/definitions/Microsoft.Ask/properties/activity/oneOf/1/properties/conversation", + "description": "Conversation reference", + "title": "conversation" + }, + "channelId": { + "description": "Channel ID", + "type": "string", + "title": "channelId" + }, + "serviceUrl": { + "description": "Service endpoint where operations concerning the referenced conversation may be performed", + "type": "string", + "title": "serviceUrl" + } + } + }, + "code": { + "description": "The a code for endOfConversation activities that indicates why the conversation ended.\nPossible values include: 'unknown', 'completedSuccessfully', 'userCancelled', 'botTimedOut',\n'botIssuedInvalidMessage', 'channelFailed'", + "type": "string", + "title": "code" + }, + "expiration": { + "description": "The time at which the activity should be considered to be \"expired\" and should not be\npresented to the recipient.", + "type": "string", + "format": "date-time", + "title": "expiration" + }, + "importance": { + "description": "The importance of the activity. Possible values include: 'low', 'normal', 'high'", + "type": "string", + "title": "importance" + }, + "deliveryMode": { + "description": "A delivery hint to signal to the recipient alternate delivery paths for the activity.\nThe default delivery mode is \"default\". Possible values include: 'normal', 'notification'", + "type": "string", + "title": "deliveryMode" + }, + "listenFor": { + "description": "List of phrases and references that speech and language priming systems should listen for", + "type": "array", + "title": "listenFor", + "items": { + "type": "string", + "title": "Phrase", + "description": "Phrase to listen for." + } + }, + "textHighlights": { + "description": "The collection of text fragments to highlight when the activity contains a ReplyToId value.", + "type": "array", + "title": "textHighlights", + "items": { + "description": "Refers to a substring of content within another field", + "title": "TextHighlight", + "type": "object", + "required": [ + "occurrence", + "text" + ], + "properties": { + "text": { + "description": "Defines the snippet of text to highlight", + "type": "string", + "title": "text" + }, + "occurrence": { + "description": "Occurrence of the text field within the referenced text, if multiple exist.", + "type": "number", + "title": "occurrence" + } + } + } + }, + "semanticAction": { + "description": "An optional programmatic action accompanying this request", + "title": "semanticAction", + "type": "object", + "required": [ + "entities", + "id" + ], + "properties": { + "id": { + "description": "ID of this action", + "type": "string", + "title": "id" + }, + "entities": { + "description": "Entities associated with this action", + "type": "object", + "title": "entities", + "additionalProperties": { + "$ref": "#/definitions/Microsoft.Ask/properties/activity/oneOf/1/properties/entities/items" + } + } + } + } + } + }, + { + "$ref": "#/definitions/Microsoft.ActivityTemplate" + }, + { + "$ref": "#/definitions/Microsoft.StaticActivityTemplate" + } + ] + }, + "Microsoft.IDialog": { + "title": "Microsoft Dialogs", + "description": "Components which derive from Dialog", + "$role": "interface", + "oneOf": [ + { + "type": "string" + }, + { + "$ref": "#/definitions/Microsoft.QnAMakerDialog" + }, + { + "$ref": "#/definitions/AzureQueues.ContinueConversationLater" + }, + { + "$ref": "#/definitions/Microsoft.AdaptiveDialog" + }, + { + "$ref": "#/definitions/Microsoft.Test.AssertCondition" + }, + { + "$ref": "#/definitions/Microsoft.BeginDialog" + }, + { + "$ref": "#/definitions/Microsoft.BeginSkill" + }, + { + "$ref": "#/definitions/Microsoft.BreakLoop" + }, + { + "$ref": "#/definitions/Microsoft.CancelAllDialogs" + }, + { + "$ref": "#/definitions/Microsoft.CancelDialog" + }, + { + "$ref": "#/definitions/Microsoft.ContinueLoop" + }, + { + "$ref": "#/definitions/Microsoft.DebugBreak" + }, + { + "$ref": "#/definitions/Microsoft.DeleteActivity" + }, + { + "$ref": "#/definitions/Microsoft.DeleteProperties" + }, + { + "$ref": "#/definitions/Microsoft.DeleteProperty" + }, + { + "$ref": "#/definitions/Microsoft.EditActions" + }, + { + "$ref": "#/definitions/Microsoft.EditArray" + }, + { + "$ref": "#/definitions/Microsoft.EmitEvent" + }, + { + "$ref": "#/definitions/Microsoft.EndDialog" + }, + { + "$ref": "#/definitions/Microsoft.EndTurn" + }, + { + "$ref": "#/definitions/Microsoft.Foreach" + }, + { + "$ref": "#/definitions/Microsoft.ForeachPage" + }, + { + "$ref": "#/definitions/Microsoft.GetActivityMembers" + }, + { + "$ref": "#/definitions/Microsoft.GetConversationMembers" + }, + { + "$ref": "#/definitions/Microsoft.GotoAction" + }, + { + "$ref": "#/definitions/Microsoft.HttpRequest" + }, + { + "$ref": "#/definitions/Microsoft.IfCondition" + }, + { + "$ref": "#/definitions/Microsoft.LogAction" + }, + { + "$ref": "#/definitions/Microsoft.RepeatDialog" + }, + { + "$ref": "#/definitions/Microsoft.ReplaceDialog" + }, + { + "$ref": "#/definitions/Microsoft.SendActivity" + }, + { + "$ref": "#/definitions/Microsoft.SetProperties" + }, + { + "$ref": "#/definitions/Microsoft.SetProperty" + }, + { + "$ref": "#/definitions/Microsoft.SignOutUser" + }, + { + "$ref": "#/definitions/Microsoft.SwitchCondition" + }, + { + "$ref": "#/definitions/Microsoft.TelemetryTrackEvent" + }, + { + "$ref": "#/definitions/Microsoft.ThrowException" + }, + { + "$ref": "#/definitions/Microsoft.TraceActivity" + }, + { + "$ref": "#/definitions/Microsoft.UpdateActivity" + }, + { + "$ref": "#/definitions/Microsoft.Ask" + }, + { + "$ref": "#/definitions/Microsoft.AttachmentInput" + }, + { + "$ref": "#/definitions/Microsoft.ChoiceInput" + }, + { + "$ref": "#/definitions/Microsoft.ConfirmInput" + }, + { + "$ref": "#/definitions/Microsoft.DateTimeInput" + }, + { + "$ref": "#/definitions/Microsoft.NumberInput" + }, + { + "$ref": "#/definitions/Microsoft.OAuthInput" + }, + { + "$ref": "#/definitions/Microsoft.TextInput" + }, + { + "$ref": "#/definitions/Testbot.JavascriptAction" + }, + { + "$ref": "#/definitions/Testbot.Multiply" + }, + { + "$ref": "#/definitions/CustomAction.dialog" + }, + { + "$ref": "#/definitions/CustomAction2.dialog" + } + ] + }, + "Microsoft.IEntityRecognizer": { + "$role": "interface", "title": "Entity Recognizers", "description": "Components which derive from EntityRecognizer.", "type": "object", @@ -3853,10 +4588,10 @@ "type": "string" }, { - "$ref": "#/definitions/Microsoft.OrchestratorRecognizer" + "$ref": "#/definitions/Microsoft.LuisRecognizer" }, { - "$ref": "#/definitions/Microsoft.LuisRecognizer" + "$ref": "#/definitions/Microsoft.OrchestratorRecognizer" }, { "$ref": "#/definitions/Microsoft.QnAMakerRecognizer" @@ -7166,14 +7901,14 @@ } ] }, - "strictFiltersCompoundOperationType": { + "strictFiltersJoinOperator": { "$ref": "#/definitions/stringExpression", - "title": "strictFiltersCompoundOperationType", + "title": "StrictFiltersJoinOperator", "description": "Join operator for Strict Filters.", "oneOf": [ { - "title": "StrictFilters CompoundOperation Type", - "description": "Value of Join Operator to be used as Conjunction with Strict Filter Value.", + "title": "Join Operator", + "description": "Value of Join Operator to be used as conjunction with Strict Filter values.", "enum": [ "AND", "OR" @@ -7309,6 +8044,25 @@ } ] }, + "strictFiltersJoinOperator": { + "$ref": "#/definitions/stringExpression", + "title": "StrictFiltersJoinOperator", + "description": "Join operator for Strict Filters.", + "oneOf": [ + { + "title": "Join Operator", + "description": "Value of Join Operator to be used as onjuction with Strict Filter values.", + "enum": [ + "AND", + "OR" + ], + "default": "AND" + }, + { + "$ref": "#/definitions/equalsExpression" + } + ] + }, "includeDialogNameInMetadata": { "$ref": "#/definitions/booleanExpression", "title": "Include Dialog Name", @@ -8004,7 +8758,7 @@ }, "properties": { "activity": { - "$ref": "#/definitions/botframework.json/definitions/Activity", + "$ref": "#/definitions/Microsoft.IActivityTemplate/oneOf/1", "title": "Activity", "description": "A static Activity to used.", "required": [ @@ -11291,215 +12045,22 @@ "title": "Arg1", "description": "Value from callers memory to use as arg 1" }, - "arg2": { - "$ref": "#/definitions/numberExpression", - "title": "Arg2", - "description": "Value from callers memory to use as arg 2" - }, - "result": { - "$ref": "#/definitions/stringExpression", - "title": "Result", - "description": "Property to store the result in" - }, - "$kind": { - "title": "Kind of dialog object", - "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": "Testbot.Multiply" - }, - "$designer": { - "title": "Designer information", - "type": "object", - "description": "Extra information for the Bot Framework Composer." - } - } - }, - "arrayExpression": { - "$role": "expression", - "title": "Array or expression", - "description": "Array or expression to evaluate.", - "oneOf": [ - { - "type": "array", - "title": "Array", - "description": "Array constant." - }, - { - "$ref": "#/definitions/equalsExpression" - } - ] - }, - "booleanExpression": { - "$role": "expression", - "title": "Boolean or expression", - "description": "Boolean constant or expression to evaluate.", - "oneOf": [ - { - "type": "boolean", - "title": "Boolean", - "description": "Boolean constant.", - "default": false, - "examples": [ - false - ] - }, - { - "$ref": "#/definitions/equalsExpression", - "examples": [ - "=user.isVip" - ] - } - ] - }, - "component": { - "required": [ - "$kind" - ], - "additionalProperties": false, - "patternProperties": { - "^\\$": { - "title": "Tooling property", - "description": "Open ended property for tooling." - } - }, - "properties": { - "$kind": { - "title": "Kind of dialog object", - "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.]*$" - }, - "$designer": { - "title": "Designer information", - "type": "object", - "description": "Extra information for the Bot Framework Composer." - } - } - }, - "condition": { - "$role": "expression", - "title": "Boolean condition", - "description": "Boolean constant or expression to evaluate.", - "oneOf": [ - { - "$ref": "#/definitions/expression" - }, - { - "type": "boolean", - "title": "Boolean", - "description": "Boolean value.", - "default": true, - "examples": [ - false - ] - } - ] - }, - "equalsExpression": { - "$role": "expression", - "type": "string", - "title": "Expression", - "description": "Expression starting with =.", - "pattern": "^=.*\\S.*", - "examples": [ - "=user.name" - ] - }, - "expression": { - "$role": "expression", - "type": "string", - "title": "Expression", - "description": "Expression to evaluate.", - "pattern": "^.*\\S.*", - "examples": [ - "user.age > 13" - ] - }, - "integerExpression": { - "$role": "expression", - "title": "Integer or expression", - "description": "Integer constant or expression to evaluate.", - "oneOf": [ - { - "type": "integer", - "title": "Integer", - "description": "Integer constant.", - "default": 0, - "examples": [ - 15 - ] - }, - { - "$ref": "#/definitions/equalsExpression", - "examples": [ - "=user.age" - ] - } - ] - }, - "numberExpression": { - "$role": "expression", - "title": "Number or expression", - "description": "Number constant or expression to evaluate.", - "oneOf": [ - { - "type": "number", - "title": "Number", - "description": "Number constant.", - "default": 0, - "examples": [ - 15.5 - ] - }, - { - "$ref": "#/definitions/equalsExpression", - "examples": [ - "=dialog.quantity" - ] - } - ] - }, - "objectExpression": { - "$role": "expression", - "title": "Object or expression", - "description": "Object or expression to evaluate.", - "oneOf": [ - { - "type": "object", - "title": "Object", - "description": "Object constant." - }, - { - "$ref": "#/definitions/equalsExpression" - } - ] - }, - "role": { - "title": "$role", - "description": "Defines the role played in the dialog schema from [expression|interface|implements($kind)|extends($kind)].", - "type": "string", - "pattern": "^((expression)|(interface)|(implements\\([a-zA-Z][a-zA-Z0-9.]*\\))|(extends\\([a-zA-Z][a-zA-Z0-9.]*\\)))$" - }, - "root": { - "type": "object", - "required": [ - "$kind" - ], - "additionalProperties": false, - "patternProperties": { - "^\\$": { - "title": "Tooling property", - "description": "Open ended property for tooling." - } - }, - "properties": { + "arg2": { + "$ref": "#/definitions/numberExpression", + "title": "Arg2", + "description": "Value from callers memory to use as arg 2" + }, + "result": { + "$ref": "#/definitions/stringExpression", + "title": "Result", + "description": "Property to store the result in" + }, "$kind": { "title": "Kind of dialog object", "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": "root" + "const": "Testbot.Multiply" }, "$designer": { "title": "Designer information", @@ -11508,30 +12069,44 @@ } } }, - "stringExpression": { + "arrayExpression": { "$role": "expression", - "title": "String or expression", - "description": "Interpolated string or expression to evaluate.", + "title": "Array or expression", + "description": "Array or expression to evaluate.", "oneOf": [ { - "type": "string", - "title": "String", - "description": "Interpolated string", - "pattern": "^(?!(=)).*", + "type": "array", + "title": "Array", + "description": "Array constant." + }, + { + "$ref": "#/definitions/equalsExpression" + } + ] + }, + "booleanExpression": { + "$role": "expression", + "title": "Boolean or expression", + "description": "Boolean constant or expression to evaluate.", + "oneOf": [ + { + "type": "boolean", + "title": "Boolean", + "description": "Boolean constant.", + "default": false, "examples": [ - "Hello ${user.name}" + false ] }, { "$ref": "#/definitions/equalsExpression", "examples": [ - "=concat('x','y','z')" + "=user.isVip" ] } ] }, - "test": { - "type": "object", + "component": { "required": [ "$kind" ], @@ -11547,8 +12122,7 @@ "title": "Kind of dialog object", "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": "test" + "pattern": "^[a-zA-Z][a-zA-Z0-9.]*$" }, "$designer": { "title": "Designer information", @@ -11557,837 +12131,233 @@ } } }, - "valueExpression": { + "condition": { "$role": "expression", - "title": "Any or expression", - "description": "Any constant or expression to evaluate.", + "title": "Boolean condition", + "description": "Boolean constant or expression to evaluate.", "oneOf": [ { - "type": "object", - "title": "Object", - "description": "Object constant." - }, - { - "type": "array", - "title": "Array", - "description": "Array constant." - }, - { - "type": "string", - "title": "String", - "description": "Interpolated string.", - "pattern": "^(?!(=)).*", - "examples": [ - "Hello ${user.name}" - ] + "$ref": "#/definitions/expression" }, { "type": "boolean", "title": "Boolean", - "description": "Boolean constant", + "description": "Boolean value.", + "default": true, "examples": [ false ] - }, + } + ] + }, + "equalsExpression": { + "$role": "expression", + "type": "string", + "title": "Expression", + "description": "Expression starting with =.", + "pattern": "^=.*\\S.*", + "examples": [ + "=user.name" + ] + }, + "expression": { + "$role": "expression", + "type": "string", + "title": "Expression", + "description": "Expression to evaluate.", + "pattern": "^.*\\S.*", + "examples": [ + "user.age > 13" + ] + }, + "integerExpression": { + "$role": "expression", + "title": "Integer or expression", + "description": "Integer constant or expression to evaluate.", + "oneOf": [ { - "type": "number", - "title": "Number", - "description": "Number constant.", + "type": "integer", + "title": "Integer", + "description": "Integer constant.", + "default": 0, "examples": [ - 15.5 + 15 ] }, { "$ref": "#/definitions/equalsExpression", "examples": [ - "=..." + "=user.age" ] } ] }, - "schema": { - "$schema": "http://json-schema.org/draft-07/schema#", - "title": "Core schema meta-schema", - "definitions": { - "schemaArray": { - "type": "array", - "minItems": 1, - "items": { - "$ref": "#/definitions/schema" - } - }, - "nonNegativeInteger": { - "type": "integer", - "minimum": 0 - }, - "nonNegativeIntegerDefault0": { - "type": "integer", - "minimum": 0, - "default": 0 - }, - "simpleTypes": { - "enum": [ - "array", - "boolean", - "integer", - "null", - "number", - "object", - "string" - ] - }, - "stringArray": { - "type": "array", - "uniqueItems": true, - "default": [], - "items": { - "type": "string" - } - } - }, - "type": [ - "object", - "boolean" - ], - "default": true, - "properties": { - "$schema": { - "type": "string", - "format": "uri" - }, - "$ref": { - "type": "string", - "format": "uri-reference" - }, - "$comment": { - "type": "string" - }, - "title": { - "type": "string" - }, - "description": { - "type": "string" - }, - "default": true, - "readOnly": { - "type": "boolean", - "default": false - }, - "writeOnly": { - "type": "boolean", - "default": false - }, - "examples": { - "type": "array", - "items": true - }, - "multipleOf": { - "type": "number", - "exclusiveMinimum": 0 - }, - "maximum": { - "type": "number" - }, - "exclusiveMaximum": { - "type": "number" - }, - "minimum": { - "type": "number" - }, - "exclusiveMinimum": { - "type": "number" - }, - "maxLength": { - "$ref": "#/definitions/schema/definitions/nonNegativeInteger" - }, - "minLength": { - "$ref": "#/definitions/schema/definitions/nonNegativeIntegerDefault0" - }, - "pattern": { - "type": "string", - "format": "regex" - }, - "additionalItems": { - "$ref": "#/definitions/schema" - }, - "items": { - "anyOf": [ - { - "$ref": "#/definitions/schema" - }, - { - "$ref": "#/definitions/schema/definitions/schemaArray" - } - ], - "default": true - }, - "maxItems": { - "$ref": "#/definitions/schema/definitions/nonNegativeInteger" - }, - "minItems": { - "$ref": "#/definitions/schema/definitions/nonNegativeIntegerDefault0" - }, - "uniqueItems": { - "type": "boolean", - "default": false - }, - "contains": { - "$ref": "#/definitions/schema" - }, - "maxProperties": { - "$ref": "#/definitions/schema/definitions/nonNegativeInteger" - }, - "minProperties": { - "$ref": "#/definitions/schema/definitions/nonNegativeIntegerDefault0" - }, - "required": { - "$ref": "#/definitions/schema/definitions/stringArray" - }, - "additionalProperties": { - "$ref": "#/definitions/schema" - }, - "definitions": { - "type": "object", - "default": {}, - "additionalProperties": { - "$ref": "#/definitions/schema" - } - }, - "properties": { - "type": "object", - "default": {}, - "additionalProperties": { - "$ref": "#/definitions/schema" - } - }, - "patternProperties": { - "type": "object", - "propertyNames": { - "format": "regex" - }, - "default": {}, - "additionalProperties": { - "$ref": "#/definitions/schema" - } - }, - "dependencies": { - "type": "object", - "additionalProperties": { - "anyOf": [ - { - "$ref": "#/definitions/schema" - }, - { - "$ref": "#/definitions/schema/definitions/stringArray" - } - ] - } - }, - "propertyNames": { - "$ref": "#/definitions/schema" - }, - "const": true, - "enum": { - "type": "array", - "minItems": 1, - "uniqueItems": true, - "items": true - }, - "type": { - "anyOf": [ - { - "$ref": "#/definitions/schema/definitions/simpleTypes" - }, - { - "type": "array", - "items": { - "$ref": "#/definitions/schema/definitions/simpleTypes" - }, - "minItems": 1, - "uniqueItems": true - } - ] - }, - "format": { - "type": "string" - }, - "contentMediaType": { - "type": "string" - }, - "contentEncoding": { - "type": "string" - }, - "if": { - "$ref": "#/definitions/schema" - }, - "then": { - "$ref": "#/definitions/schema" - }, - "else": { - "$ref": "#/definitions/schema" - }, - "allOf": { - "$ref": "#/definitions/schema/definitions/schemaArray" - }, - "anyOf": { - "$ref": "#/definitions/schema/definitions/schemaArray" - }, - "oneOf": { - "$ref": "#/definitions/schema/definitions/schemaArray" - }, - "not": { - "$ref": "#/definitions/schema" - } - } - }, - "botframework.json": { - "$schema": "http://json-schema.org/draft-07/schema#", - "definitions": { - "ChannelAccount": { - "description": "Channel account information needed to route a message", - "title": "ChannelAccount", - "type": "object", - "required": [ - "id", - "name" - ], - "properties": { - "id": { - "description": "Channel id for the user or bot on this channel (Example: joe@smith.com, or @joesmith or\n123456)", - "type": "string", - "title": "id" - }, - "name": { - "description": "Display friendly name", - "type": "string", - "title": "name" - }, - "aadObjectId": { - "description": "This account's object ID within Azure Active Directory (AAD)", - "type": "string", - "title": "aadObjectId" - }, - "role": { - "description": "Role of the entity behind the account (Example: User, Bot, etc.). Possible values include:\n'user', 'bot'", - "type": "string", - "title": "role" - } - } + "numberExpression": { + "$role": "expression", + "title": "Number or expression", + "description": "Number constant or expression to evaluate.", + "oneOf": [ + { + "type": "number", + "title": "Number", + "description": "Number constant.", + "default": 0, + "examples": [ + 15.5 + ] }, - "ConversationAccount": { - "description": "Channel account information for a conversation", - "title": "ConversationAccount", + { + "$ref": "#/definitions/equalsExpression", + "examples": [ + "=dialog.quantity" + ] + } + ] + }, + "objectExpression": { + "$role": "expression", + "title": "Object or expression", + "description": "Object or expression to evaluate.", + "oneOf": [ + { "type": "object", - "required": [ - "conversationType", - "id", - "isGroup", - "name" - ], - "properties": { - "isGroup": { - "description": "Indicates whether the conversation contains more than two participants at the time the\nactivity was generated", - "type": "boolean", - "title": "isGroup" - }, - "conversationType": { - "description": "Indicates the type of the conversation in channels that distinguish between conversation types", - "type": "string", - "title": "conversationType" - }, - "id": { - "description": "Channel id for the user or bot on this channel (Example: joe@smith.com, or @joesmith or\n123456)", - "type": "string", - "title": "id" - }, - "name": { - "description": "Display friendly name", - "type": "string", - "title": "name" - }, - "aadObjectId": { - "description": "This account's object ID within Azure Active Directory (AAD)", - "type": "string", - "title": "aadObjectId" - }, - "role": { - "description": "Role of the entity behind the account (Example: User, Bot, etc.). Possible values include:\n'user', 'bot'", - "enum": [ - "bot", - "user" - ], - "type": "string", - "title": "role" - } - } + "title": "Object", + "description": "Object constant." }, - "MessageReaction": { - "description": "Message reaction object", - "title": "MessageReaction", - "type": "object", - "required": [ - "type" - ], - "properties": { - "type": { - "description": "Message reaction type. Possible values include: 'like', 'plusOne'", - "type": "string", - "title": "type" - } - } + { + "$ref": "#/definitions/equalsExpression" + } + ] + }, + "role": { + "title": "$role", + "description": "Defines the role played in the dialog schema from [expression|interface|implements($kind)|extends($kind)].", + "type": "string", + "pattern": "^((expression)|(interface)|(implements\\([a-zA-Z][a-zA-Z0-9.]*\\))|(extends\\([a-zA-Z][a-zA-Z0-9.]*\\)))$" + }, + "root": { + "type": "object", + "required": [ + "$kind" + ], + "additionalProperties": false, + "patternProperties": { + "^\\$": { + "title": "Tooling property", + "description": "Open ended property for tooling." + } + }, + "properties": { + "$kind": { + "title": "Kind of dialog object", + "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": "root" }, - "CardAction": { - "description": "A clickable action", - "title": "CardAction", + "$designer": { + "title": "Designer information", "type": "object", - "required": [ - "title", - "type", - "value" - ], - "properties": { - "type": { - "description": "The type of action implemented by this button. Possible values include: 'openUrl', 'imBack',\n'postBack', 'playAudio', 'playVideo', 'showImage', 'downloadFile', 'signin', 'call',\n'payment', 'messageBack'", - "type": "string", - "title": "type" - }, - "title": { - "description": "Text description which appears on the button", - "type": "string", - "title": "title" - }, - "image": { - "description": "Image URL which will appear on the button, next to text label", - "type": "string", - "title": "image" - }, - "text": { - "description": "Text for this action", - "type": "string", - "title": "text" - }, - "displayText": { - "description": "(Optional) text to display in the chat feed if the button is clicked", - "type": "string", - "title": "displayText" - }, - "value": { - "description": "Supplementary parameter for action. Content of this property depends on the ActionType", - "title": "value" - }, - "channelData": { - "description": "Channel-specific data associated with this action", - "title": "channelData" - } - } + "description": "Extra information for the Bot Framework Composer." + } + } + }, + "stringExpression": { + "$role": "expression", + "title": "String or expression", + "description": "Interpolated string or expression to evaluate.", + "oneOf": [ + { + "type": "string", + "title": "String", + "description": "Interpolated string", + "pattern": "^(?!(=)).*", + "examples": [ + "Hello ${user.name}" + ] }, - "SuggestedActions": { - "description": "SuggestedActions that can be performed", - "title": "SuggestedActions", - "type": "object", - "required": [ - "actions", - "to" - ], - "properties": { - "to": { - "description": "Ids of the recipients that the actions should be shown to. These Ids are relative to the\nchannelId and a subset of all recipients of the activity", - "type": "array", - "title": "to", - "items": { - "title": "Id", - "description": "Id of recipient.", - "type": "string" - } - }, - "actions": { - "description": "Actions that can be shown to the user", - "type": "array", - "title": "actions", - "items": { - "$ref": "#/definitions/botframework.json/definitions/CardAction" - } - } - } + { + "$ref": "#/definitions/equalsExpression", + "examples": [ + "=concat('x','y','z')" + ] + } + ] + }, + "test": { + "type": "object", + "required": [ + "$kind" + ], + "additionalProperties": false, + "patternProperties": { + "^\\$": { + "title": "Tooling property", + "description": "Open ended property for tooling." + } + }, + "properties": { + "$kind": { + "title": "Kind of dialog object", + "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": "test" }, - "Attachment": { - "description": "An attachment within an activity", - "title": "Attachment", + "$designer": { + "title": "Designer information", "type": "object", - "required": [ - "contentType" - ], - "properties": { - "contentType": { - "description": "mimetype/Contenttype for the file", - "type": "string", - "title": "contentType" - }, - "contentUrl": { - "description": "Content Url", - "type": "string", - "title": "contentUrl" - }, - "content": { - "type": "object", - "description": "Embedded content", - "title": "content" - }, - "name": { - "description": "(OPTIONAL) The name of the attachment", - "type": "string", - "title": "name" - }, - "thumbnailUrl": { - "description": "(OPTIONAL) Thumbnail associated with attachment", - "type": "string", - "title": "thumbnailUrl" - } - } - }, - "Entity": { - "description": "Metadata object pertaining to an activity", - "title": "Entity", + "description": "Extra information for the Bot Framework Composer." + } + } + }, + "valueExpression": { + "$role": "expression", + "title": "Any or expression", + "description": "Any constant or expression to evaluate.", + "oneOf": [ + { "type": "object", - "required": [ - "type" - ], - "properties": { - "type": { - "description": "Type of this entity (RFC 3987 IRI)", - "type": "string", - "title": "type" - } - } + "title": "Object", + "description": "Object constant." }, - "ConversationReference": { - "description": "An object relating to a particular point in a conversation", - "title": "ConversationReference", - "type": "object", - "required": [ - "bot", - "channelId", - "conversation", - "serviceUrl" - ], - "properties": { - "activityId": { - "description": "(Optional) ID of the activity to refer to", - "type": "string", - "title": "activityId" - }, - "user": { - "description": "(Optional) User participating in this conversation", - "$ref": "#/definitions/botframework.json/definitions/ChannelAccount", - "title": "user" - }, - "bot": { - "$ref": "#/definitions/botframework.json/definitions/ChannelAccount", - "description": "Bot participating in this conversation", - "title": "bot" - }, - "conversation": { - "$ref": "#/definitions/botframework.json/definitions/ConversationAccount", - "description": "Conversation reference", - "title": "conversation" - }, - "channelId": { - "description": "Channel ID", - "type": "string", - "title": "channelId" - }, - "serviceUrl": { - "description": "Service endpoint where operations concerning the referenced conversation may be performed", - "type": "string", - "title": "serviceUrl" - } - } + { + "type": "array", + "title": "Array", + "description": "Array constant." }, - "TextHighlight": { - "description": "Refers to a substring of content within another field", - "title": "TextHighlight", - "type": "object", - "required": [ - "occurrence", - "text" - ], - "properties": { - "text": { - "description": "Defines the snippet of text to highlight", - "type": "string", - "title": "text" - }, - "occurrence": { - "description": "Occurrence of the text field within the referenced text, if multiple exist.", - "type": "number", - "title": "occurrence" - } - } + { + "type": "string", + "title": "String", + "description": "Interpolated string.", + "pattern": "^(?!(=)).*", + "examples": [ + "Hello ${user.name}" + ] }, - "SemanticAction": { - "description": "Represents a reference to a programmatic action", - "title": "SemanticAction", - "type": "object", - "required": [ - "entities", - "id" - ], - "properties": { - "id": { - "description": "ID of this action", - "type": "string", - "title": "id" - }, - "entities": { - "description": "Entities associated with this action", - "type": "object", - "title": "entities", - "additionalProperties": { - "$ref": "#/definitions/botframework.json/definitions/Entity" - } - } - } + { + "type": "boolean", + "title": "Boolean", + "description": "Boolean constant", + "examples": [ + false + ] }, - "Activity": { - "description": "An Activity is the basic communication type for the Bot Framework 3.0 protocol.", - "title": "Activity", - "type": "object", - "properties": { - "type": { - "description": "Contains the activity type. Possible values include: 'message', 'contactRelationUpdate',\n'conversationUpdate', 'typing', 'endOfConversation', 'event', 'invoke', 'deleteUserData',\n'messageUpdate', 'messageDelete', 'installationUpdate', 'messageReaction', 'suggestion',\n'trace', 'handoff'", - "type": "string", - "title": "type" - }, - "id": { - "description": "Contains an ID that uniquely identifies the activity on the channel.", - "type": "string", - "title": "id" - }, - "timestamp": { - "description": "Contains the date and time that the message was sent, in UTC, expressed in ISO-8601 format.", - "type": "string", - "format": "date-time", - "title": "timestamp" - }, - "localTimestamp": { - "description": "Contains the date and time that the message was sent, in local time, expressed in ISO-8601\nformat.\nFor example, 2016-09-23T13:07:49.4714686-07:00.", - "type": "string", - "format": "date-time", - "title": "localTimestamp" - }, - "localTimezone": { - "description": "Contains the name of the timezone in which the message, in local time, expressed in IANA Time\nZone database format.\nFor example, America/Los_Angeles.", - "type": "string", - "title": "localTimezone" - }, - "serviceUrl": { - "description": "Contains the URL that specifies the channel's service endpoint. Set by the channel.", - "type": "string", - "title": "serviceUrl" - }, - "channelId": { - "description": "Contains an ID that uniquely identifies the channel. Set by the channel.", - "type": "string", - "title": "channelId" - }, - "from": { - "$ref": "#/definitions/botframework.json/definitions/ChannelAccount", - "description": "Identifies the sender of the message.", - "title": "from" - }, - "conversation": { - "$ref": "#/definitions/botframework.json/definitions/ConversationAccount", - "description": "Identifies the conversation to which the activity belongs.", - "title": "conversation" - }, - "recipient": { - "$ref": "#/definitions/botframework.json/definitions/ChannelAccount", - "description": "Identifies the recipient of the message.", - "title": "recipient" - }, - "textFormat": { - "description": "Format of text fields Default:markdown. Possible values include: 'markdown', 'plain', 'xml'", - "type": "string", - "title": "textFormat" - }, - "attachmentLayout": { - "description": "The layout hint for multiple attachments. Default: list. Possible values include: 'list',\n'carousel'", - "type": "string", - "title": "attachmentLayout" - }, - "membersAdded": { - "description": "The collection of members added to the conversation.", - "type": "array", - "title": "membersAdded", - "items": { - "$ref": "#/definitions/botframework.json/definitions/ChannelAccount" - } - }, - "membersRemoved": { - "description": "The collection of members removed from the conversation.", - "type": "array", - "title": "membersRemoved", - "items": { - "$ref": "#/definitions/botframework.json/definitions/ChannelAccount" - } - }, - "reactionsAdded": { - "description": "The collection of reactions added to the conversation.", - "type": "array", - "title": "reactionsAdded", - "items": { - "$ref": "#/definitions/botframework.json/definitions/MessageReaction" - } - }, - "reactionsRemoved": { - "description": "The collection of reactions removed from the conversation.", - "type": "array", - "title": "reactionsRemoved", - "items": { - "$ref": "#/definitions/botframework.json/definitions/MessageReaction" - } - }, - "topicName": { - "description": "The updated topic name of the conversation.", - "type": "string", - "title": "topicName" - }, - "historyDisclosed": { - "description": "Indicates whether the prior history of the channel is disclosed.", - "type": "boolean", - "title": "historyDisclosed" - }, - "locale": { - "description": "A locale name for the contents of the text field.\nThe locale name is a combination of an ISO 639 two- or three-letter culture code associated\nwith a language\nand an ISO 3166 two-letter subculture code associated with a country or region.\nThe locale name can also correspond to a valid BCP-47 language tag.", - "type": "string", - "title": "locale" - }, - "text": { - "description": "The text content of the message.", - "type": "string", - "title": "text" - }, - "speak": { - "description": "The text to speak.", - "type": "string", - "title": "speak" - }, - "inputHint": { - "description": "Indicates whether your bot is accepting,\nexpecting, or ignoring user input after the message is delivered to the client. Possible\nvalues include: 'acceptingInput', 'ignoringInput', 'expectingInput'", - "type": "string", - "title": "inputHint" - }, - "summary": { - "description": "The text to display if the channel cannot render cards.", - "type": "string", - "title": "summary" - }, - "suggestedActions": { - "description": "The suggested actions for the activity.", - "$ref": "#/definitions/botframework.json/definitions/SuggestedActions", - "title": "suggestedActions" - }, - "attachments": { - "description": "Attachments", - "type": "array", - "title": "attachments", - "items": { - "$ref": "#/definitions/botframework.json/definitions/Attachment" - } - }, - "entities": { - "description": "Represents the entities that were mentioned in the message.", - "type": "array", - "title": "entities", - "items": { - "$ref": "#/definitions/botframework.json/definitions/Entity" - } - }, - "channelData": { - "description": "Contains channel-specific content.", - "title": "channelData" - }, - "action": { - "description": "Indicates whether the recipient of a contactRelationUpdate was added or removed from the\nsender's contact list.", - "type": "string", - "title": "action" - }, - "replyToId": { - "description": "Contains the ID of the message to which this message is a reply.", - "type": "string", - "title": "replyToId" - }, - "label": { - "description": "A descriptive label for the activity.", - "type": "string", - "title": "label" - }, - "valueType": { - "description": "The type of the activity's value object.", - "type": "string", - "title": "valueType" - }, - "value": { - "description": "A value that is associated with the activity.", - "title": "value" - }, - "name": { - "description": "The name of the operation associated with an invoke or event activity.", - "type": "string", - "title": "name" - }, - "relatesTo": { - "description": "A reference to another conversation or activity.", - "$ref": "#/definitions/botframework.json/definitions/ConversationReference", - "title": "relatesTo" - }, - "code": { - "description": "The a code for endOfConversation activities that indicates why the conversation ended.\nPossible values include: 'unknown', 'completedSuccessfully', 'userCancelled', 'botTimedOut',\n'botIssuedInvalidMessage', 'channelFailed'", - "type": "string", - "title": "code" - }, - "expiration": { - "description": "The time at which the activity should be considered to be \"expired\" and should not be\npresented to the recipient.", - "type": "string", - "format": "date-time", - "title": "expiration" - }, - "importance": { - "description": "The importance of the activity. Possible values include: 'low', 'normal', 'high'", - "type": "string", - "title": "importance" - }, - "deliveryMode": { - "description": "A delivery hint to signal to the recipient alternate delivery paths for the activity.\nThe default delivery mode is \"default\". Possible values include: 'normal', 'notification'", - "type": "string", - "title": "deliveryMode" - }, - "listenFor": { - "description": "List of phrases and references that speech and language priming systems should listen for", - "type": "array", - "title": "listenFor", - "items": { - "type": "string", - "title": "Phrase", - "description": "Phrase to listen for." - } - }, - "textHighlights": { - "description": "The collection of text fragments to highlight when the activity contains a ReplyToId value.", - "type": "array", - "title": "textHighlights", - "items": { - "$ref": "#/definitions/botframework.json/definitions/TextHighlight" - } - }, - "semanticAction": { - "$ref": "#/definitions/botframework.json/definitions/SemanticAction", - "description": "An optional programmatic action accompanying this request", - "title": "semanticAction" - } - } + { + "type": "number", + "title": "Number", + "description": "Number constant.", + "examples": [ + 15.5 + ] + }, + { + "$ref": "#/definitions/equalsExpression", + "examples": [ + "=..." + ] } - } + ] } } } From 7551180b9a0886b88199a7b976d8da3151e51ff9 Mon Sep 17 00:00:00 2001 From: Gabo Gilabert Date: Thu, 24 Sep 2020 15:00:14 -0400 Subject: [PATCH 2/2] Reverted changes made automatically by some test code to test.schema --- tests/tests.schema | 1614 ++++++++++++++++++++++---------------------- 1 file changed, 822 insertions(+), 792 deletions(-) diff --git a/tests/tests.schema b/tests/tests.schema index 26ec69843d..3df31c7b0c 100644 --- a/tests/tests.schema +++ b/tests/tests.schema @@ -734,239 +734,7 @@ "description": "Schema to fill in.", "anyOf": [ { - "$schema": "http://json-schema.org/draft-07/schema#", - "title": "Core schema meta-schema", - "definitions": { - "schemaArray": { - "type": "array", - "minItems": 1, - "items": { - "$ref": "#/definitions/Microsoft.AdaptiveDialog/properties/schema/anyOf/0" - } - }, - "nonNegativeInteger": { - "type": "integer", - "minimum": 0 - }, - "nonNegativeIntegerDefault0": { - "type": "integer", - "minimum": 0, - "default": 0 - }, - "simpleTypes": { - "enum": [ - "array", - "boolean", - "integer", - "null", - "number", - "object", - "string" - ] - }, - "stringArray": { - "type": "array", - "uniqueItems": true, - "default": [], - "items": { - "type": "string" - } - } - }, - "type": [ - "object", - "boolean" - ], - "properties": { - "$schema": { - "type": "string", - "format": "uri" - }, - "$ref": { - "type": "string", - "format": "uri-reference" - }, - "$comment": { - "type": "string" - }, - "title": { - "type": "string" - }, - "description": { - "type": "string" - }, - "default": true, - "readOnly": { - "type": "boolean", - "default": false - }, - "writeOnly": { - "type": "boolean", - "default": false - }, - "examples": { - "type": "array", - "items": true - }, - "multipleOf": { - "type": "number", - "exclusiveMinimum": 0 - }, - "maximum": { - "type": "number" - }, - "exclusiveMaximum": { - "type": "number" - }, - "minimum": { - "type": "number" - }, - "exclusiveMinimum": { - "type": "number" - }, - "maxLength": { - "$ref": "#/definitions/Microsoft.AdaptiveDialog/properties/schema/anyOf/0/definitions/nonNegativeInteger" - }, - "minLength": { - "$ref": "#/definitions/Microsoft.AdaptiveDialog/properties/schema/anyOf/0/definitions/nonNegativeIntegerDefault0" - }, - "pattern": { - "type": "string", - "format": "regex" - }, - "additionalItems": { - "$ref": "#/definitions/Microsoft.AdaptiveDialog/properties/schema/anyOf/0" - }, - "items": { - "anyOf": [ - { - "$ref": "#/definitions/Microsoft.AdaptiveDialog/properties/schema/anyOf/0" - }, - { - "$ref": "#/definitions/Microsoft.AdaptiveDialog/properties/schema/anyOf/0/definitions/schemaArray" - } - ], - "default": true - }, - "maxItems": { - "$ref": "#/definitions/Microsoft.AdaptiveDialog/properties/schema/anyOf/0/definitions/nonNegativeInteger" - }, - "minItems": { - "$ref": "#/definitions/Microsoft.AdaptiveDialog/properties/schema/anyOf/0/definitions/nonNegativeIntegerDefault0" - }, - "uniqueItems": { - "type": "boolean", - "default": false - }, - "contains": { - "$ref": "#/definitions/Microsoft.AdaptiveDialog/properties/schema/anyOf/0" - }, - "maxProperties": { - "$ref": "#/definitions/Microsoft.AdaptiveDialog/properties/schema/anyOf/0/definitions/nonNegativeInteger" - }, - "minProperties": { - "$ref": "#/definitions/Microsoft.AdaptiveDialog/properties/schema/anyOf/0/definitions/nonNegativeIntegerDefault0" - }, - "required": { - "$ref": "#/definitions/Microsoft.AdaptiveDialog/properties/schema/anyOf/0/definitions/stringArray" - }, - "additionalProperties": { - "$ref": "#/definitions/Microsoft.AdaptiveDialog/properties/schema/anyOf/0" - }, - "definitions": { - "type": "object", - "default": {}, - "additionalProperties": { - "$ref": "#/definitions/Microsoft.AdaptiveDialog/properties/schema/anyOf/0" - } - }, - "properties": { - "type": "object", - "default": {}, - "additionalProperties": { - "$ref": "#/definitions/Microsoft.AdaptiveDialog/properties/schema/anyOf/0" - } - }, - "patternProperties": { - "type": "object", - "propertyNames": { - "format": "regex" - }, - "default": {}, - "additionalProperties": { - "$ref": "#/definitions/Microsoft.AdaptiveDialog/properties/schema/anyOf/0" - } - }, - "dependencies": { - "type": "object", - "additionalProperties": { - "anyOf": [ - { - "$ref": "#/definitions/Microsoft.AdaptiveDialog/properties/schema/anyOf/0" - }, - { - "$ref": "#/definitions/Microsoft.AdaptiveDialog/properties/schema/anyOf/0/definitions/stringArray" - } - ] - } - }, - "propertyNames": { - "$ref": "#/definitions/Microsoft.AdaptiveDialog/properties/schema/anyOf/0" - }, - "const": true, - "enum": { - "type": "array", - "minItems": 1, - "uniqueItems": true, - "items": true - }, - "type": { - "anyOf": [ - { - "$ref": "#/definitions/Microsoft.AdaptiveDialog/properties/schema/anyOf/0/definitions/simpleTypes" - }, - { - "type": "array", - "items": { - "$ref": "#/definitions/Microsoft.AdaptiveDialog/properties/schema/anyOf/0/definitions/simpleTypes" - }, - "minItems": 1, - "uniqueItems": true - } - ] - }, - "format": { - "type": "string" - }, - "contentMediaType": { - "type": "string" - }, - "contentEncoding": { - "type": "string" - }, - "if": { - "$ref": "#/definitions/Microsoft.AdaptiveDialog/properties/schema/anyOf/0" - }, - "then": { - "$ref": "#/definitions/Microsoft.AdaptiveDialog/properties/schema/anyOf/0" - }, - "else": { - "$ref": "#/definitions/Microsoft.AdaptiveDialog/properties/schema/anyOf/0" - }, - "allOf": { - "$ref": "#/definitions/Microsoft.AdaptiveDialog/properties/schema/anyOf/0/definitions/schemaArray" - }, - "anyOf": { - "$ref": "#/definitions/Microsoft.AdaptiveDialog/properties/schema/anyOf/0/definitions/schemaArray" - }, - "oneOf": { - "$ref": "#/definitions/Microsoft.AdaptiveDialog/properties/schema/anyOf/0/definitions/schemaArray" - }, - "not": { - "$ref": "#/definitions/Microsoft.AdaptiveDialog/properties/schema/anyOf/0" - } - }, - "default": true + "$ref": "#/definitions/schema" }, { "type": "string", @@ -1121,7 +889,7 @@ "description": "'Property' will be set to the object or the result of this expression when max turn count is exceeded.", "oneOf": [ { - "$ref": "#/definitions/Microsoft.Ask/properties/activity/oneOf/1/properties/attachments/items", + "$ref": "#/definitions/botframework.json/definitions/Attachment", "title": "Object", "description": "Attachment object." }, @@ -1136,7 +904,7 @@ "description": "'Property' will be set to the object or the result of this expression unless it evaluates to null.", "oneOf": [ { - "$ref": "#/definitions/Microsoft.Ask/properties/activity/oneOf/1/properties/attachments/items", + "$ref": "#/definitions/botframework.json/definitions/Attachment", "title": "Object", "description": "Attachment object." }, @@ -1741,7 +1509,7 @@ "description": "Value to return when this choice is selected." }, "action": { - "$ref": "#/definitions/Microsoft.Ask/properties/activity/oneOf/1/properties/suggestedActions/properties/actions/items", + "$ref": "#/definitions/botframework.json/definitions/CardAction", "title": "Action", "description": "Card action for the choice." }, @@ -2193,7 +1961,7 @@ "description": "Value to return when this choice is selected." }, "action": { - "$ref": "#/definitions/Microsoft.Ask/properties/activity/oneOf/1/properties/suggestedActions/properties/actions/items", + "$ref": "#/definitions/botframework.json/definitions/CardAction", "title": "Action", "description": "Card action for the choice." }, @@ -3820,513 +3588,10 @@ "type": "string" }, { + "$ref": "#/definitions/botframework.json/definitions/Activity", "required": [ "type" - ], - "description": "An Activity is the basic communication type for the Bot Framework 3.0 protocol.", - "title": "Activity", - "type": "object", - "properties": { - "type": { - "description": "Contains the activity type. Possible values include: 'message', 'contactRelationUpdate',\n'conversationUpdate', 'typing', 'endOfConversation', 'event', 'invoke', 'deleteUserData',\n'messageUpdate', 'messageDelete', 'installationUpdate', 'messageReaction', 'suggestion',\n'trace', 'handoff'", - "type": "string", - "title": "type" - }, - "id": { - "description": "Contains an ID that uniquely identifies the activity on the channel.", - "type": "string", - "title": "id" - }, - "timestamp": { - "description": "Contains the date and time that the message was sent, in UTC, expressed in ISO-8601 format.", - "type": "string", - "format": "date-time", - "title": "timestamp" - }, - "localTimestamp": { - "description": "Contains the date and time that the message was sent, in local time, expressed in ISO-8601\nformat.\nFor example, 2016-09-23T13:07:49.4714686-07:00.", - "type": "string", - "format": "date-time", - "title": "localTimestamp" - }, - "localTimezone": { - "description": "Contains the name of the timezone in which the message, in local time, expressed in IANA Time\nZone database format.\nFor example, America/Los_Angeles.", - "type": "string", - "title": "localTimezone" - }, - "serviceUrl": { - "description": "Contains the URL that specifies the channel's service endpoint. Set by the channel.", - "type": "string", - "title": "serviceUrl" - }, - "channelId": { - "description": "Contains an ID that uniquely identifies the channel. Set by the channel.", - "type": "string", - "title": "channelId" - }, - "from": { - "$ref": "#/definitions/Microsoft.Ask/properties/activity/oneOf/1/properties/membersAdded/items", - "description": "Identifies the sender of the message.", - "title": "from" - }, - "conversation": { - "description": "Identifies the conversation to which the activity belongs.", - "title": "conversation", - "type": "object", - "required": [ - "conversationType", - "id", - "isGroup", - "name" - ], - "properties": { - "isGroup": { - "description": "Indicates whether the conversation contains more than two participants at the time the\nactivity was generated", - "type": "boolean", - "title": "isGroup" - }, - "conversationType": { - "description": "Indicates the type of the conversation in channels that distinguish between conversation types", - "type": "string", - "title": "conversationType" - }, - "id": { - "description": "Channel id for the user or bot on this channel (Example: joe@smith.com, or @joesmith or\n123456)", - "type": "string", - "title": "id" - }, - "name": { - "description": "Display friendly name", - "type": "string", - "title": "name" - }, - "aadObjectId": { - "description": "This account's object ID within Azure Active Directory (AAD)", - "type": "string", - "title": "aadObjectId" - }, - "role": { - "description": "Role of the entity behind the account (Example: User, Bot, etc.). Possible values include:\n'user', 'bot'", - "enum": [ - "bot", - "user" - ], - "type": "string", - "title": "role" - } - } - }, - "recipient": { - "$ref": "#/definitions/Microsoft.Ask/properties/activity/oneOf/1/properties/membersAdded/items", - "description": "Identifies the recipient of the message.", - "title": "recipient" - }, - "textFormat": { - "description": "Format of text fields Default:markdown. Possible values include: 'markdown', 'plain', 'xml'", - "type": "string", - "title": "textFormat" - }, - "attachmentLayout": { - "description": "The layout hint for multiple attachments. Default: list. Possible values include: 'list',\n'carousel'", - "type": "string", - "title": "attachmentLayout" - }, - "membersAdded": { - "description": "The collection of members added to the conversation.", - "type": "array", - "title": "membersAdded", - "items": { - "description": "Channel account information needed to route a message", - "title": "ChannelAccount", - "type": "object", - "required": [ - "id", - "name" - ], - "properties": { - "id": { - "description": "Channel id for the user or bot on this channel (Example: joe@smith.com, or @joesmith or\n123456)", - "type": "string", - "title": "id" - }, - "name": { - "description": "Display friendly name", - "type": "string", - "title": "name" - }, - "aadObjectId": { - "description": "This account's object ID within Azure Active Directory (AAD)", - "type": "string", - "title": "aadObjectId" - }, - "role": { - "description": "Role of the entity behind the account (Example: User, Bot, etc.). Possible values include:\n'user', 'bot'", - "type": "string", - "title": "role" - } - } - } - }, - "membersRemoved": { - "description": "The collection of members removed from the conversation.", - "type": "array", - "title": "membersRemoved", - "items": { - "$ref": "#/definitions/Microsoft.Ask/properties/activity/oneOf/1/properties/membersAdded/items" - } - }, - "reactionsAdded": { - "description": "The collection of reactions added to the conversation.", - "type": "array", - "title": "reactionsAdded", - "items": { - "description": "Message reaction object", - "title": "MessageReaction", - "type": "object", - "required": [ - "type" - ], - "properties": { - "type": { - "description": "Message reaction type. Possible values include: 'like', 'plusOne'", - "type": "string", - "title": "type" - } - } - } - }, - "reactionsRemoved": { - "description": "The collection of reactions removed from the conversation.", - "type": "array", - "title": "reactionsRemoved", - "items": { - "$ref": "#/definitions/Microsoft.Ask/properties/activity/oneOf/1/properties/reactionsAdded/items" - } - }, - "topicName": { - "description": "The updated topic name of the conversation.", - "type": "string", - "title": "topicName" - }, - "historyDisclosed": { - "description": "Indicates whether the prior history of the channel is disclosed.", - "type": "boolean", - "title": "historyDisclosed" - }, - "locale": { - "description": "A locale name for the contents of the text field.\nThe locale name is a combination of an ISO 639 two- or three-letter culture code associated\nwith a language\nand an ISO 3166 two-letter subculture code associated with a country or region.\nThe locale name can also correspond to a valid BCP-47 language tag.", - "type": "string", - "title": "locale" - }, - "text": { - "description": "The text content of the message.", - "type": "string", - "title": "text" - }, - "speak": { - "description": "The text to speak.", - "type": "string", - "title": "speak" - }, - "inputHint": { - "description": "Indicates whether your bot is accepting,\nexpecting, or ignoring user input after the message is delivered to the client. Possible\nvalues include: 'acceptingInput', 'ignoringInput', 'expectingInput'", - "type": "string", - "title": "inputHint" - }, - "summary": { - "description": "The text to display if the channel cannot render cards.", - "type": "string", - "title": "summary" - }, - "suggestedActions": { - "description": "The suggested actions for the activity.", - "title": "suggestedActions", - "type": "object", - "required": [ - "actions", - "to" - ], - "properties": { - "to": { - "description": "Ids of the recipients that the actions should be shown to. These Ids are relative to the\nchannelId and a subset of all recipients of the activity", - "type": "array", - "title": "to", - "items": { - "title": "Id", - "description": "Id of recipient.", - "type": "string" - } - }, - "actions": { - "description": "Actions that can be shown to the user", - "type": "array", - "title": "actions", - "items": { - "description": "A clickable action", - "title": "CardAction", - "type": "object", - "required": [ - "title", - "type", - "value" - ], - "properties": { - "type": { - "description": "The type of action implemented by this button. Possible values include: 'openUrl', 'imBack',\n'postBack', 'playAudio', 'playVideo', 'showImage', 'downloadFile', 'signin', 'call',\n'payment', 'messageBack'", - "type": "string", - "title": "type" - }, - "title": { - "description": "Text description which appears on the button", - "type": "string", - "title": "title" - }, - "image": { - "description": "Image URL which will appear on the button, next to text label", - "type": "string", - "title": "image" - }, - "text": { - "description": "Text for this action", - "type": "string", - "title": "text" - }, - "displayText": { - "description": "(Optional) text to display in the chat feed if the button is clicked", - "type": "string", - "title": "displayText" - }, - "value": { - "description": "Supplementary parameter for action. Content of this property depends on the ActionType", - "title": "value" - }, - "channelData": { - "description": "Channel-specific data associated with this action", - "title": "channelData" - } - } - } - } - } - }, - "attachments": { - "description": "Attachments", - "type": "array", - "title": "attachments", - "items": { - "description": "An attachment within an activity", - "title": "Attachment", - "type": "object", - "required": [ - "contentType" - ], - "properties": { - "contentType": { - "description": "mimetype/Contenttype for the file", - "type": "string", - "title": "contentType" - }, - "contentUrl": { - "description": "Content Url", - "type": "string", - "title": "contentUrl" - }, - "content": { - "type": "object", - "description": "Embedded content", - "title": "content" - }, - "name": { - "description": "(OPTIONAL) The name of the attachment", - "type": "string", - "title": "name" - }, - "thumbnailUrl": { - "description": "(OPTIONAL) Thumbnail associated with attachment", - "type": "string", - "title": "thumbnailUrl" - } - } - } - }, - "entities": { - "description": "Represents the entities that were mentioned in the message.", - "type": "array", - "title": "entities", - "items": { - "description": "Metadata object pertaining to an activity", - "title": "Entity", - "type": "object", - "required": [ - "type" - ], - "properties": { - "type": { - "description": "Type of this entity (RFC 3987 IRI)", - "type": "string", - "title": "type" - } - } - } - }, - "channelData": { - "description": "Contains channel-specific content.", - "title": "channelData" - }, - "action": { - "description": "Indicates whether the recipient of a contactRelationUpdate was added or removed from the\nsender's contact list.", - "type": "string", - "title": "action" - }, - "replyToId": { - "description": "Contains the ID of the message to which this message is a reply.", - "type": "string", - "title": "replyToId" - }, - "label": { - "description": "A descriptive label for the activity.", - "type": "string", - "title": "label" - }, - "valueType": { - "description": "The type of the activity's value object.", - "type": "string", - "title": "valueType" - }, - "value": { - "description": "A value that is associated with the activity.", - "title": "value" - }, - "name": { - "description": "The name of the operation associated with an invoke or event activity.", - "type": "string", - "title": "name" - }, - "relatesTo": { - "description": "A reference to another conversation or activity.", - "title": "relatesTo", - "type": "object", - "required": [ - "bot", - "channelId", - "conversation", - "serviceUrl" - ], - "properties": { - "activityId": { - "description": "(Optional) ID of the activity to refer to", - "type": "string", - "title": "activityId" - }, - "user": { - "description": "(Optional) User participating in this conversation", - "$ref": "#/definitions/Microsoft.Ask/properties/activity/oneOf/1/properties/membersAdded/items", - "title": "user" - }, - "bot": { - "$ref": "#/definitions/Microsoft.Ask/properties/activity/oneOf/1/properties/membersAdded/items", - "description": "Bot participating in this conversation", - "title": "bot" - }, - "conversation": { - "$ref": "#/definitions/Microsoft.Ask/properties/activity/oneOf/1/properties/conversation", - "description": "Conversation reference", - "title": "conversation" - }, - "channelId": { - "description": "Channel ID", - "type": "string", - "title": "channelId" - }, - "serviceUrl": { - "description": "Service endpoint where operations concerning the referenced conversation may be performed", - "type": "string", - "title": "serviceUrl" - } - } - }, - "code": { - "description": "The a code for endOfConversation activities that indicates why the conversation ended.\nPossible values include: 'unknown', 'completedSuccessfully', 'userCancelled', 'botTimedOut',\n'botIssuedInvalidMessage', 'channelFailed'", - "type": "string", - "title": "code" - }, - "expiration": { - "description": "The time at which the activity should be considered to be \"expired\" and should not be\npresented to the recipient.", - "type": "string", - "format": "date-time", - "title": "expiration" - }, - "importance": { - "description": "The importance of the activity. Possible values include: 'low', 'normal', 'high'", - "type": "string", - "title": "importance" - }, - "deliveryMode": { - "description": "A delivery hint to signal to the recipient alternate delivery paths for the activity.\nThe default delivery mode is \"default\". Possible values include: 'normal', 'notification'", - "type": "string", - "title": "deliveryMode" - }, - "listenFor": { - "description": "List of phrases and references that speech and language priming systems should listen for", - "type": "array", - "title": "listenFor", - "items": { - "type": "string", - "title": "Phrase", - "description": "Phrase to listen for." - } - }, - "textHighlights": { - "description": "The collection of text fragments to highlight when the activity contains a ReplyToId value.", - "type": "array", - "title": "textHighlights", - "items": { - "description": "Refers to a substring of content within another field", - "title": "TextHighlight", - "type": "object", - "required": [ - "occurrence", - "text" - ], - "properties": { - "text": { - "description": "Defines the snippet of text to highlight", - "type": "string", - "title": "text" - }, - "occurrence": { - "description": "Occurrence of the text field within the referenced text, if multiple exist.", - "type": "number", - "title": "occurrence" - } - } - } - }, - "semanticAction": { - "description": "An optional programmatic action accompanying this request", - "title": "semanticAction", - "type": "object", - "required": [ - "entities", - "id" - ], - "properties": { - "id": { - "description": "ID of this action", - "type": "string", - "title": "id" - }, - "entities": { - "description": "Entities associated with this action", - "type": "object", - "title": "entities", - "additionalProperties": { - "$ref": "#/definitions/Microsoft.Ask/properties/activity/oneOf/1/properties/entities/items" - } - } - } - } - } + ] }, { "$ref": "#/definitions/Microsoft.ActivityTemplate" @@ -4356,6 +3621,30 @@ { "$ref": "#/definitions/Microsoft.Test.AssertCondition" }, + { + "$ref": "#/definitions/Microsoft.Ask" + }, + { + "$ref": "#/definitions/Microsoft.AttachmentInput" + }, + { + "$ref": "#/definitions/Microsoft.ChoiceInput" + }, + { + "$ref": "#/definitions/Microsoft.ConfirmInput" + }, + { + "$ref": "#/definitions/Microsoft.DateTimeInput" + }, + { + "$ref": "#/definitions/Microsoft.NumberInput" + }, + { + "$ref": "#/definitions/Microsoft.OAuthInput" + }, + { + "$ref": "#/definitions/Microsoft.TextInput" + }, { "$ref": "#/definitions/Microsoft.BeginDialog" }, @@ -4458,30 +3747,6 @@ { "$ref": "#/definitions/Microsoft.UpdateActivity" }, - { - "$ref": "#/definitions/Microsoft.Ask" - }, - { - "$ref": "#/definitions/Microsoft.AttachmentInput" - }, - { - "$ref": "#/definitions/Microsoft.ChoiceInput" - }, - { - "$ref": "#/definitions/Microsoft.ConfirmInput" - }, - { - "$ref": "#/definitions/Microsoft.DateTimeInput" - }, - { - "$ref": "#/definitions/Microsoft.NumberInput" - }, - { - "$ref": "#/definitions/Microsoft.OAuthInput" - }, - { - "$ref": "#/definitions/Microsoft.TextInput" - }, { "$ref": "#/definitions/Testbot.JavascriptAction" }, @@ -4588,10 +3853,10 @@ "type": "string" }, { - "$ref": "#/definitions/Microsoft.LuisRecognizer" + "$ref": "#/definitions/Microsoft.OrchestratorRecognizer" }, { - "$ref": "#/definitions/Microsoft.OrchestratorRecognizer" + "$ref": "#/definitions/Microsoft.LuisRecognizer" }, { "$ref": "#/definitions/Microsoft.QnAMakerRecognizer" @@ -7901,14 +7166,14 @@ } ] }, - "strictFiltersJoinOperator": { + "strictFiltersCompoundOperationType": { "$ref": "#/definitions/stringExpression", - "title": "StrictFiltersJoinOperator", + "title": "strictFiltersCompoundOperationType", "description": "Join operator for Strict Filters.", "oneOf": [ { - "title": "Join Operator", - "description": "Value of Join Operator to be used as conjunction with Strict Filter values.", + "title": "StrictFilters CompoundOperation Type", + "description": "Value of Join Operator to be used as Conjunction with Strict Filter Value.", "enum": [ "AND", "OR" @@ -8044,25 +7309,6 @@ } ] }, - "strictFiltersJoinOperator": { - "$ref": "#/definitions/stringExpression", - "title": "StrictFiltersJoinOperator", - "description": "Join operator for Strict Filters.", - "oneOf": [ - { - "title": "Join Operator", - "description": "Value of Join Operator to be used as onjuction with Strict Filter values.", - "enum": [ - "AND", - "OR" - ], - "default": "AND" - }, - { - "$ref": "#/definitions/equalsExpression" - } - ] - }, "includeDialogNameInMetadata": { "$ref": "#/definitions/booleanExpression", "title": "Include Dialog Name", @@ -8758,7 +8004,7 @@ }, "properties": { "activity": { - "$ref": "#/definitions/Microsoft.IActivityTemplate/oneOf/1", + "$ref": "#/definitions/botframework.json/definitions/Activity", "title": "Activity", "description": "A static Activity to used.", "required": [ @@ -12358,6 +11604,790 @@ ] } ] + }, + "schema": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "Core schema meta-schema", + "definitions": { + "schemaArray": { + "type": "array", + "minItems": 1, + "items": { + "$ref": "#/definitions/schema" + } + }, + "nonNegativeInteger": { + "type": "integer", + "minimum": 0 + }, + "nonNegativeIntegerDefault0": { + "type": "integer", + "minimum": 0, + "default": 0 + }, + "simpleTypes": { + "enum": [ + "array", + "boolean", + "integer", + "null", + "number", + "object", + "string" + ] + }, + "stringArray": { + "type": "array", + "uniqueItems": true, + "default": [], + "items": { + "type": "string" + } + } + }, + "type": [ + "object", + "boolean" + ], + "default": true, + "properties": { + "$schema": { + "type": "string", + "format": "uri" + }, + "$ref": { + "type": "string", + "format": "uri-reference" + }, + "$comment": { + "type": "string" + }, + "title": { + "type": "string" + }, + "description": { + "type": "string" + }, + "default": true, + "readOnly": { + "type": "boolean", + "default": false + }, + "writeOnly": { + "type": "boolean", + "default": false + }, + "examples": { + "type": "array", + "items": true + }, + "multipleOf": { + "type": "number", + "exclusiveMinimum": 0 + }, + "maximum": { + "type": "number" + }, + "exclusiveMaximum": { + "type": "number" + }, + "minimum": { + "type": "number" + }, + "exclusiveMinimum": { + "type": "number" + }, + "maxLength": { + "$ref": "#/definitions/schema/definitions/nonNegativeInteger" + }, + "minLength": { + "$ref": "#/definitions/schema/definitions/nonNegativeIntegerDefault0" + }, + "pattern": { + "type": "string", + "format": "regex" + }, + "additionalItems": { + "$ref": "#/definitions/schema" + }, + "items": { + "anyOf": [ + { + "$ref": "#/definitions/schema" + }, + { + "$ref": "#/definitions/schema/definitions/schemaArray" + } + ], + "default": true + }, + "maxItems": { + "$ref": "#/definitions/schema/definitions/nonNegativeInteger" + }, + "minItems": { + "$ref": "#/definitions/schema/definitions/nonNegativeIntegerDefault0" + }, + "uniqueItems": { + "type": "boolean", + "default": false + }, + "contains": { + "$ref": "#/definitions/schema" + }, + "maxProperties": { + "$ref": "#/definitions/schema/definitions/nonNegativeInteger" + }, + "minProperties": { + "$ref": "#/definitions/schema/definitions/nonNegativeIntegerDefault0" + }, + "required": { + "$ref": "#/definitions/schema/definitions/stringArray" + }, + "additionalProperties": { + "$ref": "#/definitions/schema" + }, + "definitions": { + "type": "object", + "default": {}, + "additionalProperties": { + "$ref": "#/definitions/schema" + } + }, + "properties": { + "type": "object", + "default": {}, + "additionalProperties": { + "$ref": "#/definitions/schema" + } + }, + "patternProperties": { + "type": "object", + "propertyNames": { + "format": "regex" + }, + "default": {}, + "additionalProperties": { + "$ref": "#/definitions/schema" + } + }, + "dependencies": { + "type": "object", + "additionalProperties": { + "anyOf": [ + { + "$ref": "#/definitions/schema" + }, + { + "$ref": "#/definitions/schema/definitions/stringArray" + } + ] + } + }, + "propertyNames": { + "$ref": "#/definitions/schema" + }, + "const": true, + "enum": { + "type": "array", + "minItems": 1, + "uniqueItems": true, + "items": true + }, + "type": { + "anyOf": [ + { + "$ref": "#/definitions/schema/definitions/simpleTypes" + }, + { + "type": "array", + "items": { + "$ref": "#/definitions/schema/definitions/simpleTypes" + }, + "minItems": 1, + "uniqueItems": true + } + ] + }, + "format": { + "type": "string" + }, + "contentMediaType": { + "type": "string" + }, + "contentEncoding": { + "type": "string" + }, + "if": { + "$ref": "#/definitions/schema" + }, + "then": { + "$ref": "#/definitions/schema" + }, + "else": { + "$ref": "#/definitions/schema" + }, + "allOf": { + "$ref": "#/definitions/schema/definitions/schemaArray" + }, + "anyOf": { + "$ref": "#/definitions/schema/definitions/schemaArray" + }, + "oneOf": { + "$ref": "#/definitions/schema/definitions/schemaArray" + }, + "not": { + "$ref": "#/definitions/schema" + } + } + }, + "botframework.json": { + "$schema": "http://json-schema.org/draft-07/schema#", + "definitions": { + "ChannelAccount": { + "description": "Channel account information needed to route a message", + "title": "ChannelAccount", + "type": "object", + "required": [ + "id", + "name" + ], + "properties": { + "id": { + "description": "Channel id for the user or bot on this channel (Example: joe@smith.com, or @joesmith or\n123456)", + "type": "string", + "title": "id" + }, + "name": { + "description": "Display friendly name", + "type": "string", + "title": "name" + }, + "aadObjectId": { + "description": "This account's object ID within Azure Active Directory (AAD)", + "type": "string", + "title": "aadObjectId" + }, + "role": { + "description": "Role of the entity behind the account (Example: User, Bot, etc.). Possible values include:\n'user', 'bot'", + "type": "string", + "title": "role" + } + } + }, + "ConversationAccount": { + "description": "Channel account information for a conversation", + "title": "ConversationAccount", + "type": "object", + "required": [ + "conversationType", + "id", + "isGroup", + "name" + ], + "properties": { + "isGroup": { + "description": "Indicates whether the conversation contains more than two participants at the time the\nactivity was generated", + "type": "boolean", + "title": "isGroup" + }, + "conversationType": { + "description": "Indicates the type of the conversation in channels that distinguish between conversation types", + "type": "string", + "title": "conversationType" + }, + "id": { + "description": "Channel id for the user or bot on this channel (Example: joe@smith.com, or @joesmith or\n123456)", + "type": "string", + "title": "id" + }, + "name": { + "description": "Display friendly name", + "type": "string", + "title": "name" + }, + "aadObjectId": { + "description": "This account's object ID within Azure Active Directory (AAD)", + "type": "string", + "title": "aadObjectId" + }, + "role": { + "description": "Role of the entity behind the account (Example: User, Bot, etc.). Possible values include:\n'user', 'bot'", + "enum": [ + "bot", + "user" + ], + "type": "string", + "title": "role" + } + } + }, + "MessageReaction": { + "description": "Message reaction object", + "title": "MessageReaction", + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "description": "Message reaction type. Possible values include: 'like', 'plusOne'", + "type": "string", + "title": "type" + } + } + }, + "CardAction": { + "description": "A clickable action", + "title": "CardAction", + "type": "object", + "required": [ + "title", + "type", + "value" + ], + "properties": { + "type": { + "description": "The type of action implemented by this button. Possible values include: 'openUrl', 'imBack',\n'postBack', 'playAudio', 'playVideo', 'showImage', 'downloadFile', 'signin', 'call',\n'payment', 'messageBack'", + "type": "string", + "title": "type" + }, + "title": { + "description": "Text description which appears on the button", + "type": "string", + "title": "title" + }, + "image": { + "description": "Image URL which will appear on the button, next to text label", + "type": "string", + "title": "image" + }, + "text": { + "description": "Text for this action", + "type": "string", + "title": "text" + }, + "displayText": { + "description": "(Optional) text to display in the chat feed if the button is clicked", + "type": "string", + "title": "displayText" + }, + "value": { + "description": "Supplementary parameter for action. Content of this property depends on the ActionType", + "title": "value" + }, + "channelData": { + "description": "Channel-specific data associated with this action", + "title": "channelData" + } + } + }, + "SuggestedActions": { + "description": "SuggestedActions that can be performed", + "title": "SuggestedActions", + "type": "object", + "required": [ + "actions", + "to" + ], + "properties": { + "to": { + "description": "Ids of the recipients that the actions should be shown to. These Ids are relative to the\nchannelId and a subset of all recipients of the activity", + "type": "array", + "title": "to", + "items": { + "title": "Id", + "description": "Id of recipient.", + "type": "string" + } + }, + "actions": { + "description": "Actions that can be shown to the user", + "type": "array", + "title": "actions", + "items": { + "$ref": "#/definitions/botframework.json/definitions/CardAction" + } + } + } + }, + "Attachment": { + "description": "An attachment within an activity", + "title": "Attachment", + "type": "object", + "required": [ + "contentType" + ], + "properties": { + "contentType": { + "description": "mimetype/Contenttype for the file", + "type": "string", + "title": "contentType" + }, + "contentUrl": { + "description": "Content Url", + "type": "string", + "title": "contentUrl" + }, + "content": { + "type": "object", + "description": "Embedded content", + "title": "content" + }, + "name": { + "description": "(OPTIONAL) The name of the attachment", + "type": "string", + "title": "name" + }, + "thumbnailUrl": { + "description": "(OPTIONAL) Thumbnail associated with attachment", + "type": "string", + "title": "thumbnailUrl" + } + } + }, + "Entity": { + "description": "Metadata object pertaining to an activity", + "title": "Entity", + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "description": "Type of this entity (RFC 3987 IRI)", + "type": "string", + "title": "type" + } + } + }, + "ConversationReference": { + "description": "An object relating to a particular point in a conversation", + "title": "ConversationReference", + "type": "object", + "required": [ + "bot", + "channelId", + "conversation", + "serviceUrl" + ], + "properties": { + "activityId": { + "description": "(Optional) ID of the activity to refer to", + "type": "string", + "title": "activityId" + }, + "user": { + "description": "(Optional) User participating in this conversation", + "$ref": "#/definitions/botframework.json/definitions/ChannelAccount", + "title": "user" + }, + "bot": { + "$ref": "#/definitions/botframework.json/definitions/ChannelAccount", + "description": "Bot participating in this conversation", + "title": "bot" + }, + "conversation": { + "$ref": "#/definitions/botframework.json/definitions/ConversationAccount", + "description": "Conversation reference", + "title": "conversation" + }, + "channelId": { + "description": "Channel ID", + "type": "string", + "title": "channelId" + }, + "serviceUrl": { + "description": "Service endpoint where operations concerning the referenced conversation may be performed", + "type": "string", + "title": "serviceUrl" + } + } + }, + "TextHighlight": { + "description": "Refers to a substring of content within another field", + "title": "TextHighlight", + "type": "object", + "required": [ + "occurrence", + "text" + ], + "properties": { + "text": { + "description": "Defines the snippet of text to highlight", + "type": "string", + "title": "text" + }, + "occurrence": { + "description": "Occurrence of the text field within the referenced text, if multiple exist.", + "type": "number", + "title": "occurrence" + } + } + }, + "SemanticAction": { + "description": "Represents a reference to a programmatic action", + "title": "SemanticAction", + "type": "object", + "required": [ + "entities", + "id" + ], + "properties": { + "id": { + "description": "ID of this action", + "type": "string", + "title": "id" + }, + "entities": { + "description": "Entities associated with this action", + "type": "object", + "title": "entities", + "additionalProperties": { + "$ref": "#/definitions/botframework.json/definitions/Entity" + } + } + } + }, + "Activity": { + "description": "An Activity is the basic communication type for the Bot Framework 3.0 protocol.", + "title": "Activity", + "type": "object", + "properties": { + "type": { + "description": "Contains the activity type. Possible values include: 'message', 'contactRelationUpdate',\n'conversationUpdate', 'typing', 'endOfConversation', 'event', 'invoke', 'deleteUserData',\n'messageUpdate', 'messageDelete', 'installationUpdate', 'messageReaction', 'suggestion',\n'trace', 'handoff'", + "type": "string", + "title": "type" + }, + "id": { + "description": "Contains an ID that uniquely identifies the activity on the channel.", + "type": "string", + "title": "id" + }, + "timestamp": { + "description": "Contains the date and time that the message was sent, in UTC, expressed in ISO-8601 format.", + "type": "string", + "format": "date-time", + "title": "timestamp" + }, + "localTimestamp": { + "description": "Contains the date and time that the message was sent, in local time, expressed in ISO-8601\nformat.\nFor example, 2016-09-23T13:07:49.4714686-07:00.", + "type": "string", + "format": "date-time", + "title": "localTimestamp" + }, + "localTimezone": { + "description": "Contains the name of the timezone in which the message, in local time, expressed in IANA Time\nZone database format.\nFor example, America/Los_Angeles.", + "type": "string", + "title": "localTimezone" + }, + "serviceUrl": { + "description": "Contains the URL that specifies the channel's service endpoint. Set by the channel.", + "type": "string", + "title": "serviceUrl" + }, + "channelId": { + "description": "Contains an ID that uniquely identifies the channel. Set by the channel.", + "type": "string", + "title": "channelId" + }, + "from": { + "$ref": "#/definitions/botframework.json/definitions/ChannelAccount", + "description": "Identifies the sender of the message.", + "title": "from" + }, + "conversation": { + "$ref": "#/definitions/botframework.json/definitions/ConversationAccount", + "description": "Identifies the conversation to which the activity belongs.", + "title": "conversation" + }, + "recipient": { + "$ref": "#/definitions/botframework.json/definitions/ChannelAccount", + "description": "Identifies the recipient of the message.", + "title": "recipient" + }, + "textFormat": { + "description": "Format of text fields Default:markdown. Possible values include: 'markdown', 'plain', 'xml'", + "type": "string", + "title": "textFormat" + }, + "attachmentLayout": { + "description": "The layout hint for multiple attachments. Default: list. Possible values include: 'list',\n'carousel'", + "type": "string", + "title": "attachmentLayout" + }, + "membersAdded": { + "description": "The collection of members added to the conversation.", + "type": "array", + "title": "membersAdded", + "items": { + "$ref": "#/definitions/botframework.json/definitions/ChannelAccount" + } + }, + "membersRemoved": { + "description": "The collection of members removed from the conversation.", + "type": "array", + "title": "membersRemoved", + "items": { + "$ref": "#/definitions/botframework.json/definitions/ChannelAccount" + } + }, + "reactionsAdded": { + "description": "The collection of reactions added to the conversation.", + "type": "array", + "title": "reactionsAdded", + "items": { + "$ref": "#/definitions/botframework.json/definitions/MessageReaction" + } + }, + "reactionsRemoved": { + "description": "The collection of reactions removed from the conversation.", + "type": "array", + "title": "reactionsRemoved", + "items": { + "$ref": "#/definitions/botframework.json/definitions/MessageReaction" + } + }, + "topicName": { + "description": "The updated topic name of the conversation.", + "type": "string", + "title": "topicName" + }, + "historyDisclosed": { + "description": "Indicates whether the prior history of the channel is disclosed.", + "type": "boolean", + "title": "historyDisclosed" + }, + "locale": { + "description": "A locale name for the contents of the text field.\nThe locale name is a combination of an ISO 639 two- or three-letter culture code associated\nwith a language\nand an ISO 3166 two-letter subculture code associated with a country or region.\nThe locale name can also correspond to a valid BCP-47 language tag.", + "type": "string", + "title": "locale" + }, + "text": { + "description": "The text content of the message.", + "type": "string", + "title": "text" + }, + "speak": { + "description": "The text to speak.", + "type": "string", + "title": "speak" + }, + "inputHint": { + "description": "Indicates whether your bot is accepting,\nexpecting, or ignoring user input after the message is delivered to the client. Possible\nvalues include: 'acceptingInput', 'ignoringInput', 'expectingInput'", + "type": "string", + "title": "inputHint" + }, + "summary": { + "description": "The text to display if the channel cannot render cards.", + "type": "string", + "title": "summary" + }, + "suggestedActions": { + "description": "The suggested actions for the activity.", + "$ref": "#/definitions/botframework.json/definitions/SuggestedActions", + "title": "suggestedActions" + }, + "attachments": { + "description": "Attachments", + "type": "array", + "title": "attachments", + "items": { + "$ref": "#/definitions/botframework.json/definitions/Attachment" + } + }, + "entities": { + "description": "Represents the entities that were mentioned in the message.", + "type": "array", + "title": "entities", + "items": { + "$ref": "#/definitions/botframework.json/definitions/Entity" + } + }, + "channelData": { + "description": "Contains channel-specific content.", + "title": "channelData" + }, + "action": { + "description": "Indicates whether the recipient of a contactRelationUpdate was added or removed from the\nsender's contact list.", + "type": "string", + "title": "action" + }, + "replyToId": { + "description": "Contains the ID of the message to which this message is a reply.", + "type": "string", + "title": "replyToId" + }, + "label": { + "description": "A descriptive label for the activity.", + "type": "string", + "title": "label" + }, + "valueType": { + "description": "The type of the activity's value object.", + "type": "string", + "title": "valueType" + }, + "value": { + "description": "A value that is associated with the activity.", + "title": "value" + }, + "name": { + "description": "The name of the operation associated with an invoke or event activity.", + "type": "string", + "title": "name" + }, + "relatesTo": { + "description": "A reference to another conversation or activity.", + "$ref": "#/definitions/botframework.json/definitions/ConversationReference", + "title": "relatesTo" + }, + "code": { + "description": "The a code for endOfConversation activities that indicates why the conversation ended.\nPossible values include: 'unknown', 'completedSuccessfully', 'userCancelled', 'botTimedOut',\n'botIssuedInvalidMessage', 'channelFailed'", + "type": "string", + "title": "code" + }, + "expiration": { + "description": "The time at which the activity should be considered to be \"expired\" and should not be\npresented to the recipient.", + "type": "string", + "format": "date-time", + "title": "expiration" + }, + "importance": { + "description": "The importance of the activity. Possible values include: 'low', 'normal', 'high'", + "type": "string", + "title": "importance" + }, + "deliveryMode": { + "description": "A delivery hint to signal to the recipient alternate delivery paths for the activity.\nThe default delivery mode is \"default\". Possible values include: 'normal', 'notification'", + "type": "string", + "title": "deliveryMode" + }, + "listenFor": { + "description": "List of phrases and references that speech and language priming systems should listen for", + "type": "array", + "title": "listenFor", + "items": { + "type": "string", + "title": "Phrase", + "description": "Phrase to listen for." + } + }, + "textHighlights": { + "description": "The collection of text fragments to highlight when the activity contains a ReplyToId value.", + "type": "array", + "title": "textHighlights", + "items": { + "$ref": "#/definitions/botframework.json/definitions/TextHighlight" + } + }, + "semanticAction": { + "$ref": "#/definitions/botframework.json/definitions/SemanticAction", + "description": "An optional programmatic action accompanying this request", + "title": "semanticAction" + } + } + } + } } } }