@wazo/sdk 0.38.22 → 0.39.0-beta.2
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 +0 -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 +35 -1312
- 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 -4881
- 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 +430 -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 +1450 -2670
- 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 +211 -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 +1974 -7676
- 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 +49 -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 +138 -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 +404 -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 +1450 -2715
- 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 +211 -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 +2001 -7695
- package/lib/websocket-client.js +357 -1021
- package/package.json +40 -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 +83 -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} +99 -65
- 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} +373 -261
- package/src/domain/{Country.js → Country.ts} +0 -0
- 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} +441 -413
- 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} +129 -100
- 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__/{compare-version.test.js → compare-version.test.ts} +0 -0
- 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} +793 -463
- 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
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
// @flow
|
|
2
|
-
|
|
3
1
|
import Session from '../Session';
|
|
4
2
|
import Profile from '../Profile';
|
|
5
3
|
import Line from '../Line';
|
|
@@ -9,39 +7,7 @@ describe('Session domain', () => {
|
|
|
9
7
|
const plain = {
|
|
10
8
|
data: {
|
|
11
9
|
token: 'b93ae6bd-08d7-4001-9e61-057e72bbc4b3',
|
|
12
|
-
acl: [
|
|
13
|
-
'calld.lines.*.presences.read',
|
|
14
|
-
'calld.switchboards.#',
|
|
15
|
-
'calld.transfers.*.complete.update',
|
|
16
|
-
'calld.transfers.*.delete',
|
|
17
|
-
'calld.transfers.*.read',
|
|
18
|
-
'calld.users.*.presences.read',
|
|
19
|
-
'calld.users.me.#',
|
|
20
|
-
'confd.infos.read',
|
|
21
|
-
'confd.users.me.#.read',
|
|
22
|
-
'confd.users.me.forwards.*.*',
|
|
23
|
-
'confd.users.me.funckeys.*',
|
|
24
|
-
'confd.users.me.funckeys.*.*',
|
|
25
|
-
'confd.users.me.read',
|
|
26
|
-
'confd.users.me.services.*.*',
|
|
27
|
-
'confd.users.me.update',
|
|
28
|
-
'dird.#.me.read',
|
|
29
|
-
'dird.directories.favorites.#',
|
|
30
|
-
'dird.directories.lookup.*.headers.read',
|
|
31
|
-
'dird.directories.lookup.*.read',
|
|
32
|
-
'dird.directories.personal.*.read',
|
|
33
|
-
'dird.personal.#',
|
|
34
|
-
'events.calls.me',
|
|
35
|
-
'events.chat.message.*.me',
|
|
36
|
-
'events.config.users.me.#',
|
|
37
|
-
'events.statuses.*',
|
|
38
|
-
'events.switchboards.#',
|
|
39
|
-
'events.transfers.me',
|
|
40
|
-
'events.users.me.#',
|
|
41
|
-
'events.directory.me.#',
|
|
42
|
-
'websocketd',
|
|
43
|
-
'call-logd.users.me.cdr.read',
|
|
44
|
-
],
|
|
10
|
+
acl: ['calld.lines.*.presences.read', 'calld.switchboards.#', 'calld.transfers.*.complete.update', 'calld.transfers.*.delete', 'calld.transfers.*.read', 'calld.users.*.presences.read', 'calld.users.me.#', 'confd.infos.read', 'confd.users.me.#.read', 'confd.users.me.forwards.*.*', 'confd.users.me.funckeys.*', 'confd.users.me.funckeys.*.*', 'confd.users.me.read', 'confd.users.me.services.*.*', 'confd.users.me.update', 'dird.#.me.read', 'dird.directories.favorites.#', 'dird.directories.lookup.*.headers.read', 'dird.directories.lookup.*.read', 'dird.directories.personal.*.read', 'dird.personal.#', 'events.calls.me', 'events.chat.message.*.me', 'events.config.users.me.#', 'events.statuses.*', 'events.switchboards.#', 'events.transfers.me', 'events.users.me.#', 'events.directory.me.#', 'websocketd', 'call-logd.users.me.cdr.read'],
|
|
45
11
|
utc_expires_at: '2017-07-19T21:27:53.086990',
|
|
46
12
|
session_uuid: 'f14dd6d6-547c-434d-bd5c-e882b5b83b32',
|
|
47
13
|
xivo_uuid: '6cd695d2-cdb9-4444-8b2d-27425ab85fa8',
|
|
@@ -55,60 +21,24 @@ describe('Session domain', () => {
|
|
|
55
21
|
xivo_user_uuid: null,
|
|
56
22
|
},
|
|
57
23
|
};
|
|
58
|
-
|
|
59
24
|
const session = Session.parse(plain);
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
'calld.transfers.*.delete',
|
|
70
|
-
'calld.transfers.*.read',
|
|
71
|
-
'calld.users.*.presences.read',
|
|
72
|
-
'calld.users.me.#',
|
|
73
|
-
'confd.infos.read',
|
|
74
|
-
'confd.users.me.#.read',
|
|
75
|
-
'confd.users.me.forwards.*.*',
|
|
76
|
-
'confd.users.me.funckeys.*',
|
|
77
|
-
'confd.users.me.funckeys.*.*',
|
|
78
|
-
'confd.users.me.read',
|
|
79
|
-
'confd.users.me.services.*.*',
|
|
80
|
-
'confd.users.me.update',
|
|
81
|
-
'dird.#.me.read',
|
|
82
|
-
'dird.directories.favorites.#',
|
|
83
|
-
'dird.directories.lookup.*.headers.read',
|
|
84
|
-
'dird.directories.lookup.*.read',
|
|
85
|
-
'dird.directories.personal.*.read',
|
|
86
|
-
'dird.personal.#',
|
|
87
|
-
'events.calls.me',
|
|
88
|
-
'events.chat.message.*.me',
|
|
89
|
-
'events.config.users.me.#',
|
|
90
|
-
'events.statuses.*',
|
|
91
|
-
'events.switchboards.#',
|
|
92
|
-
'events.transfers.me',
|
|
93
|
-
'events.users.me.#',
|
|
94
|
-
'events.directory.me.#',
|
|
95
|
-
'websocketd',
|
|
96
|
-
'call-logd.users.me.cdr.read',
|
|
97
|
-
],
|
|
98
|
-
uuid: 'a14dd6d6-547c-434d-bd5c-e882b5b83b54',
|
|
99
|
-
expiresAt: new Date('2017-07-19T21:27:53.086990z'),
|
|
100
|
-
sessionUuid: 'f14dd6d6-547c-434d-bd5c-e882b5b83b32',
|
|
101
|
-
engineUuid: '6cd695d2-cdb9-4444-8b2d-27425ab85fa8',
|
|
102
|
-
}),
|
|
103
|
-
);
|
|
25
|
+
expect(session).toEqual(new Session({
|
|
26
|
+
token: 'b93ae6bd-08d7-4001-9e61-057e72bbc4b3',
|
|
27
|
+
refreshToken: null,
|
|
28
|
+
acl: ['calld.lines.*.presences.read', 'calld.switchboards.#', 'calld.transfers.*.complete.update', 'calld.transfers.*.delete', 'calld.transfers.*.read', 'calld.users.*.presences.read', 'calld.users.me.#', 'confd.infos.read', 'confd.users.me.#.read', 'confd.users.me.forwards.*.*', 'confd.users.me.funckeys.*', 'confd.users.me.funckeys.*.*', 'confd.users.me.read', 'confd.users.me.services.*.*', 'confd.users.me.update', 'dird.#.me.read', 'dird.directories.favorites.#', 'dird.directories.lookup.*.headers.read', 'dird.directories.lookup.*.read', 'dird.directories.personal.*.read', 'dird.personal.#', 'events.calls.me', 'events.chat.message.*.me', 'events.config.users.me.#', 'events.statuses.*', 'events.switchboards.#', 'events.transfers.me', 'events.users.me.#', 'events.directory.me.#', 'websocketd', 'call-logd.users.me.cdr.read'],
|
|
29
|
+
uuid: 'a14dd6d6-547c-434d-bd5c-e882b5b83b54',
|
|
30
|
+
expiresAt: new Date('2017-07-19T21:27:53.086990z'),
|
|
31
|
+
sessionUuid: 'f14dd6d6-547c-434d-bd5c-e882b5b83b32',
|
|
32
|
+
engineUuid: '6cd695d2-cdb9-4444-8b2d-27425ab85fa8',
|
|
33
|
+
}));
|
|
104
34
|
});
|
|
105
|
-
|
|
106
35
|
describe('about voicemails', () => {
|
|
107
36
|
const A_DATE = new Date(2999, 5, 6, 14, 30, 1);
|
|
108
37
|
it('has access to voicemail given there is a voicemail configured', () => {
|
|
109
38
|
const session = new Session({
|
|
110
39
|
token: 'ref-12345',
|
|
111
40
|
uuid: '1234',
|
|
41
|
+
// @ts-expect-error
|
|
112
42
|
profile: new Profile({
|
|
113
43
|
voicemail: {
|
|
114
44
|
id: 1234,
|
|
@@ -117,25 +47,34 @@ describe('Session domain', () => {
|
|
|
117
47
|
}),
|
|
118
48
|
expiresAt: A_DATE,
|
|
119
49
|
});
|
|
120
|
-
|
|
121
50
|
expect(session.hasAccessToVoicemail()).toBeTruthy();
|
|
122
51
|
});
|
|
123
|
-
|
|
124
52
|
describe('When getting all numbers', () => {
|
|
125
53
|
describe('and the user has multiple lines', () => {
|
|
126
54
|
it('should return multiple extensions', () => {
|
|
127
55
|
const session = new Session({
|
|
128
56
|
token: 'ref-12345',
|
|
129
57
|
uuid: '1234',
|
|
58
|
+
// @ts-expect-error
|
|
130
59
|
profile: new Profile({
|
|
131
|
-
lines: [
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
60
|
+
lines: [new Line({
|
|
61
|
+
id: 9012,
|
|
62
|
+
extensions: [{
|
|
63
|
+
id: 1,
|
|
64
|
+
exten: '8000',
|
|
65
|
+
context: 'default',
|
|
66
|
+
}],
|
|
67
|
+
}), new Line({
|
|
68
|
+
id: 3421,
|
|
69
|
+
extensions: [{
|
|
70
|
+
id: 2,
|
|
71
|
+
exten: '9980',
|
|
72
|
+
context: 'internal',
|
|
73
|
+
}],
|
|
74
|
+
})],
|
|
135
75
|
}),
|
|
136
76
|
expiresAt: A_DATE,
|
|
137
77
|
});
|
|
138
|
-
|
|
139
78
|
expect(session.allNumbers().length).toBeGreaterThan(1);
|
|
140
79
|
});
|
|
141
80
|
});
|
|
@@ -144,44 +83,46 @@ describe('Session domain', () => {
|
|
|
144
83
|
const session = new Session({
|
|
145
84
|
token: 'ref-12345',
|
|
146
85
|
uuid: '1234',
|
|
86
|
+
// @ts-expect-error
|
|
147
87
|
profile: new Profile({
|
|
148
|
-
lines: [new Line({
|
|
88
|
+
lines: [new Line({
|
|
89
|
+
id: 9012,
|
|
90
|
+
extensions: [{
|
|
91
|
+
id: 1,
|
|
92
|
+
exten: '8000',
|
|
93
|
+
context: 'default',
|
|
94
|
+
}],
|
|
95
|
+
})],
|
|
149
96
|
}),
|
|
150
97
|
expiresAt: A_DATE,
|
|
151
98
|
});
|
|
152
|
-
|
|
153
99
|
expect(session.allNumbers().length).toEqual(1);
|
|
154
100
|
});
|
|
155
101
|
});
|
|
156
102
|
});
|
|
157
|
-
|
|
158
103
|
it('does not have access to voicemail given there is no voicemail configured', () => {
|
|
159
104
|
const session = new Session({
|
|
160
105
|
token: 'ref-12345',
|
|
161
106
|
uuid: '1234',
|
|
107
|
+
// @ts-expect-error
|
|
162
108
|
profile: new Profile({
|
|
163
109
|
voicemail: undefined,
|
|
164
110
|
}),
|
|
165
111
|
expiresAt: A_DATE,
|
|
166
112
|
});
|
|
167
|
-
|
|
168
113
|
expect(session.hasAccessToVoicemail()).toBeFalsy();
|
|
169
114
|
});
|
|
170
|
-
|
|
171
115
|
it('does not have access to voicemail given there is no profile', () => {
|
|
172
116
|
const session = new Session({
|
|
173
117
|
token: 'ref-12345',
|
|
174
118
|
uuid: '1234',
|
|
175
119
|
expiresAt: A_DATE,
|
|
176
120
|
});
|
|
177
|
-
|
|
178
121
|
expect(session.hasAccessToVoicemail()).toBeFalsy();
|
|
179
122
|
});
|
|
180
123
|
});
|
|
181
|
-
|
|
182
124
|
describe('Session expiration', () => {
|
|
183
125
|
const EXPIRATION_DATE = new Date(2006, 5, 6, 14, 30, 1);
|
|
184
|
-
|
|
185
126
|
it('session should be expired given date is equal to expiration date', () => {
|
|
186
127
|
const session = new Session({
|
|
187
128
|
token: 'ref-12345',
|
|
@@ -189,10 +130,8 @@ describe('Session domain', () => {
|
|
|
189
130
|
expiresAt: EXPIRATION_DATE,
|
|
190
131
|
});
|
|
191
132
|
const currentDate = new Date(2006, 5, 6, 14, 30, 1);
|
|
192
|
-
|
|
193
133
|
expect(session.hasExpired(currentDate)).toBeTruthy();
|
|
194
134
|
});
|
|
195
|
-
|
|
196
135
|
it('session should be expired given date is after expiration', () => {
|
|
197
136
|
const session = new Session({
|
|
198
137
|
token: 'ref-12345',
|
|
@@ -200,10 +139,8 @@ describe('Session domain', () => {
|
|
|
200
139
|
expiresAt: EXPIRATION_DATE,
|
|
201
140
|
});
|
|
202
141
|
const currentDate = new Date(2006, 5, 6, 14, 32, 0);
|
|
203
|
-
|
|
204
142
|
expect(session.hasExpired(currentDate)).toBeTruthy();
|
|
205
143
|
});
|
|
206
|
-
|
|
207
144
|
it('session should not be expired given date is before expiration', () => {
|
|
208
145
|
const session = new Session({
|
|
209
146
|
token: 'ref-12345',
|
|
@@ -211,43 +148,47 @@ describe('Session domain', () => {
|
|
|
211
148
|
expiresAt: EXPIRATION_DATE,
|
|
212
149
|
});
|
|
213
150
|
const currentDate = new Date(2006, 5, 6, 14, 29, 0);
|
|
214
|
-
|
|
215
151
|
expect(session.hasExpired(currentDate)).toBeFalsy();
|
|
216
152
|
});
|
|
217
153
|
});
|
|
218
|
-
|
|
219
154
|
describe('when checking if session has a specific extension', () => {
|
|
220
155
|
const session = new Session({
|
|
221
156
|
token: 'ref-12345',
|
|
222
157
|
uuid: '1234',
|
|
158
|
+
// @ts-expect-error
|
|
223
159
|
profile: new Profile({
|
|
224
|
-
lines: [
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
160
|
+
lines: [new Line({
|
|
161
|
+
id: 9012,
|
|
162
|
+
extensions: [{
|
|
163
|
+
id: 1,
|
|
164
|
+
exten: '8000',
|
|
165
|
+
context: 'default',
|
|
166
|
+
}],
|
|
167
|
+
}), new Line({
|
|
168
|
+
id: 3421,
|
|
169
|
+
extensions: [{
|
|
170
|
+
id: 2,
|
|
171
|
+
exten: '9980',
|
|
172
|
+
context: 'internal',
|
|
173
|
+
}],
|
|
174
|
+
})],
|
|
228
175
|
}),
|
|
229
176
|
expiresAt: new Date(9999, 0, 1),
|
|
230
177
|
});
|
|
231
|
-
|
|
232
178
|
it('should return true given it owns the extension', () => {
|
|
233
179
|
expect(session.hasExtension('8000')).toBeTruthy();
|
|
234
180
|
});
|
|
235
|
-
|
|
236
181
|
it("should return true given it owns the extension even if it's not the default one", () => {
|
|
237
182
|
expect(session.hasExtension('9980')).toBeTruthy();
|
|
238
183
|
});
|
|
239
|
-
|
|
240
184
|
it("should return false given it does't own the extension", () => {
|
|
241
185
|
expect(session.hasExtension('12')).toBeFalsy();
|
|
242
186
|
});
|
|
243
187
|
});
|
|
244
|
-
|
|
245
188
|
describe('when getting the primary context', () => {
|
|
246
189
|
const DEFAULT_CONTEXT = 'default';
|
|
247
190
|
const SOME_CONTEXT = 'some-context';
|
|
248
|
-
|
|
249
|
-
let A_SESSION;
|
|
250
|
-
|
|
191
|
+
let A_SESSION: any;
|
|
251
192
|
beforeEach(() => {
|
|
252
193
|
A_SESSION = new Session({
|
|
253
194
|
token: 'ref-12345',
|
|
@@ -256,130 +197,164 @@ describe('Session domain', () => {
|
|
|
256
197
|
engineVersion: null,
|
|
257
198
|
});
|
|
258
199
|
});
|
|
259
|
-
|
|
260
200
|
describe('given NO engine version', () => {
|
|
261
201
|
beforeEach(() => {
|
|
262
|
-
A_SESSION = new Session({ ...A_SESSION,
|
|
202
|
+
A_SESSION = new Session({ ...A_SESSION,
|
|
203
|
+
engineVersion: null,
|
|
204
|
+
});
|
|
263
205
|
});
|
|
264
|
-
|
|
265
206
|
describe('and NO profile', () => {
|
|
266
207
|
beforeEach(() => {
|
|
267
|
-
A_SESSION = new Session({ ...A_SESSION,
|
|
208
|
+
A_SESSION = new Session({ ...A_SESSION,
|
|
209
|
+
profile: null,
|
|
210
|
+
});
|
|
268
211
|
});
|
|
269
|
-
|
|
270
212
|
it('should return default context', async () => {
|
|
271
213
|
const context = A_SESSION.primaryContext();
|
|
272
|
-
|
|
273
214
|
expect(context).toEqual(DEFAULT_CONTEXT);
|
|
274
215
|
});
|
|
275
216
|
});
|
|
276
|
-
|
|
277
217
|
describe('and NO lines', () => {
|
|
278
218
|
beforeEach(() => {
|
|
279
|
-
A_SESSION = new Session({ ...A_SESSION,
|
|
219
|
+
A_SESSION = new Session({ ...A_SESSION,
|
|
220
|
+
// @ts-expect-error
|
|
221
|
+
profile: new Profile({
|
|
222
|
+
lines: [],
|
|
223
|
+
}),
|
|
224
|
+
});
|
|
280
225
|
});
|
|
281
|
-
|
|
282
226
|
it('should return default context', async () => {
|
|
283
227
|
const context = A_SESSION.primaryContext();
|
|
284
|
-
|
|
285
228
|
expect(context).toEqual(DEFAULT_CONTEXT);
|
|
286
229
|
});
|
|
287
230
|
});
|
|
288
|
-
|
|
289
231
|
describe('and some lines', () => {
|
|
290
232
|
beforeEach(() => {
|
|
291
|
-
const line = new Line({
|
|
292
|
-
|
|
293
|
-
|
|
233
|
+
const line = new Line({
|
|
234
|
+
extensions: [{
|
|
235
|
+
context: SOME_CONTEXT,
|
|
236
|
+
id: 1,
|
|
237
|
+
exten: '1',
|
|
238
|
+
}],
|
|
239
|
+
id: 1,
|
|
240
|
+
// @ts-expect-error
|
|
241
|
+
exten: 1,
|
|
242
|
+
});
|
|
243
|
+
// @ts-expect-error
|
|
244
|
+
const profile = new Profile({
|
|
245
|
+
lines: [line],
|
|
246
|
+
});
|
|
247
|
+
A_SESSION = new Session({ ...A_SESSION,
|
|
248
|
+
profile,
|
|
249
|
+
});
|
|
294
250
|
});
|
|
295
|
-
|
|
296
251
|
it('should return line context', async () => {
|
|
297
252
|
const context = A_SESSION.primaryContext();
|
|
298
|
-
|
|
299
253
|
expect(context).toEqual(SOME_CONTEXT);
|
|
300
254
|
});
|
|
301
255
|
});
|
|
302
256
|
});
|
|
303
|
-
|
|
304
257
|
describe('given an engine version', () => {
|
|
305
258
|
describe('that is invalid', () => {
|
|
306
259
|
beforeEach(() => {
|
|
307
|
-
A_SESSION = new Session({ ...A_SESSION,
|
|
260
|
+
A_SESSION = new Session({ ...A_SESSION,
|
|
261
|
+
engineVersion: '19.09',
|
|
262
|
+
});
|
|
308
263
|
});
|
|
309
|
-
|
|
310
264
|
describe('and NO lines', () => {
|
|
311
265
|
beforeEach(() => {
|
|
312
|
-
|
|
313
|
-
|
|
266
|
+
// @ts-expect-error
|
|
267
|
+
const profile = new Profile({
|
|
268
|
+
lines: [],
|
|
269
|
+
});
|
|
270
|
+
A_SESSION = new Session({ ...A_SESSION,
|
|
271
|
+
profile,
|
|
272
|
+
});
|
|
314
273
|
});
|
|
315
|
-
|
|
316
274
|
it('should return default context', async () => {
|
|
317
275
|
const context = A_SESSION.primaryContext();
|
|
318
|
-
|
|
319
276
|
expect(context).toEqual(DEFAULT_CONTEXT);
|
|
320
277
|
});
|
|
321
278
|
});
|
|
322
|
-
|
|
323
279
|
describe('and some lines', () => {
|
|
324
280
|
beforeEach(() => {
|
|
325
|
-
const line = new Line({
|
|
326
|
-
|
|
327
|
-
|
|
281
|
+
const line = new Line({
|
|
282
|
+
extensions: [{
|
|
283
|
+
context: SOME_CONTEXT,
|
|
284
|
+
id: 1,
|
|
285
|
+
exten: '1',
|
|
286
|
+
}],
|
|
287
|
+
id: 1,
|
|
288
|
+
// @ts-expect-error
|
|
289
|
+
exten: 1,
|
|
290
|
+
});
|
|
291
|
+
// @ts-expect-error
|
|
292
|
+
const profile = new Profile({
|
|
293
|
+
lines: [line],
|
|
294
|
+
});
|
|
295
|
+
A_SESSION = new Session({ ...A_SESSION,
|
|
296
|
+
profile,
|
|
297
|
+
engineVersion: '18.08',
|
|
298
|
+
});
|
|
328
299
|
});
|
|
329
|
-
|
|
330
300
|
it('should return line context', async () => {
|
|
331
301
|
const context = A_SESSION.primaryContext();
|
|
332
|
-
|
|
333
302
|
expect(context).toEqual(SOME_CONTEXT);
|
|
334
303
|
});
|
|
335
304
|
});
|
|
336
305
|
});
|
|
337
|
-
|
|
338
306
|
describe('that is valid', () => {
|
|
339
307
|
describe('and under 19.08', () => {
|
|
340
308
|
describe('and NO lines', () => {
|
|
341
309
|
it('should return default context', async () => {
|
|
342
310
|
const context = A_SESSION.primaryContext();
|
|
343
|
-
|
|
344
311
|
expect(context).toEqual(DEFAULT_CONTEXT);
|
|
345
312
|
});
|
|
346
313
|
});
|
|
347
|
-
|
|
348
314
|
describe('and some lines', () => {
|
|
349
315
|
beforeEach(() => {
|
|
350
|
-
const line = new Line({
|
|
351
|
-
|
|
352
|
-
|
|
316
|
+
const line = new Line({
|
|
317
|
+
extensions: [{
|
|
318
|
+
context: SOME_CONTEXT,
|
|
319
|
+
id: 1,
|
|
320
|
+
exten: '1',
|
|
321
|
+
}],
|
|
322
|
+
id: 1,
|
|
323
|
+
// @ts-expect-error
|
|
324
|
+
exten: 1,
|
|
325
|
+
});
|
|
326
|
+
// @ts-expect-error
|
|
327
|
+
const profile = new Profile({
|
|
328
|
+
lines: [line],
|
|
329
|
+
});
|
|
330
|
+
A_SESSION = new Session({ ...A_SESSION,
|
|
331
|
+
profile,
|
|
332
|
+
});
|
|
353
333
|
});
|
|
354
|
-
|
|
355
334
|
it('should return line context', async () => {
|
|
356
335
|
const context = A_SESSION.primaryContext();
|
|
357
|
-
|
|
358
336
|
expect(context).toEqual(SOME_CONTEXT);
|
|
359
337
|
});
|
|
360
338
|
});
|
|
361
339
|
});
|
|
362
|
-
|
|
363
340
|
describe('and equal to 19.08', () => {
|
|
364
341
|
it('should return default context', async () => {
|
|
365
342
|
const context = A_SESSION.primaryContext();
|
|
366
|
-
|
|
367
343
|
expect(context).toEqual(DEFAULT_CONTEXT);
|
|
368
344
|
});
|
|
369
345
|
});
|
|
370
|
-
|
|
371
346
|
describe('and higher then 19.08', () => {
|
|
372
347
|
it('should return default context', async () => {
|
|
373
348
|
const context = A_SESSION.primaryContext();
|
|
374
|
-
|
|
375
349
|
expect(context).toEqual(DEFAULT_CONTEXT);
|
|
376
350
|
});
|
|
377
351
|
});
|
|
378
352
|
});
|
|
379
|
-
|
|
380
353
|
describe('when version is 19.10', () => {
|
|
381
354
|
it('should not consider that version is 19.1', () => {
|
|
382
|
-
A_SESSION = new Session({ ...A_SESSION,
|
|
355
|
+
A_SESSION = new Session({ ...A_SESSION,
|
|
356
|
+
engineVersion: '19.10',
|
|
357
|
+
});
|
|
383
358
|
expect(A_SESSION.hasEngineVersionGte('19.10')).toBeTruthy();
|
|
384
359
|
expect(A_SESSION.hasEngineVersionGte('19.11')).toBeFalsy();
|
|
385
360
|
expect(A_SESSION.hasEngineVersionGte('19.09')).toBeTruthy();
|
|
@@ -389,19 +364,19 @@ describe('Session domain', () => {
|
|
|
389
364
|
});
|
|
390
365
|
});
|
|
391
366
|
});
|
|
392
|
-
|
|
393
367
|
it('Should return `acl` when accessing `acls` property since it\'s deprecated', () => {
|
|
394
368
|
const acl = ['calld.lines.*.presences.read'];
|
|
395
|
-
const session = new Session({
|
|
396
|
-
|
|
369
|
+
const session = new Session({
|
|
370
|
+
acl,
|
|
371
|
+
expiresAt: new Date(),
|
|
372
|
+
token: 'abc',
|
|
373
|
+
});
|
|
397
374
|
const oldWarn = console.warn;
|
|
398
|
-
|
|
375
|
+
|
|
399
376
|
console.warn = () => {};
|
|
400
377
|
|
|
401
378
|
expect(session.acls).toEqual(acl);
|
|
402
379
|
expect(session.acl).toEqual(acl);
|
|
403
|
-
|
|
404
|
-
// $FlowFixMe
|
|
405
380
|
console.warn = oldWarn;
|
|
406
381
|
});
|
|
407
382
|
});
|
|
@@ -1,9 +1,12 @@
|
|
|
1
|
+
// @ts-nocheck
|
|
1
2
|
import SipLine from '../SipLine';
|
|
2
3
|
|
|
3
4
|
describe('SipLine domain', () => {
|
|
4
5
|
describe('Endpoint (20.13 and higher)', () => {
|
|
5
6
|
it('can tell if we have videoConference capabilities', () => {
|
|
6
|
-
const getSipLine = endpointSectionOptions => new SipLine({
|
|
7
|
+
const getSipLine = endpointSectionOptions => new SipLine({
|
|
8
|
+
endpointSectionOptions,
|
|
9
|
+
});
|
|
7
10
|
|
|
8
11
|
expect(getSipLine([['max_audio_streams', '1'], ['max_video_streams', '2']]).hasVideoConference()).toBe(true);
|
|
9
12
|
expect(getSipLine([['max_audio_streams', '1'], ['max_video_streams', '1']]).hasVideoConference()).toBe(false);
|
|
@@ -12,10 +15,11 @@ describe('SipLine domain', () => {
|
|
|
12
15
|
expect(getSipLine([['max_audio_streams', '2'], ['max_video_streams', '2']]).hasVideoConference()).toBe(true);
|
|
13
16
|
});
|
|
14
17
|
});
|
|
15
|
-
|
|
16
18
|
describe('Old Endpoint', () => {
|
|
17
19
|
it('can tell if we have videoConference capabilities', () => {
|
|
18
|
-
const getSipLine = options => new SipLine({
|
|
20
|
+
const getSipLine = options => new SipLine({
|
|
21
|
+
options,
|
|
22
|
+
});
|
|
19
23
|
|
|
20
24
|
expect(getSipLine([['max_audio_streams', '1'], ['max_video_streams', '2']]).hasVideoConference()).toBe(true);
|
|
21
25
|
expect(getSipLine([['max_audio_streams', '1'], ['max_video_streams', '1']]).hasVideoConference()).toBe(false);
|
|
@@ -1,27 +1,40 @@
|
|
|
1
|
-
// @flow
|
|
2
|
-
|
|
3
1
|
import Voicemail from '../Voicemail';
|
|
4
2
|
|
|
5
3
|
const defaultCaller = {
|
|
6
4
|
name: 'john doe',
|
|
7
5
|
number: '0101010101',
|
|
8
6
|
};
|
|
9
|
-
|
|
10
7
|
describe('Voicemail', () => {
|
|
11
8
|
it('is the same voicemail given the same id', () => {
|
|
12
|
-
const voicemail = new Voicemail({
|
|
13
|
-
|
|
14
|
-
|
|
9
|
+
const voicemail = new Voicemail({
|
|
10
|
+
id: 'ref-abc',
|
|
11
|
+
caller: defaultCaller,
|
|
12
|
+
date: new Date(),
|
|
13
|
+
duration: 0,
|
|
14
|
+
});
|
|
15
|
+
const anotherVoicemail = new Voicemail({
|
|
16
|
+
id: 'ref-abc',
|
|
17
|
+
caller: defaultCaller,
|
|
18
|
+
date: new Date(),
|
|
19
|
+
duration: 0,
|
|
20
|
+
});
|
|
15
21
|
expect(voicemail.is(anotherVoicemail)).toBeTruthy();
|
|
16
22
|
});
|
|
17
|
-
|
|
18
23
|
it('is not the same voicemail given different ids', () => {
|
|
19
|
-
const voicemail = new Voicemail({
|
|
20
|
-
|
|
21
|
-
|
|
24
|
+
const voicemail = new Voicemail({
|
|
25
|
+
id: 'ref-abc',
|
|
26
|
+
caller: defaultCaller,
|
|
27
|
+
date: new Date(),
|
|
28
|
+
duration: 0,
|
|
29
|
+
});
|
|
30
|
+
const anotherVoicemail = new Voicemail({
|
|
31
|
+
id: 'ref-123',
|
|
32
|
+
caller: defaultCaller,
|
|
33
|
+
date: new Date(),
|
|
34
|
+
duration: 0,
|
|
35
|
+
});
|
|
22
36
|
expect(voicemail.is(anotherVoicemail)).toBeFalsy();
|
|
23
37
|
});
|
|
24
|
-
|
|
25
38
|
it("matches when the query includes the caller's name", () => {
|
|
26
39
|
const voicemail = new Voicemail({
|
|
27
40
|
caller: {
|
|
@@ -33,10 +46,8 @@ describe('Voicemail', () => {
|
|
|
33
46
|
id: 'ref-1234',
|
|
34
47
|
});
|
|
35
48
|
const query = 'john';
|
|
36
|
-
|
|
37
49
|
expect(voicemail.contains(query)).toBeTruthy();
|
|
38
50
|
});
|
|
39
|
-
|
|
40
51
|
it("matches when the query includes the uppercased caller's name", () => {
|
|
41
52
|
const voicemail = new Voicemail({
|
|
42
53
|
caller: {
|
|
@@ -48,10 +59,8 @@ describe('Voicemail', () => {
|
|
|
48
59
|
id: 'ref-1234',
|
|
49
60
|
});
|
|
50
61
|
const query = 'jOHn';
|
|
51
|
-
|
|
52
62
|
expect(voicemail.contains(query)).toBeTruthy();
|
|
53
63
|
});
|
|
54
|
-
|
|
55
64
|
it("matches when the query includes the caller's number", () => {
|
|
56
65
|
const voicemail = new Voicemail({
|
|
57
66
|
caller: {
|
|
@@ -63,22 +72,19 @@ describe('Voicemail', () => {
|
|
|
63
72
|
id: 'ref-1234',
|
|
64
73
|
});
|
|
65
74
|
const query = '010101';
|
|
66
|
-
|
|
67
75
|
expect(voicemail.contains(query)).toBeTruthy();
|
|
68
76
|
});
|
|
69
|
-
|
|
70
77
|
describe('when parsing', () => {
|
|
71
78
|
it('can convert the date to unix timestamp', () => {
|
|
72
79
|
const raw = {
|
|
73
80
|
duration: 5,
|
|
74
|
-
timestamp: 1530823017,
|
|
81
|
+
timestamp: 1530823017,
|
|
82
|
+
// Thu Jul 05 2018 16:36:57 GMT-0400 (GMT-04:00)
|
|
75
83
|
id: '1530823017-00000000',
|
|
76
84
|
caller_id_name: 'Cl\u00e9ment Bourgeois',
|
|
77
85
|
caller_id_num: '8005',
|
|
78
86
|
};
|
|
79
|
-
|
|
80
87
|
const voicemail = Voicemail.parse(raw);
|
|
81
|
-
|
|
82
88
|
expect(voicemail.date.toISOString()).toBe('2018-07-05T20:36:57.000Z');
|
|
83
89
|
});
|
|
84
90
|
});
|