@wazo/sdk 0.37.36 → 0.37.39
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 +7 -2
- package/dist/wazo-sdk.js +2 -2
- package/esm/__tests__/api-client.test.js +9 -0
- package/esm/__tests__/web-rtc-client.test.js +9 -0
- package/esm/api/auth.js +4 -1
- package/esm/api-client.js +9 -0
- package/esm/checker/Checker.js +9 -0
- package/esm/checker/checks/aor.js +9 -0
- package/esm/checker/checks/api.js +9 -0
- package/esm/checker/checks/index.js +9 -0
- package/esm/checker/checks/webrtc-transport.js +9 -0
- package/esm/checker/checks/webrtc.js +9 -0
- 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/SwitchboardCall.js +5 -5
- package/esm/index.js +40 -11
- package/esm/service/CallApi.js +9 -0
- package/esm/service/getApiClient.js +9 -0
- package/esm/simple/Auth.js +41 -12
- package/esm/simple/Configuration.js +40 -11
- package/esm/simple/Directory.js +9 -0
- package/esm/simple/Phone.js +40 -11
- package/esm/simple/index.js +40 -11
- package/esm/simple/room/LocalParticipant.js +40 -11
- package/esm/simple/room/Participant.js +40 -11
- package/esm/simple/room/RemoteParticipant.js +40 -11
- package/esm/simple/room/Room.js +40 -11
- package/esm/simple/room/SipRoom.js +40 -11
- package/esm/simple/room/Stream.js +40 -11
- package/esm/simple/room/__tests__/RemoteParticipant.test.js +40 -11
- package/esm/simple/utils.js +40 -11
- package/esm/web-rtc-client.js +9 -0
- package/lib/__tests__/api-client.test.js +9 -0
- package/lib/__tests__/web-rtc-client.test.js +9 -0
- package/lib/api/auth.js +5 -0
- package/lib/api-client.js +9 -0
- package/lib/checker/Checker.js +9 -0
- package/lib/checker/checks/aor.js +9 -0
- package/lib/checker/checks/api.js +9 -0
- package/lib/checker/checks/index.js +9 -0
- package/lib/checker/checks/webrtc-transport.js +9 -0
- package/lib/checker/checks/webrtc.js +9 -0
- 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/SwitchboardCall.js +5 -5
- package/lib/index.js +40 -11
- package/lib/service/CallApi.js +9 -0
- package/lib/service/getApiClient.js +9 -0
- package/lib/simple/Auth.js +41 -11
- package/lib/simple/Configuration.js +40 -11
- package/lib/simple/Directory.js +9 -0
- package/lib/simple/Phone.js +40 -11
- package/lib/simple/index.js +40 -11
- package/lib/simple/room/LocalParticipant.js +40 -11
- package/lib/simple/room/Participant.js +40 -11
- package/lib/simple/room/RemoteParticipant.js +40 -11
- package/lib/simple/room/Room.js +40 -11
- package/lib/simple/room/SipRoom.js +40 -11
- package/lib/simple/room/Stream.js +40 -11
- package/lib/simple/room/__tests__/RemoteParticipant.test.js +40 -11
- package/lib/simple/utils.js +40 -11
- package/lib/web-rtc-client.js +9 -0
- package/package.json +1 -1
- package/src/api/auth.js +4 -1
- package/src/api-client.js +7 -0
- package/src/domain/AdHocAPIConference.js +5 -5
- package/src/domain/SwitchboardCall.js +5 -5
- package/src/simple/Auth.js +20 -2
- package/src/simple/index.js +2 -1
|
@@ -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
|
}
|
|
@@ -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
|
}
|
|
@@ -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
|
}
|
|
@@ -2453,12 +2453,14 @@ var authMethods = (client , baseUrl ) => ({
|
|
|
2453
2453
|
backend ,
|
|
2454
2454
|
expiration ,
|
|
2455
2455
|
isMobile = false,
|
|
2456
|
+
tenantId ,
|
|
2456
2457
|
) => {
|
|
2457
2458
|
const body = {
|
|
2458
2459
|
backend: backend || DEFAULT_BACKEND_USER,
|
|
2459
2460
|
expiration: expiration || DETAULT_EXPIRATION,
|
|
2460
2461
|
refresh_token: refreshToken,
|
|
2461
2462
|
client_id: client.clientId,
|
|
2463
|
+
tenant_id: tenantId,
|
|
2462
2464
|
};
|
|
2463
2465
|
|
|
2464
2466
|
const headers = {
|
|
@@ -4572,6 +4574,7 @@ class ApiClient {
|
|
|
4572
4574
|
|
|
4573
4575
|
|
|
4574
4576
|
|
|
4577
|
+
|
|
4575
4578
|
|
|
4576
4579
|
|
|
4577
4580
|
|
|
@@ -4612,6 +4615,7 @@ class ApiClient {
|
|
|
4612
4615
|
logger.info('refresh token callback called', {
|
|
4613
4616
|
refreshToken: this.refreshToken,
|
|
4614
4617
|
refreshBackend: this.refreshBackend,
|
|
4618
|
+
refreshTenantId: this.refreshTenantId,
|
|
4615
4619
|
refreshExpiration: this.refreshExpiration,
|
|
4616
4620
|
isMobile: this.isMobile,
|
|
4617
4621
|
});
|
|
@@ -4625,6 +4629,7 @@ class ApiClient {
|
|
|
4625
4629
|
this.refreshBackend,
|
|
4626
4630
|
this.refreshExpiration,
|
|
4627
4631
|
this.isMobile,
|
|
4632
|
+
this.refreshTenantId,
|
|
4628
4633
|
);
|
|
4629
4634
|
|
|
4630
4635
|
logger.info('token refreshed', { token: session.token });
|
|
@@ -4666,6 +4671,10 @@ class ApiClient {
|
|
|
4666
4671
|
this.refreshBackend = refreshBackend;
|
|
4667
4672
|
}
|
|
4668
4673
|
|
|
4674
|
+
setRefreshTenantId(tenantId ) {
|
|
4675
|
+
this.refreshTenantId = tenantId;
|
|
4676
|
+
}
|
|
4677
|
+
|
|
4669
4678
|
setIsMobile(isMobile ) {
|
|
4670
4679
|
this.isMobile = isMobile;
|
|
4671
4680
|
}
|
|
@@ -4760,7 +4769,7 @@ var getApiClient = (forServer ) => {
|
|
|
4760
4769
|
|
|
4761
4770
|
|
|
4762
4771
|
|
|
4763
|
-
|
|
4772
|
+
|
|
4764
4773
|
|
|
4765
4774
|
|
|
4766
4775
|
|
|
@@ -4780,7 +4789,7 @@ class AdHocAPIConference {
|
|
|
4780
4789
|
|
|
4781
4790
|
|
|
4782
4791
|
|
|
4783
|
-
|
|
4792
|
+
|
|
4784
4793
|
|
|
4785
4794
|
|
|
4786
4795
|
|
|
@@ -4792,7 +4801,7 @@ class AdHocAPIConference {
|
|
|
4792
4801
|
participants,
|
|
4793
4802
|
started,
|
|
4794
4803
|
finished,
|
|
4795
|
-
|
|
4804
|
+
answerTime,
|
|
4796
4805
|
conferenceId,
|
|
4797
4806
|
muted,
|
|
4798
4807
|
paused,
|
|
@@ -4802,7 +4811,7 @@ class AdHocAPIConference {
|
|
|
4802
4811
|
this.participants = participants || {};
|
|
4803
4812
|
this.started = started || false;
|
|
4804
4813
|
this.finished = finished || false;
|
|
4805
|
-
this.
|
|
4814
|
+
this.answerTime = answerTime;
|
|
4806
4815
|
this.conferenceId = conferenceId || '';
|
|
4807
4816
|
this.muted = muted || false;
|
|
4808
4817
|
this.paused = paused || false;
|
|
@@ -4815,7 +4824,7 @@ class AdHocAPIConference {
|
|
|
4815
4824
|
async start() {
|
|
4816
4825
|
this.started = true;
|
|
4817
4826
|
// $FlowFixMe
|
|
4818
|
-
this.
|
|
4827
|
+
this.answerTime = Object.values(this.participants).length ? Object.values(this.participants)[0].answerTime : null;
|
|
4819
4828
|
|
|
4820
4829
|
const participantIds = Object.keys(this.participants);
|
|
4821
4830
|
const conference = await getApiClient().calld.createAdHocConference(this.host.callId, participantIds);
|
package/lib/domain/Features.js
CHANGED
|
@@ -2246,12 +2246,14 @@ var authMethods = (client , baseUrl ) => ({
|
|
|
2246
2246
|
backend ,
|
|
2247
2247
|
expiration ,
|
|
2248
2248
|
isMobile = false,
|
|
2249
|
+
tenantId ,
|
|
2249
2250
|
) => {
|
|
2250
2251
|
const body = {
|
|
2251
2252
|
backend: backend || DEFAULT_BACKEND_USER,
|
|
2252
2253
|
expiration: expiration || DETAULT_EXPIRATION,
|
|
2253
2254
|
refresh_token: refreshToken,
|
|
2254
2255
|
client_id: client.clientId,
|
|
2256
|
+
tenant_id: tenantId,
|
|
2255
2257
|
};
|
|
2256
2258
|
|
|
2257
2259
|
const headers = {
|
|
@@ -4574,6 +4576,7 @@ class ApiClient {
|
|
|
4574
4576
|
|
|
4575
4577
|
|
|
4576
4578
|
|
|
4579
|
+
|
|
4577
4580
|
|
|
4578
4581
|
|
|
4579
4582
|
|
|
@@ -4614,6 +4617,7 @@ class ApiClient {
|
|
|
4614
4617
|
logger.info('refresh token callback called', {
|
|
4615
4618
|
refreshToken: this.refreshToken,
|
|
4616
4619
|
refreshBackend: this.refreshBackend,
|
|
4620
|
+
refreshTenantId: this.refreshTenantId,
|
|
4617
4621
|
refreshExpiration: this.refreshExpiration,
|
|
4618
4622
|
isMobile: this.isMobile,
|
|
4619
4623
|
});
|
|
@@ -4627,6 +4631,7 @@ class ApiClient {
|
|
|
4627
4631
|
this.refreshBackend,
|
|
4628
4632
|
this.refreshExpiration,
|
|
4629
4633
|
this.isMobile,
|
|
4634
|
+
this.refreshTenantId,
|
|
4630
4635
|
);
|
|
4631
4636
|
|
|
4632
4637
|
logger.info('token refreshed', { token: session.token });
|
|
@@ -4668,6 +4673,10 @@ class ApiClient {
|
|
|
4668
4673
|
this.refreshBackend = refreshBackend;
|
|
4669
4674
|
}
|
|
4670
4675
|
|
|
4676
|
+
setRefreshTenantId(tenantId ) {
|
|
4677
|
+
this.refreshTenantId = tenantId;
|
|
4678
|
+
}
|
|
4679
|
+
|
|
4671
4680
|
setIsMobile(isMobile ) {
|
|
4672
4681
|
this.isMobile = isMobile;
|
|
4673
4682
|
}
|
|
@@ -3207,12 +3207,14 @@ var authMethods = (client , baseUrl ) => ({
|
|
|
3207
3207
|
backend ,
|
|
3208
3208
|
expiration ,
|
|
3209
3209
|
isMobile = false,
|
|
3210
|
+
tenantId ,
|
|
3210
3211
|
) => {
|
|
3211
3212
|
const body = {
|
|
3212
3213
|
backend: backend || DEFAULT_BACKEND_USER,
|
|
3213
3214
|
expiration: expiration || DETAULT_EXPIRATION,
|
|
3214
3215
|
refresh_token: refreshToken,
|
|
3215
3216
|
client_id: client.clientId,
|
|
3217
|
+
tenant_id: tenantId,
|
|
3216
3218
|
};
|
|
3217
3219
|
|
|
3218
3220
|
const headers = {
|
|
@@ -4988,6 +4990,7 @@ class ApiClient {
|
|
|
4988
4990
|
|
|
4989
4991
|
|
|
4990
4992
|
|
|
4993
|
+
|
|
4991
4994
|
|
|
4992
4995
|
|
|
4993
4996
|
|
|
@@ -5028,6 +5031,7 @@ class ApiClient {
|
|
|
5028
5031
|
logger$1.info('refresh token callback called', {
|
|
5029
5032
|
refreshToken: this.refreshToken,
|
|
5030
5033
|
refreshBackend: this.refreshBackend,
|
|
5034
|
+
refreshTenantId: this.refreshTenantId,
|
|
5031
5035
|
refreshExpiration: this.refreshExpiration,
|
|
5032
5036
|
isMobile: this.isMobile,
|
|
5033
5037
|
});
|
|
@@ -5041,6 +5045,7 @@ class ApiClient {
|
|
|
5041
5045
|
this.refreshBackend,
|
|
5042
5046
|
this.refreshExpiration,
|
|
5043
5047
|
this.isMobile,
|
|
5048
|
+
this.refreshTenantId,
|
|
5044
5049
|
);
|
|
5045
5050
|
|
|
5046
5051
|
logger$1.info('token refreshed', { token: session.token });
|
|
@@ -5082,6 +5087,10 @@ class ApiClient {
|
|
|
5082
5087
|
this.refreshBackend = refreshBackend;
|
|
5083
5088
|
}
|
|
5084
5089
|
|
|
5090
|
+
setRefreshTenantId(tenantId ) {
|
|
5091
|
+
this.refreshTenantId = tenantId;
|
|
5092
|
+
}
|
|
5093
|
+
|
|
5085
5094
|
setIsMobile(isMobile ) {
|
|
5086
5095
|
this.isMobile = isMobile;
|
|
5087
5096
|
}
|
|
@@ -56,7 +56,7 @@ var updateFrom = (instance , from ) => {
|
|
|
56
56
|
|
|
57
57
|
|
|
58
58
|
|
|
59
|
-
|
|
59
|
+
|
|
60
60
|
|
|
61
61
|
|
|
62
62
|
|
|
@@ -82,7 +82,7 @@ class SwitchboardCall {
|
|
|
82
82
|
|
|
83
83
|
|
|
84
84
|
|
|
85
|
-
|
|
85
|
+
|
|
86
86
|
|
|
87
87
|
|
|
88
88
|
|
|
@@ -96,7 +96,7 @@ class SwitchboardCall {
|
|
|
96
96
|
callerIdName: plain.caller_id_name || null,
|
|
97
97
|
callerIdNumber: plain.caller_id_number || null,
|
|
98
98
|
participantId: plain.participantId || null,
|
|
99
|
-
|
|
99
|
+
answerTime: plain.startTime,
|
|
100
100
|
state: plain.state,
|
|
101
101
|
switchboardName: plain.switchboardName,
|
|
102
102
|
switchboardUuid: plain.switchboardUuid,
|
|
@@ -109,7 +109,7 @@ class SwitchboardCall {
|
|
|
109
109
|
callerIdName,
|
|
110
110
|
callerIdNumber,
|
|
111
111
|
participantId,
|
|
112
|
-
|
|
112
|
+
answerTime,
|
|
113
113
|
state,
|
|
114
114
|
switchboardName,
|
|
115
115
|
switchboardUuid,
|
|
@@ -119,7 +119,7 @@ class SwitchboardCall {
|
|
|
119
119
|
this.callerIdName = callerIdName;
|
|
120
120
|
this.callerIdNumber = callerIdNumber;
|
|
121
121
|
this.participantId = participantId;
|
|
122
|
-
this.
|
|
122
|
+
this.answerTime = answerTime;
|
|
123
123
|
this.state = state;
|
|
124
124
|
this.switchboardName = switchboardName;
|
|
125
125
|
this.switchboardUuid = switchboardUuid;
|
package/lib/index.js
CHANGED
|
@@ -2220,6 +2220,7 @@ class Session {
|
|
|
2220
2220
|
/* */
|
|
2221
2221
|
|
|
2222
2222
|
const DEFAULT_BACKEND_USER = 'wazo_user';
|
|
2223
|
+
const BACKEND_LDAP_USER = 'ldap_user';
|
|
2223
2224
|
const DETAULT_EXPIRATION = 3600;
|
|
2224
2225
|
|
|
2225
2226
|
var authMethods = (client , baseUrl ) => ({
|
|
@@ -2269,12 +2270,14 @@ var authMethods = (client , baseUrl ) => ({
|
|
|
2269
2270
|
backend ,
|
|
2270
2271
|
expiration ,
|
|
2271
2272
|
isMobile = false,
|
|
2273
|
+
tenantId ,
|
|
2272
2274
|
) => {
|
|
2273
2275
|
const body = {
|
|
2274
2276
|
backend: backend || DEFAULT_BACKEND_USER,
|
|
2275
2277
|
expiration: expiration || DETAULT_EXPIRATION,
|
|
2276
2278
|
refresh_token: refreshToken,
|
|
2277
2279
|
client_id: client.clientId,
|
|
2280
|
+
tenant_id: tenantId,
|
|
2278
2281
|
};
|
|
2279
2282
|
|
|
2280
2283
|
const headers = {
|
|
@@ -5509,6 +5512,7 @@ class ApiClient {
|
|
|
5509
5512
|
|
|
5510
5513
|
|
|
5511
5514
|
|
|
5515
|
+
|
|
5512
5516
|
|
|
5513
5517
|
|
|
5514
5518
|
|
|
@@ -5549,6 +5553,7 @@ class ApiClient {
|
|
|
5549
5553
|
logger$a.info('refresh token callback called', {
|
|
5550
5554
|
refreshToken: this.refreshToken,
|
|
5551
5555
|
refreshBackend: this.refreshBackend,
|
|
5556
|
+
refreshTenantId: this.refreshTenantId,
|
|
5552
5557
|
refreshExpiration: this.refreshExpiration,
|
|
5553
5558
|
isMobile: this.isMobile,
|
|
5554
5559
|
});
|
|
@@ -5562,6 +5567,7 @@ class ApiClient {
|
|
|
5562
5567
|
this.refreshBackend,
|
|
5563
5568
|
this.refreshExpiration,
|
|
5564
5569
|
this.isMobile,
|
|
5570
|
+
this.refreshTenantId,
|
|
5565
5571
|
);
|
|
5566
5572
|
|
|
5567
5573
|
logger$a.info('token refreshed', { token: session.token });
|
|
@@ -5603,6 +5609,10 @@ class ApiClient {
|
|
|
5603
5609
|
this.refreshBackend = refreshBackend;
|
|
5604
5610
|
}
|
|
5605
5611
|
|
|
5612
|
+
setRefreshTenantId(tenantId ) {
|
|
5613
|
+
this.refreshTenantId = tenantId;
|
|
5614
|
+
}
|
|
5615
|
+
|
|
5606
5616
|
setIsMobile(isMobile ) {
|
|
5607
5617
|
this.isMobile = isMobile;
|
|
5608
5618
|
}
|
|
@@ -9212,7 +9222,7 @@ class Room$1 {
|
|
|
9212
9222
|
|
|
9213
9223
|
|
|
9214
9224
|
|
|
9215
|
-
|
|
9225
|
+
|
|
9216
9226
|
|
|
9217
9227
|
|
|
9218
9228
|
|
|
@@ -9238,7 +9248,7 @@ class SwitchboardCall {
|
|
|
9238
9248
|
|
|
9239
9249
|
|
|
9240
9250
|
|
|
9241
|
-
|
|
9251
|
+
|
|
9242
9252
|
|
|
9243
9253
|
|
|
9244
9254
|
|
|
@@ -9252,7 +9262,7 @@ class SwitchboardCall {
|
|
|
9252
9262
|
callerIdName: plain.caller_id_name || null,
|
|
9253
9263
|
callerIdNumber: plain.caller_id_number || null,
|
|
9254
9264
|
participantId: plain.participantId || null,
|
|
9255
|
-
|
|
9265
|
+
answerTime: plain.startTime,
|
|
9256
9266
|
state: plain.state,
|
|
9257
9267
|
switchboardName: plain.switchboardName,
|
|
9258
9268
|
switchboardUuid: plain.switchboardUuid,
|
|
@@ -9265,7 +9275,7 @@ class SwitchboardCall {
|
|
|
9265
9275
|
callerIdName,
|
|
9266
9276
|
callerIdNumber,
|
|
9267
9277
|
participantId,
|
|
9268
|
-
|
|
9278
|
+
answerTime,
|
|
9269
9279
|
state,
|
|
9270
9280
|
switchboardName,
|
|
9271
9281
|
switchboardUuid,
|
|
@@ -9275,7 +9285,7 @@ class SwitchboardCall {
|
|
|
9275
9285
|
this.callerIdName = callerIdName;
|
|
9276
9286
|
this.callerIdNumber = callerIdNumber;
|
|
9277
9287
|
this.participantId = participantId;
|
|
9278
|
-
this.
|
|
9288
|
+
this.answerTime = answerTime;
|
|
9279
9289
|
this.state = state;
|
|
9280
9290
|
this.switchboardName = switchboardName;
|
|
9281
9291
|
this.switchboardUuid = switchboardUuid;
|
|
@@ -11707,6 +11717,7 @@ const getCallableNumber = (number , country ) => {
|
|
|
11707
11717
|
|
|
11708
11718
|
class InvalidSubscription extends Error {}
|
|
11709
11719
|
class InvalidAuthorization extends Error {}
|
|
11720
|
+
class NoTenantIdError extends Error {}
|
|
11710
11721
|
|
|
11711
11722
|
const logger$5 = IssueReporter$1.loggerFor('simple-auth');
|
|
11712
11723
|
|
|
@@ -11720,11 +11731,15 @@ class Auth {
|
|
|
11720
11731
|
|
|
11721
11732
|
|
|
11722
11733
|
|
|
11734
|
+
|
|
11735
|
+
|
|
11723
11736
|
|
|
11724
11737
|
constructor() {
|
|
11725
11738
|
this.expiration = DETAULT_EXPIRATION;
|
|
11726
11739
|
this.authenticated = false;
|
|
11727
11740
|
this.minSubscriptionType = null;
|
|
11741
|
+
this.BACKEND_WAZO = DEFAULT_BACKEND_USER;
|
|
11742
|
+
this.BACKEND_LDAP = BACKEND_LDAP_USER;
|
|
11728
11743
|
}
|
|
11729
11744
|
|
|
11730
11745
|
init(clientId ,
|
|
@@ -11757,15 +11772,28 @@ class Auth {
|
|
|
11757
11772
|
setFetchOptions(options);
|
|
11758
11773
|
}
|
|
11759
11774
|
|
|
11760
|
-
async logIn(username , password ) {
|
|
11775
|
+
async logIn(username , password , backend , tenantId ) {
|
|
11776
|
+
if (backend && backend !== this.BACKEND_WAZO && !tenantId) {
|
|
11777
|
+
throw new NoTenantIdError('No tenant id');
|
|
11778
|
+
}
|
|
11779
|
+
|
|
11761
11780
|
this.authenticated = false;
|
|
11762
11781
|
this.session = null;
|
|
11763
11782
|
const rawSession = await getApiClient().auth.logIn({
|
|
11764
11783
|
username,
|
|
11765
11784
|
password,
|
|
11785
|
+
backend,
|
|
11786
|
+
tenantId,
|
|
11766
11787
|
expiration: this.expiration,
|
|
11767
11788
|
mobile: this.mobile,
|
|
11768
11789
|
});
|
|
11790
|
+
|
|
11791
|
+
if (backend) {
|
|
11792
|
+
getApiClient().setRefreshBackend(backend);
|
|
11793
|
+
}
|
|
11794
|
+
|
|
11795
|
+
getApiClient().setRefreshTenantId(tenantId);
|
|
11796
|
+
|
|
11769
11797
|
return this._onAuthenticated(rawSession);
|
|
11770
11798
|
}
|
|
11771
11799
|
|
|
@@ -11992,7 +12020,7 @@ var Auth$1 = global.wazoAuthInstance;
|
|
|
11992
12020
|
|
|
11993
12021
|
|
|
11994
12022
|
|
|
11995
|
-
|
|
12023
|
+
|
|
11996
12024
|
|
|
11997
12025
|
|
|
11998
12026
|
|
|
@@ -12012,7 +12040,7 @@ class AdHocAPIConference {
|
|
|
12012
12040
|
|
|
12013
12041
|
|
|
12014
12042
|
|
|
12015
|
-
|
|
12043
|
+
|
|
12016
12044
|
|
|
12017
12045
|
|
|
12018
12046
|
|
|
@@ -12024,7 +12052,7 @@ class AdHocAPIConference {
|
|
|
12024
12052
|
participants,
|
|
12025
12053
|
started,
|
|
12026
12054
|
finished,
|
|
12027
|
-
|
|
12055
|
+
answerTime,
|
|
12028
12056
|
conferenceId,
|
|
12029
12057
|
muted,
|
|
12030
12058
|
paused,
|
|
@@ -12034,7 +12062,7 @@ class AdHocAPIConference {
|
|
|
12034
12062
|
this.participants = participants || {};
|
|
12035
12063
|
this.started = started || false;
|
|
12036
12064
|
this.finished = finished || false;
|
|
12037
|
-
this.
|
|
12065
|
+
this.answerTime = answerTime;
|
|
12038
12066
|
this.conferenceId = conferenceId || '';
|
|
12039
12067
|
this.muted = muted || false;
|
|
12040
12068
|
this.paused = paused || false;
|
|
@@ -12047,7 +12075,7 @@ class AdHocAPIConference {
|
|
|
12047
12075
|
async start() {
|
|
12048
12076
|
this.started = true;
|
|
12049
12077
|
// $FlowFixMe
|
|
12050
|
-
this.
|
|
12078
|
+
this.answerTime = Object.values(this.participants).length ? Object.values(this.participants)[0].answerTime : null;
|
|
12051
12079
|
|
|
12052
12080
|
const participantIds = Object.keys(this.participants);
|
|
12053
12081
|
const conference = await getApiClient().calld.createAdHocConference(this.host.callId, participantIds);
|
|
@@ -14092,6 +14120,7 @@ const Wazo = {
|
|
|
14092
14120
|
InvalidAuthorization,
|
|
14093
14121
|
CanceledCallError,
|
|
14094
14122
|
SFUNotAvailableError,
|
|
14123
|
+
NoTenantIdError,
|
|
14095
14124
|
};
|
|
14096
14125
|
|
|
14097
14126
|
if (window) {
|