@wazo/sdk 0.38.13 → 0.38.16

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 (70) hide show
  1. package/dist/wazo-sdk.js +2 -2
  2. package/esm/__tests__/api-client.test.js +5 -0
  3. package/esm/__tests__/web-rtc-client.test.js +12 -0
  4. package/esm/api/dird.js +5 -0
  5. package/esm/api-client.js +5 -0
  6. package/esm/checker/Checker.js +12 -0
  7. package/esm/checker/checks/aor.js +5 -0
  8. package/esm/checker/checks/api.js +5 -0
  9. package/esm/checker/checks/index.js +12 -0
  10. package/esm/checker/checks/webrtc-transport.js +12 -0
  11. package/esm/checker/checks/webrtc.js +12 -0
  12. package/esm/domain/AdHocAPIConference.js +5 -0
  13. package/esm/domain/Features.js +5 -0
  14. package/esm/domain/Phone/CTIPhone.js +7 -0
  15. package/esm/index.js +22 -3
  16. package/esm/service/CallApi.js +5 -0
  17. package/esm/service/getApiClient.js +5 -0
  18. package/esm/simple/Auth.js +22 -3
  19. package/esm/simple/Configuration.js +22 -3
  20. package/esm/simple/Directory.js +5 -0
  21. package/esm/simple/Phone.js +22 -3
  22. package/esm/simple/index.js +22 -3
  23. package/esm/simple/room/LocalParticipant.js +5528 -5509
  24. package/esm/simple/room/Participant.js +5531 -5512
  25. package/esm/simple/room/RemoteParticipant.js +22 -3
  26. package/esm/simple/room/Room.js +22 -3
  27. package/esm/simple/room/SipRoom.js +22 -3
  28. package/esm/simple/room/Stream.js +22 -3
  29. package/esm/simple/room/__tests__/Participant.test.js +22 -3
  30. package/esm/simple/room/__tests__/RemoteParticipant.test.js +22 -3
  31. package/esm/simple/utils.js +22 -3
  32. package/esm/web-rtc-client.js +12 -0
  33. package/lib/__tests__/api-client.test.js +5 -0
  34. package/lib/__tests__/web-rtc-client.test.js +12 -0
  35. package/lib/api/dird.js +5 -0
  36. package/lib/api-client.js +5 -0
  37. package/lib/checker/Checker.js +12 -0
  38. package/lib/checker/checks/aor.js +5 -0
  39. package/lib/checker/checks/api.js +5 -0
  40. package/lib/checker/checks/index.js +12 -0
  41. package/lib/checker/checks/webrtc-transport.js +12 -0
  42. package/lib/checker/checks/webrtc.js +12 -0
  43. package/lib/domain/AdHocAPIConference.js +5 -0
  44. package/lib/domain/Features.js +5 -0
  45. package/lib/domain/Phone/CTIPhone.js +7 -0
  46. package/lib/index.js +22 -3
  47. package/lib/service/CallApi.js +5 -0
  48. package/lib/service/getApiClient.js +5 -0
  49. package/lib/simple/Auth.js +22 -3
  50. package/lib/simple/Configuration.js +22 -3
  51. package/lib/simple/Directory.js +5 -0
  52. package/lib/simple/Phone.js +22 -3
  53. package/lib/simple/index.js +22 -3
  54. package/lib/simple/room/LocalParticipant.js +6444 -6425
  55. package/lib/simple/room/Participant.js +6447 -6428
  56. package/lib/simple/room/RemoteParticipant.js +22 -3
  57. package/lib/simple/room/Room.js +22 -3
  58. package/lib/simple/room/SipRoom.js +22 -3
  59. package/lib/simple/room/Stream.js +22 -3
  60. package/lib/simple/room/__tests__/Participant.test.js +22 -3
  61. package/lib/simple/room/__tests__/RemoteParticipant.test.js +22 -3
  62. package/lib/simple/utils.js +22 -3
  63. package/lib/web-rtc-client.js +12 -0
  64. package/package.json +1 -1
  65. package/src/api/dird.js +5 -0
  66. package/src/domain/Phone/CTIPhone.js +2 -0
  67. package/src/domain/Phone/Phone.js +2 -0
  68. package/src/simple/room/Participant.js +7 -1
  69. package/src/simple/room/Room.js +2 -2
  70. package/src/web-rtc-client.js +7 -0
