Constructor
-
new Conversation(conversationService)
-
Conversation allows Participants to communicate by sending and receiving Messages.
Parameters:
Name Type Description conversationService
AvayaClientServices.Services.Messaging.ConversationService
Methods
-
addParticipantAddresses(addressesToAdd) → {AvayaClientServices.Base.Promise.<(Array|object)>}
-
Adds participants to conversation by addresses.
Parameters:
Name Type Description addressesToAdd
Array.<String> Array of Strings.
Returns:
{ AvayaClientServices.Base.Promise.<(Array|object)> }
-
createEscalation() → {AvayaClientServices.Services.Messaging.Escalation}
-
Creates Escalation.
Returns:
-
createMessage() → {AvayaClientServices.Services.Messaging.Message}
-
Creates new Message.
Returns:
-
getActiveParticipants() → {Array.<AvayaClientServices.Services.Messaging.Participant>}
-
Returns array of all active Participants that take part in conversation.
See:
Returns:
-
getAttachmentCount() → {Number}
-
Returns total amount of attachments in conversation.
Returns:
{ Number }
-
getComposingParticipants() → {Array.<AvayaClientServices.Services.Messaging.Participant>}
-
Returns array of currently composing Participants.
See:
Returns:
-
getId() → {string}
-
Returns conversation ID.
Returns:
{ string }
-
getLastAccessTime() → {Date}
-
Returns conversation last access time.
Returns:
{ Date }
-
getLastEntryTime() → {Date}
-
Returns conversation last entry time.
This is timestamp of the most recent message in conversation.Returns:
{ Date }
-
getLastUpdatedByParticipant() → {AvayaClientServices.Services.Messaging.Participant}
-
Returns the Participant that the conversation was last updated by.
Returns:
-
getLastUpdatedTime() → {Date}
-
Returns conversation last updated time.
Returns:
{ Date }
-
getMessages() → {AvayaClientServices.Base.DataSet.<AvayaClientServices.Services.Messaging.Message>}
-
Gets conversation messages.
Returns:
-
getParticipants() → {Array.<AvayaClientServices.Services.Messaging.Participant>}
-
Returns array of all Participants that take part in conversation.
See:
Returns:
-
getPreviewText() → {String}
-
Returns conversation preview text. PreviewText is a body of the latest message in conversation.
Returns:
{ String }
-
getSensitivity() → {AvayaClientServices.Services.Messaging.SensitivityLevel}
-
Returns conversation sensitivity level. It determines level of privacy for conversation.
Returns:
-
getStatus() → {AvayaClientServices.Services.Messaging.ResourceStatus}
-
Returns conversation status.
Returns:
-
getSubject() → {String}
-
Returns conversation subject.
Returns:
{ String }
-
getTotalMessageCount() → {Number}
-
Returns total amount of messages in conversation.
Returns:
{ Number }
-
getType() → {AvayaClientServices.Services.Messaging.ConversationType}
-
Returns conversation type, as defined in AvayaClientServices.Services.Messaging.ConversationType.
Returns:
-
getUnreadAttachmentCount() → {Number}
-
Returns total amount of unread attachments in conversation.
Returns:
{ Number }
-
getUnreadMessageCount() → {Number}
-
Returns total amount of unread messages in conversation.
Returns:
{ Number }
-
hasAttachments() → {Boolean}
-
Determines whether conversation contains attachments.
Returns:
{ Boolean }
-
hasUnreadAttachments() → {Boolean}
-
Determines whether conversation contains unread attachments.
Returns:
{ Boolean }
-
hasUnreadMessagesSinceLastAccess() → {Boolean}
-
Determines whether conversation has unread messages since last access time
Returns:
{ Boolean }
-
isActive() → {Boolean}
-
Returns true if conversation is active.
Returns:
{ Boolean }
-
isClosed() → {Boolean}
-
Returns true if conversation is closed.
Returns:
{ Boolean }
-
isMultiParty() → {Boolean}
-
Returns true if conversation is multiparty.
A conversation is considered to be a multi-party conversation if there are more than two
active participants in conversation.Returns:
{ Boolean }
-
isParticipantActive(participant) → {Boolean}
-
Returns true if a specified participant is active in this conversation.
Parameters:
Name Type Description participant
AvayaClientServices.Services.Messaging.Participant Returns:
{ Boolean }
-
isPrivate() → {Boolean}
-
Determines whether conversation sensitivity level is PRIVATE.
Conversation is private when SensitivityLevel of conversation is set to SensitivityLevel.PRIVATE.Returns:
{ Boolean }
-
leave() → {AvayaClientServices.Base.Promise.<(Boolean|object)>}
-
Leaves a conversation.
Returns:
{ AvayaClientServices.Base.Promise.<(Boolean|object)> }
-
markAllContentAsRead() → {AvayaClientServices.Base.Promise.<(object|object)>}
-
Marks all content as read.
Returns:
{ AvayaClientServices.Base.Promise.<(object|object)> }
-
removeEscalation(escalation) → {AvayaClientServices.Base.Promise.<(undefined|undefined)>}
-
Removes escalation from conversation.
Parameters:
Name Type Description escalation
AvayaClientServices.Services.Messaging.Escalation Escalation object to be removed from Conversation.
Returns:
{ AvayaClientServices.Base.Promise.<(undefined|undefined)> }
-
removeMessage(message) → {AvayaClientServices.Base.Promise.<(undefined|undefined)>}
-
Removes a message from conversation.
Parameters:
Name Type Description message
AvayaClientServices.Services.Messaging.Message Message of Conversation.
Returns:
{ AvayaClientServices.Base.Promise.<(undefined|undefined)> }
-
removeParticipantAddresses(addressesToRemove) → {AvayaClientServices.Base.Promise.<(undefined|String)>}
-
Removes participants from conversation by addresses.
Parameters:
Name Type Description addressesToRemove
Array.<String> Array of Strings
Returns:
{ AvayaClientServices.Base.Promise.<(undefined|String)> }
-
retrieveMessagesAfter(afterMessage, maxMessageCount) → {AvayaClientServices.Base.DataRetrieval}
-
Gets conversation messages after specified message.
Parameters:
Name Type Argument Description afterMessage
AvayaClientServices.Services.Messaging.Message Message of Conversation.
maxMessageCount
Number <optional>
Maximum number of messages to be returned.
Returns:
-
retrieveMessagesBefore(beforeMessage, maxMessageCount) → {AvayaClientServices.Base.DataRetrieval}
-
Gets conversation messages before specified message.
Parameters:
Name Type Argument Description beforeMessage
AvayaClientServices.Services.Messaging.Message Message of Conversation.
maxMessageCount
Number <optional>
Maximum number of messages to be returned.
Returns:
-
setLastAccessTime() → {void}
-
Sets last access time for conversation.
Returns:
{ void }
-
setSensitivity(newSensitivity) → {void}
-
Sets conversation sensitivity level.
Parameters:
Name Type Description newSensitivity
AvayaClientServices.Services.Messaging.SensitivityLevel New Sensitivity level for Conversation.
Returns:
-
{ void }
-
{ boolean }
-
-
setSubject(newSubject) → {void}
-
Sets new subject for conversation.
Parameters:
Name Type Description newSubject
String New subject for Conversation.
Returns:
{ void }
-
start() → {AvayaClientServices.Base.Promise.<(undefined|undefined)>}
-
Starts a conversation.
Returns:
{ AvayaClientServices.Base.Promise.<(undefined|undefined)> }
-
subscribeForTypingEvents() → {AvayaClientServices.Base.Promise.<(object|object)>}
-
Subscribes for typing notifications.
Returns:
{ AvayaClientServices.Base.Promise.<(object|object)> }
-
unsubscribeForTypingEvents() → {AvayaClientServices.Base.Promise.<(object|object)>}
-
Unsubscribes from typing notifications.
Returns:
{ AvayaClientServices.Base.Promise.<(object|object)> }
Managing callbacks
-
addOnActiveStatusChangedCallback(callback) → {void}
-
Adds new onActiveStatusChangedCallback.
Parameters:
Name Type Description callback
AvayaClientServices.Services.Messaging.Conversation#onActiveStatusChangedCallback Returns:
{ void }
-
addOnClosedStatusChangedCallback(callback) → {void}
-
Adds new onClosedStatusChangedCallback.
Parameters:
Name Type Description callback
AvayaClientServices.Services.Messaging.Conversation#onClosedStatusChangedCallback Returns:
{ void }
-
addOnLastAccessTimeChangedCallback(callback) → {void}
-
Adds new onLastAccessTimeChangedCallback.
Parameters:
Name Type Description callback
AvayaClientServices.Services.Messaging.Conversation#onLastAccessTimeChangedCallback Returns:
{ void }
-
addOnLastUpdatedTimeChangedCallback(callback) → {void}
-
Adds new onLastUpdatedTimeChangedCallback.
Parameters:
Name Type Description callback
AvayaClientServices.Services.Messaging.Conversation#onLastUpdatedTimeChangedCallback Returns:
{ void }
-
addOnLatestEntryTimeChangedCallback(callback) → {void}
-
Adds new onLatestEntryTimeChangedCallback.
Parameters:
Name Type Description callback
AvayaClientServices.Services.Messaging.Conversation#onLatestEntryTimeChangedCallback Returns:
{ void }
-
addOnMultiPartyStatusChangedCallback(callback) → {void}
-
Adds new onMultiPartyStatusChangedCallback.
Parameters:
Name Type Description callback
AvayaClientServices.Services.Messaging.Conversation#onMultiPartyStatusChangedCallback Returns:
{ void }
-
addOnPreviewTextChangedCallback(callback) → {void}
-
Adds new onPreviewTextChangedCallback.
Parameters:
Name Type Description callback
AvayaClientServices.Services.Messaging.Conversation#onPreviewTextChangedCallback Returns:
{ void }
-
addOnSensitivityChangedCallback(callback) → {void}
-
Adds new onSensitivityChangedCallback.
Parameters:
Name Type Description callback
AvayaClientServices.Services.Messaging.Conversation#onSensitivityChangedCallback Returns:
{ void }
-
addOnStatusChangedCallback(callback) → {void}
-
Adds new onStatusChangedCallback.
Parameters:
Name Type Description callback
AvayaClientServices.Services.Messaging.Conversation#onStatusChangedCallback Returns:
{ void }
-
addOnSubjectChangedCallback(callback) → {void}
-
Adds new onSubjectChangedCallback.
Parameters:
Name Type Description callback
AvayaClientServices.Services.Messaging.Conversation#onSubjectChangedCallback Returns:
{ void }
-
addOnTotalAttachmentCountChangedCallback(callback) → {void}
-
Adds new onTotalAttachmentCountChangedCallback.
Parameters:
Name Type Description callback
AvayaClientServices.Services.Messaging.Conversation#onTotalAttachmentCountChangedCallback Returns:
{ void }
-
addOnTotalMessageCountChangedCallback(callback) → {void}
-
Adds new onTotalMessageCountChangedCallback.
Parameters:
Name Type Description callback
AvayaClientServices.Services.Messaging.Conversation#onTotalMessageCountChangedCallback Returns:
{ void }
-
addOnTotalUnreadAttachmentCountChangedCallback(callback) → {void}
-
Adds new onTotalUnreadAttachmentCountChangedCallback.
Parameters:
Name Type Description callback
AvayaClientServices.Services.Messaging.Conversation#onTotalUnreadAttachmentCountChangedCallback Returns:
{ void }
-
addOnTotalUnreadMessageCountChangedCallback(callback) → {void}
-
Adds new onTotalUnreadMessageCountChangedCallback.
Parameters:
Name Type Description callback
AvayaClientServices.Services.Messaging.Conversation#onTotalUnreadMessageCountChangedCallback Returns:
{ void }
-
removeOnActiveStatusChangedCallback(callback) → {void}
-
Removes existing onActiveStatusChangedCallback.
Parameters:
Name Type Description callback
AvayaClientServices.Services.Messaging.Conversation#onActiveStatusChangedCallback Returns:
{ void }
-
removeOnClosedStatusChangedCallback(callback) → {void}
-
Removes existing onClosedStatusChangedCallback.
Parameters:
Name Type Description callback
AvayaClientServices.Services.Messaging.Conversation#onClosedStatusChangedCallback Returns:
{ void }
-
removeOnLastAccessTimeChangedCallback(callback) → {void}
-
Removes existing onLastAccessTimeChangedCallback.
Parameters:
Name Type Description callback
AvayaClientServices.Services.Messaging.Conversation#onLastAccessTimeChangedCallback Returns:
{ void }
-
removeOnLastUpdatedTimeChangedCallback(callback) → {void}
-
Removes existing onLastUpdatedTimeChangedCallback.
Parameters:
Name Type Description callback
AvayaClientServices.Services.Messaging.Conversation#onLastUpdatedTimeChangedCallback Returns:
{ void }
-
removeOnLatestEntryTimeChangedCallback(callback) → {void}
-
Removes existing onLatestEntryTimeChangedCallback.
Parameters:
Name Type Description callback
AvayaClientServices.Services.Messaging.Conversation#onLatestEntryTimeChangedCallback Returns:
{ void }
-
removeOnMultiPartyStatusChangedCallback(callback) → {void}
-
Removes existing onMultiPartyStatusChangedCallback.
Parameters:
Name Type Description callback
AvayaClientServices.Services.Messaging.Conversation#onMultiPartyStatusChangedCallback Returns:
{ void }
-
removeOnPreviewTextChangedCallback(callback) → {void}
-
Removes existing onPreviewTextChangedCallback.
Parameters:
Name Type Description callback
AvayaClientServices.Services.Messaging.Conversation#onPreviewTextChangedCallback Returns:
{ void }
-
removeOnSensitivityChangedCallback(callback) → {void}
-
Removes existing onSensitivityChangedCallback.
Parameters:
Name Type Description callback
AvayaClientServices.Services.Messaging.Conversation#onSensitivityChangedCallback Returns:
{ void }
-
removeOnStatusChangedCallback(callback) → {void}
-
Removes existing onResourceStatusChangedCallback.
Parameters:
Name Type Description callback
AvayaClientServices.Services.Messaging.Conversation#onStatusChangedCallback Returns:
{ void }
-
removeOnSubjectChangedCallback(callback) → {void}
-
Removes existing onSubjectChangedCallback.
Parameters:
Name Type Description callback
AvayaClientServices.Services.Messaging.Conversation#onSubjectChangedCallback Returns:
{ void }
-
removeOnTotalAttachmentCountChangedCallback(callback) → {void}
-
Removes existing onTotalAttachmentCountChangedCallback.
Parameters:
Name Type Description callback
AvayaClientServices.Services.Messaging.Conversation#onTotalAttachmentCountChangedCallback Returns:
{ void }
-
removeOnTotalMessageCountChangedCallback(callback) → {void}
-
Removes existing onTotalMessageCountChangedCallback.
Parameters:
Name Type Description callback
AvayaClientServices.Services.Messaging.Conversation#onTotalMessageCountChangedCallback Returns:
{ void }
-
removeOnTotalUnreadAttachmentCountChangedCallback(callback) → {void}
-
Removes existing onTotalUnreadAttachmentCountChangedCallback.
Parameters:
Name Type Description callback
AvayaClientServices.Services.Messaging.Conversation#onTotalUnreadAttachmentCountChangedCallback Returns:
{ void }
-
removeOnTotalUnreadMessageCountChangedCallback(callback) → {void}
-
Removes existing onTotalUnreadMessageCountChangedCallback.
Parameters:
Name Type Description callback
AvayaClientServices.Services.Messaging.Conversation#onTotalUnreadMessageCountChangedCallback Returns:
{ void }
Capabilities
-
getAddParticipantsCapability() → {AvayaClientServices.Base.Capability}
-
Returns Capability object that indicates if participant can be added to conversation.
if (conversation is active and service is available) allow if (conversation is DRAFT_UNSENT and service is available) allow else deny
Returns:
-
getCreateEscalationCapability() → {AvayaClientServices.Base.Capability}
-
Returns Capability object that indicates if audio/video escalation is allowed in this conversation.
Returns:
-
getCreateMessageCapability() → {AvayaClientServices.Base.Capability}
-
Returns Capability object that indicates if message can be created in this conversation.
if (conversation is closed and service is available) deny if (service is not available) deny else allow
Returns:
-
getIsTypingCapability() → {AvayaClientServices.Base.Capability}
-
Returns Capability object that indicates if isTyping feature is available in this conversation.
Returns:
-
getLeaveCapability() → {AvayaClientServices.Base.Capability}
-
Returns Capability object that indicates if participant can leave this conversation.
if (conversation is not active) deny if (conversation is closed) deny if (service is not available) deny else allow
Returns:
-
getMarkAllContentAsReadCapability() → {AvayaClientServices.Base.Capability}
-
Returns Capability object that indicates if unread content in this conversation can be marked as read.
if (conversation has unreadCount equal to 0) deny if (resources doesn't contain markAsReadIf endpoint || resources are wrong || resources are unavailable) deny else allow
Returns:
-
getRemoveCapability() → {AvayaClientServices.Base.Capability}
-
Returns Capability object that indicates if this conversation can be removed.
if (conversation is DRAFT_UNSENT and service is available) allow else deny
Returns:
-
getRemoveParticipantsCapability() → {AvayaClientServices.Base.Capability}
-
Returns Capability object that indicates if participant can be removed from conversation.
if (conversation is DRAFT_UNSENT and service is available) allow else deny
Returns:
-
getRetrieveMessagesCapability() → {AvayaClientServices.Base.Capability}
-
Returns Capability object that indicates if older content of conversation can be downloaded.
if (conversation is not PUBLISHED) deny if (totalCount is equal to length of messages array) deny if (service is not available) deny else allow
Returns:
-
getSendCapability() → {AvayaClientServices.Base.Capability}
-
Returns Capability object that indicates if this conversation can be started.
if (conversation is DRAFT_UNSENT) if (self is the only participant) deny else allow else deny
Returns:
-
getUpdateLastAccessTimeCapability() → {AvayaClientServices.Base.Capability}
-
Returns Capability object that indicates if the last access time property of conversation can be updated.
if (conversation is PUBLISHED & service is available & conversation is not closed) allow else deny
Returns:
-
getUpdateSensitivityCapability() → {AvayaClientServices.Base.Capability}
-
Returns Capability object that indicates if sensitivity property of conversation can be updated.
if (conversation is PUBLISHED & service is available & conversation is not closed) allow else deny
Returns:
-
getUpdateSubjectCapability() → {AvayaClientServices.Base.Capability}
-
Returns Capability object that indicates if subject property of conversation can be updated.
if (conversation is closed) deny if (conversation is PUBLISHED) if (resources contain endpoint for subject change) allow else deny else if (conversation is DRAFT_UNSENT) allow
Returns:
Type Definitions
-
onActiveStatusChangedCallback(conversation, isActive) → {void}
-
Interface for callback function to be invoked when active status has changed.
Parameters:
Name Type Description conversation
AvayaClientServices.Services.Messaging.Conversation Conversation instance.
isActive
Boolean New value of isActive flag.
Returns:
{ void }
-
onClosedStatusChangedCallback(conversation, isClosed) → {void}
-
Interface for callback function to be invoked when closed status has changed.
Parameters:
Name Type Description conversation
AvayaClientServices.Services.Messaging.Conversation Conversation instance.
isClosed
Boolean New value of isClosed flag.
Returns:
{ void }
-
onLastAccessTimeChangedCallback(conversation, newTime) → {void}
-
Interface for callback function to be invoked when last access time has changed.
Parameters:
Name Type Description conversation
AvayaClientServices.Services.Messaging.Conversation Conversation instance.
newTime
Date New value of last access time.
Returns:
{ void }
-
onLastUpdatedTimeChangedCallback(conversation, newTime) → {void}
-
Interface for callback function to be invoked when last updated time has changed.
Parameters:
Name Type Description conversation
AvayaClientServices.Services.Messaging.Conversation Conversation instance.
newTime
Date New value of last updated time.
Returns:
{ void }
-
onLatestEntryTimeChangedCallback(conversation, newTime) → {void}
-
Interface for callback function to be invoked when latest entry time has changed.
Parameters:
Name Type Description conversation
AvayaClientServices.Services.Messaging.Conversation Conversation instance.
newTime
Date New value of last entry time.
Returns:
{ void }
-
onMultiPartyStatusChangedCallback(conversation, isMultiparty) → {void}
-
Interface for callback function to be invoked when multiparty status has changed.
Parameters:
Name Type Description conversation
AvayaClientServices.Services.Messaging.Conversation Conversation instance.
isMultiparty
Boolean New value of isMultiparty flag.
Returns:
{ void }
-
onPreviewTextChangedCallback(conversation, newPreviewText) → {void}
-
Interface for callback function to be invoked when preview text has changed.
Parameters:
Name Type Description conversation
AvayaClientServices.Services.Messaging.Conversation Conversation instance.
newPreviewText
String New value of preview text.
Returns:
{ void }
-
onSensitivityChangedCallback(conversation, newSensitivity) → {void}
-
Interface for callback function to be invoked when sensitivity has changed.
Parameters:
Name Type Description conversation
AvayaClientServices.Services.Messaging.Conversation Conversation instance.
newSensitivity
AvayaClientServices.Services.Messaging.SensitivityLevel New value of sensitivity level.
Returns:
{ void }
-
onStatusChangedCallback(conversation, newResourceStatus) → {void}
-
Interface for callback function to be invoked when resource status has changed.
Parameters:
Name Type Description conversation
AvayaClientServices.Services.Messaging.Conversation Conversation instance.
newResourceStatus
String New resource status value.
Returns:
{ void }
-
onSubjectChangedCallback(conversation, newSubject) → {void}
-
Interface for callback function to be invoked when subject has changed.
Parameters:
Name Type Description conversation
AvayaClientServices.Services.Messaging.Conversation Conversation instance.
newSubject
String New subject value.
Returns:
{ void }
-
onTotalAttachmentCountChangedCallback(conversation, newTotalAttachmentCount) → {void}
-
Interface for callback function to be invoked when total attachment count has changed.
Parameters:
Name Type Description conversation
AvayaClientServices.Services.Messaging.Conversation Conversation instance.
newTotalAttachmentCount
Number New value of total number of attachments.
Returns:
{ void }
-
onTotalMessageCountChangedCallback(conversation, newMessagesCount) → {void}
-
Interface for callback function to be invoked when total messages count has changed.
Parameters:
Name Type Description conversation
AvayaClientServices.Services.Messaging.Conversation Conversation instance.
newMessagesCount
Number New value of total number of messages.
Returns:
{ void }
-
onTotalUnreadAttachmentCountChangedCallback(conversation, newUnreadAttachmentCount) → {void}
-
Interface for callback function to be invoked when total unread attachment count has changed.
Parameters:
Name Type Description conversation
AvayaClientServices.Services.Messaging.Conversation Conversation instance.
newUnreadAttachmentCount
Number New value of unread number of attachments.
Returns:
{ void }
-
onTotalUnreadMessageCountChangedCallback(conversation, newUnreadMessageCount) → {void}
-
Interface for callback function to be invoked when total unread message count has changed.
Parameters:
Name Type Description conversation
AvayaClientServices.Services.Messaging.Conversation Conversation instance.
newUnreadMessageCount
Number New value of unread number of messages.
Returns:
{ void }