@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
@@ -1052,6 +1052,7 @@ const LINE_STATE = {
1052
1052
 
1053
1053
 
1054
1054
 
1055
+
1055
1056
 
1056
1057
 
1057
1058
 
@@ -1088,6 +1089,7 @@ const LINE_STATE = {
1088
1089
 
1089
1090
 
1090
1091
 
1092
+
1091
1093
 
1092
1094
 
1093
1095
 
@@ -1119,6 +1121,7 @@ class Profile {
1119
1121
 
1120
1122
 
1121
1123
 
1124
+
1122
1125
 
1123
1126
 
1124
1127
 
@@ -1135,6 +1138,7 @@ class Profile {
1135
1138
  lines: plain.lines.map(line => Line.parse(line)),
1136
1139
  username: plain.username,
1137
1140
  mobileNumber: plain.mobile_phone_number || '',
1141
+ ringSeconds: plain.ring_seconds,
1138
1142
  forwards: [
1139
1143
  ForwardOption.parse(plain.forwards.unconditional, FORWARD_KEYS.UNCONDITIONAL),
1140
1144
  ForwardOption.parse(plain.forwards.noanswer, FORWARD_KEYS.NO_ANSWER),
@@ -1171,6 +1175,7 @@ class Profile {
1171
1175
  switchboards,
1172
1176
  agent,
1173
1177
  status,
1178
+ ringSeconds,
1174
1179
  sipLines,
1175
1180
  callPickupTargetUsers,
1176
1181
  onlineCallRecordEnabled,
@@ -1192,6 +1197,7 @@ class Profile {
1192
1197
  this.status = status;
1193
1198
  this.callPickupTargetUsers = callPickupTargetUsers;
1194
1199
  this.onlineCallRecordEnabled = onlineCallRecordEnabled;
1200
+ this.ringSeconds = ringSeconds;
1195
1201
 
1196
1202
  this.sipLines = sipLines || [];
1197
1203
  }
@@ -2197,6 +2203,7 @@ var authMethods = (client , baseUrl ) => ({
2197
2203
 
2198
2204
 
2199
2205
 
2206
+
2200
2207
  ) {
2201
2208
  const body = {
2202
2209
  backend: params.backend || DEFAULT_BACKEND_USER,
@@ -2216,6 +2223,10 @@ var authMethods = (client , baseUrl ) => ({
2216
2223
  headers['Wazo-Session-Type'] = 'mobile';
2217
2224
  }
2218
2225
 
2226
+ if (params.tenantId) {
2227
+ body.tenant_id = params.tenantId;
2228
+ }
2229
+
2219
2230
  return client.post(`${baseUrl}/token`, body, headers).then(response => Session.parse(response));
2220
2231
  },
2221
2232
 
@@ -3284,11 +3295,13 @@ class Recording {
3284
3295
 
3285
3296
 
3286
3297
 
3298
+
3287
3299
 
3288
3300
 
3289
3301
 
3290
3302
 
3291
3303
 
3304
+
3292
3305
 
3293
3306
 
3294
3307
 
@@ -3309,10 +3322,12 @@ class Recording {
3309
3322
 
3310
3323
 
3311
3324
 
3325
+
3312
3326
 
3313
3327
 
3314
3328
 
3315
3329
 
3330
+
3316
3331
 
3317
3332
 
3318
3333
 
@@ -3374,10 +3389,12 @@ class CallLog {
3374
3389
  || plain.destination_extension
3375
3390
  || `meeting-${plain.requested_name || plain.destination_name || ''}`,
3376
3391
  name: plain.requested_name || plain.destination_name || '',
3392
+ uuid: plain.destination_user_uuid,
3377
3393
  },
3378
3394
  source: {
3379
3395
  extension: plain.source_extension,
3380
3396
  name: plain.source_name,
3397
+ uuid: plain.source_user_uuid,
3381
3398
  },
3382
3399
  id: plain.id,
3383
3400
  duration: (plain.duration || 0) * 1000, // duration is in seconds
@@ -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
@@ -5645,6 +5677,10 @@ class AdHocAPIConference {
5645
5677
  this.conferenceId = conferenceId || '';
5646
5678
  this.muted = muted || false;
5647
5679
  this.paused = paused || false;
5680
+
5681
+ if (this.host) {
5682
+ this.host.setIsConference(true);
5683
+ }
5648
5684
  }
5649
5685
 
5650
5686
  async start() {
@@ -9354,7 +9390,11 @@ class WebRTCPhone extends Emitter {
9354
9390
  accept(callSession , cameraEnabled ) {
9355
9391
  logger$8.info('WebRTC phone - accept call', { id: callSession ? callSession.getId() : 'n/a', cameraEnabled });
9356
9392
  if (this.currentSipSession) {
9357
- this.holdSipSession(this.currentSipSession, this.currentCallSession, true);
9393
+ this.holdSipSession(
9394
+ this.currentSipSession,
9395
+ this.currentCallSession,
9396
+ true,
9397
+ );
9358
9398
  }
9359
9399
 
9360
9400
  if (!callSession) {
@@ -9447,22 +9487,22 @@ class WebRTCPhone extends Emitter {
9447
9487
  }
9448
9488
  }
9449
9489
 
9450
- hold(callSession , withEvent = true, isConference = false) {
9490
+ hold(callSession , withEvent = true) {
9451
9491
  logger$8.info('WebRTC hold', { id: callSession.getId() });
9452
9492
 
9453
9493
  const sipSession = this.findSipSession(callSession);
9454
9494
 
9455
- return sipSession ? this.holdSipSession(sipSession, callSession, withEvent, isConference) : null;
9495
+ return sipSession ? this.holdSipSession(sipSession, callSession, withEvent) : null;
9456
9496
  }
9457
9497
 
9458
9498
  // @Deprecated
9459
- unhold(callSession , withEvent = true, isConference = false) {
9499
+ unhold(callSession , withEvent = true) {
9460
9500
  console.warn('Please note that `phone.unhold()` is being deprecated; `phone.resume()` is the preferred method');
9461
9501
 
9462
- return this.resume(callSession, isConference, withEvent);
9502
+ return this.resume(callSession, withEvent);
9463
9503
  }
9464
9504
 
9465
- resume(callSession , isConference = false, withEvent = true) {
9505
+ resume(callSession , withEvent = true) {
9466
9506
  logger$8.info('WebRTC resume called', { id: callSession ? callSession.getId() : null });
9467
9507
 
9468
9508
  const sipSession = this.findSipSession(callSession);
@@ -9475,10 +9515,14 @@ class WebRTCPhone extends Emitter {
9475
9515
  // Hold current session if different from the current one (we don't want 2 sessions active at the same time).
9476
9516
  if (this.currentSipSession && this.currentSipSession.id !== sipSession.id) {
9477
9517
  logger$8.info('WebRTC hold call after resume', { id: this.currentSipSession.id });
9478
- this.holdSipSession(this.currentSipSession, this.currentCallSession);
9518
+ this.holdSipSession(
9519
+ this.currentSipSession,
9520
+ this.currentCallSession,
9521
+ withEvent,
9522
+ );
9479
9523
  }
9480
9524
 
9481
- const promise = this.unholdSipSession(sipSession, callSession, withEvent, isConference);
9525
+ const promise = this.unholdSipSession(sipSession, callSession, withEvent);
9482
9526
  this.currentSipSession = sipSession;
9483
9527
  if (callSession) {
9484
9528
  this.currentCallSession = callSession;
@@ -9491,7 +9535,6 @@ class WebRTCPhone extends Emitter {
9491
9535
  sipSession ,
9492
9536
  callSession ,
9493
9537
  withEvent = true,
9494
- isConference = false,
9495
9538
  ) {
9496
9539
  if (!sipSession) {
9497
9540
  return new Promise((resolve, reject) => reject(new Error('No session to hold')));
@@ -9512,6 +9555,8 @@ class WebRTCPhone extends Emitter {
9512
9555
  await this.client.downgradeToAudio(sipSession);
9513
9556
  }
9514
9557
 
9558
+ const isConference = !!callSession && callSession.isConference();
9559
+
9515
9560
  const promise = this.client.hold(sipSession, isConference, hasVideo);
9516
9561
  if (withEvent) {
9517
9562
  this.eventEmitter.emit(ON_CALL_HELD, this._createCallSession(sipSession, callSession));
@@ -9524,11 +9569,13 @@ class WebRTCPhone extends Emitter {
9524
9569
  sipSession ,
9525
9570
  callSession ,
9526
9571
  withEvent = true,
9527
- isConference = false,
9528
9572
  ) {
9529
9573
  if (!sipSession) {
9530
9574
  return new Promise((resolve, reject) => reject(new Error('No session to unhold')));
9531
9575
  }
9576
+
9577
+ const isConference = !!callSession && callSession.isConference();
9578
+
9532
9579
  const sessionId = this.getSipSessionId(sipSession);
9533
9580
  logger$8.info('WebRTC unhold sip session', { sessionId, isConference });
9534
9581
 
@@ -9670,7 +9717,11 @@ class WebRTCPhone extends Emitter {
9670
9717
  await this.client.register();
9671
9718
  }
9672
9719
  if (this.currentSipSession) {
9673
- this.holdSipSession(this.currentSipSession, this.currentCallSession, true).catch(e => {
9720
+ this.holdSipSession(
9721
+ this.currentSipSession,
9722
+ this.currentCallSession,
9723
+ true,
9724
+ ).catch(e => {
9674
9725
  logger$8.warn('Unable to hold current session when making another call', e);
9675
9726
  });
9676
9727
  }
@@ -9685,6 +9736,7 @@ class WebRTCPhone extends Emitter {
9685
9736
  return Promise.resolve(null);
9686
9737
  }
9687
9738
  const callSession = this._createOutgoingCallSession(sipSession, cameraEnabled || false);
9739
+ callSession.setIsConference(conference);
9688
9740
  callSession.creationTime = new Date();
9689
9741
  this._updateCallSession(callSession);
9690
9742
 
@@ -10263,6 +10315,7 @@ class WebRTCPhone extends Emitter {
10263
10315
  recording: fromSession ? fromSession.isRecording() : false,
10264
10316
  recordingPaused: false, // @TODO
10265
10317
  sipSession,
10318
+ conference: !!fromSession && fromSession.isConference(),
10266
10319
  ...extra,
10267
10320
  });
10268
10321
 
@@ -10519,16 +10572,16 @@ class Phone extends Emitter {
10519
10572
  }
10520
10573
  }
10521
10574
 
10522
- hold(callSession , isConference = false) {
10523
- return this.phone && this.phone.hold(callSession, true, isConference);
10575
+ hold(callSession ) {
10576
+ return this.phone && this.phone.hold(callSession, true);
10524
10577
  }
10525
10578
 
10526
- unhold(callSession , isConference = false) {
10527
- return this.phone && this.phone.unhold(callSession, true, isConference);
10579
+ unhold(callSession ) {
10580
+ return this.phone && this.phone.unhold(callSession, true);
10528
10581
  }
10529
10582
 
10530
- resume(callSession , isConference = false) {
10531
- return this.phone && this.phone.resume(callSession, isConference);
10583
+ resume(callSession ) {
10584
+ return this.phone && this.phone.resume(callSession);
10532
10585
  }
10533
10586
 
10534
10587
  reject(callSession ) {
@@ -13627,6 +13680,7 @@ const Wazo = {
13627
13680
  InvalidAuthorization,
13628
13681
  CanceledCallError,
13629
13682
  SFUNotAvailableError,
13683
+ NoTenantIdError,
13630
13684
  };
13631
13685
 
13632
13686
  if (window) {
@@ -13640,6 +13694,7 @@ if (global) {
13640
13694
 
13641
13695
  class InvalidSubscription extends Error {}
13642
13696
  class InvalidAuthorization extends Error {}
13697
+ class NoTenantIdError extends Error {}
13643
13698
 
13644
13699
  const logger = IssueReporter$1.loggerFor('simple-auth');
13645
13700
 
@@ -13653,11 +13708,15 @@ class Auth {
13653
13708
 
13654
13709
 
13655
13710
 
13711
+
13712
+
13656
13713
 
13657
13714
  constructor() {
13658
13715
  this.expiration = DETAULT_EXPIRATION;
13659
13716
  this.authenticated = false;
13660
13717
  this.minSubscriptionType = null;
13718
+ this.BACKEND_WAZO = DEFAULT_BACKEND_USER;
13719
+ this.BACKEND_LDAP = BACKEND_LDAP_USER;
13661
13720
  }
13662
13721
 
13663
13722
  init(clientId ,
@@ -13690,12 +13749,18 @@ class Auth {
13690
13749
  setFetchOptions(options);
13691
13750
  }
13692
13751
 
13693
- async logIn(username , password ) {
13752
+ async logIn(username , password , backend , tenantId ) {
13753
+ if (backend && backend !== this.BACKEND_WAZO && !tenantId) {
13754
+ throw new NoTenantIdError('No tenant id');
13755
+ }
13756
+
13694
13757
  this.authenticated = false;
13695
13758
  this.session = null;
13696
13759
  const rawSession = await getApiClient().auth.logIn({
13697
13760
  username,
13698
13761
  password,
13762
+ backend,
13763
+ tenantId,
13699
13764
  expiration: this.expiration,
13700
13765
  mobile: this.mobile,
13701
13766
  });
@@ -13901,4 +13966,4 @@ if (!global.wazoAuthInstance) {
13901
13966
  var Auth$1 = global.wazoAuthInstance;
13902
13967
 
13903
13968
  export default Auth$1;
13904
- export { InvalidAuthorization, InvalidSubscription };
13969
+ export { InvalidAuthorization, InvalidSubscription, NoTenantIdError };