@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
package/esm/web-rtc-client.js
CHANGED
|
@@ -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
|
}
|
|
@@ -2215,6 +2215,7 @@ var authMethods = (client , baseUrl ) => ({
|
|
|
2215
2215
|
|
|
2216
2216
|
|
|
2217
2217
|
|
|
2218
|
+
|
|
2218
2219
|
) {
|
|
2219
2220
|
const body = {
|
|
2220
2221
|
backend: params.backend || DEFAULT_BACKEND_USER,
|
|
@@ -2235,9 +2236,14 @@ var authMethods = (client , baseUrl ) => ({
|
|
|
2235
2236
|
}
|
|
2236
2237
|
|
|
2237
2238
|
if (params.tenantId) {
|
|
2239
|
+
console.warn('Use of `tenantId` is deprecated when calling logIn() method, use `domainName` instead.');
|
|
2238
2240
|
body.tenant_id = params.tenantId;
|
|
2239
2241
|
}
|
|
2240
2242
|
|
|
2243
|
+
if (params.domainName) {
|
|
2244
|
+
body.domain_name = params.domainName;
|
|
2245
|
+
}
|
|
2246
|
+
|
|
2241
2247
|
return client.post(`${baseUrl}/token`, body, headers).then(response => Session.parse(response));
|
|
2242
2248
|
},
|
|
2243
2249
|
|
|
@@ -2250,6 +2256,7 @@ var authMethods = (client , baseUrl ) => ({
|
|
|
2250
2256
|
expiration ,
|
|
2251
2257
|
isMobile = false,
|
|
2252
2258
|
tenantId ,
|
|
2259
|
+
domainName ,
|
|
2253
2260
|
) => {
|
|
2254
2261
|
const body = {
|
|
2255
2262
|
backend: backend || DEFAULT_BACKEND_USER,
|
|
@@ -2259,9 +2266,14 @@ var authMethods = (client , baseUrl ) => ({
|
|
|
2259
2266
|
};
|
|
2260
2267
|
|
|
2261
2268
|
if (tenantId) {
|
|
2269
|
+
console.warn('Use of `tenantId` is deprecated when calling refreshToken() method, use `domainName` instead.');
|
|
2262
2270
|
body.tenant_id = tenantId;
|
|
2263
2271
|
}
|
|
2264
2272
|
|
|
2273
|
+
if (domainName) {
|
|
2274
|
+
body.domain_name = domainName;
|
|
2275
|
+
}
|
|
2276
|
+
|
|
2265
2277
|
const headers = {
|
|
2266
2278
|
'Content-Type': 'application/json',
|
|
2267
2279
|
...(isMobile ? { 'Wazo-Session-Type': 'mobile' } : {}),
|
|
@@ -3688,6 +3700,7 @@ global.wazoClientId = global.wazoClientId || {};
|
|
|
3688
3700
|
global.wazoClientToken = global.wazoClientToken || {};
|
|
3689
3701
|
global.wazoRefreshToken = global.wazoRefreshToken || {};
|
|
3690
3702
|
global.wazoRefreshTenantId = global.wazoRefreshTenantId || {};
|
|
3703
|
+
global.wazoRefreshDomainName = global.wazoRefreshDomainName || {};
|
|
3691
3704
|
global.wazoOnRefreshToken = global.wazoOnRefreshToken || {};
|
|
3692
3705
|
global.wazoOnRefreshTokenError = global.wazoOnRefreshTokenError || {};
|
|
3693
3706
|
global.wazoRefreshExpiration = global.wazoRefreshExpiration || {};
|
|
@@ -4747,6 +4760,7 @@ class ApiClient {
|
|
|
4747
4760
|
|
|
4748
4761
|
|
|
4749
4762
|
|
|
4763
|
+
|
|
4750
4764
|
|
|
4751
4765
|
|
|
4752
4766
|
|
|
@@ -4788,6 +4802,7 @@ class ApiClient {
|
|
|
4788
4802
|
refreshToken: this.refreshToken,
|
|
4789
4803
|
refreshBackend: this.refreshBackend,
|
|
4790
4804
|
refreshTenantId: this.refreshTenantId,
|
|
4805
|
+
refreshDomainName: this.refreshDomainName,
|
|
4791
4806
|
refreshExpiration: this.refreshExpiration,
|
|
4792
4807
|
isMobile: this.isMobile,
|
|
4793
4808
|
});
|
|
@@ -4803,6 +4818,7 @@ class ApiClient {
|
|
|
4803
4818
|
this.refreshExpiration,
|
|
4804
4819
|
this.isMobile,
|
|
4805
4820
|
this.refreshTenantId,
|
|
4821
|
+
this.refreshDomainName,
|
|
4806
4822
|
);
|
|
4807
4823
|
|
|
4808
4824
|
logger.info('token refreshed', { token: session.token });
|
|
@@ -4856,9 +4872,14 @@ class ApiClient {
|
|
|
4856
4872
|
}
|
|
4857
4873
|
|
|
4858
4874
|
setRefreshTenantId(tenantId ) {
|
|
4875
|
+
console.warn('Use of `setRefreshTenantId` is deprecated, use `setRefreshDomainName` instead');
|
|
4859
4876
|
this.refreshTenantId = tenantId;
|
|
4860
4877
|
}
|
|
4861
4878
|
|
|
4879
|
+
setRefreshDomainName(domainName ) {
|
|
4880
|
+
this.refreshDomainName = domainName;
|
|
4881
|
+
}
|
|
4882
|
+
|
|
4862
4883
|
setIsMobile(isMobile ) {
|
|
4863
4884
|
this.isMobile = isMobile;
|
|
4864
4885
|
}
|
|
@@ -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
|
}
|
package/lib/api/auth.js
CHANGED
|
@@ -975,6 +975,7 @@ var auth = (client , baseUrl ) => ({
|
|
|
975
975
|
|
|
976
976
|
|
|
977
977
|
|
|
978
|
+
|
|
978
979
|
) {
|
|
979
980
|
const body = {
|
|
980
981
|
backend: params.backend || DEFAULT_BACKEND_USER,
|
|
@@ -995,9 +996,14 @@ var auth = (client , baseUrl ) => ({
|
|
|
995
996
|
}
|
|
996
997
|
|
|
997
998
|
if (params.tenantId) {
|
|
999
|
+
console.warn('Use of `tenantId` is deprecated when calling logIn() method, use `domainName` instead.');
|
|
998
1000
|
body.tenant_id = params.tenantId;
|
|
999
1001
|
}
|
|
1000
1002
|
|
|
1003
|
+
if (params.domainName) {
|
|
1004
|
+
body.domain_name = params.domainName;
|
|
1005
|
+
}
|
|
1006
|
+
|
|
1001
1007
|
return client.post(`${baseUrl}/token`, body, headers).then(response => Session.parse(response));
|
|
1002
1008
|
},
|
|
1003
1009
|
|
|
@@ -1010,6 +1016,7 @@ var auth = (client , baseUrl ) => ({
|
|
|
1010
1016
|
expiration ,
|
|
1011
1017
|
isMobile = false,
|
|
1012
1018
|
tenantId ,
|
|
1019
|
+
domainName ,
|
|
1013
1020
|
) => {
|
|
1014
1021
|
const body = {
|
|
1015
1022
|
backend: backend || DEFAULT_BACKEND_USER,
|
|
@@ -1019,9 +1026,14 @@ var auth = (client , baseUrl ) => ({
|
|
|
1019
1026
|
};
|
|
1020
1027
|
|
|
1021
1028
|
if (tenantId) {
|
|
1029
|
+
console.warn('Use of `tenantId` is deprecated when calling refreshToken() method, use `domainName` instead.');
|
|
1022
1030
|
body.tenant_id = tenantId;
|
|
1023
1031
|
}
|
|
1024
1032
|
|
|
1033
|
+
if (domainName) {
|
|
1034
|
+
body.domain_name = domainName;
|
|
1035
|
+
}
|
|
1036
|
+
|
|
1025
1037
|
const headers = {
|
|
1026
1038
|
'Content-Type': 'application/json',
|
|
1027
1039
|
...(isMobile ? { 'Wazo-Session-Type': 'mobile' } : {}),
|
package/lib/api/ctid-ng.js
CHANGED
|
@@ -1192,6 +1192,7 @@ global.wazoClientId = global.wazoClientId || {};
|
|
|
1192
1192
|
global.wazoClientToken = global.wazoClientToken || {};
|
|
1193
1193
|
global.wazoRefreshToken = global.wazoRefreshToken || {};
|
|
1194
1194
|
global.wazoRefreshTenantId = global.wazoRefreshTenantId || {};
|
|
1195
|
+
global.wazoRefreshDomainName = global.wazoRefreshDomainName || {};
|
|
1195
1196
|
global.wazoOnRefreshToken = global.wazoOnRefreshToken || {};
|
|
1196
1197
|
global.wazoOnRefreshTokenError = global.wazoOnRefreshTokenError || {};
|
|
1197
1198
|
global.wazoRefreshExpiration = global.wazoRefreshExpiration || {};
|
package/lib/api-client.js
CHANGED
|
@@ -2215,6 +2215,7 @@ var authMethods = (client , baseUrl ) => ({
|
|
|
2215
2215
|
|
|
2216
2216
|
|
|
2217
2217
|
|
|
2218
|
+
|
|
2218
2219
|
) {
|
|
2219
2220
|
const body = {
|
|
2220
2221
|
backend: params.backend || DEFAULT_BACKEND_USER,
|
|
@@ -2235,9 +2236,14 @@ var authMethods = (client , baseUrl ) => ({
|
|
|
2235
2236
|
}
|
|
2236
2237
|
|
|
2237
2238
|
if (params.tenantId) {
|
|
2239
|
+
console.warn('Use of `tenantId` is deprecated when calling logIn() method, use `domainName` instead.');
|
|
2238
2240
|
body.tenant_id = params.tenantId;
|
|
2239
2241
|
}
|
|
2240
2242
|
|
|
2243
|
+
if (params.domainName) {
|
|
2244
|
+
body.domain_name = params.domainName;
|
|
2245
|
+
}
|
|
2246
|
+
|
|
2241
2247
|
return client.post(`${baseUrl}/token`, body, headers).then(response => Session.parse(response));
|
|
2242
2248
|
},
|
|
2243
2249
|
|
|
@@ -2250,6 +2256,7 @@ var authMethods = (client , baseUrl ) => ({
|
|
|
2250
2256
|
expiration ,
|
|
2251
2257
|
isMobile = false,
|
|
2252
2258
|
tenantId ,
|
|
2259
|
+
domainName ,
|
|
2253
2260
|
) => {
|
|
2254
2261
|
const body = {
|
|
2255
2262
|
backend: backend || DEFAULT_BACKEND_USER,
|
|
@@ -2259,9 +2266,14 @@ var authMethods = (client , baseUrl ) => ({
|
|
|
2259
2266
|
};
|
|
2260
2267
|
|
|
2261
2268
|
if (tenantId) {
|
|
2269
|
+
console.warn('Use of `tenantId` is deprecated when calling refreshToken() method, use `domainName` instead.');
|
|
2262
2270
|
body.tenant_id = tenantId;
|
|
2263
2271
|
}
|
|
2264
2272
|
|
|
2273
|
+
if (domainName) {
|
|
2274
|
+
body.domain_name = domainName;
|
|
2275
|
+
}
|
|
2276
|
+
|
|
2265
2277
|
const headers = {
|
|
2266
2278
|
'Content-Type': 'application/json',
|
|
2267
2279
|
...(isMobile ? { 'Wazo-Session-Type': 'mobile' } : {}),
|
|
@@ -3688,6 +3700,7 @@ global.wazoClientId = global.wazoClientId || {};
|
|
|
3688
3700
|
global.wazoClientToken = global.wazoClientToken || {};
|
|
3689
3701
|
global.wazoRefreshToken = global.wazoRefreshToken || {};
|
|
3690
3702
|
global.wazoRefreshTenantId = global.wazoRefreshTenantId || {};
|
|
3703
|
+
global.wazoRefreshDomainName = global.wazoRefreshDomainName || {};
|
|
3691
3704
|
global.wazoOnRefreshToken = global.wazoOnRefreshToken || {};
|
|
3692
3705
|
global.wazoOnRefreshTokenError = global.wazoOnRefreshTokenError || {};
|
|
3693
3706
|
global.wazoRefreshExpiration = global.wazoRefreshExpiration || {};
|
|
@@ -4747,6 +4760,7 @@ class ApiClient {
|
|
|
4747
4760
|
|
|
4748
4761
|
|
|
4749
4762
|
|
|
4763
|
+
|
|
4750
4764
|
|
|
4751
4765
|
|
|
4752
4766
|
|
|
@@ -4788,6 +4802,7 @@ class ApiClient {
|
|
|
4788
4802
|
refreshToken: this.refreshToken,
|
|
4789
4803
|
refreshBackend: this.refreshBackend,
|
|
4790
4804
|
refreshTenantId: this.refreshTenantId,
|
|
4805
|
+
refreshDomainName: this.refreshDomainName,
|
|
4791
4806
|
refreshExpiration: this.refreshExpiration,
|
|
4792
4807
|
isMobile: this.isMobile,
|
|
4793
4808
|
});
|
|
@@ -4803,6 +4818,7 @@ class ApiClient {
|
|
|
4803
4818
|
this.refreshExpiration,
|
|
4804
4819
|
this.isMobile,
|
|
4805
4820
|
this.refreshTenantId,
|
|
4821
|
+
this.refreshDomainName,
|
|
4806
4822
|
);
|
|
4807
4823
|
|
|
4808
4824
|
logger.info('token refreshed', { token: session.token });
|
|
@@ -4856,9 +4872,14 @@ class ApiClient {
|
|
|
4856
4872
|
}
|
|
4857
4873
|
|
|
4858
4874
|
setRefreshTenantId(tenantId ) {
|
|
4875
|
+
console.warn('Use of `setRefreshTenantId` is deprecated, use `setRefreshDomainName` instead');
|
|
4859
4876
|
this.refreshTenantId = tenantId;
|
|
4860
4877
|
}
|
|
4861
4878
|
|
|
4879
|
+
setRefreshDomainName(domainName ) {
|
|
4880
|
+
this.refreshDomainName = domainName;
|
|
4881
|
+
}
|
|
4882
|
+
|
|
4862
4883
|
setIsMobile(isMobile ) {
|
|
4863
4884
|
this.isMobile = isMobile;
|
|
4864
4885
|
}
|
package/lib/checker/Checker.js
CHANGED
|
@@ -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$3.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
|
}
|
|
@@ -2215,6 +2215,7 @@ var authMethods = (client , baseUrl ) => ({
|
|
|
2215
2215
|
|
|
2216
2216
|
|
|
2217
2217
|
|
|
2218
|
+
|
|
2218
2219
|
) {
|
|
2219
2220
|
const body = {
|
|
2220
2221
|
backend: params.backend || DEFAULT_BACKEND_USER,
|
|
@@ -2235,9 +2236,14 @@ var authMethods = (client , baseUrl ) => ({
|
|
|
2235
2236
|
}
|
|
2236
2237
|
|
|
2237
2238
|
if (params.tenantId) {
|
|
2239
|
+
console.warn('Use of `tenantId` is deprecated when calling logIn() method, use `domainName` instead.');
|
|
2238
2240
|
body.tenant_id = params.tenantId;
|
|
2239
2241
|
}
|
|
2240
2242
|
|
|
2243
|
+
if (params.domainName) {
|
|
2244
|
+
body.domain_name = params.domainName;
|
|
2245
|
+
}
|
|
2246
|
+
|
|
2241
2247
|
return client.post(`${baseUrl}/token`, body, headers).then(response => Session.parse(response));
|
|
2242
2248
|
},
|
|
2243
2249
|
|
|
@@ -2250,6 +2256,7 @@ var authMethods = (client , baseUrl ) => ({
|
|
|
2250
2256
|
expiration ,
|
|
2251
2257
|
isMobile = false,
|
|
2252
2258
|
tenantId ,
|
|
2259
|
+
domainName ,
|
|
2253
2260
|
) => {
|
|
2254
2261
|
const body = {
|
|
2255
2262
|
backend: backend || DEFAULT_BACKEND_USER,
|
|
@@ -2259,9 +2266,14 @@ var authMethods = (client , baseUrl ) => ({
|
|
|
2259
2266
|
};
|
|
2260
2267
|
|
|
2261
2268
|
if (tenantId) {
|
|
2269
|
+
console.warn('Use of `tenantId` is deprecated when calling refreshToken() method, use `domainName` instead.');
|
|
2262
2270
|
body.tenant_id = tenantId;
|
|
2263
2271
|
}
|
|
2264
2272
|
|
|
2273
|
+
if (domainName) {
|
|
2274
|
+
body.domain_name = domainName;
|
|
2275
|
+
}
|
|
2276
|
+
|
|
2265
2277
|
const headers = {
|
|
2266
2278
|
'Content-Type': 'application/json',
|
|
2267
2279
|
...(isMobile ? { 'Wazo-Session-Type': 'mobile' } : {}),
|
|
@@ -3688,6 +3700,7 @@ global.wazoClientId = global.wazoClientId || {};
|
|
|
3688
3700
|
global.wazoClientToken = global.wazoClientToken || {};
|
|
3689
3701
|
global.wazoRefreshToken = global.wazoRefreshToken || {};
|
|
3690
3702
|
global.wazoRefreshTenantId = global.wazoRefreshTenantId || {};
|
|
3703
|
+
global.wazoRefreshDomainName = global.wazoRefreshDomainName || {};
|
|
3691
3704
|
global.wazoOnRefreshToken = global.wazoOnRefreshToken || {};
|
|
3692
3705
|
global.wazoOnRefreshTokenError = global.wazoOnRefreshTokenError || {};
|
|
3693
3706
|
global.wazoRefreshExpiration = global.wazoRefreshExpiration || {};
|
|
@@ -4747,6 +4760,7 @@ class ApiClient {
|
|
|
4747
4760
|
|
|
4748
4761
|
|
|
4749
4762
|
|
|
4763
|
+
|
|
4750
4764
|
|
|
4751
4765
|
|
|
4752
4766
|
|
|
@@ -4788,6 +4802,7 @@ class ApiClient {
|
|
|
4788
4802
|
refreshToken: this.refreshToken,
|
|
4789
4803
|
refreshBackend: this.refreshBackend,
|
|
4790
4804
|
refreshTenantId: this.refreshTenantId,
|
|
4805
|
+
refreshDomainName: this.refreshDomainName,
|
|
4791
4806
|
refreshExpiration: this.refreshExpiration,
|
|
4792
4807
|
isMobile: this.isMobile,
|
|
4793
4808
|
});
|
|
@@ -4803,6 +4818,7 @@ class ApiClient {
|
|
|
4803
4818
|
this.refreshExpiration,
|
|
4804
4819
|
this.isMobile,
|
|
4805
4820
|
this.refreshTenantId,
|
|
4821
|
+
this.refreshDomainName,
|
|
4806
4822
|
);
|
|
4807
4823
|
|
|
4808
4824
|
logger.info('token refreshed', { token: session.token });
|
|
@@ -4856,9 +4872,14 @@ class ApiClient {
|
|
|
4856
4872
|
}
|
|
4857
4873
|
|
|
4858
4874
|
setRefreshTenantId(tenantId ) {
|
|
4875
|
+
console.warn('Use of `setRefreshTenantId` is deprecated, use `setRefreshDomainName` instead');
|
|
4859
4876
|
this.refreshTenantId = tenantId;
|
|
4860
4877
|
}
|
|
4861
4878
|
|
|
4879
|
+
setRefreshDomainName(domainName ) {
|
|
4880
|
+
this.refreshDomainName = domainName;
|
|
4881
|
+
}
|
|
4882
|
+
|
|
4862
4883
|
setIsMobile(isMobile ) {
|
|
4863
4884
|
this.isMobile = isMobile;
|
|
4864
4885
|
}
|
|
@@ -2215,6 +2215,7 @@ var authMethods = (client , baseUrl ) => ({
|
|
|
2215
2215
|
|
|
2216
2216
|
|
|
2217
2217
|
|
|
2218
|
+
|
|
2218
2219
|
) {
|
|
2219
2220
|
const body = {
|
|
2220
2221
|
backend: params.backend || DEFAULT_BACKEND_USER,
|
|
@@ -2235,9 +2236,14 @@ var authMethods = (client , baseUrl ) => ({
|
|
|
2235
2236
|
}
|
|
2236
2237
|
|
|
2237
2238
|
if (params.tenantId) {
|
|
2239
|
+
console.warn('Use of `tenantId` is deprecated when calling logIn() method, use `domainName` instead.');
|
|
2238
2240
|
body.tenant_id = params.tenantId;
|
|
2239
2241
|
}
|
|
2240
2242
|
|
|
2243
|
+
if (params.domainName) {
|
|
2244
|
+
body.domain_name = params.domainName;
|
|
2245
|
+
}
|
|
2246
|
+
|
|
2241
2247
|
return client.post(`${baseUrl}/token`, body, headers).then(response => Session.parse(response));
|
|
2242
2248
|
},
|
|
2243
2249
|
|
|
@@ -2250,6 +2256,7 @@ var authMethods = (client , baseUrl ) => ({
|
|
|
2250
2256
|
expiration ,
|
|
2251
2257
|
isMobile = false,
|
|
2252
2258
|
tenantId ,
|
|
2259
|
+
domainName ,
|
|
2253
2260
|
) => {
|
|
2254
2261
|
const body = {
|
|
2255
2262
|
backend: backend || DEFAULT_BACKEND_USER,
|
|
@@ -2259,9 +2266,14 @@ var authMethods = (client , baseUrl ) => ({
|
|
|
2259
2266
|
};
|
|
2260
2267
|
|
|
2261
2268
|
if (tenantId) {
|
|
2269
|
+
console.warn('Use of `tenantId` is deprecated when calling refreshToken() method, use `domainName` instead.');
|
|
2262
2270
|
body.tenant_id = tenantId;
|
|
2263
2271
|
}
|
|
2264
2272
|
|
|
2273
|
+
if (domainName) {
|
|
2274
|
+
body.domain_name = domainName;
|
|
2275
|
+
}
|
|
2276
|
+
|
|
2265
2277
|
const headers = {
|
|
2266
2278
|
'Content-Type': 'application/json',
|
|
2267
2279
|
...(isMobile ? { 'Wazo-Session-Type': 'mobile' } : {}),
|
|
@@ -3688,6 +3700,7 @@ global.wazoClientId = global.wazoClientId || {};
|
|
|
3688
3700
|
global.wazoClientToken = global.wazoClientToken || {};
|
|
3689
3701
|
global.wazoRefreshToken = global.wazoRefreshToken || {};
|
|
3690
3702
|
global.wazoRefreshTenantId = global.wazoRefreshTenantId || {};
|
|
3703
|
+
global.wazoRefreshDomainName = global.wazoRefreshDomainName || {};
|
|
3691
3704
|
global.wazoOnRefreshToken = global.wazoOnRefreshToken || {};
|
|
3692
3705
|
global.wazoOnRefreshTokenError = global.wazoOnRefreshTokenError || {};
|
|
3693
3706
|
global.wazoRefreshExpiration = global.wazoRefreshExpiration || {};
|
|
@@ -4747,6 +4760,7 @@ class ApiClient {
|
|
|
4747
4760
|
|
|
4748
4761
|
|
|
4749
4762
|
|
|
4763
|
+
|
|
4750
4764
|
|
|
4751
4765
|
|
|
4752
4766
|
|
|
@@ -4788,6 +4802,7 @@ class ApiClient {
|
|
|
4788
4802
|
refreshToken: this.refreshToken,
|
|
4789
4803
|
refreshBackend: this.refreshBackend,
|
|
4790
4804
|
refreshTenantId: this.refreshTenantId,
|
|
4805
|
+
refreshDomainName: this.refreshDomainName,
|
|
4791
4806
|
refreshExpiration: this.refreshExpiration,
|
|
4792
4807
|
isMobile: this.isMobile,
|
|
4793
4808
|
});
|
|
@@ -4803,6 +4818,7 @@ class ApiClient {
|
|
|
4803
4818
|
this.refreshExpiration,
|
|
4804
4819
|
this.isMobile,
|
|
4805
4820
|
this.refreshTenantId,
|
|
4821
|
+
this.refreshDomainName,
|
|
4806
4822
|
);
|
|
4807
4823
|
|
|
4808
4824
|
logger.info('token refreshed', { token: session.token });
|
|
@@ -4856,9 +4872,14 @@ class ApiClient {
|
|
|
4856
4872
|
}
|
|
4857
4873
|
|
|
4858
4874
|
setRefreshTenantId(tenantId ) {
|
|
4875
|
+
console.warn('Use of `setRefreshTenantId` is deprecated, use `setRefreshDomainName` instead');
|
|
4859
4876
|
this.refreshTenantId = tenantId;
|
|
4860
4877
|
}
|
|
4861
4878
|
|
|
4879
|
+
setRefreshDomainName(domainName ) {
|
|
4880
|
+
this.refreshDomainName = domainName;
|
|
4881
|
+
}
|
|
4882
|
+
|
|
4862
4883
|
setIsMobile(isMobile ) {
|
|
4863
4884
|
this.isMobile = isMobile;
|
|
4864
4885
|
}
|