@wazo/sdk 0.37.34 → 0.37.37

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.
Files changed (99) hide show
  1. package/README.md +8 -2
  2. package/dist/wazo-sdk.js +2 -2
  3. package/esm/__tests__/api-client.test.js +17 -0
  4. package/esm/__tests__/web-rtc-client.test.js +17 -0
  5. package/esm/api/auth.js +7 -1
  6. package/esm/api/call-logd.js +6 -0
  7. package/esm/api/chatd.js +6 -0
  8. package/esm/api/confd.js +6 -0
  9. package/esm/api-client.js +17 -0
  10. package/esm/checker/Checker.js +17 -0
  11. package/esm/checker/checks/aor.js +17 -0
  12. package/esm/checker/checks/api.js +17 -0
  13. package/esm/checker/checks/index.js +17 -0
  14. package/esm/checker/checks/webrtc-transport.js +17 -0
  15. package/esm/checker/checks/webrtc.js +17 -0
  16. package/esm/domain/AdHocAPIConference.js +21 -0
  17. package/esm/domain/CallLog.js +6 -0
  18. package/esm/domain/CallSession.js +14 -0
  19. package/esm/domain/Features.js +17 -0
  20. package/esm/domain/Phone/CTIPhone.js +31 -0
  21. package/esm/domain/Phone/WebRTCPhone.js +42 -11
  22. package/esm/domain/Profile.js +6 -0
  23. package/esm/domain/__tests__/CallLog.test.js +10 -0
  24. package/esm/domain/__tests__/CallSession.test.js +14 -0
  25. package/esm/domain/__tests__/IndirectTransfer.test.js +14 -0
  26. package/esm/domain/__tests__/Profile.test.js +6 -0
  27. package/esm/domain/__tests__/Room.test.js +14 -0
  28. package/esm/domain/__tests__/Session.test.js +6 -0
  29. package/esm/index.js +83 -18
  30. package/esm/service/CallApi.js +17 -0
  31. package/esm/service/getApiClient.js +17 -0
  32. package/esm/simple/Auth.js +84 -19
  33. package/esm/simple/Configuration.js +83 -18
  34. package/esm/simple/Directory.js +17 -0
  35. package/esm/simple/Phone.js +83 -18
  36. package/esm/simple/index.js +83 -18
  37. package/esm/simple/room/LocalParticipant.js +83 -18
  38. package/esm/simple/room/Participant.js +83 -18
  39. package/esm/simple/room/RemoteParticipant.js +83 -18
  40. package/esm/simple/room/Room.js +83 -18
  41. package/esm/simple/room/SipRoom.js +83 -18
  42. package/esm/simple/room/Stream.js +83 -18
  43. package/esm/simple/room/__tests__/RemoteParticipant.test.js +83 -18
  44. package/esm/simple/utils.js +83 -18
  45. package/esm/web-rtc-client.js +17 -0
  46. package/lib/__tests__/api-client.test.js +17 -0
  47. package/lib/__tests__/web-rtc-client.test.js +17 -0
  48. package/lib/api/auth.js +8 -0
  49. package/lib/api/call-logd.js +6 -0
  50. package/lib/api/chatd.js +6 -0
  51. package/lib/api/confd.js +6 -0
  52. package/lib/api-client.js +17 -0
  53. package/lib/checker/Checker.js +17 -0
  54. package/lib/checker/checks/aor.js +17 -0
  55. package/lib/checker/checks/api.js +17 -0
  56. package/lib/checker/checks/index.js +17 -0
  57. package/lib/checker/checks/webrtc-transport.js +17 -0
  58. package/lib/checker/checks/webrtc.js +17 -0
  59. package/lib/domain/AdHocAPIConference.js +21 -0
  60. package/lib/domain/CallLog.js +6 -0
  61. package/lib/domain/CallSession.js +14 -0
  62. package/lib/domain/Features.js +17 -0
  63. package/lib/domain/Phone/CTIPhone.js +31 -0
  64. package/lib/domain/Phone/WebRTCPhone.js +42 -11
  65. package/lib/domain/Profile.js +6 -0
  66. package/lib/domain/__tests__/CallLog.test.js +10 -0
  67. package/lib/domain/__tests__/CallSession.test.js +14 -0
  68. package/lib/domain/__tests__/IndirectTransfer.test.js +14 -0
  69. package/lib/domain/__tests__/Profile.test.js +6 -0
  70. package/lib/domain/__tests__/Room.test.js +14 -0
  71. package/lib/domain/__tests__/Session.test.js +6 -0
  72. package/lib/index.js +83 -18
  73. package/lib/service/CallApi.js +17 -0
  74. package/lib/service/getApiClient.js +17 -0
  75. package/lib/simple/Auth.js +84 -18
  76. package/lib/simple/Configuration.js +83 -18
  77. package/lib/simple/Directory.js +17 -0
  78. package/lib/simple/Phone.js +83 -18
  79. package/lib/simple/index.js +83 -18
  80. package/lib/simple/room/LocalParticipant.js +83 -18
  81. package/lib/simple/room/Participant.js +83 -18
  82. package/lib/simple/room/RemoteParticipant.js +83 -18
  83. package/lib/simple/room/Room.js +83 -18
  84. package/lib/simple/room/SipRoom.js +83 -18
  85. package/lib/simple/room/Stream.js +83 -18
  86. package/lib/simple/room/__tests__/RemoteParticipant.test.js +83 -18
  87. package/lib/simple/utils.js +83 -18
  88. package/lib/web-rtc-client.js +17 -0
  89. package/package.json +1 -1
  90. package/src/api/auth.js +7 -1
  91. package/src/domain/AdHocAPIConference.js +4 -0
  92. package/src/domain/CallLog.js +6 -0
  93. package/src/domain/CallSession.js +14 -0
  94. package/src/domain/Phone/WebRTCPhone.js +28 -11
  95. package/src/domain/Profile.js +6 -0
  96. package/src/domain/__tests__/CallLog.test.js +4 -0
  97. package/src/simple/Auth.js +13 -2
  98. package/src/simple/Phone.js +6 -6
  99. package/src/simple/index.js +2 -1
