From 51b33dbc177325188e2a9f05092993f9ff116af6 Mon Sep 17 00:00:00 2001 From: Srinaath Ravichandran Date: Wed, 29 Jul 2020 15:05:39 -0700 Subject: [PATCH 1/6] Added schema for bot project support Signed-off-by: Srinaath Ravichandran --- Schemas/SampleOfficeVA.botProject.json | 24 +++++ Schemas/botproject-schema.json | 71 +++++++++++++++ Schemas/provisioningProfile-schema.json | 112 ++++++++++++++++++++++++ Schemas/sampleProvisionProfile.json | 28 ++++++ 4 files changed, 235 insertions(+) create mode 100644 Schemas/SampleOfficeVA.botProject.json create mode 100644 Schemas/botproject-schema.json create mode 100644 Schemas/provisioningProfile-schema.json create mode 100644 Schemas/sampleProvisionProfile.json diff --git a/Schemas/SampleOfficeVA.botProject.json b/Schemas/SampleOfficeVA.botProject.json new file mode 100644 index 0000000000..938622e215 --- /dev/null +++ b/Schemas/SampleOfficeVA.botProject.json @@ -0,0 +1,24 @@ +{ + "$schema": "https://schemas.botframework.com/schemas/botprojects/v0.1/botproject-schema.json", + "name": "OfficeVA", + "workspace": "file://../Projects/OfficeVA", + "provisioningProfile": "file://../Projects/DeploymentProfiles/officeVA.json", + "skills": [ + { + "workspace": "file://../Projects/RoomSchedulerSkill", + "manifest": "room-scheduler-skill-manifest-v2.1.0", + "provisioningProfile": "file://../Projects/DeploymentProfiles/roomSchedulerProfile.json", + "remote": false, + "endpointName": "local" + }, + { + "manifest": "https://calendar-skill/calendar-skill-manifest-v2.1.0.json", + "remote": true + }, + { + "workspace": "file://../Projects/LunchOrderingSkill", + "provisioningProfile": "file://../Projects/DeploymentProfiles/lunchOrderingSkillProfile.json", + "remote": false + } + ] +} diff --git a/Schemas/botproject-schema.json b/Schemas/botproject-schema.json new file mode 100644 index 0000000000..2d4356adb2 --- /dev/null +++ b/Schemas/botproject-schema.json @@ -0,0 +1,71 @@ +{ + "$id": "https://schemas.botframework.com/schemas/botprojects/v0.1/worskspace.json", + "$schema": "http://json-schema.org/draft-07/schema#", + "$version": "0.1", + "title": "Virtual Assistant and Skills workspace schema", + "description": "This is a schema that captures the relationship between the virtual assistant and its skills.", + "type": "object", + "required": ["$schema", "name", "workspace", "skills"], + "properties": { + "$schema": { + "type": "string", + "format": "uri", + "description": "The schema to verify this workspace file against" + }, + "name": { + "type": "string", + "description": "Name of the Virtual Assistant or Root Bot." + }, + "workspace": { + "type": "string", + "description": "Path to the virtual assistant or Root Bot. Relative to the workspace file or an absolute path." + }, + "provisioningProfile": { + "type": "string", + "description": "Path to provisioning profile." + }, + "skills": { + "type": "array", + "minItems": 0, + "uniqueItems": true, + "description": "List of skills callable.", + "items": { + "$ref": "#/definitions/skill" + } + } + }, + "definitions": { + "skill": { + "type": "object", + "description": "Properties of a skill.", + "additionalProperties": false, + "required": ["manifest", "remote"], + "properties": { + "manifest": { + "type": "string", + "description": "Path to the manifest file on local file system or a URL to a remote skill." + }, + "workspace": { + "type": "string", + "description": "Path to the local skill project. If the workspace is local we use the file protocol as opposed to http/https for remote workspaces." + }, + "remote": { + "type": "string", + "description": "Indication if the skill is remote or local skill.", + "$ref": "#/definitions/booleanExpression", + "title": "isRemote", + "default": false + }, + "endpointName": { + "type": "string", + "description": "Indicates the name of the skill endpoint to use for writing the skill URL. If skill is remote no need for this property.", + "default": "default" + }, + "provisioningProfile": { + "type": "string", + "description": "Path to provisioning profile." + } + } + } + } +} diff --git a/Schemas/provisioningProfile-schema.json b/Schemas/provisioningProfile-schema.json new file mode 100644 index 0000000000..a0e15ef140 --- /dev/null +++ b/Schemas/provisioningProfile-schema.json @@ -0,0 +1,112 @@ +{ + "$id": "https://schemas.botframework.com/schemas/botprojects/v0.1/provisioning.json", + "$schema": "http://json-schema.org/draft-07/schema#", + "$version": "0.1", + "title": "Provisioning profile schema for Bot Projects", + "description": "This is a schema that captures the resource provisioning needs for a bot which maybe a Virtual Assistant or a skill", + "type": "object", + "required": [ + "$schema", + "MicrosoftAppId", + "MicrosoftAppPassword", + "accessToken" + ], + "additionalProperties": false, + "properties": { + "$schema": { + "type": "string", + "format": "uri", + "description": "The schema to verify this provisioning profile file against" + }, + "MicrosoftAppId": { + "type": "string", + "description": "Micorosft App ID of the resource" + }, + "MicrosoftAppPassword": { + "type": "string", + "description": "Micorosft App Password of the resource" + }, + "name": { + "type": "string", + "description": "Optional name of the publishing target" + }, + "accessToken": { + "type": "string", + "description": "Access token for azure account" + }, + "applicationInsights": { + "type": "object", + "description": "Application Insights provisioning", + "properties": { + "endpointKey": { + "type": "string", + "description": "Instrumentation key for application insights" + } + } + }, + "blobStorage": { + "type": "object", + "description": "Configuring blob storage on azure", + "properties": { + "connectionString": { + "type": "string", + "description": "Connection string for blob storage" + } + } + }, + "luis": { + "type": "object", + "description": "LUIS provisioning for a bot", + "properties": { + "endpointKey": { + "type": "string", + "description": "Endpoint key for LUIS provisioning" + }, + "authoringKey": { + "type": "string", + "description": "Authoring key for LUIS provisioning" + }, + "region": { + "type": "string", + "description": "Region for LUIS provisioning" + }, + "endpoint": { + "type": "string", + "description": "LUIS endpoint configuration" + }, + "authoringEndpoint": { + "type": "string", + "description": "Authoring endpoint for LUIS" + } + } + }, + "qna": { + "type": "object", + "description": "Qna maker provisioning for a bot", + "properties": { + "knowledgebaseid": { + "type": "string", + "description": "Qna maker knowledge base id" + }, + "endpoint": { + "type": "string", + "description": "Hostname for QNA maker resource" + } + } + }, + "cosmosDb": { + "type": "object", + "description": "Cosmos db provisioning for a bot", + "properties": { + "endpoint": { + "type": "string", + "description": "Endpoint configuration for cosmos db" + }, + "authKey": { + "type": "string", + "description": "Authorization key for cosmos db" + } + } + } + } +} diff --git a/Schemas/sampleProvisionProfile.json b/Schemas/sampleProvisionProfile.json new file mode 100644 index 0000000000..9fdfd44688 --- /dev/null +++ b/Schemas/sampleProvisionProfile.json @@ -0,0 +1,28 @@ +{ + "$schema": "https://schemas.botframework.com/schemas/botprojects/v0.1/provisioningProfile-schema.json", + "accessToken": "SDFSDFSDFSDBNASKDJASDJJLKJSADJLKMXRNZW", + "environment": "dev", + "MicrosoftAppId": "fd38ebff-02e2-427c-234234-234234", + "MicrosoftAppPassword": "XYZSASJDLKASjksdhfks!sfs", + "blobStorage": { + "connectionString": "DefaultEndpointsProtocol=https;AccountName=SampleSkill" + }, + "cosmosDb": { + "endpoint": "https://todoluissample2-dev.documents.azure.com:443/", + "authKey": "XSFDDSFOHOI" + }, + "qna": { + "knowledgebaseId": "6ea9080e0dsfsdfsdfb4c44", + "endpoint": "https://composerdemovenky.cognitiveservices.azure.com/qnamaker/v4.0/knowledgebases/89366431-a501-324324-asdhas" + }, + "luis": { + "endpointKey": "234kj23h4asdjajdkjashdkjAAsad", + "authoringKey": "234kjh890aasdhakjs", + "region": "westus", + "endpoint": "https://westus.api.cognitive.microsoft.com/", + "authoringEndpoint": "https://westus.api.cognitive.microsoft.com/" + }, + "applicationInsights": { + "endpointKey": "Asdfsdfa23432adsfsdf!sdsad" + } +} From 308e3920fa89666f982a6f957de9135d2d805db1 Mon Sep 17 00:00:00 2001 From: Srinaath Ravichandran Date: Sun, 4 Oct 2020 14:17:54 -0700 Subject: [PATCH 2/6] Add 1.0 botproject schema Signed-off-by: Srinaath Ravichandran --- Composer/.gitignore | 1 + .../packages/server/schemas/botproject.schema | 74 ++++++++++++ Schemas/SampleOfficeVA.botProject.json | 24 ---- Schemas/botproject-schema.json | 71 ----------- Schemas/provisioningProfile-schema.json | 112 ------------------ Schemas/sampleProvisionProfile.json | 28 ----- 6 files changed, 75 insertions(+), 235 deletions(-) create mode 100644 Composer/packages/server/schemas/botproject.schema delete mode 100644 Schemas/SampleOfficeVA.botProject.json delete mode 100644 Schemas/botproject-schema.json delete mode 100644 Schemas/provisioningProfile-schema.json delete mode 100644 Schemas/sampleProvisionProfile.json diff --git a/Composer/.gitignore b/Composer/.gitignore index 4a121af957..dd7f3398f4 100644 --- a/Composer/.gitignore +++ b/Composer/.gitignore @@ -13,6 +13,7 @@ packages/server/schemas/*.schema packages/server/schemas/*.uischema !packages/server/schemas/sdk.schema !packages/server/schemas/sdk.uischema +!packages/server/schemas/botproject.schema # remote extensions .composer diff --git a/Composer/packages/server/schemas/botproject.schema b/Composer/packages/server/schemas/botproject.schema new file mode 100644 index 0000000000..1ff9e75958 --- /dev/null +++ b/Composer/packages/server/schemas/botproject.schema @@ -0,0 +1,74 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "https://github.com/microsoft/BotFramework-Composer/blob/main/Composer/packages/server/schemas/botproject.schema", + "$version": "1.0.0", + "title": "Root Bot and Skills workspace schema for a environemnt. Each publishing environment has a Bot Project file associated with it.", + "description": "Schema that captures the relationship between the Root Bot and remote/local skills that the Root Bot consumes.", + "type": "object", + "required": ["$schema", "name", "workspace", "skills"], + "properties": { + "$schema": { + "type": "string", + "format": "uri", + "description": "The schema to verify this workspace file." + }, + "name": { + "type": "string", + "description": "Name of the Root Bot." + }, + "workspace": { + "type": "string", + "description": "Path to the Root Bot. If a workspace is local, we use the file protocol as opposed to http/https for remote workspaces." + }, + "skills": { + "description": "List of skills (remote or local) skills that the Root Bot consumes.", + "type": "object", + "patternProperties": { + "^.*$": { + "$ref": "#/definitions/skill" + } + }, + "additionalProperties": false + } + }, + "definitions": { + "skill": { + "type": "object", + "description": "Properties of a skill.", + "additionalProperties": false, + "required": ["remote"], + "oneOf": [ + { + "anyOf": [ + { + "required": ["workspace"] + }, + { + "required": ["manifest"] + } + ] + } + ], + "properties": { + "manifest": { + "type": "string", + "description": "URL that points to the manifest exposed by the skill." + }, + "workspace": { + "type": "string", + "description": "Path to a skill workspace. If a workspace is local, we use the file protocol as opposed to http/https protocols for remote workspaces." + }, + "remote": { + "description": "Indication if the skill is remote or local skill.", + "type": "boolean", + "title": "isRemote", + "default": false + }, + "endpointName": { + "type": "string", + "description": "The name of the endpoint inside the above chosen manifest that the Root Bot can use to consume the skill capabilities." + } + } + } + } +} diff --git a/Schemas/SampleOfficeVA.botProject.json b/Schemas/SampleOfficeVA.botProject.json deleted file mode 100644 index 938622e215..0000000000 --- a/Schemas/SampleOfficeVA.botProject.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "$schema": "https://schemas.botframework.com/schemas/botprojects/v0.1/botproject-schema.json", - "name": "OfficeVA", - "workspace": "file://../Projects/OfficeVA", - "provisioningProfile": "file://../Projects/DeploymentProfiles/officeVA.json", - "skills": [ - { - "workspace": "file://../Projects/RoomSchedulerSkill", - "manifest": "room-scheduler-skill-manifest-v2.1.0", - "provisioningProfile": "file://../Projects/DeploymentProfiles/roomSchedulerProfile.json", - "remote": false, - "endpointName": "local" - }, - { - "manifest": "https://calendar-skill/calendar-skill-manifest-v2.1.0.json", - "remote": true - }, - { - "workspace": "file://../Projects/LunchOrderingSkill", - "provisioningProfile": "file://../Projects/DeploymentProfiles/lunchOrderingSkillProfile.json", - "remote": false - } - ] -} diff --git a/Schemas/botproject-schema.json b/Schemas/botproject-schema.json deleted file mode 100644 index 2d4356adb2..0000000000 --- a/Schemas/botproject-schema.json +++ /dev/null @@ -1,71 +0,0 @@ -{ - "$id": "https://schemas.botframework.com/schemas/botprojects/v0.1/worskspace.json", - "$schema": "http://json-schema.org/draft-07/schema#", - "$version": "0.1", - "title": "Virtual Assistant and Skills workspace schema", - "description": "This is a schema that captures the relationship between the virtual assistant and its skills.", - "type": "object", - "required": ["$schema", "name", "workspace", "skills"], - "properties": { - "$schema": { - "type": "string", - "format": "uri", - "description": "The schema to verify this workspace file against" - }, - "name": { - "type": "string", - "description": "Name of the Virtual Assistant or Root Bot." - }, - "workspace": { - "type": "string", - "description": "Path to the virtual assistant or Root Bot. Relative to the workspace file or an absolute path." - }, - "provisioningProfile": { - "type": "string", - "description": "Path to provisioning profile." - }, - "skills": { - "type": "array", - "minItems": 0, - "uniqueItems": true, - "description": "List of skills callable.", - "items": { - "$ref": "#/definitions/skill" - } - } - }, - "definitions": { - "skill": { - "type": "object", - "description": "Properties of a skill.", - "additionalProperties": false, - "required": ["manifest", "remote"], - "properties": { - "manifest": { - "type": "string", - "description": "Path to the manifest file on local file system or a URL to a remote skill." - }, - "workspace": { - "type": "string", - "description": "Path to the local skill project. If the workspace is local we use the file protocol as opposed to http/https for remote workspaces." - }, - "remote": { - "type": "string", - "description": "Indication if the skill is remote or local skill.", - "$ref": "#/definitions/booleanExpression", - "title": "isRemote", - "default": false - }, - "endpointName": { - "type": "string", - "description": "Indicates the name of the skill endpoint to use for writing the skill URL. If skill is remote no need for this property.", - "default": "default" - }, - "provisioningProfile": { - "type": "string", - "description": "Path to provisioning profile." - } - } - } - } -} diff --git a/Schemas/provisioningProfile-schema.json b/Schemas/provisioningProfile-schema.json deleted file mode 100644 index a0e15ef140..0000000000 --- a/Schemas/provisioningProfile-schema.json +++ /dev/null @@ -1,112 +0,0 @@ -{ - "$id": "https://schemas.botframework.com/schemas/botprojects/v0.1/provisioning.json", - "$schema": "http://json-schema.org/draft-07/schema#", - "$version": "0.1", - "title": "Provisioning profile schema for Bot Projects", - "description": "This is a schema that captures the resource provisioning needs for a bot which maybe a Virtual Assistant or a skill", - "type": "object", - "required": [ - "$schema", - "MicrosoftAppId", - "MicrosoftAppPassword", - "accessToken" - ], - "additionalProperties": false, - "properties": { - "$schema": { - "type": "string", - "format": "uri", - "description": "The schema to verify this provisioning profile file against" - }, - "MicrosoftAppId": { - "type": "string", - "description": "Micorosft App ID of the resource" - }, - "MicrosoftAppPassword": { - "type": "string", - "description": "Micorosft App Password of the resource" - }, - "name": { - "type": "string", - "description": "Optional name of the publishing target" - }, - "accessToken": { - "type": "string", - "description": "Access token for azure account" - }, - "applicationInsights": { - "type": "object", - "description": "Application Insights provisioning", - "properties": { - "endpointKey": { - "type": "string", - "description": "Instrumentation key for application insights" - } - } - }, - "blobStorage": { - "type": "object", - "description": "Configuring blob storage on azure", - "properties": { - "connectionString": { - "type": "string", - "description": "Connection string for blob storage" - } - } - }, - "luis": { - "type": "object", - "description": "LUIS provisioning for a bot", - "properties": { - "endpointKey": { - "type": "string", - "description": "Endpoint key for LUIS provisioning" - }, - "authoringKey": { - "type": "string", - "description": "Authoring key for LUIS provisioning" - }, - "region": { - "type": "string", - "description": "Region for LUIS provisioning" - }, - "endpoint": { - "type": "string", - "description": "LUIS endpoint configuration" - }, - "authoringEndpoint": { - "type": "string", - "description": "Authoring endpoint for LUIS" - } - } - }, - "qna": { - "type": "object", - "description": "Qna maker provisioning for a bot", - "properties": { - "knowledgebaseid": { - "type": "string", - "description": "Qna maker knowledge base id" - }, - "endpoint": { - "type": "string", - "description": "Hostname for QNA maker resource" - } - } - }, - "cosmosDb": { - "type": "object", - "description": "Cosmos db provisioning for a bot", - "properties": { - "endpoint": { - "type": "string", - "description": "Endpoint configuration for cosmos db" - }, - "authKey": { - "type": "string", - "description": "Authorization key for cosmos db" - } - } - } - } -} diff --git a/Schemas/sampleProvisionProfile.json b/Schemas/sampleProvisionProfile.json deleted file mode 100644 index 9fdfd44688..0000000000 --- a/Schemas/sampleProvisionProfile.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "$schema": "https://schemas.botframework.com/schemas/botprojects/v0.1/provisioningProfile-schema.json", - "accessToken": "SDFSDFSDFSDBNASKDJASDJJLKJSADJLKMXRNZW", - "environment": "dev", - "MicrosoftAppId": "fd38ebff-02e2-427c-234234-234234", - "MicrosoftAppPassword": "XYZSASJDLKASjksdhfks!sfs", - "blobStorage": { - "connectionString": "DefaultEndpointsProtocol=https;AccountName=SampleSkill" - }, - "cosmosDb": { - "endpoint": "https://todoluissample2-dev.documents.azure.com:443/", - "authKey": "XSFDDSFOHOI" - }, - "qna": { - "knowledgebaseId": "6ea9080e0dsfsdfsdfb4c44", - "endpoint": "https://composerdemovenky.cognitiveservices.azure.com/qnamaker/v4.0/knowledgebases/89366431-a501-324324-asdhas" - }, - "luis": { - "endpointKey": "234kj23h4asdjajdkjashdkjAAsad", - "authoringKey": "234kjh890aasdhakjs", - "region": "westus", - "endpoint": "https://westus.api.cognitive.microsoft.com/", - "authoringEndpoint": "https://westus.api.cognitive.microsoft.com/" - }, - "applicationInsights": { - "endpointKey": "Asdfsdfa23432adsfsdf!sdsad" - } -} From b98e1faa4c5c5d5d72955fe59cd155f5ae8e30c4 Mon Sep 17 00:00:00 2001 From: Srinaath Ravichandran Date: Sun, 4 Oct 2020 14:22:46 -0700 Subject: [PATCH 3/6] Fix typo Signed-off-by: Srinaath Ravichandran --- Composer/packages/server/schemas/botproject.schema | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Composer/packages/server/schemas/botproject.schema b/Composer/packages/server/schemas/botproject.schema index 1ff9e75958..745c54f133 100644 --- a/Composer/packages/server/schemas/botproject.schema +++ b/Composer/packages/server/schemas/botproject.schema @@ -2,7 +2,7 @@ "$schema": "http://json-schema.org/draft-07/schema#", "$id": "https://github.com/microsoft/BotFramework-Composer/blob/main/Composer/packages/server/schemas/botproject.schema", "$version": "1.0.0", - "title": "Root Bot and Skills workspace schema for a environemnt. Each publishing environment has a Bot Project file associated with it.", + "title": "Root Bot and Skills workspace schema for a environment. Each publishing environment has a Bot Project file associated with it.", "description": "Schema that captures the relationship between the Root Bot and remote/local skills that the Root Bot consumes.", "type": "object", "required": ["$schema", "name", "workspace", "skills"], From c56e1b18ee8e4bd4a535c28cbbe29b2186912413 Mon Sep 17 00:00:00 2001 From: Srinaath Ravichandran Date: Tue, 6 Oct 2020 23:37:43 -0700 Subject: [PATCH 4/6] Updated gitignore Signed-off-by: Srinaath Ravichandran --- Composer/packages/server/.gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/Composer/packages/server/.gitignore b/Composer/packages/server/.gitignore index aeeb3279c8..ea8a2d16ff 100644 --- a/Composer/packages/server/.gitignore +++ b/Composer/packages/server/.gitignore @@ -5,3 +5,4 @@ schemas/*-pseudo.uischema src/__tests__/__data__.json src/locales/*-pseudo.json extensions.json +!packages/server/schemas/botproject.schema From b78d118f4847420cc9a614efb098636838db28b2 Mon Sep 17 00:00:00 2001 From: Srinaath Ravichandran Date: Tue, 6 Oct 2020 23:39:10 -0700 Subject: [PATCH 5/6] Typo fixed Signed-off-by: Srinaath Ravichandran --- Composer/packages/server/schemas/botproject.schema | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Composer/packages/server/schemas/botproject.schema b/Composer/packages/server/schemas/botproject.schema index 745c54f133..4decf4b2cf 100644 --- a/Composer/packages/server/schemas/botproject.schema +++ b/Composer/packages/server/schemas/botproject.schema @@ -18,7 +18,7 @@ }, "workspace": { "type": "string", - "description": "Path to the Root Bot. If a workspace is local, we use the file protocol as opposed to http/https for remote workspaces." + "description": "Absolute path to the Root Bot. If a workspace is local, we use the file protocol as opposed to http/https for remote workspaces." }, "skills": { "description": "List of skills (remote or local) skills that the Root Bot consumes.", @@ -56,7 +56,7 @@ }, "workspace": { "type": "string", - "description": "Path to a skill workspace. If a workspace is local, we use the file protocol as opposed to http/https protocols for remote workspaces." + "description": "Absolute path to a skill workspace. If a workspace is local, we use the file protocol as opposed to http/https protocols for remote workspaces." }, "remote": { "description": "Indication if the skill is remote or local skill.", From 5576163afcf7569de850981e50081d89badd128a Mon Sep 17 00:00:00 2001 From: Srinaath Ravichandran Date: Thu, 8 Oct 2020 15:17:07 -0700 Subject: [PATCH 6/6] Following sdk.schema approach to specificy object type using ref Signed-off-by: Srinaath Ravichandran --- Composer/packages/server/schemas/botproject.schema | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/Composer/packages/server/schemas/botproject.schema b/Composer/packages/server/schemas/botproject.schema index 4decf4b2cf..304d559cb6 100644 --- a/Composer/packages/server/schemas/botproject.schema +++ b/Composer/packages/server/schemas/botproject.schema @@ -24,11 +24,9 @@ "description": "List of skills (remote or local) skills that the Root Bot consumes.", "type": "object", "patternProperties": { - "^.*$": { - "$ref": "#/definitions/skill" - } + "^\\$": { "title": "Skill name", "description": "Unique Skill name identifier" } }, - "additionalProperties": false + "additionalProperties": { "$ref": "#/definitions/skill" } } }, "definitions": {