Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Update schema #3044

Merged
merged 3 commits into from
May 14, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ const DefaultUISchema: UISchema = {
subtitle: () => formatMessage('Set Properties'),
helpLink: 'https://aka.ms/bfc-using-memory',
},
[SDKKinds.SkillDialog]: {
[SDKKinds.BeginSkill]: {
label: () => formatMessage('Connect to a skill'),
subtitle: () => formatMessage('Skill Dialog'),
helpLink: 'https://aka.ms/bfc-call-skill',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ export const defaultFlowSchema: FlowSchema = {
</>
) : null,
},
[SDKKinds.SkillDialog]: {
[SDKKinds.BeginSkill]: {
widget: 'ActionCard',
colors: { theme: ObiColors.DarkBlue, color: ObiColors.White, icon: ObiColors.White },
icon: 'Library',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { copyEditActions } from './copyEditActions';

const CopyConstructorMap = {
[SDKKinds.SendActivity]: copySendActivity,
[SDKKinds.SkillDialog]: copySendActivity,
[SDKKinds.BeginSkill]: copySendActivity,
[SDKKinds.AttachmentInput]: copyInputDialog,
[SDKKinds.ChoiceInput]: copyInputDialog,
[SDKKinds.ConfirmInput]: copyInputDialog,
Expand Down
2 changes: 1 addition & 1 deletion Composer/packages/lib/shared/src/deleteUtils/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const collectLgTemplates = (action: any, outputTemplates: string[]) => {

switch (action.$kind) {
case SDKKinds.SendActivity:
case SDKKinds.SkillDialog:
case SDKKinds.BeginSkill:
outputTemplates.push(action.activity);
break;
case SDKKinds.AttachmentInput:
Expand Down
2 changes: 1 addition & 1 deletion Composer/packages/lib/shared/src/labelMap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ export const ConceptLabels: { [key in ConceptLabelKey]?: LabelOverride } = {
[SDKKinds.SetProperties]: {
title: formatMessage('Set properties'),
},
[SDKKinds.SkillDialog]: {
[SDKKinds.BeginSkill]: {
title: formatMessage('Connect to a skill'),
description: formatMessage('Begin a remote skill dialog.'),
},
Expand Down
2 changes: 1 addition & 1 deletion Composer/packages/lib/shared/src/types/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ export enum SDKKinds {
SetProperties = 'Microsoft.SetProperties',
SetProperty = 'Microsoft.SetProperty',
SignOutUser = 'Microsoft.SignOutUser',
SkillDialog = 'Microsoft.SkillDialog',
BeginSkill = 'Microsoft.BeginSkill',
StaticActivityTemplate = 'Microsoft.StaticActivityTemplate',
SwitchCondition = 'Microsoft.SwitchCondition',
TemperatureEntityRecognizer = 'Microsoft.TemperatureEntityRecognizer',
Expand Down
2 changes: 1 addition & 1 deletion Composer/packages/lib/shared/src/viewUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ export const dialogGroups: DialogGroupsMap = {
[DialogGroup.CODE]: {
label: 'Access external resources',
types: [
SDKKinds.SkillDialog,
SDKKinds.BeginSkill,
SDKKinds.HttpRequest,
SDKKinds.EmitEvent,
SDKKinds.OAuthInput,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const findLgFields = (action: any, handleLgField: LgFieldHandler) => {

switch (action.$kind) {
case SDKKinds.SendActivity:
case SDKKinds.SkillDialog:
case SDKKinds.BeginSkill:
onFound('activity');
break;
case SDKKinds.AttachmentInput:
Expand Down
264 changes: 132 additions & 132 deletions Composer/packages/server/schemas/sdk.schema
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@
{
"$ref": "#/definitions/Microsoft.BeginDialog"
},
{
"$ref": "#/definitions/Microsoft.BeginSkill"
},
{
"$ref": "#/definitions/Microsoft.BreakLoop"
},
Expand Down Expand Up @@ -274,9 +277,6 @@
{
"$ref": "#/definitions/Microsoft.SignOutUser"
},
{
"$ref": "#/definitions/Microsoft.SkillDialog"
},
{
"$ref": "#/definitions/Microsoft.StaticActivityTemplate"
},
Expand Down Expand Up @@ -1049,6 +1049,108 @@
}
}
},
"Microsoft.BeginSkill": {
"$role": "implements(Microsoft.IDialog)",
"title": "Begin a skill",
"description": "Begin a remote skill.",
"type": "object",
"required": [
"$kind"
],
"additionalProperties": false,
"patternProperties": {
"^\\$": {
"title": "Tooling property",
"description": "Open ended property for tooling."
}
},
"properties": {
"id": {
"type": "string",
"title": "Id",
"description": "Optional id for the skill dialog"
},
"disabled": {
"$ref": "#/definitions/booleanExpression",
"title": "Disabled",
"description": "Optional condition which if true will disable this action.",
"examples": [
true,
"=f(x)"
]
},
"activityProcessed": {
"$ref": "#/definitions/booleanExpression",
"title": "Activity Processed",
"description": "When set to false, the skill will be started using the activity in the current turn context instead of the activity in the Activity property.",
"default": true,
"examples": [
true,
"=f(x)"
]
},
"resultProperty": {
"$ref": "#/definitions/stringExpression",
"title": "Property",
"description": "Property to store any value returned by the dialog that is called.",
"examples": [
"dialog.userName"
]
},
"botId": {
"$ref": "#/definitions/stringExpression",
"title": "Skill host bot ID",
"description": "The Microsoft App ID that will be calling the skill.",
"default": "=settings.MicrosoftAppId"
},
"skillHostEndpoint": {
"$ref": "#/definitions/stringExpression",
"title": "Skill host",
"description": "The callback Url for the skill host.",
"default": "=settings.skillHostEndpoint",
"examples": [
"https://mybot.contoso.com/api/skills/"
]
},
"connectionName": {
"$ref": "#/definitions/stringExpression",
"title": "OAuth Connection Name (SSO)",
"description": "The OAuth Connection Name, that would be used to perform Single SignOn with a skill.",
"default": "=settings.connectionName"
},
"skillAppId": {
"$ref": "#/definitions/stringExpression",
"title": "Skill App ID",
"description": "The Microsoft App ID for the skill."
},
"skillEndpoint": {
"$ref": "#/definitions/stringExpression",
"title": "Skill endpoint ",
"description": "The /api/messages endpoint for the skill.",
"examples": [
"https://myskill.contoso.com/api/messages/"
]
},
"activity": {
"$kind": "Microsoft.IActivityTemplate",
"title": "Activity",
"description": "The activity to send to the skill.",
"$ref": "#/definitions/Microsoft.IActivityTemplate"
},
"$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": "Microsoft.BeginSkill"
},
"$designer": {
"title": "Designer information",
"type": "object",
"description": "Extra information for the Bot Framework Composer."
}
}
},
"Microsoft.BreakLoop": {
"$role": "implements(Microsoft.IDialog)",
"title": "Break Loop",
Expand Down Expand Up @@ -3912,9 +4014,36 @@
{
"$ref": "#/definitions/Microsoft.AdaptiveDialog"
},
{
"$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"
},
Expand Down Expand Up @@ -4004,33 +4133,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.SkillDialog"
},
{
"$ref": "#/definitions/Microsoft.TextInput"
}
]
},
Expand Down Expand Up @@ -7919,108 +8021,6 @@
}
}
},
"Microsoft.SkillDialog": {
"$role": "implements(Microsoft.IDialog)",
"title": "Begin a skill dialog",
"description": "Begin a remote skill dialog.",
"type": "object",
"required": [
"$kind"
],
"additionalProperties": false,
"patternProperties": {
"^\\$": {
"title": "Tooling property",
"description": "Open ended property for tooling."
}
},
"properties": {
"id": {
"type": "string",
"title": "Id",
"description": "Optional id for the skill dialog"
},
"disabled": {
"$ref": "#/definitions/booleanExpression",
"title": "Disabled",
"description": "Optional condition which if true will disable this action.",
"examples": [
true,
"=f(x)"
]
},
"activityProcessed": {
"$ref": "#/definitions/booleanExpression",
"title": "Activity Processed",
"description": "When set to false, the skill will be started using the activity in the current turn context instead of the activity in the Activity property.",
"default": true,
"examples": [
true,
"=f(x)"
]
},
"resultProperty": {
"$ref": "#/definitions/stringExpression",
"title": "Property",
"description": "Property to store any value returned by the dialog that is called.",
"examples": [
"dialog.userName"
]
},
"botId": {
"$ref": "#/definitions/stringExpression",
"title": "Skill host bot ID",
"description": "The Microsoft App ID that will be calling the skill.",
"default": "=settings.MicrosoftAppId"
},
"skillHostEndpoint": {
"$ref": "#/definitions/stringExpression",
"title": "Skill host",
"description": "The callback Url for the skill host.",
"default": "=settings.skillHostEndpoint",
"examples": [
"https://mybot.contoso.com/api/skills/"
]
},
"connectionName": {
"$ref": "#/definitions/stringExpression",
"title": "OAuth Connection Name (SSO)",
"description": "The OAuth Connection Name, that would be used to perform Single SignOn with a skill.",
"default": "=settings.connectionName"
},
"skillAppId": {
"$ref": "#/definitions/stringExpression",
"title": "Skill App ID",
"description": "The Microsoft App ID for the skill."
},
"skillEndpoint": {
"$ref": "#/definitions/stringExpression",
"title": "Skill endpoint ",
"description": "The /api/messages endpoint for the skill.",
"examples": [
"https://myskill.contoso.com/api/messages/"
]
},
"activity": {
"$kind": "Microsoft.IActivityTemplate",
"title": "Activity",
"description": "The activity to send to the skill.",
"$ref": "#/definitions/Microsoft.IActivityTemplate"
},
"$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": "Microsoft.SkillDialog"
},
"$designer": {
"title": "Designer information",
"type": "object",
"description": "Extra information for the Bot Framework Composer."
}
}
},
"Microsoft.StaticActivityTemplate": {
"$role": "implements(Microsoft.IActivityTemplate)",
"title": "Microsoft Static Activity Template",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ const renderBeginSkillDialog = ({ value = {}, onChange } = {}) => {
const props = {
depth: 1,
id: 'select.skillDialog',
schema: schema?.[SDKKinds.SkillDialog] || {},
uiOptions: formSchema?.[SDKKinds.SkillDialog] || {},
schema: schema?.[SDKKinds.BeginSkill] || {},
uiOptions: formSchema?.[SDKKinds.BeginSkill] || {},
value,
onChange,
};
Expand Down
Loading