Skip to content
This repository has been archived by the owner on Jun 30, 2022. It is now read-only.

Commit

Permalink
[TypeScript][Skill Sample] Add manifest endpoint (#1511)
Browse files Browse the repository at this point in the history
* Add manifest endpoint

* Update template with manifest endpoint
  • Loading branch information
enzocano authored and darrenj committed Jun 10, 2019
1 parent ed41689 commit 14ed4dd
Show file tree
Hide file tree
Showing 9 changed files with 162 additions and 83 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,10 @@ class Copier {
path.join(`src`, `bots`, `_dialogBot.ts`),
path.join(`src`, `bots`, `dialogBot.ts`)
);
templateFiles.set(
path.join(`src`, `_manifestTemplate.json`),
path.join(`src`, `manifestTemplate.json`)
);
templateFiles.set(
path.join(`src`, `dialogs`, `_mainDialog.ts`),
path.join(`src`, `dialogs`, `mainDialog.ts`)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"botbuilder-azure": "^4.4.0",
"botbuilder-core": "^4.4.0",
"botbuilder-dialogs": "^4.4.0",
"botbuilder-skills": "^4.4.6",
"botbuilder-skills": "^1.0.0-preview64",
"botbuilder-solutions": "^4.4.6",
"botframework-config": "^4.4.0",
"botframework-connector": "^4.4.0",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"id": "<%= skillName %>",
"name": "<%= skillName %>",
"description": "This is the description of the <%= skillName %>",
"iconUrl": "",
"authenticationConnections": [],
"actions": [
{
"id": "<%= skillName %>_Sample",
"definition": {
"description": "Trigger <%= skillName %>",
"slots": [],
"triggers": {
"utteranceSources": [
{
"locale": "en",
"source": [
"<%= skillName %>#Sample"
]
}
]
}
}
}
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,9 @@ import {
import {
IAuthenticationConnection,
ISkillManifest,
manifestGenerator,
SkillContext,
SkillHttpAdapter} from 'botbuilder-skills';
SkillHttpAdapter } from 'botbuilder-skills';
import {
ICognitiveModelConfiguration,
IOAuthConnection,
Expand All @@ -31,6 +32,7 @@ import {
ResponseManager} from 'botbuilder-solutions';
import i18next from 'i18next';
import i18nextNodeFsBackend from 'i18next-node-fs-backend';
import { join } from 'path';
import * as restify from 'restify';
import { CustomSkillAdapter } from './adapters/customSkillAdapter';
import { DefaultAdapter } from './adapters/defaultAdapter';
Expand Down Expand Up @@ -193,6 +195,10 @@ server.post('/api/skill/messages', (req: restify.Request, res: restify.Response)
});
});

const manifestPath: string = join(__dirname, 'manifestTemplate.json');
server.use(restify.plugins.queryParser());
server.get('/api/skill/manifest', manifestGenerator(manifestPath, botSettings));

// This method creates a MultiProviderAuthDialog based on a skill manifest.
function buildAuthDialog(skill: ISkillManifest, settings: Partial<IBotSettings>): MultiProviderAuthDialog|undefined {
if (skill.authenticationConnections !== undefined && skill.authenticationConnections.length > 0) {
Expand Down

This file was deleted.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"botbuilder-azure": "^4.4.0",
"botbuilder-core": "^4.4.0",
"botbuilder-dialogs": "^4.4.0",
"botbuilder-skills": "^4.4.6",
"botbuilder-skills": "^1.0.0-preview64",
"botbuilder-solutions": "^4.4.6",
"botframework-config": "^4.4.0",
"botframework-connector": "^4.4.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,9 @@ import {
import {
IAuthenticationConnection,
ISkillManifest,
manifestGenerator,
SkillContext,
SkillHttpAdapter} from 'botbuilder-skills';
SkillHttpAdapter } from 'botbuilder-skills';
import {
ICognitiveModelConfiguration,
IOAuthConnection,
Expand All @@ -31,6 +32,7 @@ import {
ResponseManager} from 'botbuilder-solutions';
import i18next from 'i18next';
import i18nextNodeFsBackend from 'i18next-node-fs-backend';
import { join } from 'path';
import * as restify from 'restify';
import { CustomSkillAdapter } from './adapters/customSkillAdapter';
import { DefaultAdapter } from './adapters/defaultAdapter';
Expand Down Expand Up @@ -193,6 +195,10 @@ server.post('/api/skill/messages', (req: restify.Request, res: restify.Response)
});
});

const manifestPath: string = join(__dirname, 'manifestTemplate.json');
server.use(restify.plugins.queryParser());
server.get('/api/skill/manifest', manifestGenerator(manifestPath, botSettings));

// This method creates a MultiProviderAuthDialog based on a skill manifest.
function buildAuthDialog(skill: ISkillManifest, settings: Partial<IBotSettings>): MultiProviderAuthDialog|undefined {
if (skill.authenticationConnections !== undefined && skill.authenticationConnections.length > 0) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,37 +1,26 @@
{
"id": "",
"name": "",
"description": "",
"iconUrl": "",
"authenticationConnections": [
{
"id": "",
"serviceProviderId": "",
"scopes": ""
}
],
"actions": [
{
"id": "",
"definition": {
"description": "",
"slots": [
"id": "sampleSkill",
"name": "Sample Skill",
"description": "This is the description of the sample skill",
"iconUrl": "",
"authenticationConnections": [],
"actions": [
{
"id": "sampleSkill_Sample",
"definition": {
"description": "Trigger sample skill",
"slots": [],
"triggers": {
"utteranceSources": [
{
"name": "",
"types": [ "string" ]
"locale": "en",
"source": [
"sample-skill#Sample"
]
}
],
"triggers": {
"utteranceSources": [
{
"locale": "en",
"source": [
"luisModel#intent"
]
}
]
}
]
}
}
]
}
]
}

0 comments on commit 14ed4dd

Please sign in to comment.