Skip to content

Commit 5ac06ee

Browse files
committed
updated LKG build for v3.5.0-rc7 release
1 parent 487b224 commit 5ac06ee

File tree

8 files changed

+340
-2
lines changed

8 files changed

+340
-2
lines changed

Node/core/lib/botbuilder.d.ts

Lines changed: 169 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1256,6 +1256,17 @@ export class Session {
12561256
*/
12571257
send(message: string|string[]|IMessage|IIsMessage, ...args: any[]): Session;
12581258

1259+
/**
1260+
* Sends a message to a user using a specific localization namespace.
1261+
* @param localizationNamespace Namespace to use for localizing the message.
1262+
* @param message
1263+
* * __message:__ _{string}_ - Text of the message to send. The message will be localized using the sessions configured localizer. If arguments are passed in the message will be formatted using [sprintf-js](https://github.com/alexei/sprintf.js).
1264+
* * __message:__ _{string[]}_ - The sent message will be chosen at random from the array.
1265+
* * __message:__ _{IMessage|IIsMessage}_ - Message to send.
1266+
* @param args (Optional) arguments used to format the final output text when __message__ is a _{string|string[]}_.
1267+
*/
1268+
sendLocalized(localizationNamespace: string, message: string|string[]|IMessage|IIsMessage, ...args: any[]): Session;
1269+
12591270
/**
12601271
* Sends the user an indication that the bot is typing. For long running operations this should be called every few seconds.
12611272
*/
@@ -1649,8 +1660,165 @@ export class ThumbnailCard implements IIsAttachment {
16491660
/** This action will be activated when user taps on the card. Not all channels support tap actions and some channels may choose to render the tap action as the titles link. */
16501661
tap(action: ICardAction|IIsCardAction): ThumbnailCard;
16511662

1652-
/** Returns the JSON for the card, */
1663+
/** Returns the JSON for the card */
1664+
toAttachment(): IAttachment;
1665+
}
1666+
1667+
1668+
/** Interface definition for a video card */
1669+
export interface IVideoCard extends IMediaCard {
1670+
1671+
/** Hint of the aspect ratio of the video or animation. (16:9)(4:3) */
1672+
aspect: string;
1673+
}
1674+
1675+
/** Interface definition for an audio card */
1676+
export interface IAudioCard extends IMediaCard {
1677+
}
1678+
1679+
/** Interface definition for an animation card */
1680+
export interface IAnimationCard extends IMediaCard {
1681+
1682+
/** Hint of the aspect ratio of the video or animation. (16:9)(4:3) */
1683+
aspect: string;
1684+
}
1685+
1686+
/** Interface definition of a generic MediaCard, which in its concrete form can be an Audio, Animation or Video card */
1687+
export interface IMediaCard {
1688+
1689+
/** Title of the Card */
1690+
title: string;
1691+
1692+
/** Subtitle appears just below Title field, differs from Title in font styling only */
1693+
subtitle: string;
1694+
1695+
/** Text field appears just below subtitle, differs from Subtitle in font styling only */
1696+
text: string;
1697+
1698+
/** Messaging supports all media formats: audio, video, images and thumbnails as well to optimize content download.*/
1699+
image: ICardImage;
1700+
1701+
/** Media source for video, audio or animations */
1702+
media: ICardMediaUrl[];
1703+
1704+
/** Set of actions applicable to the current card */
1705+
buttons?: ICardAction[];
1706+
1707+
/** Should the media source reproduction run in a loop */
1708+
autoloop: boolean;
1709+
1710+
/** Should the media start automatically */
1711+
autostart: boolean;
1712+
1713+
/** Should media be shareable */
1714+
shareable: boolean;
1715+
}
1716+
1717+
/** Url information describing media for a card */
1718+
export interface ICardMediaUrl {
1719+
1720+
/** Url to audio, video or animation media */
1721+
url: string;
1722+
1723+
/** Optional profile hint to the client to differentiate multiple MediaUrl objects from each other */
1724+
profile: string ;
1725+
}
1726+
1727+
/** Card builder class that simplifies building Video cards. */
1728+
export class VideoCard extends MediaCard implements IIsAttachment {
1729+
1730+
/**
1731+
* Creates a new VideoCard.
1732+
* @param session (Optional) will be used to localize any text.
1733+
*/
1734+
constructor(session?: Session);
1735+
aspect(text: string|string[], ...args: any[]): this;
1736+
}
1737+
1738+
/** Card builder class that simplifies building Animation cards. */
1739+
export class AnimationCard extends MediaCard implements IIsAttachment {
1740+
1741+
/**
1742+
* Creates a new AnimationCard.
1743+
* @param session (Optional) will be used to localize any text.
1744+
*/
1745+
constructor(session?: Session);
1746+
}
1747+
1748+
/** Card builder class that simplifies building Media cards. */
1749+
export class AudioCard extends MediaCard implements IIsAttachment{
1750+
1751+
/**
1752+
* Creates a new Audio.
1753+
* @param session (Optional) will be used to localize any text.
1754+
*/
1755+
constructor(session?: Session);
1756+
}
1757+
1758+
/** Card builder class that simplifies building Media cards. */
1759+
export class MediaCard implements IIsAttachment{
1760+
1761+
/**
1762+
* Creates a new MediaCard.
1763+
* @param session (Optional) will be used to localize any text.
1764+
*/
1765+
constructor(session?: Session);
1766+
1767+
/** Title of the Card */
1768+
title(text: string|string[], ...args: any[]): this;
1769+
1770+
/** Subtitle appears just below Title field, differs from Title in font styling only */
1771+
subtitle(text: string|string[], ...args: any[]): this;
1772+
1773+
/** Text field appears just below subtitle, differs from Subtitle in font styling only */
1774+
text(text: string|string[], ...args: any[]): this;
1775+
1776+
/** Messaging supports all media formats: audio, video, images and thumbnails as well to optimize content download.*/
1777+
image(image: ICardImage|IIsCardImage): this;
1778+
1779+
/** Media source for video, audio or animations */
1780+
media(list: ICardMediaUrl[]): this;
1781+
1782+
/** Returns the JSON for the card*/
16531783
toAttachment(): IAttachment;
1784+
1785+
/** Should the media source reproduction run in a loop */
1786+
autoloop(choice: boolean): this;
1787+
1788+
/** Should the media start automatically */
1789+
autostart(choice: boolean): this;
1790+
1791+
/** Should media be shareable */
1792+
shareable(choice: boolean): this;
1793+
}
1794+
1795+
/** Entities that can be converted to Media for cards */
1796+
export interface IIsCardMedia{
1797+
1798+
/** Returns the url definition for a Media entity for a card */
1799+
toMedia(): ICardMediaUrl;
1800+
}
1801+
1802+
/** Definition of a media entity for a card */
1803+
export class CardMedia implements IIsCardMedia{
1804+
1805+
/**
1806+
* Creates a new CardMedia, which defines a media entity for a card.
1807+
* @param session (Optional) will be used to localize any text.
1808+
*/
1809+
constructor(session?: Session);
1810+
1811+
/** Url of the media */
1812+
url(u: string): this;
1813+
1814+
/** Optional profile hint to the client to differentiate multiple MediaUrl objects from each other */
1815+
profile(text: string): this;
1816+
1817+
/** Returns the url definition for a Media entity for a card */
1818+
toMedia(): ICardMediaUrl;
1819+
1820+
/** Factory method for creation of Card media entities */
1821+
static create(session: Session, url: string): CardMedia;
16541822
}
16551823

16561824
/** Card builder class that simplifies building hero cards. Hero cards contain the same information as a thumbnail card, just with a larger more pronounced layout for the cards images. */

Node/core/lib/botbuilder.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,11 @@ var CardImage = require('./cards/CardImage');
1717
var ReceiptCard = require('./cards/ReceiptCard');
1818
var SigninCard = require('./cards/SigninCard');
1919
var ThumbnailCard = require('./cards/ThumbnailCard');
20+
var VideoCard = require('./cards/VideoCard');
21+
var AudioCard = require('./cards/AudioCard');
22+
var AnimationCard = require('./cards/AnimationCard');
23+
var MediaCard = require('./cards/MediaCard');
24+
var CardMedia = require('./cards/CardMedia');
2025
var Keyboard = require('./cards/Keyboard');
2126
var Middleware = require('./middleware/Middleware');
2227
var IntentRecognizerSet = require('./dialogs/IntentRecognizerSet');
@@ -29,6 +34,11 @@ exports.AttachmentLayout = Message.AttachmentLayout;
2934
exports.TextFormat = Message.TextFormat;
3035
exports.CardAction = CardAction.CardAction;
3136
exports.HeroCard = HeroCard.HeroCard;
37+
exports.VideoCard = VideoCard.VideoCard;
38+
exports.AudioCard = AudioCard.AudioCard;
39+
exports.AnimationCard = AnimationCard.AnimationCard;
40+
exports.MediaCard = MediaCard.MediaCard;
41+
exports.CardMedia = CardMedia.CardMedia;
3242
exports.CardImage = CardImage.CardImage;
3343
exports.ReceiptCard = ReceiptCard.ReceiptCard;
3444
exports.ReceiptItem = ReceiptCard.ReceiptItem;

Node/core/lib/cards/AnimationCard.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
"use strict";
2+
var __extends = (this && this.__extends) || function (d, b) {
3+
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
4+
function __() { this.constructor = d; }
5+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
6+
};
7+
var MediaCard_1 = require('./MediaCard');
8+
var AnimationCard = (function (_super) {
9+
__extends(AnimationCard, _super);
10+
function AnimationCard(session) {
11+
_super.call(this, session);
12+
this.data.contentType = 'application/vnd.microsoft.card.animation';
13+
}
14+
return AnimationCard;
15+
}(MediaCard_1.MediaCard));
16+
exports.AnimationCard = AnimationCard;

Node/core/lib/cards/AudioCard.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
"use strict";
2+
var __extends = (this && this.__extends) || function (d, b) {
3+
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
4+
function __() { this.constructor = d; }
5+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
6+
};
7+
var MediaCard_1 = require('./MediaCard');
8+
var AudioCard = (function (_super) {
9+
__extends(AudioCard, _super);
10+
function AudioCard(session) {
11+
_super.call(this, session);
12+
this.data.contentType = 'application/vnd.microsoft.card.audio';
13+
}
14+
return AudioCard;
15+
}(MediaCard_1.MediaCard));
16+
exports.AudioCard = AudioCard;

Node/core/lib/cards/CardMedia.js

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
"use strict";
2+
var CardMedia = (function () {
3+
function CardMedia(session) {
4+
this.session = session;
5+
this.data = {};
6+
}
7+
CardMedia.prototype.url = function (u) {
8+
if (u) {
9+
this.data.url = u;
10+
}
11+
return this;
12+
};
13+
CardMedia.prototype.profile = function (text) {
14+
if (text) {
15+
this.data.profile = text;
16+
}
17+
return this;
18+
};
19+
CardMedia.prototype.toMedia = function () {
20+
return this.data;
21+
};
22+
CardMedia.create = function (session, url) {
23+
return new CardMedia(session).url(url);
24+
};
25+
return CardMedia;
26+
}());
27+
exports.CardMedia = CardMedia;

Node/core/lib/cards/MediaCard.js

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
"use strict";
2+
var __extends = (this && this.__extends) || function (d, b) {
3+
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
4+
function __() { this.constructor = d; }
5+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
6+
};
7+
var Message_1 = require('../Message');
8+
var Keyboard_1 = require('./Keyboard');
9+
var MediaCard = (function (_super) {
10+
__extends(MediaCard, _super);
11+
function MediaCard(session) {
12+
_super.call(this, session);
13+
}
14+
MediaCard.prototype.title = function (text) {
15+
var args = [];
16+
for (var _i = 1; _i < arguments.length; _i++) {
17+
args[_i - 1] = arguments[_i];
18+
}
19+
if (text) {
20+
this.data.content.title = Message_1.fmtText(this.session, text, args);
21+
}
22+
return this;
23+
};
24+
MediaCard.prototype.subtitle = function (text) {
25+
var args = [];
26+
for (var _i = 1; _i < arguments.length; _i++) {
27+
args[_i - 1] = arguments[_i];
28+
}
29+
if (text) {
30+
this.data.content.subtitle = Message_1.fmtText(this.session, text, args);
31+
}
32+
return this;
33+
};
34+
MediaCard.prototype.text = function (text) {
35+
var args = [];
36+
for (var _i = 1; _i < arguments.length; _i++) {
37+
args[_i - 1] = arguments[_i];
38+
}
39+
if (text) {
40+
this.data.content.text = Message_1.fmtText(this.session, text, args);
41+
}
42+
return this;
43+
};
44+
MediaCard.prototype.autoloop = function (choice) {
45+
this.data.content.autoloop = choice;
46+
return this;
47+
};
48+
MediaCard.prototype.autostart = function (choice) {
49+
this.data.content.autostart = choice;
50+
return this;
51+
};
52+
MediaCard.prototype.shareable = function (choice) {
53+
this.data.content.shareable = choice;
54+
return this;
55+
};
56+
MediaCard.prototype.image = function (image) {
57+
if (image) {
58+
this.data.content.image = image.toImage ? image.toImage() : image;
59+
}
60+
return this;
61+
};
62+
MediaCard.prototype.media = function (list) {
63+
this.data.content.media = [];
64+
if (list) {
65+
for (var i = 0; i < list.length; i++) {
66+
var media = list[i];
67+
this.data.content.media.push(media.toMedia ? media.toMedia() : media);
68+
}
69+
}
70+
return this;
71+
};
72+
return MediaCard;
73+
}(Keyboard_1.Keyboard));
74+
exports.MediaCard = MediaCard;

Node/core/lib/cards/VideoCard.js

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
"use strict";
2+
var __extends = (this && this.__extends) || function (d, b) {
3+
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
4+
function __() { this.constructor = d; }
5+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
6+
};
7+
var Message_1 = require('../Message');
8+
var MediaCard_1 = require('./MediaCard');
9+
var VideoCard = (function (_super) {
10+
__extends(VideoCard, _super);
11+
function VideoCard(session) {
12+
_super.call(this, session);
13+
this.data.contentType = 'application/vnd.microsoft.card.video';
14+
}
15+
VideoCard.prototype.aspect = function (text) {
16+
var args = [];
17+
for (var _i = 1; _i < arguments.length; _i++) {
18+
args[_i - 1] = arguments[_i];
19+
}
20+
if (text) {
21+
this.data.content.aspect = Message_1.fmtText(this.session, text, args);
22+
}
23+
return this;
24+
};
25+
return VideoCard;
26+
}(MediaCard_1.MediaCard));
27+
exports.VideoCard = VideoCard;

Node/core/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "botbuilder",
33
"author": "Microsoft Corp.",
44
"description": "Bot Builder is a dialog system for building rich bots on virtually any platform.",
5-
"version": "3.5.0-rc6",
5+
"version": "3.5.0-rc7",
66
"license": "MIT",
77
"keywords": [
88
"botbuilder",

0 commit comments

Comments
 (0)