@wazo/sdk 0.38.8 → 0.38.11

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 (78) hide show
  1. package/dist/wazo-sdk.js +2 -2
  2. package/esm/__tests__/api-client.test.js +21 -0
  3. package/esm/__tests__/web-rtc-client.test.js +31 -6
  4. package/esm/api/auth.js +12 -0
  5. package/esm/api/ctid-ng.js +1 -0
  6. package/esm/api-client.js +21 -0
  7. package/esm/checker/Checker.js +31 -6
  8. package/esm/checker/checks/aor.js +21 -0
  9. package/esm/checker/checks/api.js +21 -0
  10. package/esm/checker/checks/index.js +31 -6
  11. package/esm/checker/checks/webrtc-transport.js +31 -6
  12. package/esm/checker/checks/webrtc.js +31 -6
  13. package/esm/domain/AdHocAPIConference.js +28 -2
  14. package/esm/domain/Features.js +28 -2
  15. package/esm/domain/Phone/CTIPhone.js +28 -2
  16. package/esm/domain/Phone/WebRTCPhone.js +4 -5
  17. package/esm/index.js +86 -17
  18. package/esm/service/CallApi.js +28 -2
  19. package/esm/service/getApiClient.js +34 -3
  20. package/esm/simple/Auth.js +87 -18
  21. package/esm/simple/Configuration.js +86 -17
  22. package/esm/simple/Directory.js +28 -2
  23. package/esm/simple/Phone.js +86 -17
  24. package/esm/simple/Softphone.js +5 -0
  25. package/esm/simple/index.js +86 -17
  26. package/esm/simple/room/LocalParticipant.js +86 -17
  27. package/esm/simple/room/Participant.js +86 -17
  28. package/esm/simple/room/RemoteParticipant.js +86 -17
  29. package/esm/simple/room/Room.js +86 -17
  30. package/esm/simple/room/SipRoom.js +86 -17
  31. package/esm/simple/room/Stream.js +86 -17
  32. package/esm/simple/room/__tests__/Participant.test.js +86 -17
  33. package/esm/simple/room/__tests__/RemoteParticipant.test.js +86 -17
  34. package/esm/simple/utils.js +86 -17
  35. package/esm/web-rtc-client.js +31 -6
  36. package/lib/__tests__/api-client.test.js +21 -0
  37. package/lib/__tests__/web-rtc-client.test.js +31 -6
  38. package/lib/api/auth.js +12 -0
  39. package/lib/api/ctid-ng.js +1 -0
  40. package/lib/api-client.js +21 -0
  41. package/lib/checker/Checker.js +31 -6
  42. package/lib/checker/checks/aor.js +21 -0
  43. package/lib/checker/checks/api.js +21 -0
  44. package/lib/checker/checks/index.js +31 -6
  45. package/lib/checker/checks/webrtc-transport.js +31 -6
  46. package/lib/checker/checks/webrtc.js +31 -6
  47. package/lib/domain/AdHocAPIConference.js +28 -2
  48. package/lib/domain/Features.js +28 -2
  49. package/lib/domain/Phone/CTIPhone.js +28 -2
  50. package/lib/domain/Phone/WebRTCPhone.js +4 -5
  51. package/lib/index.js +86 -17
  52. package/lib/service/CallApi.js +28 -2
  53. package/lib/service/getApiClient.js +34 -2
  54. package/lib/simple/Auth.js +87 -17
  55. package/lib/simple/Configuration.js +86 -17
  56. package/lib/simple/Directory.js +28 -2
  57. package/lib/simple/Phone.js +86 -17
  58. package/lib/simple/Softphone.js +5 -0
  59. package/lib/simple/index.js +86 -17
  60. package/lib/simple/room/LocalParticipant.js +86 -17
  61. package/lib/simple/room/Participant.js +86 -17
  62. package/lib/simple/room/RemoteParticipant.js +86 -17
  63. package/lib/simple/room/Room.js +86 -17
  64. package/lib/simple/room/SipRoom.js +86 -17
  65. package/lib/simple/room/Stream.js +86 -17
  66. package/lib/simple/room/__tests__/Participant.test.js +86 -17
  67. package/lib/simple/room/__tests__/RemoteParticipant.test.js +86 -17
  68. package/lib/simple/utils.js +86 -17
  69. package/lib/web-rtc-client.js +31 -6
  70. package/package.json +2 -2
  71. package/src/api/auth.js +12 -0
  72. package/src/api-client.js +8 -0
  73. package/src/domain/Phone/WebRTCPhone.js +3 -5
  74. package/src/service/getApiClient.js +13 -2
  75. package/src/simple/Auth.js +35 -4
  76. package/src/simple/Softphone.js +5 -0
  77. package/src/simple/index.js +2 -1
  78. package/src/web-rtc-client.js +10 -6
