@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/src/api/auth.ts
DELETED
|
@@ -1,305 +0,0 @@
|
|
|
1
|
-
import ApiRequester from '../utils/api-requester';
|
|
2
|
-
import type { User, Tenant, Token, UUID, LogoutResponse, ListTenantsResponse, ListUsersResponse, ListGroupsResponse, ListPoliciesResponse, GetTenantResponse, GetUserResponse } from '../domain/types';
|
|
3
|
-
import Session, { Response } from '../domain/Session';
|
|
4
|
-
|
|
5
|
-
export const DEFAULT_BACKEND_USER = 'wazo_user';
|
|
6
|
-
export const BACKEND_LDAP_USER = 'ldap_user';
|
|
7
|
-
export const DETAULT_EXPIRATION = 3600;
|
|
8
|
-
|
|
9
|
-
type LoginParams = {
|
|
10
|
-
username: string;
|
|
11
|
-
password: string;
|
|
12
|
-
backend?: string;
|
|
13
|
-
expiration: number;
|
|
14
|
-
mobile?: boolean;
|
|
15
|
-
tenantId?: string;
|
|
16
|
-
domainName?: string;
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
type SamlLoginBody = {
|
|
20
|
-
saml_session_id: string,
|
|
21
|
-
access_type?: 'online' | 'offline';
|
|
22
|
-
client_id?: string;
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
type SendResetPasswordArgs = {
|
|
26
|
-
username?: string,
|
|
27
|
-
email?: string,
|
|
28
|
-
};
|
|
29
|
-
|
|
30
|
-
export interface AuthD {
|
|
31
|
-
checkToken: (token: Token) => Promise<boolean>;
|
|
32
|
-
authenticate: (token: Token) => Promise<Session | null | undefined>;
|
|
33
|
-
logIn(params: LoginParams): Promise<Session | null | undefined> ;
|
|
34
|
-
logOut: (token: Token) => Promise<LogoutResponse>;
|
|
35
|
-
samlLogIn: (samlSessionId: string) => Promise<Session | null | undefined>;
|
|
36
|
-
samlLogOut: () => Promise<void | { location:string }>;
|
|
37
|
-
initiateIdpAuthentication(domain: string, redirectUrl: string): Promise<any>;
|
|
38
|
-
refreshToken: (refreshToken: string, backend: string, expiration: number, isMobile?: boolean, tenantId?: string, domainName?: string) => Promise<Session | null | undefined>;
|
|
39
|
-
deleteRefreshToken: (clientId: string) => Promise<boolean>;
|
|
40
|
-
updatePassword: (userUuid: UUID, oldPassword: string, newPassword: string) => Promise<boolean>;
|
|
41
|
-
sendDeviceToken: (userUuid: UUID, deviceToken: string, apnsVoipToken: string | null | undefined, apnsNotificationToken: string | null | undefined) => Promise<void>;
|
|
42
|
-
getPushNotificationSenderId: (userUuid: UUID) => Promise<string>;
|
|
43
|
-
sendResetPasswordEmail: (params: SendResetPasswordArgs) => Promise<boolean>;
|
|
44
|
-
resetPassword: (userUuid: string, password: string) => Promise<boolean>;
|
|
45
|
-
removeDeviceToken: (userUuid: UUID) => Promise<void>;
|
|
46
|
-
createUser: (username: string, password: string, firstname: string, lastname: string) => Promise<User>;
|
|
47
|
-
addUserEmail: (userUuid: UUID, email: string, main?: boolean) => Promise<void>;
|
|
48
|
-
addUserPolicy: (userUuid: UUID, policyUuid: UUID) => Promise<void>;
|
|
49
|
-
getRestrictionPolicies: (scopes: string[]) => Promise<any>;
|
|
50
|
-
deleteUserPolicy: (userUuid: UUID, policyUuid: UUID) => Promise<any>;
|
|
51
|
-
addUserGroup: (userUuid: UUID, groupUuid: UUID) => Promise<any>;
|
|
52
|
-
listUsersGroup: (groupUuid: UUID) => Promise<any>;
|
|
53
|
-
deleteUserGroup: (userUuid: UUID, groupUuid: UUID) => Promise<void>;
|
|
54
|
-
getUser: (userUuid: UUID) => Promise<GetUserResponse>;
|
|
55
|
-
getUserSession: (userUuid: UUID) => Promise<any>; // @TODO
|
|
56
|
-
deleteUserSession: (userUuid: UUID, sessionUuids: UUID) => Promise<void>;
|
|
57
|
-
listUsers: () => Promise<ListUsersResponse>;
|
|
58
|
-
deleteUser: (userUuid: UUID) => Promise<boolean>;
|
|
59
|
-
listTenants: () => Promise<ListTenantsResponse>;
|
|
60
|
-
getTenant: (tenantUuid: UUID) => Promise<GetTenantResponse>;
|
|
61
|
-
createTenant: (name: string) => Promise<Tenant>;
|
|
62
|
-
updateTenant: (uuid: UUID, name: string, contact: string, phone: string, address: Array<Record<string, any>>) => Promise<Tenant>;
|
|
63
|
-
deleteTenant: (uuid: UUID) => Promise<boolean>;
|
|
64
|
-
createGroup: (name: string) => Promise<void>;
|
|
65
|
-
listGroups: () => Promise<ListGroupsResponse>;
|
|
66
|
-
deleteGroup: (uuid: UUID) => Promise<boolean>;
|
|
67
|
-
createPolicy: (name: string, description: string, aclTemplates: Array<Record<string, any>>) => Promise<void>;
|
|
68
|
-
listPolicies: () => Promise<ListPoliciesResponse>;
|
|
69
|
-
deletePolicy: (policyUuid: UUID) => Promise<boolean>;
|
|
70
|
-
getProviders: (userUuid: UUID) => Promise<any>; // @TODO
|
|
71
|
-
getProviderToken: (userUuid: UUID, provider: string) => Promise<string>; // @TODO; validate
|
|
72
|
-
getProviderAuthUrl: (userUuid: UUID, provider: string) => Promise<string>;
|
|
73
|
-
deleteProviderToken: (userUuid: UUID, provider: string) => Promise<void>;
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
export default ((client: ApiRequester, baseUrl: string): AuthD => ({
|
|
77
|
-
checkToken: (token: Token): Promise<boolean> => client.head(`${baseUrl}/token/${token}`, null, {}),
|
|
78
|
-
authenticate: (token: Token): Promise<Session | null | undefined> => client.get(`${baseUrl}/token/${token}`, null, {}).then((response: Response) => Session.parse(response)),
|
|
79
|
-
|
|
80
|
-
logIn(params: {
|
|
81
|
-
username: string;
|
|
82
|
-
password: string;
|
|
83
|
-
backend: string;
|
|
84
|
-
expiration: number;
|
|
85
|
-
mobile?: boolean;
|
|
86
|
-
tenantId?: string;
|
|
87
|
-
domainName?: string;
|
|
88
|
-
}): Promise<Session | null | undefined> {
|
|
89
|
-
const body: Record<string, any> = {
|
|
90
|
-
backend: params.backend || DEFAULT_BACKEND_USER,
|
|
91
|
-
expiration: params.expiration || DETAULT_EXPIRATION,
|
|
92
|
-
};
|
|
93
|
-
const headers: Record<string, any> = {
|
|
94
|
-
Authorization: `Basic ${ApiRequester.base64Encode(`${params.username}:${params.password}`)}`,
|
|
95
|
-
'Content-Type': 'application/json',
|
|
96
|
-
};
|
|
97
|
-
|
|
98
|
-
if (client.clientId) {
|
|
99
|
-
body.access_type = 'offline';
|
|
100
|
-
body.client_id = client.clientId;
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
if (params.mobile) {
|
|
104
|
-
headers['Wazo-Session-Type'] = 'mobile';
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
if (params.tenantId) {
|
|
108
|
-
console.warn('Use of `tenantId` is deprecated when calling logIn() method, use `domainName` instead.');
|
|
109
|
-
body.tenant_id = params.tenantId;
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
if (params.domainName) {
|
|
113
|
-
body.domain_name = params.domainName;
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
return client.post(`${baseUrl}/token`, body, headers).then((response: Response) => Session.parse(response));
|
|
117
|
-
},
|
|
118
|
-
|
|
119
|
-
logOut: (token: Token): Promise<LogoutResponse> => client.delete(`${baseUrl}/token/${token}`, null, {}, ApiRequester.successResponseParser),
|
|
120
|
-
|
|
121
|
-
samlLogIn: async (samlSessionId: string): Promise<Session | null | undefined> => {
|
|
122
|
-
const headers: Record<string, any> = {
|
|
123
|
-
Accept: 'application/json',
|
|
124
|
-
'Content-Type': 'application/json',
|
|
125
|
-
};
|
|
126
|
-
|
|
127
|
-
const body: SamlLoginBody = {
|
|
128
|
-
saml_session_id: samlSessionId,
|
|
129
|
-
};
|
|
130
|
-
|
|
131
|
-
if (client.clientId) {
|
|
132
|
-
body.access_type = 'offline';
|
|
133
|
-
body.client_id = client.clientId;
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
if (Wazo.Auth.mobile) {
|
|
137
|
-
headers['Wazo-Session-Type'] = 'mobile';
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
return client.post(`${baseUrl}/token`, body, headers).then(Session.parse);
|
|
141
|
-
},
|
|
142
|
-
|
|
143
|
-
samlLogOut() {
|
|
144
|
-
return client.get(`${baseUrl}/saml/logout`, null, null);
|
|
145
|
-
},
|
|
146
|
-
|
|
147
|
-
initiateIdpAuthentication: async (domain: string, redirectUrl: string) => {
|
|
148
|
-
const body = {
|
|
149
|
-
domain,
|
|
150
|
-
redirect_url: redirectUrl,
|
|
151
|
-
};
|
|
152
|
-
|
|
153
|
-
const headers = {
|
|
154
|
-
Accept: 'application/json',
|
|
155
|
-
'Content-Type': 'application/json',
|
|
156
|
-
};
|
|
157
|
-
|
|
158
|
-
return client.post(`${baseUrl}/saml/sso`, body, headers);
|
|
159
|
-
},
|
|
160
|
-
refreshToken: (refreshToken: string, backend: string, expiration: number, isMobile?: boolean, tenantId?: string, domainName?: string): Promise<Session | null | undefined> => {
|
|
161
|
-
const body: Record<string, any> = {
|
|
162
|
-
backend: backend || DEFAULT_BACKEND_USER,
|
|
163
|
-
expiration: expiration || DETAULT_EXPIRATION,
|
|
164
|
-
refresh_token: refreshToken,
|
|
165
|
-
client_id: client.clientId,
|
|
166
|
-
};
|
|
167
|
-
|
|
168
|
-
if (tenantId) {
|
|
169
|
-
console.warn('Use of `tenantId` is deprecated when calling refreshToken() method, use `domainName` instead.');
|
|
170
|
-
body.tenant_id = tenantId;
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
if (domainName) {
|
|
174
|
-
body.domain_name = domainName;
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
const headers: Record<string, any> = {
|
|
178
|
-
'Content-Type': 'application/json',
|
|
179
|
-
...(isMobile ? {
|
|
180
|
-
'Wazo-Session-Type': 'mobile',
|
|
181
|
-
} : {}),
|
|
182
|
-
};
|
|
183
|
-
return client.post(`${baseUrl}/token`, body, headers, ApiRequester.defaultParser, false).then(Session.parse);
|
|
184
|
-
},
|
|
185
|
-
deleteRefreshToken: (clientId: string): Promise<boolean> => client.delete(`${baseUrl}/users/me/tokens/${clientId}`, null, null, ApiRequester.successResponseParser),
|
|
186
|
-
updatePassword: (userUuid: UUID, oldPassword: string, newPassword: string): Promise<boolean> => {
|
|
187
|
-
const body = {
|
|
188
|
-
new_password: newPassword,
|
|
189
|
-
old_password: oldPassword,
|
|
190
|
-
};
|
|
191
|
-
return client.put(`${baseUrl}/users/${userUuid}/password`, body, null, ApiRequester.successResponseParser);
|
|
192
|
-
},
|
|
193
|
-
sendDeviceToken: (userUuid: UUID, deviceToken: string, apnsVoipToken: string | null | undefined, apnsNotificationToken: string | null | undefined) => {
|
|
194
|
-
const body: Record<string, any> = {
|
|
195
|
-
token: deviceToken,
|
|
196
|
-
};
|
|
197
|
-
|
|
198
|
-
if (apnsVoipToken) {
|
|
199
|
-
// Should be called `voip_token`, but we can't changed it to be retro-compatible
|
|
200
|
-
body.apns_token = apnsVoipToken;
|
|
201
|
-
body.apns_voip_token = apnsVoipToken;
|
|
202
|
-
}
|
|
203
|
-
|
|
204
|
-
if (apnsNotificationToken) {
|
|
205
|
-
body.apns_notification_token = apnsNotificationToken;
|
|
206
|
-
}
|
|
207
|
-
|
|
208
|
-
return client.post(`${baseUrl}/users/${userUuid}/external/mobile`, body);
|
|
209
|
-
},
|
|
210
|
-
getPushNotificationSenderId: (userUuid: UUID) => client.get(`${baseUrl}/users/${userUuid}/external/mobile/sender_id`, null).then((response: Record<string, any>) => response.sender_id),
|
|
211
|
-
|
|
212
|
-
/**
|
|
213
|
-
* `username` or `email` should be set.
|
|
214
|
-
*/
|
|
215
|
-
sendResetPasswordEmail: ({
|
|
216
|
-
username,
|
|
217
|
-
email,
|
|
218
|
-
}) => {
|
|
219
|
-
const body: any = {};
|
|
220
|
-
|
|
221
|
-
if (username) {
|
|
222
|
-
body.username = username;
|
|
223
|
-
}
|
|
224
|
-
|
|
225
|
-
if (email) {
|
|
226
|
-
body.email = email;
|
|
227
|
-
}
|
|
228
|
-
|
|
229
|
-
return client.get(`${baseUrl}/users/password/reset`, body, {}, ApiRequester.successResponseParser);
|
|
230
|
-
},
|
|
231
|
-
resetPassword: (userUuid: string, password: string) => {
|
|
232
|
-
const body = {
|
|
233
|
-
password,
|
|
234
|
-
};
|
|
235
|
-
return client.post(`${baseUrl}/users/password/reset?user_uuid=${userUuid}`, body, null, ApiRequester.successResponseParser);
|
|
236
|
-
},
|
|
237
|
-
removeDeviceToken: (userUuid: UUID) => client.delete(`${baseUrl}/users/${userUuid}/external/mobile`),
|
|
238
|
-
createUser: (username: string, password: string, firstname: string, lastname: string): Promise<User> => {
|
|
239
|
-
const body = {
|
|
240
|
-
username,
|
|
241
|
-
password,
|
|
242
|
-
firstname,
|
|
243
|
-
lastname,
|
|
244
|
-
};
|
|
245
|
-
return client.post(`${baseUrl}/users`, body);
|
|
246
|
-
},
|
|
247
|
-
addUserEmail: (userUuid: UUID, email: string, main?: boolean) => {
|
|
248
|
-
const body = {
|
|
249
|
-
emails: [{
|
|
250
|
-
address: email,
|
|
251
|
-
main,
|
|
252
|
-
}],
|
|
253
|
-
};
|
|
254
|
-
return client.put(`${baseUrl}/users/${userUuid}/emails`, body);
|
|
255
|
-
},
|
|
256
|
-
addUserPolicy: (userUuid: UUID, policyUuid: UUID) => client.put(`${baseUrl}/users/${userUuid}/policies/${policyUuid}`),
|
|
257
|
-
getRestrictionPolicies: (scopes: string[]) => client.post(`${baseUrl}/token/${client.token}/scopes/check`, {
|
|
258
|
-
scopes,
|
|
259
|
-
}),
|
|
260
|
-
deleteUserPolicy: (userUuid: UUID, policyUuid: UUID) => client.delete(`${baseUrl}/users/${userUuid}/policies/${policyUuid}`),
|
|
261
|
-
addUserGroup: (userUuid: UUID, groupUuid: UUID) => client.put(`${baseUrl}/groups/${groupUuid}/users/${userUuid}`),
|
|
262
|
-
listUsersGroup: (groupUuid: UUID) => client.get(`${baseUrl}/groups/${groupUuid}/users`),
|
|
263
|
-
deleteUserGroup: (userUuid: UUID, groupUuid: UUID) => client.delete(`${baseUrl}/groups/${groupUuid}/users/${userUuid}`),
|
|
264
|
-
getUser: (userUuid: UUID): Promise<GetUserResponse> => client.get(`${baseUrl}/users/${userUuid}`),
|
|
265
|
-
getUserSession: (userUuid: UUID) => client.get(`${baseUrl}/users/${userUuid}/sessions`),
|
|
266
|
-
deleteUserSession: (userUuid: UUID, sessionUuids: UUID) => client.delete(`${baseUrl}/users/${userUuid}/sessions/${sessionUuids}`),
|
|
267
|
-
listUsers: (): Promise<ListUsersResponse> => client.get(`${baseUrl}/users`),
|
|
268
|
-
deleteUser: (userUuid: UUID): Promise<boolean> => client.delete(`${baseUrl}/users/${userUuid}`),
|
|
269
|
-
listTenants: (): Promise<ListTenantsResponse> => client.get(`${baseUrl}/tenants`),
|
|
270
|
-
getTenant: (tenantUuid: UUID): Promise<GetTenantResponse> => client.get(`${baseUrl}/tenants/${tenantUuid}`),
|
|
271
|
-
createTenant: (name: string): Promise<Tenant> => client.post(`${baseUrl}/tenants`, {
|
|
272
|
-
name,
|
|
273
|
-
}),
|
|
274
|
-
updateTenant: (uuid: UUID, name: string, contact: string, phone: string, address: Array<Record<string, any>>): Promise<Tenant> => {
|
|
275
|
-
const body = {
|
|
276
|
-
name,
|
|
277
|
-
contact,
|
|
278
|
-
phone,
|
|
279
|
-
address,
|
|
280
|
-
};
|
|
281
|
-
return client.put(`${baseUrl}/tenants/${uuid}`, body);
|
|
282
|
-
},
|
|
283
|
-
deleteTenant: (uuid: UUID): Promise<boolean> => client.delete(`${baseUrl}/tenants/${uuid}`),
|
|
284
|
-
createGroup: (name: string) => client.post(`${baseUrl}/groups`, {
|
|
285
|
-
name,
|
|
286
|
-
}),
|
|
287
|
-
listGroups: (): Promise<ListGroupsResponse> => client.get(`${baseUrl}/groups`),
|
|
288
|
-
deleteGroup: (uuid: UUID): Promise<boolean> => client.delete(`${baseUrl}/groups/${uuid}`),
|
|
289
|
-
createPolicy: (name: string, description: string, aclTemplates: Array<Record<string, any>>) => {
|
|
290
|
-
const body = {
|
|
291
|
-
name,
|
|
292
|
-
description,
|
|
293
|
-
acl_templates: aclTemplates,
|
|
294
|
-
// deprecated
|
|
295
|
-
acl: aclTemplates,
|
|
296
|
-
};
|
|
297
|
-
return client.post(`${baseUrl}/policies`, body);
|
|
298
|
-
},
|
|
299
|
-
listPolicies: (): Promise<ListPoliciesResponse> => client.get(`${baseUrl}/policies`),
|
|
300
|
-
deletePolicy: (policyUuid: UUID): Promise<boolean> => client.delete(`${baseUrl}/policies/${policyUuid}`),
|
|
301
|
-
getProviders: (userUuid: UUID) => client.get(`${baseUrl}/users/${userUuid}/external`),
|
|
302
|
-
getProviderToken: (userUuid: UUID, provider: string) => client.get(`${baseUrl}/users/${userUuid}/external/${provider}`),
|
|
303
|
-
getProviderAuthUrl: (userUuid: UUID, provider: string) => client.post(`${baseUrl}/users/${userUuid}/external/${provider}`, {}),
|
|
304
|
-
deleteProviderToken: (userUuid: UUID, provider: string) => client.delete(`${baseUrl}/users/${userUuid}/external/${provider}`),
|
|
305
|
-
}));
|
package/src/api/call-logd.ts
DELETED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import ApiRequester from '../utils/api-requester';
|
|
2
|
-
import CallLog from '../domain/CallLog';
|
|
3
|
-
|
|
4
|
-
export interface CallLogD {
|
|
5
|
-
search: (search: string, limit?: number) => Promise<Array<CallLog>>;
|
|
6
|
-
searchBy: (field: string, value: string, limit?: number) => Promise<Array<CallLog>>;
|
|
7
|
-
listCallLogs: (offset?: number, limit?: number) => Promise<Array<CallLog>>;
|
|
8
|
-
listDistinctCallLogs: (offset: number, limit?: number, distinct?: string) => Promise<Array<CallLog>>;
|
|
9
|
-
listCallLogsFromDate: (from: Date, number: string) => Promise<Array<CallLog>>;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
export default ((client: ApiRequester, baseUrl: string): CallLogD => ({
|
|
13
|
-
search: (search: string, limit = 5): Promise<Array<CallLog>> => client.get(`${baseUrl}/users/me/cdr`, {
|
|
14
|
-
search,
|
|
15
|
-
limit,
|
|
16
|
-
}).then(CallLog.parseMany),
|
|
17
|
-
|
|
18
|
-
searchBy: (field: string, value: string, limit = 5): Promise<Array<CallLog>> => client.get(`${baseUrl}/users/me/cdr`, {
|
|
19
|
-
[field]: value,
|
|
20
|
-
limit,
|
|
21
|
-
}).then(CallLog.parseMany),
|
|
22
|
-
|
|
23
|
-
listCallLogs: (offset?: number, limit = 5): Promise<Array<CallLog>> => client.get(`${baseUrl}/users/me/cdr`, {
|
|
24
|
-
offset,
|
|
25
|
-
limit,
|
|
26
|
-
}).then(CallLog.parseMany),
|
|
27
|
-
|
|
28
|
-
listDistinctCallLogs: (offset: number, limit = 5, distinct = undefined): Promise<Array<CallLog>> => client.get(`${baseUrl}/users/me/cdr`, {
|
|
29
|
-
offset,
|
|
30
|
-
limit,
|
|
31
|
-
distinct,
|
|
32
|
-
}).then(CallLog.parseMany),
|
|
33
|
-
|
|
34
|
-
listCallLogsFromDate: (from: Date, number: string): Promise<Array<CallLog>> => client.get(`${baseUrl}/users/me/cdr`, {
|
|
35
|
-
from: from.toISOString(),
|
|
36
|
-
number,
|
|
37
|
-
}).then(CallLog.parseMany),
|
|
38
|
-
}));
|
package/src/api/calld.ts
DELETED
|
@@ -1,185 +0,0 @@
|
|
|
1
|
-
/* eslint-disable camelcase */
|
|
2
|
-
import ApiRequester from '../utils/api-requester';
|
|
3
|
-
import type { UUID } from '../domain/types';
|
|
4
|
-
import Relocation, { RelocationResponse } from '../domain/Relocation';
|
|
5
|
-
import ChatMessage, { ChatMessageListResponse } from '../domain/ChatMessage';
|
|
6
|
-
import Voicemail, { type VoicemailFolderType } from '../domain/Voicemail';
|
|
7
|
-
import Call, { CallResponse } from '../domain/Call';
|
|
8
|
-
import IndirectTransfer from '../domain/IndirectTransfer';
|
|
9
|
-
import MeetingStatus from '../domain/MeetingStatus';
|
|
10
|
-
|
|
11
|
-
type CallQuery = {
|
|
12
|
-
from_mobile: boolean;
|
|
13
|
-
extension: string;
|
|
14
|
-
line_id?: number;
|
|
15
|
-
all_lines?: boolean;
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
export interface CallD {
|
|
19
|
-
updatePresence: (presence: string) => Promise<boolean>;
|
|
20
|
-
listMessages: (participantUuid: UUID | null | undefined, limit?: number) => Promise<Array<ChatMessage>>;
|
|
21
|
-
sendMessage: (alias: string, msg: string, toUserId: string) => Promise<boolean>;
|
|
22
|
-
makeCall: (extension: string, fromMobile: boolean, lineId: number | null | undefined, allLines: boolean | null | undefined) => Promise<CallResponse>;
|
|
23
|
-
cancelCall: (callId: string) => Promise<boolean>;
|
|
24
|
-
listCalls: () => Promise<Array<Call>>;
|
|
25
|
-
relocateCall: (callId: string, destination: string, lineId: number | null | undefined, contact?: string | null | undefined) => Promise<Relocation>;
|
|
26
|
-
listVoicemails: () => Promise<Array<Voicemail>>;
|
|
27
|
-
deleteVoicemail: (voicemailId: string) => Promise<boolean>;
|
|
28
|
-
getVoicemailUrl: (voicemail: Voicemail) => string;
|
|
29
|
-
updateVoicemailFolder: (voicemail: Voicemail, folder: VoicemailFolderType) => Promise<void>;
|
|
30
|
-
fetchSwitchboardHeldCalls: (switchboardUuid: UUID) => Promise<any>; // @TODO: replace `any`
|
|
31
|
-
holdSwitchboardCall: (switchboardUuid: UUID, callId: string) => Promise<boolean>;
|
|
32
|
-
answerSwitchboardHeldCall: (switchboardUuid: UUID, callId: string, lineId: string | null | undefined) => Promise<void>;
|
|
33
|
-
fetchSwitchboardQueuedCalls: (switchboardUuid: UUID) => Promise<any>; // @TODO: replace `any`
|
|
34
|
-
answerSwitchboardQueuedCall: (switchboardUuid: UUID, callId: string, lineId: string | null | undefined) => Promise<any>; // @TODO: replace `any`
|
|
35
|
-
sendFax: (extension: string, fax: string, callerId?: string) => Promise<void>;
|
|
36
|
-
getConferenceParticipantsAsUser: (conferenceId: string) => Promise<Record<string, any>>; // @TODO: replace `any`
|
|
37
|
-
getMeetingParticipantsAsUser: (meetingUuid: string) => Promise<Record<string, any>>; // @TODO: replace `any`
|
|
38
|
-
banMeetingParticipant: (meetingUuid: string, participantUuid: string) => Promise<boolean>;
|
|
39
|
-
listTrunks: () => Promise<any>;
|
|
40
|
-
mute: (callId: string) => Promise<boolean>;
|
|
41
|
-
unmute: (callId: string) => Promise<boolean>;
|
|
42
|
-
hold: (callId: string) => Promise<boolean>;
|
|
43
|
-
resume: (callId: string) => Promise<boolean>;
|
|
44
|
-
// eslint-disable-next-line camelcase
|
|
45
|
-
transferCall: (initiator_call: string, exten: string, flow: string) => Promise<IndirectTransfer>;
|
|
46
|
-
confirmCallTransfer: (transferId: string) => Promise<boolean>;
|
|
47
|
-
cancelCallTransfer: (transferId: string) => Promise<boolean>;
|
|
48
|
-
sendDTMF: (callId: string, digits: string) => Promise<boolean>;
|
|
49
|
-
// @deprecated: check for engine version >= 20.12 instead
|
|
50
|
-
isAhHocConferenceAPIEnabled: () => Promise<boolean>;
|
|
51
|
-
createAdHocConference: (hostCallId: string, participantCallIds: string[]) => Promise<any>; // @TODO: replace `any`
|
|
52
|
-
addAdHocConferenceParticipant: (conferenceId: string, callId: string) => Promise<boolean>;
|
|
53
|
-
removeAdHocConferenceParticipant: (conferenceId: string, participantCallId: string) => Promise<boolean>;
|
|
54
|
-
deleteAdHocConference: (conferenceId: string) => Promise<boolean>;
|
|
55
|
-
startRecording: (callId: string) => Promise<boolean>;
|
|
56
|
-
stopRecording: (callId: string) => Promise<boolean>;
|
|
57
|
-
pauseRecording: (callId: string) => Promise<boolean>;
|
|
58
|
-
resumeRecording: (callId: string) => Promise<boolean>;
|
|
59
|
-
guestGetMeetingStatus: (meetingUuid: string) => Promise<MeetingStatus>
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
export default ((client: ApiRequester, baseUrl: string): CallD => ({
|
|
63
|
-
updatePresence: (presence: string): Promise<boolean> => client.put(`${baseUrl}/users/me/presences`, {
|
|
64
|
-
presence,
|
|
65
|
-
}, null, ApiRequester.successResponseParser),
|
|
66
|
-
listMessages: (participantUuid: UUID | null | undefined, limit?: number): Promise<Array<ChatMessage>> => {
|
|
67
|
-
const query: Record<string, any> = {};
|
|
68
|
-
|
|
69
|
-
if (participantUuid) {
|
|
70
|
-
query.participant_user_uuid = participantUuid;
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
if (limit) {
|
|
74
|
-
query.limit = limit;
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
return client.get(`${baseUrl}/users/me/chats`, query).then((response: ChatMessageListResponse) => ChatMessage.parseMany(response));
|
|
78
|
-
},
|
|
79
|
-
sendMessage: (alias: string, msg: string, toUserId: string) => {
|
|
80
|
-
const body = {
|
|
81
|
-
alias,
|
|
82
|
-
msg,
|
|
83
|
-
to: toUserId,
|
|
84
|
-
};
|
|
85
|
-
return client.post(`${baseUrl}/users/me/chats`, body, null, ApiRequester.successResponseParser);
|
|
86
|
-
},
|
|
87
|
-
makeCall: (extension: string, fromMobile: boolean, lineId: number | null | undefined, allLines: boolean | null | undefined = false): Promise<CallResponse> => {
|
|
88
|
-
const query: CallQuery = {
|
|
89
|
-
from_mobile: fromMobile,
|
|
90
|
-
extension,
|
|
91
|
-
};
|
|
92
|
-
|
|
93
|
-
if (lineId) {
|
|
94
|
-
query.line_id = lineId;
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
if (allLines) {
|
|
98
|
-
query.all_lines = true;
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
return client.post(`${baseUrl}/users/me/calls`, query);
|
|
102
|
-
},
|
|
103
|
-
cancelCall: (callId: string): Promise<boolean> => client.delete(`${baseUrl}/users/me/calls/${callId}`, null),
|
|
104
|
-
listCalls: (): Promise<Array<Call>> => client.get(`${baseUrl}/users/me/calls`, null).then((response: any) => Call.parseMany(response.items)),
|
|
105
|
-
|
|
106
|
-
relocateCall(callId: string, destination: string, lineId: number | null | undefined, contact?: string | null | undefined): Promise<Relocation> {
|
|
107
|
-
const body: Record<string, any> = {
|
|
108
|
-
completions: ['answer'],
|
|
109
|
-
destination,
|
|
110
|
-
initiator_call: callId,
|
|
111
|
-
auto_answer: true,
|
|
112
|
-
};
|
|
113
|
-
|
|
114
|
-
if (lineId || contact) {
|
|
115
|
-
body.location = {};
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
if (lineId) {
|
|
119
|
-
body.location.line_id = lineId;
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
if (contact) {
|
|
123
|
-
body.location.contact = contact;
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
return client.post(`${baseUrl}/users/me/relocates`, body).then((response: RelocationResponse) => Relocation.parse(response));
|
|
127
|
-
},
|
|
128
|
-
|
|
129
|
-
listVoicemails: (): Promise<Array<Voicemail>> => client.get(`${baseUrl}/users/me/voicemails`).then((response: any) => Voicemail.parseMany(response)),
|
|
130
|
-
deleteVoicemail: (voicemailId: string): Promise<boolean> => client.delete(`${baseUrl}/users/me/voicemails/messages/${voicemailId}`),
|
|
131
|
-
getVoicemailUrl: (voicemail: Voicemail): string => {
|
|
132
|
-
const body = {
|
|
133
|
-
token: client.token,
|
|
134
|
-
};
|
|
135
|
-
return client.computeUrl('get', `${baseUrl}/users/me/voicemails/messages/${voicemail.id}/recording`, body);
|
|
136
|
-
},
|
|
137
|
-
updateVoicemailFolder: (voicemail: Voicemail, folder: VoicemailFolderType) => client.put(`${baseUrl}/users/me/voicemails/messages/${voicemail.id}`, { folder_id: Voicemail.getFolderMappingFromType(folder) }, null, ApiRequester.successResponseParser),
|
|
138
|
-
fetchSwitchboardHeldCalls: (switchboardUuid: UUID) => client.get(`${baseUrl}/switchboards/${switchboardUuid}/calls/held`),
|
|
139
|
-
holdSwitchboardCall: (switchboardUuid: UUID, callId: string) => client.put(`${baseUrl}/switchboards/${switchboardUuid}/calls/held/${callId}`, null, null, ApiRequester.successResponseParser),
|
|
140
|
-
answerSwitchboardHeldCall: (switchboardUuid: UUID, callId: string, lineId: string | null | undefined = null) => client.put(`${baseUrl}/switchboards/${switchboardUuid}/calls/held/${callId}/answer${lineId ? `?line_id=${lineId}` : ''}`),
|
|
141
|
-
fetchSwitchboardQueuedCalls: (switchboardUuid: UUID) => client.get(`${baseUrl}/switchboards/${switchboardUuid}/calls/queued`),
|
|
142
|
-
answerSwitchboardQueuedCall: (switchboardUuid: UUID, callId: string, lineId: string | null | undefined = null) => client.put(`${baseUrl}/switchboards/${switchboardUuid}/calls/queued/${callId}/answer${lineId ? `?line_id=${lineId}` : ''}`),
|
|
143
|
-
sendFax: (extension: string, fax: string, callerId?: string) => {
|
|
144
|
-
const headers = {
|
|
145
|
-
'Content-type': 'application/pdf',
|
|
146
|
-
'X-Auth-Token': client.token,
|
|
147
|
-
};
|
|
148
|
-
const params = ApiRequester.getQueryString({
|
|
149
|
-
extension,
|
|
150
|
-
caller_id: callerId,
|
|
151
|
-
});
|
|
152
|
-
return client.post(`${baseUrl}/users/me/faxes?${params}`, fax, headers);
|
|
153
|
-
},
|
|
154
|
-
getConferenceParticipantsAsUser: async (conferenceId: string): Promise<Record<string, any>> => client.get(`${baseUrl}/users/me/conferences/${conferenceId}/participants`),
|
|
155
|
-
getMeetingParticipantsAsUser: async (meetingUuid: string): Promise<Record<string, any>> => client.get(`${baseUrl}/users/me/meetings/${meetingUuid}/participants`),
|
|
156
|
-
banMeetingParticipant: (meetingUuid: string, participantUuid: string) => client.delete(`${baseUrl}/users/me/meetings/${meetingUuid}/participants/${participantUuid}`, null, null, ApiRequester.successResponseParser),
|
|
157
|
-
listTrunks: () => client.get(`${baseUrl}/trunks`),
|
|
158
|
-
mute: (callId: string) => client.put(`${baseUrl}/users/me/calls/${callId}/mute/start`, null, null, ApiRequester.successResponseParser),
|
|
159
|
-
unmute: (callId: string) => client.put(`${baseUrl}/users/me/calls/${callId}/mute/stop`, null, null, ApiRequester.successResponseParser),
|
|
160
|
-
hold: (callId: string) => client.put(`${baseUrl}/users/me/calls/${callId}/hold/start`, null, null, ApiRequester.successResponseParser),
|
|
161
|
-
resume: (callId: string) => client.put(`${baseUrl}/users/me/calls/${callId}/hold/stop`, null, null, ApiRequester.successResponseParser),
|
|
162
|
-
// eslint-disable-next-line camelcase
|
|
163
|
-
transferCall: (initiator_call: string, exten: string, flow: string) => client.post(`${baseUrl}/users/me/transfers`, {
|
|
164
|
-
initiator_call,
|
|
165
|
-
exten,
|
|
166
|
-
flow,
|
|
167
|
-
}).then(IndirectTransfer.parseFromApi),
|
|
168
|
-
confirmCallTransfer: (transferId: string): Promise<boolean> => client.put(`${baseUrl}/users/me/transfers/${transferId}/complete`, null, null, ApiRequester.successResponseParser),
|
|
169
|
-
cancelCallTransfer: (transferId: string): Promise<boolean> => client.delete(`${baseUrl}/users/me/transfers/${transferId}`, null, null, ApiRequester.successResponseParser),
|
|
170
|
-
sendDTMF: (callId: string, digits: string) => client.put(`${baseUrl}/users/me/calls/${callId}/dtmf?digits=${encodeURIComponent(digits)}`, null, null, ApiRequester.successResponseParser),
|
|
171
|
-
// @deprecated: check for engine version >= 20.12 instead
|
|
172
|
-
isAhHocConferenceAPIEnabled: () => client.head(`${baseUrl}/users/me/conferences/adhoc`, null, null, ApiRequester.successResponseParser),
|
|
173
|
-
createAdHocConference: (hostCallId: string, participantCallIds: string[]) => client.post(`${baseUrl}/users/me/conferences/adhoc`, {
|
|
174
|
-
host_call_id: hostCallId,
|
|
175
|
-
participant_call_ids: participantCallIds,
|
|
176
|
-
}),
|
|
177
|
-
addAdHocConferenceParticipant: (conferenceId: string, callId: string) => client.put(`${baseUrl}/users/me/conferences/adhoc/${conferenceId}/participants/${callId}`, null, null, ApiRequester.successResponseParser),
|
|
178
|
-
removeAdHocConferenceParticipant: (conferenceId: string, participantCallId: string) => client.delete(`${baseUrl}/users/me/conferences/adhoc/${conferenceId}/participants/${participantCallId}`, null, null, ApiRequester.successResponseParser),
|
|
179
|
-
deleteAdHocConference: (conferenceId: string) => client.delete(`${baseUrl}/users/me/conferences/adhoc/${conferenceId}`, null, null, ApiRequester.successResponseParser),
|
|
180
|
-
startRecording: (callId: string) => client.put(`${baseUrl}/users/me/calls/${callId}/record/start`, null, null, ApiRequester.successResponseParser),
|
|
181
|
-
stopRecording: (callId: string) => client.put(`${baseUrl}/users/me/calls/${callId}/record/stop`, null, null, ApiRequester.successResponseParser),
|
|
182
|
-
pauseRecording: (callId: string) => client.put(`${baseUrl}/users/me/calls/${callId}/record/pause`, null, null, ApiRequester.successResponseParser),
|
|
183
|
-
resumeRecording: (callId: string) => client.put(`${baseUrl}/users/me/calls/${callId}/record/resume`, null, null, ApiRequester.successResponseParser),
|
|
184
|
-
guestGetMeetingStatus: (meetingUuid: string): Promise<MeetingStatus> => client.get(`${baseUrl}/guests/me/meetings/${meetingUuid}/status`).then(MeetingStatus.parse),
|
|
185
|
-
}));
|
package/src/api/chatd.ts
DELETED
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
import ApiRequester from '../utils/api-requester';
|
|
2
|
-
import type { PresenceResponse, UUID } from '../domain/types';
|
|
3
|
-
import Profile from '../domain/Profile';
|
|
4
|
-
import ChatRoom from '../domain/ChatRoom';
|
|
5
|
-
import type { ChatUser, ChatMessageListResponse } from '../domain/ChatMessage';
|
|
6
|
-
import ChatMessage from '../domain/ChatMessage';
|
|
7
|
-
|
|
8
|
-
type PresenceListResponse = {
|
|
9
|
-
filtered: number;
|
|
10
|
-
total: number;
|
|
11
|
-
items: Array<PresenceResponse>;
|
|
12
|
-
};
|
|
13
|
-
type GetMessagesOptions = {
|
|
14
|
-
direction?: string;
|
|
15
|
-
limit?: number;
|
|
16
|
-
order?: string;
|
|
17
|
-
offset?: string;
|
|
18
|
-
search?: string;
|
|
19
|
-
distinct?: string;
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
export interface ChatD {
|
|
23
|
-
updateState: (contactUuid: UUID, state: string) => Promise<boolean>;
|
|
24
|
-
updateStatus: (contactUuid: UUID, state: string, status: string) => Promise<boolean>;
|
|
25
|
-
getState: (contactUuid: UUID) => Promise<string>;
|
|
26
|
-
getContactStatusInfo: (contactUuid: UUID) => Promise<PresenceResponse>;
|
|
27
|
-
getLineState: (contactUuid: UUID) => Promise<string>;
|
|
28
|
-
getMultipleLineState: (contactUuids: Array<UUID> | null | undefined) => Promise<Array<PresenceResponse>>;
|
|
29
|
-
getUserRooms: () => Promise<Array<ChatRoom>>;
|
|
30
|
-
createRoom: (name: string, users: Array<ChatUser>) => Promise<ChatRoom>;
|
|
31
|
-
getRoomMessages: (roomUuid: string, params?: GetMessagesOptions) => Promise<Array<ChatMessage>>;
|
|
32
|
-
sendRoomMessage: (roomUuid: string, message: ChatMessage) => Promise<ChatMessage>;
|
|
33
|
-
getMessages: (options: GetMessagesOptions) => Promise<ChatMessageListResponse>;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
// split contact status retrieval to avoid `414 Request-URI Too Large`.
|
|
37
|
-
const MAX_PRESENCE_FETCHED = 30;
|
|
38
|
-
|
|
39
|
-
export default ((client: ApiRequester, baseUrl: string): ChatD => ({
|
|
40
|
-
updateState: (contactUuid: UUID, state: string): Promise<boolean> => client.put(`${baseUrl}/users/${contactUuid}/presences`, {
|
|
41
|
-
state,
|
|
42
|
-
}, null, ApiRequester.successResponseParser),
|
|
43
|
-
updateStatus: (contactUuid: UUID, state: string, status: string): Promise<boolean> => {
|
|
44
|
-
const body = {
|
|
45
|
-
state,
|
|
46
|
-
status,
|
|
47
|
-
};
|
|
48
|
-
return client.put(`${baseUrl}/users/${contactUuid}/presences`, body, null, ApiRequester.successResponseParser);
|
|
49
|
-
},
|
|
50
|
-
getState: async (contactUuid: UUID): Promise<string> => client.get(`${baseUrl}/users/${contactUuid}/presences`).then((response: PresenceResponse) => response.state),
|
|
51
|
-
getContactStatusInfo: async (contactUuid: UUID): Promise<PresenceResponse> => client.get(`${baseUrl}/users/${contactUuid}/presences`).then((response: PresenceResponse) => response),
|
|
52
|
-
getLineState: async (contactUuid: UUID): Promise<string> => client.get(`${baseUrl}/users/${contactUuid}/presences`).then((response: PresenceResponse) => Profile.getLinesState(response.lines)),
|
|
53
|
-
async getMultipleLineState(contactUuids: Array<UUID> | null | undefined): Promise<Array<PresenceResponse>> {
|
|
54
|
-
const body: any = {};
|
|
55
|
-
const uuids: Array<UUID> = contactUuids || [];
|
|
56
|
-
|
|
57
|
-
if (uuids.length > MAX_PRESENCE_FETCHED) {
|
|
58
|
-
const requests = uuids.reduce((acc: Promise<PresenceResponse[]>[], _, i) => {
|
|
59
|
-
if (i % MAX_PRESENCE_FETCHED === 0) {
|
|
60
|
-
acc.push(this.getMultipleLineState(uuids.slice(i, i + MAX_PRESENCE_FETCHED)));
|
|
61
|
-
}
|
|
62
|
-
return acc;
|
|
63
|
-
}, []);
|
|
64
|
-
|
|
65
|
-
const splittedStatuses = await Promise.all(requests);
|
|
66
|
-
|
|
67
|
-
return splittedStatuses.flat();
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
if (uuids.length) {
|
|
71
|
-
body.user_uuid = uuids.join(',');
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
return client.get(`${baseUrl}/users/presences`, body).then((response: PresenceListResponse) => response.items);
|
|
75
|
-
},
|
|
76
|
-
getUserRooms: async (): Promise<Array<ChatRoom>> => client.get(`${baseUrl}/users/me/rooms`).then(ChatRoom.parseMany),
|
|
77
|
-
createRoom: async (name: string, users: Array<ChatUser>): Promise<ChatRoom> => client.post(`${baseUrl}/users/me/rooms`, {
|
|
78
|
-
name,
|
|
79
|
-
users,
|
|
80
|
-
}).then(ChatRoom.parse),
|
|
81
|
-
getRoomMessages: async (roomUuid: string, params?: GetMessagesOptions): Promise<Array<ChatMessage>> => {
|
|
82
|
-
const qs = ApiRequester.getQueryString(params || {});
|
|
83
|
-
return client.get(`${baseUrl}/users/me/rooms/${roomUuid}/messages${qs.length ? `?${qs}` : ''}`).then((response: ChatMessageListResponse) => ChatMessage.parseMany(response));
|
|
84
|
-
},
|
|
85
|
-
sendRoomMessage: async (roomUuid: string, message: ChatMessage): Promise<ChatMessage> => client.post(`${baseUrl}/users/me/rooms/${roomUuid}/messages`, message).then(ChatMessage.parse),
|
|
86
|
-
getMessages: async (options: GetMessagesOptions): Promise<ChatMessageListResponse> => client.get(`${baseUrl}/users/me/rooms/messages`, options),
|
|
87
|
-
}));
|