Skip to content

Commit 16f4782

Browse files
authored
Merge pull request #601 from Microsoft/tomlm/swagger0718
Update swagger to 10/30 snapshot
2 parents 68075b6 + ee4ea9d commit 16f4782

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+15272
-15218
lines changed

libraries/botbuilder-core/src/cardFactory.ts

Lines changed: 32 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -5,21 +5,7 @@
55
* Copyright (c) Microsoft Corporation. All rights reserved.
66
* Licensed under the MIT License.
77
*/
8-
import {
9-
ActionTypes,
10-
AnimationCard,
11-
Attachment,
12-
AudioCard,
13-
CardAction,
14-
CardImage,
15-
HeroCard,
16-
MediaUrl,
17-
OAuthCard,
18-
ReceiptCard,
19-
SigninCard,
20-
ThumbnailCard,
21-
VideoCard
22-
} from 'botframework-schema';
8+
import { ActionTypes, AnimationCard, Attachment, AudioCard, CardAction, CardImage, HeroCard, MediaUrl, OAuthCard, ReceiptCard, SigninCard, ThumbnailCard, VideoCard } from 'botframework-schema';
239

2410
/**
2511
* A set of utility functions designed to assist with the formatting of the various card types a
@@ -105,10 +91,10 @@ export class CardFactory {
10591
* @param other (Optional) additional properties to include on the card.
10692
*/
10793
public static animationCard(
108-
title: string,
109-
media: (MediaUrl|string)[],
110-
buttons?: (CardAction|string)[],
111-
other?: Partial<AnimationCard>
94+
title: string,
95+
media: (MediaUrl | string)[],
96+
buttons?: (CardAction | string)[],
97+
other?: Partial<AnimationCard>
11298
): Attachment {
11399
return mediaCard(CardFactory.contentTypes.animationCard, title, media, buttons, other);
114100
}
@@ -122,8 +108,8 @@ export class CardFactory {
122108
*/
123109
public static audioCard(
124110
title: string,
125-
media: (MediaUrl|string)[],
126-
buttons?: (CardAction|string)[],
111+
media: (MediaUrl | string)[],
112+
buttons?: (CardAction | string)[],
127113
other?: Partial<AudioCard>
128114
): Attachment {
129115
return mediaCard(CardFactory.contentTypes.audioCard, title, media, buttons, other);
@@ -151,15 +137,15 @@ export class CardFactory {
151137
*/
152138
public static heroCard(
153139
title: string,
154-
images?: (CardImage|string)[],
155-
buttons?: (CardAction|string)[],
140+
images?: (CardImage | string)[],
141+
buttons?: (CardAction | string)[],
156142
other?: Partial<HeroCard>
157143
): Attachment;
158144
public static heroCard(
159145
title: string,
160146
text: string,
161-
images?: (CardImage|string)[],
162-
buttons?: (CardAction|string)[],
147+
images?: (CardImage | string)[],
148+
buttons?: (CardAction | string)[],
163149
other?: Partial<HeroCard>
164150
): Attachment;
165151
public static heroCard(
@@ -185,7 +171,7 @@ export class CardFactory {
185171
public static oauthCard(connectionName: string, title: string, text?: string): Attachment {
186172
const card: Partial<OAuthCard> = {
187173
buttons: [
188-
{ type: ActionTypes.Signin, title: title, value: undefined }
174+
{ type: ActionTypes.Signin, title: title, value: undefined, channelData: undefined }
189175
],
190176
connectionName: connectionName
191177
};
@@ -213,7 +199,7 @@ export class CardFactory {
213199
* @param text (Optional) additional text to include on the card.
214200
*/
215201
public static signinCard(title: string, url: string, text?: string): Attachment {
216-
const card: SigninCard = { buttons: [{ type: ActionTypes.Signin, title: title, value: url }] };
202+
const card: SigninCard = { buttons: [{ type: ActionTypes.Signin, title: title, value: url, channelData: undefined }] };
217203
if (text) { card.text = text; }
218204

219205
return { contentType: CardFactory.contentTypes.signinCard, content: card };
@@ -235,15 +221,15 @@ export class CardFactory {
235221
*/
236222
public static thumbnailCard(
237223
title: string,
238-
images?: (CardImage|string)[],
239-
buttons?: (CardAction|string)[],
224+
images?: (CardImage | string)[],
225+
buttons?: (CardAction | string)[],
240226
other?: Partial<ThumbnailCard>
241227
): Attachment;
242228
public static thumbnailCard(
243229
title: string,
244230
text: string,
245-
images?: (CardImage|string)[],
246-
buttons?: (CardAction|string)[],
231+
images?: (CardImage | string)[],
232+
buttons?: (CardAction | string)[],
247233
other?: Partial<ThumbnailCard>
248234
): Attachment;
249235
public static thumbnailCard(
@@ -259,7 +245,7 @@ export class CardFactory {
259245
images = text;
260246
text = undefined;
261247
}
262-
const card: Partial<ThumbnailCard> = {...other};
248+
const card: Partial<ThumbnailCard> = { ...other };
263249
if (title) { card.title = title; }
264250
if (text) { card.text = text; }
265251
if (images) { card.images = CardFactory.images(images); }
@@ -277,8 +263,8 @@ export class CardFactory {
277263
*/
278264
public static videoCard(
279265
title: string,
280-
media: (MediaUrl|string)[],
281-
buttons?: (CardAction|string)[],
266+
media: (MediaUrl | string)[],
267+
buttons?: (CardAction | string)[],
282268
other?: Partial<VideoCard>
283269
): Attachment {
284270
return mediaCard(CardFactory.contentTypes.videoCard, title, media, buttons, other);
@@ -292,13 +278,13 @@ export class CardFactory {
292278
* 'messageBack' doesn't work properly in emulator.)
293279
* @param actions Array of card actions or strings. Strings will be converted to `messageBack` actions.
294280
*/
295-
public static actions(actions: (CardAction|string)[]|undefined): CardAction[] {
281+
public static actions(actions: (CardAction | string)[] | undefined): CardAction[] {
296282
const list: CardAction[] = [];
297-
(actions || []).forEach((a: (CardAction|string)) => {
283+
(actions || []).forEach((a: (CardAction | string)) => {
298284
if (typeof a === 'object') {
299285
list.push(a);
300286
} else {
301-
list.push({ type: ActionTypes.ImBack, value: a.toString(), title: a.toString() });
287+
list.push({ type: ActionTypes.ImBack, value: a.toString(), title: a.toString(), channelData: undefined });
302288
}
303289
});
304290

@@ -309,9 +295,9 @@ export class CardFactory {
309295
* Returns a properly formatted array of card images.
310296
* @param images Array of card images or strings. Strings will be converted to card images.
311297
*/
312-
public static images(images: (CardImage|string)[]|undefined): CardImage[] {
298+
public static images(images: (CardImage | string)[] | undefined): CardImage[] {
313299
const list: CardImage[] = [];
314-
(images || []).forEach((img: (CardImage|string)) => {
300+
(images || []).forEach((img: (CardImage | string)) => {
315301
if (typeof img === 'object') {
316302
list.push(img);
317303
} else {
@@ -326,9 +312,9 @@ export class CardFactory {
326312
* Returns a properly formatted array of media url objects.
327313
* @param links Array of media url objects or strings. Strings will be converted to a media url object.
328314
*/
329-
public static media(links: (MediaUrl|string)[]|undefined): MediaUrl[] {
315+
public static media(links: (MediaUrl | string)[] | undefined): MediaUrl[] {
330316
const list: MediaUrl[] = [];
331-
(links || []).forEach((lnk: (MediaUrl|string)) => {
317+
(links || []).forEach((lnk: (MediaUrl | string)) => {
332318
if (typeof lnk === 'object') {
333319
list.push(lnk);
334320
} else {
@@ -344,11 +330,11 @@ export class CardFactory {
344330
* @private
345331
*/
346332
function mediaCard(contentType: string,
347-
title: string,
348-
media: (MediaUrl|string)[],
349-
buttons?: (CardAction|string)[],
350-
other?: any): Attachment {
351-
const card: VideoCard = {...other};
333+
title: string,
334+
media: (MediaUrl | string)[],
335+
buttons?: (CardAction | string)[],
336+
other?: any): Attachment {
337+
const card: VideoCard = { ...other };
352338
if (title) { card.title = title; }
353339
card.media = CardFactory.media(media);
354340
if (buttons) { card.buttons = CardFactory.actions(buttons); }

libraries/botbuilder-core/src/transcriptLogger.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ export class TranscriptLoggerMiddleware implements Middleware {
4545
}
4646

4747
// hook up onSend pipeline
48-
context.onSendActivities(async (ctx: TurnContext, activities: Partial<Activity>[], next2: () => Promise<ResourceResponse[]>) => {
48+
context.onSendActivities(async (ctx: TurnContext, activities: Partial<Activity>[], next2: () => Promise<ResourceResponse[]>) => {
4949
// run full pipeline
5050
const responses: ResourceResponse[] = await next2();
5151
activities.forEach((a: ResourceResponse) => this.logActivity(this.cloneActivity(a)));
@@ -117,8 +117,7 @@ export class TranscriptLoggerMiddleware implements Middleware {
117117
* @param activity Activity to clone.
118118
*/
119119
private cloneActivity(activity: Partial<Activity>): Activity {
120-
const emptyActivity: Activity = {type: '', serviceUrl: '', channelId: '', from: undefined, conversation: undefined, recipient: undefined, text: '', label: '', valueType: ''};
121-
return Object.assign(emptyActivity, activity);
120+
return Object.assign(<Activity>{}, activity);
122121
}
123122
}
124123

libraries/botbuilder-dialogs/src/choices/choiceFactory.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ export class ChoiceFactory {
227227
if (choice.action) {
228228
return choice.action;
229229
} else {
230-
return { type: ActionTypes.ImBack, value: choice.value, title: choice.value };
230+
return { type: ActionTypes.ImBack, value: choice.value, title: choice.value, channelData: undefined };
231231
}
232232
});
233233

0 commit comments

Comments
 (0)