@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,8 +1,6 @@
|
|
|
1
|
-
// @flow
|
|
2
1
|
/* eslint-disable no-nested-ternary */
|
|
3
|
-
import { KEYUTIL,
|
|
4
|
-
|
|
5
|
-
import { swarmPublicKey } from '../../config';
|
|
2
|
+
import { KEYUTIL, KJUR, b64utoutf8 } from 'jsrsasign';
|
|
3
|
+
import swarmPublicKey from '../pubkey';
|
|
6
4
|
import Profile from './Profile';
|
|
7
5
|
import Contact from './Contact';
|
|
8
6
|
import Line from './Line';
|
|
@@ -11,79 +9,103 @@ import type { UUID, Token } from './types';
|
|
|
11
9
|
import newFrom from '../utils/new-from';
|
|
12
10
|
import compareVersions from '../utils/compare-version';
|
|
13
11
|
|
|
14
|
-
const
|
|
12
|
+
const { jws } = KJUR;
|
|
13
|
+
|
|
14
|
+
const swarmKey = <unknown>(KEYUTIL.getKey(swarmPublicKey)) as string;
|
|
15
15
|
const MINIMUM_WAZO_ENGINE_VERSION_FOR_DEFAULT_CONTEXT = '19.08';
|
|
16
16
|
|
|
17
|
-
type Response = {
|
|
17
|
+
export type Response = {
|
|
18
18
|
data: {
|
|
19
|
-
token: Token
|
|
20
|
-
refresh_token?: Token
|
|
21
|
-
session_uuid: UUID
|
|
22
|
-
acls?: Array<string
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
19
|
+
token: Token;
|
|
20
|
+
refresh_token?: Token;
|
|
21
|
+
session_uuid: UUID;
|
|
22
|
+
acls?: Array<string>;
|
|
23
|
+
// deprecated
|
|
24
|
+
acl?: Array<string>;
|
|
25
|
+
utc_expires_at: string;
|
|
26
|
+
xivo_uuid: string;
|
|
27
|
+
issued_at: string;
|
|
28
|
+
auth_id: string;
|
|
29
|
+
expires_at: string;
|
|
30
|
+
xivo_user_uuid: string | null | undefined;
|
|
31
|
+
metadata: {
|
|
32
|
+
jwt?: string;
|
|
33
|
+
username?: string;
|
|
34
|
+
uuid: UUID;
|
|
35
|
+
tenant_uuid?: UUID;
|
|
36
|
+
xivo_user_uuid?: UUID;
|
|
37
|
+
groups?: Array<string>;
|
|
38
|
+
xivo_uuid?: UUID;
|
|
39
|
+
tenants?: Array<{
|
|
40
|
+
uuid: UUID;
|
|
41
|
+
}>;
|
|
42
|
+
auth_id?: UUID;
|
|
43
|
+
} | null | undefined;
|
|
44
|
+
};
|
|
42
45
|
};
|
|
43
46
|
|
|
44
47
|
type Authorization = {
|
|
45
|
-
uuid: string
|
|
46
|
-
rules: Array<{
|
|
47
|
-
|
|
48
|
+
uuid: string;
|
|
49
|
+
rules: Array<{
|
|
50
|
+
name: string;
|
|
51
|
+
options: Record<string, any>;
|
|
52
|
+
}>;
|
|
53
|
+
service: string | null | undefined;
|
|
48
54
|
};
|
|
49
55
|
|
|
50
56
|
type SessionArguments = {
|
|
51
|
-
acls?: string[]
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
57
|
+
acls?: string[];
|
|
58
|
+
// deprecated
|
|
59
|
+
acl?: string[];
|
|
60
|
+
token: string;
|
|
61
|
+
refreshToken?: string | null | undefined;
|
|
62
|
+
sessionUuid?: string | null | undefined;
|
|
63
|
+
uuid?: string | null | undefined;
|
|
64
|
+
tenantUuid?: string | null | undefined;
|
|
65
|
+
profile?: Profile | null | undefined;
|
|
66
|
+
expiresAt: Date;
|
|
67
|
+
authorizations?: Array<Authorization>;
|
|
68
|
+
engineVersion?: string | null | undefined;
|
|
69
|
+
engineUuid?: string | null | undefined;
|
|
63
70
|
};
|
|
64
71
|
|
|
65
72
|
export default class Session {
|
|
66
73
|
acl: string[];
|
|
74
|
+
|
|
67
75
|
token: string;
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
76
|
+
|
|
77
|
+
refreshToken: string | null | undefined;
|
|
78
|
+
|
|
79
|
+
uuid: string | null | undefined;
|
|
80
|
+
|
|
81
|
+
tenantUuid: string | null | undefined;
|
|
82
|
+
|
|
83
|
+
engineUuid: string | null | undefined;
|
|
84
|
+
|
|
85
|
+
sessionUuid: string | null | undefined;
|
|
86
|
+
|
|
87
|
+
engineVersion: string | null | undefined;
|
|
88
|
+
|
|
89
|
+
profile: Profile | null | undefined;
|
|
90
|
+
|
|
75
91
|
expiresAt: Date;
|
|
92
|
+
|
|
76
93
|
authorizations: Array<Authorization>;
|
|
77
94
|
|
|
78
|
-
static parse(plain: Response):
|
|
95
|
+
static parse(plain: Response): Session | null | undefined {
|
|
79
96
|
const token = plain.data.metadata ? plain.data.metadata.jwt : null;
|
|
80
97
|
let authorizations = [];
|
|
81
98
|
|
|
82
99
|
// Add authorizations from JWT
|
|
83
100
|
if (token) {
|
|
84
|
-
const isValid = jws.JWS.verifyJWT(token, swarmKey, {
|
|
101
|
+
const isValid = jws.JWS.verifyJWT(token, swarmKey, {
|
|
102
|
+
alg: ['RS256'],
|
|
103
|
+
// @ts-ignore
|
|
104
|
+
verifyAt: new Date(),
|
|
105
|
+
});
|
|
106
|
+
|
|
85
107
|
if (isValid) {
|
|
86
|
-
const decodedToken = jws.JWS.readSafeJSONString(b64utoutf8(token.split('.')[1]));
|
|
108
|
+
const decodedToken: any = jws.JWS.readSafeJSONString(b64utoutf8(token.split('.')[1]));
|
|
87
109
|
authorizations = decodedToken ? decodedToken.authorizations : [];
|
|
88
110
|
}
|
|
89
111
|
}
|
|
@@ -117,7 +139,7 @@ export default class Session {
|
|
|
117
139
|
refreshToken,
|
|
118
140
|
sessionUuid,
|
|
119
141
|
engineUuid,
|
|
120
|
-
}: SessionArguments
|
|
142
|
+
}: SessionArguments) {
|
|
121
143
|
this.token = token;
|
|
122
144
|
this.uuid = uuid;
|
|
123
145
|
this.tenantUuid = tenantUuid || null;
|
|
@@ -141,7 +163,6 @@ export default class Session {
|
|
|
141
163
|
|
|
142
164
|
using(profile: Profile): Session {
|
|
143
165
|
this.profile = profile;
|
|
144
|
-
|
|
145
166
|
return this;
|
|
146
167
|
}
|
|
147
168
|
|
|
@@ -157,22 +178,23 @@ export default class Session {
|
|
|
157
178
|
if (!this.profile) {
|
|
158
179
|
return false;
|
|
159
180
|
}
|
|
181
|
+
|
|
160
182
|
return !!this.profile.voicemail;
|
|
161
183
|
}
|
|
162
184
|
|
|
163
|
-
primaryLine():
|
|
185
|
+
primaryLine(): Line | null | undefined {
|
|
164
186
|
return this.profile && this.profile.lines.length > 0 ? this.profile.lines[0] : null;
|
|
165
187
|
}
|
|
166
188
|
|
|
167
|
-
primarySipLine():
|
|
189
|
+
primarySipLine(): SipLine | null | undefined {
|
|
168
190
|
return this.profile && this.profile.sipLines.length > 0 ? this.profile.sipLines[0] : null;
|
|
169
191
|
}
|
|
170
192
|
|
|
171
|
-
primaryWebRtcLine():
|
|
193
|
+
primaryWebRtcLine(): SipLine | null | undefined {
|
|
172
194
|
return this.profile && (this.profile.sipLines || []).find(sipLine => sipLine && sipLine.isWebRtc());
|
|
173
195
|
}
|
|
174
196
|
|
|
175
|
-
primaryCtiLine():
|
|
197
|
+
primaryCtiLine(): SipLine | null | undefined {
|
|
176
198
|
return this.profile && (this.profile.sipLines || []).find(sipLine => sipLine && !sipLine.isWebRtc());
|
|
177
199
|
}
|
|
178
200
|
|
|
@@ -184,18 +206,16 @@ export default class Session {
|
|
|
184
206
|
}
|
|
185
207
|
|
|
186
208
|
const line = this.primaryLine();
|
|
187
|
-
|
|
188
|
-
return line && line.extensions.length > 0 ? line.extensions[0].context : 'default';
|
|
209
|
+
return line && Array.isArray(line.extensions) && line.extensions.length > 0 ? line.extensions[0].context : 'default';
|
|
189
210
|
}
|
|
190
211
|
|
|
191
212
|
hasEngineVersionGte(version: string) {
|
|
192
213
|
return this.engineVersion && compareVersions(String(this.engineVersion), String(version)) >= 0;
|
|
193
214
|
}
|
|
194
215
|
|
|
195
|
-
primaryNumber():
|
|
216
|
+
primaryNumber(): string | null | undefined {
|
|
196
217
|
const line = this.primaryLine();
|
|
197
|
-
|
|
198
|
-
return line && line.extensions.length ? line.extensions[0].exten : null;
|
|
218
|
+
return line && Array.isArray(line.extensions) && line.extensions.length ? line.extensions[0].exten : null;
|
|
199
219
|
}
|
|
200
220
|
|
|
201
221
|
allLines(): Line[] {
|
|
@@ -203,7 +223,8 @@ export default class Session {
|
|
|
203
223
|
}
|
|
204
224
|
|
|
205
225
|
allNumbers(): string[] {
|
|
206
|
-
const extensions = this.allLines().map(line => line.extensions
|
|
226
|
+
const extensions = this.allLines().map(line => line.extensions?.map(extension => extension.exten) || []);
|
|
227
|
+
|
|
207
228
|
if (!extensions.length) {
|
|
208
229
|
return [];
|
|
209
230
|
}
|
|
@@ -215,8 +236,9 @@ export default class Session {
|
|
|
215
236
|
return this.allNumbers().some(number => number === extension);
|
|
216
237
|
}
|
|
217
238
|
|
|
218
|
-
get acls():
|
|
239
|
+
get acls(): Array<string> | null | undefined {
|
|
219
240
|
console.warn('`acls` property of Session has been removed in Wazo\'s SDK, please use `acl` instead.');
|
|
220
241
|
return this.acl;
|
|
221
242
|
}
|
|
243
|
+
|
|
222
244
|
}
|
|
@@ -1,66 +1,75 @@
|
|
|
1
|
-
// @flow
|
|
2
1
|
import newFrom from '../utils/new-from';
|
|
3
2
|
import type { Endpoint } from './Line';
|
|
4
3
|
|
|
5
4
|
const availableCodecs = ['vp8', 'vp9', 'h264'];
|
|
6
|
-
|
|
7
5
|
type SipLineResponse = {
|
|
8
|
-
id: number
|
|
9
|
-
uuid: string
|
|
10
|
-
tenant_uuid: string
|
|
11
|
-
username: string
|
|
12
|
-
secret: string
|
|
13
|
-
type: string
|
|
14
|
-
host: string
|
|
15
|
-
options:
|
|
16
|
-
auth_section_options:
|
|
17
|
-
endpoint_section_options:
|
|
18
|
-
links: Array<
|
|
19
|
-
trunk:
|
|
20
|
-
line: Endpoint
|
|
6
|
+
id: number;
|
|
7
|
+
uuid: string;
|
|
8
|
+
tenant_uuid: string;
|
|
9
|
+
username: string;
|
|
10
|
+
secret: string;
|
|
11
|
+
type: string;
|
|
12
|
+
host: string;
|
|
13
|
+
options: string[][] | null | undefined;
|
|
14
|
+
auth_section_options: string[][] | null | undefined;
|
|
15
|
+
endpoint_section_options: string[][] | null | undefined;
|
|
16
|
+
links: Array<Record<string, any>>;
|
|
17
|
+
trunk: string | null | undefined;
|
|
18
|
+
line: Endpoint;
|
|
21
19
|
};
|
|
22
|
-
|
|
23
20
|
type SipLineArguments = {
|
|
24
|
-
id: number
|
|
25
|
-
uuid: string
|
|
26
|
-
tenantUuid: string
|
|
27
|
-
username: string
|
|
28
|
-
secret: string
|
|
29
|
-
type: string
|
|
30
|
-
host: string
|
|
31
|
-
options:
|
|
32
|
-
endpointSectionOptions:
|
|
33
|
-
links: Array<
|
|
34
|
-
trunk:
|
|
35
|
-
line: Endpoint
|
|
21
|
+
id: number;
|
|
22
|
+
uuid: string;
|
|
23
|
+
tenantUuid: string;
|
|
24
|
+
username: string;
|
|
25
|
+
secret: string;
|
|
26
|
+
type: string;
|
|
27
|
+
host: string;
|
|
28
|
+
options: string[][] | null | undefined;
|
|
29
|
+
endpointSectionOptions: string[][] | null | undefined;
|
|
30
|
+
links: Array<Record<string, any>>;
|
|
31
|
+
trunk: string | null | undefined;
|
|
32
|
+
line: Endpoint;
|
|
36
33
|
};
|
|
37
|
-
|
|
38
34
|
export default class SipLine {
|
|
39
35
|
id: any;
|
|
36
|
+
|
|
40
37
|
uuid: string;
|
|
38
|
+
|
|
41
39
|
tenantUuid: string;
|
|
40
|
+
|
|
42
41
|
username: string;
|
|
42
|
+
|
|
43
43
|
secret: string;
|
|
44
|
+
|
|
44
45
|
type: string;
|
|
46
|
+
|
|
45
47
|
host: string;
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
48
|
+
|
|
49
|
+
options: string[][] | null | undefined;
|
|
50
|
+
|
|
51
|
+
endpointSectionOptions: string[][] | null | undefined;
|
|
52
|
+
|
|
53
|
+
links: Array<Record<string, any>>;
|
|
54
|
+
|
|
55
|
+
trunk: string | null | undefined;
|
|
56
|
+
|
|
50
57
|
line: Endpoint;
|
|
51
58
|
|
|
52
59
|
static parse(plain: SipLineResponse): SipLine {
|
|
53
|
-
let {
|
|
60
|
+
let {
|
|
61
|
+
username,
|
|
62
|
+
secret,
|
|
63
|
+
host,
|
|
64
|
+
} = plain;
|
|
54
65
|
|
|
55
66
|
// Since 20.13 engine so options are now in section
|
|
56
67
|
if (plain.auth_section_options) {
|
|
57
|
-
// $FlowFixMe
|
|
58
68
|
const findOption = (options: string[][], name: string) => options.find(option => option[0] === name);
|
|
59
69
|
|
|
60
70
|
const usernameOption = findOption(plain.auth_section_options, 'username');
|
|
61
71
|
const secretOption = findOption(plain.auth_section_options, 'password');
|
|
62
|
-
const hostOption = findOption(plain.endpoint_section_options, 'media_address');
|
|
63
|
-
|
|
72
|
+
const hostOption = findOption(plain.endpoint_section_options as string[][], 'media_address');
|
|
64
73
|
username = usernameOption ? usernameOption[1] : '';
|
|
65
74
|
secret = secretOption ? secretOption[1] : '';
|
|
66
75
|
host = hostOption ? hostOption[1] : '';
|
|
@@ -90,10 +99,11 @@ export default class SipLine {
|
|
|
90
99
|
if (line.uuid) {
|
|
91
100
|
return this.uuid === line.uuid;
|
|
92
101
|
}
|
|
102
|
+
|
|
93
103
|
return this.id === line.id;
|
|
94
104
|
}
|
|
95
105
|
|
|
96
|
-
getOptions(): Array<
|
|
106
|
+
getOptions(): Array<Record<string, any>> {
|
|
97
107
|
// `options` params have beend remove since 20.13... we should now use endpointSectionOptions
|
|
98
108
|
return this.endpointSectionOptions || this.options || [];
|
|
99
109
|
}
|
|
@@ -104,14 +114,11 @@ export default class SipLine {
|
|
|
104
114
|
|
|
105
115
|
hasVideo() {
|
|
106
116
|
const allow = this.getOptions().find(option => option[0] === 'allow');
|
|
107
|
-
return Array.isArray(allow) && allow[1].split(',').some(codec => availableCodecs.some(c => c === codec));
|
|
117
|
+
return Array.isArray(allow) && allow[1].split(',').some((codec: string) => availableCodecs.some(c => c === codec));
|
|
108
118
|
}
|
|
109
119
|
|
|
110
120
|
hasVideoConference() {
|
|
111
|
-
return (
|
|
112
|
-
this.getOptions().some(option => option[0] === 'max_audio_streams' && parseInt(option[1], 10) > 0)
|
|
113
|
-
&& this.getOptions().some(option => option[0] === 'max_video_streams' && parseInt(option[1], 10) > 1)
|
|
114
|
-
);
|
|
121
|
+
return this.getOptions().some(option => option[0] === 'max_audio_streams' && parseInt(option[1], 10) > 0) && this.getOptions().some(option => option[0] === 'max_video_streams' && parseInt(option[1], 10) > 1);
|
|
115
122
|
}
|
|
116
123
|
|
|
117
124
|
constructor({
|
|
@@ -127,7 +134,7 @@ export default class SipLine {
|
|
|
127
134
|
links,
|
|
128
135
|
trunk,
|
|
129
136
|
line,
|
|
130
|
-
}: SipLineArguments
|
|
137
|
+
}: SipLineArguments) {
|
|
131
138
|
this.id = id;
|
|
132
139
|
this.uuid = uuid;
|
|
133
140
|
this.tenantUuid = tenantUuid;
|
|
@@ -140,8 +147,8 @@ export default class SipLine {
|
|
|
140
147
|
this.links = links;
|
|
141
148
|
this.trunk = trunk;
|
|
142
149
|
this.line = line;
|
|
143
|
-
|
|
144
150
|
// Useful to compare instead of instanceof with minified code
|
|
145
151
|
this.type = 'SipLine';
|
|
146
152
|
}
|
|
153
|
+
|
|
147
154
|
}
|
|
@@ -1,42 +1,48 @@
|
|
|
1
|
-
// @flow
|
|
2
|
-
|
|
3
1
|
type SubscriptionResponse = {
|
|
4
|
-
config:
|
|
2
|
+
config: Record<string, any>;
|
|
5
3
|
events: string[];
|
|
6
4
|
events_user_uuid: string;
|
|
7
5
|
events_wazo_uuid: string;
|
|
8
|
-
metadata:
|
|
6
|
+
metadata: Record<string, any>;
|
|
9
7
|
name: string;
|
|
10
8
|
owner_tenant_uuid: string;
|
|
11
9
|
owner_user_uuid: string;
|
|
12
10
|
service: string;
|
|
13
11
|
uuid: string;
|
|
14
|
-
}
|
|
12
|
+
};
|
|
15
13
|
|
|
16
14
|
type SubscriptionArguments = {
|
|
17
15
|
name: string;
|
|
18
16
|
events: string[];
|
|
19
|
-
config: string
|
|
17
|
+
config: Record<string, any>;
|
|
20
18
|
uuid: string;
|
|
21
19
|
service: string;
|
|
22
20
|
eventsUserUuid: string;
|
|
23
21
|
eventsWazoUuid: string;
|
|
24
|
-
metadata:
|
|
22
|
+
metadata: Record<string, any>;
|
|
25
23
|
ownerTenantUuid: string;
|
|
26
24
|
ownerUserUuid: string;
|
|
27
|
-
}
|
|
25
|
+
};
|
|
28
26
|
|
|
29
27
|
class Subscription {
|
|
30
|
-
|
|
31
28
|
name: string;
|
|
29
|
+
|
|
32
30
|
events: string[];
|
|
33
|
-
|
|
31
|
+
|
|
32
|
+
config: Record<string, any>;
|
|
33
|
+
|
|
34
34
|
uuid: string;
|
|
35
|
+
|
|
35
36
|
service: string;
|
|
37
|
+
|
|
36
38
|
eventsUserUuid: string;
|
|
39
|
+
|
|
37
40
|
eventsWazoUuid: string;
|
|
38
|
-
|
|
41
|
+
|
|
42
|
+
metadata: Record<string, any>;
|
|
43
|
+
|
|
39
44
|
ownerTenantUuid: string;
|
|
45
|
+
|
|
40
46
|
ownerUserUuid: string;
|
|
41
47
|
|
|
42
48
|
static parse(plain: SubscriptionResponse): Subscription {
|
|
@@ -54,7 +60,9 @@ class Subscription {
|
|
|
54
60
|
});
|
|
55
61
|
}
|
|
56
62
|
|
|
57
|
-
static parseMany(response: {
|
|
63
|
+
static parseMany(response: {
|
|
64
|
+
items: [];
|
|
65
|
+
}): Subscription[] {
|
|
58
66
|
return response.items.map(payload => Subscription.parse(payload));
|
|
59
67
|
}
|
|
60
68
|
|
|
@@ -69,7 +77,7 @@ class Subscription {
|
|
|
69
77
|
metadata,
|
|
70
78
|
ownerTenantUuid,
|
|
71
79
|
ownerUserUuid,
|
|
72
|
-
}:
|
|
80
|
+
}: SubscriptionArguments) {
|
|
73
81
|
this.name = name;
|
|
74
82
|
this.events = events;
|
|
75
83
|
this.config = config;
|
|
@@ -81,6 +89,7 @@ class Subscription {
|
|
|
81
89
|
this.ownerTenantUuid = ownerTenantUuid;
|
|
82
90
|
this.ownerUserUuid = ownerUserUuid;
|
|
83
91
|
}
|
|
92
|
+
|
|
84
93
|
}
|
|
85
94
|
|
|
86
95
|
export default Subscription;
|
|
@@ -1,64 +1,70 @@
|
|
|
1
|
-
// @flow
|
|
2
|
-
|
|
3
1
|
import CallSession from './CallSession';
|
|
4
2
|
import newFrom from '../utils/new-from';
|
|
5
3
|
import updateFrom from '../utils/update-from';
|
|
6
4
|
|
|
7
|
-
export type SwitchboardCallItem = {
|
|
8
|
-
|
|
5
|
+
export type SwitchboardCallItem = {
|
|
6
|
+
caller_id_name: string;
|
|
7
|
+
caller_id_number: string;
|
|
8
|
+
id: string;
|
|
9
|
+
};
|
|
9
10
|
export type SwitchboardCallItems = {
|
|
10
|
-
items: Array<SwitchboardCallItem
|
|
11
|
-
switchboard_uuid: string
|
|
11
|
+
items: Array<SwitchboardCallItem>;
|
|
12
|
+
switchboard_uuid: string;
|
|
12
13
|
};
|
|
13
|
-
|
|
14
14
|
export type SwitchboardAnwseredQueuedCall = {
|
|
15
|
-
operator_call_id: string
|
|
16
|
-
queued_call_id: string
|
|
17
|
-
switchboard_uuid: string
|
|
15
|
+
operator_call_id: string;
|
|
16
|
+
queued_call_id: string;
|
|
17
|
+
switchboard_uuid: string;
|
|
18
18
|
};
|
|
19
|
-
|
|
20
19
|
export type SwitchboardAnwseredHeldCall = {
|
|
21
|
-
held_call_id: string
|
|
22
|
-
operator_call_id: string
|
|
23
|
-
switchboard_uuid: string
|
|
20
|
+
held_call_id: string;
|
|
21
|
+
operator_call_id: string;
|
|
22
|
+
switchboard_uuid: string;
|
|
24
23
|
};
|
|
25
|
-
|
|
26
24
|
type SwitchboardCallArguments = {
|
|
27
|
-
id: string
|
|
28
|
-
callSession:
|
|
29
|
-
callerIdName:
|
|
30
|
-
callerIdNumber:
|
|
31
|
-
answerTime:
|
|
32
|
-
participantId:
|
|
33
|
-
state: string
|
|
34
|
-
switchboardName: string
|
|
35
|
-
switchboardUuid: string
|
|
25
|
+
id: string;
|
|
26
|
+
callSession: CallSession | null | undefined;
|
|
27
|
+
callerIdName: string | null | undefined;
|
|
28
|
+
callerIdNumber: string | null | undefined;
|
|
29
|
+
answerTime: Date | null | undefined;
|
|
30
|
+
participantId: string | null | undefined;
|
|
31
|
+
state: string;
|
|
32
|
+
switchboardName: string;
|
|
33
|
+
switchboardUuid: string;
|
|
36
34
|
};
|
|
37
|
-
|
|
38
35
|
export type SwitchboardCallResponse = {
|
|
39
|
-
callSession:
|
|
40
|
-
caller_id_name:
|
|
41
|
-
caller_id_number:
|
|
42
|
-
id: string
|
|
43
|
-
participantId:
|
|
44
|
-
startTime:
|
|
45
|
-
state: string
|
|
46
|
-
switchboardName: string
|
|
47
|
-
switchboardUuid: string
|
|
36
|
+
callSession: CallSession | null | undefined;
|
|
37
|
+
caller_id_name: string | null | undefined;
|
|
38
|
+
caller_id_number: string | null | undefined;
|
|
39
|
+
id: string;
|
|
40
|
+
participantId: string | null | undefined;
|
|
41
|
+
startTime: Date | null | undefined;
|
|
42
|
+
state: string;
|
|
43
|
+
switchboardName: string;
|
|
44
|
+
switchboardUuid: string;
|
|
48
45
|
};
|
|
49
46
|
|
|
50
47
|
class SwitchboardCall {
|
|
51
|
-
static STATE:
|
|
48
|
+
static STATE: Record<string, any>;
|
|
52
49
|
|
|
53
50
|
id: string;
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
51
|
+
|
|
52
|
+
callSession: CallSession | null | undefined;
|
|
53
|
+
|
|
54
|
+
callerIdName: string | null | undefined;
|
|
55
|
+
|
|
56
|
+
callerIdNumber: string | null | undefined;
|
|
57
|
+
|
|
58
|
+
answerTime: Date | null | undefined;
|
|
59
|
+
|
|
60
|
+
participantId: string | null | undefined;
|
|
61
|
+
|
|
59
62
|
state: string;
|
|
63
|
+
|
|
60
64
|
switchboardName: string;
|
|
65
|
+
|
|
61
66
|
switchboardUuid: string;
|
|
67
|
+
|
|
62
68
|
type: string;
|
|
63
69
|
|
|
64
70
|
static parse(plain: SwitchboardCallResponse): SwitchboardCall {
|
|
@@ -85,7 +91,7 @@ class SwitchboardCall {
|
|
|
85
91
|
state,
|
|
86
92
|
switchboardName,
|
|
87
93
|
switchboardUuid,
|
|
88
|
-
}: SwitchboardCallArguments
|
|
94
|
+
}: SwitchboardCallArguments) {
|
|
89
95
|
this.id = id;
|
|
90
96
|
this.callSession = callSession;
|
|
91
97
|
this.callerIdName = callerIdName;
|
|
@@ -95,7 +101,6 @@ class SwitchboardCall {
|
|
|
95
101
|
this.state = state;
|
|
96
102
|
this.switchboardName = switchboardName;
|
|
97
103
|
this.switchboardUuid = switchboardUuid;
|
|
98
|
-
|
|
99
104
|
// Useful to compare instead of instanceof with minified code
|
|
100
105
|
this.type = 'SwitchboardCall';
|
|
101
106
|
}
|
|
@@ -111,6 +116,7 @@ class SwitchboardCall {
|
|
|
111
116
|
static newFrom(switchboardCall: SwitchboardCall) {
|
|
112
117
|
return newFrom(switchboardCall, SwitchboardCall);
|
|
113
118
|
}
|
|
119
|
+
|
|
114
120
|
}
|
|
115
121
|
|
|
116
122
|
SwitchboardCall.STATE = {
|
|
@@ -118,5 +124,4 @@ SwitchboardCall.STATE = {
|
|
|
118
124
|
ONGOING: 'ongoing',
|
|
119
125
|
HELD: 'held',
|
|
120
126
|
};
|
|
121
|
-
|
|
122
127
|
export default SwitchboardCall;
|