@@ -384,6 +384,7 @@ const LINE_STATE = {
384
384
 
385
385
 
386
386
 
387
+
387
388
 
388
389
 
389
390
 
@@ -420,6 +421,7 @@ const LINE_STATE = {
420
421
 
421
422
 
422
423
 
424
+
423
425
 
424
426
 
425
427
 
@@ -451,6 +453,7 @@ class Profile {
451
453
 
452
454
 
453
455
 
456
+
454
457
 
455
458
 
456
459
 
@@ -467,6 +470,7 @@ class Profile {
467
470
  lines: plain.lines.map(line => Line.parse(line)),
468
471
  username: plain.username,
469
472
  mobileNumber: plain.mobile_phone_number || '',
473
+ ringSeconds: plain.ring_seconds,
470
474
  forwards: [
471
475
  ForwardOption.parse(plain.forwards.unconditional, FORWARD_KEYS.UNCONDITIONAL),
472
476
  ForwardOption.parse(plain.forwards.noanswer, FORWARD_KEYS.NO_ANSWER),
@@ -503,6 +507,7 @@ class Profile {
503
507
  switchboards,
504
508
  agent,
505
509
  status,
510
+ ringSeconds,
506
511
  sipLines,
507
512
  callPickupTargetUsers,
508
513
  onlineCallRecordEnabled,
@@ -524,6 +529,7 @@ class Profile {
524
529
  this.status = status;
525
530
  this.callPickupTargetUsers = callPickupTargetUsers;
526
531
  this.onlineCallRecordEnabled = onlineCallRecordEnabled;
532
+ this.ringSeconds = ringSeconds;
527
533
 
528
534
  this.sipLines = sipLines || [];
529
535
  }
@@ -2202,6 +2208,7 @@ class ApiRequester {
2202
2208
  /* */
2203
2209
 
2204
2210
  const DEFAULT_BACKEND_USER = 'wazo_user';
2211
+ const BACKEND_LDAP_USER = 'ldap_user';
2205
2212
  const DETAULT_EXPIRATION = 3600;
2206
2213
 
2207
2214
  var authMethods = (client , baseUrl ) => ({
@@ -2216,6 +2223,7 @@ var authMethods = (client , baseUrl ) => ({
2216
2223
 
2217
2224
 
2218
2225
 
2226
+
2219
2227
  ) {
2220
2228
  const body = {
2221
2229
  backend: params.backend || DEFAULT_BACKEND_USER,
@@ -2235,6 +2243,10 @@ var authMethods = (client , baseUrl ) => ({
2235
2243
  headers['Wazo-Session-Type'] = 'mobile';
2236
2244
  }
2237
2245
 
2246
+ if (params.tenantId) {
2247
+ body.tenant_id = params.tenantId;
2248
+ }
2249
+
2238
2250
  return client.post(`${baseUrl}/token`, body, headers).then(response => Session.parse(response));
2239
2251
  },
2240
2252
 
@@ -3275,6 +3287,7 @@ var updateFrom = (instance , from ) => {
3275
3287
 
3276
3288
 
3277
3289
 
3290
+
3278
3291
 
3279
3292
 
3280
3293
  class CallSession {
@@ -3337,6 +3350,8 @@ class CallSession {
3337
3350
 
3338
3351
 
3339
3352
 
3353
+
3354
+
3340
3355
 
3341
3356
 
3342
3357
 
@@ -3368,6 +3383,7 @@ class CallSession {
3368
3383
  videoRemotelyDowngraded,
3369
3384
  sipSession,
3370
3385
  answerTime,
3386
+ conference,
3371
3387
  } ) {
3372
3388
  this.callId = callId;
3373
3389
  this.sipCallId = sipCallId;
@@ -3396,6 +3412,7 @@ class CallSession {
3396
3412
  this.videoRemotelyDowngraded = videoRemotelyDowngraded;
3397
3413
  this.sipSession = sipSession;
3398
3414
  this.answerTime = answerTime || this.answerTime;
3415
+ this.conference = conference;
3399
3416
 
3400
3417
  // Useful to compare instead of instanceof with minified code
3401
3418
  this.type = 'CallSession';
@@ -3453,6 +3470,10 @@ class CallSession {
3453
3470
  this.screensharing = false;
3454
3471
  }
3455
3472
 
3473
+ setIsConference(conference ) {
3474
+ this.conference = conference;
3475
+ }
3476
+
3456
3477
  isIncoming() {
3457
3478
  return !this.isCaller && !this.answered;
3458
3479
  }
@@ -3529,6 +3550,10 @@ class CallSession {
3529
3550
  return this.sipStatus === SessionState.Terminated;
3530
3551
  }
3531
3552
 
3553
+ isConference() {
3554
+ return this.conference;
3555
+ }
3556
+
3532
3557
  getElapsedTimeInSeconds() {
3533
3558
  if (!this.startTime) {
3534
3559
  return 0;
@@ -3620,6 +3645,7 @@ class CallSession {
3620
3645
  cameraEnabled: false,
3621
3646
  dialedExtension: call.dialedExtension,
3622
3647
  call,
3648
+ conference: false, // @FIXME?
3623
3649
  });
3624
3650
  }
3625
3651
  }
@@ -3709,11 +3735,13 @@ class Recording {
3709
3735
 
3710
3736
 
3711
3737
 
3738
+
3712
3739
 
3713
3740
 
3714
3741
 
3715
3742
 
3716
3743
 
3744
+
3717
3745
 
3718
3746
 
3719
3747
 
@@ -3734,10 +3762,12 @@ class Recording {
3734
3762
 
3735
3763
 
3736
3764
 
3765
+
3737
3766
 
3738
3767
 
3739
3768
 
3740
3769
 
3770
+
3741
3771
 
3742
3772
 
3743
3773
 
@@ -3799,10 +3829,12 @@ class CallLog {
3799
3829
  || plain.destination_extension
3800
3830
  || `meeting-${plain.requested_name || plain.destination_name || ''}`,
3801
3831
  name: plain.requested_name || plain.destination_name || '',
3832
+ uuid: plain.destination_user_uuid,
3802
3833
  },
3803
3834
  source: {
3804
3835
  extension: plain.source_extension,
3805
3836
  name: plain.source_name,
3837
+ uuid: plain.source_user_uuid,
3806
3838
  },
3807
3839
  id: plain.id,
3808
3840
  duration: (plain.duration || 0) * 1000, // duration is in seconds
@@ -5578,6 +5610,7 @@ var getApiClient = (forServer ) => {
5578
5610
 
5579
5611
  class InvalidSubscription extends Error {}
5580
5612
  class InvalidAuthorization extends Error {}
5613
+ class NoTenantIdError extends Error {}
5581
5614
 
5582
5615
  const logger$9 = IssueReporter$1.loggerFor('simple-auth');
5583
5616
 
@@ -5591,11 +5624,15 @@ class Auth {
5591
5624
 
5592
5625
 
5593
5626
 
5627
+
5628
+
5594
5629
 
5595
5630
  constructor() {
5596
5631
  this.expiration = DETAULT_EXPIRATION;
5597
5632
  this.authenticated = false;
5598
5633
  this.minSubscriptionType = null;
5634
+ this.BACKEND_WAZO = DEFAULT_BACKEND_USER;
5635
+ this.BACKEND_LDAP = BACKEND_LDAP_USER;
5599
5636
  }
5600
5637
 
5601
5638
  init(clientId ,
@@ -5628,12 +5665,18 @@ class Auth {
5628
5665
  setFetchOptions(options);
5629
5666
  }
5630
5667
 
5631
- async logIn(username , password ) {
5668
+ async logIn(username , password , backend , tenantId ) {
5669
+ if (backend && backend !== this.BACKEND_WAZO && !tenantId) {
5670
+ throw new NoTenantIdError('No tenant id');
5671
+ }
5672
+
5632
5673
  this.authenticated = false;
5633
5674
  this.session = null;
5634
5675
  const rawSession = await getApiClient().auth.logIn({
5635
5676
  username,
5636
5677
  password,
5678
+ backend,
5679
+ tenantId,
5637
5680
  expiration: this.expiration,
5638
5681
  mobile: this.mobile,
5639
5682
  });
@@ -5909,6 +5952,10 @@ class AdHocAPIConference {
5909
5952
  this.conferenceId = conferenceId || '';
5910
5953
  this.muted = muted || false;
5911
5954
  this.paused = paused || false;
5955
+
5956
+ if (this.host) {
5957
+ this.host.setIsConference(true);
5958
+ }
5912
5959
  }
5913
5960
 
5914
5961
  async start() {
@@ -9618,7 +9665,11 @@ class WebRTCPhone extends Emitter {
9618
9665
  accept(callSession , cameraEnabled ) {
9619
9666
  logger$7.info('WebRTC phone - accept call', { id: callSession ? callSession.getId() : 'n/a', cameraEnabled });
9620
9667
  if (this.currentSipSession) {
9621
- this.holdSipSession(this.currentSipSession, this.currentCallSession, true);
9668
+ this.holdSipSession(
9669
+ this.currentSipSession,
9670
+ this.currentCallSession,
9671
+ true,
9672
+ );
9622
9673
  }
9623
9674
 
9624
9675
  if (!callSession) {
@@ -9711,22 +9762,22 @@ class WebRTCPhone extends Emitter {
9711
9762
  }
9712
9763
  }
9713
9764
 
9714
- hold(callSession , withEvent = true, isConference = false) {
9765
+ hold(callSession , withEvent = true) {
9715
9766
  logger$7.info('WebRTC hold', { id: callSession.getId() });
9716
9767
 
9717
9768
  const sipSession = this.findSipSession(callSession);
9718
9769
 
9719
- return sipSession ? this.holdSipSession(sipSession, callSession, withEvent, isConference) : null;
9770
+ return sipSession ? this.holdSipSession(sipSession, callSession, withEvent) : null;
9720
9771
  }
9721
9772
 
9722
9773
  // @Deprecated
9723
- unhold(callSession , withEvent = true, isConference = false) {
9774
+ unhold(callSession , withEvent = true) {
9724
9775
  console.warn('Please note that `phone.unhold()` is being deprecated; `phone.resume()` is the preferred method');
9725
9776
 
9726
- return this.resume(callSession, isConference, withEvent);
9777
+ return this.resume(callSession, withEvent);
9727
9778
  }
9728
9779
 
9729
- resume(callSession , isConference = false, withEvent = true) {
9780
+ resume(callSession , withEvent = true) {
9730
9781
  logger$7.info('WebRTC resume called', { id: callSession ? callSession.getId() : null });
9731
9782
 
9732
9783
  const sipSession = this.findSipSession(callSession);
@@ -9739,10 +9790,14 @@ class WebRTCPhone extends Emitter {
9739
9790
  // Hold current session if different from the current one (we don't want 2 sessions active at the same time).
9740
9791
  if (this.currentSipSession && this.currentSipSession.id !== sipSession.id) {
9741
9792
  logger$7.info('WebRTC hold call after resume', { id: this.currentSipSession.id });
9742
- this.holdSipSession(this.currentSipSession, this.currentCallSession);
9793
+ this.holdSipSession(
9794
+ this.currentSipSession,
9795
+ this.currentCallSession,
9796
+ withEvent,
9797
+ );
9743
9798
  }
9744
9799
 
9745
- const promise = this.unholdSipSession(sipSession, callSession, withEvent, isConference);
9800
+ const promise = this.unholdSipSession(sipSession, callSession, withEvent);
9746
9801
  this.currentSipSession = sipSession;
9747
9802
  if (callSession) {
9748
9803
  this.currentCallSession = callSession;
@@ -9755,7 +9810,6 @@ class WebRTCPhone extends Emitter {
9755
9810
  sipSession ,
9756
9811
  callSession ,
9757
9812
  withEvent = true,
9758
- isConference = false,
9759
9813
  ) {
9760
9814
  if (!sipSession) {
9761
9815
  return new Promise((resolve, reject) => reject(new Error('No session to hold')));
@@ -9776,6 +9830,8 @@ class WebRTCPhone extends Emitter {
9776
9830
  await this.client.downgradeToAudio(sipSession);
9777
9831
  }
9778
9832
 
9833
+ const isConference = !!callSession && callSession.isConference();
9834
+
9779
9835
  const promise = this.client.hold(sipSession, isConference, hasVideo);
9780
9836
  if (withEvent) {
9781
9837
  this.eventEmitter.emit(ON_CALL_HELD, this._createCallSession(sipSession, callSession));
@@ -9788,11 +9844,13 @@ class WebRTCPhone extends Emitter {
9788
9844
  sipSession ,
9789
9845
  callSession ,
9790
9846
  withEvent = true,
9791
- isConference = false,
9792
9847
  ) {
9793
9848
  if (!sipSession) {
9794
9849
  return new Promise((resolve, reject) => reject(new Error('No session to unhold')));
9795
9850
  }
9851
+
9852
+ const isConference = !!callSession && callSession.isConference();
9853
+
9796
9854
  const sessionId = this.getSipSessionId(sipSession);
9797
9855
  logger$7.info('WebRTC unhold sip session', { sessionId, isConference });
9798
9856
 
@@ -9934,7 +9992,11 @@ class WebRTCPhone extends Emitter {
9934
9992
  await this.client.register();
9935
9993
  }
9936
9994
  if (this.currentSipSession) {
9937
- this.holdSipSession(this.currentSipSession, this.currentCallSession, true).catch(e => {
9995
+ this.holdSipSession(
9996
+ this.currentSipSession,
9997
+ this.currentCallSession,
9998
+ true,
9999
+ ).catch(e => {
9938
10000
  logger$7.warn('Unable to hold current session when making another call', e);
9939
10001
  });
9940
10002
  }
@@ -9949,6 +10011,7 @@ class WebRTCPhone extends Emitter {
9949
10011
  return Promise.resolve(null);
9950
10012
  }
9951
10013
  const callSession = this._createOutgoingCallSession(sipSession, cameraEnabled || false);
10014
+ callSession.setIsConference(conference);
9952
10015
  callSession.creationTime = new Date();
9953
10016
  this._updateCallSession(callSession);
9954
10017
 
@@ -10527,6 +10590,7 @@ class WebRTCPhone extends Emitter {
10527
10590
  recording: fromSession ? fromSession.isRecording() : false,
10528
10591
  recordingPaused: false, // @TODO
10529
10592
  sipSession,
10593
+ conference: !!fromSession && fromSession.isConference(),
10530
10594
  ...extra,
10531
10595
  });
10532
10596
 
@@ -10783,16 +10847,16 @@ class Phone extends Emitter {
10783
10847
  }
10784
10848
  }
10785
10849
 
10786
- hold(callSession , isConference = false) {
10787
- return this.phone && this.phone.hold(callSession, true, isConference);
10850
+ hold(callSession ) {
10851
+ return this.phone && this.phone.hold(callSession, true);
10788
10852
  }
10789
10853
 
10790
- unhold(callSession , isConference = false) {
10791
- return this.phone && this.phone.unhold(callSession, true, isConference);
10854
+ unhold(callSession ) {
10855
+ return this.phone && this.phone.unhold(callSession, true);
10792
10856
  }
10793
10857
 
10794
- resume(callSession , isConference = false) {
10795
- return this.phone && this.phone.resume(callSession, isConference);
10858
+ resume(callSession ) {
10859
+ return this.phone && this.phone.resume(callSession);
10796
10860
  }
10797
10861
 
10798
10862
  reject(callSession ) {
@@ -13875,6 +13939,7 @@ const Wazo = {
13875
13939
  InvalidAuthorization,
13876
13940
  CanceledCallError,
13877
13941
  SFUNotAvailableError,
13942
+ NoTenantIdError,
13878
13943
  };
13879
13944
 
13880
13945
  if (window) {
@@ -1600,6 +1600,7 @@ const LINE_STATE = {
1600
1600
 
1601
1601
 
1602
1602
 
1603
+
1603
1604
 
1604
1605
 
1605
1606
 
@@ -1636,6 +1637,7 @@ const LINE_STATE = {
1636
1637
 
1637
1638
 
1638
1639
 
1640
+
1639
1641
 
1640
1642
 
1641
1643
 
@@ -1667,6 +1669,7 @@ class Profile {
1667
1669
 
1668
1670
 
1669
1671
 
1672
+
1670
1673
 
1671
1674
 
1672
1675
 
@@ -1683,6 +1686,7 @@ class Profile {
1683
1686
  lines: plain.lines.map(line => Line.parse(line)),
1684
1687
  username: plain.username,
1685
1688
  mobileNumber: plain.mobile_phone_number || '',
1689
+ ringSeconds: plain.ring_seconds,
1686
1690
  forwards: [
1687
1691
  ForwardOption.parse(plain.forwards.unconditional, FORWARD_KEYS.UNCONDITIONAL),
1688
1692
  ForwardOption.parse(plain.forwards.noanswer, FORWARD_KEYS.NO_ANSWER),
@@ -1719,6 +1723,7 @@ class Profile {
1719
1723
  switchboards,
1720
1724
  agent,
1721
1725
  status,
1726
+ ringSeconds,
1722
1727
  sipLines,
1723
1728
  callPickupTargetUsers,
1724
1729
  onlineCallRecordEnabled,
@@ -1740,6 +1745,7 @@ class Profile {
1740
1745
  this.status = status;
1741
1746
  this.callPickupTargetUsers = callPickupTargetUsers;
1742
1747
  this.onlineCallRecordEnabled = onlineCallRecordEnabled;
1748
+ this.ringSeconds = ringSeconds;
1743
1749
 
1744
1750
  this.sipLines = sipLines || [];
1745
1751
  }
@@ -2745,6 +2751,7 @@ var authMethods = (client , baseUrl ) => ({
2745
2751
 
2746
2752
 
2747
2753
 
2754
+
2748
2755
  ) {
2749
2756
  const body = {
2750
2757
  backend: params.backend || DEFAULT_BACKEND_USER,
@@ -2764,6 +2771,10 @@ var authMethods = (client , baseUrl ) => ({
2764
2771
  headers['Wazo-Session-Type'] = 'mobile';
2765
2772
  }
2766
2773
 
2774
+ if (params.tenantId) {
2775
+ body.tenant_id = params.tenantId;
2776
+ }
2777
+
2767
2778
  return client.post(`${baseUrl}/token`, body, headers).then(response => Session.parse(response));
2768
2779
  },
2769
2780
 
@@ -3832,11 +3843,13 @@ class Recording {
3832
3843
 
3833
3844
 
3834
3845
 
3846
+
3835
3847
 
3836
3848
 
3837
3849
 
3838
3850
 
3839
3851
 
3852
+
3840
3853
 
3841
3854
 
3842
3855
 
@@ -3857,10 +3870,12 @@ class Recording {
3857
3870
 
3858
3871
 
3859
3872
 
3873
+
3860
3874
 
3861
3875
 
3862
3876
 
3863
3877
 
3878
+
3864
3879
 
3865
3880
 
3866
3881
 
@@ -3922,10 +3937,12 @@ class CallLog {
3922
3937
  || plain.destination_extension
3923
3938
  || `meeting-${plain.requested_name || plain.destination_name || ''}`,
3924
3939
  name: plain.requested_name || plain.destination_name || '',
3940
+ uuid: plain.destination_user_uuid,
3925
3941
  },
3926
3942
  source: {
3927
3943
  extension: plain.source_extension,
3928
3944
  name: plain.source_name,
3945
+ uuid: plain.source_user_uuid,
3929
3946
  },
3930
3947
  id: plain.id,
3931
3948
  duration: (plain.duration || 0) * 1000, // duration is in seconds
@@ -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
  }
@@ -2203,6 +2209,7 @@ var authMethods = (client , baseUrl ) => ({
2203
2209
 
2204
2210
 
2205
2211
 
2212
+
2206
2213
  ) {
2207
2214
  const body = {
2208
2215
  backend: params.backend || DEFAULT_BACKEND_USER,
@@ -2222,6 +2229,10 @@ var authMethods = (client , baseUrl ) => ({
2222
2229
  headers['Wazo-Session-Type'] = 'mobile';
2223
2230
  }
2224
2231
 
2232
+ if (params.tenantId) {
2233
+ body.tenant_id = params.tenantId;
2234
+ }
2235
+
2225
2236
  return client.post(`${baseUrl}/token`, body, headers).then(response => Session.parse(response));
2226
2237
  },
2227
2238
 
@@ -3290,11 +3301,13 @@ class Recording {
3290
3301
 
3291
3302
 
3292
3303
 
3304
+
3293
3305
 
3294
3306
 
3295
3307
 
3296
3308
 
3297
3309
 
3310
+
3298
3311
 
3299
3312
 
3300
3313
 
@@ -3315,10 +3328,12 @@ class Recording {
3315
3328
 
3316
3329
 
3317
3330
 
3331
+
3318
3332
 
3319
3333
 
3320
3334
 
3321
3335
 
3336
+
3322
3337
 
3323
3338
 
3324
3339
 
@@ -3380,10 +3395,12 @@ class CallLog {
3380
3395
  || plain.destination_extension
3381
3396
  || `meeting-${plain.requested_name || plain.destination_name || ''}`,
3382
3397
  name: plain.requested_name || plain.destination_name || '',
3398
+ uuid: plain.destination_user_uuid,
3383
3399
  },
3384
3400
  source: {
3385
3401
  extension: plain.source_extension,
3386
3402
  name: plain.source_name,
3403
+ uuid: plain.source_user_uuid,
3387
3404
  },
3388
3405
  id: plain.id,
3389
3406
  duration: (plain.duration || 0) * 1000, // duration is in seconds
@@ -1609,6 +1609,7 @@ const LINE_STATE = {
1609
1609
 
1610
1610
 
1611
1611
 
1612
+
1612
1613
 
1613
1614
 
1614
1615
 
@@ -1645,6 +1646,7 @@ const LINE_STATE = {
1645
1646
 
1646
1647
 
1647
1648
 
1649
+
1648
1650
 
1649
1651
 
1650
1652
 
@@ -1676,6 +1678,7 @@ class Profile {
1676
1678
 
1677
1679
 
1678
1680
 
1681
+
1679
1682
 
1680
1683
 
1681
1684
 
@@ -1692,6 +1695,7 @@ class Profile {
1692
1695
  lines: plain.lines.map(line => Line.parse(line)),
1693
1696
  username: plain.username,
1694
1697
  mobileNumber: plain.mobile_phone_number || '',
1698
+ ringSeconds: plain.ring_seconds,
1695
1699
  forwards: [
1696
1700
  ForwardOption.parse(plain.forwards.unconditional, FORWARD_KEYS.UNCONDITIONAL),
1697
1701
  ForwardOption.parse(plain.forwards.noanswer, FORWARD_KEYS.NO_ANSWER),
@@ -1728,6 +1732,7 @@ class Profile {
1728
1732
  switchboards,
1729
1733
  agent,
1730
1734
  status,
1735
+ ringSeconds,
1731
1736
  sipLines,
1732
1737
  callPickupTargetUsers,
1733
1738
  onlineCallRecordEnabled,
@@ -1749,6 +1754,7 @@ class Profile {
1749
1754
  this.status = status;
1750
1755
  this.callPickupTargetUsers = callPickupTargetUsers;
1751
1756
  this.onlineCallRecordEnabled = onlineCallRecordEnabled;
1757
+ this.ringSeconds = ringSeconds;
1752
1758
 
1753
1759
  this.sipLines = sipLines || [];
1754
1760
  }
@@ -2754,6 +2760,7 @@ var authMethods = (client , baseUrl ) => ({
2754
2760
 
2755
2761
 
2756
2762
 
2763
+
2757
2764
  ) {
2758
2765
  const body = {
2759
2766
  backend: params.backend || DEFAULT_BACKEND_USER,
@@ -2773,6 +2780,10 @@ var authMethods = (client , baseUrl ) => ({
2773
2780
  headers['Wazo-Session-Type'] = 'mobile';
2774
2781
  }
2775
2782
 
2783
+ if (params.tenantId) {
2784
+ body.tenant_id = params.tenantId;
2785
+ }
2786
+
2776
2787
  return client.post(`${baseUrl}/token`, body, headers).then(response => Session.parse(response));
2777
2788
  },
2778
2789
 
@@ -3841,11 +3852,13 @@ class Recording {
3841
3852
 
3842
3853
 
3843
3854
 
3855
+
3844
3856
 
3845
3857
 
3846
3858
 
3847
3859
 
3848
3860
 
3861
+
3849
3862
 
3850
3863
 
3851
3864
 
@@ -3866,10 +3879,12 @@ class Recording {
3866
3879
 
3867
3880
 
3868
3881
 
3882
+
3869
3883
 
3870
3884
 
3871
3885
 
3872
3886
 
3887
+
3873
3888
 
3874
3889
 
3875
3890
 
@@ -3931,10 +3946,12 @@ class CallLog {
3931
3946
  || plain.destination_extension
3932
3947
  || `meeting-${plain.requested_name || plain.destination_name || ''}`,
3933
3948
  name: plain.requested_name || plain.destination_name || '',
3949
+ uuid: plain.destination_user_uuid,
3934
3950
  },
3935
3951
  source: {
3936
3952
  extension: plain.source_extension,
3937
3953
  name: plain.source_name,
3954
+ uuid: plain.source_user_uuid,
3938
3955
  },
3939
3956
  id: plain.id,
3940
3957
  duration: (plain.duration || 0) * 1000, // duration is in seconds