botbuilder-core
Advanced tools
Comparing version 4.1.3 to 4.1.5
@@ -44,3 +44,4 @@ /** | ||
*/ | ||
get(context: TurnContext, defaultValue?: T): Promise<T | undefined>; | ||
get(context: TurnContext): Promise<T | undefined>; | ||
get(context: TurnContext, defaultValue: T): Promise<T>; | ||
/** | ||
@@ -47,0 +48,0 @@ * Assigns a new value to the properties backing storage object. |
@@ -106,3 +106,3 @@ "use strict"; | ||
buttons: [ | ||
{ type: botframework_schema_1.ActionTypes.Signin, title: title, value: undefined } | ||
{ type: botframework_schema_1.ActionTypes.Signin, title: title, value: undefined, channelData: undefined } | ||
], | ||
@@ -134,3 +134,3 @@ connectionName: connectionName | ||
static signinCard(title, url, text) { | ||
const card = { buttons: [{ type: botframework_schema_1.ActionTypes.Signin, title: title, value: url }] }; | ||
const card = { buttons: [{ type: botframework_schema_1.ActionTypes.Signin, title: title, value: url, channelData: undefined }] }; | ||
if (text) { | ||
@@ -188,3 +188,3 @@ card.text = text; | ||
else { | ||
list.push({ type: botframework_schema_1.ActionTypes.ImBack, value: a.toString(), title: a.toString() }); | ||
list.push({ type: botframework_schema_1.ActionTypes.ImBack, value: a.toString(), title: a.toString(), channelData: undefined }); | ||
} | ||
@@ -191,0 +191,0 @@ }); |
@@ -108,4 +108,3 @@ "use strict"; | ||
cloneActivity(activity) { | ||
const emptyActivity = { type: '', serviceUrl: '', channelId: '', from: undefined, conversation: undefined, recipient: undefined, text: '', label: '', valueType: '' }; | ||
return Object.assign(emptyActivity, activity); | ||
return Object.assign({}, activity); | ||
} | ||
@@ -112,0 +111,0 @@ } |
@@ -5,3 +5,3 @@ { | ||
"description": "Core components for Microsoft Bot Builder. Components in this library can run either in a browser or on the server.", | ||
"version": "4.1.3", | ||
"version": "4.1.5", | ||
"license": "MIT", | ||
@@ -25,3 +25,3 @@ "keywords": [ | ||
"assert": "^1.4.1", | ||
"botframework-schema": "^4.1.3" | ||
"botframework-schema": "^4.1.5" | ||
}, | ||
@@ -28,0 +28,0 @@ "devDependencies": { |
@@ -46,3 +46,4 @@ /** | ||
*/ | ||
get(context: TurnContext, defaultValue?: T): Promise<T|undefined>; | ||
get(context: TurnContext): Promise<T|undefined>; | ||
get(context: TurnContext, defaultValue: T): Promise<T>; | ||
@@ -49,0 +50,0 @@ /** |
@@ -8,17 +8,3 @@ /** | ||
*/ | ||
import { | ||
ActionTypes, | ||
AnimationCard, | ||
Attachment, | ||
AudioCard, | ||
CardAction, | ||
CardImage, | ||
HeroCard, | ||
MediaUrl, | ||
OAuthCard, | ||
ReceiptCard, | ||
SigninCard, | ||
ThumbnailCard, | ||
VideoCard | ||
} from 'botframework-schema'; | ||
import { ActionTypes, AnimationCard, Attachment, AudioCard, CardAction, CardImage, HeroCard, MediaUrl, OAuthCard, ReceiptCard, SigninCard, ThumbnailCard, VideoCard } from 'botframework-schema'; | ||
@@ -109,6 +95,6 @@ /** | ||
public static animationCard( | ||
title: string, | ||
media: (MediaUrl|string)[], | ||
buttons?: (CardAction|string)[], | ||
other?: Partial<AnimationCard> | ||
title: string, | ||
media: (MediaUrl | string)[], | ||
buttons?: (CardAction | string)[], | ||
other?: Partial<AnimationCard> | ||
): Attachment { | ||
@@ -127,4 +113,4 @@ return mediaCard(CardFactory.contentTypes.animationCard, title, media, buttons, other); | ||
title: string, | ||
media: (MediaUrl|string)[], | ||
buttons?: (CardAction|string)[], | ||
media: (MediaUrl | string)[], | ||
buttons?: (CardAction | string)[], | ||
other?: Partial<AudioCard> | ||
@@ -157,4 +143,4 @@ ): Attachment { | ||
title: string, | ||
images?: (CardImage|string)[], | ||
buttons?: (CardAction|string)[], | ||
images?: (CardImage | string)[], | ||
buttons?: (CardAction | string)[], | ||
other?: Partial<HeroCard> | ||
@@ -165,4 +151,4 @@ ): Attachment; | ||
text: string, | ||
images?: (CardImage|string)[], | ||
buttons?: (CardAction|string)[], | ||
images?: (CardImage | string)[], | ||
buttons?: (CardAction | string)[], | ||
other?: Partial<HeroCard> | ||
@@ -193,3 +179,3 @@ ): Attachment; | ||
buttons: [ | ||
{ type: ActionTypes.Signin, title: title, value: undefined } | ||
{ type: ActionTypes.Signin, title: title, value: undefined, channelData: undefined } | ||
], | ||
@@ -222,3 +208,3 @@ connectionName: connectionName | ||
public static signinCard(title: string, url: string, text?: string): Attachment { | ||
const card: SigninCard = { buttons: [{ type: ActionTypes.Signin, title: title, value: url }] }; | ||
const card: SigninCard = { buttons: [{ type: ActionTypes.Signin, title: title, value: url, channelData: undefined }] }; | ||
if (text) { card.text = text; } | ||
@@ -245,4 +231,4 @@ | ||
title: string, | ||
images?: (CardImage|string)[], | ||
buttons?: (CardAction|string)[], | ||
images?: (CardImage | string)[], | ||
buttons?: (CardAction | string)[], | ||
other?: Partial<ThumbnailCard> | ||
@@ -253,4 +239,4 @@ ): Attachment; | ||
text: string, | ||
images?: (CardImage|string)[], | ||
buttons?: (CardAction|string)[], | ||
images?: (CardImage | string)[], | ||
buttons?: (CardAction | string)[], | ||
other?: Partial<ThumbnailCard> | ||
@@ -271,3 +257,3 @@ ): Attachment; | ||
} | ||
const card: Partial<ThumbnailCard> = {...other}; | ||
const card: Partial<ThumbnailCard> = { ...other }; | ||
if (title) { card.title = title; } | ||
@@ -290,4 +276,4 @@ if (text) { card.text = text; } | ||
title: string, | ||
media: (MediaUrl|string)[], | ||
buttons?: (CardAction|string)[], | ||
media: (MediaUrl | string)[], | ||
buttons?: (CardAction | string)[], | ||
other?: Partial<VideoCard> | ||
@@ -306,9 +292,9 @@ ): Attachment { | ||
*/ | ||
public static actions(actions: (CardAction|string)[]|undefined): CardAction[] { | ||
public static actions(actions: (CardAction | string)[] | undefined): CardAction[] { | ||
const list: CardAction[] = []; | ||
(actions || []).forEach((a: (CardAction|string)) => { | ||
(actions || []).forEach((a: (CardAction | string)) => { | ||
if (typeof a === 'object') { | ||
list.push(a); | ||
} else { | ||
list.push({ type: ActionTypes.ImBack, value: a.toString(), title: a.toString() }); | ||
list.push({ type: ActionTypes.ImBack, value: a.toString(), title: a.toString(), channelData: undefined }); | ||
} | ||
@@ -324,5 +310,5 @@ }); | ||
*/ | ||
public static images(images: (CardImage|string)[]|undefined): CardImage[] { | ||
public static images(images: (CardImage | string)[] | undefined): CardImage[] { | ||
const list: CardImage[] = []; | ||
(images || []).forEach((img: (CardImage|string)) => { | ||
(images || []).forEach((img: (CardImage | string)) => { | ||
if (typeof img === 'object') { | ||
@@ -342,5 +328,5 @@ list.push(img); | ||
*/ | ||
public static media(links: (MediaUrl|string)[]|undefined): MediaUrl[] { | ||
public static media(links: (MediaUrl | string)[] | undefined): MediaUrl[] { | ||
const list: MediaUrl[] = []; | ||
(links || []).forEach((lnk: (MediaUrl|string)) => { | ||
(links || []).forEach((lnk: (MediaUrl | string)) => { | ||
if (typeof lnk === 'object') { | ||
@@ -361,7 +347,7 @@ list.push(lnk); | ||
function mediaCard(contentType: string, | ||
title: string, | ||
media: (MediaUrl|string)[], | ||
buttons?: (CardAction|string)[], | ||
other?: any): Attachment { | ||
const card: VideoCard = {...other}; | ||
title: string, | ||
media: (MediaUrl | string)[], | ||
buttons?: (CardAction | string)[], | ||
other?: any): Attachment { | ||
const card: VideoCard = { ...other }; | ||
if (title) { card.title = title; } | ||
@@ -368,0 +354,0 @@ card.media = CardFactory.media(media); |
@@ -48,3 +48,3 @@ /** | ||
// hook up onSend pipeline | ||
context.onSendActivities(async (ctx: TurnContext, activities: Partial<Activity>[], next2: () => Promise<ResourceResponse[]>) => { | ||
context.onSendActivities(async (ctx: TurnContext, activities: Partial<Activity>[], next2: () => Promise<ResourceResponse[]>) => { | ||
// run full pipeline | ||
@@ -121,4 +121,3 @@ const responses: ResourceResponse[] = await next2(); | ||
private cloneActivity(activity: Partial<Activity>): Activity { | ||
const emptyActivity: Activity = {type: '', serviceUrl: '', channelId: '', from: undefined, conversation: undefined, recipient: undefined, text: '', label: '', valueType: ''}; | ||
return Object.assign(emptyActivity, activity); | ||
return Object.assign(<Activity>{}, activity); | ||
} | ||
@@ -125,0 +124,0 @@ } |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
481737
10373
Updatedbotframework-schema@^4.1.5