@wazo/sdk 0.43.15 → 0.44.1
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/dist/index.js +10630 -0
- package/dist/index.mjs +10541 -0
- package/{lib → dist}/types/domain/Contact.d.ts +3 -1
- package/dist/types/domain/Contact.d.ts.map +1 -0
- package/{lib → dist}/types/index.d.ts +13 -13
- package/dist/types/index.d.ts.map +1 -0
- package/dist/wazo-sdk.js +69378 -43
- package/dist/wazo-sdk.js.LICENSE.txt +684 -0
- package/package.json +11 -22
- package/esm/__tests__/api-client.test.js +0 -281
- package/esm/__tests__/web-rtc-client.test.js +0 -192
- package/esm/api/agentd.js +0 -23
- package/esm/api/amid.js +0 -17
- package/esm/api/application.js +0 -63
- package/esm/api/auth.js +0 -198
- package/esm/api/call-logd.js +0 -24
- package/esm/api/calld.js +0 -120
- package/esm/api/chatd.js +0 -50
- package/esm/api/confd.js +0 -77
- package/esm/api/ctid-ng.js +0 -96
- package/esm/api/dird.js +0 -110
- package/esm/api/webhookd.js +0 -7
- package/esm/api-client.js +0 -41
- package/esm/base-api-client.js +0 -125
- package/esm/checker/Checker.js +0 -54
- package/esm/checker/checks/aor.js +0 -28
- package/esm/checker/checks/api.js +0 -76
- package/esm/checker/checks/ice-ipv4.js +0 -69
- package/esm/checker/checks/index.js +0 -8
- package/esm/checker/checks/symmetric-nat.js +0 -59
- package/esm/checker/checks/wazo-websocket.js +0 -38
- package/esm/checker/checks/webrtc-transport.js +0 -35
- package/esm/checker/checks/webrtc.js +0 -40
- package/esm/constants.js +0 -11
- package/esm/domain/AdHocAPIConference.js +0 -102
- package/esm/domain/Agent.js +0 -30
- package/esm/domain/BadResponse.js +0 -21
- package/esm/domain/Call.js +0 -123
- package/esm/domain/CallLog.js +0 -157
- package/esm/domain/CallSession.js +0 -253
- package/esm/domain/CallerID.js +0 -24
- package/esm/domain/ChatMessage.js +0 -55
- package/esm/domain/ChatRoom.js +0 -30
- package/esm/domain/Contact.js +0 -464
- package/esm/domain/Country.js +0 -19
- package/esm/domain/Device/DebugDevice.js +0 -32
- package/esm/domain/Device/Device.js +0 -1
- package/esm/domain/DirectorySource.js +0 -1
- package/esm/domain/ExternalApp.js +0 -24
- package/esm/domain/Features.js +0 -77
- package/esm/domain/ForwardOption.js +0 -37
- package/esm/domain/Incall.js +0 -28
- package/esm/domain/IndirectTransfer.js +0 -40
- package/esm/domain/Line.js +0 -39
- package/esm/domain/Meeting.js +0 -61
- package/esm/domain/MeetingAuthorization.js +0 -46
- package/esm/domain/MeetingStatus.js +0 -14
- package/esm/domain/NotificationOptions.js +0 -45
- package/esm/domain/Phone/CTIPhone.js +0 -288
- package/esm/domain/Phone/Phone.js +0 -1
- package/esm/domain/Phone/WebRTCPhone.js +0 -1482
- package/esm/domain/Profile.js +0 -128
- package/esm/domain/Recording.js +0 -30
- package/esm/domain/Relocation.js +0 -20
- package/esm/domain/Room.js +0 -97
- package/esm/domain/SFUNotAvailableError.js +0 -6
- package/esm/domain/ServerError.js +0 -9
- package/esm/domain/Session.js +0 -174
- package/esm/domain/SipLine.js +0 -82
- package/esm/domain/Subscription.js +0 -42
- package/esm/domain/SwitchboardCall.js +0 -56
- package/esm/domain/Voicemail.js +0 -76
- package/esm/domain/__tests__/Agent.test.js +0 -37
- package/esm/domain/__tests__/Call.test.js +0 -25
- package/esm/domain/__tests__/CallLog.test.js +0 -181
- package/esm/domain/__tests__/CallSession.test.js +0 -78
- package/esm/domain/__tests__/Contact.test.js +0 -393
- package/esm/domain/__tests__/IndirectTransfer.test.js +0 -67
- package/esm/domain/__tests__/Line.test.js +0 -52
- package/esm/domain/__tests__/Meeting.test.js +0 -77
- package/esm/domain/__tests__/MeetingAuthorization.test.js +0 -49
- package/esm/domain/__tests__/Profile.test.js +0 -169
- package/esm/domain/__tests__/Room.test.js +0 -206
- package/esm/domain/__tests__/Session.test.js +0 -382
- package/esm/domain/__tests__/SipLine.test.js +0 -27
- package/esm/domain/__tests__/Voicemail.test.js +0 -90
- package/esm/domain/types.js +0 -2
- package/esm/index.js +0 -51
- package/esm/lib/WazoSessionDescriptionHandler.js +0 -429
- package/esm/pubkey.js +0 -10
- package/esm/service/CallApi.js +0 -61
- package/esm/service/IssueReporter.js +0 -331
- package/esm/service/__tests__/IssueReporter.test.js +0 -112
- package/esm/service/__tests__/getApiclient.test.js +0 -37
- package/esm/service/getApiClient.js +0 -94
- package/esm/simple/Auth.js +0 -384
- package/esm/simple/Configuration.js +0 -13
- package/esm/simple/Directory.js +0 -11
- package/esm/simple/Phone.js +0 -389
- package/esm/simple/Websocket.js +0 -81
- package/esm/simple/__tests__/Auth.test.js +0 -144
- package/esm/simple/index.js +0 -137
- package/esm/simple/room/LocalParticipant.js +0 -4
- package/esm/simple/room/Participant.js +0 -315
- package/esm/simple/room/RemoteParticipant.js +0 -10
- package/esm/simple/room/Room.js +0 -714
- package/esm/simple/room/SipRoom.js +0 -121
- package/esm/simple/room/Stream.js +0 -47
- package/esm/simple/room/__tests__/Participant.test.js +0 -71
- package/esm/simple/room/__tests__/RemoteParticipant.test.js +0 -12
- package/esm/simple/utils.js +0 -10
- package/esm/types/WebSocketMessage.js +0 -1
- package/esm/types/domain/Contact.d.ts +0 -332
- package/esm/types/domain/Contact.d.ts.map +0 -1
- package/esm/types/index.d.ts +0 -59
- package/esm/types/index.d.ts.map +0 -1
- package/esm/utils/Emitter.js +0 -19
- package/esm/utils/Heartbeat.js +0 -73
- package/esm/utils/PhoneNumberUtil.js +0 -67
- package/esm/utils/__tests__/Heartbeat.test.js +0 -65
- package/esm/utils/__tests__/PhoneNumberUtil.test.js +0 -70
- package/esm/utils/__tests__/api-requester.test.js +0 -166
- package/esm/utils/__tests__/array.test.js +0 -18
- package/esm/utils/__tests__/compare-version.test.js +0 -10
- package/esm/utils/__tests__/object.test.js +0 -76
- package/esm/utils/__tests__/sdp.test.js +0 -172
- package/esm/utils/__tests__/string.test.js +0 -49
- package/esm/utils/api-requester.js +0 -213
- package/esm/utils/array.js +0 -9
- package/esm/utils/compare-version.js +0 -17
- package/esm/utils/isMobile.js +0 -3
- package/esm/utils/new-from.js +0 -7
- package/esm/utils/object.js +0 -10
- package/esm/utils/once.js +0 -15
- package/esm/utils/sdp.js +0 -104
- package/esm/utils/string.js +0 -12
- package/esm/utils/update-from.js +0 -10
- package/esm/utils/webrtc.js +0 -37
- package/esm/web-rtc-client.js +0 -2200
- package/esm/websocket-client.js +0 -385
- package/index.js +0 -1
- package/lib/__tests__/api-client.test.js +0 -295
- package/lib/__tests__/web-rtc-client.test.js +0 -210
- package/lib/api/agentd.js +0 -28
- package/lib/api/amid.js +0 -28
- package/lib/api/application.js +0 -68
- package/lib/api/auth.js +0 -210
- package/lib/api/call-logd.js +0 -29
- package/lib/api/calld.js +0 -134
- package/lib/api/chatd.js +0 -68
- package/lib/api/confd.js +0 -91
- package/lib/api/ctid-ng.js +0 -101
- package/lib/api/dird.js +0 -124
- package/lib/api/webhookd.js +0 -12
- package/lib/api-client.js +0 -37
- package/lib/base-api-client.js +0 -133
- package/lib/checker/Checker.js +0 -68
- package/lib/checker/checks/aor.js +0 -42
- package/lib/checker/checks/api.js +0 -90
- package/lib/checker/checks/ice-ipv4.js +0 -73
- package/lib/checker/checks/index.js +0 -13
- package/lib/checker/checks/symmetric-nat.js +0 -61
- package/lib/checker/checks/wazo-websocket.js +0 -63
- package/lib/checker/checks/webrtc-transport.js +0 -49
- package/lib/checker/checks/webrtc.js +0 -54
- package/lib/constants.js +0 -14
- package/lib/domain/AdHocAPIConference.js +0 -101
- package/lib/domain/Agent.js +0 -25
- package/lib/domain/BadResponse.js +0 -19
- package/lib/domain/Call.js +0 -112
- package/lib/domain/CallLog.js +0 -151
- package/lib/domain/CallSession.js +0 -224
- package/lib/domain/CallerID.js +0 -27
- package/lib/domain/ChatMessage.js +0 -53
- package/lib/domain/ChatRoom.js +0 -32
- package/lib/domain/Contact.js +0 -439
- package/lib/domain/Country.js +0 -21
- package/lib/domain/Device/DebugDevice.js +0 -35
- package/lib/domain/Device/Device.js +0 -2
- package/lib/domain/DirectorySource.js +0 -2
- package/lib/domain/ExternalApp.js +0 -27
- package/lib/domain/Features.js +0 -87
- package/lib/domain/ForwardOption.js +0 -41
- package/lib/domain/Incall.js +0 -32
- package/lib/domain/IndirectTransfer.js +0 -42
- package/lib/domain/Line.js +0 -39
- package/lib/domain/Meeting.js +0 -55
- package/lib/domain/MeetingAuthorization.js +0 -45
- package/lib/domain/MeetingStatus.js +0 -15
- package/lib/domain/NotificationOptions.js +0 -49
- package/lib/domain/Phone/CTIPhone.js +0 -324
- package/lib/domain/Phone/Phone.js +0 -2
- package/lib/domain/Phone/WebRTCPhone.js +0 -1492
- package/lib/domain/Profile.js +0 -138
- package/lib/domain/Recording.js +0 -31
- package/lib/domain/Relocation.js +0 -18
- package/lib/domain/Room.js +0 -81
- package/lib/domain/SFUNotAvailableError.js +0 -9
- package/lib/domain/ServerError.js +0 -15
- package/lib/domain/Session.js +0 -166
- package/lib/domain/SipLine.js +0 -76
- package/lib/domain/Subscription.js +0 -34
- package/lib/domain/SwitchboardCall.js +0 -50
- package/lib/domain/Voicemail.js +0 -77
- package/lib/domain/__tests__/Agent.test.js +0 -42
- package/lib/domain/__tests__/Call.test.js +0 -30
- package/lib/domain/__tests__/CallLog.test.js +0 -166
- package/lib/domain/__tests__/CallSession.test.js +0 -83
- package/lib/domain/__tests__/Contact.test.js +0 -371
- package/lib/domain/__tests__/IndirectTransfer.test.js +0 -81
- package/lib/domain/__tests__/Line.test.js +0 -57
- package/lib/domain/__tests__/Meeting.test.js +0 -82
- package/lib/domain/__tests__/MeetingAuthorization.test.js +0 -54
- package/lib/domain/__tests__/Profile.test.js +0 -197
- package/lib/domain/__tests__/Room.test.js +0 -220
- package/lib/domain/__tests__/Session.test.js +0 -378
- package/lib/domain/__tests__/SipLine.test.js +0 -32
- package/lib/domain/__tests__/Voicemail.test.js +0 -95
- package/lib/domain/types.js +0 -38
- package/lib/index.js +0 -127
- package/lib/lib/WazoSessionDescriptionHandler.js +0 -434
- package/lib/pubkey.js +0 -12
- package/lib/service/CallApi.js +0 -112
- package/lib/service/IssueReporter.js +0 -317
- package/lib/service/__tests__/IssueReporter.test.js +0 -117
- package/lib/service/__tests__/getApiclient.test.js +0 -42
- package/lib/service/getApiClient.js +0 -114
- package/lib/simple/Auth.js +0 -433
- package/lib/simple/Configuration.js +0 -31
- package/lib/simple/Directory.js +0 -29
- package/lib/simple/Phone.js +0 -418
- package/lib/simple/Websocket.js +0 -116
- package/lib/simple/__tests__/Auth.test.js +0 -181
- package/lib/simple/index.js +0 -165
- package/lib/simple/room/LocalParticipant.js +0 -9
- package/lib/simple/room/Participant.js +0 -302
- package/lib/simple/room/RemoteParticipant.js +0 -15
- package/lib/simple/room/Room.js +0 -711
- package/lib/simple/room/SipRoom.js +0 -141
- package/lib/simple/room/Stream.js +0 -50
- package/lib/simple/room/__tests__/Participant.test.js +0 -85
- package/lib/simple/room/__tests__/RemoteParticipant.test.js +0 -17
- package/lib/simple/utils.js +0 -27
- package/lib/types/WebSocketMessage.js +0 -2
- package/lib/types/__tests__/api-client.test.d.ts +0 -2
- package/lib/types/__tests__/api-client.test.d.ts.map +0 -1
- package/lib/types/__tests__/web-rtc-client.test.d.ts +0 -2
- package/lib/types/__tests__/web-rtc-client.test.d.ts.map +0 -1
- package/lib/types/api/agentd.d.ts +0 -17
- package/lib/types/api/agentd.d.ts.map +0 -1
- package/lib/types/api/amid.d.ts +0 -8
- package/lib/types/api/amid.d.ts.map +0 -1
- package/lib/types/api/application.d.ts +0 -34
- package/lib/types/api/application.d.ts.map +0 -1
- package/lib/types/api/auth.d.ts +0 -69
- package/lib/types/api/auth.d.ts.map +0 -1
- package/lib/types/api/call-logd.d.ts +0 -12
- package/lib/types/api/call-logd.d.ts.map +0 -1
- package/lib/types/api/calld.d.ts +0 -52
- package/lib/types/api/calld.d.ts.map +0 -1
- package/lib/types/api/chatd.d.ts +0 -29
- package/lib/types/api/chatd.d.ts.map +0 -1
- package/lib/types/api/confd.d.ts +0 -46
- package/lib/types/api/confd.d.ts.map +0 -1
- package/lib/types/api/ctid-ng.d.ts +0 -36
- package/lib/types/api/ctid-ng.d.ts.map +0 -1
- package/lib/types/api/dird.d.ts +0 -33
- package/lib/types/api/dird.d.ts.map +0 -1
- package/lib/types/api/webhookd.d.ts +0 -24
- package/lib/types/api/webhookd.d.ts.map +0 -1
- package/lib/types/api-client.d.ts +0 -26
- package/lib/types/api-client.d.ts.map +0 -1
- package/lib/types/base-api-client.d.ts +0 -43
- package/lib/types/base-api-client.d.ts.map +0 -1
- package/lib/types/checker/Checker.d.ts +0 -13
- package/lib/types/checker/Checker.d.ts.map +0 -1
- package/lib/types/checker/checks/aor.d.ts +0 -6
- package/lib/types/checker/checks/aor.d.ts.map +0 -1
- package/lib/types/checker/checks/api.d.ts +0 -6
- package/lib/types/checker/checks/api.d.ts.map +0 -1
- package/lib/types/checker/checks/ice-ipv4.d.ts +0 -6
- package/lib/types/checker/checks/ice-ipv4.d.ts.map +0 -1
- package/lib/types/checker/checks/index.d.ts +0 -9
- package/lib/types/checker/checks/index.d.ts.map +0 -1
- package/lib/types/checker/checks/symmetric-nat.d.ts +0 -6
- package/lib/types/checker/checks/symmetric-nat.d.ts.map +0 -1
- package/lib/types/checker/checks/wazo-websocket.d.ts +0 -6
- package/lib/types/checker/checks/wazo-websocket.d.ts.map +0 -1
- package/lib/types/checker/checks/webrtc-transport.d.ts +0 -7
- package/lib/types/checker/checks/webrtc-transport.d.ts.map +0 -1
- package/lib/types/checker/checks/webrtc.d.ts +0 -6
- package/lib/types/checker/checks/webrtc.d.ts.map +0 -1
- package/lib/types/constants.d.ts +0 -12
- package/lib/types/constants.d.ts.map +0 -1
- package/lib/types/domain/AdHocAPIConference.d.ts +0 -54
- package/lib/types/domain/AdHocAPIConference.d.ts.map +0 -1
- package/lib/types/domain/Agent.d.ts +0 -31
- package/lib/types/domain/Agent.d.ts.map +0 -1
- package/lib/types/domain/BadResponse.d.ts +0 -11
- package/lib/types/domain/BadResponse.d.ts.map +0 -1
- package/lib/types/domain/Call.d.ts +0 -79
- package/lib/types/domain/Call.d.ts.map +0 -1
- package/lib/types/domain/CallLog.d.ts +0 -88
- package/lib/types/domain/CallLog.d.ts.map +0 -1
- package/lib/types/domain/CallSession.d.ts +0 -119
- package/lib/types/domain/CallSession.d.ts.map +0 -1
- package/lib/types/domain/CallerID.d.ts +0 -22
- package/lib/types/domain/CallerID.d.ts.map +0 -1
- package/lib/types/domain/ChatMessage.d.ts +0 -41
- package/lib/types/domain/ChatMessage.d.ts.map +0 -1
- package/lib/types/domain/ChatRoom.d.ts +0 -22
- package/lib/types/domain/ChatRoom.d.ts.map +0 -1
- package/lib/types/domain/Contact.d.ts.map +0 -1
- package/lib/types/domain/Country.d.ts +0 -21
- package/lib/types/domain/Country.d.ts.map +0 -1
- package/lib/types/domain/Device/DebugDevice.d.ts +0 -14
- package/lib/types/domain/Device/DebugDevice.d.ts.map +0 -1
- package/lib/types/domain/Device/Device.d.ts +0 -13
- package/lib/types/domain/Device/Device.d.ts.map +0 -1
- package/lib/types/domain/DirectorySource.d.ts +0 -13
- package/lib/types/domain/DirectorySource.d.ts.map +0 -1
- package/lib/types/domain/ExternalApp.d.ts +0 -22
- package/lib/types/domain/ExternalApp.d.ts.map +0 -1
- package/lib/types/domain/Features.d.ts +0 -26
- package/lib/types/domain/Features.d.ts.map +0 -1
- package/lib/types/domain/ForwardOption.d.ts +0 -28
- package/lib/types/domain/ForwardOption.d.ts.map +0 -1
- package/lib/types/domain/Incall.d.ts +0 -21
- package/lib/types/domain/Incall.d.ts.map +0 -1
- package/lib/types/domain/IndirectTransfer.d.ts +0 -31
- package/lib/types/domain/IndirectTransfer.d.ts.map +0 -1
- package/lib/types/domain/Line.d.ts +0 -35
- package/lib/types/domain/Line.d.ts.map +0 -1
- package/lib/types/domain/Meeting.d.ts +0 -45
- package/lib/types/domain/Meeting.d.ts.map +0 -1
- package/lib/types/domain/MeetingAuthorization.d.ts +0 -32
- package/lib/types/domain/MeetingAuthorization.d.ts.map +0 -1
- package/lib/types/domain/MeetingStatus.d.ts +0 -10
- package/lib/types/domain/MeetingStatus.d.ts.map +0 -1
- package/lib/types/domain/NotificationOptions.d.ts +0 -22
- package/lib/types/domain/NotificationOptions.d.ts.map +0 -1
- package/lib/types/domain/Phone/CTIPhone.d.ts +0 -79
- package/lib/types/domain/Phone/CTIPhone.d.ts.map +0 -1
- package/lib/types/domain/Phone/Phone.d.ts +0 -83
- package/lib/types/domain/Phone/Phone.d.ts.map +0 -1
- package/lib/types/domain/Phone/WebRTCPhone.d.ts +0 -183
- package/lib/types/domain/Phone/WebRTCPhone.d.ts.map +0 -1
- package/lib/types/domain/Profile.d.ts +0 -155
- package/lib/types/domain/Profile.d.ts.map +0 -1
- package/lib/types/domain/Recording.d.ts +0 -26
- package/lib/types/domain/Recording.d.ts.map +0 -1
- package/lib/types/domain/Relocation.d.ts +0 -23
- package/lib/types/domain/Relocation.d.ts.map +0 -1
- package/lib/types/domain/Room.d.ts +0 -33
- package/lib/types/domain/Room.d.ts.map +0 -1
- package/lib/types/domain/SFUNotAvailableError.d.ts +0 -4
- package/lib/types/domain/SFUNotAvailableError.d.ts.map +0 -1
- package/lib/types/domain/ServerError.d.ts +0 -6
- package/lib/types/domain/ServerError.d.ts.map +0 -1
- package/lib/types/domain/Session.d.ts +0 -100
- package/lib/types/domain/Session.d.ts.map +0 -1
- package/lib/types/domain/SipLine.d.ts +0 -54
- package/lib/types/domain/SipLine.d.ts.map +0 -1
- package/lib/types/domain/Subscription.d.ts +0 -43
- package/lib/types/domain/Subscription.d.ts.map +0 -1
- package/lib/types/domain/SwitchboardCall.d.ts +0 -62
- package/lib/types/domain/SwitchboardCall.d.ts.map +0 -1
- package/lib/types/domain/Voicemail.d.ts +0 -58
- package/lib/types/domain/Voicemail.d.ts.map +0 -1
- package/lib/types/domain/__tests__/Agent.test.d.ts +0 -2
- package/lib/types/domain/__tests__/Agent.test.d.ts.map +0 -1
- package/lib/types/domain/__tests__/Call.test.d.ts +0 -2
- package/lib/types/domain/__tests__/Call.test.d.ts.map +0 -1
- package/lib/types/domain/__tests__/CallLog.test.d.ts +0 -2
- package/lib/types/domain/__tests__/CallLog.test.d.ts.map +0 -1
- package/lib/types/domain/__tests__/CallSession.test.d.ts +0 -2
- package/lib/types/domain/__tests__/CallSession.test.d.ts.map +0 -1
- package/lib/types/domain/__tests__/Contact.test.d.ts +0 -2
- package/lib/types/domain/__tests__/Contact.test.d.ts.map +0 -1
- package/lib/types/domain/__tests__/IndirectTransfer.test.d.ts +0 -2
- package/lib/types/domain/__tests__/IndirectTransfer.test.d.ts.map +0 -1
- package/lib/types/domain/__tests__/Line.test.d.ts +0 -2
- package/lib/types/domain/__tests__/Line.test.d.ts.map +0 -1
- package/lib/types/domain/__tests__/Meeting.test.d.ts +0 -2
- package/lib/types/domain/__tests__/Meeting.test.d.ts.map +0 -1
- package/lib/types/domain/__tests__/MeetingAuthorization.test.d.ts +0 -2
- package/lib/types/domain/__tests__/MeetingAuthorization.test.d.ts.map +0 -1
- package/lib/types/domain/__tests__/Profile.test.d.ts +0 -2
- package/lib/types/domain/__tests__/Profile.test.d.ts.map +0 -1
- package/lib/types/domain/__tests__/Room.test.d.ts +0 -2
- package/lib/types/domain/__tests__/Room.test.d.ts.map +0 -1
- package/lib/types/domain/__tests__/Session.test.d.ts +0 -2
- package/lib/types/domain/__tests__/Session.test.d.ts.map +0 -1
- package/lib/types/domain/__tests__/SipLine.test.d.ts +0 -2
- package/lib/types/domain/__tests__/SipLine.test.d.ts.map +0 -1
- package/lib/types/domain/__tests__/Voicemail.test.d.ts +0 -2
- package/lib/types/domain/__tests__/Voicemail.test.d.ts.map +0 -1
- package/lib/types/domain/types.d.ts +0 -378
- package/lib/types/domain/types.d.ts.map +0 -1
- package/lib/types/index.d.ts.map +0 -1
- package/lib/types/lib/WazoSessionDescriptionHandler.d.ts +0 -31
- package/lib/types/lib/WazoSessionDescriptionHandler.d.ts.map +0 -1
- package/lib/types/pubkey.d.ts +0 -3
- package/lib/types/pubkey.d.ts.map +0 -1
- package/lib/types/service/CallApi.d.ts +0 -28
- package/lib/types/service/CallApi.d.ts.map +0 -1
- package/lib/types/service/IssueReporter.d.ts +0 -42
- package/lib/types/service/IssueReporter.d.ts.map +0 -1
- package/lib/types/service/__tests__/IssueReporter.test.d.ts +0 -2
- package/lib/types/service/__tests__/IssueReporter.test.d.ts.map +0 -1
- package/lib/types/service/__tests__/getApiclient.test.d.ts +0 -2
- package/lib/types/service/__tests__/getApiclient.test.d.ts.map +0 -1
- package/lib/types/service/getApiClient.d.ts +0 -21
- package/lib/types/service/getApiClient.d.ts.map +0 -1
- package/lib/types/simple/Auth.d.ts +0 -75
- package/lib/types/simple/Auth.d.ts.map +0 -1
- package/lib/types/simple/Configuration.d.ts +0 -7
- package/lib/types/simple/Configuration.d.ts.map +0 -1
- package/lib/types/simple/Directory.d.ts +0 -7
- package/lib/types/simple/Directory.d.ts.map +0 -1
- package/lib/types/simple/Phone.d.ts +0 -119
- package/lib/types/simple/Phone.d.ts.map +0 -1
- package/lib/types/simple/Websocket.d.ts +0 -21
- package/lib/types/simple/Websocket.d.ts.map +0 -1
- package/lib/types/simple/__tests__/Auth.test.d.ts +0 -2
- package/lib/types/simple/__tests__/Auth.test.d.ts.map +0 -1
- package/lib/types/simple/index.d.ts +0 -153
- package/lib/types/simple/index.d.ts.map +0 -1
- package/lib/types/simple/room/LocalParticipant.d.ts +0 -5
- package/lib/types/simple/room/LocalParticipant.d.ts.map +0 -1
- package/lib/types/simple/room/Participant.d.ts +0 -77
- package/lib/types/simple/room/Participant.d.ts.map +0 -1
- package/lib/types/simple/room/RemoteParticipant.d.ts +0 -7
- package/lib/types/simple/room/RemoteParticipant.d.ts.map +0 -1
- package/lib/types/simple/room/Room.d.ts +0 -127
- package/lib/types/simple/room/Room.d.ts.map +0 -1
- package/lib/types/simple/room/SipRoom.d.ts +0 -14
- package/lib/types/simple/room/SipRoom.d.ts.map +0 -1
- package/lib/types/simple/room/Stream.d.ts +0 -13
- package/lib/types/simple/room/Stream.d.ts.map +0 -1
- package/lib/types/simple/room/__tests__/Participant.test.d.ts +0 -2
- package/lib/types/simple/room/__tests__/Participant.test.d.ts.map +0 -1
- package/lib/types/simple/room/__tests__/RemoteParticipant.test.d.ts +0 -2
- package/lib/types/simple/room/__tests__/RemoteParticipant.test.d.ts.map +0 -1
- package/lib/types/simple/utils.d.ts +0 -3
- package/lib/types/simple/utils.d.ts.map +0 -1
- package/lib/types/types/WebSocketMessage.d.ts +0 -285
- package/lib/types/types/WebSocketMessage.d.ts.map +0 -1
- package/lib/types/utils/Emitter.d.ts +0 -18
- package/lib/types/utils/Emitter.d.ts.map +0 -1
- package/lib/types/utils/Heartbeat.d.ts +0 -22
- package/lib/types/utils/Heartbeat.d.ts.map +0 -1
- package/lib/types/utils/PhoneNumberUtil.d.ts +0 -7
- package/lib/types/utils/PhoneNumberUtil.d.ts.map +0 -1
- package/lib/types/utils/__tests__/Heartbeat.test.d.ts +0 -2
- package/lib/types/utils/__tests__/Heartbeat.test.d.ts.map +0 -1
- package/lib/types/utils/__tests__/PhoneNumberUtil.test.d.ts +0 -2
- package/lib/types/utils/__tests__/PhoneNumberUtil.test.d.ts.map +0 -1
- package/lib/types/utils/__tests__/api-requester.test.d.ts +0 -2
- package/lib/types/utils/__tests__/api-requester.test.d.ts.map +0 -1
- package/lib/types/utils/__tests__/array.test.d.ts +0 -2
- package/lib/types/utils/__tests__/array.test.d.ts.map +0 -1
- package/lib/types/utils/__tests__/compare-version.test.d.ts +0 -2
- package/lib/types/utils/__tests__/compare-version.test.d.ts.map +0 -1
- package/lib/types/utils/__tests__/object.test.d.ts +0 -2
- package/lib/types/utils/__tests__/object.test.d.ts.map +0 -1
- package/lib/types/utils/__tests__/sdp.test.d.ts +0 -2
- package/lib/types/utils/__tests__/sdp.test.d.ts.map +0 -1
- package/lib/types/utils/__tests__/string.test.d.ts +0 -2
- package/lib/types/utils/__tests__/string.test.d.ts.map +0 -1
- package/lib/types/utils/api-requester.d.ts +0 -48
- package/lib/types/utils/api-requester.d.ts.map +0 -1
- package/lib/types/utils/array.d.ts +0 -2
- package/lib/types/utils/array.d.ts.map +0 -1
- package/lib/types/utils/compare-version.d.ts +0 -3
- package/lib/types/utils/compare-version.d.ts.map +0 -1
- package/lib/types/utils/isMobile.d.ts +0 -3
- package/lib/types/utils/isMobile.d.ts.map +0 -1
- package/lib/types/utils/new-from.d.ts +0 -3
- package/lib/types/utils/new-from.d.ts.map +0 -1
- package/lib/types/utils/object.d.ts +0 -2
- package/lib/types/utils/object.d.ts.map +0 -1
- package/lib/types/utils/once.d.ts +0 -2
- package/lib/types/utils/once.d.ts.map +0 -1
- package/lib/types/utils/sdp.d.ts +0 -28
- package/lib/types/utils/sdp.d.ts.map +0 -1
- package/lib/types/utils/string.d.ts +0 -3
- package/lib/types/utils/string.d.ts.map +0 -1
- package/lib/types/utils/update-from.d.ts +0 -3
- package/lib/types/utils/update-from.d.ts.map +0 -1
- package/lib/types/utils/webrtc.d.ts +0 -15
- package/lib/types/utils/webrtc.d.ts.map +0 -1
- package/lib/types/web-rtc-client.d.ts +0 -198
- package/lib/types/web-rtc-client.d.ts.map +0 -1
- package/lib/types/websocket-client.d.ts +0 -138
- package/lib/types/websocket-client.d.ts.map +0 -1
- package/lib/utils/Emitter.js +0 -24
- package/lib/utils/Heartbeat.js +0 -66
- package/lib/utils/PhoneNumberUtil.js +0 -73
- package/lib/utils/__tests__/Heartbeat.test.js +0 -79
- package/lib/utils/__tests__/PhoneNumberUtil.test.js +0 -72
- package/lib/utils/__tests__/api-requester.test.js +0 -180
- package/lib/utils/__tests__/array.test.js +0 -20
- package/lib/utils/__tests__/compare-version.test.js +0 -15
- package/lib/utils/__tests__/object.test.js +0 -78
- package/lib/utils/__tests__/sdp.test.js +0 -188
- package/lib/utils/__tests__/string.test.js +0 -51
- package/lib/utils/api-requester.js +0 -200
- package/lib/utils/array.js +0 -13
- package/lib/utils/compare-version.js +0 -19
- package/lib/utils/isMobile.js +0 -5
- package/lib/utils/new-from.js +0 -9
- package/lib/utils/object.js +0 -14
- package/lib/utils/once.js +0 -18
- package/lib/utils/sdp.js +0 -115
- package/lib/utils/string.js +0 -17
- package/lib/utils/update-from.js +0 -12
- package/lib/utils/webrtc.js +0 -41
- package/lib/web-rtc-client.js +0 -2239
- package/lib/websocket-client.js +0 -390
- package/src/__tests__/api-client.test.ts +0 -315
- package/src/__tests__/web-rtc-client.test.ts +0 -198
- package/src/api/agentd.ts +0 -37
- package/src/api/amid.ts +0 -25
- package/src/api/application.ts +0 -96
- package/src/api/auth.ts +0 -305
- package/src/api/call-logd.ts +0 -38
- package/src/api/calld.ts +0 -185
- package/src/api/chatd.ts +0 -87
- package/src/api/confd.ts +0 -119
- package/src/api/ctid-ng.ts +0 -152
- package/src/api/dird.ts +0 -143
- package/src/api/webhookd.ts +0 -30
- package/src/api-client.ts +0 -65
- package/src/base-api-client.ts +0 -184
- package/src/checker/Checker.ts +0 -73
- package/src/checker/checks/aor.ts +0 -34
- package/src/checker/checks/api.ts +0 -78
- package/src/checker/checks/ice-ipv4.ts +0 -80
- package/src/checker/checks/index.ts +0 -9
- package/src/checker/checks/symmetric-nat.ts +0 -69
- package/src/checker/checks/wazo-websocket.ts +0 -41
- package/src/checker/checks/webrtc-transport.ts +0 -42
- package/src/checker/checks/webrtc.ts +0 -48
- package/src/constants.ts +0 -11
- package/src/domain/AdHocAPIConference.ts +0 -166
- package/src/domain/Agent.ts +0 -68
- package/src/domain/BadResponse.ts +0 -29
- package/src/domain/Call.ts +0 -217
- package/src/domain/CallLog.ts +0 -265
- package/src/domain/CallSession.ts +0 -401
- package/src/domain/CallerID.ts +0 -49
- package/src/domain/ChatMessage.ts +0 -107
- package/src/domain/ChatRoom.ts +0 -55
- package/src/domain/Contact.ts +0 -851
- package/src/domain/Country.ts +0 -19
- package/src/domain/Device/DebugDevice.ts +0 -44
- package/src/domain/Device/Device.ts +0 -12
- package/src/domain/DirectorySource.ts +0 -13
- package/src/domain/ExternalApp.ts +0 -46
- package/src/domain/Features.ts +0 -105
- package/src/domain/ForwardOption.ts +0 -65
- package/src/domain/Incall.ts +0 -50
- package/src/domain/IndirectTransfer.ts +0 -73
- package/src/domain/Line.ts +0 -79
- package/src/domain/Meeting.ts +0 -113
- package/src/domain/MeetingAuthorization.ts +0 -81
- package/src/domain/MeetingStatus.ts +0 -23
- package/src/domain/NotificationOptions.ts +0 -68
- package/src/domain/Phone/CTIPhone.ts +0 -381
- package/src/domain/Phone/Phone.ts +0 -81
- package/src/domain/Phone/WebRTCPhone.ts +0 -1830
- package/src/domain/Profile.ts +0 -289
- package/src/domain/Recording.ts +0 -60
- package/src/domain/Relocation.ts +0 -45
- package/src/domain/Room.ts +0 -141
- package/src/domain/SFUNotAvailableError.ts +0 -7
- package/src/domain/ServerError.ts +0 -12
- package/src/domain/Session.ts +0 -297
- package/src/domain/SipLine.ts +0 -154
- package/src/domain/Subscription.ts +0 -95
- package/src/domain/SwitchboardCall.ts +0 -127
- package/src/domain/Voicemail.ts +0 -138
- package/src/domain/__tests__/Agent.test.ts +0 -38
- package/src/domain/__tests__/Call.test.ts +0 -26
- package/src/domain/__tests__/CallLog.test.ts +0 -203
- package/src/domain/__tests__/CallSession.test.ts +0 -80
- package/src/domain/__tests__/Contact.test.ts +0 -407
- package/src/domain/__tests__/IndirectTransfer.test.ts +0 -68
- package/src/domain/__tests__/Line.test.ts +0 -53
- package/src/domain/__tests__/Meeting.test.ts +0 -93
- package/src/domain/__tests__/MeetingAuthorization.test.ts +0 -50
- package/src/domain/__tests__/Profile.test.ts +0 -170
- package/src/domain/__tests__/Room.test.ts +0 -207
- package/src/domain/__tests__/Session.test.ts +0 -385
- package/src/domain/__tests__/SipLine.test.ts +0 -30
- package/src/domain/__tests__/Voicemail.test.ts +0 -91
- package/src/domain/types.ts +0 -331
- package/src/index.ts +0 -60
- package/src/lib/WazoSessionDescriptionHandler.ts +0 -532
- package/src/pubkey.ts +0 -11
- package/src/service/CallApi.ts +0 -86
- package/src/service/IssueReporter.ts +0 -434
- package/src/service/__tests__/IssueReporter.test.ts +0 -127
- package/src/service/__tests__/getApiclient.test.ts +0 -46
- package/src/service/getApiClient.ts +0 -113
- package/src/simple/Auth.ts +0 -496
- package/src/simple/Configuration.ts +0 -18
- package/src/simple/Directory.ts +0 -16
- package/src/simple/Phone.ts +0 -531
- package/src/simple/Websocket.ts +0 -107
- package/src/simple/__tests__/Auth.test.ts +0 -168
- package/src/simple/index.ts +0 -153
- package/src/simple/room/LocalParticipant.ts +0 -5
- package/src/simple/room/Participant.ts +0 -409
- package/src/simple/room/RemoteParticipant.ts +0 -15
- package/src/simple/room/Room.ts +0 -942
- package/src/simple/room/SipRoom.ts +0 -164
- package/src/simple/room/Stream.ts +0 -64
- package/src/simple/room/__tests__/Participant.test.ts +0 -73
- package/src/simple/room/__tests__/RemoteParticipant.test.ts +0 -15
- package/src/simple/utils.ts +0 -12
- package/src/types/WebSocketMessage.ts +0 -335
- package/src/types/global.d.ts +0 -33
- package/src/types/wazo.d.ts +0 -1
- package/src/utils/Emitter.ts +0 -34
- package/src/utils/Heartbeat.ts +0 -102
- package/src/utils/PhoneNumberUtil.ts +0 -81
- package/src/utils/__tests__/Heartbeat.test.ts +0 -66
- package/src/utils/__tests__/PhoneNumberUtil.test.ts +0 -79
- package/src/utils/__tests__/api-requester.test.ts +0 -180
- package/src/utils/__tests__/array.test.ts +0 -19
- package/src/utils/__tests__/compare-version.test.ts +0 -11
- package/src/utils/__tests__/object.test.ts +0 -77
- package/src/utils/__tests__/sdp.test.ts +0 -173
- package/src/utils/__tests__/string.test.ts +0 -55
- package/src/utils/api-requester.ts +0 -294
- package/src/utils/array.ts +0 -11
- package/src/utils/compare-version.ts +0 -21
- package/src/utils/isMobile.ts +0 -4
- package/src/utils/new-from.ts +0 -7
- package/src/utils/object.ts +0 -12
- package/src/utils/once.ts +0 -14
- package/src/utils/sdp.ts +0 -140
- package/src/utils/string.ts +0 -15
- package/src/utils/update-from.ts +0 -11
- package/src/utils/webrtc.ts +0 -56
- package/src/web-rtc-client.ts +0 -2687
- package/src/websocket-client.ts +0 -475
- /package/{esm → dist}/types/__tests__/api-client.test.d.ts +0 -0
- /package/{esm → dist}/types/__tests__/api-client.test.d.ts.map +0 -0
- /package/{esm → dist}/types/__tests__/web-rtc-client.test.d.ts +0 -0
- /package/{esm → dist}/types/__tests__/web-rtc-client.test.d.ts.map +0 -0
- /package/{esm → dist}/types/api/agentd.d.ts +0 -0
- /package/{esm → dist}/types/api/agentd.d.ts.map +0 -0
- /package/{esm → dist}/types/api/amid.d.ts +0 -0
- /package/{esm → dist}/types/api/amid.d.ts.map +0 -0
- /package/{esm → dist}/types/api/application.d.ts +0 -0
- /package/{esm → dist}/types/api/application.d.ts.map +0 -0
- /package/{esm → dist}/types/api/auth.d.ts +0 -0
- /package/{esm → dist}/types/api/auth.d.ts.map +0 -0
- /package/{esm → dist}/types/api/call-logd.d.ts +0 -0
- /package/{esm → dist}/types/api/call-logd.d.ts.map +0 -0
- /package/{esm → dist}/types/api/calld.d.ts +0 -0
- /package/{esm → dist}/types/api/calld.d.ts.map +0 -0
- /package/{esm → dist}/types/api/chatd.d.ts +0 -0
- /package/{esm → dist}/types/api/chatd.d.ts.map +0 -0
- /package/{esm → dist}/types/api/confd.d.ts +0 -0
- /package/{esm → dist}/types/api/confd.d.ts.map +0 -0
- /package/{esm → dist}/types/api/ctid-ng.d.ts +0 -0
- /package/{esm → dist}/types/api/ctid-ng.d.ts.map +0 -0
- /package/{esm → dist}/types/api/dird.d.ts +0 -0
- /package/{esm → dist}/types/api/dird.d.ts.map +0 -0
- /package/{esm → dist}/types/api/webhookd.d.ts +0 -0
- /package/{esm → dist}/types/api/webhookd.d.ts.map +0 -0
- /package/{esm → dist}/types/api-client.d.ts +0 -0
- /package/{esm → dist}/types/api-client.d.ts.map +0 -0
- /package/{esm → dist}/types/base-api-client.d.ts +0 -0
- /package/{esm → dist}/types/base-api-client.d.ts.map +0 -0
- /package/{esm → dist}/types/checker/Checker.d.ts +0 -0
- /package/{esm → dist}/types/checker/Checker.d.ts.map +0 -0
- /package/{esm → dist}/types/checker/checks/aor.d.ts +0 -0
- /package/{esm → dist}/types/checker/checks/aor.d.ts.map +0 -0
- /package/{esm → dist}/types/checker/checks/api.d.ts +0 -0
- /package/{esm → dist}/types/checker/checks/api.d.ts.map +0 -0
- /package/{esm → dist}/types/checker/checks/ice-ipv4.d.ts +0 -0
- /package/{esm → dist}/types/checker/checks/ice-ipv4.d.ts.map +0 -0
- /package/{esm → dist}/types/checker/checks/index.d.ts +0 -0
- /package/{esm → dist}/types/checker/checks/index.d.ts.map +0 -0
- /package/{esm → dist}/types/checker/checks/symmetric-nat.d.ts +0 -0
- /package/{esm → dist}/types/checker/checks/symmetric-nat.d.ts.map +0 -0
- /package/{esm → dist}/types/checker/checks/wazo-websocket.d.ts +0 -0
- /package/{esm → dist}/types/checker/checks/wazo-websocket.d.ts.map +0 -0
- /package/{esm → dist}/types/checker/checks/webrtc-transport.d.ts +0 -0
- /package/{esm → dist}/types/checker/checks/webrtc-transport.d.ts.map +0 -0
- /package/{esm → dist}/types/checker/checks/webrtc.d.ts +0 -0
- /package/{esm → dist}/types/checker/checks/webrtc.d.ts.map +0 -0
- /package/{esm → dist}/types/constants.d.ts +0 -0
- /package/{esm → dist}/types/constants.d.ts.map +0 -0
- /package/{esm → dist}/types/domain/AdHocAPIConference.d.ts +0 -0
- /package/{esm → dist}/types/domain/AdHocAPIConference.d.ts.map +0 -0
- /package/{esm → dist}/types/domain/Agent.d.ts +0 -0
- /package/{esm → dist}/types/domain/Agent.d.ts.map +0 -0
- /package/{esm → dist}/types/domain/BadResponse.d.ts +0 -0
- /package/{esm → dist}/types/domain/BadResponse.d.ts.map +0 -0
- /package/{esm → dist}/types/domain/Call.d.ts +0 -0
- /package/{esm → dist}/types/domain/Call.d.ts.map +0 -0
- /package/{esm → dist}/types/domain/CallLog.d.ts +0 -0
- /package/{esm → dist}/types/domain/CallLog.d.ts.map +0 -0
- /package/{esm → dist}/types/domain/CallSession.d.ts +0 -0
- /package/{esm → dist}/types/domain/CallSession.d.ts.map +0 -0
- /package/{esm → dist}/types/domain/CallerID.d.ts +0 -0
- /package/{esm → dist}/types/domain/CallerID.d.ts.map +0 -0
- /package/{esm → dist}/types/domain/ChatMessage.d.ts +0 -0
- /package/{esm → dist}/types/domain/ChatMessage.d.ts.map +0 -0
- /package/{esm → dist}/types/domain/ChatRoom.d.ts +0 -0
- /package/{esm → dist}/types/domain/ChatRoom.d.ts.map +0 -0
- /package/{esm → dist}/types/domain/Country.d.ts +0 -0
- /package/{esm → dist}/types/domain/Country.d.ts.map +0 -0
- /package/{esm → dist}/types/domain/Device/DebugDevice.d.ts +0 -0
- /package/{esm → dist}/types/domain/Device/DebugDevice.d.ts.map +0 -0
- /package/{esm → dist}/types/domain/Device/Device.d.ts +0 -0
- /package/{esm → dist}/types/domain/Device/Device.d.ts.map +0 -0
- /package/{esm → dist}/types/domain/DirectorySource.d.ts +0 -0
- /package/{esm → dist}/types/domain/DirectorySource.d.ts.map +0 -0
- /package/{esm → dist}/types/domain/ExternalApp.d.ts +0 -0
- /package/{esm → dist}/types/domain/ExternalApp.d.ts.map +0 -0
- /package/{esm → dist}/types/domain/Features.d.ts +0 -0
- /package/{esm → dist}/types/domain/Features.d.ts.map +0 -0
- /package/{esm → dist}/types/domain/ForwardOption.d.ts +0 -0
- /package/{esm → dist}/types/domain/ForwardOption.d.ts.map +0 -0
- /package/{esm → dist}/types/domain/Incall.d.ts +0 -0
- /package/{esm → dist}/types/domain/Incall.d.ts.map +0 -0
- /package/{esm → dist}/types/domain/IndirectTransfer.d.ts +0 -0
- /package/{esm → dist}/types/domain/IndirectTransfer.d.ts.map +0 -0
- /package/{esm → dist}/types/domain/Line.d.ts +0 -0
- /package/{esm → dist}/types/domain/Line.d.ts.map +0 -0
- /package/{esm → dist}/types/domain/Meeting.d.ts +0 -0
- /package/{esm → dist}/types/domain/Meeting.d.ts.map +0 -0
- /package/{esm → dist}/types/domain/MeetingAuthorization.d.ts +0 -0
- /package/{esm → dist}/types/domain/MeetingAuthorization.d.ts.map +0 -0
- /package/{esm → dist}/types/domain/MeetingStatus.d.ts +0 -0
- /package/{esm → dist}/types/domain/MeetingStatus.d.ts.map +0 -0
- /package/{esm → dist}/types/domain/NotificationOptions.d.ts +0 -0
- /package/{esm → dist}/types/domain/NotificationOptions.d.ts.map +0 -0
- /package/{esm → dist}/types/domain/Phone/CTIPhone.d.ts +0 -0
- /package/{esm → dist}/types/domain/Phone/CTIPhone.d.ts.map +0 -0
- /package/{esm → dist}/types/domain/Phone/Phone.d.ts +0 -0
- /package/{esm → dist}/types/domain/Phone/Phone.d.ts.map +0 -0
- /package/{esm → dist}/types/domain/Phone/WebRTCPhone.d.ts +0 -0
- /package/{esm → dist}/types/domain/Phone/WebRTCPhone.d.ts.map +0 -0
- /package/{esm → dist}/types/domain/Profile.d.ts +0 -0
- /package/{esm → dist}/types/domain/Profile.d.ts.map +0 -0
- /package/{esm → dist}/types/domain/Recording.d.ts +0 -0
- /package/{esm → dist}/types/domain/Recording.d.ts.map +0 -0
- /package/{esm → dist}/types/domain/Relocation.d.ts +0 -0
- /package/{esm → dist}/types/domain/Relocation.d.ts.map +0 -0
- /package/{esm → dist}/types/domain/Room.d.ts +0 -0
- /package/{esm → dist}/types/domain/Room.d.ts.map +0 -0
- /package/{esm → dist}/types/domain/SFUNotAvailableError.d.ts +0 -0
- /package/{esm → dist}/types/domain/SFUNotAvailableError.d.ts.map +0 -0
- /package/{esm → dist}/types/domain/ServerError.d.ts +0 -0
- /package/{esm → dist}/types/domain/ServerError.d.ts.map +0 -0
- /package/{esm → dist}/types/domain/Session.d.ts +0 -0
- /package/{esm → dist}/types/domain/Session.d.ts.map +0 -0
- /package/{esm → dist}/types/domain/SipLine.d.ts +0 -0
- /package/{esm → dist}/types/domain/SipLine.d.ts.map +0 -0
- /package/{esm → dist}/types/domain/Subscription.d.ts +0 -0
- /package/{esm → dist}/types/domain/Subscription.d.ts.map +0 -0
- /package/{esm → dist}/types/domain/SwitchboardCall.d.ts +0 -0
- /package/{esm → dist}/types/domain/SwitchboardCall.d.ts.map +0 -0
- /package/{esm → dist}/types/domain/Voicemail.d.ts +0 -0
- /package/{esm → dist}/types/domain/Voicemail.d.ts.map +0 -0
- /package/{esm → dist}/types/domain/__tests__/Agent.test.d.ts +0 -0
- /package/{esm → dist}/types/domain/__tests__/Agent.test.d.ts.map +0 -0
- /package/{esm → dist}/types/domain/__tests__/Call.test.d.ts +0 -0
- /package/{esm → dist}/types/domain/__tests__/Call.test.d.ts.map +0 -0
- /package/{esm → dist}/types/domain/__tests__/CallLog.test.d.ts +0 -0
- /package/{esm → dist}/types/domain/__tests__/CallLog.test.d.ts.map +0 -0
- /package/{esm → dist}/types/domain/__tests__/CallSession.test.d.ts +0 -0
- /package/{esm → dist}/types/domain/__tests__/CallSession.test.d.ts.map +0 -0
- /package/{esm → dist}/types/domain/__tests__/Contact.test.d.ts +0 -0
- /package/{esm → dist}/types/domain/__tests__/Contact.test.d.ts.map +0 -0
- /package/{esm → dist}/types/domain/__tests__/IndirectTransfer.test.d.ts +0 -0
- /package/{esm → dist}/types/domain/__tests__/IndirectTransfer.test.d.ts.map +0 -0
- /package/{esm → dist}/types/domain/__tests__/Line.test.d.ts +0 -0
- /package/{esm → dist}/types/domain/__tests__/Line.test.d.ts.map +0 -0
- /package/{esm → dist}/types/domain/__tests__/Meeting.test.d.ts +0 -0
- /package/{esm → dist}/types/domain/__tests__/Meeting.test.d.ts.map +0 -0
- /package/{esm → dist}/types/domain/__tests__/MeetingAuthorization.test.d.ts +0 -0
- /package/{esm → dist}/types/domain/__tests__/MeetingAuthorization.test.d.ts.map +0 -0
- /package/{esm → dist}/types/domain/__tests__/Profile.test.d.ts +0 -0
- /package/{esm → dist}/types/domain/__tests__/Profile.test.d.ts.map +0 -0
- /package/{esm → dist}/types/domain/__tests__/Room.test.d.ts +0 -0
- /package/{esm → dist}/types/domain/__tests__/Room.test.d.ts.map +0 -0
- /package/{esm → dist}/types/domain/__tests__/Session.test.d.ts +0 -0
- /package/{esm → dist}/types/domain/__tests__/Session.test.d.ts.map +0 -0
- /package/{esm → dist}/types/domain/__tests__/SipLine.test.d.ts +0 -0
- /package/{esm → dist}/types/domain/__tests__/SipLine.test.d.ts.map +0 -0
- /package/{esm → dist}/types/domain/__tests__/Voicemail.test.d.ts +0 -0
- /package/{esm → dist}/types/domain/__tests__/Voicemail.test.d.ts.map +0 -0
- /package/{esm → dist}/types/domain/types.d.ts +0 -0
- /package/{esm → dist}/types/domain/types.d.ts.map +0 -0
- /package/{esm → dist}/types/lib/WazoSessionDescriptionHandler.d.ts +0 -0
- /package/{esm → dist}/types/lib/WazoSessionDescriptionHandler.d.ts.map +0 -0
- /package/{esm → dist}/types/pubkey.d.ts +0 -0
- /package/{esm → dist}/types/pubkey.d.ts.map +0 -0
- /package/{esm → dist}/types/service/CallApi.d.ts +0 -0
- /package/{esm → dist}/types/service/CallApi.d.ts.map +0 -0
- /package/{esm → dist}/types/service/IssueReporter.d.ts +0 -0
- /package/{esm → dist}/types/service/IssueReporter.d.ts.map +0 -0
- /package/{esm → dist}/types/service/__tests__/IssueReporter.test.d.ts +0 -0
- /package/{esm → dist}/types/service/__tests__/IssueReporter.test.d.ts.map +0 -0
- /package/{esm → dist}/types/service/__tests__/getApiclient.test.d.ts +0 -0
- /package/{esm → dist}/types/service/__tests__/getApiclient.test.d.ts.map +0 -0
- /package/{esm → dist}/types/service/getApiClient.d.ts +0 -0
- /package/{esm → dist}/types/service/getApiClient.d.ts.map +0 -0
- /package/{esm → dist}/types/simple/Auth.d.ts +0 -0
- /package/{esm → dist}/types/simple/Auth.d.ts.map +0 -0
- /package/{esm → dist}/types/simple/Configuration.d.ts +0 -0
- /package/{esm → dist}/types/simple/Configuration.d.ts.map +0 -0
- /package/{esm → dist}/types/simple/Directory.d.ts +0 -0
- /package/{esm → dist}/types/simple/Directory.d.ts.map +0 -0
- /package/{esm → dist}/types/simple/Phone.d.ts +0 -0
- /package/{esm → dist}/types/simple/Phone.d.ts.map +0 -0
- /package/{esm → dist}/types/simple/Websocket.d.ts +0 -0
- /package/{esm → dist}/types/simple/Websocket.d.ts.map +0 -0
- /package/{esm → dist}/types/simple/__tests__/Auth.test.d.ts +0 -0
- /package/{esm → dist}/types/simple/__tests__/Auth.test.d.ts.map +0 -0
- /package/{esm → dist}/types/simple/index.d.ts +0 -0
- /package/{esm → dist}/types/simple/index.d.ts.map +0 -0
- /package/{esm → dist}/types/simple/room/LocalParticipant.d.ts +0 -0
- /package/{esm → dist}/types/simple/room/LocalParticipant.d.ts.map +0 -0
- /package/{esm → dist}/types/simple/room/Participant.d.ts +0 -0
- /package/{esm → dist}/types/simple/room/Participant.d.ts.map +0 -0
- /package/{esm → dist}/types/simple/room/RemoteParticipant.d.ts +0 -0
- /package/{esm → dist}/types/simple/room/RemoteParticipant.d.ts.map +0 -0
- /package/{esm → dist}/types/simple/room/Room.d.ts +0 -0
- /package/{esm → dist}/types/simple/room/Room.d.ts.map +0 -0
- /package/{esm → dist}/types/simple/room/SipRoom.d.ts +0 -0
- /package/{esm → dist}/types/simple/room/SipRoom.d.ts.map +0 -0
- /package/{esm → dist}/types/simple/room/Stream.d.ts +0 -0
- /package/{esm → dist}/types/simple/room/Stream.d.ts.map +0 -0
- /package/{esm → dist}/types/simple/room/__tests__/Participant.test.d.ts +0 -0
- /package/{esm → dist}/types/simple/room/__tests__/Participant.test.d.ts.map +0 -0
- /package/{esm → dist}/types/simple/room/__tests__/RemoteParticipant.test.d.ts +0 -0
- /package/{esm → dist}/types/simple/room/__tests__/RemoteParticipant.test.d.ts.map +0 -0
- /package/{esm → dist}/types/simple/utils.d.ts +0 -0
- /package/{esm → dist}/types/simple/utils.d.ts.map +0 -0
- /package/{esm → dist}/types/types/WebSocketMessage.d.ts +0 -0
- /package/{esm → dist}/types/types/WebSocketMessage.d.ts.map +0 -0
- /package/{esm → dist}/types/utils/Emitter.d.ts +0 -0
- /package/{esm → dist}/types/utils/Emitter.d.ts.map +0 -0
- /package/{esm → dist}/types/utils/Heartbeat.d.ts +0 -0
- /package/{esm → dist}/types/utils/Heartbeat.d.ts.map +0 -0
- /package/{esm → dist}/types/utils/PhoneNumberUtil.d.ts +0 -0
- /package/{esm → dist}/types/utils/PhoneNumberUtil.d.ts.map +0 -0
- /package/{esm → dist}/types/utils/__tests__/Heartbeat.test.d.ts +0 -0
- /package/{esm → dist}/types/utils/__tests__/Heartbeat.test.d.ts.map +0 -0
- /package/{esm → dist}/types/utils/__tests__/PhoneNumberUtil.test.d.ts +0 -0
- /package/{esm → dist}/types/utils/__tests__/PhoneNumberUtil.test.d.ts.map +0 -0
- /package/{esm → dist}/types/utils/__tests__/api-requester.test.d.ts +0 -0
- /package/{esm → dist}/types/utils/__tests__/api-requester.test.d.ts.map +0 -0
- /package/{esm → dist}/types/utils/__tests__/array.test.d.ts +0 -0
- /package/{esm → dist}/types/utils/__tests__/array.test.d.ts.map +0 -0
- /package/{esm → dist}/types/utils/__tests__/compare-version.test.d.ts +0 -0
- /package/{esm → dist}/types/utils/__tests__/compare-version.test.d.ts.map +0 -0
- /package/{esm → dist}/types/utils/__tests__/object.test.d.ts +0 -0
- /package/{esm → dist}/types/utils/__tests__/object.test.d.ts.map +0 -0
- /package/{esm → dist}/types/utils/__tests__/sdp.test.d.ts +0 -0
- /package/{esm → dist}/types/utils/__tests__/sdp.test.d.ts.map +0 -0
- /package/{esm → dist}/types/utils/__tests__/string.test.d.ts +0 -0
- /package/{esm → dist}/types/utils/__tests__/string.test.d.ts.map +0 -0
- /package/{esm → dist}/types/utils/api-requester.d.ts +0 -0
- /package/{esm → dist}/types/utils/api-requester.d.ts.map +0 -0
- /package/{esm → dist}/types/utils/array.d.ts +0 -0
- /package/{esm → dist}/types/utils/array.d.ts.map +0 -0
- /package/{esm → dist}/types/utils/compare-version.d.ts +0 -0
- /package/{esm → dist}/types/utils/compare-version.d.ts.map +0 -0
- /package/{esm → dist}/types/utils/isMobile.d.ts +0 -0
- /package/{esm → dist}/types/utils/isMobile.d.ts.map +0 -0
- /package/{esm → dist}/types/utils/new-from.d.ts +0 -0
- /package/{esm → dist}/types/utils/new-from.d.ts.map +0 -0
- /package/{esm → dist}/types/utils/object.d.ts +0 -0
- /package/{esm → dist}/types/utils/object.d.ts.map +0 -0
- /package/{esm → dist}/types/utils/once.d.ts +0 -0
- /package/{esm → dist}/types/utils/once.d.ts.map +0 -0
- /package/{esm → dist}/types/utils/sdp.d.ts +0 -0
- /package/{esm → dist}/types/utils/sdp.d.ts.map +0 -0
- /package/{esm → dist}/types/utils/string.d.ts +0 -0
- /package/{esm → dist}/types/utils/string.d.ts.map +0 -0
- /package/{esm → dist}/types/utils/update-from.d.ts +0 -0
- /package/{esm → dist}/types/utils/update-from.d.ts.map +0 -0
- /package/{esm → dist}/types/utils/webrtc.d.ts +0 -0
- /package/{esm → dist}/types/utils/webrtc.d.ts.map +0 -0
- /package/{esm → dist}/types/web-rtc-client.d.ts +0 -0
- /package/{esm → dist}/types/web-rtc-client.d.ts.map +0 -0
- /package/{esm → dist}/types/websocket-client.d.ts +0 -0
- /package/{esm → dist}/types/websocket-client.d.ts.map +0 -0
package/esm/simple/Phone.js
DELETED
|
@@ -1,389 +0,0 @@
|
|
|
1
|
-
import { SessionState } from 'sip.js/lib/api/session-state';
|
|
2
|
-
import AdHocAPIConference from '../domain/AdHocAPIConference';
|
|
3
|
-
import WebRTCPhone, * as PHONE_EVENTS from '../domain/Phone/WebRTCPhone';
|
|
4
|
-
import { MESSAGE_TYPE_CHAT, MESSAGE_TYPE_SIGNAL } from '../domain/Phone/WebRTCPhone';
|
|
5
|
-
import WebRTCClient, { events as clientEvents, transportEvents } from '../web-rtc-client';
|
|
6
|
-
import IssueReporter from '../service/IssueReporter';
|
|
7
|
-
import Emitter from '../utils/Emitter';
|
|
8
|
-
import Wazo from './index';
|
|
9
|
-
import SFUNotAvailableError from '../domain/SFUNotAvailableError';
|
|
10
|
-
const logger = IssueReporter.loggerFor('simple-phone');
|
|
11
|
-
const sipLogger = IssueReporter.loggerFor('sip.js');
|
|
12
|
-
const protocolLogger = IssueReporter.loggerFor('sip');
|
|
13
|
-
const protocolDebugMessages = ['Received WebSocket text message:', 'Sending WebSocket message:'];
|
|
14
|
-
export class Phone extends Emitter {
|
|
15
|
-
client;
|
|
16
|
-
phone;
|
|
17
|
-
session;
|
|
18
|
-
sipLine;
|
|
19
|
-
SessionState;
|
|
20
|
-
ON_USER_AGENT;
|
|
21
|
-
ON_REGISTERED;
|
|
22
|
-
ON_UNREGISTERED;
|
|
23
|
-
ON_PROGRESS;
|
|
24
|
-
ON_CALL_ACCEPTED;
|
|
25
|
-
ON_CALL_ANSWERED;
|
|
26
|
-
ON_CALL_INCOMING;
|
|
27
|
-
ON_CALL_OUTGOING;
|
|
28
|
-
ON_CALL_MUTED;
|
|
29
|
-
ON_CALL_UNMUTED;
|
|
30
|
-
ON_CALL_RESUMED;
|
|
31
|
-
ON_CALL_HELD;
|
|
32
|
-
ON_CALL_UNHELD;
|
|
33
|
-
ON_CAMERA_DISABLED;
|
|
34
|
-
ON_CAMERA_RESUMED;
|
|
35
|
-
ON_CALL_CANCELED;
|
|
36
|
-
ON_CALL_FAILED;
|
|
37
|
-
ON_CALL_REJECTED;
|
|
38
|
-
ON_CALL_ENDED;
|
|
39
|
-
ON_CALL_ENDING;
|
|
40
|
-
ON_MESSAGE;
|
|
41
|
-
ON_REINVITE;
|
|
42
|
-
ON_TRACK;
|
|
43
|
-
ON_AUDIO_STREAM;
|
|
44
|
-
ON_VIDEO_STREAM;
|
|
45
|
-
ON_REMOVE_STREAM;
|
|
46
|
-
ON_SHARE_SCREEN_STARTED;
|
|
47
|
-
ON_SHARE_SCREEN_ENDING;
|
|
48
|
-
ON_SHARE_SCREEN_ENDED;
|
|
49
|
-
ON_TERMINATE_SOUND;
|
|
50
|
-
ON_PLAY_RING_SOUND;
|
|
51
|
-
ON_PLAY_INBOUND_CALL_SIGNAL_SOUND;
|
|
52
|
-
ON_PLAY_HANGUP_SOUND;
|
|
53
|
-
ON_PLAY_PROGRESS_SOUND;
|
|
54
|
-
ON_VIDEO_INPUT_CHANGE;
|
|
55
|
-
ON_CALL_ERROR;
|
|
56
|
-
ON_MESSAGE_TRACK_UPDATED;
|
|
57
|
-
ON_NETWORK_STATS;
|
|
58
|
-
ON_CHAT;
|
|
59
|
-
ON_SIGNAL;
|
|
60
|
-
ON_DISCONNECTED;
|
|
61
|
-
ON_EARLY_MEDIA;
|
|
62
|
-
MESSAGE_TYPE_CHAT;
|
|
63
|
-
MESSAGE_TYPE_SIGNAL;
|
|
64
|
-
constructor() {
|
|
65
|
-
super();
|
|
66
|
-
// Sugar syntax for `Wazo.Phone.EVENT_NAME`
|
|
67
|
-
Object.keys(PHONE_EVENTS).forEach((key) => {
|
|
68
|
-
// @ts-ignore: keys
|
|
69
|
-
this[key] = PHONE_EVENTS[key];
|
|
70
|
-
});
|
|
71
|
-
this.SessionState = SessionState;
|
|
72
|
-
}
|
|
73
|
-
async connect(rawOptions = {}, sipLine = null) {
|
|
74
|
-
const options = rawOptions;
|
|
75
|
-
if (this.phone) {
|
|
76
|
-
// Already connected
|
|
77
|
-
// let's update media constraints if they're being fed
|
|
78
|
-
if (options.media) {
|
|
79
|
-
this.phone.setMediaConstraints(options.media);
|
|
80
|
-
}
|
|
81
|
-
return;
|
|
82
|
-
}
|
|
83
|
-
const server = Wazo.Auth.getHost();
|
|
84
|
-
const session = Wazo.Auth.getSession();
|
|
85
|
-
if (!server || !session) {
|
|
86
|
-
throw new Error('Please connect to the server using `Wazo.Auth.logIn` or `Wazo.Auth.authenticate` before using Room.connect().');
|
|
87
|
-
}
|
|
88
|
-
this.session = session;
|
|
89
|
-
this.sipLine = sipLine || this.getPrimaryWebRtcLine();
|
|
90
|
-
if (!this.sipLine) {
|
|
91
|
-
throw new Error('Sorry, no sip lines found for this user');
|
|
92
|
-
}
|
|
93
|
-
options.userUuid = session.uuid || '';
|
|
94
|
-
this.connectWithCredentials(server, this.sipLine, session.displayName(), options);
|
|
95
|
-
}
|
|
96
|
-
connectWithCredentials(server, sipLine, displayName, rawOptions = {}) {
|
|
97
|
-
if (this.phone) {
|
|
98
|
-
// Already connected
|
|
99
|
-
return;
|
|
100
|
-
}
|
|
101
|
-
const [host, port = 443] = server.split(':');
|
|
102
|
-
const options = rawOptions;
|
|
103
|
-
options.media = options.media || {
|
|
104
|
-
audio: true,
|
|
105
|
-
video: false,
|
|
106
|
-
};
|
|
107
|
-
options.uaConfigOverrides = options.uaConfigOverrides || {};
|
|
108
|
-
if (IssueReporter.enabled) {
|
|
109
|
-
options.uaConfigOverrides.traceSip = true;
|
|
110
|
-
options.log = options.log || {};
|
|
111
|
-
options.log.builtinEnabled = false;
|
|
112
|
-
options.log.logLevel = 'debug';
|
|
113
|
-
options.log.connector = this._logConnector;
|
|
114
|
-
}
|
|
115
|
-
this.client = new WebRTCClient({
|
|
116
|
-
host,
|
|
117
|
-
port: typeof port === 'string' ? parseInt(port, 10) : port,
|
|
118
|
-
displayName,
|
|
119
|
-
authorizationUser: sipLine.username,
|
|
120
|
-
password: sipLine.secret,
|
|
121
|
-
uri: `${sipLine.username}@${server}`,
|
|
122
|
-
...options,
|
|
123
|
-
}, undefined, options.uaConfigOverrides);
|
|
124
|
-
this.phone = new WebRTCPhone(this.client, options.audioDeviceOutput, true, options.audioDeviceRing);
|
|
125
|
-
this._transferEvents();
|
|
126
|
-
}
|
|
127
|
-
async disconnect() {
|
|
128
|
-
if (this.phone) {
|
|
129
|
-
if (this.phone.hasAnActiveCall()) {
|
|
130
|
-
logger.info('hangup call on disconnect');
|
|
131
|
-
await this.phone.hangup();
|
|
132
|
-
}
|
|
133
|
-
await this.phone.close();
|
|
134
|
-
}
|
|
135
|
-
this.phone = null;
|
|
136
|
-
}
|
|
137
|
-
// If audioOnly is set to true, all video stream will be deactivated, even remotes ones.
|
|
138
|
-
async call(extension, withCamera = false, rawSipLine = null, audioOnly = false, conference = false) {
|
|
139
|
-
if (!this.phone) {
|
|
140
|
-
return;
|
|
141
|
-
}
|
|
142
|
-
const sipLine = rawSipLine || this.getPrimaryWebRtcLine();
|
|
143
|
-
return this.phone.makeCall(extension, sipLine, withCamera, audioOnly, conference);
|
|
144
|
-
}
|
|
145
|
-
async hangup(callSession) {
|
|
146
|
-
logger.info('hangup via simple phone', {
|
|
147
|
-
callId: callSession.getId(),
|
|
148
|
-
});
|
|
149
|
-
return this.phone ? this.phone.hangup(callSession) : false;
|
|
150
|
-
}
|
|
151
|
-
async accept(callSession, cameraEnabled) {
|
|
152
|
-
logger.info('accept via simple phone', {
|
|
153
|
-
callId: callSession.getId(),
|
|
154
|
-
cameraEnabled,
|
|
155
|
-
});
|
|
156
|
-
return this.phone ? this.phone.accept(callSession, cameraEnabled) : null;
|
|
157
|
-
}
|
|
158
|
-
async startConference(host, otherCalls) {
|
|
159
|
-
const participants = [host, ...otherCalls].reduce((acc, participant) => {
|
|
160
|
-
acc[participant.getTalkingToIds()[0]] = participant;
|
|
161
|
-
return acc;
|
|
162
|
-
}, {});
|
|
163
|
-
if (!this.phone) {
|
|
164
|
-
return Promise.reject();
|
|
165
|
-
}
|
|
166
|
-
const adHocConference = new AdHocAPIConference({
|
|
167
|
-
phone: this.phone,
|
|
168
|
-
host,
|
|
169
|
-
participants,
|
|
170
|
-
});
|
|
171
|
-
return adHocConference.start();
|
|
172
|
-
}
|
|
173
|
-
mute(callSession, withApi = true) {
|
|
174
|
-
if (withApi) {
|
|
175
|
-
this.muteViaAPI(callSession);
|
|
176
|
-
}
|
|
177
|
-
this.phone?.mute(callSession);
|
|
178
|
-
}
|
|
179
|
-
unmute(callSession, withApi = true) {
|
|
180
|
-
if (withApi) {
|
|
181
|
-
this.unmuteViaAPI(callSession);
|
|
182
|
-
}
|
|
183
|
-
this.phone?.unmute(callSession);
|
|
184
|
-
}
|
|
185
|
-
muteViaAPI(callSession) {
|
|
186
|
-
if (callSession && callSession.callId) {
|
|
187
|
-
Wazo.getApiClient().calld.mute(callSession.callId).catch(e => {
|
|
188
|
-
logger.error('Mute via API, error', e);
|
|
189
|
-
});
|
|
190
|
-
}
|
|
191
|
-
}
|
|
192
|
-
unmuteViaAPI(callSession) {
|
|
193
|
-
if (callSession && callSession.callId) {
|
|
194
|
-
Wazo.getApiClient().calld.unmute(callSession.callId).catch(e => {
|
|
195
|
-
logger.error('Unmute via API, error', e);
|
|
196
|
-
});
|
|
197
|
-
}
|
|
198
|
-
}
|
|
199
|
-
hold(callSession) {
|
|
200
|
-
return this.phone?.hold(callSession, true);
|
|
201
|
-
}
|
|
202
|
-
async unhold(callSession) {
|
|
203
|
-
return this.phone?.unhold(callSession, true);
|
|
204
|
-
}
|
|
205
|
-
async resume(callSession) {
|
|
206
|
-
return this.phone?.resume(callSession) || null;
|
|
207
|
-
}
|
|
208
|
-
reject(callSession) {
|
|
209
|
-
return this.phone?.reject(callSession);
|
|
210
|
-
}
|
|
211
|
-
transfer(callSession, target) {
|
|
212
|
-
this.phone?.transfer(callSession, target);
|
|
213
|
-
}
|
|
214
|
-
atxfer(callSession) {
|
|
215
|
-
return this.phone?.atxfer(callSession) || null;
|
|
216
|
-
}
|
|
217
|
-
async reinvite(callSession, constraints = null, conference = false) {
|
|
218
|
-
return this.phone ? this.phone.sendReinvite(callSession, constraints, conference) : null;
|
|
219
|
-
}
|
|
220
|
-
async getStats(callSession) {
|
|
221
|
-
return this.phone ? this.phone.getStats(callSession) : null;
|
|
222
|
-
}
|
|
223
|
-
startNetworkMonitoring(callSession, interval = 1000) {
|
|
224
|
-
return this.phone ? this.phone.startNetworkMonitoring(callSession, interval) : null;
|
|
225
|
-
}
|
|
226
|
-
stopNetworkMonitoring(callSession) {
|
|
227
|
-
return this.phone ? this.phone.stopNetworkMonitoring(callSession) : null;
|
|
228
|
-
}
|
|
229
|
-
getSipSessionId(sipSession) {
|
|
230
|
-
if (!sipSession || !this.phone) {
|
|
231
|
-
return null;
|
|
232
|
-
}
|
|
233
|
-
return this.phone.getSipSessionId(sipSession);
|
|
234
|
-
}
|
|
235
|
-
sendMessage(body, sipSession, contentType = 'text/plain') {
|
|
236
|
-
const toSipSession = sipSession || this.getCurrentSipSession();
|
|
237
|
-
if (!toSipSession || !this.phone) {
|
|
238
|
-
return;
|
|
239
|
-
}
|
|
240
|
-
this.phone.sendMessage(toSipSession, body, contentType);
|
|
241
|
-
}
|
|
242
|
-
sendChat(content, sipSession) {
|
|
243
|
-
this.sendMessage(JSON.stringify({
|
|
244
|
-
type: MESSAGE_TYPE_CHAT,
|
|
245
|
-
content,
|
|
246
|
-
}), sipSession, 'application/json');
|
|
247
|
-
}
|
|
248
|
-
sendSignal(content, sipSession) {
|
|
249
|
-
this.sendMessage(JSON.stringify({
|
|
250
|
-
type: MESSAGE_TYPE_SIGNAL,
|
|
251
|
-
content,
|
|
252
|
-
}), sipSession, 'application/json');
|
|
253
|
-
}
|
|
254
|
-
turnCameraOff(callSession) {
|
|
255
|
-
this.phone?.turnCameraOff(callSession);
|
|
256
|
-
}
|
|
257
|
-
turnCameraOn(callSession) {
|
|
258
|
-
this.phone?.turnCameraOn(callSession);
|
|
259
|
-
}
|
|
260
|
-
async startScreenSharing(constraints, callSession) {
|
|
261
|
-
return this.phone?.startScreenSharing(constraints, callSession) || null;
|
|
262
|
-
}
|
|
263
|
-
stopScreenSharing(callSession, restoreLocalStream = true) {
|
|
264
|
-
return this.phone ? this.phone.stopScreenSharing(restoreLocalStream, callSession) : Promise.resolve();
|
|
265
|
-
}
|
|
266
|
-
sendDTMF(tone, callSession) {
|
|
267
|
-
this.phone?.sendKey(callSession, tone);
|
|
268
|
-
}
|
|
269
|
-
getLocalStream(callSession) {
|
|
270
|
-
return this.phone?.getLocalStream(callSession);
|
|
271
|
-
}
|
|
272
|
-
hasLocalVideo(callSession) {
|
|
273
|
-
return this.phone?.hasLocalVideo(callSession) || false;
|
|
274
|
-
}
|
|
275
|
-
hasALocalVideoTrack(callSession) {
|
|
276
|
-
return this.phone?.hasALocalVideoTrack(callSession) || false;
|
|
277
|
-
}
|
|
278
|
-
// @Deprecated
|
|
279
|
-
getLocalMediaStream(callSession) {
|
|
280
|
-
logger.warn('Phone.getLocalMediaStream is deprecated, use Phone.getLocalStream instead');
|
|
281
|
-
return this.phone?.getLocalStream(callSession);
|
|
282
|
-
}
|
|
283
|
-
getLocalVideoStream(callSession) {
|
|
284
|
-
return this.phone?.getLocalVideoStream(callSession) || null;
|
|
285
|
-
}
|
|
286
|
-
getRemoteStream(callSession) {
|
|
287
|
-
return this.phone?.getRemoteStream(callSession) || null;
|
|
288
|
-
}
|
|
289
|
-
getRemoteVideoStream(callSession) {
|
|
290
|
-
return this.phone?.getRemoteVideoStream(callSession) || null;
|
|
291
|
-
}
|
|
292
|
-
isVideoRemotelyHeld(callSession) {
|
|
293
|
-
return this.phone?.isVideoRemotelyHeld(callSession) || false;
|
|
294
|
-
}
|
|
295
|
-
// @Deprecated
|
|
296
|
-
getRemoteStreamForCall(callSession) {
|
|
297
|
-
logger.warn('Phone.getRemoteStreamForCall is deprecated, use Phone.getRemoteStream instead');
|
|
298
|
-
return this.getRemoteStream(callSession) || null;
|
|
299
|
-
}
|
|
300
|
-
// Returns remote streams directly from the peerConnection
|
|
301
|
-
// @Deprecated
|
|
302
|
-
getRemoteStreamsForCall(callSession) {
|
|
303
|
-
logger.warn('Phone.getRemoteStreamsForCall is deprecated, use Phone.getLocalStream instead');
|
|
304
|
-
return this.getLocalStream(callSession) || null;
|
|
305
|
-
}
|
|
306
|
-
// @Deprecated
|
|
307
|
-
getRemoteVideoStreamForCall(callSession) {
|
|
308
|
-
logger.warn('Phone.getRemoteVideoStreamForCall is deprecated, use Phone.getRemoteVideoStream instead');
|
|
309
|
-
return this.getRemoteVideoStream(callSession);
|
|
310
|
-
}
|
|
311
|
-
// Useful in a react-native environment when remoteMediaStream is not updated
|
|
312
|
-
getRemoteVideoStreamFromPc(callSession) {
|
|
313
|
-
return this.phone?.getRemoteVideoStreamFromPc(callSession) || null;
|
|
314
|
-
}
|
|
315
|
-
hasVideo(callSession) {
|
|
316
|
-
return this.phone ? this.phone.hasVideo(callSession) : false;
|
|
317
|
-
}
|
|
318
|
-
hasAVideoTrack(callSession) {
|
|
319
|
-
return this.phone ? this.phone.hasAVideoTrack(callSession) : false;
|
|
320
|
-
}
|
|
321
|
-
getCurrentSipSession() {
|
|
322
|
-
return this.phone?.currentSipSession || null;
|
|
323
|
-
}
|
|
324
|
-
getPrimaryWebRtcLine() {
|
|
325
|
-
const session = Wazo.Auth.getSession();
|
|
326
|
-
return session?.primaryWebRtcLine() || null;
|
|
327
|
-
}
|
|
328
|
-
getOutputDevice() {
|
|
329
|
-
return this.phone?.audioOutputDeviceId || null;
|
|
330
|
-
}
|
|
331
|
-
getPrimaryLine() {
|
|
332
|
-
const session = Wazo.Auth.getSession();
|
|
333
|
-
return session?.primarySipLine() || null;
|
|
334
|
-
}
|
|
335
|
-
getLineById(lineId) {
|
|
336
|
-
return this.getSipLines().find(line => line && line.id === lineId) || null;
|
|
337
|
-
}
|
|
338
|
-
getSipLines() {
|
|
339
|
-
const session = Wazo.Auth.getSession();
|
|
340
|
-
if (!session) {
|
|
341
|
-
return [];
|
|
342
|
-
}
|
|
343
|
-
return session.profile?.sipLines || [];
|
|
344
|
-
}
|
|
345
|
-
hasSfu() {
|
|
346
|
-
return this.sipLine?.hasVideoConference() || false;
|
|
347
|
-
}
|
|
348
|
-
checkSfu() {
|
|
349
|
-
if (!this.hasSfu()) {
|
|
350
|
-
throw new SFUNotAvailableError();
|
|
351
|
-
}
|
|
352
|
-
}
|
|
353
|
-
enableLogger() {
|
|
354
|
-
this.client.enableLogger(this._logConnector);
|
|
355
|
-
}
|
|
356
|
-
_transferEvents() {
|
|
357
|
-
this.unbind();
|
|
358
|
-
[...clientEvents, ...transportEvents].forEach(event => {
|
|
359
|
-
this.client.on(event, (...args) => this.eventEmitter.emit.apply(this.eventEmitter.emit, [`client-${event}`, ...args]));
|
|
360
|
-
});
|
|
361
|
-
Object.values(PHONE_EVENTS).forEach(event => {
|
|
362
|
-
if (typeof event !== 'string' || !this.phone) {
|
|
363
|
-
return;
|
|
364
|
-
}
|
|
365
|
-
this.phone.on(event, (...args) => this.eventEmitter.emit.apply(this.eventEmitter, [event, ...args]));
|
|
366
|
-
});
|
|
367
|
-
}
|
|
368
|
-
_logConnector(level, className, label, content) {
|
|
369
|
-
const protocolIndex = content && content.indexOf ? protocolDebugMessages.findIndex(prefix => content.indexOf(prefix) !== -1) : -1;
|
|
370
|
-
if (className === 'sip.Transport' && protocolIndex !== -1) {
|
|
371
|
-
const direction = protocolIndex === 0 ? 'receiving' : 'sending';
|
|
372
|
-
const message = content.replace(`${protocolDebugMessages[protocolIndex]}\n\n`, '').replace('\r\n', '\n');
|
|
373
|
-
protocolLogger.trace(message, {
|
|
374
|
-
className,
|
|
375
|
-
direction,
|
|
376
|
-
});
|
|
377
|
-
}
|
|
378
|
-
else {
|
|
379
|
-
sipLogger.trace(content, {
|
|
380
|
-
className,
|
|
381
|
-
});
|
|
382
|
-
}
|
|
383
|
-
}
|
|
384
|
-
}
|
|
385
|
-
if (!global.wazoTelephonyInstance) {
|
|
386
|
-
global.wazoTelephonyInstance = new Phone();
|
|
387
|
-
}
|
|
388
|
-
// @ts-ignore: Circular definition of import alias 'default'.
|
|
389
|
-
export default global.wazoTelephonyInstance;
|
package/esm/simple/Websocket.js
DELETED
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
import WazoWebSocketClient, * as WebSocketClient from '../websocket-client';
|
|
2
|
-
import Emitter from '../utils/Emitter';
|
|
3
|
-
import IssueReporter from '../service/IssueReporter';
|
|
4
|
-
import { obfuscateToken } from '../utils/string';
|
|
5
|
-
const { SOCKET_EVENTS, ...OTHER_EVENTS } = WebSocketClient;
|
|
6
|
-
const ALL_EVENTS = [...Object.values(SOCKET_EVENTS), ...Object.values(OTHER_EVENTS)];
|
|
7
|
-
const logger = IssueReporter.loggerFor('simple-ws-client');
|
|
8
|
-
export class Websocket extends Emitter {
|
|
9
|
-
ws;
|
|
10
|
-
eventLists;
|
|
11
|
-
CONFERENCE_USER_PARTICIPANT_JOINED;
|
|
12
|
-
CONFERENCE_USER_PARTICIPANT_LEFT;
|
|
13
|
-
MEETING_USER_PARTICIPANT_JOINED;
|
|
14
|
-
MEETING_USER_PARTICIPANT_LEFT;
|
|
15
|
-
CALL_CREATED;
|
|
16
|
-
constructor() {
|
|
17
|
-
super();
|
|
18
|
-
// Sugar syntax for `Wazo.WebSocket.EVENT_NAME`
|
|
19
|
-
Object.keys(OTHER_EVENTS).forEach(key => {
|
|
20
|
-
// @ts-ignore: keys
|
|
21
|
-
this[key] = OTHER_EVENTS[key];
|
|
22
|
-
});
|
|
23
|
-
Object.keys(SOCKET_EVENTS).forEach(key => {
|
|
24
|
-
// @ts-ignore: keys
|
|
25
|
-
this[key] = SOCKET_EVENTS[key];
|
|
26
|
-
});
|
|
27
|
-
this.eventLists = WazoWebSocketClient.eventLists;
|
|
28
|
-
this.ws = null;
|
|
29
|
-
}
|
|
30
|
-
open(host, session) {
|
|
31
|
-
logger.info('open simple WebSocket', {
|
|
32
|
-
host,
|
|
33
|
-
token: obfuscateToken(session.token),
|
|
34
|
-
});
|
|
35
|
-
this.ws = new WazoWebSocketClient({
|
|
36
|
-
host,
|
|
37
|
-
token: session.token,
|
|
38
|
-
events: ['*'],
|
|
39
|
-
version: 2,
|
|
40
|
-
session,
|
|
41
|
-
}, {
|
|
42
|
-
rejectUnauthorized: false,
|
|
43
|
-
binaryType: 'arraybuffer',
|
|
44
|
-
});
|
|
45
|
-
this.ws.connect();
|
|
46
|
-
// Re-emit all events
|
|
47
|
-
ALL_EVENTS.forEach((event) => {
|
|
48
|
-
if (!this.ws) {
|
|
49
|
-
return;
|
|
50
|
-
}
|
|
51
|
-
this.ws.on(event, (payload) => {
|
|
52
|
-
this.eventEmitter.emit(event, payload);
|
|
53
|
-
});
|
|
54
|
-
});
|
|
55
|
-
}
|
|
56
|
-
updateToken(token) {
|
|
57
|
-
logger.info('update token via simple Websocket', {
|
|
58
|
-
token,
|
|
59
|
-
ws: !!this.ws,
|
|
60
|
-
});
|
|
61
|
-
if (!this.ws) {
|
|
62
|
-
return;
|
|
63
|
-
}
|
|
64
|
-
this.ws.updateToken(token);
|
|
65
|
-
}
|
|
66
|
-
isOpen() {
|
|
67
|
-
return this.ws?.isConnected() || false;
|
|
68
|
-
}
|
|
69
|
-
close(force = false) {
|
|
70
|
-
logger.info('Closing event transport websocket', { force, ws: !!this.ws });
|
|
71
|
-
if (this.ws) {
|
|
72
|
-
this.ws.close(force);
|
|
73
|
-
}
|
|
74
|
-
this.unbind();
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
if (!global.wazoWebsocketInstance) {
|
|
78
|
-
global.wazoWebsocketInstance = new Websocket();
|
|
79
|
-
}
|
|
80
|
-
// @ts-ignore: Circular definition of import alias 'default'.
|
|
81
|
-
export default global.wazoWebsocketInstance;
|
|
@@ -1,144 +0,0 @@
|
|
|
1
|
-
import BadResponse from '../../domain/BadResponse';
|
|
2
|
-
import ServerError from '../../domain/ServerError';
|
|
3
|
-
import getApiClient, { setRefreshToken } from '../../service/getApiClient';
|
|
4
|
-
import { Auth as AuthClass } from '../Auth';
|
|
5
|
-
const Auth = new AuthClass();
|
|
6
|
-
const TOKEN = 'some-token';
|
|
7
|
-
const REFRESH_TOKEN = 'some-refresh-token';
|
|
8
|
-
const USER_UUID = 'some-user-uuid';
|
|
9
|
-
jest.mock('../../service/getApiClient');
|
|
10
|
-
describe('simple/Auth', () => {
|
|
11
|
-
beforeEach(() => {
|
|
12
|
-
const authenticate = jest.fn();
|
|
13
|
-
getApiClient.mockImplementation(() => ({
|
|
14
|
-
auth: {
|
|
15
|
-
authenticate,
|
|
16
|
-
},
|
|
17
|
-
}));
|
|
18
|
-
});
|
|
19
|
-
afterEach(() => {
|
|
20
|
-
jest.restoreAllMocks();
|
|
21
|
-
});
|
|
22
|
-
describe('validateToken', () => {
|
|
23
|
-
it('should return undefined if nullish', async () => {
|
|
24
|
-
// @ts-expect-error
|
|
25
|
-
const result = await Auth.validateToken(null);
|
|
26
|
-
expect(result).toEqual(undefined);
|
|
27
|
-
});
|
|
28
|
-
it('should set refresh token if provided', async () => {
|
|
29
|
-
await Auth.validateToken(TOKEN, REFRESH_TOKEN);
|
|
30
|
-
expect(setRefreshToken).toHaveBeenCalledWith(REFRESH_TOKEN);
|
|
31
|
-
});
|
|
32
|
-
it('should set user uuid header when using edge server', async () => {
|
|
33
|
-
Auth.usingEdgeServer = true;
|
|
34
|
-
const setHttpUserUuidHeader = jest.spyOn(Auth, 'setHttpUserUuidHeader');
|
|
35
|
-
await Auth.validateToken(TOKEN, undefined, USER_UUID);
|
|
36
|
-
expect(setHttpUserUuidHeader).toHaveBeenCalledWith(USER_UUID);
|
|
37
|
-
});
|
|
38
|
-
it('should NOT set user uuid header when NOT using edge server', async () => {
|
|
39
|
-
Auth.usingEdgeServer = false;
|
|
40
|
-
const setHttpUserUuidHeader = jest.spyOn(Auth, 'setHttpUserUuidHeader');
|
|
41
|
-
await Auth.validateToken(TOKEN, undefined, USER_UUID);
|
|
42
|
-
expect(setHttpUserUuidHeader).not.toHaveBeenCalled();
|
|
43
|
-
});
|
|
44
|
-
});
|
|
45
|
-
describe('checkHttpUserUuidHeader', () => {
|
|
46
|
-
it('should return undefined if UUID is null', async () => {
|
|
47
|
-
const result = await Auth.checkHttpUserUuidHeader(null);
|
|
48
|
-
expect(result).toEqual(undefined);
|
|
49
|
-
});
|
|
50
|
-
it('should set user UUID header on successful HEAD call', async () => {
|
|
51
|
-
const head = jest.fn(() => Promise.resolve({ headers: { get: () => null } }));
|
|
52
|
-
const setHttpUserUuidHeader = jest.spyOn(Auth, 'setHttpUserUuidHeader');
|
|
53
|
-
Auth.onSetUsingEdgeServer = jest.fn();
|
|
54
|
-
getApiClient.mockImplementation(() => ({
|
|
55
|
-
client: {
|
|
56
|
-
head,
|
|
57
|
-
},
|
|
58
|
-
}));
|
|
59
|
-
await Auth.checkHttpUserUuidHeader(USER_UUID);
|
|
60
|
-
expect(head).toHaveBeenCalled();
|
|
61
|
-
expect(setHttpUserUuidHeader).toHaveBeenCalledWith(USER_UUID);
|
|
62
|
-
expect(Auth.usingEdgeServer).toEqual(true);
|
|
63
|
-
expect(Auth.onSetUsingEdgeServer).toHaveBeenCalledWith(true);
|
|
64
|
-
});
|
|
65
|
-
it('should NOT set user UUID header on failed HEAD call', async () => {
|
|
66
|
-
const head = jest.fn(() => Promise.reject());
|
|
67
|
-
const setHttpUserUuidHeader = jest.spyOn(Auth, 'setHttpUserUuidHeader');
|
|
68
|
-
Auth.onSetUsingEdgeServer = jest.fn();
|
|
69
|
-
getApiClient.mockImplementation(() => ({
|
|
70
|
-
client: {
|
|
71
|
-
head,
|
|
72
|
-
},
|
|
73
|
-
}));
|
|
74
|
-
await Auth.checkHttpUserUuidHeader(USER_UUID);
|
|
75
|
-
expect(head).toHaveBeenCalled();
|
|
76
|
-
expect(setHttpUserUuidHeader).not.toHaveBeenCalled();
|
|
77
|
-
expect(Auth.usingEdgeServer).toEqual(false);
|
|
78
|
-
expect(Auth.onSetUsingEdgeServer).toHaveBeenCalledWith(false);
|
|
79
|
-
});
|
|
80
|
-
it('should set user UUID header on mobile when header is present', async () => {
|
|
81
|
-
Auth.mobile = true;
|
|
82
|
-
const head = jest.fn(() => Promise.resolve({ headers: { get: () => 'X-User-UUID: something' } }));
|
|
83
|
-
const setHttpUserUuidHeader = jest.spyOn(Auth, 'setHttpUserUuidHeader');
|
|
84
|
-
Auth.onSetUsingEdgeServer = jest.fn();
|
|
85
|
-
getApiClient.mockImplementation(() => ({
|
|
86
|
-
client: {
|
|
87
|
-
head,
|
|
88
|
-
},
|
|
89
|
-
}));
|
|
90
|
-
await Auth.checkHttpUserUuidHeader(USER_UUID);
|
|
91
|
-
expect(head).toHaveBeenCalled();
|
|
92
|
-
expect(setHttpUserUuidHeader).toHaveBeenCalledWith(USER_UUID);
|
|
93
|
-
expect(Auth.usingEdgeServer).toEqual(true);
|
|
94
|
-
expect(Auth.onSetUsingEdgeServer).toHaveBeenCalledWith(true);
|
|
95
|
-
});
|
|
96
|
-
it('should NOT set user UUID header on mobile when header is NOT present', async () => {
|
|
97
|
-
Auth.mobile = true;
|
|
98
|
-
const head = jest.fn(() => Promise.resolve({ headers: { get: () => 'something' } }));
|
|
99
|
-
const setHttpUserUuidHeader = jest.spyOn(Auth, 'setHttpUserUuidHeader');
|
|
100
|
-
Auth.onSetUsingEdgeServer = jest.fn();
|
|
101
|
-
getApiClient.mockImplementation(() => ({
|
|
102
|
-
client: {
|
|
103
|
-
head,
|
|
104
|
-
},
|
|
105
|
-
}));
|
|
106
|
-
await Auth.checkHttpUserUuidHeader(USER_UUID);
|
|
107
|
-
expect(head).toHaveBeenCalled();
|
|
108
|
-
expect(setHttpUserUuidHeader).not.toHaveBeenCalled();
|
|
109
|
-
expect(Auth.usingEdgeServer).toEqual(false);
|
|
110
|
-
expect(Auth.onSetUsingEdgeServer).toHaveBeenCalledWith(false);
|
|
111
|
-
});
|
|
112
|
-
});
|
|
113
|
-
describe('initiateIdpAuthentication', () => {
|
|
114
|
-
const validResponse = { location: 'idp.com/auth', saml_session_id: 'a1b2C3d4' };
|
|
115
|
-
it('should return a `location` and `saml_session_id` if the response is valid', async () => {
|
|
116
|
-
const initiateIdpAuthentication = jest.fn(() => validResponse);
|
|
117
|
-
getApiClient.mockImplementation(() => ({
|
|
118
|
-
auth: {
|
|
119
|
-
initiateIdpAuthentication,
|
|
120
|
-
},
|
|
121
|
-
}));
|
|
122
|
-
const response = await Auth.initiateIdpAuthentication('example.com', 'https://myapp.xyz');
|
|
123
|
-
expect(response).toBe(validResponse);
|
|
124
|
-
});
|
|
125
|
-
it('should return a `NoSamlRouteError` if the response is a 404', async () => {
|
|
126
|
-
const initiateIdpAuthentication = jest.fn(() => { throw BadResponse.fromText('an error message', 404); });
|
|
127
|
-
getApiClient.mockImplementation(() => ({
|
|
128
|
-
auth: {
|
|
129
|
-
initiateIdpAuthentication,
|
|
130
|
-
},
|
|
131
|
-
}));
|
|
132
|
-
await expect(Auth.initiateIdpAuthentication('example.com', 'https://myapp.xyz')).rejects.toThrow('No route found for SAML SSO');
|
|
133
|
-
});
|
|
134
|
-
it('should return a `SamlConfigError` if the response is a 500', async () => {
|
|
135
|
-
const initiateIdpAuthentication = jest.fn(() => { throw ServerError.fromText('an error message', 500); });
|
|
136
|
-
getApiClient.mockImplementation(() => ({
|
|
137
|
-
auth: {
|
|
138
|
-
initiateIdpAuthentication,
|
|
139
|
-
},
|
|
140
|
-
}));
|
|
141
|
-
await expect(Auth.initiateIdpAuthentication('example.com', 'https://myapp.xyz')).rejects.toThrow('SAML/server configuration error');
|
|
142
|
-
});
|
|
143
|
-
});
|
|
144
|
-
});
|