@wazo/sdk 0.37.37 → 0.37.40
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -1
- package/dist/wazo-sdk.js +2 -2
- package/esm/__tests__/api-client.test.js +9 -0
- package/esm/__tests__/web-rtc-client.test.js +15 -3
- package/esm/api/auth.js +2 -0
- package/esm/api-client.js +9 -0
- package/esm/checker/Checker.js +15 -3
- package/esm/checker/checks/aor.js +9 -0
- package/esm/checker/checks/api.js +9 -0
- package/esm/checker/checks/index.js +15 -3
- package/esm/checker/checks/webrtc-transport.js +15 -3
- package/esm/checker/checks/webrtc.js +15 -3
- package/esm/domain/AdHocAPIConference.js +14 -5
- package/esm/domain/Features.js +9 -0
- package/esm/domain/Phone/CTIPhone.js +9 -0
- package/esm/domain/Phone/WebRTCPhone.js +1 -1
- package/esm/domain/SwitchboardCall.js +5 -5
- package/esm/index.js +33 -14
- package/esm/service/CallApi.js +9 -0
- package/esm/service/getApiClient.js +9 -0
- package/esm/simple/Auth.js +33 -14
- package/esm/simple/Configuration.js +33 -14
- package/esm/simple/Directory.js +9 -0
- package/esm/simple/Phone.js +33 -14
- package/esm/simple/index.js +33 -14
- package/esm/simple/room/LocalParticipant.js +33 -14
- package/esm/simple/room/Participant.js +33 -14
- package/esm/simple/room/RemoteParticipant.js +33 -14
- package/esm/simple/room/Room.js +33 -14
- package/esm/simple/room/SipRoom.js +33 -14
- package/esm/simple/room/Stream.js +33 -14
- package/esm/simple/room/__tests__/RemoteParticipant.test.js +33 -14
- package/esm/simple/utils.js +33 -14
- package/esm/web-rtc-client.js +15 -3
- package/lib/__tests__/api-client.test.js +9 -0
- package/lib/__tests__/web-rtc-client.test.js +15 -3
- package/lib/api/auth.js +2 -0
- package/lib/api-client.js +9 -0
- package/lib/checker/Checker.js +15 -3
- package/lib/checker/checks/aor.js +9 -0
- package/lib/checker/checks/api.js +9 -0
- package/lib/checker/checks/index.js +15 -3
- package/lib/checker/checks/webrtc-transport.js +15 -3
- package/lib/checker/checks/webrtc.js +15 -3
- package/lib/domain/AdHocAPIConference.js +14 -5
- package/lib/domain/Features.js +9 -0
- package/lib/domain/Phone/CTIPhone.js +9 -0
- package/lib/domain/Phone/WebRTCPhone.js +1 -1
- package/lib/domain/SwitchboardCall.js +5 -5
- package/lib/index.js +33 -14
- package/lib/service/CallApi.js +9 -0
- package/lib/service/getApiClient.js +9 -0
- package/lib/simple/Auth.js +33 -14
- package/lib/simple/Configuration.js +33 -14
- package/lib/simple/Directory.js +9 -0
- package/lib/simple/Phone.js +33 -14
- package/lib/simple/index.js +33 -14
- package/lib/simple/room/LocalParticipant.js +33 -14
- package/lib/simple/room/Participant.js +33 -14
- package/lib/simple/room/RemoteParticipant.js +33 -14
- package/lib/simple/room/Room.js +33 -14
- package/lib/simple/room/SipRoom.js +33 -14
- package/lib/simple/room/Stream.js +33 -14
- package/lib/simple/room/__tests__/RemoteParticipant.test.js +33 -14
- package/lib/simple/utils.js +33 -14
- package/lib/web-rtc-client.js +15 -3
- package/package.json +1 -1
- package/src/api/auth.js +2 -0
- package/src/api-client.js +7 -0
- package/src/domain/AdHocAPIConference.js +5 -5
- package/src/domain/Phone/WebRTCPhone.js +1 -1
- package/src/domain/SwitchboardCall.js +5 -5
- package/src/simple/Auth.js +7 -0
- package/src/web-rtc-client.js +7 -4
|
@@ -2258,12 +2258,14 @@ var authMethods = (client , baseUrl ) => ({
|
|
|
2258
2258
|
backend ,
|
|
2259
2259
|
expiration ,
|
|
2260
2260
|
isMobile = false,
|
|
2261
|
+
tenantId ,
|
|
2261
2262
|
) => {
|
|
2262
2263
|
const body = {
|
|
2263
2264
|
backend: backend || DEFAULT_BACKEND_USER,
|
|
2264
2265
|
expiration: expiration || DETAULT_EXPIRATION,
|
|
2265
2266
|
refresh_token: refreshToken,
|
|
2266
2267
|
client_id: client.clientId,
|
|
2268
|
+
tenant_id: tenantId,
|
|
2267
2269
|
};
|
|
2268
2270
|
|
|
2269
2271
|
const headers = {
|
|
@@ -5415,6 +5417,7 @@ class ApiClient {
|
|
|
5415
5417
|
|
|
5416
5418
|
|
|
5417
5419
|
|
|
5420
|
+
|
|
5418
5421
|
|
|
5419
5422
|
|
|
5420
5423
|
|
|
@@ -5455,6 +5458,7 @@ class ApiClient {
|
|
|
5455
5458
|
logger$a.info('refresh token callback called', {
|
|
5456
5459
|
refreshToken: this.refreshToken,
|
|
5457
5460
|
refreshBackend: this.refreshBackend,
|
|
5461
|
+
refreshTenantId: this.refreshTenantId,
|
|
5458
5462
|
refreshExpiration: this.refreshExpiration,
|
|
5459
5463
|
isMobile: this.isMobile,
|
|
5460
5464
|
});
|
|
@@ -5468,6 +5472,7 @@ class ApiClient {
|
|
|
5468
5472
|
this.refreshBackend,
|
|
5469
5473
|
this.refreshExpiration,
|
|
5470
5474
|
this.isMobile,
|
|
5475
|
+
this.refreshTenantId,
|
|
5471
5476
|
);
|
|
5472
5477
|
|
|
5473
5478
|
logger$a.info('token refreshed', { token: session.token });
|
|
@@ -5509,6 +5514,10 @@ class ApiClient {
|
|
|
5509
5514
|
this.refreshBackend = refreshBackend;
|
|
5510
5515
|
}
|
|
5511
5516
|
|
|
5517
|
+
setRefreshTenantId(tenantId ) {
|
|
5518
|
+
this.refreshTenantId = tenantId;
|
|
5519
|
+
}
|
|
5520
|
+
|
|
5512
5521
|
setIsMobile(isMobile ) {
|
|
5513
5522
|
this.isMobile = isMobile;
|
|
5514
5523
|
}
|
|
@@ -5631,7 +5640,7 @@ var getApiClient = (forServer ) => {
|
|
|
5631
5640
|
|
|
5632
5641
|
|
|
5633
5642
|
|
|
5634
|
-
|
|
5643
|
+
|
|
5635
5644
|
|
|
5636
5645
|
|
|
5637
5646
|
|
|
@@ -5651,7 +5660,7 @@ class AdHocAPIConference {
|
|
|
5651
5660
|
|
|
5652
5661
|
|
|
5653
5662
|
|
|
5654
|
-
|
|
5663
|
+
|
|
5655
5664
|
|
|
5656
5665
|
|
|
5657
5666
|
|
|
@@ -5663,7 +5672,7 @@ class AdHocAPIConference {
|
|
|
5663
5672
|
participants,
|
|
5664
5673
|
started,
|
|
5665
5674
|
finished,
|
|
5666
|
-
|
|
5675
|
+
answerTime,
|
|
5667
5676
|
conferenceId,
|
|
5668
5677
|
muted,
|
|
5669
5678
|
paused,
|
|
@@ -5673,7 +5682,7 @@ class AdHocAPIConference {
|
|
|
5673
5682
|
this.participants = participants || {};
|
|
5674
5683
|
this.started = started || false;
|
|
5675
5684
|
this.finished = finished || false;
|
|
5676
|
-
this.
|
|
5685
|
+
this.answerTime = answerTime;
|
|
5677
5686
|
this.conferenceId = conferenceId || '';
|
|
5678
5687
|
this.muted = muted || false;
|
|
5679
5688
|
this.paused = paused || false;
|
|
@@ -5686,7 +5695,7 @@ class AdHocAPIConference {
|
|
|
5686
5695
|
async start() {
|
|
5687
5696
|
this.started = true;
|
|
5688
5697
|
// $FlowFixMe
|
|
5689
|
-
this.
|
|
5698
|
+
this.answerTime = Object.values(this.participants).length ? Object.values(this.participants)[0].answerTime : null;
|
|
5690
5699
|
|
|
5691
5700
|
const participantIds = Object.keys(this.participants);
|
|
5692
5701
|
const conference = await getApiClient().calld.createAdHocConference(this.host.callId, participantIds);
|
|
@@ -8444,11 +8453,14 @@ class WebRTCClient extends Emitter {
|
|
|
8444
8453
|
}
|
|
8445
8454
|
|
|
8446
8455
|
async _disconnectTransport(force = false) {
|
|
8447
|
-
if (force) {
|
|
8456
|
+
if (force && this.userAgent && this.userAgent.transport) {
|
|
8448
8457
|
// Bypass sip.js state machine that prevent to close WS with the state `Connecting`
|
|
8449
8458
|
this.userAgent.transport.disconnectResolve = () => {};
|
|
8450
|
-
|
|
8451
|
-
this.userAgent.transport._ws
|
|
8459
|
+
|
|
8460
|
+
if (this.userAgent.transport._ws) {
|
|
8461
|
+
this.userAgent.transport._ws.close(1000);
|
|
8462
|
+
}
|
|
8463
|
+
|
|
8452
8464
|
return;
|
|
8453
8465
|
}
|
|
8454
8466
|
|
|
@@ -10120,7 +10132,7 @@ class WebRTCPhone extends Emitter {
|
|
|
10120
10132
|
});
|
|
10121
10133
|
|
|
10122
10134
|
this.client.on(this.client.DISCONNECTED, () => {
|
|
10123
|
-
logger$8.
|
|
10135
|
+
logger$8.warn('WebRTC client disconnected');
|
|
10124
10136
|
|
|
10125
10137
|
this.eventEmitter.emit(ON_UNREGISTERED);
|
|
10126
10138
|
|
|
@@ -12963,7 +12975,7 @@ class Room {
|
|
|
12963
12975
|
|
|
12964
12976
|
|
|
12965
12977
|
|
|
12966
|
-
|
|
12978
|
+
|
|
12967
12979
|
|
|
12968
12980
|
|
|
12969
12981
|
|
|
@@ -12989,7 +13001,7 @@ class SwitchboardCall {
|
|
|
12989
13001
|
|
|
12990
13002
|
|
|
12991
13003
|
|
|
12992
|
-
|
|
13004
|
+
|
|
12993
13005
|
|
|
12994
13006
|
|
|
12995
13007
|
|
|
@@ -13003,7 +13015,7 @@ class SwitchboardCall {
|
|
|
13003
13015
|
callerIdName: plain.caller_id_name || null,
|
|
13004
13016
|
callerIdNumber: plain.caller_id_number || null,
|
|
13005
13017
|
participantId: plain.participantId || null,
|
|
13006
|
-
|
|
13018
|
+
answerTime: plain.startTime,
|
|
13007
13019
|
state: plain.state,
|
|
13008
13020
|
switchboardName: plain.switchboardName,
|
|
13009
13021
|
switchboardUuid: plain.switchboardUuid,
|
|
@@ -13016,7 +13028,7 @@ class SwitchboardCall {
|
|
|
13016
13028
|
callerIdName,
|
|
13017
13029
|
callerIdNumber,
|
|
13018
13030
|
participantId,
|
|
13019
|
-
|
|
13031
|
+
answerTime,
|
|
13020
13032
|
state,
|
|
13021
13033
|
switchboardName,
|
|
13022
13034
|
switchboardUuid,
|
|
@@ -13026,7 +13038,7 @@ class SwitchboardCall {
|
|
|
13026
13038
|
this.callerIdName = callerIdName;
|
|
13027
13039
|
this.callerIdNumber = callerIdNumber;
|
|
13028
13040
|
this.participantId = participantId;
|
|
13029
|
-
this.
|
|
13041
|
+
this.answerTime = answerTime;
|
|
13030
13042
|
this.state = state;
|
|
13031
13043
|
this.switchboardName = switchboardName;
|
|
13032
13044
|
this.switchboardUuid = switchboardUuid;
|
|
@@ -13747,6 +13759,13 @@ class Auth {
|
|
|
13747
13759
|
expiration: this.expiration,
|
|
13748
13760
|
mobile: this.mobile,
|
|
13749
13761
|
});
|
|
13762
|
+
|
|
13763
|
+
if (backend) {
|
|
13764
|
+
getApiClient().setRefreshBackend(backend);
|
|
13765
|
+
}
|
|
13766
|
+
|
|
13767
|
+
getApiClient().setRefreshTenantId(tenantId);
|
|
13768
|
+
|
|
13750
13769
|
return this._onAuthenticated(rawSession);
|
|
13751
13770
|
}
|
|
13752
13771
|
|
package/esm/simple/Directory.js
CHANGED
|
@@ -2238,12 +2238,14 @@ var authMethods = (client , baseUrl ) => ({
|
|
|
2238
2238
|
backend ,
|
|
2239
2239
|
expiration ,
|
|
2240
2240
|
isMobile = false,
|
|
2241
|
+
tenantId ,
|
|
2241
2242
|
) => {
|
|
2242
2243
|
const body = {
|
|
2243
2244
|
backend: backend || DEFAULT_BACKEND_USER,
|
|
2244
2245
|
expiration: expiration || DETAULT_EXPIRATION,
|
|
2245
2246
|
refresh_token: refreshToken,
|
|
2246
2247
|
client_id: client.clientId,
|
|
2248
|
+
tenant_id: tenantId,
|
|
2247
2249
|
};
|
|
2248
2250
|
|
|
2249
2251
|
const headers = {
|
|
@@ -4566,6 +4568,7 @@ class ApiClient {
|
|
|
4566
4568
|
|
|
4567
4569
|
|
|
4568
4570
|
|
|
4571
|
+
|
|
4569
4572
|
|
|
4570
4573
|
|
|
4571
4574
|
|
|
@@ -4606,6 +4609,7 @@ class ApiClient {
|
|
|
4606
4609
|
logger.info('refresh token callback called', {
|
|
4607
4610
|
refreshToken: this.refreshToken,
|
|
4608
4611
|
refreshBackend: this.refreshBackend,
|
|
4612
|
+
refreshTenantId: this.refreshTenantId,
|
|
4609
4613
|
refreshExpiration: this.refreshExpiration,
|
|
4610
4614
|
isMobile: this.isMobile,
|
|
4611
4615
|
});
|
|
@@ -4619,6 +4623,7 @@ class ApiClient {
|
|
|
4619
4623
|
this.refreshBackend,
|
|
4620
4624
|
this.refreshExpiration,
|
|
4621
4625
|
this.isMobile,
|
|
4626
|
+
this.refreshTenantId,
|
|
4622
4627
|
);
|
|
4623
4628
|
|
|
4624
4629
|
logger.info('token refreshed', { token: session.token });
|
|
@@ -4660,6 +4665,10 @@ class ApiClient {
|
|
|
4660
4665
|
this.refreshBackend = refreshBackend;
|
|
4661
4666
|
}
|
|
4662
4667
|
|
|
4668
|
+
setRefreshTenantId(tenantId ) {
|
|
4669
|
+
this.refreshTenantId = tenantId;
|
|
4670
|
+
}
|
|
4671
|
+
|
|
4663
4672
|
setIsMobile(isMobile ) {
|
|
4664
4673
|
this.isMobile = isMobile;
|
|
4665
4674
|
}
|
package/esm/simple/Phone.js
CHANGED
|
@@ -2861,12 +2861,14 @@ var authMethods = (client , baseUrl ) => ({
|
|
|
2861
2861
|
backend ,
|
|
2862
2862
|
expiration ,
|
|
2863
2863
|
isMobile = false,
|
|
2864
|
+
tenantId ,
|
|
2864
2865
|
) => {
|
|
2865
2866
|
const body = {
|
|
2866
2867
|
backend: backend || DEFAULT_BACKEND_USER,
|
|
2867
2868
|
expiration: expiration || DETAULT_EXPIRATION,
|
|
2868
2869
|
refresh_token: refreshToken,
|
|
2869
2870
|
client_id: client.clientId,
|
|
2871
|
+
tenant_id: tenantId,
|
|
2870
2872
|
};
|
|
2871
2873
|
|
|
2872
2874
|
const headers = {
|
|
@@ -5415,6 +5417,7 @@ class ApiClient {
|
|
|
5415
5417
|
|
|
5416
5418
|
|
|
5417
5419
|
|
|
5420
|
+
|
|
5418
5421
|
|
|
5419
5422
|
|
|
5420
5423
|
|
|
@@ -5455,6 +5458,7 @@ class ApiClient {
|
|
|
5455
5458
|
logger$a.info('refresh token callback called', {
|
|
5456
5459
|
refreshToken: this.refreshToken,
|
|
5457
5460
|
refreshBackend: this.refreshBackend,
|
|
5461
|
+
refreshTenantId: this.refreshTenantId,
|
|
5458
5462
|
refreshExpiration: this.refreshExpiration,
|
|
5459
5463
|
isMobile: this.isMobile,
|
|
5460
5464
|
});
|
|
@@ -5468,6 +5472,7 @@ class ApiClient {
|
|
|
5468
5472
|
this.refreshBackend,
|
|
5469
5473
|
this.refreshExpiration,
|
|
5470
5474
|
this.isMobile,
|
|
5475
|
+
this.refreshTenantId,
|
|
5471
5476
|
);
|
|
5472
5477
|
|
|
5473
5478
|
logger$a.info('token refreshed', { token: session.token });
|
|
@@ -5509,6 +5514,10 @@ class ApiClient {
|
|
|
5509
5514
|
this.refreshBackend = refreshBackend;
|
|
5510
5515
|
}
|
|
5511
5516
|
|
|
5517
|
+
setRefreshTenantId(tenantId ) {
|
|
5518
|
+
this.refreshTenantId = tenantId;
|
|
5519
|
+
}
|
|
5520
|
+
|
|
5512
5521
|
setIsMobile(isMobile ) {
|
|
5513
5522
|
this.isMobile = isMobile;
|
|
5514
5523
|
}
|
|
@@ -5631,7 +5640,7 @@ var getApiClient = (forServer ) => {
|
|
|
5631
5640
|
|
|
5632
5641
|
|
|
5633
5642
|
|
|
5634
|
-
|
|
5643
|
+
|
|
5635
5644
|
|
|
5636
5645
|
|
|
5637
5646
|
|
|
@@ -5651,7 +5660,7 @@ class AdHocAPIConference {
|
|
|
5651
5660
|
|
|
5652
5661
|
|
|
5653
5662
|
|
|
5654
|
-
|
|
5663
|
+
|
|
5655
5664
|
|
|
5656
5665
|
|
|
5657
5666
|
|
|
@@ -5663,7 +5672,7 @@ class AdHocAPIConference {
|
|
|
5663
5672
|
participants,
|
|
5664
5673
|
started,
|
|
5665
5674
|
finished,
|
|
5666
|
-
|
|
5675
|
+
answerTime,
|
|
5667
5676
|
conferenceId,
|
|
5668
5677
|
muted,
|
|
5669
5678
|
paused,
|
|
@@ -5673,7 +5682,7 @@ class AdHocAPIConference {
|
|
|
5673
5682
|
this.participants = participants || {};
|
|
5674
5683
|
this.started = started || false;
|
|
5675
5684
|
this.finished = finished || false;
|
|
5676
|
-
this.
|
|
5685
|
+
this.answerTime = answerTime;
|
|
5677
5686
|
this.conferenceId = conferenceId || '';
|
|
5678
5687
|
this.muted = muted || false;
|
|
5679
5688
|
this.paused = paused || false;
|
|
@@ -5686,7 +5695,7 @@ class AdHocAPIConference {
|
|
|
5686
5695
|
async start() {
|
|
5687
5696
|
this.started = true;
|
|
5688
5697
|
// $FlowFixMe
|
|
5689
|
-
this.
|
|
5698
|
+
this.answerTime = Object.values(this.participants).length ? Object.values(this.participants)[0].answerTime : null;
|
|
5690
5699
|
|
|
5691
5700
|
const participantIds = Object.keys(this.participants);
|
|
5692
5701
|
const conference = await getApiClient().calld.createAdHocConference(this.host.callId, participantIds);
|
|
@@ -8444,11 +8453,14 @@ class WebRTCClient extends Emitter {
|
|
|
8444
8453
|
}
|
|
8445
8454
|
|
|
8446
8455
|
async _disconnectTransport(force = false) {
|
|
8447
|
-
if (force) {
|
|
8456
|
+
if (force && this.userAgent && this.userAgent.transport) {
|
|
8448
8457
|
// Bypass sip.js state machine that prevent to close WS with the state `Connecting`
|
|
8449
8458
|
this.userAgent.transport.disconnectResolve = () => {};
|
|
8450
|
-
|
|
8451
|
-
this.userAgent.transport._ws
|
|
8459
|
+
|
|
8460
|
+
if (this.userAgent.transport._ws) {
|
|
8461
|
+
this.userAgent.transport._ws.close(1000);
|
|
8462
|
+
}
|
|
8463
|
+
|
|
8452
8464
|
return;
|
|
8453
8465
|
}
|
|
8454
8466
|
|
|
@@ -10120,7 +10132,7 @@ class WebRTCPhone extends Emitter {
|
|
|
10120
10132
|
});
|
|
10121
10133
|
|
|
10122
10134
|
this.client.on(this.client.DISCONNECTED, () => {
|
|
10123
|
-
logger$8.
|
|
10135
|
+
logger$8.warn('WebRTC client disconnected');
|
|
10124
10136
|
|
|
10125
10137
|
this.eventEmitter.emit(ON_UNREGISTERED);
|
|
10126
10138
|
|
|
@@ -10448,6 +10460,13 @@ class Auth {
|
|
|
10448
10460
|
expiration: this.expiration,
|
|
10449
10461
|
mobile: this.mobile,
|
|
10450
10462
|
});
|
|
10463
|
+
|
|
10464
|
+
if (backend) {
|
|
10465
|
+
getApiClient().setRefreshBackend(backend);
|
|
10466
|
+
}
|
|
10467
|
+
|
|
10468
|
+
getApiClient().setRefreshTenantId(tenantId);
|
|
10469
|
+
|
|
10451
10470
|
return this._onAuthenticated(rawSession);
|
|
10452
10471
|
}
|
|
10453
10472
|
|
|
@@ -12845,7 +12864,7 @@ class Room {
|
|
|
12845
12864
|
|
|
12846
12865
|
|
|
12847
12866
|
|
|
12848
|
-
|
|
12867
|
+
|
|
12849
12868
|
|
|
12850
12869
|
|
|
12851
12870
|
|
|
@@ -12871,7 +12890,7 @@ class SwitchboardCall {
|
|
|
12871
12890
|
|
|
12872
12891
|
|
|
12873
12892
|
|
|
12874
|
-
|
|
12893
|
+
|
|
12875
12894
|
|
|
12876
12895
|
|
|
12877
12896
|
|
|
@@ -12885,7 +12904,7 @@ class SwitchboardCall {
|
|
|
12885
12904
|
callerIdName: plain.caller_id_name || null,
|
|
12886
12905
|
callerIdNumber: plain.caller_id_number || null,
|
|
12887
12906
|
participantId: plain.participantId || null,
|
|
12888
|
-
|
|
12907
|
+
answerTime: plain.startTime,
|
|
12889
12908
|
state: plain.state,
|
|
12890
12909
|
switchboardName: plain.switchboardName,
|
|
12891
12910
|
switchboardUuid: plain.switchboardUuid,
|
|
@@ -12898,7 +12917,7 @@ class SwitchboardCall {
|
|
|
12898
12917
|
callerIdName,
|
|
12899
12918
|
callerIdNumber,
|
|
12900
12919
|
participantId,
|
|
12901
|
-
|
|
12920
|
+
answerTime,
|
|
12902
12921
|
state,
|
|
12903
12922
|
switchboardName,
|
|
12904
12923
|
switchboardUuid,
|
|
@@ -12908,7 +12927,7 @@ class SwitchboardCall {
|
|
|
12908
12927
|
this.callerIdName = callerIdName;
|
|
12909
12928
|
this.callerIdNumber = callerIdNumber;
|
|
12910
12929
|
this.participantId = participantId;
|
|
12911
|
-
this.
|
|
12930
|
+
this.answerTime = answerTime;
|
|
12912
12931
|
this.state = state;
|
|
12913
12932
|
this.switchboardName = switchboardName;
|
|
12914
12933
|
this.switchboardUuid = switchboardUuid;
|
package/esm/simple/index.js
CHANGED
|
@@ -2258,12 +2258,14 @@ var authMethods = (client , baseUrl ) => ({
|
|
|
2258
2258
|
backend ,
|
|
2259
2259
|
expiration ,
|
|
2260
2260
|
isMobile = false,
|
|
2261
|
+
tenantId ,
|
|
2261
2262
|
) => {
|
|
2262
2263
|
const body = {
|
|
2263
2264
|
backend: backend || DEFAULT_BACKEND_USER,
|
|
2264
2265
|
expiration: expiration || DETAULT_EXPIRATION,
|
|
2265
2266
|
refresh_token: refreshToken,
|
|
2266
2267
|
client_id: client.clientId,
|
|
2268
|
+
tenant_id: tenantId,
|
|
2267
2269
|
};
|
|
2268
2270
|
|
|
2269
2271
|
const headers = {
|
|
@@ -5415,6 +5417,7 @@ class ApiClient {
|
|
|
5415
5417
|
|
|
5416
5418
|
|
|
5417
5419
|
|
|
5420
|
+
|
|
5418
5421
|
|
|
5419
5422
|
|
|
5420
5423
|
|
|
@@ -5455,6 +5458,7 @@ class ApiClient {
|
|
|
5455
5458
|
logger$a.info('refresh token callback called', {
|
|
5456
5459
|
refreshToken: this.refreshToken,
|
|
5457
5460
|
refreshBackend: this.refreshBackend,
|
|
5461
|
+
refreshTenantId: this.refreshTenantId,
|
|
5458
5462
|
refreshExpiration: this.refreshExpiration,
|
|
5459
5463
|
isMobile: this.isMobile,
|
|
5460
5464
|
});
|
|
@@ -5468,6 +5472,7 @@ class ApiClient {
|
|
|
5468
5472
|
this.refreshBackend,
|
|
5469
5473
|
this.refreshExpiration,
|
|
5470
5474
|
this.isMobile,
|
|
5475
|
+
this.refreshTenantId,
|
|
5471
5476
|
);
|
|
5472
5477
|
|
|
5473
5478
|
logger$a.info('token refreshed', { token: session.token });
|
|
@@ -5509,6 +5514,10 @@ class ApiClient {
|
|
|
5509
5514
|
this.refreshBackend = refreshBackend;
|
|
5510
5515
|
}
|
|
5511
5516
|
|
|
5517
|
+
setRefreshTenantId(tenantId ) {
|
|
5518
|
+
this.refreshTenantId = tenantId;
|
|
5519
|
+
}
|
|
5520
|
+
|
|
5512
5521
|
setIsMobile(isMobile ) {
|
|
5513
5522
|
this.isMobile = isMobile;
|
|
5514
5523
|
}
|
|
@@ -5680,6 +5689,13 @@ class Auth {
|
|
|
5680
5689
|
expiration: this.expiration,
|
|
5681
5690
|
mobile: this.mobile,
|
|
5682
5691
|
});
|
|
5692
|
+
|
|
5693
|
+
if (backend) {
|
|
5694
|
+
getApiClient().setRefreshBackend(backend);
|
|
5695
|
+
}
|
|
5696
|
+
|
|
5697
|
+
getApiClient().setRefreshTenantId(tenantId);
|
|
5698
|
+
|
|
5683
5699
|
return this._onAuthenticated(rawSession);
|
|
5684
5700
|
}
|
|
5685
5701
|
|
|
@@ -5906,7 +5922,7 @@ var Auth$1 = global.wazoAuthInstance;
|
|
|
5906
5922
|
|
|
5907
5923
|
|
|
5908
5924
|
|
|
5909
|
-
|
|
5925
|
+
|
|
5910
5926
|
|
|
5911
5927
|
|
|
5912
5928
|
|
|
@@ -5926,7 +5942,7 @@ class AdHocAPIConference {
|
|
|
5926
5942
|
|
|
5927
5943
|
|
|
5928
5944
|
|
|
5929
|
-
|
|
5945
|
+
|
|
5930
5946
|
|
|
5931
5947
|
|
|
5932
5948
|
|
|
@@ -5938,7 +5954,7 @@ class AdHocAPIConference {
|
|
|
5938
5954
|
participants,
|
|
5939
5955
|
started,
|
|
5940
5956
|
finished,
|
|
5941
|
-
|
|
5957
|
+
answerTime,
|
|
5942
5958
|
conferenceId,
|
|
5943
5959
|
muted,
|
|
5944
5960
|
paused,
|
|
@@ -5948,7 +5964,7 @@ class AdHocAPIConference {
|
|
|
5948
5964
|
this.participants = participants || {};
|
|
5949
5965
|
this.started = started || false;
|
|
5950
5966
|
this.finished = finished || false;
|
|
5951
|
-
this.
|
|
5967
|
+
this.answerTime = answerTime;
|
|
5952
5968
|
this.conferenceId = conferenceId || '';
|
|
5953
5969
|
this.muted = muted || false;
|
|
5954
5970
|
this.paused = paused || false;
|
|
@@ -5961,7 +5977,7 @@ class AdHocAPIConference {
|
|
|
5961
5977
|
async start() {
|
|
5962
5978
|
this.started = true;
|
|
5963
5979
|
// $FlowFixMe
|
|
5964
|
-
this.
|
|
5980
|
+
this.answerTime = Object.values(this.participants).length ? Object.values(this.participants)[0].answerTime : null;
|
|
5965
5981
|
|
|
5966
5982
|
const participantIds = Object.keys(this.participants);
|
|
5967
5983
|
const conference = await getApiClient().calld.createAdHocConference(this.host.callId, participantIds);
|
|
@@ -8719,11 +8735,14 @@ class WebRTCClient extends Emitter {
|
|
|
8719
8735
|
}
|
|
8720
8736
|
|
|
8721
8737
|
async _disconnectTransport(force = false) {
|
|
8722
|
-
if (force) {
|
|
8738
|
+
if (force && this.userAgent && this.userAgent.transport) {
|
|
8723
8739
|
// Bypass sip.js state machine that prevent to close WS with the state `Connecting`
|
|
8724
8740
|
this.userAgent.transport.disconnectResolve = () => {};
|
|
8725
|
-
|
|
8726
|
-
this.userAgent.transport._ws
|
|
8741
|
+
|
|
8742
|
+
if (this.userAgent.transport._ws) {
|
|
8743
|
+
this.userAgent.transport._ws.close(1000);
|
|
8744
|
+
}
|
|
8745
|
+
|
|
8727
8746
|
return;
|
|
8728
8747
|
}
|
|
8729
8748
|
|
|
@@ -10395,7 +10414,7 @@ class WebRTCPhone extends Emitter {
|
|
|
10395
10414
|
});
|
|
10396
10415
|
|
|
10397
10416
|
this.client.on(this.client.DISCONNECTED, () => {
|
|
10398
|
-
logger$7.
|
|
10417
|
+
logger$7.warn('WebRTC client disconnected');
|
|
10399
10418
|
|
|
10400
10419
|
this.eventEmitter.emit(ON_UNREGISTERED);
|
|
10401
10420
|
|
|
@@ -13255,7 +13274,7 @@ class Room {
|
|
|
13255
13274
|
|
|
13256
13275
|
|
|
13257
13276
|
|
|
13258
|
-
|
|
13277
|
+
|
|
13259
13278
|
|
|
13260
13279
|
|
|
13261
13280
|
|
|
@@ -13281,7 +13300,7 @@ class SwitchboardCall {
|
|
|
13281
13300
|
|
|
13282
13301
|
|
|
13283
13302
|
|
|
13284
|
-
|
|
13303
|
+
|
|
13285
13304
|
|
|
13286
13305
|
|
|
13287
13306
|
|
|
@@ -13295,7 +13314,7 @@ class SwitchboardCall {
|
|
|
13295
13314
|
callerIdName: plain.caller_id_name || null,
|
|
13296
13315
|
callerIdNumber: plain.caller_id_number || null,
|
|
13297
13316
|
participantId: plain.participantId || null,
|
|
13298
|
-
|
|
13317
|
+
answerTime: plain.startTime,
|
|
13299
13318
|
state: plain.state,
|
|
13300
13319
|
switchboardName: plain.switchboardName,
|
|
13301
13320
|
switchboardUuid: plain.switchboardUuid,
|
|
@@ -13308,7 +13327,7 @@ class SwitchboardCall {
|
|
|
13308
13327
|
callerIdName,
|
|
13309
13328
|
callerIdNumber,
|
|
13310
13329
|
participantId,
|
|
13311
|
-
|
|
13330
|
+
answerTime,
|
|
13312
13331
|
state,
|
|
13313
13332
|
switchboardName,
|
|
13314
13333
|
switchboardUuid,
|
|
@@ -13318,7 +13337,7 @@ class SwitchboardCall {
|
|
|
13318
13337
|
this.callerIdName = callerIdName;
|
|
13319
13338
|
this.callerIdNumber = callerIdNumber;
|
|
13320
13339
|
this.participantId = participantId;
|
|
13321
|
-
this.
|
|
13340
|
+
this.answerTime = answerTime;
|
|
13322
13341
|
this.state = state;
|
|
13323
13342
|
this.switchboardName = switchboardName;
|
|
13324
13343
|
this.switchboardUuid = switchboardUuid;
|