botfriends-handover-nodejs
Version:
NodeJs wrapper for BOTfriends Handover Tool
65 lines (56 loc) • 1.29 kB
text/typescript
export interface ISdk {
sendMessage (userId: string, message: any): Promise<IResult>
sendFile (userId: string, file: any, type: string): Promise<IResult>
sendCarousel (userId: string, carousel: any): Promise<IResult>
sendLocation (userId: string, location: any): Promise<IResult>
getOnlineAgents (): Promise<IResult>,
getHandoverStatus (userId: string): Promise<IResult>,
startHandover (userId: string): Promise<IResult>
}
export interface IResult {
success: boolean
data?: Promise<any>
message?: string
}
export interface IData {
userId: string
message: IMessage
}
export interface INlpData {
userQuery: string
detectedIntent: string
confidenceScore: number
}
export interface IMessage {
role: string
type: string
text?: string
source?: string
actions?: Array<string>
mediaUrl?: string
mediaType?: string
coordinates?: ICoordinates
items?: Array<IItem>
nlpData?: INlpData
}
export interface IAction {
text: string
type: string
uri?: string
payload?: string
metadata?: IMetadata
}
export interface IMetadata {
buttonIntent: string
}
export interface ICoordinates {
lat: number
long: number
}
export interface IItem {
title: string
description?: string
mediaUrl?: string
actions: Array<IAction>
size?: number
}