@wazo/sdk 0.38.22 → 0.39.0-beta.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +62 -293
- package/dist/wazo-sdk.js +9 -25
- package/esm/__tests__/api-client.test.js +183 -5059
- package/esm/__tests__/web-rtc-client.test.js +177 -7930
- package/esm/api/agentd.js +23 -832
- package/esm/api/amid.js +9 -411
- package/esm/api/application.js +60 -829
- package/esm/api/auth.js +164 -1213
- package/esm/api/call-logd.js +24 -733
- package/esm/api/calld.js +114 -1469
- package/esm/api/chatd.js +48 -1311
- package/esm/api/confd.js +67 -1580
- package/esm/api/ctid-ng.js +92 -1343
- package/esm/api/dird.js +100 -1590
- package/esm/api/webhookd.js +7 -513
- package/esm/api-client.js +143 -4880
- package/esm/checker/Checker.js +45 -8727
- package/esm/checker/checks/aor.js +24 -4924
- package/esm/checker/checks/api.js +70 -4968
- package/esm/checker/checks/ice-ipv4.js +63 -117
- package/esm/checker/checks/index.js +8 -8677
- package/esm/checker/checks/symmetric-nat.js +54 -102
- package/esm/checker/checks/wazo-websocket.js +34 -999
- package/esm/checker/checks/webrtc-transport.js +28 -7845
- package/esm/checker/checks/webrtc.js +31 -7852
- package/esm/domain/AdHocAPIConference.js +86 -5115
- package/esm/domain/Agent.js +27 -61
- package/esm/domain/BadResponse.js +20 -43
- package/esm/domain/Call.js +120 -210
- package/esm/domain/CallLog.js +123 -305
- package/esm/domain/CallSession.js +251 -423
- package/esm/domain/ChatMessage.js +52 -105
- package/esm/domain/ChatRoom.js +28 -60
- package/esm/domain/Contact.js +435 -741
- package/esm/domain/Country.js +17 -19
- package/esm/domain/Device/DebugDevice.js +31 -47
- package/esm/domain/Device/Device.js +1 -1
- package/esm/domain/DirectorySource.js +1 -1
- package/esm/domain/ExternalApp.js +23 -56
- package/esm/domain/Features.js +57 -5009
- package/esm/domain/ForwardOption.js +35 -70
- package/esm/domain/IndirectTransfer.js +38 -97
- package/esm/domain/Line.js +37 -88
- package/esm/domain/Meeting.js +58 -113
- package/esm/domain/MeetingAuthorization.js +38 -68
- package/esm/domain/MeetingStatus.js +13 -28
- package/esm/domain/NotificationOptions.js +43 -77
- package/esm/domain/Phone/CTIPhone.js +245 -5743
- package/esm/domain/Phone/Phone.js +1 -2
- package/esm/domain/Phone/WebRTCPhone.js +1457 -2671
- package/esm/domain/Profile.js +120 -405
- package/esm/domain/Recording.js +27 -51
- package/esm/domain/Relocation.js +16 -40
- package/esm/domain/Room.js +90 -133
- package/esm/domain/SFUNotAvailableError.js +5 -8
- package/esm/domain/ServerError.js +8 -61
- package/esm/domain/Session.js +125 -251
- package/esm/domain/SipLine.js +78 -155
- package/esm/domain/Subscription.js +39 -83
- package/esm/domain/SwitchboardCall.js +51 -143
- package/esm/domain/Voicemail.js +57 -122
- package/esm/domain/__tests__/Agent.test.js +31 -101
- package/esm/domain/__tests__/Call.test.js +24 -232
- package/esm/domain/__tests__/CallLog.test.js +60 -386
- package/esm/domain/__tests__/CallSession.test.js +74 -502
- package/esm/domain/__tests__/Contact.test.js +220 -902
- package/esm/domain/__tests__/IndirectTransfer.test.js +63 -546
- package/esm/domain/__tests__/Line.test.js +48 -156
- package/esm/domain/__tests__/Meeting.test.js +73 -226
- package/esm/domain/__tests__/MeetingAuthorization.test.js +45 -105
- package/esm/domain/__tests__/Profile.test.js +135 -496
- package/esm/domain/__tests__/Room.test.js +227 -719
- package/esm/domain/__tests__/Session.test.js +357 -1025
- package/esm/domain/__tests__/SipLine.test.js +24 -179
- package/esm/domain/__tests__/Voicemail.test.js +82 -200
- package/esm/domain/types.js +1 -1
- package/esm/index.js +63 -14985
- package/esm/lib/WazoSessionDescriptionHandler.js +406 -890
- package/esm/pubkey.js +10 -0
- package/esm/service/CallApi.js +42 -5014
- package/esm/service/IssueReporter.js +278 -360
- package/esm/service/__tests__/IssueReporter.test.js +92 -494
- package/esm/service/getApiClient.js +53 -4972
- package/esm/simple/Auth.js +212 -14747
- package/esm/simple/Configuration.js +8 -14796
- package/esm/simple/Directory.js +6 -4964
- package/esm/simple/Phone.js +309 -14727
- package/esm/simple/Websocket.js +68 -1112
- package/esm/simple/index.js +125 -14792
- package/esm/simple/room/LocalParticipant.js +1 -14797
- package/esm/simple/room/Participant.js +274 -14760
- package/esm/simple/room/RemoteParticipant.js +6 -14796
- package/esm/simple/room/Room.js +648 -14736
- package/esm/simple/room/SipRoom.js +111 -14790
- package/esm/simple/room/Stream.js +40 -14792
- package/esm/simple/room/__tests__/Participant.test.js +68 -14872
- package/esm/simple/room/__tests__/RemoteParticipant.test.js +10 -14805
- package/esm/simple/utils.js +9 -14799
- package/esm/types/WebSocketMessage.js +1 -1
- package/esm/types/__tests__/api-client.test.d.ts +2 -0
- package/esm/types/__tests__/api-client.test.d.ts.map +1 -0
- package/esm/types/__tests__/web-rtc-client.test.d.ts +2 -0
- package/esm/types/__tests__/web-rtc-client.test.d.ts.map +1 -0
- package/esm/types/api/agentd.d.ts +17 -0
- package/esm/types/api/agentd.d.ts.map +1 -0
- package/esm/types/api/amid.d.ts +8 -0
- package/esm/types/api/amid.d.ts.map +1 -0
- package/esm/types/api/application.d.ts +34 -0
- package/esm/types/api/application.d.ts.map +1 -0
- package/esm/types/api/auth.d.ts +64 -0
- package/esm/types/api/auth.d.ts.map +1 -0
- package/esm/types/api/call-logd.d.ts +12 -0
- package/esm/types/api/call-logd.d.ts.map +1 -0
- package/esm/types/api/calld.d.ts +51 -0
- package/esm/types/api/calld.d.ts.map +1 -0
- package/esm/types/api/chatd.d.ts +42 -0
- package/esm/types/api/chatd.d.ts.map +1 -0
- package/esm/types/api/confd.d.ts +39 -0
- package/esm/types/api/confd.d.ts.map +1 -0
- package/esm/types/api/ctid-ng.d.ts +36 -0
- package/esm/types/api/ctid-ng.d.ts.map +1 -0
- package/esm/types/api/dird.d.ts +38 -0
- package/esm/types/api/dird.d.ts.map +1 -0
- package/esm/types/api/webhookd.d.ts +24 -0
- package/esm/types/api/webhookd.d.ts.map +1 -0
- package/esm/types/api-client.d.ts +63 -0
- package/esm/types/api-client.d.ts.map +1 -0
- package/esm/types/checker/Checker.d.ts +13 -0
- package/esm/types/checker/Checker.d.ts.map +1 -0
- package/esm/types/checker/checks/aor.d.ts +6 -0
- package/esm/types/checker/checks/aor.d.ts.map +1 -0
- package/esm/types/checker/checks/api.d.ts +6 -0
- package/esm/types/checker/checks/api.d.ts.map +1 -0
- package/esm/types/checker/checks/ice-ipv4.d.ts +6 -0
- package/esm/types/checker/checks/ice-ipv4.d.ts.map +1 -0
- package/esm/types/checker/checks/index.d.ts +9 -0
- package/esm/types/checker/checks/index.d.ts.map +1 -0
- package/esm/types/checker/checks/symmetric-nat.d.ts +6 -0
- package/esm/types/checker/checks/symmetric-nat.d.ts.map +1 -0
- package/esm/types/checker/checks/wazo-websocket.d.ts +6 -0
- package/esm/types/checker/checks/wazo-websocket.d.ts.map +1 -0
- package/esm/types/checker/checks/webrtc-transport.d.ts +7 -0
- package/esm/types/checker/checks/webrtc-transport.d.ts.map +1 -0
- package/esm/types/checker/checks/webrtc.d.ts +6 -0
- package/esm/types/checker/checks/webrtc.d.ts.map +1 -0
- package/esm/types/domain/AdHocAPIConference.d.ts +54 -0
- package/esm/types/domain/AdHocAPIConference.d.ts.map +1 -0
- package/esm/types/domain/Agent.d.ts +31 -0
- package/esm/types/domain/Agent.d.ts.map +1 -0
- package/esm/types/domain/BadResponse.d.ts +11 -0
- package/esm/types/domain/BadResponse.d.ts.map +1 -0
- package/esm/types/domain/Call.d.ts +79 -0
- package/esm/types/domain/Call.d.ts.map +1 -0
- package/esm/types/domain/CallLog.d.ts +91 -0
- package/esm/types/domain/CallLog.d.ts.map +1 -0
- package/esm/types/domain/CallSession.d.ts +120 -0
- package/esm/types/domain/CallSession.d.ts.map +1 -0
- package/esm/types/domain/ChatMessage.d.ts +41 -0
- package/esm/types/domain/ChatMessage.d.ts.map +1 -0
- package/esm/types/domain/ChatRoom.d.ts +22 -0
- package/esm/types/domain/ChatRoom.d.ts.map +1 -0
- package/esm/types/domain/Contact.d.ts +316 -0
- package/esm/types/domain/Contact.d.ts.map +1 -0
- package/esm/types/domain/Country.d.ts +20 -0
- package/esm/types/domain/Country.d.ts.map +1 -0
- package/esm/types/domain/Device/DebugDevice.d.ts +14 -0
- package/esm/types/domain/Device/DebugDevice.d.ts.map +1 -0
- package/esm/types/domain/Device/Device.d.ts +13 -0
- package/esm/types/domain/Device/Device.d.ts.map +1 -0
- package/esm/types/domain/DirectorySource.d.ts +13 -0
- package/esm/types/domain/DirectorySource.d.ts.map +1 -0
- package/esm/types/domain/ExternalApp.d.ts +22 -0
- package/esm/types/domain/ExternalApp.d.ts.map +1 -0
- package/esm/types/domain/Features.d.ts +24 -0
- package/esm/types/domain/Features.d.ts.map +1 -0
- package/esm/types/domain/ForwardOption.d.ts +27 -0
- package/esm/types/domain/ForwardOption.d.ts.map +1 -0
- package/esm/types/domain/IndirectTransfer.d.ts +31 -0
- package/esm/types/domain/IndirectTransfer.d.ts.map +1 -0
- package/esm/types/domain/Line.d.ts +46 -0
- package/esm/types/domain/Line.d.ts.map +1 -0
- package/esm/types/domain/Meeting.d.ts +45 -0
- package/esm/types/domain/Meeting.d.ts.map +1 -0
- package/esm/types/domain/MeetingAuthorization.d.ts +26 -0
- package/esm/types/domain/MeetingAuthorization.d.ts.map +1 -0
- package/esm/types/domain/MeetingStatus.d.ts +10 -0
- package/esm/types/domain/MeetingStatus.d.ts.map +1 -0
- package/esm/types/domain/NotificationOptions.d.ts +22 -0
- package/esm/types/domain/NotificationOptions.d.ts.map +1 -0
- package/esm/types/domain/Phone/CTIPhone.d.ts +76 -0
- package/esm/types/domain/Phone/CTIPhone.d.ts.map +1 -0
- package/esm/types/domain/Phone/Phone.d.ts +71 -0
- package/esm/types/domain/Phone/Phone.d.ts.map +1 -0
- package/esm/types/domain/Phone/WebRTCPhone.d.ts +179 -0
- package/esm/types/domain/Phone/WebRTCPhone.d.ts.map +1 -0
- package/esm/types/domain/Profile.d.ts +151 -0
- package/esm/types/domain/Profile.d.ts.map +1 -0
- package/esm/types/domain/Recording.d.ts +26 -0
- package/esm/types/domain/Recording.d.ts.map +1 -0
- package/esm/types/domain/Relocation.d.ts +23 -0
- package/esm/types/domain/Relocation.d.ts.map +1 -0
- package/esm/types/domain/Room.d.ts +35 -0
- package/esm/types/domain/Room.d.ts.map +1 -0
- package/esm/types/domain/SFUNotAvailableError.d.ts +4 -0
- package/esm/types/domain/SFUNotAvailableError.d.ts.map +1 -0
- package/esm/types/domain/ServerError.d.ts +6 -0
- package/esm/types/domain/ServerError.d.ts.map +1 -0
- package/esm/types/domain/Session.d.ts +90 -0
- package/esm/types/domain/Session.d.ts.map +1 -0
- package/esm/types/domain/SipLine.d.ts +54 -0
- package/esm/types/domain/SipLine.d.ts.map +1 -0
- package/esm/types/domain/Subscription.d.ts +43 -0
- package/esm/types/domain/Subscription.d.ts.map +1 -0
- package/esm/types/domain/SwitchboardCall.d.ts +62 -0
- package/esm/types/domain/SwitchboardCall.d.ts.map +1 -0
- package/esm/types/domain/Voicemail.d.ts +50 -0
- package/esm/types/domain/Voicemail.d.ts.map +1 -0
- package/esm/types/domain/__tests__/Agent.test.d.ts +2 -0
- package/esm/types/domain/__tests__/Agent.test.d.ts.map +1 -0
- package/esm/types/domain/__tests__/Call.test.d.ts +2 -0
- package/esm/types/domain/__tests__/Call.test.d.ts.map +1 -0
- package/esm/types/domain/__tests__/CallLog.test.d.ts +2 -0
- package/esm/types/domain/__tests__/CallLog.test.d.ts.map +1 -0
- package/esm/types/domain/__tests__/CallSession.test.d.ts +2 -0
- package/esm/types/domain/__tests__/CallSession.test.d.ts.map +1 -0
- package/esm/types/domain/__tests__/Contact.test.d.ts +2 -0
- package/esm/types/domain/__tests__/Contact.test.d.ts.map +1 -0
- package/esm/types/domain/__tests__/IndirectTransfer.test.d.ts +2 -0
- package/esm/types/domain/__tests__/IndirectTransfer.test.d.ts.map +1 -0
- package/esm/types/domain/__tests__/Line.test.d.ts +2 -0
- package/esm/types/domain/__tests__/Line.test.d.ts.map +1 -0
- package/esm/types/domain/__tests__/Meeting.test.d.ts +2 -0
- package/esm/types/domain/__tests__/Meeting.test.d.ts.map +1 -0
- package/esm/types/domain/__tests__/MeetingAuthorization.test.d.ts +2 -0
- package/esm/types/domain/__tests__/MeetingAuthorization.test.d.ts.map +1 -0
- package/esm/types/domain/__tests__/Profile.test.d.ts +2 -0
- package/esm/types/domain/__tests__/Profile.test.d.ts.map +1 -0
- package/esm/types/domain/__tests__/Room.test.d.ts +2 -0
- package/esm/types/domain/__tests__/Room.test.d.ts.map +1 -0
- package/esm/types/domain/__tests__/Session.test.d.ts +2 -0
- package/esm/types/domain/__tests__/Session.test.d.ts.map +1 -0
- package/esm/types/domain/__tests__/SipLine.test.d.ts +2 -0
- package/esm/types/domain/__tests__/SipLine.test.d.ts.map +1 -0
- package/esm/types/domain/__tests__/Voicemail.test.d.ts +2 -0
- package/esm/types/domain/__tests__/Voicemail.test.d.ts.map +1 -0
- package/esm/types/domain/types.d.ts +217 -0
- package/esm/types/domain/types.d.ts.map +1 -0
- package/esm/types/index.d.ts +304 -0
- package/esm/types/index.d.ts.map +1 -0
- package/esm/types/lib/WazoSessionDescriptionHandler.d.ts +30 -0
- package/esm/types/lib/WazoSessionDescriptionHandler.d.ts.map +1 -0
- package/esm/types/pubkey.d.ts +3 -0
- package/esm/types/pubkey.d.ts.map +1 -0
- package/esm/types/service/CallApi.d.ts +28 -0
- package/esm/types/service/CallApi.d.ts.map +1 -0
- package/esm/types/service/IssueReporter.d.ts +40 -0
- package/esm/types/service/IssueReporter.d.ts.map +1 -0
- package/esm/types/service/__tests__/IssueReporter.test.d.ts +2 -0
- package/esm/types/service/__tests__/IssueReporter.test.d.ts.map +1 -0
- package/esm/types/service/getApiClient.d.ts +16 -0
- package/esm/types/service/getApiClient.d.ts.map +1 -0
- package/esm/types/simple/Auth.d.ts +51 -0
- package/esm/types/simple/Auth.d.ts.map +1 -0
- package/esm/types/simple/Configuration.d.ts +3 -0
- package/esm/types/simple/Configuration.d.ts.map +1 -0
- package/esm/types/simple/Directory.d.ts +3 -0
- package/esm/types/simple/Directory.d.ts.map +1 -0
- package/esm/types/simple/Phone.d.ts +115 -0
- package/esm/types/simple/Phone.d.ts.map +1 -0
- package/esm/types/simple/Websocket.d.ts +19 -0
- package/esm/types/simple/Websocket.d.ts.map +1 -0
- package/esm/types/simple/index.d.ts +147 -0
- package/esm/types/simple/index.d.ts.map +1 -0
- package/esm/types/simple/room/LocalParticipant.d.ts +5 -0
- package/esm/types/simple/room/LocalParticipant.d.ts.map +1 -0
- package/esm/types/simple/room/Participant.d.ts +76 -0
- package/esm/types/simple/room/Participant.d.ts.map +1 -0
- package/esm/types/simple/room/RemoteParticipant.d.ts +7 -0
- package/esm/types/simple/room/RemoteParticipant.d.ts.map +1 -0
- package/esm/types/simple/room/Room.d.ts +116 -0
- package/esm/types/simple/room/Room.d.ts.map +1 -0
- package/esm/types/simple/room/SipRoom.d.ts +14 -0
- package/esm/types/simple/room/SipRoom.d.ts.map +1 -0
- package/esm/types/simple/room/Stream.d.ts +13 -0
- package/esm/types/simple/room/Stream.d.ts.map +1 -0
- package/esm/types/simple/room/__tests__/Participant.test.d.ts +2 -0
- package/esm/types/simple/room/__tests__/Participant.test.d.ts.map +1 -0
- package/esm/types/simple/room/__tests__/RemoteParticipant.test.d.ts +2 -0
- package/esm/types/simple/room/__tests__/RemoteParticipant.test.d.ts.map +1 -0
- package/esm/types/simple/utils.d.ts +3 -0
- package/esm/types/simple/utils.d.ts.map +1 -0
- package/esm/types/types/WebSocketMessage.d.ts +285 -0
- package/esm/types/types/WebSocketMessage.d.ts.map +1 -0
- package/esm/types/utils/Emitter.d.ts +18 -0
- package/esm/types/utils/Emitter.d.ts.map +1 -0
- package/esm/types/utils/Heartbeat.d.ts +21 -0
- package/esm/types/utils/Heartbeat.d.ts.map +1 -0
- package/esm/types/utils/PhoneNumberUtil.d.ts +8 -0
- package/esm/types/utils/PhoneNumberUtil.d.ts.map +1 -0
- package/esm/types/utils/__tests__/Heartbeat.test.d.ts +2 -0
- package/esm/types/utils/__tests__/Heartbeat.test.d.ts.map +1 -0
- package/esm/types/utils/__tests__/PhoneNumberUtil.test.d.ts +2 -0
- package/esm/types/utils/__tests__/PhoneNumberUtil.test.d.ts.map +1 -0
- package/esm/types/utils/__tests__/api-requester.test.d.ts +2 -0
- package/esm/types/utils/__tests__/api-requester.test.d.ts.map +1 -0
- package/esm/types/utils/__tests__/array.test.d.ts +2 -0
- package/esm/types/utils/__tests__/array.test.d.ts.map +1 -0
- package/esm/types/utils/__tests__/compare-version.test.d.ts +2 -0
- package/esm/types/utils/__tests__/compare-version.test.d.ts.map +1 -0
- package/esm/types/utils/__tests__/object.test.d.ts +2 -0
- package/esm/types/utils/__tests__/object.test.d.ts.map +1 -0
- package/esm/types/utils/__tests__/sdp.test.d.ts +2 -0
- package/esm/types/utils/__tests__/sdp.test.d.ts.map +1 -0
- package/esm/types/utils/__tests__/string.test.d.ts +2 -0
- package/esm/types/utils/__tests__/string.test.d.ts.map +1 -0
- package/esm/types/utils/api-requester.d.ts +45 -0
- package/esm/types/utils/api-requester.d.ts.map +1 -0
- package/esm/types/utils/array.d.ts +2 -0
- package/esm/types/utils/array.d.ts.map +1 -0
- package/esm/types/utils/compare-version.d.ts +3 -0
- package/esm/types/utils/compare-version.d.ts.map +1 -0
- package/esm/types/utils/isMobile.d.ts +3 -0
- package/esm/types/utils/isMobile.d.ts.map +1 -0
- package/esm/types/utils/new-from.d.ts +3 -0
- package/esm/types/utils/new-from.d.ts.map +1 -0
- package/esm/types/utils/object.d.ts +2 -0
- package/esm/types/utils/object.d.ts.map +1 -0
- package/esm/types/utils/once.d.ts +2 -0
- package/esm/types/utils/once.d.ts.map +1 -0
- package/esm/types/utils/sdp.d.ts +13 -0
- package/esm/types/utils/sdp.d.ts.map +1 -0
- package/esm/types/utils/string.d.ts +2 -0
- package/esm/types/utils/string.d.ts.map +1 -0
- package/esm/types/utils/update-from.d.ts +3 -0
- package/esm/types/utils/update-from.d.ts.map +1 -0
- package/esm/types/utils/webrtc.d.ts +15 -0
- package/esm/types/utils/webrtc.d.ts.map +1 -0
- package/esm/types/web-rtc-client.d.ts +220 -0
- package/esm/types/web-rtc-client.d.ts.map +1 -0
- package/esm/types/websocket-client.d.ts +134 -0
- package/esm/types/websocket-client.d.ts.map +1 -0
- package/esm/utils/Emitter.js +17 -27
- package/esm/utils/Heartbeat.js +60 -83
- package/esm/utils/PhoneNumberUtil.js +48 -63
- package/esm/utils/__tests__/Heartbeat.test.js +59 -168
- package/esm/utils/__tests__/PhoneNumberUtil.test.js +55 -125
- package/esm/utils/__tests__/api-requester.test.js +127 -780
- package/esm/utils/__tests__/array.test.js +16 -19
- package/esm/utils/__tests__/compare-version.test.js +8 -26
- package/esm/utils/__tests__/object.test.js +73 -54
- package/esm/utils/__tests__/sdp.test.js +87 -216
- package/esm/utils/__tests__/string.test.js +21 -27
- package/esm/utils/api-requester.js +197 -675
- package/esm/utils/array.js +7 -11
- package/esm/utils/compare-version.js +12 -15
- package/esm/utils/isMobile.js +0 -2
- package/esm/utils/new-from.js +7 -12
- package/esm/utils/object.js +9 -23
- package/esm/utils/once.js +12 -13
- package/esm/utils/sdp.js +87 -131
- package/esm/utils/string.js +5 -9
- package/esm/utils/update-from.js +9 -16
- package/esm/utils/webrtc.js +35 -36
- package/esm/web-rtc-client.js +2038 -7677
- package/esm/websocket-client.js +352 -944
- package/lib/__tests__/api-client.test.js +199 -5067
- package/lib/__tests__/web-rtc-client.test.js +191 -7941
- package/lib/api/agentd.js +27 -837
- package/lib/api/amid.js +18 -415
- package/lib/api/application.js +64 -834
- package/lib/api/auth.js +166 -1222
- package/lib/api/call-logd.js +28 -738
- package/lib/api/calld.js +126 -1473
- package/lib/api/chatd.js +65 -1316
- package/lib/api/confd.js +79 -1584
- package/lib/api/ctid-ng.js +96 -1348
- package/lib/api/dird.js +105 -1596
- package/lib/api/webhookd.js +11 -518
- package/lib/api-client.js +139 -4884
- package/lib/checker/Checker.js +61 -8739
- package/lib/checker/checks/aor.js +37 -4929
- package/lib/checker/checks/api.js +81 -4971
- package/lib/checker/checks/ice-ipv4.js +66 -118
- package/lib/checker/checks/index.js +13 -8687
- package/lib/checker/checks/symmetric-nat.js +56 -104
- package/lib/checker/checks/wazo-websocket.js +58 -1006
- package/lib/checker/checks/webrtc-transport.js +41 -7853
- package/lib/checker/checks/webrtc.js +42 -7858
- package/lib/domain/AdHocAPIConference.js +80 -5116
- package/lib/domain/Agent.js +23 -64
- package/lib/domain/BadResponse.js +17 -44
- package/lib/domain/Call.js +108 -215
- package/lib/domain/CallLog.js +117 -311
- package/lib/domain/CallSession.js +221 -424
- package/lib/domain/ChatMessage.js +49 -110
- package/lib/domain/ChatRoom.js +28 -60
- package/lib/domain/Contact.js +409 -742
- package/lib/domain/Country.js +19 -21
- package/lib/domain/Device/DebugDevice.js +34 -49
- package/lib/domain/Device/Device.js +2 -2
- package/lib/domain/DirectorySource.js +2 -2
- package/lib/domain/ExternalApp.js +24 -56
- package/lib/domain/Features.js +68 -5018
- package/lib/domain/ForwardOption.js +36 -71
- package/lib/domain/IndirectTransfer.js +39 -98
- package/lib/domain/Line.js +35 -88
- package/lib/domain/Meeting.js +51 -118
- package/lib/domain/MeetingAuthorization.js +35 -75
- package/lib/domain/MeetingStatus.js +13 -29
- package/lib/domain/NotificationOptions.js +45 -77
- package/lib/domain/Phone/CTIPhone.js +283 -5755
- package/lib/domain/Phone/Phone.js +2 -5
- package/lib/domain/Phone/WebRTCPhone.js +1457 -2716
- package/lib/domain/Profile.js +127 -406
- package/lib/domain/Recording.js +28 -57
- package/lib/domain/Relocation.js +15 -43
- package/lib/domain/Room.js +73 -134
- package/lib/domain/SFUNotAvailableError.js +7 -9
- package/lib/domain/ServerError.js +14 -63
- package/lib/domain/Session.js +118 -251
- package/lib/domain/SipLine.js +70 -155
- package/lib/domain/Subscription.js +32 -86
- package/lib/domain/SwitchboardCall.js +45 -145
- package/lib/domain/Voicemail.js +56 -127
- package/lib/domain/__tests__/Agent.test.js +36 -103
- package/lib/domain/__tests__/Call.test.js +28 -237
- package/lib/domain/__tests__/CallLog.test.js +65 -392
- package/lib/domain/__tests__/CallSession.test.js +78 -503
- package/lib/domain/__tests__/Contact.test.js +224 -903
- package/lib/domain/__tests__/IndirectTransfer.test.js +75 -546
- package/lib/domain/__tests__/Line.test.js +52 -157
- package/lib/domain/__tests__/Meeting.test.js +78 -232
- package/lib/domain/__tests__/MeetingAuthorization.test.js +50 -107
- package/lib/domain/__tests__/Profile.test.js +161 -496
- package/lib/domain/__tests__/Room.test.js +239 -719
- package/lib/domain/__tests__/Session.test.js +350 -1024
- package/lib/domain/__tests__/SipLine.test.js +28 -180
- package/lib/domain/__tests__/Voicemail.test.js +86 -205
- package/lib/domain/types.js +2 -2
- package/lib/index.js +105 -15010
- package/lib/lib/WazoSessionDescriptionHandler.js +409 -898
- package/lib/pubkey.js +12 -0
- package/lib/service/CallApi.js +88 -5015
- package/lib/service/IssueReporter.js +264 -366
- package/lib/service/__tests__/IssueReporter.test.js +97 -500
- package/lib/service/getApiClient.js +70 -4990
- package/lib/simple/Auth.js +272 -14777
- package/lib/simple/Configuration.js +23 -14805
- package/lib/simple/Directory.js +18 -4966
- package/lib/simple/Phone.js +345 -14746
- package/lib/simple/Websocket.js +98 -1117
- package/lib/simple/index.js +151 -14800
- package/lib/simple/room/LocalParticipant.js +7 -14808
- package/lib/simple/room/Participant.js +269 -14778
- package/lib/simple/room/RemoteParticipant.js +11 -14806
- package/lib/simple/room/Room.js +655 -14761
- package/lib/simple/room/SipRoom.js +136 -14805
- package/lib/simple/room/Stream.js +43 -14802
- package/lib/simple/room/__tests__/Participant.test.js +79 -14879
- package/lib/simple/room/__tests__/RemoteParticipant.test.js +14 -14814
- package/lib/simple/utils.js +22 -14808
- package/lib/types/WebSocketMessage.js +2 -4
- package/lib/types/__tests__/api-client.test.d.ts +2 -0
- package/lib/types/__tests__/api-client.test.d.ts.map +1 -0
- package/lib/types/__tests__/web-rtc-client.test.d.ts +2 -0
- package/lib/types/__tests__/web-rtc-client.test.d.ts.map +1 -0
- package/lib/types/api/agentd.d.ts +17 -0
- package/lib/types/api/agentd.d.ts.map +1 -0
- package/lib/types/api/amid.d.ts +8 -0
- package/lib/types/api/amid.d.ts.map +1 -0
- package/lib/types/api/application.d.ts +34 -0
- package/lib/types/api/application.d.ts.map +1 -0
- package/lib/types/api/auth.d.ts +64 -0
- package/lib/types/api/auth.d.ts.map +1 -0
- package/lib/types/api/call-logd.d.ts +12 -0
- package/lib/types/api/call-logd.d.ts.map +1 -0
- package/lib/types/api/calld.d.ts +51 -0
- package/lib/types/api/calld.d.ts.map +1 -0
- package/lib/types/api/chatd.d.ts +42 -0
- package/lib/types/api/chatd.d.ts.map +1 -0
- package/lib/types/api/confd.d.ts +39 -0
- package/lib/types/api/confd.d.ts.map +1 -0
- package/lib/types/api/ctid-ng.d.ts +36 -0
- package/lib/types/api/ctid-ng.d.ts.map +1 -0
- package/lib/types/api/dird.d.ts +38 -0
- package/lib/types/api/dird.d.ts.map +1 -0
- package/lib/types/api/webhookd.d.ts +24 -0
- package/lib/types/api/webhookd.d.ts.map +1 -0
- package/lib/types/api-client.d.ts +63 -0
- package/lib/types/api-client.d.ts.map +1 -0
- package/lib/types/checker/Checker.d.ts +13 -0
- package/lib/types/checker/Checker.d.ts.map +1 -0
- package/lib/types/checker/checks/aor.d.ts +6 -0
- package/lib/types/checker/checks/aor.d.ts.map +1 -0
- package/lib/types/checker/checks/api.d.ts +6 -0
- package/lib/types/checker/checks/api.d.ts.map +1 -0
- package/lib/types/checker/checks/ice-ipv4.d.ts +6 -0
- package/lib/types/checker/checks/ice-ipv4.d.ts.map +1 -0
- package/lib/types/checker/checks/index.d.ts +9 -0
- package/lib/types/checker/checks/index.d.ts.map +1 -0
- package/lib/types/checker/checks/symmetric-nat.d.ts +6 -0
- package/lib/types/checker/checks/symmetric-nat.d.ts.map +1 -0
- package/lib/types/checker/checks/wazo-websocket.d.ts +6 -0
- package/lib/types/checker/checks/wazo-websocket.d.ts.map +1 -0
- package/lib/types/checker/checks/webrtc-transport.d.ts +7 -0
- package/lib/types/checker/checks/webrtc-transport.d.ts.map +1 -0
- package/lib/types/checker/checks/webrtc.d.ts +6 -0
- package/lib/types/checker/checks/webrtc.d.ts.map +1 -0
- package/lib/types/domain/AdHocAPIConference.d.ts +54 -0
- package/lib/types/domain/AdHocAPIConference.d.ts.map +1 -0
- package/lib/types/domain/Agent.d.ts +31 -0
- package/lib/types/domain/Agent.d.ts.map +1 -0
- package/lib/types/domain/BadResponse.d.ts +11 -0
- package/lib/types/domain/BadResponse.d.ts.map +1 -0
- package/lib/types/domain/Call.d.ts +79 -0
- package/lib/types/domain/Call.d.ts.map +1 -0
- package/lib/types/domain/CallLog.d.ts +91 -0
- package/lib/types/domain/CallLog.d.ts.map +1 -0
- package/lib/types/domain/CallSession.d.ts +120 -0
- package/lib/types/domain/CallSession.d.ts.map +1 -0
- package/lib/types/domain/ChatMessage.d.ts +41 -0
- package/lib/types/domain/ChatMessage.d.ts.map +1 -0
- package/lib/types/domain/ChatRoom.d.ts +22 -0
- package/lib/types/domain/ChatRoom.d.ts.map +1 -0
- package/lib/types/domain/Contact.d.ts +316 -0
- package/lib/types/domain/Contact.d.ts.map +1 -0
- package/lib/types/domain/Country.d.ts +20 -0
- package/lib/types/domain/Country.d.ts.map +1 -0
- package/lib/types/domain/Device/DebugDevice.d.ts +14 -0
- package/lib/types/domain/Device/DebugDevice.d.ts.map +1 -0
- package/lib/types/domain/Device/Device.d.ts +13 -0
- package/lib/types/domain/Device/Device.d.ts.map +1 -0
- package/lib/types/domain/DirectorySource.d.ts +13 -0
- package/lib/types/domain/DirectorySource.d.ts.map +1 -0
- package/lib/types/domain/ExternalApp.d.ts +22 -0
- package/lib/types/domain/ExternalApp.d.ts.map +1 -0
- package/lib/types/domain/Features.d.ts +24 -0
- package/lib/types/domain/Features.d.ts.map +1 -0
- package/lib/types/domain/ForwardOption.d.ts +27 -0
- package/lib/types/domain/ForwardOption.d.ts.map +1 -0
- package/lib/types/domain/IndirectTransfer.d.ts +31 -0
- package/lib/types/domain/IndirectTransfer.d.ts.map +1 -0
- package/lib/types/domain/Line.d.ts +46 -0
- package/lib/types/domain/Line.d.ts.map +1 -0
- package/lib/types/domain/Meeting.d.ts +45 -0
- package/lib/types/domain/Meeting.d.ts.map +1 -0
- package/lib/types/domain/MeetingAuthorization.d.ts +26 -0
- package/lib/types/domain/MeetingAuthorization.d.ts.map +1 -0
- package/lib/types/domain/MeetingStatus.d.ts +10 -0
- package/lib/types/domain/MeetingStatus.d.ts.map +1 -0
- package/lib/types/domain/NotificationOptions.d.ts +22 -0
- package/lib/types/domain/NotificationOptions.d.ts.map +1 -0
- package/lib/types/domain/Phone/CTIPhone.d.ts +76 -0
- package/lib/types/domain/Phone/CTIPhone.d.ts.map +1 -0
- package/lib/types/domain/Phone/Phone.d.ts +71 -0
- package/lib/types/domain/Phone/Phone.d.ts.map +1 -0
- package/lib/types/domain/Phone/WebRTCPhone.d.ts +179 -0
- package/lib/types/domain/Phone/WebRTCPhone.d.ts.map +1 -0
- package/lib/types/domain/Profile.d.ts +151 -0
- package/lib/types/domain/Profile.d.ts.map +1 -0
- package/lib/types/domain/Recording.d.ts +26 -0
- package/lib/types/domain/Recording.d.ts.map +1 -0
- package/lib/types/domain/Relocation.d.ts +23 -0
- package/lib/types/domain/Relocation.d.ts.map +1 -0
- package/lib/types/domain/Room.d.ts +35 -0
- package/lib/types/domain/Room.d.ts.map +1 -0
- package/lib/types/domain/SFUNotAvailableError.d.ts +4 -0
- package/lib/types/domain/SFUNotAvailableError.d.ts.map +1 -0
- package/lib/types/domain/ServerError.d.ts +6 -0
- package/lib/types/domain/ServerError.d.ts.map +1 -0
- package/lib/types/domain/Session.d.ts +90 -0
- package/lib/types/domain/Session.d.ts.map +1 -0
- package/lib/types/domain/SipLine.d.ts +54 -0
- package/lib/types/domain/SipLine.d.ts.map +1 -0
- package/lib/types/domain/Subscription.d.ts +43 -0
- package/lib/types/domain/Subscription.d.ts.map +1 -0
- package/lib/types/domain/SwitchboardCall.d.ts +62 -0
- package/lib/types/domain/SwitchboardCall.d.ts.map +1 -0
- package/lib/types/domain/Voicemail.d.ts +50 -0
- package/lib/types/domain/Voicemail.d.ts.map +1 -0
- package/lib/types/domain/__tests__/Agent.test.d.ts +2 -0
- package/lib/types/domain/__tests__/Agent.test.d.ts.map +1 -0
- package/lib/types/domain/__tests__/Call.test.d.ts +2 -0
- package/lib/types/domain/__tests__/Call.test.d.ts.map +1 -0
- package/lib/types/domain/__tests__/CallLog.test.d.ts +2 -0
- package/lib/types/domain/__tests__/CallLog.test.d.ts.map +1 -0
- package/lib/types/domain/__tests__/CallSession.test.d.ts +2 -0
- package/lib/types/domain/__tests__/CallSession.test.d.ts.map +1 -0
- package/lib/types/domain/__tests__/Contact.test.d.ts +2 -0
- package/lib/types/domain/__tests__/Contact.test.d.ts.map +1 -0
- package/lib/types/domain/__tests__/IndirectTransfer.test.d.ts +2 -0
- package/lib/types/domain/__tests__/IndirectTransfer.test.d.ts.map +1 -0
- package/lib/types/domain/__tests__/Line.test.d.ts +2 -0
- package/lib/types/domain/__tests__/Line.test.d.ts.map +1 -0
- package/lib/types/domain/__tests__/Meeting.test.d.ts +2 -0
- package/lib/types/domain/__tests__/Meeting.test.d.ts.map +1 -0
- package/lib/types/domain/__tests__/MeetingAuthorization.test.d.ts +2 -0
- package/lib/types/domain/__tests__/MeetingAuthorization.test.d.ts.map +1 -0
- package/lib/types/domain/__tests__/Profile.test.d.ts +2 -0
- package/lib/types/domain/__tests__/Profile.test.d.ts.map +1 -0
- package/lib/types/domain/__tests__/Room.test.d.ts +2 -0
- package/lib/types/domain/__tests__/Room.test.d.ts.map +1 -0
- package/lib/types/domain/__tests__/Session.test.d.ts +2 -0
- package/lib/types/domain/__tests__/Session.test.d.ts.map +1 -0
- package/lib/types/domain/__tests__/SipLine.test.d.ts +2 -0
- package/lib/types/domain/__tests__/SipLine.test.d.ts.map +1 -0
- package/lib/types/domain/__tests__/Voicemail.test.d.ts +2 -0
- package/lib/types/domain/__tests__/Voicemail.test.d.ts.map +1 -0
- package/lib/types/domain/types.d.ts +217 -0
- package/lib/types/domain/types.d.ts.map +1 -0
- package/lib/types/index.d.ts +304 -0
- package/lib/types/index.d.ts.map +1 -0
- package/lib/types/lib/WazoSessionDescriptionHandler.d.ts +30 -0
- package/lib/types/lib/WazoSessionDescriptionHandler.d.ts.map +1 -0
- package/lib/types/pubkey.d.ts +3 -0
- package/lib/types/pubkey.d.ts.map +1 -0
- package/lib/types/service/CallApi.d.ts +28 -0
- package/lib/types/service/CallApi.d.ts.map +1 -0
- package/lib/types/service/IssueReporter.d.ts +40 -0
- package/lib/types/service/IssueReporter.d.ts.map +1 -0
- package/lib/types/service/__tests__/IssueReporter.test.d.ts +2 -0
- package/lib/types/service/__tests__/IssueReporter.test.d.ts.map +1 -0
- package/lib/types/service/getApiClient.d.ts +16 -0
- package/lib/types/service/getApiClient.d.ts.map +1 -0
- package/lib/types/simple/Auth.d.ts +51 -0
- package/lib/types/simple/Auth.d.ts.map +1 -0
- package/lib/types/simple/Configuration.d.ts +3 -0
- package/lib/types/simple/Configuration.d.ts.map +1 -0
- package/lib/types/simple/Directory.d.ts +3 -0
- package/lib/types/simple/Directory.d.ts.map +1 -0
- package/lib/types/simple/Phone.d.ts +115 -0
- package/lib/types/simple/Phone.d.ts.map +1 -0
- package/lib/types/simple/Websocket.d.ts +19 -0
- package/lib/types/simple/Websocket.d.ts.map +1 -0
- package/lib/types/simple/index.d.ts +147 -0
- package/lib/types/simple/index.d.ts.map +1 -0
- package/lib/types/simple/room/LocalParticipant.d.ts +5 -0
- package/lib/types/simple/room/LocalParticipant.d.ts.map +1 -0
- package/lib/types/simple/room/Participant.d.ts +76 -0
- package/lib/types/simple/room/Participant.d.ts.map +1 -0
- package/lib/types/simple/room/RemoteParticipant.d.ts +7 -0
- package/lib/types/simple/room/RemoteParticipant.d.ts.map +1 -0
- package/lib/types/simple/room/Room.d.ts +116 -0
- package/lib/types/simple/room/Room.d.ts.map +1 -0
- package/lib/types/simple/room/SipRoom.d.ts +14 -0
- package/lib/types/simple/room/SipRoom.d.ts.map +1 -0
- package/lib/types/simple/room/Stream.d.ts +13 -0
- package/lib/types/simple/room/Stream.d.ts.map +1 -0
- package/lib/types/simple/room/__tests__/Participant.test.d.ts +2 -0
- package/lib/types/simple/room/__tests__/Participant.test.d.ts.map +1 -0
- package/lib/types/simple/room/__tests__/RemoteParticipant.test.d.ts +2 -0
- package/lib/types/simple/room/__tests__/RemoteParticipant.test.d.ts.map +1 -0
- package/lib/types/simple/utils.d.ts +3 -0
- package/lib/types/simple/utils.d.ts.map +1 -0
- package/lib/types/types/WebSocketMessage.d.ts +285 -0
- package/lib/types/types/WebSocketMessage.d.ts.map +1 -0
- package/lib/types/utils/Emitter.d.ts +18 -0
- package/lib/types/utils/Emitter.d.ts.map +1 -0
- package/lib/types/utils/Heartbeat.d.ts +21 -0
- package/lib/types/utils/Heartbeat.d.ts.map +1 -0
- package/lib/types/utils/PhoneNumberUtil.d.ts +8 -0
- package/lib/types/utils/PhoneNumberUtil.d.ts.map +1 -0
- package/lib/types/utils/__tests__/Heartbeat.test.d.ts +2 -0
- package/lib/types/utils/__tests__/Heartbeat.test.d.ts.map +1 -0
- package/lib/types/utils/__tests__/PhoneNumberUtil.test.d.ts +2 -0
- package/lib/types/utils/__tests__/PhoneNumberUtil.test.d.ts.map +1 -0
- package/lib/types/utils/__tests__/api-requester.test.d.ts +2 -0
- package/lib/types/utils/__tests__/api-requester.test.d.ts.map +1 -0
- package/lib/types/utils/__tests__/array.test.d.ts +2 -0
- package/lib/types/utils/__tests__/array.test.d.ts.map +1 -0
- package/lib/types/utils/__tests__/compare-version.test.d.ts +2 -0
- package/lib/types/utils/__tests__/compare-version.test.d.ts.map +1 -0
- package/lib/types/utils/__tests__/object.test.d.ts +2 -0
- package/lib/types/utils/__tests__/object.test.d.ts.map +1 -0
- package/lib/types/utils/__tests__/sdp.test.d.ts +2 -0
- package/lib/types/utils/__tests__/sdp.test.d.ts.map +1 -0
- package/lib/types/utils/__tests__/string.test.d.ts +2 -0
- package/lib/types/utils/__tests__/string.test.d.ts.map +1 -0
- package/lib/types/utils/api-requester.d.ts +45 -0
- package/lib/types/utils/api-requester.d.ts.map +1 -0
- package/lib/types/utils/array.d.ts +2 -0
- package/lib/types/utils/array.d.ts.map +1 -0
- package/lib/types/utils/compare-version.d.ts +3 -0
- package/lib/types/utils/compare-version.d.ts.map +1 -0
- package/lib/types/utils/isMobile.d.ts +3 -0
- package/lib/types/utils/isMobile.d.ts.map +1 -0
- package/lib/types/utils/new-from.d.ts +3 -0
- package/lib/types/utils/new-from.d.ts.map +1 -0
- package/lib/types/utils/object.d.ts +2 -0
- package/lib/types/utils/object.d.ts.map +1 -0
- package/lib/types/utils/once.d.ts +2 -0
- package/lib/types/utils/once.d.ts.map +1 -0
- package/lib/types/utils/sdp.d.ts +13 -0
- package/lib/types/utils/sdp.d.ts.map +1 -0
- package/lib/types/utils/string.d.ts +2 -0
- package/lib/types/utils/string.d.ts.map +1 -0
- package/lib/types/utils/update-from.d.ts +3 -0
- package/lib/types/utils/update-from.d.ts.map +1 -0
- package/lib/types/utils/webrtc.d.ts +15 -0
- package/lib/types/utils/webrtc.d.ts.map +1 -0
- package/lib/types/web-rtc-client.d.ts +220 -0
- package/lib/types/web-rtc-client.d.ts.map +1 -0
- package/lib/types/websocket-client.d.ts +134 -0
- package/lib/types/websocket-client.d.ts.map +1 -0
- package/lib/utils/Emitter.js +22 -33
- package/lib/utils/Heartbeat.js +54 -86
- package/lib/utils/PhoneNumberUtil.js +60 -77
- package/lib/utils/__tests__/Heartbeat.test.js +73 -170
- package/lib/utils/__tests__/PhoneNumberUtil.test.js +57 -131
- package/lib/utils/__tests__/api-requester.test.js +139 -784
- package/lib/utils/__tests__/array.test.js +18 -21
- package/lib/utils/__tests__/compare-version.test.js +12 -27
- package/lib/utils/__tests__/object.test.js +75 -56
- package/lib/utils/__tests__/sdp.test.js +99 -220
- package/lib/utils/__tests__/string.test.js +23 -29
- package/lib/utils/api-requester.js +191 -685
- package/lib/utils/array.js +10 -14
- package/lib/utils/compare-version.js +15 -18
- package/lib/utils/isMobile.js +3 -5
- package/lib/utils/new-from.js +9 -14
- package/lib/utils/object.js +12 -26
- package/lib/utils/once.js +15 -15
- package/lib/utils/sdp.js +97 -150
- package/lib/utils/string.js +8 -12
- package/lib/utils/update-from.js +11 -18
- package/lib/utils/webrtc.js +38 -39
- package/lib/web-rtc-client.js +2070 -7694
- package/lib/websocket-client.js +357 -1021
- package/package.json +41 -34
- package/src/__tests__/{api-client.test.js → api-client.test.ts} +71 -29
- package/src/__tests__/{web-rtc-client.test.js → web-rtc-client.test.ts} +95 -35
- package/src/api/agentd.ts +37 -0
- package/src/api/amid.ts +16 -0
- package/src/api/application.ts +96 -0
- package/src/api/auth.ts +259 -0
- package/src/api/call-logd.ts +38 -0
- package/src/api/calld.ts +183 -0
- package/src/api/chatd.ts +101 -0
- package/src/api/confd.ts +110 -0
- package/src/api/ctid-ng.ts +152 -0
- package/src/api/dird.ts +146 -0
- package/src/api/webhookd.ts +30 -0
- package/src/{api-client.js → api-client.ts} +103 -67
- package/src/checker/{Checker.js → Checker.ts} +27 -20
- package/src/checker/checks/{aor.js → aor.ts} +10 -6
- package/src/checker/checks/{api.js → api.ts} +18 -17
- package/src/checker/checks/{ice-ipv4.js → ice-ipv4.ts} +23 -26
- package/src/checker/checks/{index.js → index.ts} +1 -9
- package/src/checker/checks/{symmetric-nat.js → symmetric-nat.ts} +14 -15
- package/src/checker/checks/{wazo-websocket.js → wazo-websocket.ts} +7 -5
- package/src/checker/checks/{webrtc-transport.js → webrtc-transport.ts} +3 -2
- package/src/checker/checks/{webrtc.js → webrtc.ts} +3 -4
- package/src/domain/{AdHocAPIConference.js → AdHocAPIConference.ts} +38 -54
- package/src/domain/{Agent.js → Agent.ts} +11 -7
- package/src/domain/BadResponse.ts +29 -0
- package/src/domain/{Call.js → Call.ts} +62 -46
- package/src/domain/{CallLog.js → CallLog.ts} +61 -63
- package/src/domain/{CallSession.js → CallSession.ts} +55 -52
- package/src/domain/{ChatMessage.js → ChatMessage.ts} +32 -21
- package/src/domain/{ChatRoom.js → ChatRoom.ts} +15 -11
- package/src/domain/{Contact.js → Contact.ts} +380 -262
- package/src/domain/Device/{DebugDevice.js → DebugDevice.ts} +3 -5
- package/src/domain/Device/{Device.js → Device.ts} +0 -11
- package/src/domain/DirectorySource.ts +13 -0
- package/src/domain/{ExternalApp.js → ExternalApp.ts} +14 -13
- package/src/domain/{Features.js → Features.ts} +43 -17
- package/src/domain/{ForwardOption.js → ForwardOption.ts} +16 -16
- package/src/domain/{IndirectTransfer.js → IndirectTransfer.ts} +21 -19
- package/src/domain/{Line.js → Line.ts} +39 -26
- package/src/domain/{Meeting.js → Meeting.ts} +36 -29
- package/src/domain/{MeetingAuthorization.js → MeetingAuthorization.ts} +13 -12
- package/src/domain/{MeetingStatus.js → MeetingStatus.ts} +2 -6
- package/src/domain/{NotificationOptions.js → NotificationOptions.ts} +14 -13
- package/src/domain/Phone/{CTIPhone.js → CTIPhone.ts} +90 -60
- package/src/domain/Phone/{Phone.js → Phone.ts} +27 -72
- package/src/domain/Phone/{WebRTCPhone.js → WebRTCPhone.ts} +456 -422
- package/src/domain/{Profile.js → Profile.ts} +117 -100
- package/src/domain/{Recording.js → Recording.ts} +25 -16
- package/src/domain/{Relocation.js → Relocation.ts} +15 -14
- package/src/domain/{Room.js → Room.ts} +58 -27
- package/src/domain/{SFUNotAvailableError.js → SFUNotAvailableError.ts} +2 -2
- package/src/domain/ServerError.ts +12 -0
- package/src/domain/{Session.js → Session.ts} +89 -67
- package/src/domain/{SipLine.js → SipLine.ts} +52 -45
- package/src/domain/{Subscription.js → Subscription.ts} +22 -13
- package/src/domain/{SwitchboardCall.js → SwitchboardCall.ts} +48 -43
- package/src/domain/{Voicemail.js → Voicemail.ts} +38 -34
- package/src/domain/__tests__/{Agent.test.js → Agent.test.ts} +11 -19
- package/src/domain/__tests__/{Call.test.js → Call.test.ts} +12 -9
- package/src/domain/__tests__/CallLog.test.ts +65 -0
- package/src/domain/__tests__/{CallSession.test.js → CallSession.test.ts} +15 -19
- package/src/domain/__tests__/Contact.test.ts +238 -0
- package/src/domain/__tests__/{IndirectTransfer.test.js → IndirectTransfer.test.ts} +38 -31
- package/src/domain/__tests__/Line.test.ts +53 -0
- package/src/domain/__tests__/{Meeting.test.js → Meeting.test.ts} +12 -38
- package/src/domain/__tests__/{MeetingAuthorization.test.js → MeetingAuthorization.test.ts} +13 -21
- package/src/domain/__tests__/Profile.test.ts +139 -0
- package/src/domain/__tests__/{Room.test.js → Room.test.ts} +114 -76
- package/src/domain/__tests__/{Session.test.js → Session.test.ts} +137 -162
- package/src/domain/__tests__/{SipLine.test.js → SipLine.test.ts} +7 -3
- package/src/domain/__tests__/{Voicemail.test.js → Voicemail.test.ts} +26 -20
- package/src/domain/types.ts +227 -0
- package/src/{index.js → index.ts} +4 -28
- package/src/lib/WazoSessionDescriptionHandler.ts +534 -0
- package/{config.js → src/pubkey.ts} +3 -3
- package/src/service/{CallApi.js → CallApi.ts} +14 -18
- package/src/service/{IssueReporter.js → IssueReporter.ts} +105 -56
- package/src/service/__tests__/{IssueReporter.test.js → IssueReporter.test.ts} +27 -23
- package/src/service/getApiClient.ts +94 -0
- package/src/simple/{Auth.js → Auth.ts} +130 -101
- package/src/simple/{Configuration.js → Configuration.ts} +2 -3
- package/src/simple/{Directory.js → Directory.ts} +2 -3
- package/src/simple/Phone.ts +623 -0
- package/src/simple/Websocket.ts +119 -0
- package/src/simple/{index.js → index.ts} +51 -21
- package/src/simple/room/{LocalParticipant.js → LocalParticipant.ts} +1 -3
- package/src/simple/room/{Participant.js → Participant.ts} +108 -46
- package/src/simple/room/{RemoteParticipant.js → RemoteParticipant.ts} +5 -4
- package/src/simple/room/{Room.js → Room.ts} +266 -183
- package/src/simple/room/{SipRoom.js → SipRoom.ts} +46 -29
- package/src/simple/room/{Stream.js → Stream.ts} +8 -6
- package/src/simple/room/__tests__/{Participant.test.js → Participant.test.ts} +9 -15
- package/src/simple/room/__tests__/{RemoteParticipant.test.js → RemoteParticipant.test.ts} +5 -1
- package/src/simple/utils.ts +12 -0
- package/src/types/WebSocketMessage.ts +335 -0
- package/src/types/global.d.ts +26 -0
- package/src/utils/Emitter.ts +34 -0
- package/src/utils/{Heartbeat.js → Heartbeat.ts} +17 -11
- package/src/utils/{PhoneNumberUtil.js → PhoneNumberUtil.ts} +12 -18
- package/src/utils/__tests__/{Heartbeat.test.js → Heartbeat.test.ts} +0 -15
- package/src/utils/__tests__/{PhoneNumberUtil.test.js → PhoneNumberUtil.test.ts} +6 -4
- package/src/utils/__tests__/{api-requester.test.js → api-requester.test.ts} +75 -24
- package/src/utils/__tests__/{array.test.js → array.test.ts} +10 -2
- package/src/utils/__tests__/object.test.ts +77 -0
- package/src/utils/__tests__/{sdp.test.js → sdp.test.ts} +15 -37
- package/src/utils/__tests__/{string.test.js → string.test.ts} +4 -2
- package/src/utils/{api-requester.js → api-requester.ts} +104 -83
- package/src/utils/{array.js → array.ts} +2 -2
- package/src/utils/{compare-version.js → compare-version.ts} +3 -2
- package/src/utils/{isMobile.js → isMobile.ts} +1 -1
- package/src/utils/{new-from.js → new-from.ts} +3 -6
- package/src/utils/{object.js → object.ts} +3 -6
- package/src/utils/{once.js → once.ts} +5 -5
- package/src/utils/sdp.ts +119 -0
- package/src/utils/{string.js → string.ts} +2 -3
- package/src/utils/update-from.ts +11 -0
- package/src/utils/{webrtc.js → webrtc.ts} +21 -3
- package/src/{web-rtc-client.js → web-rtc-client.ts} +879 -476
- package/src/{websocket-client.js → websocket-client.ts} +146 -144
- package/esm/simple/Softphone.js +0 -394
- package/lib/simple/Softphone.js +0 -396
- package/src/api/agentd.js +0 -74
- package/src/api/amid.js +0 -13
- package/src/api/application.js +0 -137
- package/src/api/auth.js +0 -279
- package/src/api/call-logd.js +0 -20
- package/src/api/calld.js +0 -214
- package/src/api/chatd.js +0 -80
- package/src/api/confd.js +0 -127
- package/src/api/ctid-ng.js +0 -153
- package/src/api/dird.js +0 -159
- package/src/api/webhookd.js +0 -31
- package/src/domain/BadResponse.js +0 -42
- package/src/domain/DirectorySource.js +0 -16
- package/src/domain/ServerError.js +0 -18
- package/src/domain/__tests__/CallLog.test.js +0 -75
- package/src/domain/__tests__/Contact.test.js +0 -170
- package/src/domain/__tests__/Line.test.js +0 -73
- package/src/domain/__tests__/Profile.test.js +0 -104
- package/src/domain/types.js +0 -248
- package/src/lib/WazoSessionDescriptionHandler.js +0 -467
- package/src/service/getApiClient.js +0 -122
- package/src/simple/Phone.js +0 -425
- package/src/simple/Softphone.js +0 -392
- package/src/simple/Websocket.js +0 -86
- package/src/simple/utils.js +0 -17
- package/src/types/WebSocketMessage.js +0 -232
- package/src/utils/Emitter.js +0 -26
- package/src/utils/__tests__/object.test.js +0 -35
- package/src/utils/sdp.js +0 -140
- package/src/utils/update-from.js +0 -15
- /package/src/domain/{Country.js → Country.ts} +0 -0
- /package/src/utils/__tests__/{compare-version.test.js → compare-version.test.ts} +0 -0
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
// @flow
|
|
2
|
-
|
|
3
1
|
import Session from './Session';
|
|
4
2
|
import { LINE_STATE, STATE } from './Profile';
|
|
5
3
|
import newFrom from '../utils/new-from';
|
|
@@ -11,257 +9,305 @@ export const BACKEND = {
|
|
|
11
9
|
GOOGLE: 'google',
|
|
12
10
|
WAZO: 'wazo',
|
|
13
11
|
};
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
};
|
|
27
|
-
|
|
12
|
+
export interface NewContact {
|
|
13
|
+
firstName: string;
|
|
14
|
+
lastName: string;
|
|
15
|
+
phoneNumber: string;
|
|
16
|
+
email: string | null | undefined;
|
|
17
|
+
address: string | null | undefined;
|
|
18
|
+
entreprise: string | null | undefined;
|
|
19
|
+
birthday: string | null | undefined;
|
|
20
|
+
note: string | null | undefined;
|
|
21
|
+
sessions: Array<{
|
|
22
|
+
uuid: string;
|
|
23
|
+
mobile: boolean;
|
|
24
|
+
}> | null | undefined;
|
|
25
|
+
connected: boolean | null | undefined;
|
|
26
|
+
}
|
|
28
27
|
export type ContactResponse = {
|
|
29
|
-
source: string
|
|
30
|
-
backend: string
|
|
31
|
-
column_values: Array<any
|
|
28
|
+
source: string;
|
|
29
|
+
backend: string;
|
|
30
|
+
column_values: Array<any>;
|
|
32
31
|
relations: {
|
|
33
|
-
user_id: number
|
|
34
|
-
xivo_id: string
|
|
35
|
-
agent_id:
|
|
36
|
-
endpoint_id: number
|
|
37
|
-
user_uuid: string
|
|
38
|
-
source_entry_id: string
|
|
39
|
-
}
|
|
32
|
+
user_id: number;
|
|
33
|
+
xivo_id: string;
|
|
34
|
+
agent_id: number | null | undefined;
|
|
35
|
+
endpoint_id: number;
|
|
36
|
+
user_uuid: string;
|
|
37
|
+
source_entry_id: string;
|
|
38
|
+
};
|
|
40
39
|
};
|
|
41
|
-
|
|
42
40
|
export type ContactsResponse = {
|
|
43
|
-
column_types: Array
|
|
44
|
-
term: string
|
|
45
|
-
column_headers: Array<string
|
|
46
|
-
results: Array<ContactResponse
|
|
41
|
+
column_types: Array<string | null | undefined>;
|
|
42
|
+
term: string;
|
|
43
|
+
column_headers: Array<string>;
|
|
44
|
+
results: Array<ContactResponse>;
|
|
47
45
|
};
|
|
48
|
-
|
|
49
46
|
export type ContactPersonalResponse = {
|
|
50
|
-
id: string
|
|
51
|
-
firstName:
|
|
52
|
-
lastName:
|
|
53
|
-
number:
|
|
54
|
-
numbers:
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
47
|
+
id: string;
|
|
48
|
+
firstName: string | null | undefined;
|
|
49
|
+
lastName: string | null | undefined;
|
|
50
|
+
number: string | null | undefined;
|
|
51
|
+
numbers: Array<{
|
|
52
|
+
label?: string;
|
|
53
|
+
number: string;
|
|
54
|
+
}> | null | undefined;
|
|
55
|
+
email: string | null | undefined;
|
|
56
|
+
entreprise: string | null | undefined;
|
|
57
|
+
birthday: string | null | undefined;
|
|
58
|
+
address: string | null | undefined;
|
|
59
|
+
note: string | null | undefined;
|
|
60
60
|
// @TODO: legacy ?
|
|
61
|
-
firstname:
|
|
62
|
-
lastname:
|
|
63
|
-
backend:
|
|
64
|
-
favorited: boolean
|
|
61
|
+
firstname: string | null | undefined;
|
|
62
|
+
lastname: string | null | undefined;
|
|
63
|
+
backend: string | null | undefined;
|
|
64
|
+
favorited: boolean;
|
|
65
65
|
};
|
|
66
|
-
|
|
67
66
|
export type ContactsGraphQlResponse = {
|
|
68
67
|
data: {
|
|
69
68
|
me: {
|
|
70
69
|
contacts: {
|
|
71
70
|
edges: Array<{
|
|
72
71
|
node: {
|
|
73
|
-
firstname?: string
|
|
74
|
-
lastname?: string
|
|
75
|
-
wazoReverse?: string
|
|
76
|
-
wazoSourceName?: string
|
|
77
|
-
wazoBackend?: string
|
|
78
|
-
email?: string
|
|
79
|
-
wazoSourceEntryId?: string
|
|
80
|
-
userUuid?: string
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
}
|
|
72
|
+
firstname?: string;
|
|
73
|
+
lastname?: string;
|
|
74
|
+
wazoReverse?: string;
|
|
75
|
+
wazoSourceName?: string;
|
|
76
|
+
wazoBackend?: string;
|
|
77
|
+
email?: string;
|
|
78
|
+
wazoSourceEntryId?: string;
|
|
79
|
+
userUuid?: string;
|
|
80
|
+
};
|
|
81
|
+
}>;
|
|
82
|
+
};
|
|
83
|
+
};
|
|
84
|
+
};
|
|
86
85
|
};
|
|
87
|
-
|
|
88
86
|
// @see: https://github.com/rt2zz/react-native-contacts#example-contact-record
|
|
89
87
|
export type ContactMobileResponse = {
|
|
90
|
-
recordID: string
|
|
91
|
-
company: string
|
|
88
|
+
recordID: string;
|
|
89
|
+
company: string;
|
|
92
90
|
emailAddresses: Array<{
|
|
93
|
-
label: string
|
|
94
|
-
email: string
|
|
95
|
-
}
|
|
96
|
-
givenName: string
|
|
97
|
-
familyName: string
|
|
98
|
-
middleName: string
|
|
99
|
-
jobTitle: string
|
|
100
|
-
note: string
|
|
91
|
+
label: string;
|
|
92
|
+
email: string;
|
|
93
|
+
}>;
|
|
94
|
+
givenName: string;
|
|
95
|
+
familyName: string;
|
|
96
|
+
middleName: string;
|
|
97
|
+
jobTitle: string;
|
|
98
|
+
note: string;
|
|
101
99
|
urlAddresses: Array<{
|
|
102
|
-
label: string
|
|
103
|
-
url: string
|
|
104
|
-
}
|
|
100
|
+
label: string;
|
|
101
|
+
url: string;
|
|
102
|
+
}>;
|
|
105
103
|
phoneNumbers: Array<{
|
|
106
|
-
label: string
|
|
107
|
-
number: string
|
|
108
|
-
}
|
|
109
|
-
hasThumbnail: boolean
|
|
110
|
-
thumbnailPath: string
|
|
104
|
+
label: string;
|
|
105
|
+
number: string;
|
|
106
|
+
}>;
|
|
107
|
+
hasThumbnail: boolean;
|
|
108
|
+
thumbnailPath: string;
|
|
111
109
|
postalAddresses: Array<{
|
|
112
|
-
street: string
|
|
113
|
-
city: string
|
|
114
|
-
state: string
|
|
115
|
-
region: string
|
|
116
|
-
postCode: string
|
|
117
|
-
country: string
|
|
118
|
-
label: string
|
|
119
|
-
}
|
|
110
|
+
street: string;
|
|
111
|
+
city: string;
|
|
112
|
+
state: string;
|
|
113
|
+
region: string;
|
|
114
|
+
postCode: string;
|
|
115
|
+
country: string;
|
|
116
|
+
label: string;
|
|
117
|
+
}>;
|
|
120
118
|
birthday: {
|
|
121
|
-
year: number
|
|
122
|
-
month: number
|
|
123
|
-
day: number
|
|
124
|
-
}
|
|
119
|
+
year: number;
|
|
120
|
+
month: number;
|
|
121
|
+
day: number;
|
|
122
|
+
};
|
|
125
123
|
};
|
|
126
|
-
|
|
127
124
|
type ContactArguments = {
|
|
128
|
-
id?: string
|
|
129
|
-
uuid?: string
|
|
130
|
-
name?: string
|
|
131
|
-
number?: string
|
|
132
|
-
numbers?: Array<{
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
125
|
+
id?: string;
|
|
126
|
+
uuid?: string;
|
|
127
|
+
name?: string;
|
|
128
|
+
number?: string;
|
|
129
|
+
numbers?: Array<{
|
|
130
|
+
label?: string;
|
|
131
|
+
number: string;
|
|
132
|
+
}>;
|
|
133
|
+
favorited?: boolean;
|
|
134
|
+
email?: string;
|
|
135
|
+
emails?: Array<{
|
|
136
|
+
label?: string;
|
|
137
|
+
email: string;
|
|
138
|
+
}>;
|
|
139
|
+
entreprise?: string;
|
|
140
|
+
birthday?: string;
|
|
141
|
+
address?: string;
|
|
142
|
+
note?: string;
|
|
143
|
+
endpointId?: number;
|
|
144
|
+
personal?: boolean;
|
|
145
|
+
state?: string;
|
|
146
|
+
source?: string;
|
|
147
|
+
sourceId?: string | null | undefined;
|
|
148
|
+
lineState?: string;
|
|
149
|
+
previousPresential?: string;
|
|
147
150
|
lastActivity?: string;
|
|
148
|
-
mobile?: boolean
|
|
149
|
-
status?: string
|
|
150
|
-
backend?: string
|
|
151
|
-
personalStatus?: string
|
|
152
|
-
sessions?: Array<{
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
151
|
+
mobile?: boolean;
|
|
152
|
+
status?: string;
|
|
153
|
+
backend?: string;
|
|
154
|
+
personalStatus?: string;
|
|
155
|
+
sessions?: Array<{
|
|
156
|
+
uuid: string;
|
|
157
|
+
mobile: boolean;
|
|
158
|
+
}>;
|
|
159
|
+
connected?: boolean;
|
|
160
|
+
doNotDisturb?: boolean;
|
|
161
|
+
ringing?: boolean;
|
|
162
|
+
lines?: Record<string, any>[];
|
|
157
163
|
};
|
|
158
|
-
|
|
159
164
|
type Office365Response = {
|
|
160
|
-
assistantName: any
|
|
161
|
-
birthday: any
|
|
162
|
-
businessAddress: any
|
|
163
|
-
businessHomePage: any
|
|
164
|
-
businessPhones: Array<any
|
|
165
|
-
categories: Array<any
|
|
166
|
-
changeKey: string
|
|
167
|
-
children: Array<any
|
|
168
|
-
companyName: any
|
|
169
|
-
createdDateTime: string
|
|
170
|
-
department: any
|
|
171
|
-
displayName: string
|
|
172
|
-
emailAddresses: Array<{
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
165
|
+
assistantName: any;
|
|
166
|
+
birthday: any;
|
|
167
|
+
businessAddress: any;
|
|
168
|
+
businessHomePage: any;
|
|
169
|
+
businessPhones: Array<any>;
|
|
170
|
+
categories: Array<any>;
|
|
171
|
+
changeKey: string;
|
|
172
|
+
children: Array<any>;
|
|
173
|
+
companyName: any;
|
|
174
|
+
createdDateTime: string;
|
|
175
|
+
department: any;
|
|
176
|
+
displayName: string;
|
|
177
|
+
emailAddresses: Array<{
|
|
178
|
+
name: string;
|
|
179
|
+
address: string;
|
|
180
|
+
}>;
|
|
181
|
+
fileAs: string;
|
|
182
|
+
generation: any;
|
|
183
|
+
givenName: any;
|
|
184
|
+
homeAddress: any;
|
|
185
|
+
homePhones: string[];
|
|
186
|
+
id: string;
|
|
187
|
+
imAddresses: any;
|
|
188
|
+
initials: any;
|
|
189
|
+
jobTitle: any;
|
|
190
|
+
lastModifiedDateTime: string;
|
|
191
|
+
manager: any;
|
|
192
|
+
middleName: any;
|
|
193
|
+
mobilePhone: string;
|
|
194
|
+
nickName: any;
|
|
195
|
+
officeLocation: any;
|
|
196
|
+
otherAddress: any;
|
|
197
|
+
parentFolderId: string;
|
|
198
|
+
personalNotes: string;
|
|
199
|
+
profession: any;
|
|
200
|
+
spouseName: any;
|
|
201
|
+
surname: string;
|
|
202
|
+
title: any;
|
|
203
|
+
yomiCompanyName: any;
|
|
204
|
+
yomiGivenName: any;
|
|
205
|
+
yomiSurname: any;
|
|
198
206
|
};
|
|
199
|
-
|
|
200
207
|
type WazoResponse = {
|
|
201
|
-
email: string
|
|
202
|
-
exten: string
|
|
203
|
-
firstname: string
|
|
204
|
-
lastname: string
|
|
205
|
-
mobile_phone_number: any
|
|
206
|
-
uuid: string
|
|
207
|
-
id: string
|
|
208
|
-
voicemail_number: any
|
|
208
|
+
email: string;
|
|
209
|
+
exten: string;
|
|
210
|
+
firstname: string;
|
|
211
|
+
lastname: string;
|
|
212
|
+
mobile_phone_number: any;
|
|
213
|
+
uuid: string;
|
|
214
|
+
id: string;
|
|
215
|
+
voicemail_number: any;
|
|
209
216
|
};
|
|
210
217
|
type ConferenceResponse = {
|
|
211
|
-
backend: string
|
|
212
|
-
name: string
|
|
213
|
-
id: number
|
|
214
|
-
extensions: Array<{
|
|
215
|
-
|
|
218
|
+
backend: string;
|
|
219
|
+
name: string;
|
|
220
|
+
id: number;
|
|
221
|
+
extensions: Array<{
|
|
222
|
+
context: string;
|
|
223
|
+
exten: string;
|
|
224
|
+
}>;
|
|
225
|
+
incalls: Array<{
|
|
226
|
+
context: string;
|
|
227
|
+
exten: string;
|
|
228
|
+
}>;
|
|
216
229
|
};
|
|
217
|
-
|
|
218
230
|
type GoogleResponse = {
|
|
219
|
-
emails: string[]
|
|
220
|
-
id: string
|
|
221
|
-
name: string
|
|
222
|
-
numbers: string[]
|
|
223
|
-
numbers_by_label: any
|
|
231
|
+
emails: string[];
|
|
232
|
+
id: string;
|
|
233
|
+
name: string;
|
|
234
|
+
numbers: string[];
|
|
235
|
+
numbers_by_label: any;
|
|
224
236
|
};
|
|
225
|
-
|
|
226
237
|
const SOURCE_MOBILE = 'mobile';
|
|
227
|
-
|
|
228
238
|
export default class Contact {
|
|
229
239
|
type: string;
|
|
230
240
|
|
|
231
|
-
id:
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
241
|
+
id: string | null | undefined;
|
|
242
|
+
|
|
243
|
+
uuid: string | null | undefined;
|
|
244
|
+
|
|
245
|
+
name: string | null | undefined;
|
|
246
|
+
|
|
247
|
+
number: string | null | undefined;
|
|
248
|
+
|
|
249
|
+
numbers: Array<{
|
|
250
|
+
label?: string;
|
|
251
|
+
number: string;
|
|
252
|
+
}> | null | undefined;
|
|
253
|
+
|
|
254
|
+
favorited: boolean | null | undefined;
|
|
255
|
+
|
|
256
|
+
email: string | null | undefined;
|
|
257
|
+
|
|
258
|
+
emails: Array<{
|
|
259
|
+
label?: string;
|
|
260
|
+
email: string;
|
|
261
|
+
}> | null | undefined;
|
|
262
|
+
|
|
263
|
+
entreprise: string | null | undefined;
|
|
264
|
+
|
|
265
|
+
birthday: string | null | undefined;
|
|
266
|
+
|
|
267
|
+
address: string | null | undefined;
|
|
268
|
+
|
|
269
|
+
note: string | null | undefined;
|
|
270
|
+
|
|
271
|
+
endpointId: number | null | undefined;
|
|
272
|
+
|
|
273
|
+
personal: boolean | null | undefined;
|
|
274
|
+
|
|
275
|
+
state: string | null | undefined;
|
|
276
|
+
|
|
277
|
+
lineState: string | null | undefined;
|
|
278
|
+
|
|
279
|
+
previousPresential: string | null | undefined;
|
|
280
|
+
|
|
281
|
+
lastActivity: string | null | undefined;
|
|
282
|
+
|
|
283
|
+
mobile: boolean | null | undefined;
|
|
284
|
+
|
|
285
|
+
source: string | null | undefined;
|
|
286
|
+
|
|
287
|
+
sourceId: string | null | undefined;
|
|
288
|
+
|
|
289
|
+
status: string | null | undefined;
|
|
290
|
+
|
|
291
|
+
backend: string | null | undefined;
|
|
292
|
+
|
|
254
293
|
personalStatus: string;
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
294
|
+
|
|
295
|
+
sessions: Array<{
|
|
296
|
+
uuid: string;
|
|
297
|
+
mobile: boolean;
|
|
298
|
+
}> | null | undefined;
|
|
299
|
+
|
|
300
|
+
connected: boolean | null | undefined;
|
|
301
|
+
|
|
302
|
+
doNotDisturb: boolean | null | undefined;
|
|
303
|
+
|
|
304
|
+
ringing: boolean | null | undefined;
|
|
305
|
+
|
|
306
|
+
lines: Record<string, any>[];
|
|
260
307
|
|
|
261
308
|
static merge(oldContacts: Array<Contact>, newContacts: Array<Contact>): Array<Contact> {
|
|
262
309
|
return newContacts.map(current => {
|
|
263
310
|
const old = oldContacts.find(contact => contact && contact.is(current));
|
|
264
|
-
|
|
265
311
|
return old ? current.merge(old) : current;
|
|
266
312
|
});
|
|
267
313
|
}
|
|
@@ -284,10 +330,11 @@ export default class Contact {
|
|
|
284
330
|
if (!response || !response.results) {
|
|
285
331
|
return [];
|
|
286
332
|
}
|
|
333
|
+
|
|
287
334
|
return response.results.map(r => Contact.parse(r, response.column_types));
|
|
288
335
|
}
|
|
289
336
|
|
|
290
|
-
static manyGraphQlWithNumbersParser(numbers: string[]):
|
|
337
|
+
static manyGraphQlWithNumbersParser(numbers: string[]): (...args: Array<any>) => any {
|
|
291
338
|
return (response: ContactsGraphQlResponse) => {
|
|
292
339
|
if (!response.data || !response.data.me || !response.data.me.contacts) {
|
|
293
340
|
return [];
|
|
@@ -298,45 +345,55 @@ export default class Contact {
|
|
|
298
345
|
return null;
|
|
299
346
|
}
|
|
300
347
|
|
|
301
|
-
const {
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
348
|
+
const {
|
|
349
|
+
email,
|
|
350
|
+
} = edge.node;
|
|
351
|
+
const name = edge.node.firstname && edge.node.lastname ? `${edge.node.firstname || ''} ${edge.node.lastname || ''}` : edge.node.wazoReverse;
|
|
305
352
|
return new Contact({
|
|
306
353
|
name,
|
|
307
354
|
number: numbers[i],
|
|
308
|
-
numbers: [{
|
|
355
|
+
numbers: [{
|
|
356
|
+
label: 'primary',
|
|
357
|
+
number: numbers[i],
|
|
358
|
+
}],
|
|
309
359
|
backend: edge.node.wazoBackend,
|
|
310
360
|
source: edge.node.wazoSourceName,
|
|
311
361
|
sourceId: edge.node.wazoSourceEntryId || '',
|
|
312
362
|
email: email || '',
|
|
313
|
-
emails: email ? [{
|
|
363
|
+
emails: email ? [{
|
|
364
|
+
label: 'primary',
|
|
365
|
+
email,
|
|
366
|
+
}] : [],
|
|
314
367
|
uuid: edge.node.userUuid,
|
|
315
368
|
});
|
|
316
369
|
}).filter(contact => !!contact);
|
|
317
370
|
};
|
|
318
371
|
}
|
|
319
372
|
|
|
320
|
-
static fetchNumbers(plain: ContactResponse, columns: Array
|
|
321
|
-
const numberColumns = columns
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
373
|
+
static fetchNumbers(plain: ContactResponse, columns: Array<string | null | undefined>): Array<string> {
|
|
374
|
+
const numberColumns = columns.map((e, index) => ({
|
|
375
|
+
index,
|
|
376
|
+
columnName: e,
|
|
377
|
+
})).filter(e => e.columnName === 'number' || e.columnName === 'callable').map(e => e.index);
|
|
326
378
|
return plain.column_values.filter((e, index) => numberColumns.some(i => i === index) && e !== null);
|
|
327
379
|
}
|
|
328
380
|
|
|
329
|
-
static parse(plain: ContactResponse, columns: Array
|
|
381
|
+
static parse(plain: ContactResponse, columns: Array<string | null | undefined>): Contact {
|
|
330
382
|
const numbers = Contact.fetchNumbers(plain, columns);
|
|
331
383
|
const email = plain.column_values[columns.indexOf('email')];
|
|
332
|
-
|
|
333
384
|
return new Contact({
|
|
334
385
|
name: plain.column_values[columns.indexOf('name')],
|
|
335
386
|
number: numbers.length ? numbers[0] : '',
|
|
336
|
-
numbers: numbers.map((number, i) => ({
|
|
387
|
+
numbers: numbers.map((number, i) => ({
|
|
388
|
+
label: i === 0 ? 'primary' : 'secondary',
|
|
389
|
+
number,
|
|
390
|
+
})),
|
|
337
391
|
favorited: plain.column_values[columns.indexOf('favorite')],
|
|
338
392
|
email: email || '',
|
|
339
|
-
emails: email ? [{
|
|
393
|
+
emails: email ? [{
|
|
394
|
+
label: 'primary',
|
|
395
|
+
email,
|
|
396
|
+
}] : [],
|
|
340
397
|
entreprise: plain.column_values[columns.indexOf('entreprise')] || '',
|
|
341
398
|
birthday: plain.column_values[columns.indexOf('birthday')] || '',
|
|
342
399
|
address: plain.column_values[columns.indexOf('address')] || '',
|
|
@@ -350,7 +407,7 @@ export default class Contact {
|
|
|
350
407
|
});
|
|
351
408
|
}
|
|
352
409
|
|
|
353
|
-
static parseManyPersonal(results: Array<ContactPersonalResponse>): Array
|
|
410
|
+
static parseManyPersonal(results: Array<ContactPersonalResponse>): Array<Contact | null | undefined> {
|
|
354
411
|
return results.map(r => Contact.parsePersonal(r));
|
|
355
412
|
}
|
|
356
413
|
|
|
@@ -358,9 +415,15 @@ export default class Contact {
|
|
|
358
415
|
return new Contact({
|
|
359
416
|
name: `${plain.firstName || plain.firstname || ''} ${plain.lastName || plain.lastname || ''}`,
|
|
360
417
|
number: plain.number || '',
|
|
361
|
-
numbers: plain.number ? [{
|
|
418
|
+
numbers: plain.number ? [{
|
|
419
|
+
label: 'primary',
|
|
420
|
+
number: plain.number,
|
|
421
|
+
}] : [],
|
|
362
422
|
email: plain.email || '',
|
|
363
|
-
emails: plain.email ? [{
|
|
423
|
+
emails: plain.email ? [{
|
|
424
|
+
label: 'primary',
|
|
425
|
+
email: plain.email,
|
|
426
|
+
}] : [],
|
|
364
427
|
source: 'personal',
|
|
365
428
|
sourceId: plain.id || '',
|
|
366
429
|
entreprise: plain.entreprise || '',
|
|
@@ -375,18 +438,30 @@ export default class Contact {
|
|
|
375
438
|
|
|
376
439
|
static parseMobile(plain: ContactMobileResponse): Contact {
|
|
377
440
|
let address = '';
|
|
441
|
+
|
|
378
442
|
if (plain.postalAddresses.length) {
|
|
379
443
|
const postalAddress = plain.postalAddresses[0];
|
|
380
|
-
|
|
381
444
|
address = `${postalAddress.street} ${postalAddress.city} ${postalAddress.postCode} ${postalAddress.country}`;
|
|
382
445
|
}
|
|
383
446
|
|
|
447
|
+
const firstName = plain.givenName || '';
|
|
448
|
+
const lastName = plain.familyName || '';
|
|
449
|
+
const companyName = plain.company || '';
|
|
450
|
+
const isCompanyAccount = !firstName && !lastName;
|
|
451
|
+
const name = isCompanyAccount ? companyName : `${firstName} ${lastName}`;
|
|
452
|
+
|
|
384
453
|
return new Contact({
|
|
385
|
-
name
|
|
454
|
+
name,
|
|
386
455
|
number: plain.phoneNumbers.length ? plain.phoneNumbers[0].number : '',
|
|
387
|
-
numbers: plain.phoneNumbers.length ? [{
|
|
456
|
+
numbers: plain.phoneNumbers.length ? [{
|
|
457
|
+
label: 'primary',
|
|
458
|
+
number: plain.phoneNumbers[0].number,
|
|
459
|
+
}] : [],
|
|
388
460
|
email: plain.emailAddresses.length ? plain.emailAddresses[0].email : '',
|
|
389
|
-
emails: plain.emailAddresses.length ? [{
|
|
461
|
+
emails: plain.emailAddresses.length ? [{
|
|
462
|
+
label: 'primary',
|
|
463
|
+
email: plain.emailAddresses[0].email,
|
|
464
|
+
}] : [],
|
|
390
465
|
source: SOURCE_MOBILE,
|
|
391
466
|
sourceId: plain.recordID || '',
|
|
392
467
|
birthday: plain.birthday ? `${plain.birthday.year}-${plain.birthday.month}-${plain.birthday.day}` : '',
|
|
@@ -402,23 +477,40 @@ export default class Contact {
|
|
|
402
477
|
}
|
|
403
478
|
|
|
404
479
|
static parseOffice365(single: Office365Response, source: DirectorySource): Contact {
|
|
405
|
-
const emails: Array<{
|
|
406
|
-
|
|
480
|
+
const emails: Array<{
|
|
481
|
+
label?: string;
|
|
482
|
+
email: string;
|
|
483
|
+
}> = [];
|
|
484
|
+
const numbers: Array<{
|
|
485
|
+
label?: string;
|
|
486
|
+
number: string;
|
|
487
|
+
}> = [];
|
|
407
488
|
|
|
408
489
|
if (single.emailAddresses) {
|
|
409
|
-
single.emailAddresses.map(email => emails.push({
|
|
490
|
+
single.emailAddresses.map(email => emails.push({
|
|
491
|
+
email: email.address,
|
|
492
|
+
}));
|
|
410
493
|
}
|
|
411
494
|
|
|
412
495
|
if (single.businessPhones) {
|
|
413
|
-
single.businessPhones.map(phone => numbers.push({
|
|
496
|
+
single.businessPhones.map(phone => numbers.push({
|
|
497
|
+
label: 'business',
|
|
498
|
+
number: phone,
|
|
499
|
+
}));
|
|
414
500
|
}
|
|
415
501
|
|
|
416
502
|
if (single.mobilePhone) {
|
|
417
|
-
numbers.push({
|
|
503
|
+
numbers.push({
|
|
504
|
+
label: 'mobile',
|
|
505
|
+
number: single.mobilePhone,
|
|
506
|
+
});
|
|
418
507
|
}
|
|
419
508
|
|
|
420
509
|
if (single.homePhones) {
|
|
421
|
-
single.homePhones.map(phone => numbers.push({
|
|
510
|
+
single.homePhones.map(phone => numbers.push({
|
|
511
|
+
label: 'home',
|
|
512
|
+
number: phone,
|
|
513
|
+
}));
|
|
422
514
|
}
|
|
423
515
|
|
|
424
516
|
return new Contact({
|
|
@@ -437,19 +529,33 @@ export default class Contact {
|
|
|
437
529
|
}
|
|
438
530
|
|
|
439
531
|
static parseGoogle(single: GoogleResponse, source: DirectorySource): Contact {
|
|
440
|
-
const emails: Array<{
|
|
441
|
-
|
|
532
|
+
const emails: Array<{
|
|
533
|
+
label?: string;
|
|
534
|
+
email: string;
|
|
535
|
+
}> = [];
|
|
536
|
+
const numbers: Array<{
|
|
537
|
+
label?: string;
|
|
538
|
+
number: string;
|
|
539
|
+
}> = [];
|
|
442
540
|
|
|
443
541
|
if (single.emails) {
|
|
444
|
-
single.emails.forEach(email =>
|
|
445
|
-
|
|
542
|
+
single.emails.forEach((email: any) => (typeof email === 'object' ? {
|
|
543
|
+
email: email.address,
|
|
544
|
+
label: email.label,
|
|
545
|
+
} : {
|
|
546
|
+
email,
|
|
547
|
+
}));
|
|
446
548
|
}
|
|
447
549
|
|
|
448
550
|
if (single.numbers_by_label) {
|
|
449
|
-
Object.keys(single.numbers_by_label).forEach(label =>
|
|
450
|
-
|
|
551
|
+
Object.keys(single.numbers_by_label).forEach(label => numbers.push({
|
|
552
|
+
label,
|
|
553
|
+
number: single.numbers_by_label[label],
|
|
554
|
+
}));
|
|
451
555
|
} else if (single.numbers) {
|
|
452
|
-
single.numbers.forEach(phone => numbers.push({
|
|
556
|
+
single.numbers.forEach(phone => numbers.push({
|
|
557
|
+
number: phone,
|
|
558
|
+
}));
|
|
453
559
|
}
|
|
454
560
|
|
|
455
561
|
return new Contact({
|
|
@@ -468,19 +574,28 @@ export default class Contact {
|
|
|
468
574
|
}
|
|
469
575
|
|
|
470
576
|
static parseWazo(single: WazoResponse, source: DirectorySource): Contact {
|
|
471
|
-
const emails = [];
|
|
472
|
-
const numbers = [];
|
|
577
|
+
const emails: any[] = [];
|
|
578
|
+
const numbers: any[] = [];
|
|
473
579
|
|
|
474
580
|
if (single.email) {
|
|
475
|
-
emails.push({
|
|
581
|
+
emails.push({
|
|
582
|
+
label: 'email',
|
|
583
|
+
email: single.email,
|
|
584
|
+
});
|
|
476
585
|
}
|
|
477
586
|
|
|
478
587
|
if (single.exten) {
|
|
479
|
-
numbers.push({
|
|
588
|
+
numbers.push({
|
|
589
|
+
label: 'exten',
|
|
590
|
+
number: single.exten,
|
|
591
|
+
});
|
|
480
592
|
}
|
|
481
593
|
|
|
482
594
|
if (single.mobile_phone_number) {
|
|
483
|
-
numbers.push({
|
|
595
|
+
numbers.push({
|
|
596
|
+
label: 'mobile',
|
|
597
|
+
number: single.mobile_phone_number,
|
|
598
|
+
});
|
|
484
599
|
}
|
|
485
600
|
|
|
486
601
|
return new Contact({
|
|
@@ -500,12 +615,15 @@ export default class Contact {
|
|
|
500
615
|
}
|
|
501
616
|
|
|
502
617
|
static parseConference(single: ConferenceResponse, source: DirectorySource): Contact {
|
|
503
|
-
const numbers = [];
|
|
618
|
+
const numbers: any[] = [];
|
|
504
619
|
let firstNumber = '';
|
|
505
620
|
|
|
506
621
|
if (single && single.extensions && single.extensions.length > 0 && single.extensions[0].exten) {
|
|
507
622
|
firstNumber = single.extensions[0].exten;
|
|
508
|
-
numbers.push({
|
|
623
|
+
numbers.push({
|
|
624
|
+
label: 'exten',
|
|
625
|
+
number: firstNumber,
|
|
626
|
+
});
|
|
509
627
|
}
|
|
510
628
|
|
|
511
629
|
return new Contact({
|
|
@@ -582,25 +700,21 @@ export default class Contact {
|
|
|
582
700
|
this.ringing = ringing;
|
|
583
701
|
this.previousPresential = previousPresential;
|
|
584
702
|
this.lines = lines || [];
|
|
585
|
-
|
|
586
703
|
// Useful to compare instead of instanceof with minified code
|
|
587
704
|
this.type = 'Contact';
|
|
588
705
|
}
|
|
589
706
|
|
|
590
707
|
setFavorite(value: boolean) {
|
|
591
708
|
this.favorited = value;
|
|
592
|
-
|
|
593
709
|
return this;
|
|
594
710
|
}
|
|
595
711
|
|
|
596
712
|
is(other: Contact): boolean {
|
|
597
713
|
const sameSourceId = this.sourceId !== null && other.sourceId !== null && this.sourceId === other.sourceId;
|
|
598
714
|
const sameUuid = !!this.uuid && !!other.uuid && this.uuid === other.uuid;
|
|
599
|
-
|
|
600
715
|
const hasSameId = sameSourceId || sameUuid;
|
|
601
716
|
const hasSameBackend = !!this.backend && !!other.backend && this.backend === other.backend;
|
|
602
717
|
const hasSameSource = !!this.source && !!other.source && this.source === other.source;
|
|
603
|
-
|
|
604
718
|
return !!other && hasSameId && hasSameBackend && hasSameSource;
|
|
605
719
|
}
|
|
606
720
|
|
|
@@ -636,7 +750,7 @@ export default class Contact {
|
|
|
636
750
|
return this.lineState === LINE_STATE.TALKING || this.lineState === LINE_STATE.HOLDING;
|
|
637
751
|
}
|
|
638
752
|
|
|
639
|
-
isRinging():
|
|
753
|
+
isRinging(): boolean | null | undefined {
|
|
640
754
|
return this.ringing;
|
|
641
755
|
}
|
|
642
756
|
|
|
@@ -650,7 +764,7 @@ export default class Contact {
|
|
|
650
764
|
|
|
651
765
|
merge(old: Contact): Contact {
|
|
652
766
|
Object.keys(old).filter(key => key !== 'lineState').forEach(key => {
|
|
653
|
-
//
|
|
767
|
+
// @ts-ignore
|
|
654
768
|
this[key] = old[key] || this[key];
|
|
655
769
|
});
|
|
656
770
|
|
|
@@ -681,20 +795,24 @@ export default class Contact {
|
|
|
681
795
|
return this.favorited;
|
|
682
796
|
}
|
|
683
797
|
|
|
684
|
-
separateName(): {
|
|
798
|
+
separateName(): {
|
|
799
|
+
firstName: string;
|
|
800
|
+
lastName: string;
|
|
801
|
+
} {
|
|
685
802
|
if (!this.name) {
|
|
686
803
|
return {
|
|
687
804
|
firstName: '',
|
|
688
805
|
lastName: '',
|
|
689
806
|
};
|
|
690
807
|
}
|
|
808
|
+
|
|
691
809
|
const names = this.name.split(/\s+/);
|
|
692
810
|
const firstName = names[0];
|
|
693
811
|
const lastName = names.slice(1).join(' ');
|
|
694
|
-
|
|
695
812
|
return {
|
|
696
813
|
firstName,
|
|
697
814
|
lastName,
|
|
698
815
|
};
|
|
699
816
|
}
|
|
817
|
+
|
|
700
818
|
}
|