@wazo/sdk 0.43.15 → 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/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 +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 -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
|
@@ -1,407 +0,0 @@
|
|
|
1
|
-
import Contact from '../Contact';
|
|
2
|
-
|
|
3
|
-
const genericContactResponse = {
|
|
4
|
-
column_types: [
|
|
5
|
-
'name',
|
|
6
|
-
'firstname',
|
|
7
|
-
'lastname',
|
|
8
|
-
'number',
|
|
9
|
-
'callable',
|
|
10
|
-
'voicemail',
|
|
11
|
-
'favorite',
|
|
12
|
-
'email',
|
|
13
|
-
'personal',
|
|
14
|
-
],
|
|
15
|
-
term: 'a',
|
|
16
|
-
column_headers: [
|
|
17
|
-
'Nom',
|
|
18
|
-
'Pr\u00e9nom',
|
|
19
|
-
'Nom de famille',
|
|
20
|
-
'Num\u00e9ro',
|
|
21
|
-
'Mobile',
|
|
22
|
-
'Bo\u00eete vocale',
|
|
23
|
-
'Favoris',
|
|
24
|
-
'E-mail',
|
|
25
|
-
'Personnel',
|
|
26
|
-
],
|
|
27
|
-
results: [],
|
|
28
|
-
};
|
|
29
|
-
|
|
30
|
-
const contact1 = {
|
|
31
|
-
source: 'internal',
|
|
32
|
-
column_values: [
|
|
33
|
-
'Jonathan Lessard',
|
|
34
|
-
'Jonathan',
|
|
35
|
-
'Lessard',
|
|
36
|
-
'8020',
|
|
37
|
-
'06800880',
|
|
38
|
-
null,
|
|
39
|
-
false,
|
|
40
|
-
'jonathan@example.com',
|
|
41
|
-
false,
|
|
42
|
-
],
|
|
43
|
-
backend: 'wazo',
|
|
44
|
-
relations: {
|
|
45
|
-
user_id: 8,
|
|
46
|
-
xivo_id: '6cd695d2-cdb9-4444-8b2d-27425ab85fa8',
|
|
47
|
-
agent_id: null,
|
|
48
|
-
endpoint_id: 8,
|
|
49
|
-
user_uuid: 'a14dd6d6-547c-434d-bd5c-e882b5b83b54',
|
|
50
|
-
source_entry_id: '8',
|
|
51
|
-
},
|
|
52
|
-
};
|
|
53
|
-
|
|
54
|
-
const contact2 = {
|
|
55
|
-
source: 'internal',
|
|
56
|
-
column_values: [
|
|
57
|
-
'John Doe',
|
|
58
|
-
'John',
|
|
59
|
-
'Doe',
|
|
60
|
-
'8021',
|
|
61
|
-
'06800881',
|
|
62
|
-
null,
|
|
63
|
-
false,
|
|
64
|
-
'john@example.com',
|
|
65
|
-
false,
|
|
66
|
-
],
|
|
67
|
-
backend: 'wazo',
|
|
68
|
-
relations: {
|
|
69
|
-
user_id: 9,
|
|
70
|
-
xivo_id: '6cd695d2-cdb9-4444-8b2d-27425ab85fa9',
|
|
71
|
-
agent_id: null,
|
|
72
|
-
endpoint_id: 9,
|
|
73
|
-
user_uuid: 'a14dd6d6-547c-434d-bd5c-e882b5b83b55',
|
|
74
|
-
source_entry_id: '9',
|
|
75
|
-
},
|
|
76
|
-
};
|
|
77
|
-
|
|
78
|
-
const parsedContact1 = new Contact({
|
|
79
|
-
name: 'Jonathan Lessard',
|
|
80
|
-
firstName: 'Jonathan',
|
|
81
|
-
lastName: 'Lessard',
|
|
82
|
-
number: '8020',
|
|
83
|
-
numbers: [
|
|
84
|
-
{
|
|
85
|
-
label: 'primary',
|
|
86
|
-
number: '8020',
|
|
87
|
-
},
|
|
88
|
-
{
|
|
89
|
-
label: 'secondary',
|
|
90
|
-
number: '06800880',
|
|
91
|
-
},
|
|
92
|
-
],
|
|
93
|
-
favorited: false,
|
|
94
|
-
email: 'jonathan@example.com',
|
|
95
|
-
emails: [
|
|
96
|
-
{
|
|
97
|
-
label: 'primary',
|
|
98
|
-
email: 'jonathan@example.com',
|
|
99
|
-
},
|
|
100
|
-
],
|
|
101
|
-
address: '',
|
|
102
|
-
entreprise: '',
|
|
103
|
-
birthday: '',
|
|
104
|
-
note: '',
|
|
105
|
-
endpointId: 8,
|
|
106
|
-
personal: false,
|
|
107
|
-
source: 'internal',
|
|
108
|
-
sourceId: '8',
|
|
109
|
-
uuid: 'a14dd6d6-547c-434d-bd5c-e882b5b83b54',
|
|
110
|
-
backend: 'wazo',
|
|
111
|
-
});
|
|
112
|
-
|
|
113
|
-
const parsedContact2 = new Contact({
|
|
114
|
-
name: 'John Doe',
|
|
115
|
-
firstName: 'John',
|
|
116
|
-
lastName: 'Doe',
|
|
117
|
-
number: '8021',
|
|
118
|
-
numbers: [
|
|
119
|
-
{
|
|
120
|
-
label: 'primary',
|
|
121
|
-
number: '8021',
|
|
122
|
-
},
|
|
123
|
-
{
|
|
124
|
-
label: 'secondary',
|
|
125
|
-
number: '06800881',
|
|
126
|
-
},
|
|
127
|
-
],
|
|
128
|
-
favorited: false,
|
|
129
|
-
email: 'john@example.com',
|
|
130
|
-
emails: [
|
|
131
|
-
{
|
|
132
|
-
label: 'primary',
|
|
133
|
-
email: 'john@example.com',
|
|
134
|
-
},
|
|
135
|
-
],
|
|
136
|
-
address: '',
|
|
137
|
-
entreprise: '',
|
|
138
|
-
birthday: '',
|
|
139
|
-
note: '',
|
|
140
|
-
endpointId: 9,
|
|
141
|
-
personal: false,
|
|
142
|
-
source: 'internal',
|
|
143
|
-
sourceId: '9',
|
|
144
|
-
uuid: 'a14dd6d6-547c-434d-bd5c-e882b5b83b55',
|
|
145
|
-
backend: 'wazo',
|
|
146
|
-
});
|
|
147
|
-
|
|
148
|
-
describe('Contact domain', () => {
|
|
149
|
-
it('is extern when given no uuid', () => {
|
|
150
|
-
const boba = new Contact({});
|
|
151
|
-
expect(boba.isIntern()).toBeFalsy();
|
|
152
|
-
});
|
|
153
|
-
it('is intern when given a uuid', () => {
|
|
154
|
-
const boba = new Contact({
|
|
155
|
-
uuid: '123',
|
|
156
|
-
});
|
|
157
|
-
expect(boba.isIntern()).toBeTruthy();
|
|
158
|
-
});
|
|
159
|
-
it('is the same contact when it has the same uuid and sourceId', () => {
|
|
160
|
-
const john = new Contact({
|
|
161
|
-
uuid: '12345',
|
|
162
|
-
sourceId: '800',
|
|
163
|
-
backend: 'some-backend',
|
|
164
|
-
source: 'wazo',
|
|
165
|
-
});
|
|
166
|
-
const sam = new Contact({
|
|
167
|
-
uuid: '12345',
|
|
168
|
-
sourceId: '800',
|
|
169
|
-
backend: 'some-backend',
|
|
170
|
-
source: 'wazo',
|
|
171
|
-
});
|
|
172
|
-
expect(john.is(sam)).toBe(true);
|
|
173
|
-
});
|
|
174
|
-
it('is the same contact when it has the same uuid and no sourceId', () => {
|
|
175
|
-
const john = new Contact({
|
|
176
|
-
uuid: '12345',
|
|
177
|
-
sourceId: undefined,
|
|
178
|
-
backend: 'some-backend',
|
|
179
|
-
source: 'wazo',
|
|
180
|
-
});
|
|
181
|
-
const sam = new Contact({
|
|
182
|
-
uuid: '12345',
|
|
183
|
-
sourceId: undefined,
|
|
184
|
-
backend: 'some-backend',
|
|
185
|
-
source: 'wazo',
|
|
186
|
-
});
|
|
187
|
-
expect(john.is(sam)).toBe(true);
|
|
188
|
-
});
|
|
189
|
-
it('is the same contact when it has the same uuid and no sourceId', () => {
|
|
190
|
-
const john = new Contact({
|
|
191
|
-
uuid: '12345',
|
|
192
|
-
sourceId: undefined,
|
|
193
|
-
backend: 'some-backend',
|
|
194
|
-
source: 'wazo',
|
|
195
|
-
});
|
|
196
|
-
const sam = new Contact({
|
|
197
|
-
uuid: '12345',
|
|
198
|
-
sourceId: undefined,
|
|
199
|
-
backend: 'some-backend',
|
|
200
|
-
source: 'wazo',
|
|
201
|
-
});
|
|
202
|
-
expect(john.is(sam)).toBe(true);
|
|
203
|
-
});
|
|
204
|
-
it('is the same contact when one is missing a uuid but they have the same sourceId', () => {
|
|
205
|
-
const john = new Contact({
|
|
206
|
-
uuid: '12345',
|
|
207
|
-
sourceId: '800',
|
|
208
|
-
backend: 'some-backend',
|
|
209
|
-
source: 'wazo',
|
|
210
|
-
});
|
|
211
|
-
const sam = new Contact({
|
|
212
|
-
uuid: undefined,
|
|
213
|
-
sourceId: '800',
|
|
214
|
-
backend: 'some-backend',
|
|
215
|
-
source: 'wazo',
|
|
216
|
-
});
|
|
217
|
-
expect(john.is(sam)).toBe(true);
|
|
218
|
-
});
|
|
219
|
-
it('is the same contact when one is missing a sourceId but they have the same sourceId', () => {
|
|
220
|
-
const john = new Contact({
|
|
221
|
-
uuid: '12345',
|
|
222
|
-
sourceId: '800',
|
|
223
|
-
backend: 'some-backend',
|
|
224
|
-
source: 'wazo',
|
|
225
|
-
});
|
|
226
|
-
const sam = new Contact({
|
|
227
|
-
uuid: '12345',
|
|
228
|
-
sourceId: undefined,
|
|
229
|
-
backend: 'some-backend',
|
|
230
|
-
source: 'wazo',
|
|
231
|
-
});
|
|
232
|
-
expect(john.is(sam)).toBe(true);
|
|
233
|
-
});
|
|
234
|
-
it('is the same contact even when it has different uuid', () => {
|
|
235
|
-
const john = new Contact({
|
|
236
|
-
uuid: 'abc',
|
|
237
|
-
sourceId: '800',
|
|
238
|
-
backend: 'some-backend',
|
|
239
|
-
source: 'wazo',
|
|
240
|
-
});
|
|
241
|
-
const sam = new Contact({
|
|
242
|
-
uuid: '12345',
|
|
243
|
-
sourceId: '800',
|
|
244
|
-
backend: 'some-backend',
|
|
245
|
-
source: 'wazo',
|
|
246
|
-
});
|
|
247
|
-
expect(john.is(sam)).toBe(true);
|
|
248
|
-
});
|
|
249
|
-
it('is the same contact even when it has different sourceId', () => {
|
|
250
|
-
const john = new Contact({
|
|
251
|
-
uuid: '12345',
|
|
252
|
-
sourceId: '100',
|
|
253
|
-
backend: 'some-backend',
|
|
254
|
-
source: 'wazo',
|
|
255
|
-
});
|
|
256
|
-
const sam = new Contact({
|
|
257
|
-
uuid: '12345',
|
|
258
|
-
sourceId: '800',
|
|
259
|
-
backend: 'some-backend',
|
|
260
|
-
source: 'wazo',
|
|
261
|
-
});
|
|
262
|
-
expect(john.is(sam)).toBe(true);
|
|
263
|
-
});
|
|
264
|
-
it('has the id given the same uuid', () => {
|
|
265
|
-
const contact = new Contact({
|
|
266
|
-
uuid: 'uuid-12345',
|
|
267
|
-
});
|
|
268
|
-
expect(contact.hasId('uuid-12345')).toBeTruthy();
|
|
269
|
-
});
|
|
270
|
-
it('does not have the id given a different uuid', () => {
|
|
271
|
-
const contact = new Contact({
|
|
272
|
-
uuid: 'uuid-12345',
|
|
273
|
-
});
|
|
274
|
-
expect(contact.hasId('uuid-dummy')).toBeFalsy();
|
|
275
|
-
});
|
|
276
|
-
it('does separate names with a single space', () => {
|
|
277
|
-
const contact = new Contact({
|
|
278
|
-
name: 'John Smith',
|
|
279
|
-
});
|
|
280
|
-
const { firstName, lastName } = contact.separateName();
|
|
281
|
-
expect(firstName).toBe('John');
|
|
282
|
-
expect(lastName).toBe('Smith');
|
|
283
|
-
});
|
|
284
|
-
it('does separate names with multiple spaces', () => {
|
|
285
|
-
const contact = new Contact({
|
|
286
|
-
name: 'John Smith',
|
|
287
|
-
});
|
|
288
|
-
const { firstName, lastName } = contact.separateName();
|
|
289
|
-
expect(firstName).toBe('John');
|
|
290
|
-
expect(lastName).toBe('Smith');
|
|
291
|
-
});
|
|
292
|
-
it('is available given an available state', () => {
|
|
293
|
-
const contact = new Contact({
|
|
294
|
-
uuid: 'uuid-12345',
|
|
295
|
-
state: 'available',
|
|
296
|
-
});
|
|
297
|
-
expect(contact.isAvailable()).toBeTruthy();
|
|
298
|
-
});
|
|
299
|
-
it('is not available given a non available state', () => {
|
|
300
|
-
const contact = new Contact({
|
|
301
|
-
uuid: 'uuid-12345',
|
|
302
|
-
state: 'donotdisturb',
|
|
303
|
-
});
|
|
304
|
-
expect(contact.isAvailable()).toBeFalsy();
|
|
305
|
-
});
|
|
306
|
-
it('is not available given no state', () => {
|
|
307
|
-
const contact = new Contact({
|
|
308
|
-
uuid: 'uuid-12345',
|
|
309
|
-
});
|
|
310
|
-
expect(contact.isAvailable()).toBeFalsy();
|
|
311
|
-
});
|
|
312
|
-
it('can parse a plain contact to domain', () => {
|
|
313
|
-
const response = {
|
|
314
|
-
...genericContactResponse,
|
|
315
|
-
results: [contact1],
|
|
316
|
-
};
|
|
317
|
-
const contact = Contact.parse(response.results[0], response.column_types);
|
|
318
|
-
expect(contact).toEqual(parsedContact1);
|
|
319
|
-
});
|
|
320
|
-
it('should merge 2 contact', () => {
|
|
321
|
-
const noBirthdayContact = new Contact({
|
|
322
|
-
uuid: 'uuid-12345',
|
|
323
|
-
lastActivity: 'yesterday',
|
|
324
|
-
birthday: undefined,
|
|
325
|
-
});
|
|
326
|
-
const noLastActivityContact = new Contact({
|
|
327
|
-
uuid: 'uuid-12345',
|
|
328
|
-
lastActivity: undefined,
|
|
329
|
-
birthday: 'tomorrow',
|
|
330
|
-
});
|
|
331
|
-
const result = noBirthdayContact.merge(noLastActivityContact);
|
|
332
|
-
expect(result.lastActivity).toBe('yesterday');
|
|
333
|
-
expect(result.birthday).toBe('tomorrow');
|
|
334
|
-
});
|
|
335
|
-
it('returns all contacts when parsing many contacts with no limit', () => {
|
|
336
|
-
const response = {
|
|
337
|
-
...genericContactResponse,
|
|
338
|
-
results: [contact1, contact2],
|
|
339
|
-
};
|
|
340
|
-
|
|
341
|
-
const contacts = Contact.parseMany(response);
|
|
342
|
-
expect(contacts).toEqual([parsedContact1, parsedContact2]);
|
|
343
|
-
});
|
|
344
|
-
it('returns all contacts when parsing many contacts with a higher limit than number of results', () => {
|
|
345
|
-
const response = {
|
|
346
|
-
...genericContactResponse,
|
|
347
|
-
results: [contact1, contact2],
|
|
348
|
-
};
|
|
349
|
-
|
|
350
|
-
const contacts = Contact.parseMany(response, 0, 1000);
|
|
351
|
-
expect(contacts).toEqual([parsedContact1, parsedContact2]);
|
|
352
|
-
});
|
|
353
|
-
it('returns limited contacts when parsing many contacts with a smaller limit than number of results', () => {
|
|
354
|
-
const response = {
|
|
355
|
-
...genericContactResponse,
|
|
356
|
-
results: [contact1],
|
|
357
|
-
};
|
|
358
|
-
|
|
359
|
-
const contacts = Contact.parseMany(response, 0, 1);
|
|
360
|
-
expect(contacts).toEqual([parsedContact1]);
|
|
361
|
-
});
|
|
362
|
-
it('returns all contacts when parsing many contacts with same limit than number of results', () => {
|
|
363
|
-
const response = {
|
|
364
|
-
...genericContactResponse,
|
|
365
|
-
results: [contact1, contact2],
|
|
366
|
-
};
|
|
367
|
-
|
|
368
|
-
const contacts = Contact.parseMany(response, 0, 2);
|
|
369
|
-
expect(contacts).toEqual([parsedContact1, parsedContact2]);
|
|
370
|
-
});
|
|
371
|
-
it('returns an empty array when parsing many contact with limit of 0', () => {
|
|
372
|
-
const response = {
|
|
373
|
-
...genericContactResponse,
|
|
374
|
-
results: [contact1, contact2],
|
|
375
|
-
};
|
|
376
|
-
|
|
377
|
-
const contacts = Contact.parseMany(response, 0, 0);
|
|
378
|
-
expect(contacts).toEqual([]);
|
|
379
|
-
});
|
|
380
|
-
it('returns all contacts when parsing many contacts with a negative limit', () => {
|
|
381
|
-
const response = {
|
|
382
|
-
...genericContactResponse,
|
|
383
|
-
results: [contact1, contact2],
|
|
384
|
-
};
|
|
385
|
-
|
|
386
|
-
const contacts = Contact.parseMany(response, 0, -1);
|
|
387
|
-
expect(contacts).toEqual([parsedContact1, parsedContact2]);
|
|
388
|
-
});
|
|
389
|
-
it('returns all contacts when parsing many contacts with a null limit', () => {
|
|
390
|
-
const response = {
|
|
391
|
-
...genericContactResponse,
|
|
392
|
-
results: [contact1, contact2],
|
|
393
|
-
};
|
|
394
|
-
|
|
395
|
-
const contacts = Contact.parseMany(response, 0, null);
|
|
396
|
-
expect(contacts).toEqual([parsedContact1, parsedContact2]);
|
|
397
|
-
});
|
|
398
|
-
it('returns all contacts after the first one when parsing many contacts with an offset of 1', () => {
|
|
399
|
-
const response = {
|
|
400
|
-
...genericContactResponse,
|
|
401
|
-
results: [contact1, contact2],
|
|
402
|
-
};
|
|
403
|
-
|
|
404
|
-
const contacts = Contact.parseMany(response, 1, null);
|
|
405
|
-
expect(contacts).toEqual([parsedContact2]);
|
|
406
|
-
});
|
|
407
|
-
});
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
import CallSession from '../CallSession';
|
|
2
|
-
import IndirectTransfer from '../IndirectTransfer';
|
|
3
|
-
|
|
4
|
-
describe('Indirect transfer', () => {
|
|
5
|
-
describe('on parse from call session', () => {
|
|
6
|
-
it('should return valid IndirectTransfer', async () => {
|
|
7
|
-
const sourceId = 'source-id';
|
|
8
|
-
const destinationId = 'destination-id';
|
|
9
|
-
const indirectTransfer = IndirectTransfer.parseFromCallSession(new CallSession({
|
|
10
|
-
callId: sourceId,
|
|
11
|
-
} as any), new CallSession({
|
|
12
|
-
callId: destinationId,
|
|
13
|
-
} as any));
|
|
14
|
-
expect(indirectTransfer).toEqual({
|
|
15
|
-
sourceId,
|
|
16
|
-
destinationId,
|
|
17
|
-
});
|
|
18
|
-
});
|
|
19
|
-
});
|
|
20
|
-
describe('on check destination', () => {
|
|
21
|
-
it('should match when destination is the same', async () => {
|
|
22
|
-
const destinationId = 'destination-id';
|
|
23
|
-
const indirectTransfer = new IndirectTransfer({
|
|
24
|
-
sourceId: 'some-id',
|
|
25
|
-
destinationId,
|
|
26
|
-
});
|
|
27
|
-
const isDestination = indirectTransfer.destinationIs(new CallSession({
|
|
28
|
-
callId: destinationId,
|
|
29
|
-
} as any));
|
|
30
|
-
expect(isDestination).toBeTruthy();
|
|
31
|
-
});
|
|
32
|
-
it('should NOT match when destination is the different', async () => {
|
|
33
|
-
const destinationId = 'destination-id';
|
|
34
|
-
const indirectTransfer = new IndirectTransfer({
|
|
35
|
-
sourceId: 'some-id',
|
|
36
|
-
destinationId: 'some-other-id',
|
|
37
|
-
});
|
|
38
|
-
const isDestination = indirectTransfer.destinationIs(new CallSession({
|
|
39
|
-
callId: destinationId,
|
|
40
|
-
} as any));
|
|
41
|
-
expect(isDestination).toBeFalsy();
|
|
42
|
-
});
|
|
43
|
-
});
|
|
44
|
-
describe('on check source', () => {
|
|
45
|
-
it('should match when source is the same', async () => {
|
|
46
|
-
const sourceId = 'source-id';
|
|
47
|
-
const indirectTransfer = new IndirectTransfer({
|
|
48
|
-
destinationId: 'some-id',
|
|
49
|
-
sourceId,
|
|
50
|
-
});
|
|
51
|
-
const isSource = indirectTransfer.sourceIs(new CallSession({
|
|
52
|
-
callId: sourceId,
|
|
53
|
-
} as any));
|
|
54
|
-
expect(isSource).toBeTruthy();
|
|
55
|
-
});
|
|
56
|
-
it('should NOT match when source is the different', async () => {
|
|
57
|
-
const sourceId = 'source-id';
|
|
58
|
-
const indirectTransfer = new IndirectTransfer({
|
|
59
|
-
sourceId: 'some-id',
|
|
60
|
-
destinationId: 'some-other-id',
|
|
61
|
-
});
|
|
62
|
-
const isSource = indirectTransfer.sourceIs(new CallSession({
|
|
63
|
-
callId: sourceId,
|
|
64
|
-
} as any));
|
|
65
|
-
expect(isSource).toBeFalsy();
|
|
66
|
-
});
|
|
67
|
-
});
|
|
68
|
-
});
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
import Line from '../Line';
|
|
2
|
-
|
|
3
|
-
describe('Line domain', () => {
|
|
4
|
-
it('can parse a plain line to domain', () => {
|
|
5
|
-
const response = {
|
|
6
|
-
id: 8,
|
|
7
|
-
endpoint_sip: {
|
|
8
|
-
id: 19,
|
|
9
|
-
username: 'ipcor1pj',
|
|
10
|
-
links: [{
|
|
11
|
-
href: 'https://stack.example.com/api/confd/1.1/endpoints/sip/19',
|
|
12
|
-
rel: 'endpoint_sip',
|
|
13
|
-
}],
|
|
14
|
-
},
|
|
15
|
-
endpoint_sccp: null,
|
|
16
|
-
endpoint_custom: null,
|
|
17
|
-
extensions: [{
|
|
18
|
-
id: 59,
|
|
19
|
-
exten: '8020',
|
|
20
|
-
context: 'default',
|
|
21
|
-
links: [{
|
|
22
|
-
href: 'https://stack.example.com/api/confd/1.1/extensions/59',
|
|
23
|
-
rel: 'extensions',
|
|
24
|
-
}],
|
|
25
|
-
}],
|
|
26
|
-
links: [{
|
|
27
|
-
href: 'https://stack.example.com/api/confd/1.1/lines/8',
|
|
28
|
-
rel: 'lines',
|
|
29
|
-
}],
|
|
30
|
-
};
|
|
31
|
-
const line = Line.parse(response);
|
|
32
|
-
expect(line).toEqual(new Line({
|
|
33
|
-
id: 8,
|
|
34
|
-
extensions: [{
|
|
35
|
-
id: 59,
|
|
36
|
-
exten: '8020',
|
|
37
|
-
context: 'default',
|
|
38
|
-
links: [{
|
|
39
|
-
href: 'https://stack.example.com/api/confd/1.1/extensions/59',
|
|
40
|
-
rel: 'extensions',
|
|
41
|
-
}],
|
|
42
|
-
}],
|
|
43
|
-
endpointSip: {
|
|
44
|
-
id: 19,
|
|
45
|
-
links: [{
|
|
46
|
-
href: 'https://stack.example.com/api/confd/1.1/endpoints/sip/19',
|
|
47
|
-
rel: 'endpoint_sip',
|
|
48
|
-
}],
|
|
49
|
-
username: 'ipcor1pj',
|
|
50
|
-
},
|
|
51
|
-
}));
|
|
52
|
-
});
|
|
53
|
-
});
|
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
import moment from 'moment';
|
|
2
|
-
import Meeting from '../Meeting';
|
|
3
|
-
|
|
4
|
-
const rawCreationTime = '2021-12-21T15:56:42.880Z';
|
|
5
|
-
describe('Meeting domain', () => {
|
|
6
|
-
it('should retain its values when parsed', () => {
|
|
7
|
-
const args = {
|
|
8
|
-
guest_sip_authorization: 'some-guest-sip-authorization',
|
|
9
|
-
ingress_http_uri: 'some-uri',
|
|
10
|
-
name: 'some-name',
|
|
11
|
-
owner_uuids: ['some-owner-uuid'],
|
|
12
|
-
port: 'some-port',
|
|
13
|
-
uuid: 'some-uuid',
|
|
14
|
-
exten: 'some-exten',
|
|
15
|
-
persistent: true,
|
|
16
|
-
creation_time: rawCreationTime,
|
|
17
|
-
require_authorization: true,
|
|
18
|
-
};
|
|
19
|
-
const meeting = Meeting.parse(args);
|
|
20
|
-
const {
|
|
21
|
-
uri,
|
|
22
|
-
uuid,
|
|
23
|
-
name,
|
|
24
|
-
port,
|
|
25
|
-
extension,
|
|
26
|
-
persistent,
|
|
27
|
-
ownerUuids,
|
|
28
|
-
creationTime,
|
|
29
|
-
requireAuthorization,
|
|
30
|
-
} = meeting;
|
|
31
|
-
expect(uri).toEqual(args.ingress_http_uri);
|
|
32
|
-
expect(uuid).toEqual(args.uuid);
|
|
33
|
-
expect(name).toEqual(args.name);
|
|
34
|
-
expect(port).toEqual(args.port);
|
|
35
|
-
expect(extension).toEqual(args.exten);
|
|
36
|
-
expect(persistent).toEqual(args.persistent);
|
|
37
|
-
expect(ownerUuids).toEqual(args.owner_uuids);
|
|
38
|
-
expect(creationTime).toEqual(moment(rawCreationTime).toDate());
|
|
39
|
-
expect(requireAuthorization).toEqual(args.require_authorization);
|
|
40
|
-
});
|
|
41
|
-
it('should retain its values when instantiated', () => {
|
|
42
|
-
const keys = ['uuid', 'name', 'guestSipAuthorization', 'ownerUuids', 'port', 'uri', 'extension', 'persistent', 'creationTime', 'requireAuthorization'];
|
|
43
|
-
const args = keys.reduce((acc: any, key) => {
|
|
44
|
-
acc[key] = `some-${key}`;
|
|
45
|
-
return acc;
|
|
46
|
-
}, {});
|
|
47
|
-
const meeting = new Meeting(args) as any;
|
|
48
|
-
keys.forEach(key => expect(meeting[key]).toEqual(`some-${key}`));
|
|
49
|
-
});
|
|
50
|
-
it('can return username and secret from an base64 encrypted string', () => {
|
|
51
|
-
const USERNAME = 'username';
|
|
52
|
-
const SECRET = 'secret';
|
|
53
|
-
const args = {
|
|
54
|
-
guest_sip_authorization: Buffer.from(`${USERNAME}:${SECRET}`).toString('base64'),
|
|
55
|
-
creation_time: '',
|
|
56
|
-
ingress_http_uri: '',
|
|
57
|
-
name: '',
|
|
58
|
-
owner_uuids: [],
|
|
59
|
-
port: '',
|
|
60
|
-
uuid: '',
|
|
61
|
-
exten: '',
|
|
62
|
-
persistent: false,
|
|
63
|
-
require_authorization: false,
|
|
64
|
-
};
|
|
65
|
-
const meeting = Meeting.parse(args);
|
|
66
|
-
const {
|
|
67
|
-
username,
|
|
68
|
-
secret,
|
|
69
|
-
} = meeting.getGuestSipCredentials();
|
|
70
|
-
expect(username).toEqual(USERNAME);
|
|
71
|
-
expect(secret).toEqual(SECRET);
|
|
72
|
-
});
|
|
73
|
-
it('should return a date from a string', () => {
|
|
74
|
-
const args = {
|
|
75
|
-
creation_time: rawCreationTime,
|
|
76
|
-
guest_sip_authorization: '',
|
|
77
|
-
ingress_http_uri: '',
|
|
78
|
-
name: '',
|
|
79
|
-
owner_uuids: [],
|
|
80
|
-
port: '',
|
|
81
|
-
uuid: '',
|
|
82
|
-
exten: '',
|
|
83
|
-
persistent: false,
|
|
84
|
-
require_authorization: false,
|
|
85
|
-
};
|
|
86
|
-
const {
|
|
87
|
-
creationTime,
|
|
88
|
-
} = Meeting.parse(args);
|
|
89
|
-
expect(creationTime.getDate()).toEqual(21);
|
|
90
|
-
expect(creationTime.getFullYear()).toEqual(2021);
|
|
91
|
-
expect(creationTime.getMonth()).toEqual(11);
|
|
92
|
-
});
|
|
93
|
-
});
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import MeetingAuthorization from '../MeetingAuthorization';
|
|
2
|
-
|
|
3
|
-
describe('MeetingAuthorization', () => {
|
|
4
|
-
describe('parse', () => {
|
|
5
|
-
it('should parse a raw input', () => {
|
|
6
|
-
const rawAuthorization = {
|
|
7
|
-
created_at: 'today',
|
|
8
|
-
meeting_uuid: 'meeting_uuid',
|
|
9
|
-
uuid: 'uuid',
|
|
10
|
-
guest_uuid: 'guest_uuid',
|
|
11
|
-
guest_name: 'guest_name',
|
|
12
|
-
};
|
|
13
|
-
const authorization = {
|
|
14
|
-
meetingUuid: rawAuthorization.meeting_uuid,
|
|
15
|
-
uuid: rawAuthorization.uuid,
|
|
16
|
-
userUuid: rawAuthorization.guest_uuid,
|
|
17
|
-
userName: rawAuthorization.guest_name,
|
|
18
|
-
status: undefined,
|
|
19
|
-
};
|
|
20
|
-
const response = MeetingAuthorization.parse(rawAuthorization);
|
|
21
|
-
expect(response).toEqual(authorization);
|
|
22
|
-
});
|
|
23
|
-
});
|
|
24
|
-
describe('parseMany', () => {
|
|
25
|
-
it('should parse multiple raw inputs', () => {
|
|
26
|
-
const rawAuthorizations = [{
|
|
27
|
-
created_at: 'today1',
|
|
28
|
-
meeting_uuid: 'meeting_uuid1',
|
|
29
|
-
uuid: 'uuid1',
|
|
30
|
-
guest_uuid: 'guest_uuid1',
|
|
31
|
-
guest_name: 'guest_name1',
|
|
32
|
-
}, {
|
|
33
|
-
created_at: 'today2',
|
|
34
|
-
meeting_uuid: 'meeting_uuid2',
|
|
35
|
-
uuid: 'uuid2',
|
|
36
|
-
guest_uuid: 'guest_uuid2',
|
|
37
|
-
guest_name: 'guest_name2',
|
|
38
|
-
}];
|
|
39
|
-
const authorizations = rawAuthorizations.map(rawAuthorization => ({
|
|
40
|
-
meetingUuid: rawAuthorization.meeting_uuid,
|
|
41
|
-
uuid: rawAuthorization.uuid,
|
|
42
|
-
userUuid: rawAuthorization.guest_uuid,
|
|
43
|
-
userName: rawAuthorization.guest_name,
|
|
44
|
-
status: undefined,
|
|
45
|
-
}));
|
|
46
|
-
const response = MeetingAuthorization.parseMany(rawAuthorizations);
|
|
47
|
-
expect(response).toEqual(authorizations);
|
|
48
|
-
});
|
|
49
|
-
});
|
|
50
|
-
});
|