@@ -4606,6 +4606,8 @@ class CTIPhone extends Emitter {
4606
4606
  }
4607
4607
 
4608
4608
  useLocalVideoElement() {}
4609
+
4610
+ setMediaConstraints() {}
4609
4611
  }
4610
4612
 
4611
4613
  /* */
@@ -4783,6 +4785,11 @@ var dirdMethods = (client , baseUrl ) => ({
4783
4785
  listPersonalContacts: (queryParams = null) =>
4784
4786
  client.get(`${baseUrl}/personal`, queryParams).then(response => Contact.parseManyPersonal(response.items)),
4785
4787
 
4788
+ fetchPersonalContact: (contactUuid ) =>
4789
+ client
4790
+ .get(`${baseUrl}/personal/${contactUuid}`)
4791
+ .then(Contact.parsePersonal),
4792
+
4786
4793
  addContact: (contact ) =>
4787
4794
  client.post(`${baseUrl}/personal`, getContactPayload(contact)).then(Contact.parsePersonal),
4788
4795
 
@@ -7196,6 +7203,12 @@ class WebRTCClient extends Emitter {
7196
7203
  };
7197
7204
 
7198
7205
  const ua = new UserAgent(webRTCConfiguration);
7206
+ if (ua.transport && ua.transport.connectPromise) {
7207
+ ua.transport.connectPromise.catch((e => {
7208
+ logger$8.warn('Transport connect error', e);
7209
+ }));
7210
+ }
7211
+
7199
7212
  ua.transport.onMessage = (rawMessage ) => {
7200
7213
  const message = Parser.parseMessage(rawMessage, ua.transport.logger);
7201
7214
 
@@ -7417,6 +7430,7 @@ class WebRTCClient extends Emitter {
7417
7430
  conference,
7418
7431
  audioOnly,
7419
7432
  },
7433
+ earlyMedia: true,
7420
7434
  };
7421
7435
 
7422
7436
  if (audioOnly) {
@@ -12292,10 +12306,15 @@ class Participant extends Emitter {
12292
12306
  }
12293
12307
  }
12294
12308
 
12295
- broadcastStatus(inboundStatus = null) {
12309
+ broadcastStatus(inboundStatus = null, sendReinvite ) {
12296
12310
  const status = inboundStatus || this.getStatus();
12297
12311
  logger$3.info('broadcasting participant status', { callId: this.callId, status });
12298
12312
 
12313
+ if (sendReinvite && !this.streams.length && Phone$1.phone) {
12314
+ // eslint-disable-next-line no-underscore-dangle
12315
+ Phone$1.phone._sendReinviteMessage(this.room.callSession, false);
12316
+ }
12317
+
12299
12318
  this.room.sendSignal({
12300
12319
  type: SIGNAL_TYPE_PARTICIPANT_UPDATE,
12301
12320
  origin: this.callId,
@@ -12938,7 +12957,7 @@ class Room$1 extends Emitter {
12938
12957
  // callId is null, someone's requesting everyone's state;
12939
12958
  // or callId is set and matches ours;
12940
12959
  if (this.localParticipant && (!callId || callId === this.localParticipant.callId)) {
12941
- this.localParticipant.broadcastStatus();
12960
+ this.localParticipant.broadcastStatus(null, true);
12942
12961
  }
12943
12962
 
12944
12963
  // might as well update the requester's status
@@ -13040,7 +13059,7 @@ class Room$1 extends Emitter {
13040
13059
 
13041
13060
  this.connected = true;
13042
13061
 
13043
- localParticipant.broadcastStatus();
13062
+ localParticipant.broadcastStatus(null, true);
13044
13063
 
13045
13064
  // we're in the room, now let's request everyone's status
13046
13065
  if (this.localParticipant) {