Frontend API

export class FBPMessage

This class implements the format of a FBPMessage as described here : https://flowbased.github.io/fbp-protocol/#message-structure

Created by antoine on 15/06/2017.

getProtocol (): string

Returns the protocol field of the message.

getCommand (): string

Returns the command field of the message.

getPayloadAsJSON (): Object

Returns the payload field of the message.

getPayloadAsString (): string

Returns the payload field of the message, as a serialized string

setProtocol(protocol: string)

Set the protocol field of the message.

setCommand(command: string)

Set the command field of the message

setPayload (payload: string)

Set the payload of the message, from a stringified json.

setPayloadFromJson (payload: Object)

Set the payload of the message, from a Javascript object.

toJSONstring (): string

Stringify the message in order to send it.