@@ -2215,6 +2215,7 @@ var authMethods = (client , baseUrl ) => ({
2215
2215
 
2216
2216
 
2217
2217
 
2218
+
2218
2219
  ) {
2219
2220
  const body = {
2220
2221
  backend: params.backend || DEFAULT_BACKEND_USER,
@@ -2235,9 +2236,14 @@ var authMethods = (client , baseUrl ) => ({
2235
2236
  }
2236
2237
 
2237
2238
  if (params.tenantId) {
2239
+ console.warn('Use of `tenantId` is deprecated when calling logIn() method, use `domainName` instead.');
2238
2240
  body.tenant_id = params.tenantId;
2239
2241
  }
2240
2242
 
2243
+ if (params.domainName) {
2244
+ body.domain_name = params.domainName;
2245
+ }
2246
+
2241
2247
  return client.post(`${baseUrl}/token`, body, headers).then(response => Session.parse(response));
2242
2248
  },
2243
2249
 
@@ -2250,6 +2256,7 @@ var authMethods = (client , baseUrl ) => ({
2250
2256
  expiration ,
2251
2257
  isMobile = false,
2252
2258
  tenantId ,
2259
+ domainName ,
2253
2260
  ) => {
2254
2261
  const body = {
2255
2262
  backend: backend || DEFAULT_BACKEND_USER,
@@ -2259,9 +2266,14 @@ var authMethods = (client , baseUrl ) => ({
2259
2266
  };
2260
2267
 
2261
2268
  if (tenantId) {
2269
+ console.warn('Use of `tenantId` is deprecated when calling refreshToken() method, use `domainName` instead.');
2262
2270
  body.tenant_id = tenantId;
2263
2271
  }
2264
2272
 
2273
+ if (domainName) {
2274
+ body.domain_name = domainName;
2275
+ }
2276
+
2265
2277
  const headers = {
2266
2278
  'Content-Type': 'application/json',
2267
2279
  ...(isMobile ? { 'Wazo-Session-Type': 'mobile' } : {}),
@@ -4730,6 +4742,7 @@ class ApiClient {
4730
4742
 
4731
4743
 
4732
4744
 
4745
+
4733
4746
 
4734
4747
 
4735
4748
 
@@ -4771,6 +4784,7 @@ class ApiClient {
4771
4784
  refreshToken: this.refreshToken,
4772
4785
  refreshBackend: this.refreshBackend,
4773
4786
  refreshTenantId: this.refreshTenantId,
4787
+ refreshDomainName: this.refreshDomainName,
4774
4788
  refreshExpiration: this.refreshExpiration,
4775
4789
  isMobile: this.isMobile,
4776
4790
  });
@@ -4786,6 +4800,7 @@ class ApiClient {
4786
4800
  this.refreshExpiration,
4787
4801
  this.isMobile,
4788
4802
  this.refreshTenantId,
4803
+ this.refreshDomainName,
4789
4804
  );
4790
4805
 
4791
4806
  logger.info('token refreshed', { token: session.token });
@@ -4839,9 +4854,14 @@ class ApiClient {
4839
4854
  }
4840
4855
 
4841
4856
  setRefreshTenantId(tenantId ) {
4857
+ console.warn('Use of `setRefreshTenantId` is deprecated, use `setRefreshDomainName` instead');
4842
4858
  this.refreshTenantId = tenantId;
4843
4859
  }
4844
4860
 
4861
+ setRefreshDomainName(domainName ) {
4862
+ this.refreshDomainName = domainName;
4863
+ }
4864
+
4845
4865
  setIsMobile(isMobile ) {
4846
4866
  this.isMobile = isMobile;
4847
4867
  }
@@ -4866,6 +4886,7 @@ global.wazoClientId = global.wazoClientId || {};
4866
4886
  global.wazoClientToken = global.wazoClientToken || {};
4867
4887
  global.wazoRefreshToken = global.wazoRefreshToken || {};
4868
4888
  global.wazoRefreshTenantId = global.wazoRefreshTenantId || {};
4889
+ global.wazoRefreshDomainName = global.wazoRefreshDomainName || {};
4869
4890
  global.wazoOnRefreshToken = global.wazoOnRefreshToken || {};
4870
4891
  global.wazoOnRefreshTokenError = global.wazoOnRefreshTokenError || {};
4871
4892
  global.wazoRefreshExpiration = global.wazoRefreshExpiration || {};
@@ -4875,6 +4896,7 @@ global.wazoFetchOptions = global.wazoFetchOptions || {};
4875
4896
 
4876
4897
  const fillClient = (apiClient ) => {
4877
4898
  const { server, token, clientId } = apiClient.client;
4899
+ const tenantId = global.wazoRefreshTenantId[server] || global.wazoRefreshTenantId[null] || apiClient.refreshTenantId;
4878
4900
 
4879
4901
  // try with null server when dealing with non-related server info
4880
4902
  apiClient.setToken(global.wazoClientToken[server] || global.wazoClientToken[null] || token);
@@ -4883,8 +4905,12 @@ const fillClient = (apiClient ) => {
4883
4905
 
4884
4906
  apiClient.setRefreshToken(global.wazoRefreshToken[server] || global.wazoRefreshToken[null] || apiClient.refreshToken);
4885
4907
 
4886
- apiClient.setRefreshTenantId(
4887
- global.wazoRefreshTenantId[server] || global.wazoRefreshTenantId[null] || apiClient.refreshTenantId,
4908
+ if (tenantId) {
4909
+ apiClient.setRefreshTenantId(tenantId);
4910
+ }
4911
+
4912
+ apiClient.setRefreshDomainName(
4913
+ global.wazoRefreshDomainName[server] || global.wazoRefreshDomainName[null] || apiClient.refreshDomainName,
4888
4914
  );
4889
4915
 
4890
4916
  apiClient.setFetchOptions(global.wazoFetchOptions[server] || global.wazoFetchOptions[null] || apiClient.fetchOptions);
@@ -2848,6 +2848,7 @@ var authMethods = (client , baseUrl ) => ({
2848
2848
 
2849
2849
 
2850
2850
 
2851
+
2851
2852
  ) {
2852
2853
  const body = {
2853
2854
  backend: params.backend || DEFAULT_BACKEND_USER,
@@ -2868,9 +2869,14 @@ var authMethods = (client , baseUrl ) => ({
2868
2869
  }
2869
2870
 
2870
2871
  if (params.tenantId) {
2872
+ console.warn('Use of `tenantId` is deprecated when calling logIn() method, use `domainName` instead.');
2871
2873
  body.tenant_id = params.tenantId;
2872
2874
  }
2873
2875
 
2876
+ if (params.domainName) {
2877
+ body.domain_name = params.domainName;
2878
+ }
2879
+
2874
2880
  return client.post(`${baseUrl}/token`, body, headers).then(response => Session.parse(response));
2875
2881
  },
2876
2882
 
@@ -2883,6 +2889,7 @@ var authMethods = (client , baseUrl ) => ({
2883
2889
  expiration ,
2884
2890
  isMobile = false,
2885
2891
  tenantId ,
2892
+ domainName ,
2886
2893
  ) => {
2887
2894
  const body = {
2888
2895
  backend: backend || DEFAULT_BACKEND_USER,
@@ -2892,9 +2899,14 @@ var authMethods = (client , baseUrl ) => ({
2892
2899
  };
2893
2900
 
2894
2901
  if (tenantId) {
2902
+ console.warn('Use of `tenantId` is deprecated when calling refreshToken() method, use `domainName` instead.');
2895
2903
  body.tenant_id = tenantId;
2896
2904
  }
2897
2905
 
2906
+ if (domainName) {
2907
+ body.domain_name = domainName;
2908
+ }
2909
+
2898
2910
  const headers = {
2899
2911
  'Content-Type': 'application/json',
2900
2912
  ...(isMobile ? { 'Wazo-Session-Type': 'mobile' } : {}),
@@ -5583,6 +5595,7 @@ class ApiClient {
5583
5595
 
5584
5596
 
5585
5597
 
5598
+
5586
5599
 
5587
5600
 
5588
5601
 
@@ -5624,6 +5637,7 @@ class ApiClient {
5624
5637
  refreshToken: this.refreshToken,
5625
5638
  refreshBackend: this.refreshBackend,
5626
5639
  refreshTenantId: this.refreshTenantId,
5640
+ refreshDomainName: this.refreshDomainName,
5627
5641
  refreshExpiration: this.refreshExpiration,
5628
5642
  isMobile: this.isMobile,
5629
5643
  });
@@ -5639,6 +5653,7 @@ class ApiClient {
5639
5653
  this.refreshExpiration,
5640
5654
  this.isMobile,
5641
5655
  this.refreshTenantId,
5656
+ this.refreshDomainName,
5642
5657
  );
5643
5658
 
5644
5659
  logger$a.info('token refreshed', { token: session.token });
@@ -5692,9 +5707,14 @@ class ApiClient {
5692
5707
  }
5693
5708
 
5694
5709
  setRefreshTenantId(tenantId ) {
5710
+ console.warn('Use of `setRefreshTenantId` is deprecated, use `setRefreshDomainName` instead');
5695
5711
  this.refreshTenantId = tenantId;
5696
5712
  }
5697
5713
 
5714
+ setRefreshDomainName(domainName ) {
5715
+ this.refreshDomainName = domainName;
5716
+ }
5717
+
5698
5718
  setIsMobile(isMobile ) {
5699
5719
  this.isMobile = isMobile;
5700
5720
  }
@@ -5719,6 +5739,7 @@ global.wazoClientId = global.wazoClientId || {};
5719
5739
  global.wazoClientToken = global.wazoClientToken || {};
5720
5740
  global.wazoRefreshToken = global.wazoRefreshToken || {};
5721
5741
  global.wazoRefreshTenantId = global.wazoRefreshTenantId || {};
5742
+ global.wazoRefreshDomainName = global.wazoRefreshDomainName || {};
5722
5743
  global.wazoOnRefreshToken = global.wazoOnRefreshToken || {};
5723
5744
  global.wazoOnRefreshTokenError = global.wazoOnRefreshTokenError || {};
5724
5745
  global.wazoRefreshExpiration = global.wazoRefreshExpiration || {};
@@ -5743,9 +5764,14 @@ const setRefreshToken = (newRefreshToken , forServer = null) =>
5743
5764
  };
5744
5765
 
5745
5766
  const setRefreshTenantId = (refreshTenantId , forServer = null) => {
5767
+ console.warn('Use of `setRefreshTenantId` is deprecated, please use `setRefreshDomainName` instead');
5746
5768
  global.wazoRefreshTenantId[forServer] = refreshTenantId;
5747
5769
  };
5748
5770
 
5771
+ const setRefreshDomainName = (refreshDomainName , forServer = null) => {
5772
+ global.wazoRefreshDomainName[forServer] = refreshDomainName;
5773
+ };
5774
+
5749
5775
  const setOnRefreshToken = (onRefreshToken , forServer = null) => {
5750
5776
  global.wazoOnRefreshToken[forServer] = onRefreshToken;
5751
5777
  };
@@ -5764,6 +5790,7 @@ const setFetchOptions = (fetchOptions , forServer = null) => {
5764
5790
 
5765
5791
  const fillClient = (apiClient ) => {
5766
5792
  const { server, token, clientId } = apiClient.client;
5793
+ const tenantId = global.wazoRefreshTenantId[server] || global.wazoRefreshTenantId[null] || apiClient.refreshTenantId;
5767
5794
 
5768
5795
  // try with null server when dealing with non-related server info
5769
5796
  apiClient.setToken(global.wazoClientToken[server] || global.wazoClientToken[null] || token);
@@ -5772,8 +5799,12 @@ const fillClient = (apiClient ) => {
5772
5799
 
5773
5800
  apiClient.setRefreshToken(global.wazoRefreshToken[server] || global.wazoRefreshToken[null] || apiClient.refreshToken);
5774
5801
 
5775
- apiClient.setRefreshTenantId(
5776
- global.wazoRefreshTenantId[server] || global.wazoRefreshTenantId[null] || apiClient.refreshTenantId,
5802
+ if (tenantId) {
5803
+ apiClient.setRefreshTenantId(tenantId);
5804
+ }
5805
+
5806
+ apiClient.setRefreshDomainName(
5807
+ global.wazoRefreshDomainName[server] || global.wazoRefreshDomainName[null] || apiClient.refreshDomainName,
5777
5808
  );
5778
5809
 
5779
5810
  apiClient.setFetchOptions(global.wazoFetchOptions[server] || global.wazoFetchOptions[null] || apiClient.fetchOptions);
@@ -7470,9 +7501,11 @@ class WebRTCClient extends Emitter {
7470
7501
  const videoTracks = localStream.getVideoTracks();
7471
7502
 
7472
7503
  // Remove video senders
7473
- pc.getSenders().filter(sender => sender.track && sender.track.kind === 'video').forEach(videoSender => {
7474
- videoSender.replaceTrack(null);
7475
- });
7504
+ if (pc.getSenders) {
7505
+ pc.getSenders().filter(sender => sender.track && sender.track.kind === 'video').forEach(videoSender => {
7506
+ videoSender.replaceTrack(null);
7507
+ });
7508
+ }
7476
7509
 
7477
7510
  videoTracks.forEach(videoTrack => {
7478
7511
  videoTrack.enabled = false;
@@ -7705,7 +7738,8 @@ class WebRTCClient extends Emitter {
7705
7738
  const constraints = { audio: { deviceId: { exact: deviceId } } };
7706
7739
  const stream = await navigator.mediaDevices.getUserMedia(constraints);
7707
7740
  const audioTrack = stream.getAudioTracks()[0];
7708
- const sender = pc && pc.getSenders().find(s => audioTrack && s && s.track && s.track.kind === audioTrack.kind);
7741
+ const sender = pc && pc.getSenders
7742
+ && pc.getSenders().find(s => audioTrack && s && s.track && s.track.kind === audioTrack.kind);
7709
7743
 
7710
7744
  if (sender) {
7711
7745
  if (sender.track) {
@@ -7768,10 +7802,11 @@ class WebRTCClient extends Emitter {
7768
7802
  // $FlowFixMe
7769
7803
  return navigator.mediaDevices.getUserMedia(constraints).then(async stream => {
7770
7804
  const videoTrack = stream.getVideoTracks()[0];
7771
- let sender = pc && pc.getSenders().find(s => videoTrack && s && s.track && s.track.kind === videoTrack.kind);
7805
+ let sender = pc && pc.getSenders
7806
+ && pc.getSenders().find(s => videoTrack && s && s.track && s.track.kind === videoTrack.kind);
7772
7807
  let wasTrackEnabled = false;
7773
7808
  if (!sender) {
7774
- sender = pc && pc.getSenders().find(s => !s.track);
7809
+ sender = pc && pc.getSenders && pc.getSenders().find(s => !s.track);
7775
7810
  }
7776
7811
 
7777
7812
  if (sender) {
@@ -9305,7 +9340,7 @@ class WebRTCPhone extends Emitter {
9305
9340
  const screenTrack = screenShareStream.getVideoTracks()[0];
9306
9341
  const sipSession = this.currentSipSession;
9307
9342
  const pc = this.client.getPeerConnection(this.getSipSessionId(sipSession));
9308
- const sender = pc && pc.getSenders().find(s => s && s.track && s.track.kind === 'video');
9343
+ const sender = pc && pc.getSenders && pc.getSenders().find(s => s && s.track && s.track.kind === 'video');
9309
9344
  const localStream = this.client.getLocalStream(this.getSipSessionId(sipSession));
9310
9345
  const videoTrack = localStream ? localStream.getTracks().find(track => track.kind === 'video') : null;
9311
9346
  const hadVideo = !!videoTrack;
@@ -9343,9 +9378,7 @@ class WebRTCPhone extends Emitter {
9343
9378
 
9344
9379
  try {
9345
9380
  if (this.currentScreenShare.stream) {
9346
- this.currentScreenShare.stream.getTracks()
9347
- .filter(track => track.kind === 'video')
9348
- .forEach(track => track.stop());
9381
+ this.currentScreenShare.stream.getTracks().forEach(track => track.stop());
9349
9382
  }
9350
9383
 
9351
9384
  if (restoreLocalStream) {
@@ -9389,7 +9422,7 @@ class WebRTCPhone extends Emitter {
9389
9422
  const screenTrack = screenStream.getVideoTracks()[0];
9390
9423
  const sipSessionId = this.getSipSessionId(sipSession);
9391
9424
  const pc = this.client.getPeerConnection(sipSessionId);
9392
- const sender = pc && pc.getSenders().find(s => s && s.track && s.track.kind === 'video');
9425
+ const sender = pc && pc.getSenders && pc.getSenders().find(s => s && s.track && s.track.kind === 'video');
9393
9426
 
9394
9427
  logger$8.info('WebRTC phone - on screensharing', {
9395
9428
  hadVideo,
@@ -10634,6 +10667,7 @@ var PHONE_EVENTS = /*#__PURE__*/Object.freeze({
10634
10667
  class InvalidSubscription extends Error {}
10635
10668
  class InvalidAuthorization extends Error {}
10636
10669
  class NoTenantIdError extends Error {}
10670
+ class NoDomainNameError extends Error {}
10637
10671
 
10638
10672
  const logger$7 = IssueReporter$1.loggerFor('simple-auth');
10639
10673
 
@@ -10697,9 +10731,24 @@ class Auth {
10697
10731
  setFetchOptions(options);
10698
10732
  }
10699
10733
 
10700
- async logIn(username , password , backend , tenantId ) {
10701
- if (backend && backend !== this.BACKEND_WAZO && !tenantId) {
10702
- throw new NoTenantIdError('No tenant id');
10734
+ async logIn(username , password , backend , extra ) {
10735
+ let tenantId = null;
10736
+ let domainName = null;
10737
+ if (typeof extra === 'string') {
10738
+ tenantId = extra;
10739
+ }
10740
+ if (extra && typeof extra === 'object') {
10741
+ domainName = extra.domainName;
10742
+ }
10743
+
10744
+ if (backend && backend !== this.BACKEND_WAZO && !tenantId && !domainName) {
10745
+ if (!tenantId) {
10746
+ throw new NoTenantIdError('No tenant id');
10747
+ }
10748
+
10749
+ if (!domainName) {
10750
+ throw new NoDomainNameError('No domain name');
10751
+ }
10703
10752
  }
10704
10753
 
10705
10754
  this.authenticated = false;
@@ -10709,6 +10758,7 @@ class Auth {
10709
10758
  password,
10710
10759
  backend,
10711
10760
  tenantId,
10761
+ domainName,
10712
10762
  expiration: this.expiration,
10713
10763
  mobile: this.mobile,
10714
10764
  });
@@ -10717,7 +10767,13 @@ class Auth {
10717
10767
  getApiClient().setRefreshBackend(backend);
10718
10768
  }
10719
10769
 
10720
- getApiClient().setRefreshTenantId(tenantId);
10770
+ if (tenantId) {
10771
+ getApiClient().setRefreshTenantId(tenantId);
10772
+ }
10773
+
10774
+ if (domainName) {
10775
+ getApiClient().setRefreshDomainName(domainName);
10776
+ }
10721
10777
 
10722
10778
  return this._onAuthenticated(rawSession);
10723
10779
  }
@@ -10816,11 +10872,18 @@ class Auth {
10816
10872
  }
10817
10873
 
10818
10874
  setRefreshTenantId(refreshTenantId ) {
10875
+ console.warn('Use of `setRefreshTenantId` is deprecated, use `setRefreshDomainName` instead.');
10819
10876
  setRefreshTenantId(refreshTenantId);
10820
10877
 
10821
10878
  getApiClient().setRefreshTenantId(refreshTenantId);
10822
10879
  }
10823
10880
 
10881
+ setRefreshDomainName(domainName ) {
10882
+ setRefreshDomainName(domainName);
10883
+
10884
+ getApiClient().setRefreshDomainName(domainName);
10885
+ }
10886
+
10824
10887
  forceRefreshToken() {
10825
10888
  getApiClient().forceRefreshToken();
10826
10889
  }
@@ -13912,6 +13975,7 @@ class Softphone {
13912
13975
  wrapUpDuration,
13913
13976
  enableAgent = true,
13914
13977
  tenantId,
13978
+ domainName,
13915
13979
  debug = false,
13916
13980
  } = {}) {
13917
13981
  this.url = url || 'https://softphone.wazo.io';
@@ -13936,8 +14000,12 @@ class Softphone {
13936
14000
  config.port = port;
13937
14001
  }
13938
14002
  if (tenantId) {
14003
+ console.warn('Use of `tenantId` is deprecated when calling `Softphone.init()`, use `domainName` instead');
13939
14004
  config.tenantId = tenantId;
13940
14005
  }
14006
+ if (domainName) {
14007
+ config.domainName = domainName;
14008
+ }
13941
14009
  if (wrapUpDuration) {
13942
14010
  config.wrapUpDuration = wrapUpDuration;
13943
14011
  }
@@ -14258,6 +14326,7 @@ const Wazo = {
14258
14326
  CanceledCallError,
14259
14327
  SFUNotAvailableError,
14260
14328
  NoTenantIdError,
14329
+ NoDomainNameError,
14261
14330
  };
14262
14331
 
14263
14332
  if (window) {
@@ -109,6 +109,7 @@ class Softphone {
109
109
  wrapUpDuration,
110
110
  enableAgent = true,
111
111
  tenantId,
112
+ domainName,
112
113
  debug = false,
113
114
  } = {}) {
114
115
  this.url = url || 'https://softphone.wazo.io';
@@ -133,8 +134,12 @@ class Softphone {
133
134
  config.port = port;
134
135
  }
135
136
  if (tenantId) {
137
+ console.warn('Use of `tenantId` is deprecated when calling `Softphone.init()`, use `domainName` instead');
136
138
  config.tenantId = tenantId;
137
139
  }
140
+ if (domainName) {
141
+ config.domainName = domainName;
142
+ }
138
143
  if (wrapUpDuration) {
139
144
  config.wrapUpDuration = wrapUpDuration;
140
145
  }