@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
package/esm/domain/Contact.js
DELETED
|
@@ -1,464 +0,0 @@
|
|
|
1
|
-
import { LINE_STATE, STATE } from './Profile';
|
|
2
|
-
import newFrom from '../utils/new-from';
|
|
3
|
-
export const BACKEND = {
|
|
4
|
-
OFFICE365: 'office365',
|
|
5
|
-
PERSONAL: 'personal',
|
|
6
|
-
GOOGLE: 'google',
|
|
7
|
-
WAZO: 'wazo',
|
|
8
|
-
CONFERENCE: 'conference',
|
|
9
|
-
PHONEBOOK: 'phonebook',
|
|
10
|
-
};
|
|
11
|
-
const SOURCE_MOBILE = 'mobile';
|
|
12
|
-
export default class Contact {
|
|
13
|
-
static BACKEND = BACKEND;
|
|
14
|
-
type;
|
|
15
|
-
id;
|
|
16
|
-
uuid;
|
|
17
|
-
name;
|
|
18
|
-
firstName;
|
|
19
|
-
lastName;
|
|
20
|
-
number;
|
|
21
|
-
numbers;
|
|
22
|
-
favorited;
|
|
23
|
-
email;
|
|
24
|
-
emails;
|
|
25
|
-
entreprise;
|
|
26
|
-
birthday;
|
|
27
|
-
address;
|
|
28
|
-
note;
|
|
29
|
-
endpointId;
|
|
30
|
-
personal;
|
|
31
|
-
state;
|
|
32
|
-
lineState;
|
|
33
|
-
previousPresential;
|
|
34
|
-
lastActivity;
|
|
35
|
-
mobile;
|
|
36
|
-
source;
|
|
37
|
-
sourceId;
|
|
38
|
-
status;
|
|
39
|
-
backend;
|
|
40
|
-
personalStatus;
|
|
41
|
-
sessions;
|
|
42
|
-
connected;
|
|
43
|
-
doNotDisturb;
|
|
44
|
-
ringing;
|
|
45
|
-
lines;
|
|
46
|
-
static merge(oldContacts, newContacts) {
|
|
47
|
-
return newContacts.map(current => {
|
|
48
|
-
const old = oldContacts.find(contact => contact && contact.is(current));
|
|
49
|
-
return old ? current.merge(old) : current;
|
|
50
|
-
});
|
|
51
|
-
}
|
|
52
|
-
static sortContacts(a, b) {
|
|
53
|
-
const aNames = a.separateName();
|
|
54
|
-
const bNames = b.separateName();
|
|
55
|
-
const aLastName = aNames.lastName;
|
|
56
|
-
const bLastName = bNames.lastName;
|
|
57
|
-
// last Name can be empty
|
|
58
|
-
if (aLastName === bLastName) {
|
|
59
|
-
return aNames.firstName.localeCompare(bNames.firstName);
|
|
60
|
-
}
|
|
61
|
-
return aLastName.localeCompare(bLastName);
|
|
62
|
-
}
|
|
63
|
-
static parseMany(response, offset = 0, limit = null) {
|
|
64
|
-
if (!response || !response.results || limit === 0) {
|
|
65
|
-
return [];
|
|
66
|
-
}
|
|
67
|
-
const results = limit !== null && limit > 0 ? response.results.slice(offset, limit) : offset > 0 ? response.results.slice(offset) : response.results;
|
|
68
|
-
return results.map(r => Contact.parse(r, response.column_types));
|
|
69
|
-
}
|
|
70
|
-
static manyGraphQlWithNumbersParser(numbers) {
|
|
71
|
-
return (response) => {
|
|
72
|
-
if (!response.data || !response.data.me || !response.data.me.contacts) {
|
|
73
|
-
return [];
|
|
74
|
-
}
|
|
75
|
-
return response.data.me.contacts.edges.map((edge, i) => {
|
|
76
|
-
if (!edge.node) {
|
|
77
|
-
return null;
|
|
78
|
-
}
|
|
79
|
-
const { email, } = edge.node;
|
|
80
|
-
const name = edge.node.firstname && edge.node.lastname ? `${edge.node.firstname || ''} ${edge.node.lastname || ''}` : edge.node.wazoReverse;
|
|
81
|
-
return new Contact({
|
|
82
|
-
name,
|
|
83
|
-
firstName: edge.node.firstname,
|
|
84
|
-
lastName: edge.node.lastname,
|
|
85
|
-
number: numbers[i],
|
|
86
|
-
numbers: [{
|
|
87
|
-
label: 'primary',
|
|
88
|
-
number: numbers[i],
|
|
89
|
-
}],
|
|
90
|
-
backend: edge.node.wazoBackend,
|
|
91
|
-
source: edge.node.wazoSourceName,
|
|
92
|
-
sourceId: edge.node.wazoSourceEntryId || '',
|
|
93
|
-
email: email || '',
|
|
94
|
-
emails: email ? [{
|
|
95
|
-
label: 'primary',
|
|
96
|
-
email,
|
|
97
|
-
}] : [],
|
|
98
|
-
uuid: edge.node.userUuid,
|
|
99
|
-
});
|
|
100
|
-
}).filter(contact => !!contact);
|
|
101
|
-
};
|
|
102
|
-
}
|
|
103
|
-
static fetchNumbers(plain, columns) {
|
|
104
|
-
const numberColumns = columns.map((e, index) => ({
|
|
105
|
-
index,
|
|
106
|
-
columnName: e,
|
|
107
|
-
})).filter(e => e.columnName === 'number' || e.columnName === 'callable').map(e => e.index);
|
|
108
|
-
return plain.column_values.filter((e, index) => numberColumns.some(i => i === index) && e !== null);
|
|
109
|
-
}
|
|
110
|
-
static parse(plain, columns) {
|
|
111
|
-
const numbers = Contact.fetchNumbers(plain, columns);
|
|
112
|
-
const email = plain.column_values[columns.indexOf('email')];
|
|
113
|
-
return new Contact({
|
|
114
|
-
name: plain.column_values[columns.indexOf('name')],
|
|
115
|
-
firstName: plain.column_values[columns.indexOf('firstname')],
|
|
116
|
-
lastName: plain.column_values[columns.indexOf('lastname')],
|
|
117
|
-
number: numbers.length ? numbers[0] : '',
|
|
118
|
-
numbers: numbers.map((number, i) => ({
|
|
119
|
-
label: i === 0 ? 'primary' : 'secondary',
|
|
120
|
-
number,
|
|
121
|
-
})),
|
|
122
|
-
favorited: plain.column_values[columns.indexOf('favorite')],
|
|
123
|
-
email: email || '',
|
|
124
|
-
emails: email ? [{
|
|
125
|
-
label: 'primary',
|
|
126
|
-
email,
|
|
127
|
-
}] : [],
|
|
128
|
-
entreprise: plain.column_values[columns.indexOf('entreprise')] || '',
|
|
129
|
-
birthday: plain.column_values[columns.indexOf('birthday')] || '',
|
|
130
|
-
address: plain.column_values[columns.indexOf('address')] || '',
|
|
131
|
-
note: plain.column_values[columns.indexOf('note')] || '',
|
|
132
|
-
endpointId: plain.relations.endpoint_id,
|
|
133
|
-
personal: plain.column_values[columns.indexOf('personal')],
|
|
134
|
-
source: plain.source,
|
|
135
|
-
sourceId: plain.relations.source_entry_id || '',
|
|
136
|
-
uuid: plain.relations.user_uuid,
|
|
137
|
-
backend: plain.backend || '',
|
|
138
|
-
});
|
|
139
|
-
}
|
|
140
|
-
static parseManyPersonal(results) {
|
|
141
|
-
return results.map(r => Contact.parsePersonal(r));
|
|
142
|
-
}
|
|
143
|
-
static parsePersonal(plain) {
|
|
144
|
-
return new Contact({
|
|
145
|
-
name: `${plain.firstName || plain.firstname || ''} ${plain.lastName || plain.lastname || ''}`,
|
|
146
|
-
firstName: plain.firstName || plain.firstname,
|
|
147
|
-
lastName: plain.lastName || plain.lastname,
|
|
148
|
-
number: plain.number || '',
|
|
149
|
-
numbers: plain.number ? [{
|
|
150
|
-
label: 'primary',
|
|
151
|
-
number: plain.number,
|
|
152
|
-
}] : [],
|
|
153
|
-
email: plain.email || '',
|
|
154
|
-
emails: plain.email ? [{
|
|
155
|
-
label: 'primary',
|
|
156
|
-
email: plain.email,
|
|
157
|
-
}] : [],
|
|
158
|
-
source: 'personal',
|
|
159
|
-
sourceId: plain.id || '',
|
|
160
|
-
entreprise: plain.entreprise || '',
|
|
161
|
-
birthday: plain.birthday || '',
|
|
162
|
-
address: plain.address || '',
|
|
163
|
-
note: plain.note || '',
|
|
164
|
-
favorited: plain.favorited,
|
|
165
|
-
personal: true,
|
|
166
|
-
backend: plain.backend || BACKEND.PERSONAL,
|
|
167
|
-
});
|
|
168
|
-
}
|
|
169
|
-
static parseMobile(plain) {
|
|
170
|
-
let address = '';
|
|
171
|
-
if (plain.postalAddresses.length) {
|
|
172
|
-
const postalAddress = plain.postalAddresses[0];
|
|
173
|
-
address = `${postalAddress.street} ${postalAddress.city} ${postalAddress.postCode} ${postalAddress.country}`;
|
|
174
|
-
}
|
|
175
|
-
const firstName = plain.givenName || '';
|
|
176
|
-
const lastName = plain.familyName || '';
|
|
177
|
-
const companyName = plain.company || '';
|
|
178
|
-
const isCompanyAccount = !firstName && !lastName;
|
|
179
|
-
const name = isCompanyAccount ? companyName : `${firstName} ${lastName}`;
|
|
180
|
-
return new Contact({
|
|
181
|
-
name,
|
|
182
|
-
firstName,
|
|
183
|
-
lastName,
|
|
184
|
-
number: plain.phoneNumbers.length ? plain.phoneNumbers[0].number : '',
|
|
185
|
-
// Make numbers unique
|
|
186
|
-
numbers: [...new Map(plain.phoneNumbers.map(item => [item.number, item])).values()].map((item, idx) => ({
|
|
187
|
-
label: idx === 0 ? 'primary' : 'secondary',
|
|
188
|
-
number: item.number,
|
|
189
|
-
})),
|
|
190
|
-
email: plain.emailAddresses.length ? plain.emailAddresses[0].email : '',
|
|
191
|
-
emails: plain.emailAddresses.length ? [{
|
|
192
|
-
label: 'primary',
|
|
193
|
-
email: plain.emailAddresses[0].email,
|
|
194
|
-
}] : [],
|
|
195
|
-
source: SOURCE_MOBILE,
|
|
196
|
-
sourceId: plain.recordID || '',
|
|
197
|
-
birthday: plain.birthday ? `${plain.birthday.year}-${plain.birthday.month}-${plain.birthday.day}` : '',
|
|
198
|
-
address,
|
|
199
|
-
note: plain.note || '',
|
|
200
|
-
favorited: false,
|
|
201
|
-
personal: true,
|
|
202
|
-
});
|
|
203
|
-
}
|
|
204
|
-
static parseManyOffice365(response, source) {
|
|
205
|
-
return response.map(r => Contact.parseOffice365(r, source));
|
|
206
|
-
}
|
|
207
|
-
static parseOffice365(single, source) {
|
|
208
|
-
const emails = [];
|
|
209
|
-
const numbers = [];
|
|
210
|
-
if (single.emailAddresses) {
|
|
211
|
-
single.emailAddresses.map(email => emails.push({
|
|
212
|
-
email: email.address,
|
|
213
|
-
}));
|
|
214
|
-
}
|
|
215
|
-
if (single.businessPhones) {
|
|
216
|
-
single.businessPhones.map(phone => numbers.push({
|
|
217
|
-
label: 'business',
|
|
218
|
-
number: phone,
|
|
219
|
-
}));
|
|
220
|
-
}
|
|
221
|
-
if (single.mobilePhone) {
|
|
222
|
-
numbers.push({
|
|
223
|
-
label: 'mobile',
|
|
224
|
-
number: single.mobilePhone,
|
|
225
|
-
});
|
|
226
|
-
}
|
|
227
|
-
if (single.homePhones) {
|
|
228
|
-
single.homePhones.map(phone => numbers.push({
|
|
229
|
-
label: 'home',
|
|
230
|
-
number: phone,
|
|
231
|
-
}));
|
|
232
|
-
}
|
|
233
|
-
return new Contact({
|
|
234
|
-
sourceId: single.id || '',
|
|
235
|
-
name: single.displayName || '',
|
|
236
|
-
firstName: single.givenName,
|
|
237
|
-
lastName: single.surname,
|
|
238
|
-
number: numbers.length ? numbers[0].number : '',
|
|
239
|
-
numbers,
|
|
240
|
-
emails,
|
|
241
|
-
source: source.name,
|
|
242
|
-
backend: BACKEND.OFFICE365,
|
|
243
|
-
});
|
|
244
|
-
}
|
|
245
|
-
static parseManyGoogle(response, source) {
|
|
246
|
-
return response.map(r => Contact.parseGoogle(r, source));
|
|
247
|
-
}
|
|
248
|
-
static parseGoogle(single, source) {
|
|
249
|
-
const emails = [];
|
|
250
|
-
const numbers = [];
|
|
251
|
-
if (single.emails) {
|
|
252
|
-
single.emails.forEach((email) => (typeof email === 'object' ? {
|
|
253
|
-
email: email.address,
|
|
254
|
-
label: email.label,
|
|
255
|
-
} : {
|
|
256
|
-
email,
|
|
257
|
-
}));
|
|
258
|
-
}
|
|
259
|
-
if (single.numbers_by_label) {
|
|
260
|
-
Object.keys(single.numbers_by_label).forEach(label => numbers.push({
|
|
261
|
-
label,
|
|
262
|
-
number: single.numbers_by_label[label],
|
|
263
|
-
}));
|
|
264
|
-
}
|
|
265
|
-
else if (single.numbers) {
|
|
266
|
-
single.numbers.forEach(phone => numbers.push({
|
|
267
|
-
number: phone,
|
|
268
|
-
}));
|
|
269
|
-
}
|
|
270
|
-
return new Contact({
|
|
271
|
-
sourceId: single.id || '',
|
|
272
|
-
name: single.name || '',
|
|
273
|
-
firstName: single.lastname || '',
|
|
274
|
-
lastName: single.firstname || '',
|
|
275
|
-
number: numbers.length ? numbers[0].number : '',
|
|
276
|
-
numbers,
|
|
277
|
-
emails,
|
|
278
|
-
source: source.name,
|
|
279
|
-
backend: BACKEND.GOOGLE,
|
|
280
|
-
});
|
|
281
|
-
}
|
|
282
|
-
static parseManyWazo(response, source) {
|
|
283
|
-
return response.map(r => Contact.parseWazo(r, source));
|
|
284
|
-
}
|
|
285
|
-
static parseWazo(single, source) {
|
|
286
|
-
const emails = [];
|
|
287
|
-
const numbers = [];
|
|
288
|
-
if (single.email) {
|
|
289
|
-
emails.push({
|
|
290
|
-
label: 'email',
|
|
291
|
-
email: single.email,
|
|
292
|
-
});
|
|
293
|
-
}
|
|
294
|
-
if (single.exten) {
|
|
295
|
-
numbers.push({
|
|
296
|
-
label: 'exten',
|
|
297
|
-
number: single.exten,
|
|
298
|
-
});
|
|
299
|
-
}
|
|
300
|
-
if (single.mobile_phone_number) {
|
|
301
|
-
numbers.push({
|
|
302
|
-
label: 'mobile',
|
|
303
|
-
number: single.mobile_phone_number,
|
|
304
|
-
});
|
|
305
|
-
}
|
|
306
|
-
return new Contact({
|
|
307
|
-
uuid: single.uuid,
|
|
308
|
-
sourceId: String(single.id) || '',
|
|
309
|
-
name: `${single.firstname}${single.lastname ? ` ${single.lastname}` : ''}`,
|
|
310
|
-
firstName: single.firstname,
|
|
311
|
-
lastName: single.lastname,
|
|
312
|
-
number: numbers.length ? numbers[0].number : '',
|
|
313
|
-
numbers,
|
|
314
|
-
emails,
|
|
315
|
-
source: source.name,
|
|
316
|
-
backend: BACKEND.WAZO,
|
|
317
|
-
});
|
|
318
|
-
}
|
|
319
|
-
static parseManyConference(response, source) {
|
|
320
|
-
return response.map(r => Contact.parseConference(r, source));
|
|
321
|
-
}
|
|
322
|
-
static parseConference(single, source) {
|
|
323
|
-
const numbers = [];
|
|
324
|
-
let firstNumber = '';
|
|
325
|
-
if (single && single.extensions && single.extensions.length > 0 && single.extensions[0].exten) {
|
|
326
|
-
firstNumber = single.extensions[0].exten;
|
|
327
|
-
numbers.push({
|
|
328
|
-
label: 'exten',
|
|
329
|
-
number: firstNumber,
|
|
330
|
-
});
|
|
331
|
-
}
|
|
332
|
-
return new Contact({
|
|
333
|
-
sourceId: String(single.id),
|
|
334
|
-
name: single.name,
|
|
335
|
-
number: firstNumber,
|
|
336
|
-
numbers,
|
|
337
|
-
source: source.name,
|
|
338
|
-
backend: BACKEND.CONFERENCE,
|
|
339
|
-
});
|
|
340
|
-
}
|
|
341
|
-
static newFrom(contact) {
|
|
342
|
-
return newFrom(contact, Contact);
|
|
343
|
-
}
|
|
344
|
-
constructor({ id, uuid, name, firstName, lastName, number, numbers, email, emails, source, sourceId, entreprise, birthday, address, note, state, lineState, lastActivity, mobile, status, endpointId, personal, favorited, backend, personalStatus, sessions, connected, doNotDisturb, ringing, previousPresential, lines, } = {}) {
|
|
345
|
-
this.id = id;
|
|
346
|
-
this.uuid = uuid;
|
|
347
|
-
this.name = name || '';
|
|
348
|
-
this.firstName = firstName || '';
|
|
349
|
-
this.lastName = lastName || '';
|
|
350
|
-
this.number = number;
|
|
351
|
-
this.numbers = numbers;
|
|
352
|
-
this.email = email;
|
|
353
|
-
this.emails = emails;
|
|
354
|
-
this.source = source;
|
|
355
|
-
this.sourceId = sourceId;
|
|
356
|
-
this.entreprise = entreprise;
|
|
357
|
-
this.birthday = birthday;
|
|
358
|
-
this.address = address;
|
|
359
|
-
this.note = note;
|
|
360
|
-
this.state = state;
|
|
361
|
-
this.lineState = lineState;
|
|
362
|
-
this.lastActivity = lastActivity;
|
|
363
|
-
this.mobile = mobile;
|
|
364
|
-
this.status = status;
|
|
365
|
-
this.endpointId = endpointId;
|
|
366
|
-
this.personal = personal;
|
|
367
|
-
this.favorited = favorited;
|
|
368
|
-
this.backend = backend;
|
|
369
|
-
this.personalStatus = personalStatus || '';
|
|
370
|
-
this.sessions = sessions || [];
|
|
371
|
-
this.connected = connected;
|
|
372
|
-
this.doNotDisturb = doNotDisturb;
|
|
373
|
-
this.ringing = ringing;
|
|
374
|
-
this.previousPresential = previousPresential;
|
|
375
|
-
this.lines = lines || [];
|
|
376
|
-
// Useful to compare instead of instanceof with minified code
|
|
377
|
-
this.type = 'Contact';
|
|
378
|
-
}
|
|
379
|
-
setFavorite(value) {
|
|
380
|
-
this.favorited = value;
|
|
381
|
-
return this;
|
|
382
|
-
}
|
|
383
|
-
is(other) {
|
|
384
|
-
const sameSourceId = this.sourceId !== null && other.sourceId !== null && this.sourceId === other.sourceId;
|
|
385
|
-
const sameUuid = !!this.uuid && !!other.uuid && this.uuid === other.uuid;
|
|
386
|
-
const hasSameId = sameSourceId || sameUuid;
|
|
387
|
-
const hasSameBackend = !!this.backend && !!other.backend && this.backend === other.backend;
|
|
388
|
-
const hasSameSource = !!this.source && !!other.source && this.source === other.source;
|
|
389
|
-
return !!other && hasSameId && hasSameBackend && hasSameSource;
|
|
390
|
-
}
|
|
391
|
-
hasId(id) {
|
|
392
|
-
return this.uuid === id;
|
|
393
|
-
}
|
|
394
|
-
hasNumber(number) {
|
|
395
|
-
return this.number === number;
|
|
396
|
-
}
|
|
397
|
-
hasEndpointId(endpointId) {
|
|
398
|
-
return this.endpointId === endpointId;
|
|
399
|
-
}
|
|
400
|
-
isAvailable() {
|
|
401
|
-
return this.state === STATE.AVAILABLE;
|
|
402
|
-
}
|
|
403
|
-
isAway() {
|
|
404
|
-
return this.state === STATE.AWAY;
|
|
405
|
-
}
|
|
406
|
-
isUnavailable() {
|
|
407
|
-
return this.state === STATE.UNAVAILABLE;
|
|
408
|
-
}
|
|
409
|
-
isInvisible() {
|
|
410
|
-
return this.state === STATE.INVISIBLE;
|
|
411
|
-
}
|
|
412
|
-
isInCall() {
|
|
413
|
-
return this.lineState === LINE_STATE.TALKING || this.lineState === LINE_STATE.HOLDING;
|
|
414
|
-
}
|
|
415
|
-
isRinging() {
|
|
416
|
-
return this.ringing;
|
|
417
|
-
}
|
|
418
|
-
isInUseOrRinging() {
|
|
419
|
-
return this.lineState === LINE_STATE.TALKING || this.lineState === LINE_STATE.RINGING;
|
|
420
|
-
}
|
|
421
|
-
isProgressing() {
|
|
422
|
-
return this.lineState === LINE_STATE.PROGRESSING;
|
|
423
|
-
}
|
|
424
|
-
merge(old) {
|
|
425
|
-
Object.keys(old).filter(key => key !== 'lineState').forEach(key => {
|
|
426
|
-
// @ts-ignore: keys
|
|
427
|
-
this[key] = old[key] || this[key];
|
|
428
|
-
});
|
|
429
|
-
if (old.lineState) {
|
|
430
|
-
this.lineState = old.lineState;
|
|
431
|
-
}
|
|
432
|
-
return this;
|
|
433
|
-
}
|
|
434
|
-
isIntern() {
|
|
435
|
-
return !!this.uuid;
|
|
436
|
-
}
|
|
437
|
-
hasSourceId() {
|
|
438
|
-
return !!this.sourceId;
|
|
439
|
-
}
|
|
440
|
-
isCallable(session) {
|
|
441
|
-
return !!this.number && !!session && !session.is(this);
|
|
442
|
-
}
|
|
443
|
-
isFromMobile() {
|
|
444
|
-
return this.source === SOURCE_MOBILE;
|
|
445
|
-
}
|
|
446
|
-
isFavorite() {
|
|
447
|
-
return this.favorited;
|
|
448
|
-
}
|
|
449
|
-
separateName() {
|
|
450
|
-
if (!this.name) {
|
|
451
|
-
return {
|
|
452
|
-
firstName: '',
|
|
453
|
-
lastName: '',
|
|
454
|
-
};
|
|
455
|
-
}
|
|
456
|
-
const names = this.name.split(/\s+/);
|
|
457
|
-
const firstName = names[0];
|
|
458
|
-
const lastName = names.slice(1).join(' ');
|
|
459
|
-
return {
|
|
460
|
-
firstName,
|
|
461
|
-
lastName,
|
|
462
|
-
};
|
|
463
|
-
}
|
|
464
|
-
}
|
package/esm/domain/Country.js
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
export default {
|
|
2
|
-
AUSTRALIA: 'AU',
|
|
3
|
-
BELGIUM: 'BE',
|
|
4
|
-
CANADA: 'CA',
|
|
5
|
-
FRANCE: 'FR',
|
|
6
|
-
GERMANY: 'DE',
|
|
7
|
-
ISRAEL: 'IL',
|
|
8
|
-
ITALY: 'IT',
|
|
9
|
-
LUXEMBOURG: 'LU',
|
|
10
|
-
MALAYSIA: 'MY',
|
|
11
|
-
MONACO: 'MC',
|
|
12
|
-
NETHERLANDS: 'NL',
|
|
13
|
-
POLAND: 'PL',
|
|
14
|
-
PORTUGAL: 'PT',
|
|
15
|
-
UNITED_KINGDOM: 'GB',
|
|
16
|
-
UNITED_STATES: 'US',
|
|
17
|
-
SPAIN: 'ES',
|
|
18
|
-
SWITZERLAND: 'CH',
|
|
19
|
-
};
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
export default class DebugDevice {
|
|
2
|
-
connectToCall() {
|
|
3
|
-
console.info('DebugDevice - Connected to call');
|
|
4
|
-
}
|
|
5
|
-
disconnectFromCall() {
|
|
6
|
-
console.info('DebugDevice - Disconnected from call');
|
|
7
|
-
}
|
|
8
|
-
ringback() {
|
|
9
|
-
console.info('DebugDevice - Ringback');
|
|
10
|
-
}
|
|
11
|
-
stopRingback() {
|
|
12
|
-
console.info('DebugDevice - Stop ringback');
|
|
13
|
-
}
|
|
14
|
-
playRingtone() {
|
|
15
|
-
console.info('DebugDevice - Play ringtone');
|
|
16
|
-
}
|
|
17
|
-
stopRingtone() {
|
|
18
|
-
console.info('DebugDevice - Stop ringtone');
|
|
19
|
-
}
|
|
20
|
-
mute() {
|
|
21
|
-
console.info('DebugDevice - Mute');
|
|
22
|
-
}
|
|
23
|
-
unmute() {
|
|
24
|
-
console.info('DebugDevice - Unmute');
|
|
25
|
-
}
|
|
26
|
-
putOnSpeaker() {
|
|
27
|
-
console.info('DebugDevice - Put on speaker');
|
|
28
|
-
}
|
|
29
|
-
putOffSpeaker() {
|
|
30
|
-
console.info('DebugDevice - Put off speaker');
|
|
31
|
-
}
|
|
32
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import newFrom from '../utils/new-from';
|
|
2
|
-
export default class ExternalApp {
|
|
3
|
-
name;
|
|
4
|
-
type;
|
|
5
|
-
configuration;
|
|
6
|
-
static parse(plain) {
|
|
7
|
-
return new ExternalApp({
|
|
8
|
-
name: plain.name,
|
|
9
|
-
configuration: plain.configuration,
|
|
10
|
-
});
|
|
11
|
-
}
|
|
12
|
-
static parseMany(plain) {
|
|
13
|
-
return plain.items.map(item => ExternalApp.parse(item));
|
|
14
|
-
}
|
|
15
|
-
static newFrom(profile) {
|
|
16
|
-
return newFrom(profile, ExternalApp);
|
|
17
|
-
}
|
|
18
|
-
constructor({ name, configuration, } = {}) {
|
|
19
|
-
this.name = name;
|
|
20
|
-
this.configuration = configuration;
|
|
21
|
-
// Useful to compare instead of instanceof with minified code
|
|
22
|
-
this.type = 'ExternalApp';
|
|
23
|
-
}
|
|
24
|
-
}
|
package/esm/domain/Features.js
DELETED
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
import getApiClient from '../service/getApiClient';
|
|
2
|
-
export const FEATURES = ['chat', 'video', 'call_recording', 'fax', 'mobile_double_call', 'mobile_gsm', 'meeting', 'caller_id'];
|
|
3
|
-
export const getScopeName = (featureName) => `enterprise.app.${featureName}`;
|
|
4
|
-
const scopesToCheck = FEATURES.map(getScopeName); // Handle available features on the engine.
|
|
5
|
-
class Features {
|
|
6
|
-
_hasChat;
|
|
7
|
-
_hasVideo;
|
|
8
|
-
_hasCallRecording;
|
|
9
|
-
_hasFax;
|
|
10
|
-
_hasMobileDoubleCall;
|
|
11
|
-
_hasMobileGsm;
|
|
12
|
-
_hasMeeting;
|
|
13
|
-
_hasCallerID;
|
|
14
|
-
constructor() {
|
|
15
|
-
this._hasChat = true;
|
|
16
|
-
this._hasVideo = true;
|
|
17
|
-
this._hasCallRecording = true;
|
|
18
|
-
this._hasFax = true;
|
|
19
|
-
this._hasMobileDoubleCall = true;
|
|
20
|
-
this._hasMobileGsm = true;
|
|
21
|
-
this._hasMeeting = true;
|
|
22
|
-
this._hasCallerID = false;
|
|
23
|
-
}
|
|
24
|
-
async fetchAccess() {
|
|
25
|
-
let response;
|
|
26
|
-
try {
|
|
27
|
-
response = await getApiClient().auth.getRestrictionPolicies(scopesToCheck);
|
|
28
|
-
}
|
|
29
|
-
catch (_) { // Noting to do because everything should be available even if the API is not available
|
|
30
|
-
}
|
|
31
|
-
if (!response) {
|
|
32
|
-
return;
|
|
33
|
-
}
|
|
34
|
-
const { scopes, } = response;
|
|
35
|
-
this._hasChat = this._hasFeatures(scopes, 'chat');
|
|
36
|
-
this._hasVideo = this._hasFeatures(scopes, 'video');
|
|
37
|
-
this._hasCallRecording = this._hasFeatures(scopes, 'call_recording');
|
|
38
|
-
this._hasFax = this._hasFeatures(scopes, 'fax');
|
|
39
|
-
this._hasMobileDoubleCall = this._hasFeatures(scopes, 'mobile_double_call');
|
|
40
|
-
this._hasMobileGsm = this._hasFeatures(scopes, 'mobile_gsm');
|
|
41
|
-
this._hasMeeting = this._hasFeatures(scopes, 'meeting');
|
|
42
|
-
this._hasCallerID = this._hasFeatures(scopes, 'caller_id');
|
|
43
|
-
}
|
|
44
|
-
hasChat() {
|
|
45
|
-
return this._hasChat;
|
|
46
|
-
}
|
|
47
|
-
hasVideo() {
|
|
48
|
-
return this._hasVideo;
|
|
49
|
-
}
|
|
50
|
-
hasCallRecording() {
|
|
51
|
-
return this._hasCallRecording;
|
|
52
|
-
}
|
|
53
|
-
hasFax() {
|
|
54
|
-
return this._hasFax;
|
|
55
|
-
}
|
|
56
|
-
hasMobileDoubleCall() {
|
|
57
|
-
return this._hasMobileDoubleCall;
|
|
58
|
-
}
|
|
59
|
-
hasMobileGsm() {
|
|
60
|
-
return this._hasMobileGsm;
|
|
61
|
-
}
|
|
62
|
-
hasMeeting() {
|
|
63
|
-
return this._hasMeeting;
|
|
64
|
-
}
|
|
65
|
-
hasCallerID() {
|
|
66
|
-
return this._hasCallerID;
|
|
67
|
-
}
|
|
68
|
-
_hasFeatures(scopes, featureName) {
|
|
69
|
-
const scopeName = getScopeName(featureName);
|
|
70
|
-
if (!scopes || !(scopeName in scopes)) {
|
|
71
|
-
// Assume that the feature is available if not present (available by default)
|
|
72
|
-
return true;
|
|
73
|
-
}
|
|
74
|
-
return scopes[scopeName] === true;
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
export default new Features();
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import newFrom from '../utils/new-from';
|
|
2
|
-
export const FORWARD_KEYS = {
|
|
3
|
-
BUSY: 'busy',
|
|
4
|
-
NO_ANSWER: 'noanswer',
|
|
5
|
-
UNCONDITIONAL: 'unconditional',
|
|
6
|
-
};
|
|
7
|
-
export default class ForwardOption {
|
|
8
|
-
destination;
|
|
9
|
-
enabled;
|
|
10
|
-
key;
|
|
11
|
-
static parse(plain, key) {
|
|
12
|
-
return new ForwardOption({
|
|
13
|
-
destination: plain.destination || '',
|
|
14
|
-
enabled: plain.enabled,
|
|
15
|
-
key,
|
|
16
|
-
});
|
|
17
|
-
}
|
|
18
|
-
static newFrom(profile) {
|
|
19
|
-
return newFrom(profile, ForwardOption);
|
|
20
|
-
}
|
|
21
|
-
constructor({ destination, enabled, key, } = {}) {
|
|
22
|
-
this.destination = destination;
|
|
23
|
-
this.enabled = enabled;
|
|
24
|
-
this.key = key;
|
|
25
|
-
}
|
|
26
|
-
setDestination(number) {
|
|
27
|
-
this.destination = number;
|
|
28
|
-
return this;
|
|
29
|
-
}
|
|
30
|
-
setEnabled(enabled) {
|
|
31
|
-
this.enabled = enabled;
|
|
32
|
-
return this;
|
|
33
|
-
}
|
|
34
|
-
is(other) {
|
|
35
|
-
return this.key === other.key;
|
|
36
|
-
}
|
|
37
|
-
}
|
package/esm/domain/Incall.js
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import newFrom from '../utils/new-from';
|
|
2
|
-
export default class Incall {
|
|
3
|
-
id;
|
|
4
|
-
extensions;
|
|
5
|
-
extension;
|
|
6
|
-
// Useful to compare instead of instanceof with minified code
|
|
7
|
-
type = 'Incall';
|
|
8
|
-
constructor({ id, extensions } = {}) {
|
|
9
|
-
this.id = id;
|
|
10
|
-
this.extensions = extensions;
|
|
11
|
-
this.extension = extensions?.[0]?.exten;
|
|
12
|
-
}
|
|
13
|
-
static parse(plain) {
|
|
14
|
-
return new Incall({
|
|
15
|
-
id: plain.id,
|
|
16
|
-
extensions: plain.extensions,
|
|
17
|
-
});
|
|
18
|
-
}
|
|
19
|
-
static newFrom(profile) {
|
|
20
|
-
return newFrom(profile, Incall);
|
|
21
|
-
}
|
|
22
|
-
hasExtension(extension) {
|
|
23
|
-
if (!this.extensions) {
|
|
24
|
-
return false;
|
|
25
|
-
}
|
|
26
|
-
return this.extensions.some(ext => ext.exten === extension);
|
|
27
|
-
}
|
|
28
|
-
}
|