Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
## [Unreleased]

- Added `messageBack` to `CardActionTypes` and updated `CardAction` fields, by [@corinagum](https://github.com/corinagum), in PR [#138](https://github.com/Microsoft/BotFramework-DirectLineJS/pull/138)
- Expand `CardAction`s with specific types, by [@corinagum](https://github.com/corinagum), in PR [#141](https://github.com/Microsoft/BotFramework-DirectLineJS/pull/141)

## [0.10.1] - 2018-12-21
### Changed
Expand Down
28 changes: 21 additions & 7 deletions package-lock.json

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

77 changes: 71 additions & 6 deletions src/directLine.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,28 +51,93 @@ export interface UnknownMedia{
thumbnailUrl?: string
}

export type CardActionTypes = "call" | "downloadFile" | "imBack" | "messageBack" | "openUrl" | "playAudio" | "playVideo" | "postBack" | "signin" | "showImage";
export type CardActionTypes = "call" | "downloadFile"| "imBack" | "messageBack" | "openUrl" | "playAudio" | "playVideo" | "postBack" | "signin" | "showImage";

export type CardAction = CardActionWithImage | CardActionWithTitle;
export type CardAction = CallCardAction | DownloadFileCardAction | IMBackCardAction | MessageBackCardAction | OpenURLCardAction | PlayAudioCardAction | PlayVideoCardAction | PostBackCardAction | SignInCardAction | ShowImageCardAction;

export interface CardActionWithImage {
export interface CallCardAction {
image?: string,
title: string,
type: "call",
value: any
}

export interface DownloadFileCardAction {
image?: string,
title: string,
type: "downloadFile",
value: any
}

export interface IMBackCardAction {
image?: string,
title?: string,
type: "imBack",
value: string
}

export type MessageBackCardAction = MessageBackWithImage | MessageBackWithTitle

export interface MessageBackWithImage {
displayText?: string,
image: string,
text?: string,
title?: string,
type: CardActionTypes,
type: "messageBack",
value?: any
}

export interface CardActionWithTitle {
export interface MessageBackWithTitle {
displayText?: string,
image?: string,
text?: string,
title: string,
type: CardActionTypes,
type: "messageBack",
value?: any
}

export interface OpenURLCardAction {
image?: string,
title: string,
type: "openUrl",
value: any
}

export interface PlayAudioCardAction {
image?: string,
title: string,
type: "playAudio",
value: any
}

export interface PlayVideoCardAction {
image?: string,
title: string,
type: "playVideo",
value: any
}

export interface PostBackCardAction {
image?: string,
title?: string,
type: "postBack",
value: any
}

export interface ShowImageCardAction {
image?: string,
title: string,
type: "showImage",
value: any
}

export interface SignInCardAction {
image?: string,
title: string,
type: "signin",
value: any
}

export interface CardImage {
alt?: string,
url: string,
Expand Down