@wazo/sdk 0.37.35 → 0.37.38
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 +8 -2
- package/dist/wazo-sdk.js +2 -2
- package/esm/__tests__/api-client.test.js +7 -1
- package/esm/__tests__/web-rtc-client.test.js +7 -1
- package/esm/api/auth.js +2 -1
- package/esm/api/call-logd.js +1 -1
- package/esm/api/chatd.js +6 -0
- package/esm/api/confd.js +6 -0
- package/esm/api-client.js +7 -1
- package/esm/checker/Checker.js +7 -1
- package/esm/checker/checks/aor.js +7 -1
- package/esm/checker/checks/api.js +7 -1
- package/esm/checker/checks/index.js +7 -1
- package/esm/checker/checks/webrtc-transport.js +7 -1
- package/esm/checker/checks/webrtc.js +7 -1
- package/esm/domain/AdHocAPIConference.js +16 -6
- package/esm/domain/CallLog.js +1 -1
- package/esm/domain/CallSession.js +14 -0
- package/esm/domain/Features.js +7 -1
- package/esm/domain/Phone/CTIPhone.js +21 -1
- package/esm/domain/Phone/WebRTCPhone.js +42 -11
- package/esm/domain/Profile.js +6 -0
- package/esm/domain/SwitchboardCall.js +5 -5
- package/esm/domain/__tests__/CallLog.test.js +5 -1
- package/esm/domain/__tests__/CallSession.test.js +14 -0
- package/esm/domain/__tests__/IndirectTransfer.test.js +14 -0
- package/esm/domain/__tests__/Profile.test.js +6 -0
- package/esm/domain/__tests__/Room.test.js +14 -0
- package/esm/domain/__tests__/Session.test.js +6 -0
- package/esm/index.js +83 -29
- package/esm/service/CallApi.js +7 -1
- package/esm/service/getApiClient.js +7 -1
- package/esm/simple/Auth.js +84 -30
- package/esm/simple/Configuration.js +83 -29
- package/esm/simple/Directory.js +7 -1
- package/esm/simple/Phone.js +83 -29
- package/esm/simple/index.js +83 -29
- package/esm/simple/room/LocalParticipant.js +83 -29
- package/esm/simple/room/Participant.js +83 -29
- package/esm/simple/room/RemoteParticipant.js +83 -29
- package/esm/simple/room/Room.js +83 -29
- package/esm/simple/room/SipRoom.js +83 -29
- package/esm/simple/room/Stream.js +83 -29
- package/esm/simple/room/__tests__/RemoteParticipant.test.js +83 -29
- package/esm/simple/utils.js +83 -29
- package/esm/web-rtc-client.js +7 -1
- package/lib/__tests__/api-client.test.js +7 -1
- package/lib/__tests__/web-rtc-client.test.js +7 -1
- package/lib/api/auth.js +3 -0
- package/lib/api/call-logd.js +1 -1
- package/lib/api/chatd.js +6 -0
- package/lib/api/confd.js +6 -0
- package/lib/api-client.js +7 -1
- package/lib/checker/Checker.js +7 -1
- package/lib/checker/checks/aor.js +7 -1
- package/lib/checker/checks/api.js +7 -1
- package/lib/checker/checks/index.js +7 -1
- package/lib/checker/checks/webrtc-transport.js +7 -1
- package/lib/checker/checks/webrtc.js +7 -1
- package/lib/domain/AdHocAPIConference.js +16 -6
- package/lib/domain/CallLog.js +1 -1
- package/lib/domain/CallSession.js +14 -0
- package/lib/domain/Features.js +7 -1
- package/lib/domain/Phone/CTIPhone.js +21 -1
- package/lib/domain/Phone/WebRTCPhone.js +42 -11
- package/lib/domain/Profile.js +6 -0
- package/lib/domain/SwitchboardCall.js +5 -5
- package/lib/domain/__tests__/CallLog.test.js +5 -1
- package/lib/domain/__tests__/CallSession.test.js +14 -0
- package/lib/domain/__tests__/IndirectTransfer.test.js +14 -0
- package/lib/domain/__tests__/Profile.test.js +6 -0
- package/lib/domain/__tests__/Room.test.js +14 -0
- package/lib/domain/__tests__/Session.test.js +6 -0
- package/lib/index.js +83 -29
- package/lib/service/CallApi.js +7 -1
- package/lib/service/getApiClient.js +7 -1
- package/lib/simple/Auth.js +84 -29
- package/lib/simple/Configuration.js +83 -29
- package/lib/simple/Directory.js +7 -1
- package/lib/simple/Phone.js +83 -29
- package/lib/simple/index.js +83 -29
- package/lib/simple/room/LocalParticipant.js +83 -29
- package/lib/simple/room/Participant.js +83 -29
- package/lib/simple/room/RemoteParticipant.js +83 -29
- package/lib/simple/room/Room.js +83 -29
- package/lib/simple/room/SipRoom.js +83 -29
- package/lib/simple/room/Stream.js +83 -29
- package/lib/simple/room/__tests__/RemoteParticipant.test.js +83 -29
- package/lib/simple/utils.js +83 -29
- package/lib/web-rtc-client.js +7 -1
- package/package.json +1 -1
- package/src/api/auth.js +2 -1
- package/src/domain/AdHocAPIConference.js +9 -5
- package/src/domain/CallLog.js +1 -1
- package/src/domain/CallSession.js +14 -0
- package/src/domain/Phone/WebRTCPhone.js +28 -11
- package/src/domain/Profile.js +6 -0
- package/src/domain/SwitchboardCall.js +5 -5
- package/src/domain/__tests__/CallLog.test.js +4 -0
- package/src/simple/Auth.js +13 -2
- package/src/simple/Phone.js +6 -6
- package/src/simple/index.js +2 -1
|
@@ -394,6 +394,7 @@ const LINE_STATE = {
|
|
|
394
394
|
|
|
395
395
|
|
|
396
396
|
|
|
397
|
+
|
|
397
398
|
|
|
398
399
|
|
|
399
400
|
|
|
@@ -430,6 +431,7 @@ const LINE_STATE = {
|
|
|
430
431
|
|
|
431
432
|
|
|
432
433
|
|
|
434
|
+
|
|
433
435
|
|
|
434
436
|
|
|
435
437
|
|
|
@@ -461,6 +463,7 @@ class Profile {
|
|
|
461
463
|
|
|
462
464
|
|
|
463
465
|
|
|
466
|
+
|
|
464
467
|
|
|
465
468
|
|
|
466
469
|
|
|
@@ -477,6 +480,7 @@ class Profile {
|
|
|
477
480
|
lines: plain.lines.map(line => Line.parse(line)),
|
|
478
481
|
username: plain.username,
|
|
479
482
|
mobileNumber: plain.mobile_phone_number || '',
|
|
483
|
+
ringSeconds: plain.ring_seconds,
|
|
480
484
|
forwards: [
|
|
481
485
|
ForwardOption.parse(plain.forwards.unconditional, FORWARD_KEYS.UNCONDITIONAL),
|
|
482
486
|
ForwardOption.parse(plain.forwards.noanswer, FORWARD_KEYS.NO_ANSWER),
|
|
@@ -513,6 +517,7 @@ class Profile {
|
|
|
513
517
|
switchboards,
|
|
514
518
|
agent,
|
|
515
519
|
status,
|
|
520
|
+
ringSeconds,
|
|
516
521
|
sipLines,
|
|
517
522
|
callPickupTargetUsers,
|
|
518
523
|
onlineCallRecordEnabled,
|
|
@@ -534,6 +539,7 @@ class Profile {
|
|
|
534
539
|
this.status = status;
|
|
535
540
|
this.callPickupTargetUsers = callPickupTargetUsers;
|
|
536
541
|
this.onlineCallRecordEnabled = onlineCallRecordEnabled;
|
|
542
|
+
this.ringSeconds = ringSeconds;
|
|
537
543
|
|
|
538
544
|
this.sipLines = sipLines || [];
|
|
539
545
|
}
|
|
@@ -2212,6 +2218,7 @@ class ApiRequester {
|
|
|
2212
2218
|
/* */
|
|
2213
2219
|
|
|
2214
2220
|
const DEFAULT_BACKEND_USER = 'wazo_user';
|
|
2221
|
+
const BACKEND_LDAP_USER = 'ldap_user';
|
|
2215
2222
|
const DETAULT_EXPIRATION = 3600;
|
|
2216
2223
|
|
|
2217
2224
|
var authMethods = (client , baseUrl ) => ({
|
|
@@ -3290,6 +3297,7 @@ var updateFrom = (instance , from ) => {
|
|
|
3290
3297
|
|
|
3291
3298
|
|
|
3292
3299
|
|
|
3300
|
+
|
|
3293
3301
|
|
|
3294
3302
|
|
|
3295
3303
|
class CallSession {
|
|
@@ -3352,6 +3360,8 @@ class CallSession {
|
|
|
3352
3360
|
|
|
3353
3361
|
|
|
3354
3362
|
|
|
3363
|
+
|
|
3364
|
+
|
|
3355
3365
|
|
|
3356
3366
|
|
|
3357
3367
|
|
|
@@ -3383,6 +3393,7 @@ class CallSession {
|
|
|
3383
3393
|
videoRemotelyDowngraded,
|
|
3384
3394
|
sipSession,
|
|
3385
3395
|
answerTime,
|
|
3396
|
+
conference,
|
|
3386
3397
|
} ) {
|
|
3387
3398
|
this.callId = callId;
|
|
3388
3399
|
this.sipCallId = sipCallId;
|
|
@@ -3411,6 +3422,7 @@ class CallSession {
|
|
|
3411
3422
|
this.videoRemotelyDowngraded = videoRemotelyDowngraded;
|
|
3412
3423
|
this.sipSession = sipSession;
|
|
3413
3424
|
this.answerTime = answerTime || this.answerTime;
|
|
3425
|
+
this.conference = conference;
|
|
3414
3426
|
|
|
3415
3427
|
// Useful to compare instead of instanceof with minified code
|
|
3416
3428
|
this.type = 'CallSession';
|
|
@@ -3468,6 +3480,10 @@ class CallSession {
|
|
|
3468
3480
|
this.screensharing = false;
|
|
3469
3481
|
}
|
|
3470
3482
|
|
|
3483
|
+
setIsConference(conference ) {
|
|
3484
|
+
this.conference = conference;
|
|
3485
|
+
}
|
|
3486
|
+
|
|
3471
3487
|
isIncoming() {
|
|
3472
3488
|
return !this.isCaller && !this.answered;
|
|
3473
3489
|
}
|
|
@@ -3544,6 +3560,10 @@ class CallSession {
|
|
|
3544
3560
|
return this.sipStatus === sessionState.SessionState.Terminated;
|
|
3545
3561
|
}
|
|
3546
3562
|
|
|
3563
|
+
isConference() {
|
|
3564
|
+
return this.conference;
|
|
3565
|
+
}
|
|
3566
|
+
|
|
3547
3567
|
getElapsedTimeInSeconds() {
|
|
3548
3568
|
if (!this.startTime) {
|
|
3549
3569
|
return 0;
|
|
@@ -3635,6 +3655,7 @@ class CallSession {
|
|
|
3635
3655
|
cameraEnabled: false,
|
|
3636
3656
|
dialedExtension: call.dialedExtension,
|
|
3637
3657
|
call,
|
|
3658
|
+
conference: false, // @FIXME?
|
|
3638
3659
|
});
|
|
3639
3660
|
}
|
|
3640
3661
|
}
|
|
@@ -3730,7 +3751,7 @@ class Recording {
|
|
|
3730
3751
|
|
|
3731
3752
|
|
|
3732
3753
|
|
|
3733
|
-
|
|
3754
|
+
|
|
3734
3755
|
|
|
3735
3756
|
|
|
3736
3757
|
|
|
@@ -5620,7 +5641,7 @@ var getApiClient = (forServer ) => {
|
|
|
5620
5641
|
|
|
5621
5642
|
|
|
5622
5643
|
|
|
5623
|
-
|
|
5644
|
+
|
|
5624
5645
|
|
|
5625
5646
|
|
|
5626
5647
|
|
|
@@ -5640,7 +5661,7 @@ class AdHocAPIConference {
|
|
|
5640
5661
|
|
|
5641
5662
|
|
|
5642
5663
|
|
|
5643
|
-
|
|
5664
|
+
|
|
5644
5665
|
|
|
5645
5666
|
|
|
5646
5667
|
|
|
@@ -5652,7 +5673,7 @@ class AdHocAPIConference {
|
|
|
5652
5673
|
participants,
|
|
5653
5674
|
started,
|
|
5654
5675
|
finished,
|
|
5655
|
-
|
|
5676
|
+
answerTime,
|
|
5656
5677
|
conferenceId,
|
|
5657
5678
|
muted,
|
|
5658
5679
|
paused,
|
|
@@ -5662,16 +5683,20 @@ class AdHocAPIConference {
|
|
|
5662
5683
|
this.participants = participants || {};
|
|
5663
5684
|
this.started = started || false;
|
|
5664
5685
|
this.finished = finished || false;
|
|
5665
|
-
this.
|
|
5686
|
+
this.answerTime = answerTime;
|
|
5666
5687
|
this.conferenceId = conferenceId || '';
|
|
5667
5688
|
this.muted = muted || false;
|
|
5668
5689
|
this.paused = paused || false;
|
|
5690
|
+
|
|
5691
|
+
if (this.host) {
|
|
5692
|
+
this.host.setIsConference(true);
|
|
5693
|
+
}
|
|
5669
5694
|
}
|
|
5670
5695
|
|
|
5671
5696
|
async start() {
|
|
5672
5697
|
this.started = true;
|
|
5673
5698
|
// $FlowFixMe
|
|
5674
|
-
this.
|
|
5699
|
+
this.answerTime = Object.values(this.participants).length ? Object.values(this.participants)[0].answerTime : null;
|
|
5675
5700
|
|
|
5676
5701
|
const participantIds = Object.keys(this.participants);
|
|
5677
5702
|
const conference = await getApiClient().calld.createAdHocConference(this.host.callId, participantIds);
|
|
@@ -9375,7 +9400,11 @@ class WebRTCPhone extends Emitter {
|
|
|
9375
9400
|
accept(callSession , cameraEnabled ) {
|
|
9376
9401
|
logger$8.info('WebRTC phone - accept call', { id: callSession ? callSession.getId() : 'n/a', cameraEnabled });
|
|
9377
9402
|
if (this.currentSipSession) {
|
|
9378
|
-
this.holdSipSession(
|
|
9403
|
+
this.holdSipSession(
|
|
9404
|
+
this.currentSipSession,
|
|
9405
|
+
this.currentCallSession,
|
|
9406
|
+
true,
|
|
9407
|
+
);
|
|
9379
9408
|
}
|
|
9380
9409
|
|
|
9381
9410
|
if (!callSession) {
|
|
@@ -9468,22 +9497,22 @@ class WebRTCPhone extends Emitter {
|
|
|
9468
9497
|
}
|
|
9469
9498
|
}
|
|
9470
9499
|
|
|
9471
|
-
hold(callSession , withEvent = true
|
|
9500
|
+
hold(callSession , withEvent = true) {
|
|
9472
9501
|
logger$8.info('WebRTC hold', { id: callSession.getId() });
|
|
9473
9502
|
|
|
9474
9503
|
const sipSession = this.findSipSession(callSession);
|
|
9475
9504
|
|
|
9476
|
-
return sipSession ? this.holdSipSession(sipSession, callSession, withEvent
|
|
9505
|
+
return sipSession ? this.holdSipSession(sipSession, callSession, withEvent) : null;
|
|
9477
9506
|
}
|
|
9478
9507
|
|
|
9479
9508
|
// @Deprecated
|
|
9480
|
-
unhold(callSession , withEvent = true
|
|
9509
|
+
unhold(callSession , withEvent = true) {
|
|
9481
9510
|
console.warn('Please note that `phone.unhold()` is being deprecated; `phone.resume()` is the preferred method');
|
|
9482
9511
|
|
|
9483
|
-
return this.resume(callSession,
|
|
9512
|
+
return this.resume(callSession, withEvent);
|
|
9484
9513
|
}
|
|
9485
9514
|
|
|
9486
|
-
resume(callSession ,
|
|
9515
|
+
resume(callSession , withEvent = true) {
|
|
9487
9516
|
logger$8.info('WebRTC resume called', { id: callSession ? callSession.getId() : null });
|
|
9488
9517
|
|
|
9489
9518
|
const sipSession = this.findSipSession(callSession);
|
|
@@ -9496,10 +9525,14 @@ class WebRTCPhone extends Emitter {
|
|
|
9496
9525
|
// Hold current session if different from the current one (we don't want 2 sessions active at the same time).
|
|
9497
9526
|
if (this.currentSipSession && this.currentSipSession.id !== sipSession.id) {
|
|
9498
9527
|
logger$8.info('WebRTC hold call after resume', { id: this.currentSipSession.id });
|
|
9499
|
-
this.holdSipSession(
|
|
9528
|
+
this.holdSipSession(
|
|
9529
|
+
this.currentSipSession,
|
|
9530
|
+
this.currentCallSession,
|
|
9531
|
+
withEvent,
|
|
9532
|
+
);
|
|
9500
9533
|
}
|
|
9501
9534
|
|
|
9502
|
-
const promise = this.unholdSipSession(sipSession, callSession, withEvent
|
|
9535
|
+
const promise = this.unholdSipSession(sipSession, callSession, withEvent);
|
|
9503
9536
|
this.currentSipSession = sipSession;
|
|
9504
9537
|
if (callSession) {
|
|
9505
9538
|
this.currentCallSession = callSession;
|
|
@@ -9512,7 +9545,6 @@ class WebRTCPhone extends Emitter {
|
|
|
9512
9545
|
sipSession ,
|
|
9513
9546
|
callSession ,
|
|
9514
9547
|
withEvent = true,
|
|
9515
|
-
isConference = false,
|
|
9516
9548
|
) {
|
|
9517
9549
|
if (!sipSession) {
|
|
9518
9550
|
return new Promise((resolve, reject) => reject(new Error('No session to hold')));
|
|
@@ -9533,6 +9565,8 @@ class WebRTCPhone extends Emitter {
|
|
|
9533
9565
|
await this.client.downgradeToAudio(sipSession);
|
|
9534
9566
|
}
|
|
9535
9567
|
|
|
9568
|
+
const isConference = !!callSession && callSession.isConference();
|
|
9569
|
+
|
|
9536
9570
|
const promise = this.client.hold(sipSession, isConference, hasVideo);
|
|
9537
9571
|
if (withEvent) {
|
|
9538
9572
|
this.eventEmitter.emit(ON_CALL_HELD, this._createCallSession(sipSession, callSession));
|
|
@@ -9545,11 +9579,13 @@ class WebRTCPhone extends Emitter {
|
|
|
9545
9579
|
sipSession ,
|
|
9546
9580
|
callSession ,
|
|
9547
9581
|
withEvent = true,
|
|
9548
|
-
isConference = false,
|
|
9549
9582
|
) {
|
|
9550
9583
|
if (!sipSession) {
|
|
9551
9584
|
return new Promise((resolve, reject) => reject(new Error('No session to unhold')));
|
|
9552
9585
|
}
|
|
9586
|
+
|
|
9587
|
+
const isConference = !!callSession && callSession.isConference();
|
|
9588
|
+
|
|
9553
9589
|
const sessionId = this.getSipSessionId(sipSession);
|
|
9554
9590
|
logger$8.info('WebRTC unhold sip session', { sessionId, isConference });
|
|
9555
9591
|
|
|
@@ -9691,7 +9727,11 @@ class WebRTCPhone extends Emitter {
|
|
|
9691
9727
|
await this.client.register();
|
|
9692
9728
|
}
|
|
9693
9729
|
if (this.currentSipSession) {
|
|
9694
|
-
this.holdSipSession(
|
|
9730
|
+
this.holdSipSession(
|
|
9731
|
+
this.currentSipSession,
|
|
9732
|
+
this.currentCallSession,
|
|
9733
|
+
true,
|
|
9734
|
+
).catch(e => {
|
|
9695
9735
|
logger$8.warn('Unable to hold current session when making another call', e);
|
|
9696
9736
|
});
|
|
9697
9737
|
}
|
|
@@ -9706,6 +9746,7 @@ class WebRTCPhone extends Emitter {
|
|
|
9706
9746
|
return Promise.resolve(null);
|
|
9707
9747
|
}
|
|
9708
9748
|
const callSession = this._createOutgoingCallSession(sipSession, cameraEnabled || false);
|
|
9749
|
+
callSession.setIsConference(conference);
|
|
9709
9750
|
callSession.creationTime = new Date();
|
|
9710
9751
|
this._updateCallSession(callSession);
|
|
9711
9752
|
|
|
@@ -10284,6 +10325,7 @@ class WebRTCPhone extends Emitter {
|
|
|
10284
10325
|
recording: fromSession ? fromSession.isRecording() : false,
|
|
10285
10326
|
recordingPaused: false, // @TODO
|
|
10286
10327
|
sipSession,
|
|
10328
|
+
conference: !!fromSession && fromSession.isConference(),
|
|
10287
10329
|
...extra,
|
|
10288
10330
|
});
|
|
10289
10331
|
|
|
@@ -10540,16 +10582,16 @@ class Phone extends Emitter {
|
|
|
10540
10582
|
}
|
|
10541
10583
|
}
|
|
10542
10584
|
|
|
10543
|
-
hold(callSession
|
|
10544
|
-
return this.phone && this.phone.hold(callSession, true
|
|
10585
|
+
hold(callSession ) {
|
|
10586
|
+
return this.phone && this.phone.hold(callSession, true);
|
|
10545
10587
|
}
|
|
10546
10588
|
|
|
10547
|
-
unhold(callSession
|
|
10548
|
-
return this.phone && this.phone.unhold(callSession, true
|
|
10589
|
+
unhold(callSession ) {
|
|
10590
|
+
return this.phone && this.phone.unhold(callSession, true);
|
|
10549
10591
|
}
|
|
10550
10592
|
|
|
10551
|
-
resume(callSession
|
|
10552
|
-
return this.phone && this.phone.resume(callSession
|
|
10593
|
+
resume(callSession ) {
|
|
10594
|
+
return this.phone && this.phone.resume(callSession);
|
|
10553
10595
|
}
|
|
10554
10596
|
|
|
10555
10597
|
reject(callSession ) {
|
|
@@ -12931,7 +12973,7 @@ class Room {
|
|
|
12931
12973
|
|
|
12932
12974
|
|
|
12933
12975
|
|
|
12934
|
-
|
|
12976
|
+
|
|
12935
12977
|
|
|
12936
12978
|
|
|
12937
12979
|
|
|
@@ -12957,7 +12999,7 @@ class SwitchboardCall {
|
|
|
12957
12999
|
|
|
12958
13000
|
|
|
12959
13001
|
|
|
12960
|
-
|
|
13002
|
+
|
|
12961
13003
|
|
|
12962
13004
|
|
|
12963
13005
|
|
|
@@ -12971,7 +13013,7 @@ class SwitchboardCall {
|
|
|
12971
13013
|
callerIdName: plain.caller_id_name || null,
|
|
12972
13014
|
callerIdNumber: plain.caller_id_number || null,
|
|
12973
13015
|
participantId: plain.participantId || null,
|
|
12974
|
-
|
|
13016
|
+
answerTime: plain.startTime,
|
|
12975
13017
|
state: plain.state,
|
|
12976
13018
|
switchboardName: plain.switchboardName,
|
|
12977
13019
|
switchboardUuid: plain.switchboardUuid,
|
|
@@ -12984,7 +13026,7 @@ class SwitchboardCall {
|
|
|
12984
13026
|
callerIdName,
|
|
12985
13027
|
callerIdNumber,
|
|
12986
13028
|
participantId,
|
|
12987
|
-
|
|
13029
|
+
answerTime,
|
|
12988
13030
|
state,
|
|
12989
13031
|
switchboardName,
|
|
12990
13032
|
switchboardUuid,
|
|
@@ -12994,7 +13036,7 @@ class SwitchboardCall {
|
|
|
12994
13036
|
this.callerIdName = callerIdName;
|
|
12995
13037
|
this.callerIdNumber = callerIdNumber;
|
|
12996
13038
|
this.participantId = participantId;
|
|
12997
|
-
this.
|
|
13039
|
+
this.answerTime = answerTime;
|
|
12998
13040
|
this.state = state;
|
|
12999
13041
|
this.switchboardName = switchboardName;
|
|
13000
13042
|
this.switchboardUuid = switchboardUuid;
|
|
@@ -13631,6 +13673,7 @@ const Wazo = {
|
|
|
13631
13673
|
InvalidAuthorization,
|
|
13632
13674
|
CanceledCallError,
|
|
13633
13675
|
SFUNotAvailableError,
|
|
13676
|
+
NoTenantIdError,
|
|
13634
13677
|
};
|
|
13635
13678
|
|
|
13636
13679
|
if (window) {
|
|
@@ -13644,6 +13687,7 @@ if (global) {
|
|
|
13644
13687
|
|
|
13645
13688
|
class InvalidSubscription extends Error {}
|
|
13646
13689
|
class InvalidAuthorization extends Error {}
|
|
13690
|
+
class NoTenantIdError extends Error {}
|
|
13647
13691
|
|
|
13648
13692
|
const logger = IssueReporter$1.loggerFor('simple-auth');
|
|
13649
13693
|
|
|
@@ -13657,11 +13701,15 @@ class Auth {
|
|
|
13657
13701
|
|
|
13658
13702
|
|
|
13659
13703
|
|
|
13704
|
+
|
|
13705
|
+
|
|
13660
13706
|
|
|
13661
13707
|
constructor() {
|
|
13662
13708
|
this.expiration = DETAULT_EXPIRATION;
|
|
13663
13709
|
this.authenticated = false;
|
|
13664
13710
|
this.minSubscriptionType = null;
|
|
13711
|
+
this.BACKEND_WAZO = DEFAULT_BACKEND_USER;
|
|
13712
|
+
this.BACKEND_LDAP = BACKEND_LDAP_USER;
|
|
13665
13713
|
}
|
|
13666
13714
|
|
|
13667
13715
|
init(clientId ,
|
|
@@ -13694,12 +13742,18 @@ class Auth {
|
|
|
13694
13742
|
setFetchOptions(options);
|
|
13695
13743
|
}
|
|
13696
13744
|
|
|
13697
|
-
async logIn(username , password ) {
|
|
13745
|
+
async logIn(username , password , backend , tenantId ) {
|
|
13746
|
+
if (backend && backend !== this.BACKEND_WAZO && !tenantId) {
|
|
13747
|
+
throw new NoTenantIdError('No tenant id');
|
|
13748
|
+
}
|
|
13749
|
+
|
|
13698
13750
|
this.authenticated = false;
|
|
13699
13751
|
this.session = null;
|
|
13700
13752
|
const rawSession = await getApiClient().auth.logIn({
|
|
13701
13753
|
username,
|
|
13702
13754
|
password,
|
|
13755
|
+
backend,
|
|
13756
|
+
tenantId,
|
|
13703
13757
|
expiration: this.expiration,
|
|
13704
13758
|
mobile: this.mobile,
|
|
13705
13759
|
});
|
package/lib/simple/Directory.js
CHANGED
|
@@ -1058,6 +1058,7 @@ const LINE_STATE = {
|
|
|
1058
1058
|
|
|
1059
1059
|
|
|
1060
1060
|
|
|
1061
|
+
|
|
1061
1062
|
|
|
1062
1063
|
|
|
1063
1064
|
|
|
@@ -1094,6 +1095,7 @@ const LINE_STATE = {
|
|
|
1094
1095
|
|
|
1095
1096
|
|
|
1096
1097
|
|
|
1098
|
+
|
|
1097
1099
|
|
|
1098
1100
|
|
|
1099
1101
|
|
|
@@ -1125,6 +1127,7 @@ class Profile {
|
|
|
1125
1127
|
|
|
1126
1128
|
|
|
1127
1129
|
|
|
1130
|
+
|
|
1128
1131
|
|
|
1129
1132
|
|
|
1130
1133
|
|
|
@@ -1141,6 +1144,7 @@ class Profile {
|
|
|
1141
1144
|
lines: plain.lines.map(line => Line.parse(line)),
|
|
1142
1145
|
username: plain.username,
|
|
1143
1146
|
mobileNumber: plain.mobile_phone_number || '',
|
|
1147
|
+
ringSeconds: plain.ring_seconds,
|
|
1144
1148
|
forwards: [
|
|
1145
1149
|
ForwardOption.parse(plain.forwards.unconditional, FORWARD_KEYS.UNCONDITIONAL),
|
|
1146
1150
|
ForwardOption.parse(plain.forwards.noanswer, FORWARD_KEYS.NO_ANSWER),
|
|
@@ -1177,6 +1181,7 @@ class Profile {
|
|
|
1177
1181
|
switchboards,
|
|
1178
1182
|
agent,
|
|
1179
1183
|
status,
|
|
1184
|
+
ringSeconds,
|
|
1180
1185
|
sipLines,
|
|
1181
1186
|
callPickupTargetUsers,
|
|
1182
1187
|
onlineCallRecordEnabled,
|
|
@@ -1198,6 +1203,7 @@ class Profile {
|
|
|
1198
1203
|
this.status = status;
|
|
1199
1204
|
this.callPickupTargetUsers = callPickupTargetUsers;
|
|
1200
1205
|
this.onlineCallRecordEnabled = onlineCallRecordEnabled;
|
|
1206
|
+
this.ringSeconds = ringSeconds;
|
|
1201
1207
|
|
|
1202
1208
|
this.sipLines = sipLines || [];
|
|
1203
1209
|
}
|
|
@@ -3301,7 +3307,7 @@ class Recording {
|
|
|
3301
3307
|
|
|
3302
3308
|
|
|
3303
3309
|
|
|
3304
|
-
|
|
3310
|
+
|
|
3305
3311
|
|
|
3306
3312
|
|
|
3307
3313
|
|