Please enable JavaScript.
Coggle requires JavaScript to display documents.
nxmClient (NexmoClient :computer: (constructor (config (cache, bugsnag,…
nxmClient
NexmoClient :computer:
constructor
WildEmiter.mixin(NexmoClient)
sessionReady
requests
application
config
cache
bugsnag
callstats
debug
socket_io
screenShareExtensionId
sdk_version
sync (none, lite, full)
nxm urls
iceServers
rtcstats
conversations_page_config
events_page_config
ws_url
_createAndSetConnection()
Props
_createAndSetConnection() => CAPI websocket :spider_web:
connection.on('packet) => this.application._handleEvent(res)
disconnect()
connect()
sendRequest() => emits(type, request)
logout()
login(token) => application(NexmoClient)
Application :closed_book:
handleEvent() (app level passes to eventHandlers)
updateToken()
inAppCall(usernames) => nxmCall
callServer(phone_number) => nxmCall :
NxmCall :phone:
constructor
Application
from (User)
Conversation
CallStatus (enum)
CallDirection (enum)
status
direction
_setupConversationObject(conversation)
WildEmitter.mixin(NXMCall)
Props
_enableStatsEvents() => mos_report // browser gives better info
_attachCallListeners() (attach member event listeners from conv)
_isValidStatusTransition(status) => Boolean
hangUpIfAllLeft() => this.hangUp()
_setupConversationObject(conversation) => attachCallListeners
_setFrom(from) => set from object
_handleStatusChange(event) (process raw events to decipher nxmCall status)
_setStatusAndEmit(status) => application.emit('calls:status:changed')
answer(autoPlayAudio) => conversation.media.enable
createCall(usernames, autoPlayAudio) => invites .
(create a conversation with the prefix "CALL_" and invite all the users and if at least one user successfully invited enable audio
going to remove prefix "CALL_" and as custom field
createServerCall(phoneNumber) => response Trigger nxmCall flow for phone call, create knocking event
hangUp(reason) => response -------Leave conversation and disable the audio
reject(reason) => response.body ----- reject incoming nxmCall, leave the conversation you are invited to
updateOrCreateConversation(payload) => Conversation
Conversation :silhouettes:
constructor
application
id
name
members (Map of users)
events (Map of events)
sequence_number (for event sync)
is_video_conversation (Bool)
default_page_config
_events_page_last (last fetched)
conversations
media
Media :video_camera:
constructor
7 more items...
_attachEndingEventHandlers() => to clean up media, member, rtc terminate
_enableCallStats(pc)
_enableStatsReporting(ws_url)
_enableStatsEvents()
_initStatsReporting()
initStatsEvents()
_disableStatsReporting()
_disableStatsEvents()
_handleAudio(params) => streams => handles enabling of audio only stream with rtc:new
_handleVideo(params) => localStream
1 more item...
_emitEventsByRtcId(rtc_id) => execute func of events in _eventsQueue that match rtc.id
_runWhenLegInitialized(rtc_id, func) => execute or add to _eventsQueue
_handleVideoSend(localStream, isSendOnly, type, name, params) => pc.setLocalDescriptioon
_sendIceRequest(body, rtc_id) => send ICE to CAPI // SENT TO CAPI BUT THEY DO NOTHING WITH IT. SHOULD BE ABLE TO DELETE
_onIceCandidate(promiseArray, event, body, rtc_id) => add candidate from event to body and pass to _sendIceRequest
_handleNewOffer(params, event) => _runWhenLegInitialized
conversationsEventsHandler
wildemitter.mixin(Conversation)
me (Member, not in conv by default, must be invited or joined)
Props
_updateObjectInstance (update conversation object)
join(params) => Member
Member
constructor
conversation
callStatus
wildEmmiter.mixin(Member)
Props
_normalise(params) => update object instance and align attribute names
playStream(params) => NXMEvent => play audio stream only to this member within conversation
NOT TESTED YET
sayText(params) => NXMEvent
NXMEvent
4 more items...
kick(reason) => kick member from conv => response.body
mute(mute) => mute this member =>
earmuff(earmuff) => earmuff this member =>
_handleEvent => handle events (invited, joined, left, media)
_setCallstatusAndEmit => emit(callstatus)
del() (deletes conversation)
deleteEvent()
invite(params) => Member (invites user to conv/creates member)
inviteWithAudio(parms)
leave(reason) => me.kick(reason)
sendText() => TextEvent :pencil2:
sendImage(params) => imageRequest NETWORK REQUEST
_typing(state) => response.type
startTyping => _typing('on')
stopTyping => _typing('stop')
getEvents(params) => EventsPage NETWORK REQUEST
_handleEvent(event) => use conversationEventHandler => emit(event)
newConversation(params) => Conversation
newConversationAndJoin(params) => Conversation
getConversation(id) => Conversation
getConversations(params) => ConversationsPage NETWORK REQUEST
syncConversations(conversations)
getUser(id) => User
constructor
wildemmitter.mixin(application)
_conversations_page_last (last fetched, make private)
_default_page_config
calls (Map)
conversations (Map)
session (nxmClient)
me (logged-in user)
Props
generate JWT