@wazo/sdk 0.37.31 → 0.37.35

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 (90) hide show
  1. package/dist/wazo-sdk.js +2 -2
  2. package/esm/__tests__/api-client.test.js +41 -0
  3. package/esm/__tests__/web-rtc-client.test.js +68 -6
  4. package/esm/api/auth.js +5 -0
  5. package/esm/api/call-logd.js +6 -0
  6. package/esm/api/calld.js +30 -0
  7. package/esm/api-client.js +41 -0
  8. package/esm/checker/Checker.js +68 -6
  9. package/esm/checker/checks/aor.js +41 -0
  10. package/esm/checker/checks/api.js +41 -0
  11. package/esm/checker/checks/index.js +68 -6
  12. package/esm/checker/checks/webrtc-transport.js +68 -6
  13. package/esm/checker/checks/webrtc.js +68 -6
  14. package/esm/domain/AdHocAPIConference.js +41 -0
  15. package/esm/domain/CallLog.js +6 -0
  16. package/esm/domain/CallSession.js +8 -0
  17. package/esm/domain/Features.js +41 -0
  18. package/esm/domain/MeetingStatus.js +29 -0
  19. package/esm/domain/Phone/CTIPhone.js +49 -0
  20. package/esm/domain/Phone/WebRTCPhone.js +33 -6
  21. package/esm/domain/__tests__/CallLog.test.js +6 -0
  22. package/esm/domain/__tests__/CallSession.test.js +40 -4
  23. package/esm/domain/__tests__/IndirectTransfer.test.js +8 -0
  24. package/esm/domain/__tests__/Room.test.js +8 -0
  25. package/esm/index.js +101 -12
  26. package/esm/service/CallApi.js +41 -0
  27. package/esm/service/getApiClient.js +41 -0
  28. package/esm/simple/Auth.js +101 -12
  29. package/esm/simple/Configuration.js +101 -12
  30. package/esm/simple/Directory.js +41 -0
  31. package/esm/simple/Phone.js +101 -12
  32. package/esm/simple/index.js +101 -12
  33. package/esm/simple/room/LocalParticipant.js +101 -12
  34. package/esm/simple/room/Participant.js +101 -12
  35. package/esm/simple/room/RemoteParticipant.js +101 -12
  36. package/esm/simple/room/Room.js +101 -12
  37. package/esm/simple/room/SipRoom.js +101 -12
  38. package/esm/simple/room/Stream.js +101 -12
  39. package/esm/simple/room/__tests__/RemoteParticipant.test.js +101 -12
  40. package/esm/simple/utils.js +101 -12
  41. package/esm/web-rtc-client.js +68 -6
  42. package/lib/__tests__/api-client.test.js +41 -0
  43. package/lib/__tests__/web-rtc-client.test.js +68 -6
  44. package/lib/api/auth.js +5 -0
  45. package/lib/api/call-logd.js +6 -0
  46. package/lib/api/calld.js +30 -0
  47. package/lib/api-client.js +41 -0
  48. package/lib/checker/Checker.js +68 -6
  49. package/lib/checker/checks/aor.js +41 -0
  50. package/lib/checker/checks/api.js +41 -0
  51. package/lib/checker/checks/index.js +68 -6
  52. package/lib/checker/checks/webrtc-transport.js +68 -6
  53. package/lib/checker/checks/webrtc.js +68 -6
  54. package/lib/domain/AdHocAPIConference.js +41 -0
  55. package/lib/domain/CallLog.js +6 -0
  56. package/lib/domain/CallSession.js +8 -0
  57. package/lib/domain/Features.js +41 -0
  58. package/lib/domain/MeetingStatus.js +31 -0
  59. package/lib/domain/Phone/CTIPhone.js +49 -0
  60. package/lib/domain/Phone/WebRTCPhone.js +33 -6
  61. package/lib/domain/__tests__/CallLog.test.js +6 -0
  62. package/lib/domain/__tests__/CallSession.test.js +40 -4
  63. package/lib/domain/__tests__/IndirectTransfer.test.js +8 -0
  64. package/lib/domain/__tests__/Room.test.js +8 -0
  65. package/lib/index.js +101 -12
  66. package/lib/service/CallApi.js +41 -0
  67. package/lib/service/getApiClient.js +41 -0
  68. package/lib/simple/Auth.js +101 -12
  69. package/lib/simple/Configuration.js +101 -12
  70. package/lib/simple/Directory.js +41 -0
  71. package/lib/simple/Phone.js +101 -12
  72. package/lib/simple/index.js +101 -12
  73. package/lib/simple/room/LocalParticipant.js +101 -12
  74. package/lib/simple/room/Participant.js +101 -12
  75. package/lib/simple/room/RemoteParticipant.js +101 -12
  76. package/lib/simple/room/Room.js +101 -12
  77. package/lib/simple/room/SipRoom.js +101 -12
  78. package/lib/simple/room/Stream.js +101 -12
  79. package/lib/simple/room/__tests__/RemoteParticipant.test.js +101 -12
  80. package/lib/simple/utils.js +101 -12
  81. package/lib/web-rtc-client.js +68 -6
  82. package/package.json +1 -1
  83. package/src/api/auth.js +5 -0
  84. package/src/api/calld.js +3 -0
  85. package/src/domain/CallLog.js +6 -0
  86. package/src/domain/CallSession.js +8 -0
  87. package/src/domain/MeetingStatus.js +27 -0
  88. package/src/domain/Phone/WebRTCPhone.js +25 -6
  89. package/src/domain/__tests__/CallSession.test.js +32 -4
  90. package/src/web-rtc-client.js +27 -6
