@wazo/sdk 0.38.9 → 0.38.10
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 +21 -0
- 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 +21 -0
- package/esm/checker/checks/aor.js +21 -0
- package/esm/checker/checks/api.js +21 -0
- package/esm/checker/checks/index.js +21 -0
- package/esm/checker/checks/webrtc-transport.js +21 -0
- package/esm/checker/checks/webrtc.js +21 -0
- 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 +1 -0
- package/esm/index.js +73 -6
- package/esm/service/CallApi.js +28 -2
- package/esm/service/getApiClient.js +34 -3
- package/esm/simple/Auth.js +74 -7
- package/esm/simple/Configuration.js +73 -6
- package/esm/simple/Directory.js +28 -2
- package/esm/simple/Phone.js +73 -6
- package/esm/simple/Softphone.js +5 -0
- package/esm/simple/index.js +73 -6
- package/esm/simple/room/LocalParticipant.js +73 -6
- package/esm/simple/room/Participant.js +73 -6
- package/esm/simple/room/RemoteParticipant.js +73 -6
- package/esm/simple/room/Room.js +73 -6
- package/esm/simple/room/SipRoom.js +73 -6
- package/esm/simple/room/Stream.js +73 -6
- package/esm/simple/room/__tests__/Participant.test.js +73 -6
- package/esm/simple/room/__tests__/RemoteParticipant.test.js +73 -6
- package/esm/simple/utils.js +73 -6
- package/esm/web-rtc-client.js +21 -0
- package/lib/__tests__/api-client.test.js +21 -0
- package/lib/__tests__/web-rtc-client.test.js +21 -0
- 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 +21 -0
- package/lib/checker/checks/aor.js +21 -0
- package/lib/checker/checks/api.js +21 -0
- package/lib/checker/checks/index.js +21 -0
- package/lib/checker/checks/webrtc-transport.js +21 -0
- package/lib/checker/checks/webrtc.js +21 -0
- 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 +1 -0
- package/lib/index.js +73 -6
- package/lib/service/CallApi.js +28 -2
- package/lib/service/getApiClient.js +34 -2
- package/lib/simple/Auth.js +74 -6
- package/lib/simple/Configuration.js +73 -6
- package/lib/simple/Directory.js +28 -2
- package/lib/simple/Phone.js +73 -6
- package/lib/simple/Softphone.js +5 -0
- package/lib/simple/index.js +73 -6
- package/lib/simple/room/LocalParticipant.js +73 -6
- package/lib/simple/room/Participant.js +73 -6
- package/lib/simple/room/RemoteParticipant.js +73 -6
- package/lib/simple/room/Room.js +73 -6
- package/lib/simple/room/SipRoom.js +73 -6
- package/lib/simple/room/Stream.js +73 -6
- package/lib/simple/room/__tests__/Participant.test.js +73 -6
- package/lib/simple/room/__tests__/RemoteParticipant.test.js +73 -6
- package/lib/simple/utils.js +73 -6
- package/lib/web-rtc-client.js +21 -0
- package/package.json +2 -2
- package/src/api/auth.js +12 -0
- package/src/api-client.js +8 -0
- 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
|
@@ -2786,6 +2786,7 @@ var authMethods = (client , baseUrl ) => ({
|
|
|
2786
2786
|
|
|
2787
2787
|
|
|
2788
2788
|
|
|
2789
|
+
|
|
2789
2790
|
) {
|
|
2790
2791
|
const body = {
|
|
2791
2792
|
backend: params.backend || DEFAULT_BACKEND_USER,
|
|
@@ -2806,9 +2807,14 @@ var authMethods = (client , baseUrl ) => ({
|
|
|
2806
2807
|
}
|
|
2807
2808
|
|
|
2808
2809
|
if (params.tenantId) {
|
|
2810
|
+
console.warn('Use of `tenantId` is deprecated when calling logIn() method, use `domainName` instead.');
|
|
2809
2811
|
body.tenant_id = params.tenantId;
|
|
2810
2812
|
}
|
|
2811
2813
|
|
|
2814
|
+
if (params.domainName) {
|
|
2815
|
+
body.domain_name = params.domainName;
|
|
2816
|
+
}
|
|
2817
|
+
|
|
2812
2818
|
return client.post(`${baseUrl}/token`, body, headers).then(response => Session.parse(response));
|
|
2813
2819
|
},
|
|
2814
2820
|
|
|
@@ -2821,6 +2827,7 @@ var authMethods = (client , baseUrl ) => ({
|
|
|
2821
2827
|
expiration ,
|
|
2822
2828
|
isMobile = false,
|
|
2823
2829
|
tenantId ,
|
|
2830
|
+
domainName ,
|
|
2824
2831
|
) => {
|
|
2825
2832
|
const body = {
|
|
2826
2833
|
backend: backend || DEFAULT_BACKEND_USER,
|
|
@@ -2830,9 +2837,14 @@ var authMethods = (client , baseUrl ) => ({
|
|
|
2830
2837
|
};
|
|
2831
2838
|
|
|
2832
2839
|
if (tenantId) {
|
|
2840
|
+
console.warn('Use of `tenantId` is deprecated when calling refreshToken() method, use `domainName` instead.');
|
|
2833
2841
|
body.tenant_id = tenantId;
|
|
2834
2842
|
}
|
|
2835
2843
|
|
|
2844
|
+
if (domainName) {
|
|
2845
|
+
body.domain_name = domainName;
|
|
2846
|
+
}
|
|
2847
|
+
|
|
2836
2848
|
const headers = {
|
|
2837
2849
|
'Content-Type': 'application/json',
|
|
2838
2850
|
...(isMobile ? { 'Wazo-Session-Type': 'mobile' } : {}),
|
|
@@ -4259,6 +4271,7 @@ global.wazoClientId = global.wazoClientId || {};
|
|
|
4259
4271
|
global.wazoClientToken = global.wazoClientToken || {};
|
|
4260
4272
|
global.wazoRefreshToken = global.wazoRefreshToken || {};
|
|
4261
4273
|
global.wazoRefreshTenantId = global.wazoRefreshTenantId || {};
|
|
4274
|
+
global.wazoRefreshDomainName = global.wazoRefreshDomainName || {};
|
|
4262
4275
|
global.wazoOnRefreshToken = global.wazoOnRefreshToken || {};
|
|
4263
4276
|
global.wazoOnRefreshTokenError = global.wazoOnRefreshTokenError || {};
|
|
4264
4277
|
global.wazoRefreshExpiration = global.wazoRefreshExpiration || {};
|
|
@@ -5318,6 +5331,7 @@ class ApiClient {
|
|
|
5318
5331
|
|
|
5319
5332
|
|
|
5320
5333
|
|
|
5334
|
+
|
|
5321
5335
|
|
|
5322
5336
|
|
|
5323
5337
|
|
|
@@ -5359,6 +5373,7 @@ class ApiClient {
|
|
|
5359
5373
|
refreshToken: this.refreshToken,
|
|
5360
5374
|
refreshBackend: this.refreshBackend,
|
|
5361
5375
|
refreshTenantId: this.refreshTenantId,
|
|
5376
|
+
refreshDomainName: this.refreshDomainName,
|
|
5362
5377
|
refreshExpiration: this.refreshExpiration,
|
|
5363
5378
|
isMobile: this.isMobile,
|
|
5364
5379
|
});
|
|
@@ -5374,6 +5389,7 @@ class ApiClient {
|
|
|
5374
5389
|
this.refreshExpiration,
|
|
5375
5390
|
this.isMobile,
|
|
5376
5391
|
this.refreshTenantId,
|
|
5392
|
+
this.refreshDomainName,
|
|
5377
5393
|
);
|
|
5378
5394
|
|
|
5379
5395
|
logger$1.info('token refreshed', { token: session.token });
|
|
@@ -5427,9 +5443,14 @@ class ApiClient {
|
|
|
5427
5443
|
}
|
|
5428
5444
|
|
|
5429
5445
|
setRefreshTenantId(tenantId ) {
|
|
5446
|
+
console.warn('Use of `setRefreshTenantId` is deprecated, use `setRefreshDomainName` instead');
|
|
5430
5447
|
this.refreshTenantId = tenantId;
|
|
5431
5448
|
}
|
|
5432
5449
|
|
|
5450
|
+
setRefreshDomainName(domainName ) {
|
|
5451
|
+
this.refreshDomainName = domainName;
|
|
5452
|
+
}
|
|
5453
|
+
|
|
5433
5454
|
setIsMobile(isMobile ) {
|
|
5434
5455
|
this.isMobile = isMobile;
|
|
5435
5456
|
}
|
|
@@ -2786,6 +2786,7 @@ var authMethods = (client , baseUrl ) => ({
|
|
|
2786
2786
|
|
|
2787
2787
|
|
|
2788
2788
|
|
|
2789
|
+
|
|
2789
2790
|
) {
|
|
2790
2791
|
const body = {
|
|
2791
2792
|
backend: params.backend || DEFAULT_BACKEND_USER,
|
|
@@ -2806,9 +2807,14 @@ var authMethods = (client , baseUrl ) => ({
|
|
|
2806
2807
|
}
|
|
2807
2808
|
|
|
2808
2809
|
if (params.tenantId) {
|
|
2810
|
+
console.warn('Use of `tenantId` is deprecated when calling logIn() method, use `domainName` instead.');
|
|
2809
2811
|
body.tenant_id = params.tenantId;
|
|
2810
2812
|
}
|
|
2811
2813
|
|
|
2814
|
+
if (params.domainName) {
|
|
2815
|
+
body.domain_name = params.domainName;
|
|
2816
|
+
}
|
|
2817
|
+
|
|
2812
2818
|
return client.post(`${baseUrl}/token`, body, headers).then(response => Session.parse(response));
|
|
2813
2819
|
},
|
|
2814
2820
|
|
|
@@ -2821,6 +2827,7 @@ var authMethods = (client , baseUrl ) => ({
|
|
|
2821
2827
|
expiration ,
|
|
2822
2828
|
isMobile = false,
|
|
2823
2829
|
tenantId ,
|
|
2830
|
+
domainName ,
|
|
2824
2831
|
) => {
|
|
2825
2832
|
const body = {
|
|
2826
2833
|
backend: backend || DEFAULT_BACKEND_USER,
|
|
@@ -2830,9 +2837,14 @@ var authMethods = (client , baseUrl ) => ({
|
|
|
2830
2837
|
};
|
|
2831
2838
|
|
|
2832
2839
|
if (tenantId) {
|
|
2840
|
+
console.warn('Use of `tenantId` is deprecated when calling refreshToken() method, use `domainName` instead.');
|
|
2833
2841
|
body.tenant_id = tenantId;
|
|
2834
2842
|
}
|
|
2835
2843
|
|
|
2844
|
+
if (domainName) {
|
|
2845
|
+
body.domain_name = domainName;
|
|
2846
|
+
}
|
|
2847
|
+
|
|
2836
2848
|
const headers = {
|
|
2837
2849
|
'Content-Type': 'application/json',
|
|
2838
2850
|
...(isMobile ? { 'Wazo-Session-Type': 'mobile' } : {}),
|
|
@@ -4259,6 +4271,7 @@ global.wazoClientId = global.wazoClientId || {};
|
|
|
4259
4271
|
global.wazoClientToken = global.wazoClientToken || {};
|
|
4260
4272
|
global.wazoRefreshToken = global.wazoRefreshToken || {};
|
|
4261
4273
|
global.wazoRefreshTenantId = global.wazoRefreshTenantId || {};
|
|
4274
|
+
global.wazoRefreshDomainName = global.wazoRefreshDomainName || {};
|
|
4262
4275
|
global.wazoOnRefreshToken = global.wazoOnRefreshToken || {};
|
|
4263
4276
|
global.wazoOnRefreshTokenError = global.wazoOnRefreshTokenError || {};
|
|
4264
4277
|
global.wazoRefreshExpiration = global.wazoRefreshExpiration || {};
|
|
@@ -5318,6 +5331,7 @@ class ApiClient {
|
|
|
5318
5331
|
|
|
5319
5332
|
|
|
5320
5333
|
|
|
5334
|
+
|
|
5321
5335
|
|
|
5322
5336
|
|
|
5323
5337
|
|
|
@@ -5359,6 +5373,7 @@ class ApiClient {
|
|
|
5359
5373
|
refreshToken: this.refreshToken,
|
|
5360
5374
|
refreshBackend: this.refreshBackend,
|
|
5361
5375
|
refreshTenantId: this.refreshTenantId,
|
|
5376
|
+
refreshDomainName: this.refreshDomainName,
|
|
5362
5377
|
refreshExpiration: this.refreshExpiration,
|
|
5363
5378
|
isMobile: this.isMobile,
|
|
5364
5379
|
});
|
|
@@ -5374,6 +5389,7 @@ class ApiClient {
|
|
|
5374
5389
|
this.refreshExpiration,
|
|
5375
5390
|
this.isMobile,
|
|
5376
5391
|
this.refreshTenantId,
|
|
5392
|
+
this.refreshDomainName,
|
|
5377
5393
|
);
|
|
5378
5394
|
|
|
5379
5395
|
logger$1.info('token refreshed', { token: session.token });
|
|
@@ -5427,9 +5443,14 @@ class ApiClient {
|
|
|
5427
5443
|
}
|
|
5428
5444
|
|
|
5429
5445
|
setRefreshTenantId(tenantId ) {
|
|
5446
|
+
console.warn('Use of `setRefreshTenantId` is deprecated, use `setRefreshDomainName` instead');
|
|
5430
5447
|
this.refreshTenantId = tenantId;
|
|
5431
5448
|
}
|
|
5432
5449
|
|
|
5450
|
+
setRefreshDomainName(domainName ) {
|
|
5451
|
+
this.refreshDomainName = domainName;
|
|
5452
|
+
}
|
|
5453
|
+
|
|
5433
5454
|
setIsMobile(isMobile ) {
|
|
5434
5455
|
this.isMobile = isMobile;
|
|
5435
5456
|
}
|
|
@@ -2424,6 +2424,7 @@ var authMethods = (client , baseUrl ) => ({
|
|
|
2424
2424
|
|
|
2425
2425
|
|
|
2426
2426
|
|
|
2427
|
+
|
|
2427
2428
|
) {
|
|
2428
2429
|
const body = {
|
|
2429
2430
|
backend: params.backend || DEFAULT_BACKEND_USER,
|
|
@@ -2444,9 +2445,14 @@ var authMethods = (client , baseUrl ) => ({
|
|
|
2444
2445
|
}
|
|
2445
2446
|
|
|
2446
2447
|
if (params.tenantId) {
|
|
2448
|
+
console.warn('Use of `tenantId` is deprecated when calling logIn() method, use `domainName` instead.');
|
|
2447
2449
|
body.tenant_id = params.tenantId;
|
|
2448
2450
|
}
|
|
2449
2451
|
|
|
2452
|
+
if (params.domainName) {
|
|
2453
|
+
body.domain_name = params.domainName;
|
|
2454
|
+
}
|
|
2455
|
+
|
|
2450
2456
|
return client.post(`${baseUrl}/token`, body, headers).then(response => Session.parse(response));
|
|
2451
2457
|
},
|
|
2452
2458
|
|
|
@@ -2459,6 +2465,7 @@ var authMethods = (client , baseUrl ) => ({
|
|
|
2459
2465
|
expiration ,
|
|
2460
2466
|
isMobile = false,
|
|
2461
2467
|
tenantId ,
|
|
2468
|
+
domainName ,
|
|
2462
2469
|
) => {
|
|
2463
2470
|
const body = {
|
|
2464
2471
|
backend: backend || DEFAULT_BACKEND_USER,
|
|
@@ -2468,9 +2475,14 @@ var authMethods = (client , baseUrl ) => ({
|
|
|
2468
2475
|
};
|
|
2469
2476
|
|
|
2470
2477
|
if (tenantId) {
|
|
2478
|
+
console.warn('Use of `tenantId` is deprecated when calling refreshToken() method, use `domainName` instead.');
|
|
2471
2479
|
body.tenant_id = tenantId;
|
|
2472
2480
|
}
|
|
2473
2481
|
|
|
2482
|
+
if (domainName) {
|
|
2483
|
+
body.domain_name = domainName;
|
|
2484
|
+
}
|
|
2485
|
+
|
|
2474
2486
|
const headers = {
|
|
2475
2487
|
'Content-Type': 'application/json',
|
|
2476
2488
|
...(isMobile ? { 'Wazo-Session-Type': 'mobile' } : {}),
|
|
@@ -4724,6 +4736,7 @@ class ApiClient {
|
|
|
4724
4736
|
|
|
4725
4737
|
|
|
4726
4738
|
|
|
4739
|
+
|
|
4727
4740
|
|
|
4728
4741
|
|
|
4729
4742
|
|
|
@@ -4765,6 +4778,7 @@ class ApiClient {
|
|
|
4765
4778
|
refreshToken: this.refreshToken,
|
|
4766
4779
|
refreshBackend: this.refreshBackend,
|
|
4767
4780
|
refreshTenantId: this.refreshTenantId,
|
|
4781
|
+
refreshDomainName: this.refreshDomainName,
|
|
4768
4782
|
refreshExpiration: this.refreshExpiration,
|
|
4769
4783
|
isMobile: this.isMobile,
|
|
4770
4784
|
});
|
|
@@ -4780,6 +4794,7 @@ class ApiClient {
|
|
|
4780
4794
|
this.refreshExpiration,
|
|
4781
4795
|
this.isMobile,
|
|
4782
4796
|
this.refreshTenantId,
|
|
4797
|
+
this.refreshDomainName,
|
|
4783
4798
|
);
|
|
4784
4799
|
|
|
4785
4800
|
logger.info('token refreshed', { token: session.token });
|
|
@@ -4833,9 +4848,14 @@ class ApiClient {
|
|
|
4833
4848
|
}
|
|
4834
4849
|
|
|
4835
4850
|
setRefreshTenantId(tenantId ) {
|
|
4851
|
+
console.warn('Use of `setRefreshTenantId` is deprecated, use `setRefreshDomainName` instead');
|
|
4836
4852
|
this.refreshTenantId = tenantId;
|
|
4837
4853
|
}
|
|
4838
4854
|
|
|
4855
|
+
setRefreshDomainName(domainName ) {
|
|
4856
|
+
this.refreshDomainName = domainName;
|
|
4857
|
+
}
|
|
4858
|
+
|
|
4839
4859
|
setIsMobile(isMobile ) {
|
|
4840
4860
|
this.isMobile = isMobile;
|
|
4841
4861
|
}
|
|
@@ -4860,6 +4880,7 @@ global.wazoClientId = global.wazoClientId || {};
|
|
|
4860
4880
|
global.wazoClientToken = global.wazoClientToken || {};
|
|
4861
4881
|
global.wazoRefreshToken = global.wazoRefreshToken || {};
|
|
4862
4882
|
global.wazoRefreshTenantId = global.wazoRefreshTenantId || {};
|
|
4883
|
+
global.wazoRefreshDomainName = global.wazoRefreshDomainName || {};
|
|
4863
4884
|
global.wazoOnRefreshToken = global.wazoOnRefreshToken || {};
|
|
4864
4885
|
global.wazoOnRefreshTokenError = global.wazoOnRefreshTokenError || {};
|
|
4865
4886
|
global.wazoRefreshExpiration = global.wazoRefreshExpiration || {};
|
|
@@ -4869,6 +4890,7 @@ global.wazoFetchOptions = global.wazoFetchOptions || {};
|
|
|
4869
4890
|
|
|
4870
4891
|
const fillClient = (apiClient ) => {
|
|
4871
4892
|
const { server, token, clientId } = apiClient.client;
|
|
4893
|
+
const tenantId = global.wazoRefreshTenantId[server] || global.wazoRefreshTenantId[null] || apiClient.refreshTenantId;
|
|
4872
4894
|
|
|
4873
4895
|
// try with null server when dealing with non-related server info
|
|
4874
4896
|
apiClient.setToken(global.wazoClientToken[server] || global.wazoClientToken[null] || token);
|
|
@@ -4877,8 +4899,12 @@ const fillClient = (apiClient ) => {
|
|
|
4877
4899
|
|
|
4878
4900
|
apiClient.setRefreshToken(global.wazoRefreshToken[server] || global.wazoRefreshToken[null] || apiClient.refreshToken);
|
|
4879
4901
|
|
|
4880
|
-
|
|
4881
|
-
|
|
4902
|
+
if (tenantId) {
|
|
4903
|
+
apiClient.setRefreshTenantId(tenantId);
|
|
4904
|
+
}
|
|
4905
|
+
|
|
4906
|
+
apiClient.setRefreshDomainName(
|
|
4907
|
+
global.wazoRefreshDomainName[server] || global.wazoRefreshDomainName[null] || apiClient.refreshDomainName,
|
|
4882
4908
|
);
|
|
4883
4909
|
|
|
4884
4910
|
apiClient.setFetchOptions(global.wazoFetchOptions[server] || global.wazoFetchOptions[null] || apiClient.fetchOptions);
|
package/esm/domain/Features.js
CHANGED
|
@@ -2209,6 +2209,7 @@ var authMethods = (client , baseUrl ) => ({
|
|
|
2209
2209
|
|
|
2210
2210
|
|
|
2211
2211
|
|
|
2212
|
+
|
|
2212
2213
|
) {
|
|
2213
2214
|
const body = {
|
|
2214
2215
|
backend: params.backend || DEFAULT_BACKEND_USER,
|
|
@@ -2229,9 +2230,14 @@ var authMethods = (client , baseUrl ) => ({
|
|
|
2229
2230
|
}
|
|
2230
2231
|
|
|
2231
2232
|
if (params.tenantId) {
|
|
2233
|
+
console.warn('Use of `tenantId` is deprecated when calling logIn() method, use `domainName` instead.');
|
|
2232
2234
|
body.tenant_id = params.tenantId;
|
|
2233
2235
|
}
|
|
2234
2236
|
|
|
2237
|
+
if (params.domainName) {
|
|
2238
|
+
body.domain_name = params.domainName;
|
|
2239
|
+
}
|
|
2240
|
+
|
|
2235
2241
|
return client.post(`${baseUrl}/token`, body, headers).then(response => Session.parse(response));
|
|
2236
2242
|
},
|
|
2237
2243
|
|
|
@@ -2244,6 +2250,7 @@ var authMethods = (client , baseUrl ) => ({
|
|
|
2244
2250
|
expiration ,
|
|
2245
2251
|
isMobile = false,
|
|
2246
2252
|
tenantId ,
|
|
2253
|
+
domainName ,
|
|
2247
2254
|
) => {
|
|
2248
2255
|
const body = {
|
|
2249
2256
|
backend: backend || DEFAULT_BACKEND_USER,
|
|
@@ -2253,9 +2260,14 @@ var authMethods = (client , baseUrl ) => ({
|
|
|
2253
2260
|
};
|
|
2254
2261
|
|
|
2255
2262
|
if (tenantId) {
|
|
2263
|
+
console.warn('Use of `tenantId` is deprecated when calling refreshToken() method, use `domainName` instead.');
|
|
2256
2264
|
body.tenant_id = tenantId;
|
|
2257
2265
|
}
|
|
2258
2266
|
|
|
2267
|
+
if (domainName) {
|
|
2268
|
+
body.domain_name = domainName;
|
|
2269
|
+
}
|
|
2270
|
+
|
|
2259
2271
|
const headers = {
|
|
2260
2272
|
'Content-Type': 'application/json',
|
|
2261
2273
|
...(isMobile ? { 'Wazo-Session-Type': 'mobile' } : {}),
|
|
@@ -4724,6 +4736,7 @@ class ApiClient {
|
|
|
4724
4736
|
|
|
4725
4737
|
|
|
4726
4738
|
|
|
4739
|
+
|
|
4727
4740
|
|
|
4728
4741
|
|
|
4729
4742
|
|
|
@@ -4765,6 +4778,7 @@ class ApiClient {
|
|
|
4765
4778
|
refreshToken: this.refreshToken,
|
|
4766
4779
|
refreshBackend: this.refreshBackend,
|
|
4767
4780
|
refreshTenantId: this.refreshTenantId,
|
|
4781
|
+
refreshDomainName: this.refreshDomainName,
|
|
4768
4782
|
refreshExpiration: this.refreshExpiration,
|
|
4769
4783
|
isMobile: this.isMobile,
|
|
4770
4784
|
});
|
|
@@ -4780,6 +4794,7 @@ class ApiClient {
|
|
|
4780
4794
|
this.refreshExpiration,
|
|
4781
4795
|
this.isMobile,
|
|
4782
4796
|
this.refreshTenantId,
|
|
4797
|
+
this.refreshDomainName,
|
|
4783
4798
|
);
|
|
4784
4799
|
|
|
4785
4800
|
logger.info('token refreshed', { token: session.token });
|
|
@@ -4833,9 +4848,14 @@ class ApiClient {
|
|
|
4833
4848
|
}
|
|
4834
4849
|
|
|
4835
4850
|
setRefreshTenantId(tenantId ) {
|
|
4851
|
+
console.warn('Use of `setRefreshTenantId` is deprecated, use `setRefreshDomainName` instead');
|
|
4836
4852
|
this.refreshTenantId = tenantId;
|
|
4837
4853
|
}
|
|
4838
4854
|
|
|
4855
|
+
setRefreshDomainName(domainName ) {
|
|
4856
|
+
this.refreshDomainName = domainName;
|
|
4857
|
+
}
|
|
4858
|
+
|
|
4839
4859
|
setIsMobile(isMobile ) {
|
|
4840
4860
|
this.isMobile = isMobile;
|
|
4841
4861
|
}
|
|
@@ -4860,6 +4880,7 @@ global.wazoClientId = global.wazoClientId || {};
|
|
|
4860
4880
|
global.wazoClientToken = global.wazoClientToken || {};
|
|
4861
4881
|
global.wazoRefreshToken = global.wazoRefreshToken || {};
|
|
4862
4882
|
global.wazoRefreshTenantId = global.wazoRefreshTenantId || {};
|
|
4883
|
+
global.wazoRefreshDomainName = global.wazoRefreshDomainName || {};
|
|
4863
4884
|
global.wazoOnRefreshToken = global.wazoOnRefreshToken || {};
|
|
4864
4885
|
global.wazoOnRefreshTokenError = global.wazoOnRefreshTokenError || {};
|
|
4865
4886
|
global.wazoRefreshExpiration = global.wazoRefreshExpiration || {};
|
|
@@ -4869,6 +4890,7 @@ global.wazoFetchOptions = global.wazoFetchOptions || {};
|
|
|
4869
4890
|
|
|
4870
4891
|
const fillClient = (apiClient ) => {
|
|
4871
4892
|
const { server, token, clientId } = apiClient.client;
|
|
4893
|
+
const tenantId = global.wazoRefreshTenantId[server] || global.wazoRefreshTenantId[null] || apiClient.refreshTenantId;
|
|
4872
4894
|
|
|
4873
4895
|
// try with null server when dealing with non-related server info
|
|
4874
4896
|
apiClient.setToken(global.wazoClientToken[server] || global.wazoClientToken[null] || token);
|
|
@@ -4877,8 +4899,12 @@ const fillClient = (apiClient ) => {
|
|
|
4877
4899
|
|
|
4878
4900
|
apiClient.setRefreshToken(global.wazoRefreshToken[server] || global.wazoRefreshToken[null] || apiClient.refreshToken);
|
|
4879
4901
|
|
|
4880
|
-
|
|
4881
|
-
|
|
4902
|
+
if (tenantId) {
|
|
4903
|
+
apiClient.setRefreshTenantId(tenantId);
|
|
4904
|
+
}
|
|
4905
|
+
|
|
4906
|
+
apiClient.setRefreshDomainName(
|
|
4907
|
+
global.wazoRefreshDomainName[server] || global.wazoRefreshDomainName[null] || apiClient.refreshDomainName,
|
|
4882
4908
|
);
|
|
4883
4909
|
|
|
4884
4910
|
apiClient.setFetchOptions(global.wazoFetchOptions[server] || global.wazoFetchOptions[null] || apiClient.fetchOptions);
|
|
@@ -3175,6 +3175,7 @@ var authMethods = (client , baseUrl ) => ({
|
|
|
3175
3175
|
|
|
3176
3176
|
|
|
3177
3177
|
|
|
3178
|
+
|
|
3178
3179
|
) {
|
|
3179
3180
|
const body = {
|
|
3180
3181
|
backend: params.backend || DEFAULT_BACKEND_USER,
|
|
@@ -3195,9 +3196,14 @@ var authMethods = (client , baseUrl ) => ({
|
|
|
3195
3196
|
}
|
|
3196
3197
|
|
|
3197
3198
|
if (params.tenantId) {
|
|
3199
|
+
console.warn('Use of `tenantId` is deprecated when calling logIn() method, use `domainName` instead.');
|
|
3198
3200
|
body.tenant_id = params.tenantId;
|
|
3199
3201
|
}
|
|
3200
3202
|
|
|
3203
|
+
if (params.domainName) {
|
|
3204
|
+
body.domain_name = params.domainName;
|
|
3205
|
+
}
|
|
3206
|
+
|
|
3201
3207
|
return client.post(`${baseUrl}/token`, body, headers).then(response => Session.parse(response));
|
|
3202
3208
|
},
|
|
3203
3209
|
|
|
@@ -3210,6 +3216,7 @@ var authMethods = (client , baseUrl ) => ({
|
|
|
3210
3216
|
expiration ,
|
|
3211
3217
|
isMobile = false,
|
|
3212
3218
|
tenantId ,
|
|
3219
|
+
domainName ,
|
|
3213
3220
|
) => {
|
|
3214
3221
|
const body = {
|
|
3215
3222
|
backend: backend || DEFAULT_BACKEND_USER,
|
|
@@ -3219,9 +3226,14 @@ var authMethods = (client , baseUrl ) => ({
|
|
|
3219
3226
|
};
|
|
3220
3227
|
|
|
3221
3228
|
if (tenantId) {
|
|
3229
|
+
console.warn('Use of `tenantId` is deprecated when calling refreshToken() method, use `domainName` instead.');
|
|
3222
3230
|
body.tenant_id = tenantId;
|
|
3223
3231
|
}
|
|
3224
3232
|
|
|
3233
|
+
if (domainName) {
|
|
3234
|
+
body.domain_name = domainName;
|
|
3235
|
+
}
|
|
3236
|
+
|
|
3225
3237
|
const headers = {
|
|
3226
3238
|
'Content-Type': 'application/json',
|
|
3227
3239
|
...(isMobile ? { 'Wazo-Session-Type': 'mobile' } : {}),
|
|
@@ -5137,6 +5149,7 @@ class ApiClient {
|
|
|
5137
5149
|
|
|
5138
5150
|
|
|
5139
5151
|
|
|
5152
|
+
|
|
5140
5153
|
|
|
5141
5154
|
|
|
5142
5155
|
|
|
@@ -5178,6 +5191,7 @@ class ApiClient {
|
|
|
5178
5191
|
refreshToken: this.refreshToken,
|
|
5179
5192
|
refreshBackend: this.refreshBackend,
|
|
5180
5193
|
refreshTenantId: this.refreshTenantId,
|
|
5194
|
+
refreshDomainName: this.refreshDomainName,
|
|
5181
5195
|
refreshExpiration: this.refreshExpiration,
|
|
5182
5196
|
isMobile: this.isMobile,
|
|
5183
5197
|
});
|
|
@@ -5193,6 +5207,7 @@ class ApiClient {
|
|
|
5193
5207
|
this.refreshExpiration,
|
|
5194
5208
|
this.isMobile,
|
|
5195
5209
|
this.refreshTenantId,
|
|
5210
|
+
this.refreshDomainName,
|
|
5196
5211
|
);
|
|
5197
5212
|
|
|
5198
5213
|
logger$1.info('token refreshed', { token: session.token });
|
|
@@ -5246,9 +5261,14 @@ class ApiClient {
|
|
|
5246
5261
|
}
|
|
5247
5262
|
|
|
5248
5263
|
setRefreshTenantId(tenantId ) {
|
|
5264
|
+
console.warn('Use of `setRefreshTenantId` is deprecated, use `setRefreshDomainName` instead');
|
|
5249
5265
|
this.refreshTenantId = tenantId;
|
|
5250
5266
|
}
|
|
5251
5267
|
|
|
5268
|
+
setRefreshDomainName(domainName ) {
|
|
5269
|
+
this.refreshDomainName = domainName;
|
|
5270
|
+
}
|
|
5271
|
+
|
|
5252
5272
|
setIsMobile(isMobile ) {
|
|
5253
5273
|
this.isMobile = isMobile;
|
|
5254
5274
|
}
|
|
@@ -5273,6 +5293,7 @@ global.wazoClientId = global.wazoClientId || {};
|
|
|
5273
5293
|
global.wazoClientToken = global.wazoClientToken || {};
|
|
5274
5294
|
global.wazoRefreshToken = global.wazoRefreshToken || {};
|
|
5275
5295
|
global.wazoRefreshTenantId = global.wazoRefreshTenantId || {};
|
|
5296
|
+
global.wazoRefreshDomainName = global.wazoRefreshDomainName || {};
|
|
5276
5297
|
global.wazoOnRefreshToken = global.wazoOnRefreshToken || {};
|
|
5277
5298
|
global.wazoOnRefreshTokenError = global.wazoOnRefreshTokenError || {};
|
|
5278
5299
|
global.wazoRefreshExpiration = global.wazoRefreshExpiration || {};
|
|
@@ -5282,6 +5303,7 @@ global.wazoFetchOptions = global.wazoFetchOptions || {};
|
|
|
5282
5303
|
|
|
5283
5304
|
const fillClient = (apiClient ) => {
|
|
5284
5305
|
const { server, token, clientId } = apiClient.client;
|
|
5306
|
+
const tenantId = global.wazoRefreshTenantId[server] || global.wazoRefreshTenantId[null] || apiClient.refreshTenantId;
|
|
5285
5307
|
|
|
5286
5308
|
// try with null server when dealing with non-related server info
|
|
5287
5309
|
apiClient.setToken(global.wazoClientToken[server] || global.wazoClientToken[null] || token);
|
|
@@ -5290,8 +5312,12 @@ const fillClient = (apiClient ) => {
|
|
|
5290
5312
|
|
|
5291
5313
|
apiClient.setRefreshToken(global.wazoRefreshToken[server] || global.wazoRefreshToken[null] || apiClient.refreshToken);
|
|
5292
5314
|
|
|
5293
|
-
|
|
5294
|
-
|
|
5315
|
+
if (tenantId) {
|
|
5316
|
+
apiClient.setRefreshTenantId(tenantId);
|
|
5317
|
+
}
|
|
5318
|
+
|
|
5319
|
+
apiClient.setRefreshDomainName(
|
|
5320
|
+
global.wazoRefreshDomainName[server] || global.wazoRefreshDomainName[null] || apiClient.refreshDomainName,
|
|
5295
5321
|
);
|
|
5296
5322
|
|
|
5297
5323
|
apiClient.setFetchOptions(global.wazoFetchOptions[server] || global.wazoFetchOptions[null] || apiClient.fetchOptions);
|
|
@@ -894,6 +894,7 @@ global.wazoClientId = global.wazoClientId || {};
|
|
|
894
894
|
global.wazoClientToken = global.wazoClientToken || {};
|
|
895
895
|
global.wazoRefreshToken = global.wazoRefreshToken || {};
|
|
896
896
|
global.wazoRefreshTenantId = global.wazoRefreshTenantId || {};
|
|
897
|
+
global.wazoRefreshDomainName = global.wazoRefreshDomainName || {};
|
|
897
898
|
global.wazoOnRefreshToken = global.wazoOnRefreshToken || {};
|
|
898
899
|
global.wazoOnRefreshTokenError = global.wazoOnRefreshTokenError || {};
|
|
899
900
|
global.wazoRefreshExpiration = global.wazoRefreshExpiration || {};
|