Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Client

Main client class

Hierarchy

Index

Constructors

constructor

Properties

Private httpApi

httpApi: HttpApi

loggedIn

loggedIn: boolean = false

Private mqttApi

mqttApi: MqttApi

Private options

options: ClientOptions

Private seqId

seqId: string = ""

Private session

session: Session | null

Methods

Private connectQueue

  • connectQueue(seqId: any): Promise<void>
  • Parameters

    • seqId: any

    Returns Promise<void>

Private createQueue

  • createQueue(seqId: number): Promise<void>
  • Parameters

    • seqId: number

    Returns Promise<void>

Private doLogin

  • doLogin(login: string, password: string): Promise<Object>
  • Parameters

    • login: string
    • password: string

    Returns Promise<Object>

getAttachmentInfo

  • getAttachmentInfo(messageId: string, attachmentId: string): Promise<any>
  • Parameters

    • messageId: string
    • attachmentId: string

    Returns Promise<any>

getAttachmentURL

  • getAttachmentURL(messageId: string, attachmentId: string): Promise<string>
  • Parameters

    • messageId: string
    • attachmentId: string

    Returns Promise<string>

getMessages

  • getMessages(threadId: string, count: number): Promise<Message>
  • Parameters

    • threadId: string
    • count: number

    Returns Promise<Message>

getSession

getStickerURL

  • getStickerURL(stickerId: number): Promise<string>
  • Parameters

    • stickerId: number

    Returns Promise<string>

getThreadInfo

  • getThreadInfo(threadId: string): Promise<Thread>

getThreadList

  • getThreadList(count: number): Promise<Thread[]>

getUserInfo

  • getUserInfo(userId: string): Promise<User>

Private handleMS

  • handleMS(ms: string): Promise<void>
  • Parameters

    • ms: string

    Returns Promise<void>

Private handleMessage

  • handleMessage(event: any): void

login

  • login(email: string, password: string): Promise<void>
  • Parameters

    • email: string
    • password: string

    Returns Promise<void>

sendAttachmentFile

  • sendAttachmentFile(threadId: string, attachmentPath: string, extension?: string): Promise<any>
  • Parameters

    • threadId: string
    • attachmentPath: string
    • Optional extension: string

    Returns Promise<any>

sendAttachmentStream

  • sendAttachmentStream(threadId: string, extension: string, attachment: Readable): Promise<any>
  • Parameters

    • threadId: string
    • extension: string
    • attachment: Readable

    Returns Promise<any>

sendMessage

  • sendMessage(threadId: string, message: string, options?: MessageOptions): Promise<object>
  • Parameters

    • threadId: string
    • message: string
    • Optional options: MessageOptions

    Returns Promise<object>

sendPresenceState

  • sendPresenceState(recipientUserId: string, present: boolean): Promise<void>
  • Indicate that the user is currently present in the conversation. Only relevant for non-group conversations

    Parameters

    • recipientUserId: string
    • present: boolean

    Returns Promise<void>

sendReadReceipt

  • sendReadReceipt(message: Message): Promise<void>
  • Mark a message as read.

    Parameters

    • message: Message

    Returns Promise<void>

sendTypingState

  • sendTypingState(threadOrRecipientUserId: string, present: boolean): Promise<void>
  • Send "User is typing" message. In a non-group conversation, sendPresenceState() must be called first.

    Parameters

    • threadOrRecipientUserId: string
    • present: boolean

    Returns Promise<void>

Generated using TypeDoc