@@ -87,11 +87,13 @@ class Recording {
87
87
 
88
88
 
89
89
 
90
+
90
91
 
91
92
 
92
93
 
93
94
 
94
95
 
96
+
95
97
 
96
98
 
97
99
 
@@ -112,10 +114,12 @@ class Recording {
112
114
 
113
115
 
114
116
 
117
+
115
118
 
116
119
 
117
120
 
118
121
 
122
+
119
123
 
120
124
 
121
125
 
@@ -177,10 +181,12 @@ class CallLog {
177
181
  || plain.destination_extension
178
182
  || `meeting-${plain.requested_name || plain.destination_name || ''}`,
179
183
  name: plain.requested_name || plain.destination_name || '',
184
+ uuid: plain.destination_user_uuid,
180
185
  },
181
186
  source: {
182
187
  extension: plain.source_extension,
183
188
  name: plain.source_name,
189
+ uuid: plain.source_user_uuid,
184
190
  },
185
191
  id: plain.id,
186
192
  duration: (plain.duration || 0) * 1000, // duration is in seconds
@@ -375,6 +375,14 @@ class CallSession {
375
375
  return !!this.answerTime;
376
376
  }
377
377
 
378
+ toJSON() {
379
+ const jsonObj = { ...this };
380
+ // $FlowFixMe
381
+ jsonObj.answered = this.answered;
382
+
383
+ return jsonObj;
384
+ }
385
+
378
386
  static parseCall(call ) {
379
387
  return new CallSession({
380
388
  callId: call.id,
@@ -400,6 +408,8 @@ class CallSession {
400
408
  }
401
409
  }
402
410
 
411
+ const stringify = cs => JSON.parse(JSON.stringify(cs));
412
+
403
413
  describe('CallSession domain', () => {
404
414
  it('should update from another CallSession without data loss', () => {
405
415
  const callSession = new CallSession({
@@ -438,7 +448,7 @@ describe('CallSession domain', () => {
438
448
  expect(cs2.is(cs1)).toBeTruthy();
439
449
  });
440
450
 
441
- it('should set answerTime when setting answered', () => {
451
+ it('should set answerTime when setting answered to true', () => {
442
452
  const cs1 = new CallSession({});
443
453
  cs1.answered = true;
444
454
 
@@ -447,11 +457,37 @@ describe('CallSession domain', () => {
447
457
 
448
458
  const cs3 = new CallSession({ answered: true });
449
459
 
450
- expect(cs1.answered).toBeTruthy();
460
+ expect(cs1.answered).toEqual(true);
451
461
  expect(cs1.answerTime).not.toBeNull();
452
- expect(cs2.answered).toBeTruthy();
462
+ expect(cs2.answered).toEqual(true);
453
463
  expect(cs2.answerTime).not.toBeNull();
454
- expect(cs3.answered).toBeTruthy();
464
+ expect(cs3.answered).toEqual(true);
455
465
  expect(cs3.answerTime).not.toBeNull();
466
+
467
+ const cs4 = stringify(cs1);
468
+ const cs5 = stringify(cs2);
469
+ const cs6 = stringify(cs3);
470
+
471
+ expect(cs4.answered).toEqual(true);
472
+ expect(cs5.answered).toEqual(true);
473
+ expect(cs6.answered).toEqual(true);
474
+ });
475
+
476
+ it('should reset answerTime when setting answered to false', () => {
477
+ const cs1 = new CallSession({});
478
+ cs1.answered = false;
479
+
480
+ const cs2 = new CallSession({ answered: false });
481
+
482
+ expect(cs1.answered).toEqual(false);
483
+ expect(cs1.answerTime).toBeNull();
484
+ expect(cs2.answered).toEqual(false);
485
+ expect(cs2.answerTime).toBeNull();
486
+
487
+ const cs4 = stringify(cs1);
488
+ const cs5 = stringify(cs2);
489
+
490
+ expect(cs4.answered).toEqual(false);
491
+ expect(cs5.answered).toEqual(false);
456
492
  });
457
493
  });
@@ -375,6 +375,14 @@ class CallSession {
375
375
  return !!this.answerTime;
376
376
  }
377
377
 
378
+ toJSON() {
379
+ const jsonObj = { ...this };
380
+ // $FlowFixMe
381
+ jsonObj.answered = this.answered;
382
+
383
+ return jsonObj;
384
+ }
385
+
378
386
  static parseCall(call ) {
379
387
  return new CallSession({
380
388
  callId: call.id,
@@ -375,6 +375,14 @@ class CallSession {
375
375
  return !!this.answerTime;
376
376
  }
377
377
 
378
+ toJSON() {
379
+ const jsonObj = { ...this };
380
+ // $FlowFixMe
381
+ jsonObj.answered = this.answered;
382
+
383
+ return jsonObj;
384
+ }
385
+
378
386
  static parseCall(call ) {
379
387
  return new CallSession({
380
388
  callId: call.id,
package/esm/index.js CHANGED
@@ -2217,6 +2217,7 @@ var authMethods = (client , baseUrl ) => ({
2217
2217
 
2218
2218
 
2219
2219
 
2220
+
2220
2221
  ) {
2221
2222
  const body = {
2222
2223
  backend: params.backend || DEFAULT_BACKEND_USER,
@@ -2236,6 +2237,10 @@ var authMethods = (client , baseUrl ) => ({
2236
2237
  headers['Wazo-Session-Type'] = 'mobile';
2237
2238
  }
2238
2239
 
2240
+ if (params.tenantId) {
2241
+ body.tenant_id = params.tenantId;
2242
+ }
2243
+
2239
2244
  return client.post(`${baseUrl}/token`, body, headers).then(response => Session.parse(response));
2240
2245
  },
2241
2246
 
@@ -3592,6 +3597,14 @@ class CallSession {
3592
3597
  return !!this.answerTime;
3593
3598
  }
3594
3599
 
3600
+ toJSON() {
3601
+ const jsonObj = { ...this };
3602
+ // $FlowFixMe
3603
+ jsonObj.answered = this.answered;
3604
+
3605
+ return jsonObj;
3606
+ }
3607
+
3595
3608
  static parseCall(call ) {
3596
3609
  return new CallSession({
3597
3610
  callId: call.id,
@@ -3702,11 +3715,13 @@ class Recording {
3702
3715
 
3703
3716
 
3704
3717
 
3718
+
3705
3719
 
3706
3720
 
3707
3721
 
3708
3722
 
3709
3723
 
3724
+
3710
3725
 
3711
3726
 
3712
3727
 
@@ -3727,10 +3742,12 @@ class Recording {
3727
3742
 
3728
3743
 
3729
3744
 
3745
+
3730
3746
 
3731
3747
 
3732
3748
 
3733
3749
 
3750
+
3734
3751
 
3735
3752
 
3736
3753
 
@@ -3792,10 +3809,12 @@ class CallLog {
3792
3809
  || plain.destination_extension
3793
3810
  || `meeting-${plain.requested_name || plain.destination_name || ''}`,
3794
3811
  name: plain.requested_name || plain.destination_name || '',
3812
+ uuid: plain.destination_user_uuid,
3795
3813
  },
3796
3814
  source: {
3797
3815
  extension: plain.source_extension,
3798
3816
  name: plain.source_name,
3817
+ uuid: plain.source_user_uuid,
3799
3818
  },
3800
3819
  id: plain.id,
3801
3820
  duration: (plain.duration || 0) * 1000, // duration is in seconds
@@ -4926,6 +4945,34 @@ var chatdMethods = (client , baseUrl ) => ({
4926
4945
  client.get(`${baseUrl}/users/me/rooms/messages`, options),
4927
4946
  });
4928
4947
 
4948
+ //
4949
+
4950
+
4951
+
4952
+
4953
+
4954
+ class MeetingStatus {
4955
+
4956
+
4957
+
4958
+
4959
+ constructor({
4960
+ full,
4961
+ } = {}) {
4962
+ this.full = full;
4963
+
4964
+ // Useful to compare instead of instanceof with minified code
4965
+ this.type = 'MeetingStatus';
4966
+ }
4967
+
4968
+ static parse(plain ) {
4969
+ return new MeetingStatus({
4970
+ full: plain.full,
4971
+ });
4972
+ }
4973
+
4974
+ }
4975
+
4929
4976
  /* */
4930
4977
 
4931
4978
 
@@ -5120,6 +5167,8 @@ var calldMethods = (client , baseUrl ) => ({
5120
5167
  client.put(`${baseUrl}/users/me/calls/${callId}/record/resume`, null, null,
5121
5168
  ApiRequester.successResponseParser),
5122
5169
 
5170
+ guestGetMeetingStatus: (meetingUuid ) =>
5171
+ client.get(`${baseUrl}/guests/me/meetings/${meetingUuid}/status`).then(MeetingStatus.parse),
5123
5172
  });
5124
5173
 
5125
5174
  //
@@ -6187,7 +6236,7 @@ const events$1 = [REGISTERED, UNREGISTERED, REGISTRATION_FAILED, INVITE];
6187
6236
  const transportEvents = [CONNECTED, DISCONNECTED, TRANSPORT_ERROR, MESSAGE];
6188
6237
  class CanceledCallError extends Error {}
6189
6238
 
6190
- const MAX_REGISTER_TRIES = 10;
6239
+ const MAX_REGISTER_TRIES = 5;
6191
6240
 
6192
6241
 
6193
6242
 
@@ -6241,6 +6290,7 @@ class WebRTCClient extends Emitter {
6241
6290
 
6242
6291
 
6243
6292
 
6293
+
6244
6294
 
6245
6295
  // sugar
6246
6296
 
@@ -6303,6 +6353,7 @@ class WebRTCClient extends Emitter {
6303
6353
  this.conferences = {};
6304
6354
  this.networkMonitoringInterval = {};
6305
6355
  this.sessionNetworkStats = {};
6356
+ this.forceClosed = false;
6306
6357
 
6307
6358
  this._boundOnHeartbeat = this._onHeartbeat.bind(this);
6308
6359
  this.heartbeat = new Heartbeat(config.heartbeatDelay, config.heartbeatTimeout, config.maxHeartbeats);
@@ -6424,6 +6475,8 @@ class WebRTCClient extends Emitter {
6424
6475
  skipRegister: this.skipRegister,
6425
6476
  };
6426
6477
 
6478
+ this.forceClosed = false;
6479
+
6427
6480
  if (this.skipRegister) {
6428
6481
  logger$9.info('sdk webrtc skip register...', logInfo);
6429
6482
  return Promise.resolve();
@@ -6448,7 +6501,15 @@ class WebRTCClient extends Emitter {
6448
6501
  const registerOptions = this._isWeb() ? {} : { extraContactHeaderParams: ['mobility=mobile'] };
6449
6502
 
6450
6503
  const onRegisterFailed = () => {
6451
- logger$9.info('sdk webrtc registering failed', { tries, registerer: !!this.registerer });
6504
+ logger$9.info('sdk webrtc registering failed', {
6505
+ tries,
6506
+ registerer: !!this.registerer,
6507
+ forceClosed: this.forceClosed,
6508
+ });
6509
+ if (this.forceClosed) {
6510
+ return;
6511
+ }
6512
+
6452
6513
  this.connectionPromise = null;
6453
6514
  if (this.registerer && this.registerer.waiting) {
6454
6515
  this.registerer.waitingToggle(false);
@@ -6726,8 +6787,9 @@ class WebRTCClient extends Emitter {
6726
6787
  }
6727
6788
  }
6728
6789
 
6729
- async close() {
6730
- logger$9.info('sdk webrtc closing client', { userAgent: !!this.userAgent });
6790
+ async close(force = false) {
6791
+ logger$9.info('sdk webrtc closing client', { userAgent: !!this.userAgent, force });
6792
+ this.forceClosed = force;
6731
6793
  this._cleanupMedia();
6732
6794
  this.connectionPromise = null;
6733
6795
 
@@ -6746,7 +6808,7 @@ class WebRTCClient extends Emitter {
6746
6808
  this.userAgent.delegate = null;
6747
6809
  this.userAgent.stateChange.removeAllListeners();
6748
6810
 
6749
- await this._disconnectTransport();
6811
+ await this._disconnectTransport(force);
6750
6812
 
6751
6813
  this._cleanupRegister();
6752
6814
 
@@ -8182,7 +8244,15 @@ class WebRTCClient extends Emitter {
8182
8244
  return UserAgent.makeURI(`sip:${target}@${this.config.host}`);
8183
8245
  }
8184
8246
 
8185
- async _disconnectTransport() {
8247
+ async _disconnectTransport(force = false) {
8248
+ if (force) {
8249
+ // Bypass sip.js state machine that prevent to close WS with the state `Connecting`
8250
+ this.userAgent.transport.disconnectResolve = () => {};
8251
+ // eslint-disable-next-line
8252
+ this.userAgent.transport._ws.close(1000);
8253
+ return;
8254
+ }
8255
+
8186
8256
  // Check if `disconnectPromise` is not present to avoid `Disconnect promise must not be defined` errors.
8187
8257
  if (this.userAgent && this.userAgent.transport && !this.userAgent.transport.disconnectPromise) {
8188
8258
  try {
@@ -10030,6 +10100,12 @@ class WebRTCPhone extends Emitter {
10030
10100
  return Promise.resolve(null);
10031
10101
  }
10032
10102
 
10103
+ const sipSessionId = this.getSipSessionIdFromCallSession(callSession);
10104
+ if (sipSessionId && !(sipSessionId in this.callSessions)) {
10105
+ logger$7.warn('Call session already ended or not found, can\'t accept it.', { sipSessionId });
10106
+ return Promise.resolve(null);
10107
+ }
10108
+
10033
10109
  if (callSession.getId() in this.acceptedSessions) {
10034
10110
  logger$7.warn('CallSession already accepted.', { id: callSession ? callSession.getId() : 'n/a' });
10035
10111
  return Promise.resolve(callSession.sipCallId);
@@ -10490,7 +10566,7 @@ class WebRTCPhone extends Emitter {
10490
10566
  return this.client && this.client.isConference(callSession.sipCallId);
10491
10567
  }
10492
10568
 
10493
- async close() {
10569
+ async close(force = false) {
10494
10570
  logger$7.info('WebRTC close');
10495
10571
 
10496
10572
  try {
@@ -10502,7 +10578,7 @@ class WebRTCPhone extends Emitter {
10502
10578
  logger$7.error('WebRTC close, unregister error', e);
10503
10579
  }
10504
10580
 
10505
- this.client.close();
10581
+ this.client.close(force);
10506
10582
  this.unbind();
10507
10583
 
10508
10584
  this.incomingSessions = [];
@@ -10654,9 +10730,17 @@ class WebRTCPhone extends Emitter {
10654
10730
  });
10655
10731
 
10656
10732
  this.client.on(this.client.ACCEPTED, (sipSession ) => {
10657
- logger$7.info('WebRTC call accepted', { sipId: sipSession.id });
10733
+ const sessionId = this.getSipSessionId(sipSession);
10734
+ const hasSession = sessionId in this.callSessions;
10735
+
10736
+ logger$7.info('WebRTC call accepted', { sipId: sessionId, hasSession });
10737
+
10738
+ if (!hasSession) {
10739
+ logger$7.warn('Call accepted ignored, session is no longer present in the WebRtcPhone', { sessionId });
10740
+ return;
10741
+ }
10658
10742
 
10659
- this._onCallAccepted(sipSession, this.client.hasVideo(this.getSipSessionId(sipSession)));
10743
+ this._onCallAccepted(sipSession, this.client.hasVideo(sessionId));
10660
10744
 
10661
10745
  if (this.audioOutputDeviceId) {
10662
10746
  this.client.changeAudioOutputDevice(this.audioOutputDeviceId);
@@ -10792,9 +10876,14 @@ class WebRTCPhone extends Emitter {
10792
10876
  return this.client.getSipSessionId(sipSession);
10793
10877
  }
10794
10878
 
10795
- _updateCallSession(callSession ) {
10879
+ getSipSessionIdFromCallSession(callSession ) {
10796
10880
  const sipSession = this.findSipSession(callSession);
10797
- const sipSessionId = sipSession ? this.getSipSessionId(sipSession) : null;
10881
+
10882
+ return sipSession ? this.getSipSessionId(sipSession) : null;
10883
+ }
10884
+
10885
+ _updateCallSession(callSession ) {
10886
+ const sipSessionId = this.getSipSessionIdFromCallSession(callSession);
10798
10887
 
10799
10888
  if (sipSessionId) {
10800
10889
  this.callSessions[sipSessionId] = callSession;
@@ -1745,11 +1745,13 @@ class Recording {
1745
1745
 
1746
1746
 
1747
1747
 
1748
+
1748
1749
 
1749
1750
 
1750
1751
 
1751
1752
 
1752
1753
 
1754
+
1753
1755
 
1754
1756
 
1755
1757
 
@@ -1770,10 +1772,12 @@ class Recording {
1770
1772
 
1771
1773
 
1772
1774
 
1775
+
1773
1776
 
1774
1777
 
1775
1778
 
1776
1779
 
1780
+
1777
1781
 
1778
1782
 
1779
1783
 
@@ -1835,10 +1839,12 @@ class CallLog {
1835
1839
  || plain.destination_extension
1836
1840
  || `meeting-${plain.requested_name || plain.destination_name || ''}`,
1837
1841
  name: plain.requested_name || plain.destination_name || '',
1842
+ uuid: plain.destination_user_uuid,
1838
1843
  },
1839
1844
  source: {
1840
1845
  extension: plain.source_extension,
1841
1846
  name: plain.source_name,
1847
+ uuid: plain.source_user_uuid,
1842
1848
  },
1843
1849
  id: plain.id,
1844
1850
  duration: (plain.duration || 0) * 1000, // duration is in seconds
@@ -2731,6 +2737,7 @@ var authMethods = (client , baseUrl ) => ({
2731
2737
 
2732
2738
 
2733
2739
 
2740
+
2734
2741
  ) {
2735
2742
  const body = {
2736
2743
  backend: params.backend || DEFAULT_BACKEND_USER,
@@ -2750,6 +2757,10 @@ var authMethods = (client , baseUrl ) => ({
2750
2757
  headers['Wazo-Session-Type'] = 'mobile';
2751
2758
  }
2752
2759
 
2760
+ if (params.tenantId) {
2761
+ body.tenant_id = params.tenantId;
2762
+ }
2763
+
2753
2764
  return client.post(`${baseUrl}/token`, body, headers).then(response => Session.parse(response));
2754
2765
  },
2755
2766
 
@@ -4016,6 +4027,34 @@ class IndirectTransfer {
4016
4027
  }
4017
4028
  }
4018
4029
 
4030
+ //
4031
+
4032
+
4033
+
4034
+
4035
+
4036
+ class MeetingStatus {
4037
+
4038
+
4039
+
4040
+
4041
+ constructor({
4042
+ full,
4043
+ } = {}) {
4044
+ this.full = full;
4045
+
4046
+ // Useful to compare instead of instanceof with minified code
4047
+ this.type = 'MeetingStatus';
4048
+ }
4049
+
4050
+ static parse(plain ) {
4051
+ return new MeetingStatus({
4052
+ full: plain.full,
4053
+ });
4054
+ }
4055
+
4056
+ }
4057
+
4019
4058
  /* */
4020
4059
 
4021
4060
 
@@ -4210,6 +4249,8 @@ var calldMethods = (client , baseUrl ) => ({
4210
4249
  client.put(`${baseUrl}/users/me/calls/${callId}/record/resume`, null, null,
4211
4250
  ApiRequester.successResponseParser),
4212
4251
 
4252
+ guestGetMeetingStatus: (meetingUuid ) =>
4253
+ client.get(`${baseUrl}/guests/me/meetings/${meetingUuid}/status`).then(MeetingStatus.parse),
4213
4254
  });
4214
4255
 
4215
4256
  //
@@ -2197,6 +2197,7 @@ var authMethods = (client , baseUrl ) => ({
2197
2197
 
2198
2198
 
2199
2199
 
2200
+
2200
2201
  ) {
2201
2202
  const body = {
2202
2203
  backend: params.backend || DEFAULT_BACKEND_USER,
@@ -2216,6 +2217,10 @@ var authMethods = (client , baseUrl ) => ({
2216
2217
  headers['Wazo-Session-Type'] = 'mobile';
2217
2218
  }
2218
2219
 
2220
+ if (params.tenantId) {
2221
+ body.tenant_id = params.tenantId;
2222
+ }
2223
+
2219
2224
  return client.post(`${baseUrl}/token`, body, headers).then(response => Session.parse(response));
2220
2225
  },
2221
2226
 
@@ -3284,11 +3289,13 @@ class Recording {
3284
3289
 
3285
3290
 
3286
3291
 
3292
+
3287
3293
 
3288
3294
 
3289
3295
 
3290
3296
 
3291
3297
 
3298
+
3292
3299
 
3293
3300
 
3294
3301
 
@@ -3309,10 +3316,12 @@ class Recording {
3309
3316
 
3310
3317
 
3311
3318
 
3319
+
3312
3320
 
3313
3321
 
3314
3322
 
3315
3323
 
3324
+
3316
3325
 
3317
3326
 
3318
3327
 
@@ -3374,10 +3383,12 @@ class CallLog {
3374
3383
  || plain.destination_extension
3375
3384
  || `meeting-${plain.requested_name || plain.destination_name || ''}`,
3376
3385
  name: plain.requested_name || plain.destination_name || '',
3386
+ uuid: plain.destination_user_uuid,
3377
3387
  },
3378
3388
  source: {
3379
3389
  extension: plain.source_extension,
3380
3390
  name: plain.source_name,
3391
+ uuid: plain.source_user_uuid,
3381
3392
  },
3382
3393
  id: plain.id,
3383
3394
  duration: (plain.duration || 0) * 1000, // duration is in seconds
@@ -4016,6 +4027,34 @@ var chatdMethods = (client , baseUrl ) => ({
4016
4027
  client.get(`${baseUrl}/users/me/rooms/messages`, options),
4017
4028
  });
4018
4029
 
4030
+ //
4031
+
4032
+
4033
+
4034
+
4035
+
4036
+ class MeetingStatus {
4037
+
4038
+
4039
+
4040
+
4041
+ constructor({
4042
+ full,
4043
+ } = {}) {
4044
+ this.full = full;
4045
+
4046
+ // Useful to compare instead of instanceof with minified code
4047
+ this.type = 'MeetingStatus';
4048
+ }
4049
+
4050
+ static parse(plain ) {
4051
+ return new MeetingStatus({
4052
+ full: plain.full,
4053
+ });
4054
+ }
4055
+
4056
+ }
4057
+
4019
4058
  /* */
4020
4059
 
4021
4060
 
@@ -4210,6 +4249,8 @@ var calldMethods = (client , baseUrl ) => ({
4210
4249
  client.put(`${baseUrl}/users/me/calls/${callId}/record/resume`, null, null,
4211
4250
  ApiRequester.successResponseParser),
4212
4251
 
4252
+ guestGetMeetingStatus: (meetingUuid ) =>
4253
+ client.get(`${baseUrl}/guests/me/meetings/${meetingUuid}/status`).then(MeetingStatus.parse),
4213
4254
  });
4214
4255
 
4215
4256
  //