@wazo/sdk 0.43.14 → 0.44.0
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 +84 -57
- package/dist/index.js +10630 -0
- package/dist/index.mjs +10541 -0
- package/dist/types/api-client.d.ts +26 -0
- package/dist/types/api-client.d.ts.map +1 -0
- package/{lib/types/api-client.d.ts → dist/types/base-api-client.d.ts} +3 -24
- package/dist/types/base-api-client.d.ts.map +1 -0
- package/dist/types/constants.d.ts +12 -0
- package/dist/types/constants.d.ts.map +1 -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 +14 -13
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/service/__tests__/getApiclient.test.d.ts +2 -0
- package/dist/types/service/__tests__/getApiclient.test.d.ts.map +1 -0
- package/{lib → dist}/types/service/getApiClient.d.ts +5 -2
- package/dist/types/service/getApiClient.d.ts.map +1 -0
- package/{esm → dist}/types/simple/index.d.ts +1 -1
- package/{lib → dist}/types/utils/api-requester.d.ts.map +1 -1
- package/dist/wazo-sdk.js +69378 -43
- package/dist/wazo-sdk.js.LICENSE.txt +684 -0
- package/package.json +10 -21
- 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 -166
- 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/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 -50
- 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/getApiClient.js +0 -92
- 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/api-client.d.ts +0 -64
- package/esm/types/api-client.d.ts.map +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 -58
- package/esm/types/index.d.ts.map +0 -1
- package/esm/types/service/getApiClient.d.ts +0 -18
- package/esm/types/service/getApiClient.d.ts.map +0 -1
- package/esm/types/utils/api-requester.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 -214
- 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 -164
- 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/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 -125
- 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/getApiClient.js +0 -112
- 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.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/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/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/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 -201
- 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 -233
- 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/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 -59
- 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/getApiClient.ts +0 -106
- 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 -295
- 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/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/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/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.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/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/src/domain/Voicemail.ts
DELETED
|
@@ -1,138 +0,0 @@
|
|
|
1
|
-
import moment from 'moment';
|
|
2
|
-
import newFrom from '../utils/new-from';
|
|
3
|
-
|
|
4
|
-
export const VoicemailFolder = {
|
|
5
|
-
NEW: 'new',
|
|
6
|
-
OLD: 'old',
|
|
7
|
-
URGENT: 'urgent',
|
|
8
|
-
OTHER: 'other',
|
|
9
|
-
} as const;
|
|
10
|
-
|
|
11
|
-
const VoicemailFolderMapping = {
|
|
12
|
-
[VoicemailFolder.NEW]: 1,
|
|
13
|
-
[VoicemailFolder.OLD]: 2,
|
|
14
|
-
[VoicemailFolder.URGENT]: 3,
|
|
15
|
-
[VoicemailFolder.OTHER]: 4,
|
|
16
|
-
} as const;
|
|
17
|
-
|
|
18
|
-
export type VoicemailFolderType = typeof VoicemailFolder[keyof typeof VoicemailFolder];
|
|
19
|
-
|
|
20
|
-
type MessageResponse = {
|
|
21
|
-
caller_id_name: string;
|
|
22
|
-
caller_id_num: string;
|
|
23
|
-
duration: number;
|
|
24
|
-
id: string;
|
|
25
|
-
folder?: Record<string, any>;
|
|
26
|
-
timestamp: number;
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
export type Response = {
|
|
30
|
-
id: string;
|
|
31
|
-
name: string;
|
|
32
|
-
number: string;
|
|
33
|
-
folders: Array<{
|
|
34
|
-
id: string;
|
|
35
|
-
name: string;
|
|
36
|
-
type: VoicemailFolderType;
|
|
37
|
-
messages: Array<MessageResponse>;
|
|
38
|
-
}>;
|
|
39
|
-
};
|
|
40
|
-
|
|
41
|
-
type VoicemailArguments = {
|
|
42
|
-
id: string;
|
|
43
|
-
date: Date;
|
|
44
|
-
duration: number;
|
|
45
|
-
caller: {
|
|
46
|
-
name: string;
|
|
47
|
-
number: string;
|
|
48
|
-
};
|
|
49
|
-
unread?: boolean | null | undefined;
|
|
50
|
-
};
|
|
51
|
-
export default class Voicemail {
|
|
52
|
-
type: string;
|
|
53
|
-
|
|
54
|
-
id: string;
|
|
55
|
-
|
|
56
|
-
date: Date;
|
|
57
|
-
|
|
58
|
-
duration: number;
|
|
59
|
-
|
|
60
|
-
unread: boolean | null | undefined;
|
|
61
|
-
|
|
62
|
-
caller: {
|
|
63
|
-
name: string;
|
|
64
|
-
number: string;
|
|
65
|
-
};
|
|
66
|
-
|
|
67
|
-
static parse(plain: MessageResponse): Voicemail {
|
|
68
|
-
return new Voicemail({
|
|
69
|
-
id: plain.id,
|
|
70
|
-
date: moment(plain.timestamp * 1000).toDate(),
|
|
71
|
-
duration: plain.duration * 1000,
|
|
72
|
-
caller: {
|
|
73
|
-
name: plain.caller_id_name,
|
|
74
|
-
number: plain.caller_id_num,
|
|
75
|
-
},
|
|
76
|
-
unread: plain.folder ? plain.folder.type === VoicemailFolder.NEW : null,
|
|
77
|
-
});
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
static parseMany(plain: Response): Array<Voicemail> {
|
|
81
|
-
if (!plain) {
|
|
82
|
-
return [];
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
const plainUnread = plain.folders.filter(folder => folder.type === VoicemailFolder.NEW)[0].messages;
|
|
86
|
-
const plainRead = plain.folders.filter(folder => folder.type === VoicemailFolder.OLD)[0].messages;
|
|
87
|
-
const unread = plainUnread.map(message => Voicemail.parse(message)).map(voicemail => voicemail.makeAsUnRead());
|
|
88
|
-
const read = plainRead.map(message => Voicemail.parse(message)).map(voicemail => voicemail.acknowledge());
|
|
89
|
-
return [...unread, ...read];
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
static newFrom(profile: Voicemail) {
|
|
93
|
-
return newFrom(profile, Voicemail);
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
static getFolderMappingFromType(folder: VoicemailFolderType) {
|
|
97
|
-
return VoicemailFolderMapping[folder];
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
constructor({
|
|
101
|
-
id,
|
|
102
|
-
date,
|
|
103
|
-
duration,
|
|
104
|
-
caller,
|
|
105
|
-
unread,
|
|
106
|
-
}: VoicemailArguments) {
|
|
107
|
-
this.id = id;
|
|
108
|
-
this.date = date;
|
|
109
|
-
this.duration = duration;
|
|
110
|
-
this.caller = caller;
|
|
111
|
-
this.unread = unread;
|
|
112
|
-
// Useful to compare instead of instanceof with minified code
|
|
113
|
-
this.type = 'Voicemail';
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
is(other: Voicemail): boolean {
|
|
117
|
-
return other && this.id === other.id;
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
acknowledge() {
|
|
121
|
-
this.unread = false;
|
|
122
|
-
return this;
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
makeAsUnRead() {
|
|
126
|
-
this.unread = true;
|
|
127
|
-
return this;
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
contains(query: string): boolean {
|
|
131
|
-
if (!query) {
|
|
132
|
-
return true;
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
return this.caller.name.toUpperCase().includes(query.toUpperCase()) || this.caller.number.includes(query);
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import Agent, { AgentArguments, AgentResponse } from '../Agent';
|
|
2
|
-
|
|
3
|
-
const fieldMap: Record<string, any> = {
|
|
4
|
-
context: 'context',
|
|
5
|
-
extension: 'extension',
|
|
6
|
-
id: 'id',
|
|
7
|
-
logged: 'logged',
|
|
8
|
-
number: 'number',
|
|
9
|
-
paused: 'paused',
|
|
10
|
-
pausedReason: 'paused_reason',
|
|
11
|
-
};
|
|
12
|
-
const plain: Record<string, any> = {
|
|
13
|
-
context: 'bogus_context',
|
|
14
|
-
extension: 'bogus_extension',
|
|
15
|
-
id: 1234,
|
|
16
|
-
logged: true,
|
|
17
|
-
number: 'number',
|
|
18
|
-
origin_uuid: '3fa85f64-5717-4562-b3fc-2c963f66afa6',
|
|
19
|
-
paused: true,
|
|
20
|
-
paused_reason: 'this is a reason',
|
|
21
|
-
state_interface: 'undefined_state_interface',
|
|
22
|
-
tenant_uuid: '3fa85f64-5717-4562-b3fc-2c963f66afa6',
|
|
23
|
-
};
|
|
24
|
-
const formatted: Record<string, any> = {};
|
|
25
|
-
Object.keys(fieldMap).forEach((field: string) => {
|
|
26
|
-
formatted[field] = plain[fieldMap[field]];
|
|
27
|
-
});
|
|
28
|
-
describe('Call Center Agent domain', () => {
|
|
29
|
-
it('should keep its values', () => {
|
|
30
|
-
const agent = new Agent(formatted as AgentArguments) as any;
|
|
31
|
-
expect(agent).toBeInstanceOf(Agent);
|
|
32
|
-
Object.keys(fieldMap).map(key => expect(agent[key]).toBe(formatted[key]));
|
|
33
|
-
});
|
|
34
|
-
it('can parse a plain call center agent to domain', () => {
|
|
35
|
-
const agent = Agent.parse(plain as AgentResponse);
|
|
36
|
-
expect(agent).toEqual(new Agent(formatted as AgentArguments));
|
|
37
|
-
});
|
|
38
|
-
});
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import Call from '../Call';
|
|
2
|
-
|
|
3
|
-
describe('Call domain', () => {
|
|
4
|
-
it('can return the elapsed time since its creation in seconds', () => {
|
|
5
|
-
Date.now = jest.fn(() => new Date(2012, 7, 28, 13, 0, 0)) as any;
|
|
6
|
-
const call = new Call({
|
|
7
|
-
startingTime: new Date(2012, 7, 28, 12, 30, 0),
|
|
8
|
-
} as any);
|
|
9
|
-
const elapsedTimeInSeconds = call.getElapsedTimeInSeconds();
|
|
10
|
-
expect(elapsedTimeInSeconds).toBe(30 * 60);
|
|
11
|
-
});
|
|
12
|
-
it('has the number provided it is the same number', () => {
|
|
13
|
-
const call = new Call({
|
|
14
|
-
calleeName: 'John Doe',
|
|
15
|
-
calleeNumber: '911',
|
|
16
|
-
} as any);
|
|
17
|
-
expect(call.hasNumber('911')).toBeTruthy();
|
|
18
|
-
});
|
|
19
|
-
it('does not have the number provided it is a different number', () => {
|
|
20
|
-
const call = new Call({
|
|
21
|
-
calleeName: 'John Doe',
|
|
22
|
-
calleeNumber: '911',
|
|
23
|
-
} as any);
|
|
24
|
-
expect(call.hasNumber('418-222-5555')).toBeFalsy();
|
|
25
|
-
});
|
|
26
|
-
});
|
|
@@ -1,203 +0,0 @@
|
|
|
1
|
-
import moment from 'moment';
|
|
2
|
-
import CallLog, { Response, CallLogResponse, CALL_LOG_VALID_REQUESTED_VERSION } from '../CallLog';
|
|
3
|
-
import Recording from '../Recording';
|
|
4
|
-
import Session from '../Session';
|
|
5
|
-
import Profile from '../Profile';
|
|
6
|
-
import Line from '../Line';
|
|
7
|
-
|
|
8
|
-
const ALICE_EXTENSION = '41';
|
|
9
|
-
const ALICE_UUID = '11111111-1111-1111-1111-111111111111';
|
|
10
|
-
|
|
11
|
-
const BOB_EXTENSION = '42';
|
|
12
|
-
const BOB_UUID = '22222222-2222-2222-2222-222222222222';
|
|
13
|
-
|
|
14
|
-
const CHARLIE_EXTENSION = '43';
|
|
15
|
-
const CHARLIE_UUID = '33333333-3333-3333-3333-333333333333';
|
|
16
|
-
|
|
17
|
-
// Default scenario: Alice > Bob (No anwser forward) > Charlie
|
|
18
|
-
const CALL_LOG_RESPONSE: CallLogResponse = {
|
|
19
|
-
id: 1,
|
|
20
|
-
answer: '2024-01-02T00:00:00.000000+00:00',
|
|
21
|
-
answered: true,
|
|
22
|
-
call_direction: 'internal',
|
|
23
|
-
source_name: 'Alice',
|
|
24
|
-
source_extension: ALICE_EXTENSION,
|
|
25
|
-
source_user_uuid: ALICE_UUID,
|
|
26
|
-
requested_name: 'Bob',
|
|
27
|
-
requested_extension: BOB_EXTENSION,
|
|
28
|
-
requested_user_uuid: BOB_UUID,
|
|
29
|
-
destination_name: 'Charlie',
|
|
30
|
-
destination_extension: CHARLIE_EXTENSION,
|
|
31
|
-
destination_user_uuid: CHARLIE_UUID,
|
|
32
|
-
duration: 4,
|
|
33
|
-
start: '2024-01-01T00:00:00.000000+00:00',
|
|
34
|
-
end: '2024-01-01T00:00:04.000000+00:00',
|
|
35
|
-
recordings: [{
|
|
36
|
-
uuid: '0394ad6f-5c72-4072-8503-e3ad9a41c0a0',
|
|
37
|
-
start_time: '2024-01-01T00:00:00.000000+00:00',
|
|
38
|
-
end_time: '2024-01-01T00:00:04.000000+00:00',
|
|
39
|
-
filename: '2024-01-01T00_00_04UTC-61886-0394ad6f-5c72-4072-8503-e3ad9a41c0a0.wav',
|
|
40
|
-
deleted: false,
|
|
41
|
-
}],
|
|
42
|
-
};
|
|
43
|
-
const CALL_LOG = CallLog.parse(CALL_LOG_RESPONSE);
|
|
44
|
-
|
|
45
|
-
const generateBobSession = (opts?: Partial<Session>): Session =>
|
|
46
|
-
new Session({
|
|
47
|
-
acl: [],
|
|
48
|
-
token: 'ref-12345',
|
|
49
|
-
uuid: BOB_UUID,
|
|
50
|
-
expiresAt: new Date(9999, 0, 1),
|
|
51
|
-
engineVersion: CALL_LOG_VALID_REQUESTED_VERSION,
|
|
52
|
-
profile: new Profile({
|
|
53
|
-
lines: [new Line({
|
|
54
|
-
id: 1,
|
|
55
|
-
extensions: [{
|
|
56
|
-
id: 1,
|
|
57
|
-
exten: BOB_EXTENSION,
|
|
58
|
-
context: 'internal',
|
|
59
|
-
}],
|
|
60
|
-
})],
|
|
61
|
-
} as any),
|
|
62
|
-
...(opts || {}),
|
|
63
|
-
});
|
|
64
|
-
|
|
65
|
-
const BOB_SESSION = generateBobSession();
|
|
66
|
-
|
|
67
|
-
describe('CallLog Domain', () => {
|
|
68
|
-
describe('parseMany', () => {
|
|
69
|
-
it('can parse a plain call log to domain', () => {
|
|
70
|
-
const response: Response = {
|
|
71
|
-
filtered: 6,
|
|
72
|
-
items: [CALL_LOG_RESPONSE],
|
|
73
|
-
total: 233,
|
|
74
|
-
};
|
|
75
|
-
|
|
76
|
-
const logs = CallLog.parseMany(response);
|
|
77
|
-
expect(logs).toEqual([new CallLog({
|
|
78
|
-
id: 1,
|
|
79
|
-
answer: moment(CALL_LOG_RESPONSE.answer).toDate(),
|
|
80
|
-
answered: true,
|
|
81
|
-
callDirection: 'internal',
|
|
82
|
-
source: {
|
|
83
|
-
uuid: ALICE_UUID,
|
|
84
|
-
name: 'Alice',
|
|
85
|
-
extension: ALICE_EXTENSION,
|
|
86
|
-
},
|
|
87
|
-
requested: {
|
|
88
|
-
uuid: BOB_UUID,
|
|
89
|
-
name: 'Bob',
|
|
90
|
-
extension: BOB_EXTENSION,
|
|
91
|
-
},
|
|
92
|
-
destination: {
|
|
93
|
-
uuid: CHARLIE_UUID,
|
|
94
|
-
name: 'Bob',
|
|
95
|
-
extension: BOB_EXTENSION,
|
|
96
|
-
plainExtension: CHARLIE_EXTENSION,
|
|
97
|
-
plainName: 'Charlie',
|
|
98
|
-
},
|
|
99
|
-
duration: 4000,
|
|
100
|
-
start: moment(CALL_LOG_RESPONSE.start).toDate(),
|
|
101
|
-
end: moment(CALL_LOG_RESPONSE.end).toDate(),
|
|
102
|
-
recordings: [new Recording({
|
|
103
|
-
uuid: CALL_LOG_RESPONSE.recordings[0].uuid,
|
|
104
|
-
start: moment(CALL_LOG_RESPONSE.recordings[0].start_time).toDate(),
|
|
105
|
-
end: moment(CALL_LOG_RESPONSE.recordings[0].end_time).toDate(),
|
|
106
|
-
fileName: CALL_LOG_RESPONSE.recordings[0].filename,
|
|
107
|
-
deleted: false,
|
|
108
|
-
})],
|
|
109
|
-
})]);
|
|
110
|
-
});
|
|
111
|
-
});
|
|
112
|
-
|
|
113
|
-
describe('isIconming', () => {
|
|
114
|
-
it('should be TRUE', () => {
|
|
115
|
-
// When requested is set to the same user session extension
|
|
116
|
-
expect(CALL_LOG.isIncomingAndForwarded(BOB_SESSION)).toBe(true);
|
|
117
|
-
|
|
118
|
-
// When destination is set to the same user session extension
|
|
119
|
-
const destinationCallLog = CallLog.parse({
|
|
120
|
-
...CALL_LOG_RESPONSE,
|
|
121
|
-
destination_extension: CALL_LOG_RESPONSE.requested_extension,
|
|
122
|
-
destination_name: CALL_LOG_RESPONSE.requested_name,
|
|
123
|
-
destination_user_uuid: CALL_LOG_RESPONSE.requested_user_uuid,
|
|
124
|
-
requested_extension: CALL_LOG_RESPONSE.destination_extension,
|
|
125
|
-
requested_name: CALL_LOG_RESPONSE.destination_name,
|
|
126
|
-
requested_user_uuid: CALL_LOG_RESPONSE.destination_user_uuid,
|
|
127
|
-
});
|
|
128
|
-
expect(destinationCallLog.isIncomingAndForwarded(BOB_SESSION)).toBe(true);
|
|
129
|
-
|
|
130
|
-
// When destination is set to the same user with a changed extension
|
|
131
|
-
const destinationExtensionChangedCallLog = CallLog.parse({
|
|
132
|
-
...CALL_LOG_RESPONSE,
|
|
133
|
-
destination_extension: `${CALL_LOG_RESPONSE.requested_extension}9`,
|
|
134
|
-
destination_name: CALL_LOG_RESPONSE.requested_name,
|
|
135
|
-
destination_user_uuid: CALL_LOG_RESPONSE.requested_user_uuid,
|
|
136
|
-
requested_extension: `${CALL_LOG_RESPONSE.destination_extension}9`,
|
|
137
|
-
requested_name: CALL_LOG_RESPONSE.destination_name,
|
|
138
|
-
requested_user_uuid: CALL_LOG_RESPONSE.destination_user_uuid,
|
|
139
|
-
});
|
|
140
|
-
expect(destinationExtensionChangedCallLog.isIncomingAndForwarded(BOB_SESSION)).toBe(true);
|
|
141
|
-
|
|
142
|
-
// When call direction is inbound
|
|
143
|
-
const inboundCallLog = CallLog.parse({ ...CALL_LOG_RESPONSE, call_direction: 'inbound' });
|
|
144
|
-
expect(inboundCallLog.isIncomingAndForwarded(BOB_SESSION)).toBe(true);
|
|
145
|
-
|
|
146
|
-
});
|
|
147
|
-
|
|
148
|
-
it('should be FALSE', () => {
|
|
149
|
-
// When call direction is outbound
|
|
150
|
-
const outboundCallLog = CallLog.parse({ ...CALL_LOG_RESPONSE, call_direction: 'outbound' });
|
|
151
|
-
expect(outboundCallLog.isIncomingAndForwarded(BOB_SESSION)).toBe(false);
|
|
152
|
-
});
|
|
153
|
-
});
|
|
154
|
-
|
|
155
|
-
describe('isIncomingAndForwarded', () => {
|
|
156
|
-
it('should be TRUE when requested is current user extension and destination is another extesnion', () => {
|
|
157
|
-
// Internal call (requested contact)
|
|
158
|
-
expect(CALL_LOG.isIncomingAndForwarded(BOB_SESSION)).toBe(true);
|
|
159
|
-
|
|
160
|
-
// Inbound call (requested contact)
|
|
161
|
-
const inboundCallLog = CallLog.parse({
|
|
162
|
-
...CALL_LOG_RESPONSE,
|
|
163
|
-
call_direction: 'inbound',
|
|
164
|
-
source_extension: '18004444444',
|
|
165
|
-
source_name: '',
|
|
166
|
-
source_user_uuid: null,
|
|
167
|
-
});
|
|
168
|
-
expect(inboundCallLog.isIncomingAndForwarded(BOB_SESSION)).toBe(true);
|
|
169
|
-
|
|
170
|
-
// Current user is the final destination
|
|
171
|
-
const destinationCallLog = CallLog.parse({
|
|
172
|
-
...CALL_LOG_RESPONSE,
|
|
173
|
-
destination_extension: CALL_LOG_RESPONSE.requested_extension,
|
|
174
|
-
destination_name: CALL_LOG_RESPONSE.requested_name,
|
|
175
|
-
destination_user_uuid: CALL_LOG_RESPONSE.requested_user_uuid,
|
|
176
|
-
requested_extension: CALL_LOG_RESPONSE.destination_extension,
|
|
177
|
-
requested_name: CALL_LOG_RESPONSE.destination_name,
|
|
178
|
-
requested_user_uuid: CALL_LOG_RESPONSE.destination_user_uuid,
|
|
179
|
-
});
|
|
180
|
-
expect(destinationCallLog.isIncomingAndForwarded(BOB_SESSION)).toBe(true);
|
|
181
|
-
});
|
|
182
|
-
|
|
183
|
-
it('should be FALSE', () => {
|
|
184
|
-
// Requested and destination are same
|
|
185
|
-
const directCallLog = CallLog.parse({
|
|
186
|
-
...CALL_LOG_RESPONSE,
|
|
187
|
-
requested_extension: CALL_LOG_RESPONSE.destination_extension,
|
|
188
|
-
requested_name: CALL_LOG_RESPONSE.destination_name,
|
|
189
|
-
requested_user_uuid: CALL_LOG_RESPONSE.destination_user_uuid,
|
|
190
|
-
});
|
|
191
|
-
|
|
192
|
-
expect(directCallLog.isIncomingAndForwarded(BOB_SESSION)).toBe(false);
|
|
193
|
-
|
|
194
|
-
// Not incoming call
|
|
195
|
-
const outboundCallLog = CallLog.parse({ ...CALL_LOG_RESPONSE, call_direction: 'outbound' });
|
|
196
|
-
expect(outboundCallLog.isIncomingAndForwarded(BOB_SESSION)).toBe(false);
|
|
197
|
-
|
|
198
|
-
// Stack version
|
|
199
|
-
const oldStackSession = generateBobSession({ engineVersion: CALL_LOG_VALID_REQUESTED_VERSION.replace('14', '10') });
|
|
200
|
-
expect(CALL_LOG.isIncomingAndForwarded(oldStackSession)).toBe(false);
|
|
201
|
-
});
|
|
202
|
-
});
|
|
203
|
-
});
|
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
import CallSession from '../CallSession';
|
|
2
|
-
|
|
3
|
-
const stringify = (cs: any) => JSON.parse(JSON.stringify(cs));
|
|
4
|
-
|
|
5
|
-
describe('CallSession domain', () => {
|
|
6
|
-
it('should update from another CallSession without data loss', () => {
|
|
7
|
-
const callSession = new CallSession({
|
|
8
|
-
callId: null,
|
|
9
|
-
sipCallId: 123,
|
|
10
|
-
paused: false,
|
|
11
|
-
number: '8001',
|
|
12
|
-
isCaller: true,
|
|
13
|
-
dialedExtension: null,
|
|
14
|
-
} as any);
|
|
15
|
-
const anotherCallSession = new CallSession({
|
|
16
|
-
callId: 345,
|
|
17
|
-
callerNumber: '8008',
|
|
18
|
-
number: '8008',
|
|
19
|
-
isCaller: false,
|
|
20
|
-
dialedExtension: undefined,
|
|
21
|
-
} as any);
|
|
22
|
-
callSession.updateFrom(anotherCallSession);
|
|
23
|
-
expect(callSession.callId).toBe(345);
|
|
24
|
-
expect(callSession.sipCallId).toBe(123);
|
|
25
|
-
expect(callSession.paused).toBe(false);
|
|
26
|
-
expect(callSession.ringing).toBe(undefined);
|
|
27
|
-
expect(callSession.callerNumber).toBe('8008');
|
|
28
|
-
expect(callSession.number).toBe('8008');
|
|
29
|
-
expect(callSession.isCaller).toBe(false);
|
|
30
|
-
expect(callSession.dialedExtension).toBe('');
|
|
31
|
-
});
|
|
32
|
-
it('should compare 2 callSession', () => {
|
|
33
|
-
const cs1 = new CallSession({
|
|
34
|
-
callId: 123,
|
|
35
|
-
sipCallId: 456,
|
|
36
|
-
} as any);
|
|
37
|
-
const cs2 = new CallSession({
|
|
38
|
-
callId: 123,
|
|
39
|
-
sipCallId: null,
|
|
40
|
-
} as any);
|
|
41
|
-
expect(cs1.is(cs2)).toBeTruthy();
|
|
42
|
-
expect(cs2.is(cs1)).toBeTruthy();
|
|
43
|
-
});
|
|
44
|
-
it('should set answerTime when setting answered to true', () => {
|
|
45
|
-
const cs1 = new CallSession({} as any);
|
|
46
|
-
cs1.answered = true;
|
|
47
|
-
const cs2 = new CallSession({} as any);
|
|
48
|
-
cs2.answer();
|
|
49
|
-
const cs3 = new CallSession({
|
|
50
|
-
answered: true,
|
|
51
|
-
} as any);
|
|
52
|
-
expect(cs1.answered).toEqual(true);
|
|
53
|
-
expect(cs1.answerTime).not.toBeNull();
|
|
54
|
-
expect(cs2.answered).toEqual(true);
|
|
55
|
-
expect(cs2.answerTime).not.toBeNull();
|
|
56
|
-
expect(cs3.answered).toEqual(true);
|
|
57
|
-
expect(cs3.answerTime).not.toBeNull();
|
|
58
|
-
const cs4 = stringify(cs1);
|
|
59
|
-
const cs5 = stringify(cs2);
|
|
60
|
-
const cs6 = stringify(cs3);
|
|
61
|
-
expect(cs4.answered).toEqual(true);
|
|
62
|
-
expect(cs5.answered).toEqual(true);
|
|
63
|
-
expect(cs6.answered).toEqual(true);
|
|
64
|
-
});
|
|
65
|
-
it('should reset answerTime when setting answered to false', () => {
|
|
66
|
-
const cs1 = new CallSession({} as any);
|
|
67
|
-
cs1.answered = false;
|
|
68
|
-
const cs2 = new CallSession({
|
|
69
|
-
answered: false,
|
|
70
|
-
} as any);
|
|
71
|
-
expect(cs1.answered).toEqual(false);
|
|
72
|
-
expect(cs1.answerTime).toBeNull();
|
|
73
|
-
expect(cs2.answered).toEqual(false);
|
|
74
|
-
expect(cs2.answerTime).toBeNull();
|
|
75
|
-
const cs4 = stringify(cs1);
|
|
76
|
-
const cs5 = stringify(cs2);
|
|
77
|
-
expect(cs4.answered).toEqual(false);
|
|
78
|
-
expect(cs5.answered).toEqual(false);
|
|
79
|
-
});
|
|
80
|
-
});
|