Members
# assignedAgent
The assigned agent (or null if none assigned)
Methods
# static deserialize(conversation, state) → {Dialog}
Rehydrate a serialized dialog
Parameters:
Name | Type | Description |
---|---|---|
conversation |
||
state |
# async close(dialogCloseReason, cause) → {Promise.<void>}
Close the dialog, conversation will remain open.
Parameters:
Name | Type | Description |
---|---|---|
dialogCloseReason |
DialogCloseReason | "AGENT", "CONSUMER", or "SYSTEM" |
cause |
string |
# async getAllPublishEvents() → {Promise.<void>}
Retrieve and process all PublishEvents for this dialog: ContentEvent, RichContentEvent & AcceptStatusEvent. This should be called to ensure that all the messages for a dialog have been populated.
# getSelfParticipant() → {Participant|null}
Gets the Participant object that corresponds with the current connection if it exists. Returns null otherwise.
# async join(participantRole) → {Promise.<void>}
Attempt to join the current dialog as the given role
Parameters:
Name | Type | Description |
---|---|---|
participantRole |
ParticipantRole |
# async queryMessages(queryopt) → {Promise.<Array.<Message>>}
Returns all messages from this dialog, optionally accepts a query to filter.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
query |
object |
<optional> |
optional query to filter messages |
maxQuantity |
string |
<optional> |
maximum number of messages to return |
sequenceMin |
string |
<optional> |
messages older than the provided sequence number, inclusive |
sequenceMax |
string |
<optional> |
messages newer than the provided sequence number, inclusive |
messages matching the query
# async sendAcceptStatus(sequenceList) → {Promise.<void>}
Sends an accept status for all publish events in the sequence list
Parameters:
Name | Type | Description |
---|---|---|
sequenceList |
Array | array of sequence numbers to send the accept status |
# async sendMessage(text, metadataopt, quickRepliesopt) → {Promise.<void>}
Sends a message on this dialog
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
text |
string | the text of the message, max length 8,000 characters |
||
metadata |
Object | Array.<Object> |
<optional> |
null | A metadata object or an array of metadata objects, must conform to valid metadata schema |
quickReplies |
Object |
<optional> |
null | An object conforming to the quick replies schema |
# async sendPrivateMessage(text, metadataopt)
Sends a private message on this dialog, only agents and agent managers can see these messages
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
text |
string | the text of the message, max length 8,000 characters |
||
metadata |
Object | Array.<Object> |
<optional> |
null | An array of metadata entries, these must conform to a valid metadata schema |
# async sendReadStatus(sequenceList) → {Promise.<void>}
Sends a read status for all publish events in the sequence list
Parameters:
Name | Type | Description |
---|---|---|
sequenceList |
Array | array of sequence numbers to send the read status |
# async sendRichText(message, metadataopt, quickReplies) → {Promise.<void>}
Sends a rich text message on this dialog
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
message |
string | the text of the message, max length 15,000 characters |
||
metadata |
Object | Array.<Object> |
<optional> |
null | An array of metadata entries, these must conform to a valid metadata schema |
quickReplies |
Object | null | an object conforming to the quick replies schema |
# async setChatState(chatState) → {Promise.<void>}
Sets the chat state for a participant in the dialog
Parameters:
Name | Type | Description |
---|---|---|
chatState |
ParticipantChatState | The current chat state for the dialog participant |
# async uploadFile(buffer, captionopt) → {Promise.<void>}
Uploads a buffer and publishes the upload event on this dialog
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
buffer |
ArrayBuffer | buffer of file to be uploaded |
|
caption |
string |
<optional> |
a caption for the file |