Methods
# async _closeDialog(conversationId, dialogId, dialogCloseReason, cause) → {Promise.<void>}
Close the dialog. Conversation stage will remain open as long as it has open dialogs.
Parameters:
Name | Type | Default | Description |
---|---|---|---|
conversationId |
string | ||
dialogId |
string | ||
dialogCloseReason |
DialogCloseReason | null | "AGENT", "CONSUMER", or "SYSTEM" |
cause |
string | null |
# async _connectWithRetry()
Establishes or initializes a websocket connection to UMS Will continue to retry until connected if maintainConnection = true
# async abstract _getWebsocketUrl() → {Promise.<String>}
Returns a websocket URL. Must be implemented by child classes.
# async _joinDialog(conversationId, dialogId, participantRole)
Attempt to join the current conversation as the given role
Parameters:
Name | Type | Description |
---|---|---|
conversationId |
string | |
dialogId |
string | |
participantRole |
ParticipantRole |
# async _leaveDialog(conversationId, dialogId, participantRole)
Attempt to leave the current conversation as the given role
Parameters:
Name | Type | Description |
---|---|---|
conversationId |
string | |
dialogId |
string | |
participantRole |
ParticipantRole |
# protected _onAuthInvalidError()
Clear the current auth token, forces a reauth when ._connect() is called again
# protected _onUMSMessage(data)
handles message packets from UMS, will either pass to handleResponse or handleNotification
Parameters:
Name | Type | Description |
---|---|---|
data |
string | The json packet received from UMS, to be parsed. Must include "kind" attribute. |
# async protected _requestConversationSubscription() → {Promise.<uuid>}
Makes the websocket call to UMS to create a subscription. Overrides the abstract method above, called from createConversationSubscription
# async protected _transferConversation(transferDetailsopt)
Transfers a conversation to another agent, skill, or both. Removes the ASSIGNED_AGENT from the conversation.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
transferDetails |
object |
<optional> |
Object containing details for conversation transfer. Defaults to an empty Object. |
conversationId |
string | ||
skillId |
string |
<optional> |
Transfers this conversation to the specified skillId |
agentId |
string |
<optional> |
Transfers this conversation to the specified agentId |
removeFromExistingRole |
string |
<optional> |
The role of the agentId in this conversation, if any (e.g. READER) |
removeAgentId |
string |
<optional> |
The agentId of the ASSIGNED_AGENT to be removed during transfer |
void
# async closeConversation(conversationId) → {Promise.<void>}
Attempts to close a given conversation.
Parameters:
Name | Type | Description |
---|---|---|
conversationId |
string |
# async getClock() → {Promise.<number>}
Makes a get clock request, previously used as a keep alive signal
- Deprecated:
- Yes
- The current time in milliseconds from the UMS server's system clock
# async abstract getToken()
Returns the token from this connection
# async open()
Establishes or initializes a websocket connection to UMS
# async send(request) → {Promise.<*>}
Sends a request over the websocket, awaits the response
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
request |
Object | The request information |
|
type |
string | ||
body |
Object | ||
headers |
Array.<String> |
<optional> |
|
metadata |
Array.<Object> |
<optional> |
array of metadata to be attached to this request |
- A promise that will resolve when a success response is received, it will reject if there is an error, a timeout, or the connection is disconnected before the response is received.
# async abstract setAgentState(agentId, agentState)
Changes the availability of an agent, only supported by BrandWebsocketConnection
Parameters:
Name | Type | Description |
---|---|---|
agentId |
string | {accountId.userId} - Defaults to the agentId for the current connection |
agentState |
string | represents availability states of the agent: ONLINE, OFFLINE, AWAY, BACK_SOON |
void