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

[Node-Samples] Update to botbuilder 3.5.1 #51

Merged
merged 25 commits into from
Jan 23, 2017
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
b89f797
[Node-ReceiveAttachment] Update to botbuilder 3.5.1
pcostantini Jan 10, 2017
b4a92e2
[Node-SendAttachment] Update to botbuilder 3.5.1
pcostantini Jan 10, 2017
2e75ceb
[Node-CarouselCards] Update to botbuilder 3.5.1
pcostantini Jan 10, 2017
ebd2b5c
[Node-RichCards] Update to botbuilder 3.5.1
pcostantini Jan 10, 2017
68cbb60
[Node-State] Update to botbuilder 3.5.1
pcostantini Jan 10, 2017
e7f0182
[Node-MultiDialogs] Update to botbuilder 3.5.1
pcostantini Jan 10, 2017
28f8252
[Node-GetConversationMembers] Update to botbuilder 3.5.1
pcostantini Jan 10, 2017
0ef8a55
[Node-DirectLine] Update to botbuilder 3.5.1 and DirectLine 3.0
pcostantini Jan 10, 2017
178bb46
[Node-CreateNewConversation] Update to botbuilder 3.5.1
pcostantini Jan 10, 2017
dfac8f5
[Node-ChannelData] Update to botbuilder 3.5.1
pcostantini Jan 10, 2017
c3f9f2e
[Node-AppInsights] Update to botbuilder 3.5.1
pcostantini Jan 10, 2017
e27a151
[Node-AzureSearch] Update to botbuilder 3.5.1
pcostantini Jan 10, 2017
57927e4
[Node-SimilarProducts] Update to botbuilder 3.5.1
pcostantini Jan 10, 2017
aeb96b3
[Node-SpeechToText] Update to botbuilder 3.5.1
pcostantini Jan 10, 2017
c5cbc3a
[Node-LUIS] Update to botbuilder 3.5.1
pcostantini Jan 10, 2017
295400d
[Node-ImageCaption] Update to botbuilder 3.5.1
pcostantini Jan 10, 2017
13b7000
Fix typo in code comment
pcostantini Jan 10, 2017
74eb448
[Node] Update Emulator screenshots
pcostantini Jan 10, 2017
275b754
[Node-ContosoFlowers] Update to botbuilder 3.5.1 and add Localization…
pcostantini Jan 11, 2017
fa62d28
[Node] Updates for Microsoft Teams support
pcostantini Jan 12, 2017
6eeb67c
Add repository, bugs and keywords to package.json
pcostantini Jan 12, 2017
ee36c2b
[Node] RichCards - limitations of new Media Cards on channels
pcostantini Jan 12, 2017
5edcce6
Merge branch 'master' into node-samples-updates
pcostantini Jan 13, 2017
02a6c8b
[Node] Update remaining API Keys and azuredeploy.json templates
pcostantini Jan 13, 2017
51ed21e
[Node-SpeechToText] Do not consider video/mp4 as valid audio file
pcostantini Jan 16, 2017
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
Prev Previous commit
Next Next commit
[Node] Updates for Microsoft Teams support
* [Node-ReceiveAttachment] Update to support MS Teams attachments
* [Node] README updates on Microsoft Teams support
  • Loading branch information
