@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
package/esm/web-rtc-client.js
CHANGED
|
@@ -2786,12 +2786,14 @@ var authMethods = (client , baseUrl ) => ({
|
|
|
2786
2786
|
backend ,
|
|
2787
2787
|
expiration ,
|
|
2788
2788
|
isMobile = false,
|
|
2789
|
+
tenantId ,
|
|
2789
2790
|
) => {
|
|
2790
2791
|
const body = {
|
|
2791
2792
|
backend: backend || DEFAULT_BACKEND_USER,
|
|
2792
2793
|
expiration: expiration || DETAULT_EXPIRATION,
|
|
2793
2794
|
refresh_token: refreshToken,
|
|
2794
2795
|
client_id: client.clientId,
|
|
2796
|
+
tenant_id: tenantId,
|
|
2795
2797
|
};
|
|
2796
2798
|
|
|
2797
2799
|
const headers = {
|
|
@@ -5129,6 +5131,7 @@ class ApiClient {
|
|
|
5129
5131
|
|
|
5130
5132
|
|
|
5131
5133
|
|
|
5134
|
+
|
|
5132
5135
|
|
|
5133
5136
|
|
|
5134
5137
|
|
|
@@ -5169,6 +5172,7 @@ class ApiClient {
|
|
|
5169
5172
|
logger$1.info('refresh token callback called', {
|
|
5170
5173
|
refreshToken: this.refreshToken,
|
|
5171
5174
|
refreshBackend: this.refreshBackend,
|
|
5175
|
+
refreshTenantId: this.refreshTenantId,
|
|
5172
5176
|
refreshExpiration: this.refreshExpiration,
|
|
5173
5177
|
isMobile: this.isMobile,
|
|
5174
5178
|
});
|
|
@@ -5182,6 +5186,7 @@ class ApiClient {
|
|
|
5182
5186
|
this.refreshBackend,
|
|
5183
5187
|
this.refreshExpiration,
|
|
5184
5188
|
this.isMobile,
|
|
5189
|
+
this.refreshTenantId,
|
|
5185
5190
|
);
|
|
5186
5191
|
|
|
5187
5192
|
logger$1.info('token refreshed', { token: session.token });
|
|
@@ -5223,6 +5228,10 @@ class ApiClient {
|
|
|
5223
5228
|
this.refreshBackend = refreshBackend;
|
|
5224
5229
|
}
|
|
5225
5230
|
|
|
5231
|
+
setRefreshTenantId(tenantId ) {
|
|
5232
|
+
this.refreshTenantId = tenantId;
|
|
5233
|
+
}
|
|
5234
|
+
|
|
5226
5235
|
setIsMobile(isMobile ) {
|
|
5227
5236
|
this.isMobile = isMobile;
|
|
5228
5237
|
}
|
|
@@ -7391,11 +7400,14 @@ class WebRTCClient extends Emitter {
|
|
|
7391
7400
|
}
|
|
7392
7401
|
|
|
7393
7402
|
async _disconnectTransport(force = false) {
|
|
7394
|
-
if (force) {
|
|
7403
|
+
if (force && this.userAgent && this.userAgent.transport) {
|
|
7395
7404
|
// Bypass sip.js state machine that prevent to close WS with the state `Connecting`
|
|
7396
7405
|
this.userAgent.transport.disconnectResolve = () => {};
|
|
7397
|
-
|
|
7398
|
-
this.userAgent.transport._ws
|
|
7406
|
+
|
|
7407
|
+
if (this.userAgent.transport._ws) {
|
|
7408
|
+
this.userAgent.transport._ws.close(1000);
|
|
7409
|
+
}
|
|
7410
|
+
|
|
7399
7411
|
return;
|
|
7400
7412
|
}
|
|
7401
7413
|
|
|
@@ -2244,12 +2244,14 @@ var authMethods = (client , baseUrl ) => ({
|
|
|
2244
2244
|
backend ,
|
|
2245
2245
|
expiration ,
|
|
2246
2246
|
isMobile = false,
|
|
2247
|
+
tenantId ,
|
|
2247
2248
|
) => {
|
|
2248
2249
|
const body = {
|
|
2249
2250
|
backend: backend || DEFAULT_BACKEND_USER,
|
|
2250
2251
|
expiration: expiration || DETAULT_EXPIRATION,
|
|
2251
2252
|
refresh_token: refreshToken,
|
|
2252
2253
|
client_id: client.clientId,
|
|
2254
|
+
tenant_id: tenantId,
|
|
2253
2255
|
};
|
|
2254
2256
|
|
|
2255
2257
|
const headers = {
|
|
@@ -4587,6 +4589,7 @@ class ApiClient {
|
|
|
4587
4589
|
|
|
4588
4590
|
|
|
4589
4591
|
|
|
4592
|
+
|
|
4590
4593
|
|
|
4591
4594
|
|
|
4592
4595
|
|
|
@@ -4627,6 +4630,7 @@ class ApiClient {
|
|
|
4627
4630
|
logger.info('refresh token callback called', {
|
|
4628
4631
|
refreshToken: this.refreshToken,
|
|
4629
4632
|
refreshBackend: this.refreshBackend,
|
|
4633
|
+
refreshTenantId: this.refreshTenantId,
|
|
4630
4634
|
refreshExpiration: this.refreshExpiration,
|
|
4631
4635
|
isMobile: this.isMobile,
|
|
4632
4636
|
});
|
|
@@ -4640,6 +4644,7 @@ class ApiClient {
|
|
|
4640
4644
|
this.refreshBackend,
|
|
4641
4645
|
this.refreshExpiration,
|
|
4642
4646
|
this.isMobile,
|
|
4647
|
+
this.refreshTenantId,
|
|
4643
4648
|
);
|
|
4644
4649
|
|
|
4645
4650
|
logger.info('token refreshed', { token: session.token });
|
|
@@ -4681,6 +4686,10 @@ class ApiClient {
|
|
|
4681
4686
|
this.refreshBackend = refreshBackend;
|
|
4682
4687
|
}
|
|
4683
4688
|
|
|
4689
|
+
setRefreshTenantId(tenantId ) {
|
|
4690
|
+
this.refreshTenantId = tenantId;
|
|
4691
|
+
}
|
|
4692
|
+
|
|
4684
4693
|
setIsMobile(isMobile ) {
|
|
4685
4694
|
this.isMobile = isMobile;
|
|
4686
4695
|
}
|
|
@@ -2795,12 +2795,14 @@ var authMethods = (client , baseUrl ) => ({
|
|
|
2795
2795
|
backend ,
|
|
2796
2796
|
expiration ,
|
|
2797
2797
|
isMobile = false,
|
|
2798
|
+
tenantId ,
|
|
2798
2799
|
) => {
|
|
2799
2800
|
const body = {
|
|
2800
2801
|
backend: backend || DEFAULT_BACKEND_USER,
|
|
2801
2802
|
expiration: expiration || DETAULT_EXPIRATION,
|
|
2802
2803
|
refresh_token: refreshToken,
|
|
2803
2804
|
client_id: client.clientId,
|
|
2805
|
+
tenant_id: tenantId,
|
|
2804
2806
|
};
|
|
2805
2807
|
|
|
2806
2808
|
const headers = {
|
|
@@ -5138,6 +5140,7 @@ class ApiClient {
|
|
|
5138
5140
|
|
|
5139
5141
|
|
|
5140
5142
|
|
|
5143
|
+
|
|
5141
5144
|
|
|
5142
5145
|
|
|
5143
5146
|
|
|
@@ -5178,6 +5181,7 @@ class ApiClient {
|
|
|
5178
5181
|
logger$1.info('refresh token callback called', {
|
|
5179
5182
|
refreshToken: this.refreshToken,
|
|
5180
5183
|
refreshBackend: this.refreshBackend,
|
|
5184
|
+
refreshTenantId: this.refreshTenantId,
|
|
5181
5185
|
refreshExpiration: this.refreshExpiration,
|
|
5182
5186
|
isMobile: this.isMobile,
|
|
5183
5187
|
});
|
|
@@ -5191,6 +5195,7 @@ class ApiClient {
|
|
|
5191
5195
|
this.refreshBackend,
|
|
5192
5196
|
this.refreshExpiration,
|
|
5193
5197
|
this.isMobile,
|
|
5198
|
+
this.refreshTenantId,
|
|
5194
5199
|
);
|
|
5195
5200
|
|
|
5196
5201
|
logger$1.info('token refreshed', { token: session.token });
|
|
@@ -5232,6 +5237,10 @@ class ApiClient {
|
|
|
5232
5237
|
this.refreshBackend = refreshBackend;
|
|
5233
5238
|
}
|
|
5234
5239
|
|
|
5240
|
+
setRefreshTenantId(tenantId ) {
|
|
5241
|
+
this.refreshTenantId = tenantId;
|
|
5242
|
+
}
|
|
5243
|
+
|
|
5235
5244
|
setIsMobile(isMobile ) {
|
|
5236
5245
|
this.isMobile = isMobile;
|
|
5237
5246
|
}
|
|
@@ -7397,11 +7406,14 @@ class WebRTCClient extends Emitter {
|
|
|
7397
7406
|
}
|
|
7398
7407
|
|
|
7399
7408
|
async _disconnectTransport(force = false) {
|
|
7400
|
-
if (force) {
|
|
7409
|
+
if (force && this.userAgent && this.userAgent.transport) {
|
|
7401
7410
|
// Bypass sip.js state machine that prevent to close WS with the state `Connecting`
|
|
7402
7411
|
this.userAgent.transport.disconnectResolve = () => {};
|
|
7403
|
-
|
|
7404
|
-
this.userAgent.transport._ws
|
|
7412
|
+
|
|
7413
|
+
if (this.userAgent.transport._ws) {
|
|
7414
|
+
this.userAgent.transport._ws.close(1000);
|
|
7415
|
+
}
|
|
7416
|
+
|
|
7405
7417
|
return;
|
|
7406
7418
|
}
|
|
7407
7419
|
|
package/lib/api/auth.js
CHANGED
|
@@ -1004,12 +1004,14 @@ var auth = (client , baseUrl ) => ({
|
|
|
1004
1004
|
backend ,
|
|
1005
1005
|
expiration ,
|
|
1006
1006
|
isMobile = false,
|
|
1007
|
+
tenantId ,
|
|
1007
1008
|
) => {
|
|
1008
1009
|
const body = {
|
|
1009
1010
|
backend: backend || DEFAULT_BACKEND_USER,
|
|
1010
1011
|
expiration: expiration || DETAULT_EXPIRATION,
|
|
1011
1012
|
refresh_token: refreshToken,
|
|
1012
1013
|
client_id: client.clientId,
|
|
1014
|
+
tenant_id: tenantId,
|
|
1013
1015
|
};
|
|
1014
1016
|
|
|
1015
1017
|
const headers = {
|
package/lib/api-client.js
CHANGED
|
@@ -2244,12 +2244,14 @@ var authMethods = (client , baseUrl ) => ({
|
|
|
2244
2244
|
backend ,
|
|
2245
2245
|
expiration ,
|
|
2246
2246
|
isMobile = false,
|
|
2247
|
+
tenantId ,
|
|
2247
2248
|
) => {
|
|
2248
2249
|
const body = {
|
|
2249
2250
|
backend: backend || DEFAULT_BACKEND_USER,
|
|
2250
2251
|
expiration: expiration || DETAULT_EXPIRATION,
|
|
2251
2252
|
refresh_token: refreshToken,
|
|
2252
2253
|
client_id: client.clientId,
|
|
2254
|
+
tenant_id: tenantId,
|
|
2253
2255
|
};
|
|
2254
2256
|
|
|
2255
2257
|
const headers = {
|
|
@@ -4587,6 +4589,7 @@ class ApiClient {
|
|
|
4587
4589
|
|
|
4588
4590
|
|
|
4589
4591
|
|
|
4592
|
+
|
|
4590
4593
|
|
|
4591
4594
|
|
|
4592
4595
|
|
|
@@ -4627,6 +4630,7 @@ class ApiClient {
|
|
|
4627
4630
|
logger.info('refresh token callback called', {
|
|
4628
4631
|
refreshToken: this.refreshToken,
|
|
4629
4632
|
refreshBackend: this.refreshBackend,
|
|
4633
|
+
refreshTenantId: this.refreshTenantId,
|
|
4630
4634
|
refreshExpiration: this.refreshExpiration,
|
|
4631
4635
|
isMobile: this.isMobile,
|
|
4632
4636
|
});
|
|
@@ -4640,6 +4644,7 @@ class ApiClient {
|
|
|
4640
4644
|
this.refreshBackend,
|
|
4641
4645
|
this.refreshExpiration,
|
|
4642
4646
|
this.isMobile,
|
|
4647
|
+
this.refreshTenantId,
|
|
4643
4648
|
);
|
|
4644
4649
|
|
|
4645
4650
|
logger.info('token refreshed', { token: session.token });
|
|
@@ -4681,6 +4686,10 @@ class ApiClient {
|
|
|
4681
4686
|
this.refreshBackend = refreshBackend;
|
|
4682
4687
|
}
|
|
4683
4688
|
|
|
4689
|
+
setRefreshTenantId(tenantId ) {
|
|
4690
|
+
this.refreshTenantId = tenantId;
|
|
4691
|
+
}
|
|
4692
|
+
|
|
4684
4693
|
setIsMobile(isMobile ) {
|
|
4685
4694
|
this.isMobile = isMobile;
|
|
4686
4695
|
}
|
package/lib/checker/Checker.js
CHANGED
|
@@ -2266,12 +2266,14 @@ var authMethods = (client , baseUrl ) => ({
|
|
|
2266
2266
|
backend ,
|
|
2267
2267
|
expiration ,
|
|
2268
2268
|
isMobile = false,
|
|
2269
|
+
tenantId ,
|
|
2269
2270
|
) => {
|
|
2270
2271
|
const body = {
|
|
2271
2272
|
backend: backend || DEFAULT_BACKEND_USER,
|
|
2272
2273
|
expiration: expiration || DETAULT_EXPIRATION,
|
|
2273
2274
|
refresh_token: refreshToken,
|
|
2274
2275
|
client_id: client.clientId,
|
|
2276
|
+
tenant_id: tenantId,
|
|
2275
2277
|
};
|
|
2276
2278
|
|
|
2277
2279
|
const headers = {
|
|
@@ -4635,6 +4637,7 @@ class ApiClient {
|
|
|
4635
4637
|
|
|
4636
4638
|
|
|
4637
4639
|
|
|
4640
|
+
|
|
4638
4641
|
|
|
4639
4642
|
|
|
4640
4643
|
|
|
@@ -4675,6 +4678,7 @@ class ApiClient {
|
|
|
4675
4678
|
logger$3.info('refresh token callback called', {
|
|
4676
4679
|
refreshToken: this.refreshToken,
|
|
4677
4680
|
refreshBackend: this.refreshBackend,
|
|
4681
|
+
refreshTenantId: this.refreshTenantId,
|
|
4678
4682
|
refreshExpiration: this.refreshExpiration,
|
|
4679
4683
|
isMobile: this.isMobile,
|
|
4680
4684
|
});
|
|
@@ -4688,6 +4692,7 @@ class ApiClient {
|
|
|
4688
4692
|
this.refreshBackend,
|
|
4689
4693
|
this.refreshExpiration,
|
|
4690
4694
|
this.isMobile,
|
|
4695
|
+
this.refreshTenantId,
|
|
4691
4696
|
);
|
|
4692
4697
|
|
|
4693
4698
|
logger$3.info('token refreshed', { token: session.token });
|
|
@@ -4729,6 +4734,10 @@ class ApiClient {
|
|
|
4729
4734
|
this.refreshBackend = refreshBackend;
|
|
4730
4735
|
}
|
|
4731
4736
|
|
|
4737
|
+
setRefreshTenantId(tenantId ) {
|
|
4738
|
+
this.refreshTenantId = tenantId;
|
|
4739
|
+
}
|
|
4740
|
+
|
|
4732
4741
|
setIsMobile(isMobile ) {
|
|
4733
4742
|
this.isMobile = isMobile;
|
|
4734
4743
|
}
|
|
@@ -7983,11 +7992,14 @@ class WebRTCClient extends Emitter {
|
|
|
7983
7992
|
}
|
|
7984
7993
|
|
|
7985
7994
|
async _disconnectTransport(force = false) {
|
|
7986
|
-
if (force) {
|
|
7995
|
+
if (force && this.userAgent && this.userAgent.transport) {
|
|
7987
7996
|
// Bypass sip.js state machine that prevent to close WS with the state `Connecting`
|
|
7988
7997
|
this.userAgent.transport.disconnectResolve = () => {};
|
|
7989
|
-
|
|
7990
|
-
this.userAgent.transport._ws
|
|
7998
|
+
|
|
7999
|
+
if (this.userAgent.transport._ws) {
|
|
8000
|
+
this.userAgent.transport._ws.close(1000);
|
|
8001
|
+
}
|
|
8002
|
+
|
|
7991
8003
|
return;
|
|
7992
8004
|
}
|
|
7993
8005
|
|
|
@@ -2244,12 +2244,14 @@ var authMethods = (client , baseUrl ) => ({
|
|
|
2244
2244
|
backend ,
|
|
2245
2245
|
expiration ,
|
|
2246
2246
|
isMobile = false,
|
|
2247
|
+
tenantId ,
|
|
2247
2248
|
) => {
|
|
2248
2249
|
const body = {
|
|
2249
2250
|
backend: backend || DEFAULT_BACKEND_USER,
|
|
2250
2251
|
expiration: expiration || DETAULT_EXPIRATION,
|
|
2251
2252
|
refresh_token: refreshToken,
|
|
2252
2253
|
client_id: client.clientId,
|
|
2254
|
+
tenant_id: tenantId,
|
|
2253
2255
|
};
|
|
2254
2256
|
|
|
2255
2257
|
const headers = {
|
|
@@ -4587,6 +4589,7 @@ class ApiClient {
|
|
|
4587
4589
|
|
|
4588
4590
|
|
|
4589
4591
|
|
|
4592
|
+
|
|
4590
4593
|
|
|
4591
4594
|
|
|
4592
4595
|
|
|
@@ -4627,6 +4630,7 @@ class ApiClient {
|
|
|
4627
4630
|
logger.info('refresh token callback called', {
|
|
4628
4631
|
refreshToken: this.refreshToken,
|
|
4629
4632
|
refreshBackend: this.refreshBackend,
|
|
4633
|
+
refreshTenantId: this.refreshTenantId,
|
|
4630
4634
|
refreshExpiration: this.refreshExpiration,
|
|
4631
4635
|
isMobile: this.isMobile,
|
|
4632
4636
|
});
|
|
@@ -4640,6 +4644,7 @@ class ApiClient {
|
|
|
4640
4644
|
this.refreshBackend,
|
|
4641
4645
|
this.refreshExpiration,
|
|
4642
4646
|
this.isMobile,
|
|
4647
|
+
this.refreshTenantId,
|
|
4643
4648
|
);
|
|
4644
4649
|
|
|
4645
4650
|
logger.info('token refreshed', { token: session.token });
|
|
@@ -4681,6 +4686,10 @@ class ApiClient {
|
|
|
4681
4686
|
this.refreshBackend = refreshBackend;
|
|
4682
4687
|
}
|
|
4683
4688
|
|
|
4689
|
+
setRefreshTenantId(tenantId ) {
|
|
4690
|
+
this.refreshTenantId = tenantId;
|
|
4691
|
+
}
|
|
4692
|
+
|
|
4684
4693
|
setIsMobile(isMobile ) {
|
|
4685
4694
|
this.isMobile = isMobile;
|
|
4686
4695
|
}
|
|
@@ -2244,12 +2244,14 @@ var authMethods = (client , baseUrl ) => ({
|
|
|
2244
2244
|
backend ,
|
|
2245
2245
|
expiration ,
|
|
2246
2246
|
isMobile = false,
|
|
2247
|
+
tenantId ,
|
|
2247
2248
|
) => {
|
|
2248
2249
|
const body = {
|
|
2249
2250
|
backend: backend || DEFAULT_BACKEND_USER,
|
|
2250
2251
|
expiration: expiration || DETAULT_EXPIRATION,
|
|
2251
2252
|
refresh_token: refreshToken,
|
|
2252
2253
|
client_id: client.clientId,
|
|
2254
|
+
tenant_id: tenantId,
|
|
2253
2255
|
};
|
|
2254
2256
|
|
|
2255
2257
|
const headers = {
|
|
@@ -4587,6 +4589,7 @@ class ApiClient {
|
|
|
4587
4589
|
|
|
4588
4590
|
|
|
4589
4591
|
|
|
4592
|
+
|
|
4590
4593
|
|
|
4591
4594
|
|
|
4592
4595
|
|
|
@@ -4627,6 +4630,7 @@ class ApiClient {
|
|
|
4627
4630
|
logger.info('refresh token callback called', {
|
|
4628
4631
|
refreshToken: this.refreshToken,
|
|
4629
4632
|
refreshBackend: this.refreshBackend,
|
|
4633
|
+
refreshTenantId: this.refreshTenantId,
|
|
4630
4634
|
refreshExpiration: this.refreshExpiration,
|
|
4631
4635
|
isMobile: this.isMobile,
|
|
4632
4636
|
});
|
|
@@ -4640,6 +4644,7 @@ class ApiClient {
|
|
|
4640
4644
|
this.refreshBackend,
|
|
4641
4645
|
this.refreshExpiration,
|
|
4642
4646
|
this.isMobile,
|
|
4647
|
+
this.refreshTenantId,
|
|
4643
4648
|
);
|
|
4644
4649
|
|
|
4645
4650
|
logger.info('token refreshed', { token: session.token });
|
|
@@ -4681,6 +4686,10 @@ class ApiClient {
|
|
|
4681
4686
|
this.refreshBackend = refreshBackend;
|
|
4682
4687
|
}
|
|
4683
4688
|
|
|
4689
|
+
setRefreshTenantId(tenantId ) {
|
|
4690
|
+
this.refreshTenantId = tenantId;
|
|
4691
|
+
}
|
|
4692
|
+
|
|
4684
4693
|
setIsMobile(isMobile ) {
|
|
4685
4694
|
this.isMobile = isMobile;
|
|
4686
4695
|
}
|
|
@@ -2266,12 +2266,14 @@ var authMethods = (client , baseUrl ) => ({
|
|
|
2266
2266
|
backend ,
|
|
2267
2267
|
expiration ,
|
|
2268
2268
|
isMobile = false,
|
|
2269
|
+
tenantId ,
|
|
2269
2270
|
) => {
|
|
2270
2271
|
const body = {
|
|
2271
2272
|
backend: backend || DEFAULT_BACKEND_USER,
|
|
2272
2273
|
expiration: expiration || DETAULT_EXPIRATION,
|
|
2273
2274
|
refresh_token: refreshToken,
|
|
2274
2275
|
client_id: client.clientId,
|
|
2276
|
+
tenant_id: tenantId,
|
|
2275
2277
|
};
|
|
2276
2278
|
|
|
2277
2279
|
const headers = {
|
|
@@ -4635,6 +4637,7 @@ class ApiClient {
|
|
|
4635
4637
|
|
|
4636
4638
|
|
|
4637
4639
|
|
|
4640
|
+
|
|
4638
4641
|
|
|
4639
4642
|
|
|
4640
4643
|
|
|
@@ -4675,6 +4678,7 @@ class ApiClient {
|
|
|
4675
4678
|
logger$2.info('refresh token callback called', {
|
|
4676
4679
|
refreshToken: this.refreshToken,
|
|
4677
4680
|
refreshBackend: this.refreshBackend,
|
|
4681
|
+
refreshTenantId: this.refreshTenantId,
|
|
4678
4682
|
refreshExpiration: this.refreshExpiration,
|
|
4679
4683
|
isMobile: this.isMobile,
|
|
4680
4684
|
});
|
|
@@ -4688,6 +4692,7 @@ class ApiClient {
|
|
|
4688
4692
|
this.refreshBackend,
|
|
4689
4693
|
this.refreshExpiration,
|
|
4690
4694
|
this.isMobile,
|
|
4695
|
+
this.refreshTenantId,
|
|
4691
4696
|
);
|
|
4692
4697
|
|
|
4693
4698
|
logger$2.info('token refreshed', { token: session.token });
|
|
@@ -4729,6 +4734,10 @@ class ApiClient {
|
|
|
4729
4734
|
this.refreshBackend = refreshBackend;
|
|
4730
4735
|
}
|
|
4731
4736
|
|
|
4737
|
+
setRefreshTenantId(tenantId ) {
|
|
4738
|
+
this.refreshTenantId = tenantId;
|
|
4739
|
+
}
|
|
4740
|
+
|
|
4732
4741
|
setIsMobile(isMobile ) {
|
|
4733
4742
|
this.isMobile = isMobile;
|
|
4734
4743
|
}
|
|
@@ -7983,11 +7992,14 @@ class WebRTCClient extends Emitter {
|
|
|
7983
7992
|
}
|
|
7984
7993
|
|
|
7985
7994
|
async _disconnectTransport(force = false) {
|
|
7986
|
-
if (force) {
|
|
7995
|
+
if (force && this.userAgent && this.userAgent.transport) {
|
|
7987
7996
|
// Bypass sip.js state machine that prevent to close WS with the state `Connecting`
|
|
7988
7997
|
this.userAgent.transport.disconnectResolve = () => {};
|
|
7989
|
-
|
|
7990
|
-
this.userAgent.transport._ws
|
|
7998
|
+
|
|
7999
|
+
if (this.userAgent.transport._ws) {
|
|
8000
|
+
this.userAgent.transport._ws.close(1000);
|
|
8001
|
+
}
|
|
8002
|
+
|
|
7991
8003
|
return;
|
|
7992
8004
|
}
|
|
7993
8005
|
|
|
@@ -2795,12 +2795,14 @@ var authMethods = (client , baseUrl ) => ({
|
|
|
2795
2795
|
backend ,
|
|
2796
2796
|
expiration ,
|
|
2797
2797
|
isMobile = false,
|
|
2798
|
+
tenantId ,
|
|
2798
2799
|
) => {
|
|
2799
2800
|
const body = {
|
|
2800
2801
|
backend: backend || DEFAULT_BACKEND_USER,
|
|
2801
2802
|
expiration: expiration || DETAULT_EXPIRATION,
|
|
2802
2803
|
refresh_token: refreshToken,
|
|
2803
2804
|
client_id: client.clientId,
|
|
2805
|
+
tenant_id: tenantId,
|
|
2804
2806
|
};
|
|
2805
2807
|
|
|
2806
2808
|
const headers = {
|
|
@@ -5138,6 +5140,7 @@ class ApiClient {
|
|
|
5138
5140
|
|
|
5139
5141
|
|
|
5140
5142
|
|
|
5143
|
+
|
|
5141
5144
|
|
|
5142
5145
|
|
|
5143
5146
|
|
|
@@ -5178,6 +5181,7 @@ class ApiClient {
|
|
|
5178
5181
|
logger$1.info('refresh token callback called', {
|
|
5179
5182
|
refreshToken: this.refreshToken,
|
|
5180
5183
|
refreshBackend: this.refreshBackend,
|
|
5184
|
+
refreshTenantId: this.refreshTenantId,
|
|
5181
5185
|
refreshExpiration: this.refreshExpiration,
|
|
5182
5186
|
isMobile: this.isMobile,
|
|
5183
5187
|
});
|
|
@@ -5191,6 +5195,7 @@ class ApiClient {
|
|
|
5191
5195
|
this.refreshBackend,
|
|
5192
5196
|
this.refreshExpiration,
|
|
5193
5197
|
this.isMobile,
|
|
5198
|
+
this.refreshTenantId,
|
|
5194
5199
|
);
|
|
5195
5200
|
|
|
5196
5201
|
logger$1.info('token refreshed', { token: session.token });
|
|
@@ -5232,6 +5237,10 @@ class ApiClient {
|
|
|
5232
5237
|
this.refreshBackend = refreshBackend;
|
|
5233
5238
|
}
|
|
5234
5239
|
|
|
5240
|
+
setRefreshTenantId(tenantId ) {
|
|
5241
|
+
this.refreshTenantId = tenantId;
|
|
5242
|
+
}
|
|
5243
|
+
|
|
5235
5244
|
setIsMobile(isMobile ) {
|
|
5236
5245
|
this.isMobile = isMobile;
|
|
5237
5246
|
}
|
|
@@ -7397,11 +7406,14 @@ class WebRTCClient extends Emitter {
|
|
|
7397
7406
|
}
|
|
7398
7407
|
|
|
7399
7408
|
async _disconnectTransport(force = false) {
|
|
7400
|
-
if (force) {
|
|
7409
|
+
if (force && this.userAgent && this.userAgent.transport) {
|
|
7401
7410
|
// Bypass sip.js state machine that prevent to close WS with the state `Connecting`
|
|
7402
7411
|
this.userAgent.transport.disconnectResolve = () => {};
|
|
7403
|
-
|
|
7404
|
-
this.userAgent.transport._ws
|
|
7412
|
+
|
|
7413
|
+
if (this.userAgent.transport._ws) {
|
|
7414
|
+
this.userAgent.transport._ws.close(1000);
|
|
7415
|
+
}
|
|
7416
|
+
|
|
7405
7417
|
return;
|
|
7406
7418
|
}
|
|
7407
7419
|
|
|
@@ -2795,12 +2795,14 @@ var authMethods = (client , baseUrl ) => ({
|
|
|
2795
2795
|
backend ,
|
|
2796
2796
|
expiration ,
|
|
2797
2797
|
isMobile = false,
|
|
2798
|
+
tenantId ,
|
|
2798
2799
|
) => {
|
|
2799
2800
|
const body = {
|
|
2800
2801
|
backend: backend || DEFAULT_BACKEND_USER,
|
|
2801
2802
|
expiration: expiration || DETAULT_EXPIRATION,
|
|
2802
2803
|
refresh_token: refreshToken,
|
|
2803
2804
|
client_id: client.clientId,
|
|
2805
|
+
tenant_id: tenantId,
|
|
2804
2806
|
};
|
|
2805
2807
|
|
|
2806
2808
|
const headers = {
|
|
@@ -5138,6 +5140,7 @@ class ApiClient {
|
|
|
5138
5140
|
|
|
5139
5141
|
|
|
5140
5142
|
|
|
5143
|
+
|
|
5141
5144
|
|
|
5142
5145
|
|
|
5143
5146
|
|
|
@@ -5178,6 +5181,7 @@ class ApiClient {
|
|
|
5178
5181
|
logger$1.info('refresh token callback called', {
|
|
5179
5182
|
refreshToken: this.refreshToken,
|
|
5180
5183
|
refreshBackend: this.refreshBackend,
|
|
5184
|
+
refreshTenantId: this.refreshTenantId,
|
|
5181
5185
|
refreshExpiration: this.refreshExpiration,
|
|
5182
5186
|
isMobile: this.isMobile,
|
|
5183
5187
|
});
|
|
@@ -5191,6 +5195,7 @@ class ApiClient {
|
|
|
5191
5195
|
this.refreshBackend,
|
|
5192
5196
|
this.refreshExpiration,
|
|
5193
5197
|
this.isMobile,
|
|
5198
|
+
this.refreshTenantId,
|
|
5194
5199
|
);
|
|
5195
5200
|
|
|
5196
5201
|
logger$1.info('token refreshed', { token: session.token });
|
|
@@ -5232,6 +5237,10 @@ class ApiClient {
|
|
|
5232
5237
|
this.refreshBackend = refreshBackend;
|
|
5233
5238
|
}
|
|
5234
5239
|
|
|
5240
|
+
setRefreshTenantId(tenantId ) {
|
|
5241
|
+
this.refreshTenantId = tenantId;
|
|
5242
|
+
}
|
|
5243
|
+
|
|
5235
5244
|
setIsMobile(isMobile ) {
|
|
5236
5245
|
this.isMobile = isMobile;
|
|
5237
5246
|
}
|
|
@@ -7397,11 +7406,14 @@ class WebRTCClient extends Emitter {
|
|
|
7397
7406
|
}
|
|
7398
7407
|
|
|
7399
7408
|
async _disconnectTransport(force = false) {
|
|
7400
|
-
if (force) {
|
|
7409
|
+
if (force && this.userAgent && this.userAgent.transport) {
|
|
7401
7410
|
// Bypass sip.js state machine that prevent to close WS with the state `Connecting`
|
|
7402
7411
|
this.userAgent.transport.disconnectResolve = () => {};
|
|
7403
|
-
|
|
7404
|
-
this.userAgent.transport._ws
|
|
7412
|
+
|
|
7413
|
+
if (this.userAgent.transport._ws) {
|
|
7414
|
+
this.userAgent.transport._ws.close(1000);
|
|
7415
|
+
}
|
|
7416
|
+
|
|
7405
7417
|
return;
|
|
7406
7418
|
}
|
|
7407
7419
|
|