@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
|
@@ -2237,6 +2237,7 @@ var authMethods = (client , baseUrl ) => ({
|
|
|
2237
2237
|
|
|
2238
2238
|
|
|
2239
2239
|
|
|
2240
|
+
|
|
2240
2241
|
) {
|
|
2241
2242
|
const body = {
|
|
2242
2243
|
backend: params.backend || DEFAULT_BACKEND_USER,
|
|
@@ -2257,9 +2258,14 @@ var authMethods = (client , baseUrl ) => ({
|
|
|
2257
2258
|
}
|
|
2258
2259
|
|
|
2259
2260
|
if (params.tenantId) {
|
|
2261
|
+
console.warn('Use of `tenantId` is deprecated when calling logIn() method, use `domainName` instead.');
|
|
2260
2262
|
body.tenant_id = params.tenantId;
|
|
2261
2263
|
}
|
|
2262
2264
|
|
|
2265
|
+
if (params.domainName) {
|
|
2266
|
+
body.domain_name = params.domainName;
|
|
2267
|
+
}
|
|
2268
|
+
|
|
2263
2269
|
return client.post(`${baseUrl}/token`, body, headers).then(response => Session.parse(response));
|
|
2264
2270
|
},
|
|
2265
2271
|
|
|
@@ -2272,6 +2278,7 @@ var authMethods = (client , baseUrl ) => ({
|
|
|
2272
2278
|
expiration ,
|
|
2273
2279
|
isMobile = false,
|
|
2274
2280
|
tenantId ,
|
|
2281
|
+
domainName ,
|
|
2275
2282
|
) => {
|
|
2276
2283
|
const body = {
|
|
2277
2284
|
backend: backend || DEFAULT_BACKEND_USER,
|
|
@@ -2281,9 +2288,14 @@ var authMethods = (client , baseUrl ) => ({
|
|
|
2281
2288
|
};
|
|
2282
2289
|
|
|
2283
2290
|
if (tenantId) {
|
|
2291
|
+
console.warn('Use of `tenantId` is deprecated when calling refreshToken() method, use `domainName` instead.');
|
|
2284
2292
|
body.tenant_id = tenantId;
|
|
2285
2293
|
}
|
|
2286
2294
|
|
|
2295
|
+
if (domainName) {
|
|
2296
|
+
body.domain_name = domainName;
|
|
2297
|
+
}
|
|
2298
|
+
|
|
2287
2299
|
const headers = {
|
|
2288
2300
|
'Content-Type': 'application/json',
|
|
2289
2301
|
...(isMobile ? { 'Wazo-Session-Type': 'mobile' } : {}),
|
|
@@ -3736,6 +3748,7 @@ global.wazoClientId = global.wazoClientId || {};
|
|
|
3736
3748
|
global.wazoClientToken = global.wazoClientToken || {};
|
|
3737
3749
|
global.wazoRefreshToken = global.wazoRefreshToken || {};
|
|
3738
3750
|
global.wazoRefreshTenantId = global.wazoRefreshTenantId || {};
|
|
3751
|
+
global.wazoRefreshDomainName = global.wazoRefreshDomainName || {};
|
|
3739
3752
|
global.wazoOnRefreshToken = global.wazoOnRefreshToken || {};
|
|
3740
3753
|
global.wazoOnRefreshTokenError = global.wazoOnRefreshTokenError || {};
|
|
3741
3754
|
global.wazoRefreshExpiration = global.wazoRefreshExpiration || {};
|
|
@@ -4795,6 +4808,7 @@ class ApiClient {
|
|
|
4795
4808
|
|
|
4796
4809
|
|
|
4797
4810
|
|
|
4811
|
+
|
|
4798
4812
|
|
|
4799
4813
|
|
|
4800
4814
|
|
|
@@ -4836,6 +4850,7 @@ class ApiClient {
|
|
|
4836
4850
|
refreshToken: this.refreshToken,
|
|
4837
4851
|
refreshBackend: this.refreshBackend,
|
|
4838
4852
|
refreshTenantId: this.refreshTenantId,
|
|
4853
|
+
refreshDomainName: this.refreshDomainName,
|
|
4839
4854
|
refreshExpiration: this.refreshExpiration,
|
|
4840
4855
|
isMobile: this.isMobile,
|
|
4841
4856
|
});
|
|
@@ -4851,6 +4866,7 @@ class ApiClient {
|
|
|
4851
4866
|
this.refreshExpiration,
|
|
4852
4867
|
this.isMobile,
|
|
4853
4868
|
this.refreshTenantId,
|
|
4869
|
+
this.refreshDomainName,
|
|
4854
4870
|
);
|
|
4855
4871
|
|
|
4856
4872
|
logger$2.info('token refreshed', { token: session.token });
|
|
@@ -4904,9 +4920,14 @@ class ApiClient {
|
|
|
4904
4920
|
}
|
|
4905
4921
|
|
|
4906
4922
|
setRefreshTenantId(tenantId ) {
|
|
4923
|
+
console.warn('Use of `setRefreshTenantId` is deprecated, use `setRefreshDomainName` instead');
|
|
4907
4924
|
this.refreshTenantId = tenantId;
|
|
4908
4925
|
}
|
|
4909
4926
|
|
|
4927
|
+
setRefreshDomainName(domainName ) {
|
|
4928
|
+
this.refreshDomainName = domainName;
|
|
4929
|
+
}
|
|
4930
|
+
|
|
4910
4931
|
setIsMobile(isMobile ) {
|
|
4911
4932
|
this.isMobile = isMobile;
|
|
4912
4933
|
}
|
|
@@ -2795,6 +2795,7 @@ var authMethods = (client , baseUrl ) => ({
|
|
|
2795
2795
|
|
|
2796
2796
|
|
|
2797
2797
|
|
|
2798
|
+
|
|
2798
2799
|
) {
|
|
2799
2800
|
const body = {
|
|
2800
2801
|
backend: params.backend || DEFAULT_BACKEND_USER,
|
|
@@ -2815,9 +2816,14 @@ var authMethods = (client , baseUrl ) => ({
|
|
|
2815
2816
|
}
|
|
2816
2817
|
|
|
2817
2818
|
if (params.tenantId) {
|
|
2819
|
+
console.warn('Use of `tenantId` is deprecated when calling logIn() method, use `domainName` instead.');
|
|
2818
2820
|
body.tenant_id = params.tenantId;
|
|
2819
2821
|
}
|
|
2820
2822
|
|
|
2823
|
+
if (params.domainName) {
|
|
2824
|
+
body.domain_name = params.domainName;
|
|
2825
|
+
}
|
|
2826
|
+
|
|
2821
2827
|
return client.post(`${baseUrl}/token`, body, headers).then(response => Session.parse(response));
|
|
2822
2828
|
},
|
|
2823
2829
|
|
|
@@ -2830,6 +2836,7 @@ var authMethods = (client , baseUrl ) => ({
|
|
|
2830
2836
|
expiration ,
|
|
2831
2837
|
isMobile = false,
|
|
2832
2838
|
tenantId ,
|
|
2839
|
+
domainName ,
|
|
2833
2840
|
) => {
|
|
2834
2841
|
const body = {
|
|
2835
2842
|
backend: backend || DEFAULT_BACKEND_USER,
|
|
@@ -2839,9 +2846,14 @@ var authMethods = (client , baseUrl ) => ({
|
|
|
2839
2846
|
};
|
|
2840
2847
|
|
|
2841
2848
|
if (tenantId) {
|
|
2849
|
+
console.warn('Use of `tenantId` is deprecated when calling refreshToken() method, use `domainName` instead.');
|
|
2842
2850
|
body.tenant_id = tenantId;
|
|
2843
2851
|
}
|
|
2844
2852
|
|
|
2853
|
+
if (domainName) {
|
|
2854
|
+
body.domain_name = domainName;
|
|
2855
|
+
}
|
|
2856
|
+
|
|
2845
2857
|
const headers = {
|
|
2846
2858
|
'Content-Type': 'application/json',
|
|
2847
2859
|
...(isMobile ? { 'Wazo-Session-Type': 'mobile' } : {}),
|
|
@@ -4268,6 +4280,7 @@ global.wazoClientId = global.wazoClientId || {};
|
|
|
4268
4280
|
global.wazoClientToken = global.wazoClientToken || {};
|
|
4269
4281
|
global.wazoRefreshToken = global.wazoRefreshToken || {};
|
|
4270
4282
|
global.wazoRefreshTenantId = global.wazoRefreshTenantId || {};
|
|
4283
|
+
global.wazoRefreshDomainName = global.wazoRefreshDomainName || {};
|
|
4271
4284
|
global.wazoOnRefreshToken = global.wazoOnRefreshToken || {};
|
|
4272
4285
|
global.wazoOnRefreshTokenError = global.wazoOnRefreshTokenError || {};
|
|
4273
4286
|
global.wazoRefreshExpiration = global.wazoRefreshExpiration || {};
|
|
@@ -5327,6 +5340,7 @@ class ApiClient {
|
|
|
5327
5340
|
|
|
5328
5341
|
|
|
5329
5342
|
|
|
5343
|
+
|
|
5330
5344
|
|
|
5331
5345
|
|
|
5332
5346
|
|
|
@@ -5368,6 +5382,7 @@ class ApiClient {
|
|
|
5368
5382
|
refreshToken: this.refreshToken,
|
|
5369
5383
|
refreshBackend: this.refreshBackend,
|
|
5370
5384
|
refreshTenantId: this.refreshTenantId,
|
|
5385
|
+
refreshDomainName: this.refreshDomainName,
|
|
5371
5386
|
refreshExpiration: this.refreshExpiration,
|
|
5372
5387
|
isMobile: this.isMobile,
|
|
5373
5388
|
});
|
|
@@ -5383,6 +5398,7 @@ class ApiClient {
|
|
|
5383
5398
|
this.refreshExpiration,
|
|
5384
5399
|
this.isMobile,
|
|
5385
5400
|
this.refreshTenantId,
|
|
5401
|
+
this.refreshDomainName,
|
|
5386
5402
|
);
|
|
5387
5403
|
|
|
5388
5404
|
logger$1.info('token refreshed', { token: session.token });
|
|
@@ -5436,9 +5452,14 @@ class ApiClient {
|
|
|
5436
5452
|
}
|
|
5437
5453
|
|
|
5438
5454
|
setRefreshTenantId(tenantId ) {
|
|
5455
|
+
console.warn('Use of `setRefreshTenantId` is deprecated, use `setRefreshDomainName` instead');
|
|
5439
5456
|
this.refreshTenantId = tenantId;
|
|
5440
5457
|
}
|
|
5441
5458
|
|
|
5459
|
+
setRefreshDomainName(domainName ) {
|
|
5460
|
+
this.refreshDomainName = domainName;
|
|
5461
|
+
}
|
|
5462
|
+
|
|
5442
5463
|
setIsMobile(isMobile ) {
|
|
5443
5464
|
this.isMobile = isMobile;
|
|
5444
5465
|
}
|
|
@@ -2795,6 +2795,7 @@ var authMethods = (client , baseUrl ) => ({
|
|
|
2795
2795
|
|
|
2796
2796
|
|
|
2797
2797
|
|
|
2798
|
+
|
|
2798
2799
|
) {
|
|
2799
2800
|
const body = {
|
|
2800
2801
|
backend: params.backend || DEFAULT_BACKEND_USER,
|
|
@@ -2815,9 +2816,14 @@ var authMethods = (client , baseUrl ) => ({
|
|
|
2815
2816
|
}
|
|
2816
2817
|
|
|
2817
2818
|
if (params.tenantId) {
|
|
2819
|
+
console.warn('Use of `tenantId` is deprecated when calling logIn() method, use `domainName` instead.');
|
|
2818
2820
|
body.tenant_id = params.tenantId;
|
|
2819
2821
|
}
|
|
2820
2822
|
|
|
2823
|
+
if (params.domainName) {
|
|
2824
|
+
body.domain_name = params.domainName;
|
|
2825
|
+
}
|
|
2826
|
+
|
|
2821
2827
|
return client.post(`${baseUrl}/token`, body, headers).then(response => Session.parse(response));
|
|
2822
2828
|
},
|
|
2823
2829
|
|
|
@@ -2830,6 +2836,7 @@ var authMethods = (client , baseUrl ) => ({
|
|
|
2830
2836
|
expiration ,
|
|
2831
2837
|
isMobile = false,
|
|
2832
2838
|
tenantId ,
|
|
2839
|
+
domainName ,
|
|
2833
2840
|
) => {
|
|
2834
2841
|
const body = {
|
|
2835
2842
|
backend: backend || DEFAULT_BACKEND_USER,
|
|
@@ -2839,9 +2846,14 @@ var authMethods = (client , baseUrl ) => ({
|
|
|
2839
2846
|
};
|
|
2840
2847
|
|
|
2841
2848
|
if (tenantId) {
|
|
2849
|
+
console.warn('Use of `tenantId` is deprecated when calling refreshToken() method, use `domainName` instead.');
|
|
2842
2850
|
body.tenant_id = tenantId;
|
|
2843
2851
|
}
|
|
2844
2852
|
|
|
2853
|
+
if (domainName) {
|
|
2854
|
+
body.domain_name = domainName;
|
|
2855
|
+
}
|
|
2856
|
+
|
|
2845
2857
|
const headers = {
|
|
2846
2858
|
'Content-Type': 'application/json',
|
|
2847
2859
|
...(isMobile ? { 'Wazo-Session-Type': 'mobile' } : {}),
|
|
@@ -4268,6 +4280,7 @@ global.wazoClientId = global.wazoClientId || {};
|
|
|
4268
4280
|
global.wazoClientToken = global.wazoClientToken || {};
|
|
4269
4281
|
global.wazoRefreshToken = global.wazoRefreshToken || {};
|
|
4270
4282
|
global.wazoRefreshTenantId = global.wazoRefreshTenantId || {};
|
|
4283
|
+
global.wazoRefreshDomainName = global.wazoRefreshDomainName || {};
|
|
4271
4284
|
global.wazoOnRefreshToken = global.wazoOnRefreshToken || {};
|
|
4272
4285
|
global.wazoOnRefreshTokenError = global.wazoOnRefreshTokenError || {};
|
|
4273
4286
|
global.wazoRefreshExpiration = global.wazoRefreshExpiration || {};
|
|
@@ -5327,6 +5340,7 @@ class ApiClient {
|
|
|
5327
5340
|
|
|
5328
5341
|
|
|
5329
5342
|
|
|
5343
|
+
|
|
5330
5344
|
|
|
5331
5345
|
|
|
5332
5346
|
|
|
@@ -5368,6 +5382,7 @@ class ApiClient {
|
|
|
5368
5382
|
refreshToken: this.refreshToken,
|
|
5369
5383
|
refreshBackend: this.refreshBackend,
|
|
5370
5384
|
refreshTenantId: this.refreshTenantId,
|
|
5385
|
+
refreshDomainName: this.refreshDomainName,
|
|
5371
5386
|
refreshExpiration: this.refreshExpiration,
|
|
5372
5387
|
isMobile: this.isMobile,
|
|
5373
5388
|
});
|
|
@@ -5383,6 +5398,7 @@ class ApiClient {
|
|
|
5383
5398
|
this.refreshExpiration,
|
|
5384
5399
|
this.isMobile,
|
|
5385
5400
|
this.refreshTenantId,
|
|
5401
|
+
this.refreshDomainName,
|
|
5386
5402
|
);
|
|
5387
5403
|
|
|
5388
5404
|
logger$1.info('token refreshed', { token: session.token });
|
|
@@ -5436,9 +5452,14 @@ class ApiClient {
|
|
|
5436
5452
|
}
|
|
5437
5453
|
|
|
5438
5454
|
setRefreshTenantId(tenantId ) {
|
|
5455
|
+
console.warn('Use of `setRefreshTenantId` is deprecated, use `setRefreshDomainName` instead');
|
|
5439
5456
|
this.refreshTenantId = tenantId;
|
|
5440
5457
|
}
|
|
5441
5458
|
|
|
5459
|
+
setRefreshDomainName(domainName ) {
|
|
5460
|
+
this.refreshDomainName = domainName;
|
|
5461
|
+
}
|
|
5462
|
+
|
|
5442
5463
|
setIsMobile(isMobile ) {
|
|
5443
5464
|
this.isMobile = isMobile;
|
|
5444
5465
|
}
|
|
@@ -2430,6 +2430,7 @@ var authMethods = (client , baseUrl ) => ({
|
|
|
2430
2430
|
|
|
2431
2431
|
|
|
2432
2432
|
|
|
2433
|
+
|
|
2433
2434
|
) {
|
|
2434
2435
|
const body = {
|
|
2435
2436
|
backend: params.backend || DEFAULT_BACKEND_USER,
|
|
@@ -2450,9 +2451,14 @@ var authMethods = (client , baseUrl ) => ({
|
|
|
2450
2451
|
}
|
|
2451
2452
|
|
|
2452
2453
|
if (params.tenantId) {
|
|
2454
|
+
console.warn('Use of `tenantId` is deprecated when calling logIn() method, use `domainName` instead.');
|
|
2453
2455
|
body.tenant_id = params.tenantId;
|
|
2454
2456
|
}
|
|
2455
2457
|
|
|
2458
|
+
if (params.domainName) {
|
|
2459
|
+
body.domain_name = params.domainName;
|
|
2460
|
+
}
|
|
2461
|
+
|
|
2456
2462
|
return client.post(`${baseUrl}/token`, body, headers).then(response => Session.parse(response));
|
|
2457
2463
|
},
|
|
2458
2464
|
|
|
@@ -2465,6 +2471,7 @@ var authMethods = (client , baseUrl ) => ({
|
|
|
2465
2471
|
expiration ,
|
|
2466
2472
|
isMobile = false,
|
|
2467
2473
|
tenantId ,
|
|
2474
|
+
domainName ,
|
|
2468
2475
|
) => {
|
|
2469
2476
|
const body = {
|
|
2470
2477
|
backend: backend || DEFAULT_BACKEND_USER,
|
|
@@ -2474,9 +2481,14 @@ var authMethods = (client , baseUrl ) => ({
|
|
|
2474
2481
|
};
|
|
2475
2482
|
|
|
2476
2483
|
if (tenantId) {
|
|
2484
|
+
console.warn('Use of `tenantId` is deprecated when calling refreshToken() method, use `domainName` instead.');
|
|
2477
2485
|
body.tenant_id = tenantId;
|
|
2478
2486
|
}
|
|
2479
2487
|
|
|
2488
|
+
if (domainName) {
|
|
2489
|
+
body.domain_name = domainName;
|
|
2490
|
+
}
|
|
2491
|
+
|
|
2480
2492
|
const headers = {
|
|
2481
2493
|
'Content-Type': 'application/json',
|
|
2482
2494
|
...(isMobile ? { 'Wazo-Session-Type': 'mobile' } : {}),
|
|
@@ -4730,6 +4742,7 @@ class ApiClient {
|
|
|
4730
4742
|
|
|
4731
4743
|
|
|
4732
4744
|
|
|
4745
|
+
|
|
4733
4746
|
|
|
4734
4747
|
|
|
4735
4748
|
|
|
@@ -4771,6 +4784,7 @@ class ApiClient {
|
|
|
4771
4784
|
refreshToken: this.refreshToken,
|
|
4772
4785
|
refreshBackend: this.refreshBackend,
|
|
4773
4786
|
refreshTenantId: this.refreshTenantId,
|
|
4787
|
+
refreshDomainName: this.refreshDomainName,
|
|
4774
4788
|
refreshExpiration: this.refreshExpiration,
|
|
4775
4789
|
isMobile: this.isMobile,
|
|
4776
4790
|
});
|
|
@@ -4786,6 +4800,7 @@ class ApiClient {
|
|
|
4786
4800
|
this.refreshExpiration,
|
|
4787
4801
|
this.isMobile,
|
|
4788
4802
|
this.refreshTenantId,
|
|
4803
|
+
this.refreshDomainName,
|
|
4789
4804
|
);
|
|
4790
4805
|
|
|
4791
4806
|
logger.info('token refreshed', { token: session.token });
|
|
@@ -4839,9 +4854,14 @@ class ApiClient {
|
|
|
4839
4854
|
}
|
|
4840
4855
|
|
|
4841
4856
|
setRefreshTenantId(tenantId ) {
|
|
4857
|
+
console.warn('Use of `setRefreshTenantId` is deprecated, use `setRefreshDomainName` instead');
|
|
4842
4858
|
this.refreshTenantId = tenantId;
|
|
4843
4859
|
}
|
|
4844
4860
|
|
|
4861
|
+
setRefreshDomainName(domainName ) {
|
|
4862
|
+
this.refreshDomainName = domainName;
|
|
4863
|
+
}
|
|
4864
|
+
|
|
4845
4865
|
setIsMobile(isMobile ) {
|
|
4846
4866
|
this.isMobile = isMobile;
|
|
4847
4867
|
}
|
|
@@ -4866,6 +4886,7 @@ global.wazoClientId = global.wazoClientId || {};
|
|
|
4866
4886
|
global.wazoClientToken = global.wazoClientToken || {};
|
|
4867
4887
|
global.wazoRefreshToken = global.wazoRefreshToken || {};
|
|
4868
4888
|
global.wazoRefreshTenantId = global.wazoRefreshTenantId || {};
|
|
4889
|
+
global.wazoRefreshDomainName = global.wazoRefreshDomainName || {};
|
|
4869
4890
|
global.wazoOnRefreshToken = global.wazoOnRefreshToken || {};
|
|
4870
4891
|
global.wazoOnRefreshTokenError = global.wazoOnRefreshTokenError || {};
|
|
4871
4892
|
global.wazoRefreshExpiration = global.wazoRefreshExpiration || {};
|
|
@@ -4875,6 +4896,7 @@ global.wazoFetchOptions = global.wazoFetchOptions || {};
|
|
|
4875
4896
|
|
|
4876
4897
|
const fillClient = (apiClient ) => {
|
|
4877
4898
|
const { server, token, clientId } = apiClient.client;
|
|
4899
|
+
const tenantId = global.wazoRefreshTenantId[server] || global.wazoRefreshTenantId[null] || apiClient.refreshTenantId;
|
|
4878
4900
|
|
|
4879
4901
|
// try with null server when dealing with non-related server info
|
|
4880
4902
|
apiClient.setToken(global.wazoClientToken[server] || global.wazoClientToken[null] || token);
|
|
@@ -4883,8 +4905,12 @@ const fillClient = (apiClient ) => {
|
|
|
4883
4905
|
|
|
4884
4906
|
apiClient.setRefreshToken(global.wazoRefreshToken[server] || global.wazoRefreshToken[null] || apiClient.refreshToken);
|
|
4885
4907
|
|
|
4886
|
-
|
|
4887
|
-
|
|
4908
|
+
if (tenantId) {
|
|
4909
|
+
apiClient.setRefreshTenantId(tenantId);
|
|
4910
|
+
}
|
|
4911
|
+
|
|
4912
|
+
apiClient.setRefreshDomainName(
|
|
4913
|
+
global.wazoRefreshDomainName[server] || global.wazoRefreshDomainName[null] || apiClient.refreshDomainName,
|
|
4888
4914
|
);
|
|
4889
4915
|
|
|
4890
4916
|
apiClient.setFetchOptions(global.wazoFetchOptions[server] || global.wazoFetchOptions[null] || apiClient.fetchOptions);
|
package/lib/domain/Features.js
CHANGED
|
@@ -2217,6 +2217,7 @@ var authMethods = (client , baseUrl ) => ({
|
|
|
2217
2217
|
|
|
2218
2218
|
|
|
2219
2219
|
|
|
2220
|
+
|
|
2220
2221
|
) {
|
|
2221
2222
|
const body = {
|
|
2222
2223
|
backend: params.backend || DEFAULT_BACKEND_USER,
|
|
@@ -2237,9 +2238,14 @@ var authMethods = (client , baseUrl ) => ({
|
|
|
2237
2238
|
}
|
|
2238
2239
|
|
|
2239
2240
|
if (params.tenantId) {
|
|
2241
|
+
console.warn('Use of `tenantId` is deprecated when calling logIn() method, use `domainName` instead.');
|
|
2240
2242
|
body.tenant_id = params.tenantId;
|
|
2241
2243
|
}
|
|
2242
2244
|
|
|
2245
|
+
if (params.domainName) {
|
|
2246
|
+
body.domain_name = params.domainName;
|
|
2247
|
+
}
|
|
2248
|
+
|
|
2243
2249
|
return client.post(`${baseUrl}/token`, body, headers).then(response => Session.parse(response));
|
|
2244
2250
|
},
|
|
2245
2251
|
|
|
@@ -2252,6 +2258,7 @@ var authMethods = (client , baseUrl ) => ({
|
|
|
2252
2258
|
expiration ,
|
|
2253
2259
|
isMobile = false,
|
|
2254
2260
|
tenantId ,
|
|
2261
|
+
domainName ,
|
|
2255
2262
|
) => {
|
|
2256
2263
|
const body = {
|
|
2257
2264
|
backend: backend || DEFAULT_BACKEND_USER,
|
|
@@ -2261,9 +2268,14 @@ var authMethods = (client , baseUrl ) => ({
|
|
|
2261
2268
|
};
|
|
2262
2269
|
|
|
2263
2270
|
if (tenantId) {
|
|
2271
|
+
console.warn('Use of `tenantId` is deprecated when calling refreshToken() method, use `domainName` instead.');
|
|
2264
2272
|
body.tenant_id = tenantId;
|
|
2265
2273
|
}
|
|
2266
2274
|
|
|
2275
|
+
if (domainName) {
|
|
2276
|
+
body.domain_name = domainName;
|
|
2277
|
+
}
|
|
2278
|
+
|
|
2267
2279
|
const headers = {
|
|
2268
2280
|
'Content-Type': 'application/json',
|
|
2269
2281
|
...(isMobile ? { 'Wazo-Session-Type': 'mobile' } : {}),
|
|
@@ -4732,6 +4744,7 @@ class ApiClient {
|
|
|
4732
4744
|
|
|
4733
4745
|
|
|
4734
4746
|
|
|
4747
|
+
|
|
4735
4748
|
|
|
4736
4749
|
|
|
4737
4750
|
|
|
@@ -4773,6 +4786,7 @@ class ApiClient {
|
|
|
4773
4786
|
refreshToken: this.refreshToken,
|
|
4774
4787
|
refreshBackend: this.refreshBackend,
|
|
4775
4788
|
refreshTenantId: this.refreshTenantId,
|
|
4789
|
+
refreshDomainName: this.refreshDomainName,
|
|
4776
4790
|
refreshExpiration: this.refreshExpiration,
|
|
4777
4791
|
isMobile: this.isMobile,
|
|
4778
4792
|
});
|
|
@@ -4788,6 +4802,7 @@ class ApiClient {
|
|
|
4788
4802
|
this.refreshExpiration,
|
|
4789
4803
|
this.isMobile,
|
|
4790
4804
|
this.refreshTenantId,
|
|
4805
|
+
this.refreshDomainName,
|
|
4791
4806
|
);
|
|
4792
4807
|
|
|
4793
4808
|
logger.info('token refreshed', { token: session.token });
|
|
@@ -4841,9 +4856,14 @@ class ApiClient {
|
|
|
4841
4856
|
}
|
|
4842
4857
|
|
|
4843
4858
|
setRefreshTenantId(tenantId ) {
|
|
4859
|
+
console.warn('Use of `setRefreshTenantId` is deprecated, use `setRefreshDomainName` instead');
|
|
4844
4860
|
this.refreshTenantId = tenantId;
|
|
4845
4861
|
}
|
|
4846
4862
|
|
|
4863
|
+
setRefreshDomainName(domainName ) {
|
|
4864
|
+
this.refreshDomainName = domainName;
|
|
4865
|
+
}
|
|
4866
|
+
|
|
4847
4867
|
setIsMobile(isMobile ) {
|
|
4848
4868
|
this.isMobile = isMobile;
|
|
4849
4869
|
}
|
|
@@ -4868,6 +4888,7 @@ global.wazoClientId = global.wazoClientId || {};
|
|
|
4868
4888
|
global.wazoClientToken = global.wazoClientToken || {};
|
|
4869
4889
|
global.wazoRefreshToken = global.wazoRefreshToken || {};
|
|
4870
4890
|
global.wazoRefreshTenantId = global.wazoRefreshTenantId || {};
|
|
4891
|
+
global.wazoRefreshDomainName = global.wazoRefreshDomainName || {};
|
|
4871
4892
|
global.wazoOnRefreshToken = global.wazoOnRefreshToken || {};
|
|
4872
4893
|
global.wazoOnRefreshTokenError = global.wazoOnRefreshTokenError || {};
|
|
4873
4894
|
global.wazoRefreshExpiration = global.wazoRefreshExpiration || {};
|
|
@@ -4877,6 +4898,7 @@ global.wazoFetchOptions = global.wazoFetchOptions || {};
|
|
|
4877
4898
|
|
|
4878
4899
|
const fillClient = (apiClient ) => {
|
|
4879
4900
|
const { server, token, clientId } = apiClient.client;
|
|
4901
|
+
const tenantId = global.wazoRefreshTenantId[server] || global.wazoRefreshTenantId[null] || apiClient.refreshTenantId;
|
|
4880
4902
|
|
|
4881
4903
|
// try with null server when dealing with non-related server info
|
|
4882
4904
|
apiClient.setToken(global.wazoClientToken[server] || global.wazoClientToken[null] || token);
|
|
@@ -4885,8 +4907,12 @@ const fillClient = (apiClient ) => {
|
|
|
4885
4907
|
|
|
4886
4908
|
apiClient.setRefreshToken(global.wazoRefreshToken[server] || global.wazoRefreshToken[null] || apiClient.refreshToken);
|
|
4887
4909
|
|
|
4888
|
-
|
|
4889
|
-
|
|
4910
|
+
if (tenantId) {
|
|
4911
|
+
apiClient.setRefreshTenantId(tenantId);
|
|
4912
|
+
}
|
|
4913
|
+
|
|
4914
|
+
apiClient.setRefreshDomainName(
|
|
4915
|
+
global.wazoRefreshDomainName[server] || global.wazoRefreshDomainName[null] || apiClient.refreshDomainName,
|
|
4890
4916
|
);
|
|
4891
4917
|
|
|
4892
4918
|
apiClient.setFetchOptions(global.wazoFetchOptions[server] || global.wazoFetchOptions[null] || apiClient.fetchOptions);
|
|
@@ -3184,6 +3184,7 @@ var authMethods = (client , baseUrl ) => ({
|
|
|
3184
3184
|
|
|
3185
3185
|
|
|
3186
3186
|
|
|
3187
|
+
|
|
3187
3188
|
) {
|
|
3188
3189
|
const body = {
|
|
3189
3190
|
backend: params.backend || DEFAULT_BACKEND_USER,
|
|
@@ -3204,9 +3205,14 @@ var authMethods = (client , baseUrl ) => ({
|
|
|
3204
3205
|
}
|
|
3205
3206
|
|
|
3206
3207
|
if (params.tenantId) {
|
|
3208
|
+
console.warn('Use of `tenantId` is deprecated when calling logIn() method, use `domainName` instead.');
|
|
3207
3209
|
body.tenant_id = params.tenantId;
|
|
3208
3210
|
}
|
|
3209
3211
|
|
|
3212
|
+
if (params.domainName) {
|
|
3213
|
+
body.domain_name = params.domainName;
|
|
3214
|
+
}
|
|
3215
|
+
|
|
3210
3216
|
return client.post(`${baseUrl}/token`, body, headers).then(response => Session.parse(response));
|
|
3211
3217
|
},
|
|
3212
3218
|
|
|
@@ -3219,6 +3225,7 @@ var authMethods = (client , baseUrl ) => ({
|
|
|
3219
3225
|
expiration ,
|
|
3220
3226
|
isMobile = false,
|
|
3221
3227
|
tenantId ,
|
|
3228
|
+
domainName ,
|
|
3222
3229
|
) => {
|
|
3223
3230
|
const body = {
|
|
3224
3231
|
backend: backend || DEFAULT_BACKEND_USER,
|
|
@@ -3228,9 +3235,14 @@ var authMethods = (client , baseUrl ) => ({
|
|
|
3228
3235
|
};
|
|
3229
3236
|
|
|
3230
3237
|
if (tenantId) {
|
|
3238
|
+
console.warn('Use of `tenantId` is deprecated when calling refreshToken() method, use `domainName` instead.');
|
|
3231
3239
|
body.tenant_id = tenantId;
|
|
3232
3240
|
}
|
|
3233
3241
|
|
|
3242
|
+
if (domainName) {
|
|
3243
|
+
body.domain_name = domainName;
|
|
3244
|
+
}
|
|
3245
|
+
|
|
3234
3246
|
const headers = {
|
|
3235
3247
|
'Content-Type': 'application/json',
|
|
3236
3248
|
...(isMobile ? { 'Wazo-Session-Type': 'mobile' } : {}),
|
|
@@ -5146,6 +5158,7 @@ class ApiClient {
|
|
|
5146
5158
|
|
|
5147
5159
|
|
|
5148
5160
|
|
|
5161
|
+
|
|
5149
5162
|
|
|
5150
5163
|
|
|
5151
5164
|
|
|
@@ -5187,6 +5200,7 @@ class ApiClient {
|
|
|
5187
5200
|
refreshToken: this.refreshToken,
|
|
5188
5201
|
refreshBackend: this.refreshBackend,
|
|
5189
5202
|
refreshTenantId: this.refreshTenantId,
|
|
5203
|
+
refreshDomainName: this.refreshDomainName,
|
|
5190
5204
|
refreshExpiration: this.refreshExpiration,
|
|
5191
5205
|
isMobile: this.isMobile,
|
|
5192
5206
|
});
|
|
@@ -5202,6 +5216,7 @@ class ApiClient {
|
|
|
5202
5216
|
this.refreshExpiration,
|
|
5203
5217
|
this.isMobile,
|
|
5204
5218
|
this.refreshTenantId,
|
|
5219
|
+
this.refreshDomainName,
|
|
5205
5220
|
);
|
|
5206
5221
|
|
|
5207
5222
|
logger$1.info('token refreshed', { token: session.token });
|
|
@@ -5255,9 +5270,14 @@ class ApiClient {
|
|
|
5255
5270
|
}
|
|
5256
5271
|
|
|
5257
5272
|
setRefreshTenantId(tenantId ) {
|
|
5273
|
+
console.warn('Use of `setRefreshTenantId` is deprecated, use `setRefreshDomainName` instead');
|
|
5258
5274
|
this.refreshTenantId = tenantId;
|
|
5259
5275
|
}
|
|
5260
5276
|
|
|
5277
|
+
setRefreshDomainName(domainName ) {
|
|
5278
|
+
this.refreshDomainName = domainName;
|
|
5279
|
+
}
|
|
5280
|
+
|
|
5261
5281
|
setIsMobile(isMobile ) {
|
|
5262
5282
|
this.isMobile = isMobile;
|
|
5263
5283
|
}
|
|
@@ -5282,6 +5302,7 @@ global.wazoClientId = global.wazoClientId || {};
|
|
|
5282
5302
|
global.wazoClientToken = global.wazoClientToken || {};
|
|
5283
5303
|
global.wazoRefreshToken = global.wazoRefreshToken || {};
|
|
5284
5304
|
global.wazoRefreshTenantId = global.wazoRefreshTenantId || {};
|
|
5305
|
+
global.wazoRefreshDomainName = global.wazoRefreshDomainName || {};
|
|
5285
5306
|
global.wazoOnRefreshToken = global.wazoOnRefreshToken || {};
|
|
5286
5307
|
global.wazoOnRefreshTokenError = global.wazoOnRefreshTokenError || {};
|
|
5287
5308
|
global.wazoRefreshExpiration = global.wazoRefreshExpiration || {};
|
|
@@ -5291,6 +5312,7 @@ global.wazoFetchOptions = global.wazoFetchOptions || {};
|
|
|
5291
5312
|
|
|
5292
5313
|
const fillClient = (apiClient ) => {
|
|
5293
5314
|
const { server, token, clientId } = apiClient.client;
|
|
5315
|
+
const tenantId = global.wazoRefreshTenantId[server] || global.wazoRefreshTenantId[null] || apiClient.refreshTenantId;
|
|
5294
5316
|
|
|
5295
5317
|
// try with null server when dealing with non-related server info
|
|
5296
5318
|
apiClient.setToken(global.wazoClientToken[server] || global.wazoClientToken[null] || token);
|
|
@@ -5299,8 +5321,12 @@ const fillClient = (apiClient ) => {
|
|
|
5299
5321
|
|
|
5300
5322
|
apiClient.setRefreshToken(global.wazoRefreshToken[server] || global.wazoRefreshToken[null] || apiClient.refreshToken);
|
|
5301
5323
|
|
|
5302
|
-
|
|
5303
|
-
|
|
5324
|
+
if (tenantId) {
|
|
5325
|
+
apiClient.setRefreshTenantId(tenantId);
|
|
5326
|
+
}
|
|
5327
|
+
|
|
5328
|
+
apiClient.setRefreshDomainName(
|
|
5329
|
+
global.wazoRefreshDomainName[server] || global.wazoRefreshDomainName[null] || apiClient.refreshDomainName,
|
|
5304
5330
|
);
|
|
5305
5331
|
|
|
5306
5332
|
apiClient.setFetchOptions(global.wazoFetchOptions[server] || global.wazoFetchOptions[null] || apiClient.fetchOptions);
|
|
@@ -903,6 +903,7 @@ global.wazoClientId = global.wazoClientId || {};
|
|
|
903
903
|
global.wazoClientToken = global.wazoClientToken || {};
|
|
904
904
|
global.wazoRefreshToken = global.wazoRefreshToken || {};
|
|
905
905
|
global.wazoRefreshTenantId = global.wazoRefreshTenantId || {};
|
|
906
|
+
global.wazoRefreshDomainName = global.wazoRefreshDomainName || {};
|
|
906
907
|
global.wazoOnRefreshToken = global.wazoOnRefreshToken || {};
|
|
907
908
|
global.wazoOnRefreshTokenError = global.wazoOnRefreshTokenError || {};
|
|
908
909
|
global.wazoRefreshExpiration = global.wazoRefreshExpiration || {};
|