@wazo/sdk 0.38.9 → 0.38.12
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/wazo-sdk.js +2 -2
- package/esm/__tests__/api-client.test.js +21 -0
- package/esm/__tests__/web-rtc-client.test.js +32 -7
- package/esm/api/auth.js +12 -0
- package/esm/api/ctid-ng.js +1 -0
- package/esm/api-client.js +21 -0
- package/esm/checker/Checker.js +32 -7
- package/esm/checker/checks/aor.js +21 -0
- package/esm/checker/checks/api.js +21 -0
- package/esm/checker/checks/index.js +32 -7
- package/esm/checker/checks/webrtc-transport.js +32 -7
- package/esm/checker/checks/webrtc.js +32 -7
- package/esm/domain/AdHocAPIConference.js +28 -2
- package/esm/domain/Features.js +28 -2
- package/esm/domain/Phone/CTIPhone.js +28 -2
- package/esm/domain/Phone/WebRTCPhone.js +3 -2
- package/esm/index.js +86 -15
- package/esm/service/CallApi.js +28 -2
- package/esm/service/getApiClient.js +34 -3
- package/esm/simple/Auth.js +87 -16
- package/esm/simple/Configuration.js +86 -15
- package/esm/simple/Directory.js +28 -2
- package/esm/simple/Phone.js +86 -15
- package/esm/simple/Softphone.js +5 -0
- package/esm/simple/index.js +86 -15
- package/esm/simple/room/LocalParticipant.js +86 -15
- package/esm/simple/room/Participant.js +86 -15
- package/esm/simple/room/RemoteParticipant.js +86 -15
- package/esm/simple/room/Room.js +86 -15
- package/esm/simple/room/SipRoom.js +86 -15
- package/esm/simple/room/Stream.js +86 -15
- package/esm/simple/room/__tests__/Participant.test.js +86 -15
- package/esm/simple/room/__tests__/RemoteParticipant.test.js +86 -15
- package/esm/simple/utils.js +86 -15
- package/esm/web-rtc-client.js +32 -7
- package/lib/__tests__/api-client.test.js +21 -0
- package/lib/__tests__/web-rtc-client.test.js +32 -7
- package/lib/api/auth.js +12 -0
- package/lib/api/ctid-ng.js +1 -0
- package/lib/api-client.js +21 -0
- package/lib/checker/Checker.js +32 -7
- package/lib/checker/checks/aor.js +21 -0
- package/lib/checker/checks/api.js +21 -0
- package/lib/checker/checks/index.js +32 -7
- package/lib/checker/checks/webrtc-transport.js +32 -7
- package/lib/checker/checks/webrtc.js +32 -7
- package/lib/domain/AdHocAPIConference.js +28 -2
- package/lib/domain/Features.js +28 -2
- package/lib/domain/Phone/CTIPhone.js +28 -2
- package/lib/domain/Phone/WebRTCPhone.js +3 -2
- package/lib/index.js +86 -15
- package/lib/service/CallApi.js +28 -2
- package/lib/service/getApiClient.js +34 -2
- package/lib/simple/Auth.js +87 -15
- package/lib/simple/Configuration.js +86 -15
- package/lib/simple/Directory.js +28 -2
- package/lib/simple/Phone.js +86 -15
- package/lib/simple/Softphone.js +5 -0
- package/lib/simple/index.js +86 -15
- package/lib/simple/room/LocalParticipant.js +86 -15
- package/lib/simple/room/Participant.js +86 -15
- package/lib/simple/room/RemoteParticipant.js +86 -15
- package/lib/simple/room/Room.js +86 -15
- package/lib/simple/room/SipRoom.js +86 -15
- package/lib/simple/room/Stream.js +86 -15
- package/lib/simple/room/__tests__/Participant.test.js +86 -15
- package/lib/simple/room/__tests__/RemoteParticipant.test.js +86 -15
- package/lib/simple/utils.js +86 -15
- package/lib/web-rtc-client.js +32 -7
- package/package.json +2 -2
- package/src/api/auth.js +12 -0
- package/src/api-client.js +8 -0
- package/src/domain/Phone/WebRTCPhone.js +2 -2
- package/src/service/getApiClient.js +13 -2
- package/src/simple/Auth.js +35 -4
- package/src/simple/Softphone.js +5 -0
- package/src/simple/index.js +2 -1
- package/src/web-rtc-client.js +11 -7
package/src/simple/Softphone.js
CHANGED
|
@@ -107,6 +107,7 @@ class Softphone {
|
|
|
107
107
|
wrapUpDuration,
|
|
108
108
|
enableAgent = true,
|
|
109
109
|
tenantId,
|
|
110
|
+
domainName,
|
|
110
111
|
debug = false,
|
|
111
112
|
}: Object = {}) {
|
|
112
113
|
this.url = url || 'https://softphone.wazo.io';
|
|
@@ -131,8 +132,12 @@ class Softphone {
|
|
|
131
132
|
config.port = port;
|
|
132
133
|
}
|
|
133
134
|
if (tenantId) {
|
|
135
|
+
console.warn('Use of `tenantId` is deprecated when calling `Softphone.init()`, use `domainName` instead');
|
|
134
136
|
config.tenantId = tenantId;
|
|
135
137
|
}
|
|
138
|
+
if (domainName) {
|
|
139
|
+
config.domainName = domainName;
|
|
140
|
+
}
|
|
136
141
|
if (wrapUpDuration) {
|
|
137
142
|
config.wrapUpDuration = wrapUpDuration;
|
|
138
143
|
}
|
package/src/simple/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/* global window */
|
|
2
|
-
import Auth, { InvalidSubscription, InvalidAuthorization, NoTenantIdError } from './Auth';
|
|
2
|
+
import Auth, { InvalidSubscription, InvalidAuthorization, NoTenantIdError, NoDomainNameError } from './Auth';
|
|
3
3
|
import Phone from './Phone';
|
|
4
4
|
import Websocket from './Websocket';
|
|
5
5
|
import Room from './room/Room';
|
|
@@ -106,6 +106,7 @@ const Wazo = {
|
|
|
106
106
|
CanceledCallError,
|
|
107
107
|
SFUNotAvailableError,
|
|
108
108
|
NoTenantIdError,
|
|
109
|
+
NoDomainNameError,
|
|
109
110
|
};
|
|
110
111
|
|
|
111
112
|
if (window) {
|
package/src/web-rtc-client.js
CHANGED
|
@@ -836,7 +836,7 @@ export default class WebRTCClient extends Emitter {
|
|
|
836
836
|
|
|
837
837
|
videoSender = transceiverIdx !== -1 ? transceivers[transceiverIdx].sender : null;
|
|
838
838
|
} else {
|
|
839
|
-
videoSender = pc.getSenders().find(sender => sender.track === null);
|
|
839
|
+
videoSender = pc && pc.getSenders && pc.getSenders().find(sender => sender.track === null);
|
|
840
840
|
}
|
|
841
841
|
|
|
842
842
|
if (!videoSender) {
|
|
@@ -877,9 +877,11 @@ export default class WebRTCClient extends Emitter {
|
|
|
877
877
|
const videoTracks = localStream.getVideoTracks();
|
|
878
878
|
|
|
879
879
|
// Remove video senders
|
|
880
|
-
pc.getSenders
|
|
881
|
-
|
|
882
|
-
|
|
880
|
+
if (pc.getSenders) {
|
|
881
|
+
pc.getSenders().filter(sender => sender.track && sender.track.kind === 'video').forEach(videoSender => {
|
|
882
|
+
videoSender.replaceTrack(null);
|
|
883
|
+
});
|
|
884
|
+
}
|
|
883
885
|
|
|
884
886
|
videoTracks.forEach(videoTrack => {
|
|
885
887
|
videoTrack.enabled = false;
|
|
@@ -1112,7 +1114,8 @@ export default class WebRTCClient extends Emitter {
|
|
|
1112
1114
|
const constraints = { audio: { deviceId: { exact: deviceId } } };
|
|
1113
1115
|
const stream = await navigator.mediaDevices.getUserMedia(constraints);
|
|
1114
1116
|
const audioTrack = stream.getAudioTracks()[0];
|
|
1115
|
-
const sender = pc && pc.getSenders
|
|
1117
|
+
const sender = pc && pc.getSenders
|
|
1118
|
+
&& pc.getSenders().find(s => audioTrack && s && s.track && s.track.kind === audioTrack.kind);
|
|
1116
1119
|
|
|
1117
1120
|
if (sender) {
|
|
1118
1121
|
if (sender.track) {
|
|
@@ -1175,10 +1178,11 @@ export default class WebRTCClient extends Emitter {
|
|
|
1175
1178
|
// $FlowFixMe
|
|
1176
1179
|
return navigator.mediaDevices.getUserMedia(constraints).then(async stream => {
|
|
1177
1180
|
const videoTrack = stream.getVideoTracks()[0];
|
|
1178
|
-
let sender = pc && pc.getSenders
|
|
1181
|
+
let sender = pc && pc.getSenders
|
|
1182
|
+
&& pc.getSenders().find(s => videoTrack && s && s.track && s.track.kind === videoTrack.kind);
|
|
1179
1183
|
let wasTrackEnabled = false;
|
|
1180
1184
|
if (!sender) {
|
|
1181
|
-
sender = pc && pc.getSenders().find(s => !s.track);
|
|
1185
|
+
sender = pc && pc.getSenders && pc.getSenders().find(s => !s.track);
|
|
1182
1186
|
}
|
|
1183
1187
|
|
|
1184
1188
|
if (sender) {
|