-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Align Conversation SDK with documentation
- Loading branch information
1 parent
32bf1a7
commit bdcbccd
Showing
36 changed files
with
280 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
...sation/src/models/v1/channel-specific-contact-message/channel-specific-contact-message.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import { WhatsAppInteractiveNfmReply } from '../whatsapp-interactive-nfm-reply'; | ||
|
||
/** | ||
* A contact message containing a channel specific message (not supported by OMNI types). | ||
*/ | ||
export interface ChannelSpecificContactMessage { | ||
/** The message type. */ | ||
message_type: 'nfm_reply'; | ||
/** @see WhatsAppInteractiveNfmReplyMessage */ | ||
message: WhatsAppInteractiveNfmReplyMessage; | ||
} | ||
|
||
/** | ||
* A WhatsApp interactive contact message containing the nfm_reply. | ||
*/ | ||
interface WhatsAppInteractiveNfmReplyMessage { | ||
/** The interactive message type. */ | ||
type: string; | ||
/** @see WhatsAppInteractiveNfmReply */ | ||
nfm_reply: WhatsAppInteractiveNfmReply; | ||
} |
1 change: 1 addition & 0 deletions
1
packages/conversation/src/models/v1/channel-specific-contact-message/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export type { ChannelSpecificContactMessage } from './channel-specific-contact-message'; |
11 changes: 11 additions & 0 deletions
11
packages/conversation/src/models/v1/channel-specific-message/channel-specific-message.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { FlowChannelSpecificMessage } from '../flow-channel-specific-message'; | ||
|
||
/** | ||
* A message containing a channel specific message (not supported by OMNI types). | ||
*/ | ||
export interface ChannelSpecificMessage { | ||
/** @see MessageTypeEnum */ | ||
message_type: 'FLOWS'; | ||
/** @see FlowChannelSpecificMessage */ | ||
message: FlowChannelSpecificMessage; | ||
} |
1 change: 1 addition & 0 deletions
1
packages/conversation/src/models/v1/channel-specific-message/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export type { ChannelSpecificMessage } from './channel-specific-message'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
44 changes: 44 additions & 0 deletions
44
...conversation/src/models/v1/flow-channel-specific-message/flow-channel-specific-message.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
import { WhatsAppInteractiveBody } from '../whatsapp-interactive-body'; | ||
import { WhatsAppInteractiveFooter } from '../whatsapp-interactive-footer'; | ||
import { WhatsAppInteractiveTextHeader } from '../whatsapp-interactive-text-header'; | ||
import { WhatsAppInteractiveImageHeader } from '../whatsapp-interactive-image-header'; | ||
import { WhatsAppInteractiveDocumentHeader } from '../whatsapp-interactive-document-header'; | ||
import { WhatsAppInteractiveVideoHeader } from '../whatsapp-interactive-video-header'; | ||
|
||
/** | ||
* A message type for sending WhatsApp Flows. | ||
*/ | ||
export interface FlowChannelSpecificMessage { | ||
|
||
/** @see FlowChannelSpecificMessageHeader */ | ||
header?: FlowChannelSpecificMessageHeader; | ||
/** @see WhatsAppInteractiveBody */ | ||
body?: WhatsAppInteractiveBody; | ||
/** @see WhatsAppInteractiveFooter */ | ||
footer?: WhatsAppInteractiveFooter; | ||
/** ID of the Flow. */ | ||
flow_id: string; | ||
/** Generated token which is an identifier. */ | ||
flow_token?: string; | ||
/** The mode in which the flow is. */ | ||
flow_mode?: 'draft' | 'published'; | ||
/** Text which is displayed on the Call To Action button (20 characters maximum, emoji not supported). */ | ||
flow_cta: string; | ||
/** */ | ||
flow_action?: 'navigate' | 'data_exchange'; | ||
/** @see FlowChannelSpecificMessageFlowActionPayload */ | ||
flow_action_payload?: FlowChannelSpecificMessageFlowActionPayload; | ||
} | ||
|
||
type FlowChannelSpecificMessageHeader = | ||
WhatsAppInteractiveTextHeader | ||
| WhatsAppInteractiveImageHeader | ||
| WhatsAppInteractiveDocumentHeader | ||
| WhatsAppInteractiveVideoHeader; | ||
|
||
interface FlowChannelSpecificMessageFlowActionPayload { | ||
/** The ID of the screen displayed first. This must be an entry screen. */ | ||
screen?: string; | ||
/** Data for the first screen. */ | ||
data?: object; | ||
} |
1 change: 1 addition & 0 deletions
1
packages/conversation/src/models/v1/flow-channel-specific-message/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export type { FlowChannelSpecificMessage } from './flow-channel-specific-message'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export type { ProductItem } from './product-item'; |
15 changes: 15 additions & 0 deletions
15
packages/conversation/src/models/v1/product-item/product-item.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
/** | ||
* A message component for interactive messages, containing a product. | ||
*/ | ||
export interface ProductItem { | ||
/** Required parameter. The ID for the product. */ | ||
id: string; | ||
/** Required parameter. The marketplace to which the product belongs. */ | ||
marketplace: string; | ||
/** Output only. The quantity of the chosen product. */ | ||
quantity?: number; | ||
/** Output only. The price for one unit of the chosen product. */ | ||
item_price?: number; | ||
/** Output only. The currency of the item_price. */ | ||
currency?: string; | ||
} |
1 change: 1 addition & 0 deletions
1
packages/conversation/src/models/v1/product-response-message/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export type { ProductResponseMessage } from './product-response-message'; |
13 changes: 13 additions & 0 deletions
13
packages/conversation/src/models/v1/product-response-message/product-response-message.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import { ProductItem } from '../product-item'; | ||
|
||
/** | ||
* Represents an interactive WhatsApp message containing ProductItem objects | ||
*/ | ||
export interface ProductResponseMessage { | ||
/** The selected products. */ | ||
products: ProductItem[]; | ||
/** Optional parameter. Text that may be sent with selected products. */ | ||
text?: string; | ||
/** Optional parameter. The catalog id that the selected products belong to. */ | ||
catalog_id?: string; | ||
} |
1 change: 1 addition & 0 deletions
1
packages/conversation/src/models/v1/whatsapp-interactive-body/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export type { WhatsAppInteractiveBody } from './whatsapp-interactive-body'; |
7 changes: 7 additions & 0 deletions
7
packages/conversation/src/models/v1/whatsapp-interactive-body/whatsapp-interactive-body.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
/** | ||
* Body of the interactive message. | ||
*/ | ||
export interface WhatsAppInteractiveBody { | ||
/** The content of the message (1024 characters maximum). Emojis and Markdown are supported. */ | ||
text: string; | ||
} |
1 change: 1 addition & 0 deletions
1
packages/conversation/src/models/v1/whatsapp-interactive-document-header/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export type { WhatsAppInteractiveDocumentHeader } from './whatsapp-interactive-document-header'; |
11 changes: 11 additions & 0 deletions
11
...rc/models/v1/whatsapp-interactive-document-header/whatsapp-interactive-document-header.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { WhatsAppInteractiveHeaderMedia } from '../whatsapp-interactive-header-media'; | ||
|
||
/** | ||
* Header of the interactive message with document. | ||
*/ | ||
export interface WhatsAppInteractiveDocumentHeader { | ||
/** Must be set to document. */ | ||
type: 'document'; | ||
/** @see WhatsAppInteractiveHeaderMedia */ | ||
document: WhatsAppInteractiveHeaderMedia; | ||
} |
1 change: 1 addition & 0 deletions
1
packages/conversation/src/models/v1/whatsapp-interactive-footer/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export type { WhatsAppInteractiveFooter } from './whatsapp-interactive-footer'; |
7 changes: 7 additions & 0 deletions
7
...ges/conversation/src/models/v1/whatsapp-interactive-footer/whatsapp-interactive-footer.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
/** | ||
* Footer of the interactive message. | ||
*/ | ||
export interface WhatsAppInteractiveFooter { | ||
/** The footer content (60 characters maximum). Emojis, Markdown and links are supported. */ | ||
text: string; | ||
} |
1 change: 1 addition & 0 deletions
1
packages/conversation/src/models/v1/whatsapp-interactive-header-media/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export type { WhatsAppInteractiveHeaderMedia } from './whatsapp-interactive-header-media'; |
Oops, something went wrong.