pcostantini authored Jan 12, 2017
commit fa62d285db91d81d893cf7d626d5a3e2525921b0
2 changes: 2 additions & 0 deletions Node/cards-CarouselCards/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ To get more information about how to get started in Bot Builder for Node and Att
* [Message.attachmentLayout](https://docs.botframework.com/en-us/node/builder/chat-reference/classes/_botbuilder_d_.message.html#attachmentlayout)
* [AttachmentLayout](https://docs.botframework.com/en-us/node/builder/chat-reference/modules/_botbuilder_d_.html#attachmentlayout)
* [Adding Attachments to a Message](https://docs.botframework.com/en-us/core-concepts/attachments)
* [Carousel Layout in Microsoft Teams](https://msdn.microsoft.com/en-us/microsoft-teams/bots#carousel-layout)
* [RichCards sample](../cards-RichCards)

> **Limitations**
Expand All @@ -67,6 +68,7 @@ To get more information about how to get started in Bot Builder for Node and Att
> The features used in this sample are fully supported in the following channels:
> - Skype
> - Facebook
> - Microsoft Teams
>
> They are also supported, with some limitations, in the following channels:
> - Telegram
Expand Down
24 changes: 23 additions & 1 deletion Node/cards-RichCards/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -227,13 +227,14 @@ To get more information about how to get started in Bot Builder for Node and Att
* [AudioCard](https://docs.botframework.com/en-us/node/builder/chat-reference/classes/_botbuilder_d_.audiocard.html)
* [Message.addAttachment](https://docs.botframework.com/en-us/node/builder/chat-reference/classes/_botbuilder_d_.message.html#addattachment)
* [Attachment](https://docs.botframework.com/en-us/node/builder/chat-reference/interfaces/_botbuilder_d_.iattachment.html)
* [Cards and buttons on Microsoft Teams](https://msdn.microsoft.com/en-us/microsoft-teams/bots#cards-and-buttons)

> **Limitations**
> The functionality provided by the Bot Framework Activity can be used across many channels. Moreover, some special channel features can be unleashed using the [Message.sourceEvent](https://docs.botframework.com/en-us/node/builder/chat-reference/classes/_botbuilder_d_.message.html#sourceevent) method.
>
> The Bot Framework does its best to support the reuse of your Bot in as many channels as you want. However, due to the very nature of some of these channels, some features are not fully portable.
>
> The Hero card, Thumbnail card, Receipt card and Sign-in card used in this sample are fully supported in the following channels:
> The Hero card and Thumbnail card used in this sample are fully supported in the following channels:
> - Skype
> - Facebook
> - Telegram
Expand All @@ -249,6 +250,27 @@ To get more information about how to get started in Bot Builder for Node and Att
> On the other hand, they are not supported and the sample won't work as expected in the following channel:
> - SMS
>
> The Receipt card and Sign-in card used in this sample are fully supported in the following channels:
> - Skype
> - Facebook
> - Telegram
> - DirectLine
> - WebChat
> - Slack
> - Email
> - GroupMe
>
> They are also supported, with some limitations, in the following channel:
> - Kik
>
> On the other hand, they are not supported and the sample won't work as expected in the following channel:
> - SMS
> - Microsoft Teams
>
> The Animation card, Video card and Audio card used in this sample are fully supported in the following channels:
> - Skype
> - Facebook
>
> On the other hand, they are not supported and the sample won't work as expected in the following channel:
> - Microsoft Teams
>
1 change: 1 addition & 0 deletions Node/core-CreateNewConversation/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ To get more information about how to get started in Bot Builder for Node and Dia
>
> On the other hand, they are not supported and the sample won't work as expected in the following channels:
> - Facebook
> - Microsoft Teams
> - DirectLine
> - WebChat
> - Kik
Expand Down
7 changes: 5 additions & 2 deletions Node/core-GetConversationMembers/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -143,13 +143,16 @@ To get more information about how to get started in Bot Builder for Node, Conver
>
> The features used in this sample are fully supported in the following channels:
> - Skype
> - Facebook
> - Slack
> - DirectLine
> - WebChat
> - Email
> - GroupMe
>
>
> They are also supported, with some limitations, in the following channels:
> - Facebook
> - Microsoft Teams
>
> On the other hand, they are not supported and the sample won't work as expected in the following channels:
> - SMS
> - Kik
Expand Down
1 change: 1 addition & 0 deletions Node/core-MultiDialogs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,7 @@ To get more information about how to get started in Bot Builder for Node and Dia
> The features used in this sample are fully supported in the following channels:
> - Skype
> - Facebook
> - Microsoft Teams
> - Slack
> - DirectLine
> - WebChat
Expand Down
10 changes: 5 additions & 5 deletions Node/core-ReceiveAttachment/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ When attachments are sent to the bot they can be found in the message activity [
This property exposes a list of [IAttachment](https://docs.botframework.com/en-us/node/builder/chat-reference/interfaces/_botbuilder_d_.iattachment.html) representing each of the files sent. The attachment object contains information on the [contentType](https://docs.botframework.com/en-us/node/builder/chat-reference/interfaces/_botbuilder_d_.iattachment.html#contenttype) of the file and a [contentUrl](https://docs.botframework.com/en-us/node/builder/chat-reference/interfaces/_botbuilder_d_.iattachment.html#contenturl) which is a reference to the location of the attachment's content. In order to access the actual attachment file you will need to download the address from the contentUrl property.
Check out the key code located in the [dialog handler](app.js#L26-L43) where the `message.attachments` property of the message activity is read to get the first attachment and download it.

> Note: The Skype attachment URLs are secured by JwtToken; you should set the JwtToken of your bot as the authorization header for the HTTP GET request your bot initiates to fetch content. Below is the sample code that temporarily works around this issue and set the JwtToken on the HTTP request. You should be careful when you send the bot's JwtToken to a third party server and should always make sure to send it to trusted parties.
> Note: The Skype and MS Teams attachment URLs are secured by JwtToken; you should set the JwtToken of your bot as the authorization header for the HTTP GET request your bot initiates to fetch content. Below is the sample code that temporarily works around this issue and set the JwtToken on the HTTP request. You should be careful when you send the bot's JwtToken to a third party server and should always make sure to send it to trusted parties.

````JavaScript
function (session) {
Expand All @@ -28,9 +28,9 @@ function (session) {
if (msg.attachments.length) {

// Message with attachment, proceed to download it.
// Skype attachment URLs are secured by a JwtToken, so we need to pass the token from our bot.
// Skype & MS Teams attachment URLs are secured by a JwtToken, so we need to pass the token from our bot.
var attachment = msg.attachments[0];
var fileDownload = isSkypeMessage(msg)
var fileDownload = checkRequiresToken(msg)
? requestWithToken(attachment.contentUrl)
: request(attachment.contentUrl);

Expand Down Expand Up @@ -66,8 +66,8 @@ var requestWithToken = function (url) {
// Promise for obtaining JWT Token (requested once)
var obtainToken = Promise.promisify(connector.getAccessToken.bind(connector));

var isSkypeMessage = function (message) {
return message.source === 'skype';
var checkRequiresToken = function (message) {
return message.source === 'skype' || message.source === 'msteams';
};
````

Expand Down
8 changes: 4 additions & 4 deletions Node/core-ReceiveAttachment/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ var bot = new builder.UniversalBot(connector, function (session) {
if (msg.attachments.length) {

// Message with attachment, proceed to download it.
// Skype attachment URLs are secured by a JwtToken, so we need to pass the token from our bot.
// Skype & MS Teams attachment URLs are secured by a JwtToken, so we need to pass the token from our bot.
var attachment = msg.attachments[0];
var fileDownload = isSkypeMessage(msg)
var fileDownload = checkRequiresToken(msg)
? requestWithToken(attachment.contentUrl)
: request(attachment.contentUrl);

Expand Down Expand Up @@ -68,6 +68,6 @@ var requestWithToken = function (url) {
// Promise for obtaining JWT Token (requested once)
var obtainToken = Promise.promisify(connector.getAccessToken.bind(connector));

var isSkypeMessage = function (message) {
return message.source === 'skype';
var checkRequiresToken = function (message) {
return message.source === 'skype' || message.source === 'msteams';
};
1 change: 1 addition & 0 deletions Node/demo-ContosoFlowers/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -668,6 +668,7 @@ To get more information about how to get started in Bot Builder for Node review
> - GroupMe
>
> They are also supported, with some limitations, in the following channel:
> - Microsoft Teams (Receipt card not supported)
> - Email
>
> On the other hand, they are not supported and the sample won't work as expected in the following channels:
Expand Down
1 change: 1 addition & 0 deletions Node/demo-Search/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,7 @@ To get more information about how to get started in Bot Builder for Node please
> The features used in these samples are fully supported in the following channels:
> - Skype
> - Facebook
> - Microsoft Teams
> - Telegram
> - DirectLine
> - WebChat
Expand Down
1 change: 1 addition & 0 deletions Node/intelligence-LUIS/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,7 @@ To get more information about how to get started in Bot Builder for Node and LUI
> The features used in this sample are fully supported in the following channels:
> - Skype
> - Facebook
> - Microsoft Teams
> - DirectLine
> - WebChat
> - Slack
Expand Down