@wazo/sdk 0.37.1 → 0.37.2

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 (105) hide show
  1. package/dist/wazo-sdk.js +5 -5
  2. package/esm/__tests__/api-client.test.js +7 -1
  3. package/esm/__tests__/web-rtc-client.test.js +13 -1
  4. package/esm/api/agentd.js +7 -1
  5. package/esm/api/amid.js +7 -1
  6. package/esm/api/application.js +7 -1
  7. package/esm/api/auth.js +7 -1
  8. package/esm/api/call-logd.js +7 -1
  9. package/esm/api/calld.js +7 -1
  10. package/esm/api/chatd.js +7 -1
  11. package/esm/api/confd.js +7 -1
  12. package/esm/api/ctid-ng.js +7 -1
  13. package/esm/api/dird.js +7 -1
  14. package/esm/api/webhookd.js +7 -1
  15. package/esm/api-client.js +7 -1
  16. package/esm/checker/Checker.js +13 -1
  17. package/esm/checker/checks/aor.js +7 -1
  18. package/esm/checker/checks/api.js +7 -1
  19. package/esm/checker/checks/index.js +13 -1
  20. package/esm/checker/checks/wazo-websocket.js +7 -1
  21. package/esm/checker/checks/webrtc-transport.js +13 -1
  22. package/esm/checker/checks/webrtc.js +13 -1
  23. package/esm/domain/AdHocAPIConference.js +7 -1
  24. package/esm/domain/Features.js +7 -1
  25. package/esm/domain/Phone/CTIPhone.js +11 -1
  26. package/esm/domain/Phone/WebRTCPhone.js +7 -1
  27. package/esm/index.js +5648 -5229
  28. package/esm/lib/WazoSessionDescriptionHandler.js +7 -1
  29. package/esm/service/CallApi.js +7 -1
  30. package/esm/service/IssueReporter.js +7 -1
  31. package/esm/service/__tests__/IssueReporter.test.js +9 -1
  32. package/esm/service/getApiClient.js +7 -1
  33. package/esm/simple/Auth.js +426 -9
  34. package/esm/simple/Configuration.js +426 -9
  35. package/esm/simple/Directory.js +7 -1
  36. package/esm/simple/Phone.js +426 -9
  37. package/esm/simple/Websocket.js +7 -1
  38. package/esm/simple/index.js +426 -9
  39. package/esm/simple/room/LocalParticipant.js +426 -9
  40. package/esm/simple/room/Participant.js +426 -9
  41. package/esm/simple/room/RemoteParticipant.js +426 -9
  42. package/esm/simple/room/Room.js +426 -9
  43. package/esm/simple/room/Stream.js +426 -9
  44. package/esm/simple/room/__tests__/RemoteParticipant.test.js +426 -9
  45. package/esm/simple/utils.js +426 -9
  46. package/esm/utils/__tests__/api-requester.test.js +7 -1
  47. package/esm/utils/api-requester.js +7 -1
  48. package/esm/web-rtc-client.js +13 -1
  49. package/esm/websocket-client.js +7 -1
  50. package/lib/__tests__/api-client.test.js +7 -1
  51. package/lib/__tests__/web-rtc-client.test.js +13 -1
  52. package/lib/api/agentd.js +7 -1
  53. package/lib/api/amid.js +7 -1
  54. package/lib/api/application.js +7 -1
  55. package/lib/api/auth.js +7 -1
  56. package/lib/api/call-logd.js +7 -1
  57. package/lib/api/calld.js +7 -1
  58. package/lib/api/chatd.js +7 -1
  59. package/lib/api/confd.js +7 -1
  60. package/lib/api/ctid-ng.js +7 -1
  61. package/lib/api/dird.js +7 -1
  62. package/lib/api/webhookd.js +7 -1
  63. package/lib/api-client.js +7 -1
  64. package/lib/checker/Checker.js +13 -1
  65. package/lib/checker/checks/aor.js +7 -1
  66. package/lib/checker/checks/api.js +7 -1
  67. package/lib/checker/checks/index.js +13 -1
  68. package/lib/checker/checks/wazo-websocket.js +7 -1
  69. package/lib/checker/checks/webrtc-transport.js +13 -1
  70. package/lib/checker/checks/webrtc.js +13 -1
  71. package/lib/domain/AdHocAPIConference.js +7 -1
  72. package/lib/domain/Features.js +7 -1
  73. package/lib/domain/Phone/CTIPhone.js +11 -1
  74. package/lib/domain/Phone/WebRTCPhone.js +7 -1
  75. package/lib/index.js +5648 -5229
  76. package/lib/lib/WazoSessionDescriptionHandler.js +7 -1
  77. package/lib/service/CallApi.js +7 -1
  78. package/lib/service/IssueReporter.js +7 -1
  79. package/lib/service/__tests__/IssueReporter.test.js +9 -1
  80. package/lib/service/getApiClient.js +7 -1
  81. package/lib/simple/Auth.js +426 -9
  82. package/lib/simple/Configuration.js +426 -9
  83. package/lib/simple/Directory.js +7 -1
  84. package/lib/simple/Phone.js +426 -9
  85. package/lib/simple/Websocket.js +7 -1
  86. package/lib/simple/index.js +426 -9
  87. package/lib/simple/room/LocalParticipant.js +426 -9
  88. package/lib/simple/room/Participant.js +426 -9
  89. package/lib/simple/room/RemoteParticipant.js +426 -9
  90. package/lib/simple/room/Room.js +426 -9
  91. package/lib/simple/room/Stream.js +426 -9
  92. package/lib/simple/room/__tests__/RemoteParticipant.test.js +426 -9
  93. package/lib/simple/utils.js +426 -9
  94. package/lib/utils/__tests__/api-requester.test.js +7 -1
  95. package/lib/utils/api-requester.js +7 -1
  96. package/lib/web-rtc-client.js +13 -1
  97. package/lib/websocket-client.js +7 -1
  98. package/package.json +1 -1
  99. package/src/domain/Phone/CTIPhone.js +4 -0
  100. package/src/domain/Phone/Phone.js +2 -0
  101. package/src/index.js +4 -0
  102. package/src/service/IssueReporter.js +7 -1
  103. package/src/service/__tests__/IssueReporter.test.js +2 -0
  104. package/src/simple/index.js +4 -0
  105. package/src/web-rtc-client.js +6 -0
package/lib/api/auth.js CHANGED
@@ -314,7 +314,13 @@ class IssueReporter {
314
314
  }
315
315
 
316
316
  _isLevelAbove(level1 , level2 ) {
317
- return LOG_LEVELS.indexOf(level1) > LOG_LEVELS.indexOf(level2);
317
+ const index1 = LOG_LEVELS.indexOf(level1);
318
+ const index2 = LOG_LEVELS.indexOf(level2);
319
+ if (index1 === -1 || index2 === -1) {
320
+ return false;
321
+ }
322
+
323
+ return index1 > index2;
318
324
  }
319
325
 
320
326
  _makeCategory(category ) {
@@ -251,7 +251,13 @@ class IssueReporter {
251
251
  }
252
252
 
253
253
  _isLevelAbove(level1 , level2 ) {
254
- return LOG_LEVELS.indexOf(level1) > LOG_LEVELS.indexOf(level2);
254
+ const index1 = LOG_LEVELS.indexOf(level1);
255
+ const index2 = LOG_LEVELS.indexOf(level2);
256
+ if (index1 === -1 || index2 === -1) {
257
+ return false;
258
+ }
259
+
260
+ return index1 > index2;
255
261
  }
256
262
 
257
263
  _makeCategory(category ) {
package/lib/api/calld.js CHANGED
@@ -312,7 +312,13 @@ class IssueReporter {
312
312
  }
313
313
 
314
314
  _isLevelAbove(level1 , level2 ) {
315
- return LOG_LEVELS.indexOf(level1) > LOG_LEVELS.indexOf(level2);
315
+ const index1 = LOG_LEVELS.indexOf(level1);
316
+ const index2 = LOG_LEVELS.indexOf(level2);
317
+ if (index1 === -1 || index2 === -1) {
318
+ return false;
319
+ }
320
+
321
+ return index1 > index2;
316
322
  }
317
323
 
318
324
  _makeCategory(category ) {
package/lib/api/chatd.js CHANGED
@@ -311,7 +311,13 @@ class IssueReporter {
311
311
  }
312
312
 
313
313
  _isLevelAbove(level1 , level2 ) {
314
- return LOG_LEVELS.indexOf(level1) > LOG_LEVELS.indexOf(level2);
314
+ const index1 = LOG_LEVELS.indexOf(level1);
315
+ const index2 = LOG_LEVELS.indexOf(level2);
316
+ if (index1 === -1 || index2 === -1) {
317
+ return false;
318
+ }
319
+
320
+ return index1 > index2;
315
321
  }
316
322
 
317
323
  _makeCategory(category ) {
package/lib/api/confd.js CHANGED
@@ -311,7 +311,13 @@ class IssueReporter {
311
311
  }
312
312
 
313
313
  _isLevelAbove(level1 , level2 ) {
314
- return LOG_LEVELS.indexOf(level1) > LOG_LEVELS.indexOf(level2);
314
+ const index1 = LOG_LEVELS.indexOf(level1);
315
+ const index2 = LOG_LEVELS.indexOf(level2);
316
+ if (index1 === -1 || index2 === -1) {
317
+ return false;
318
+ }
319
+
320
+ return index1 > index2;
315
321
  }
316
322
 
317
323
  _makeCategory(category ) {
@@ -315,7 +315,13 @@ class IssueReporter {
315
315
  }
316
316
 
317
317
  _isLevelAbove(level1 , level2 ) {
318
- return LOG_LEVELS.indexOf(level1) > LOG_LEVELS.indexOf(level2);
318
+ const index1 = LOG_LEVELS.indexOf(level1);
319
+ const index2 = LOG_LEVELS.indexOf(level2);
320
+ if (index1 === -1 || index2 === -1) {
321
+ return false;
322
+ }
323
+
324
+ return index1 > index2;
319
325
  }
320
326
 
321
327
  _makeCategory(category ) {
package/lib/api/dird.js CHANGED
@@ -313,7 +313,13 @@ class IssueReporter {
313
313
  }
314
314
 
315
315
  _isLevelAbove(level1 , level2 ) {
316
- return LOG_LEVELS.indexOf(level1) > LOG_LEVELS.indexOf(level2);
316
+ const index1 = LOG_LEVELS.indexOf(level1);
317
+ const index2 = LOG_LEVELS.indexOf(level2);
318
+ if (index1 === -1 || index2 === -1) {
319
+ return false;
320
+ }
321
+
322
+ return index1 > index2;
317
323
  }
318
324
 
319
325
  _makeCategory(category ) {
@@ -250,7 +250,13 @@ class IssueReporter {
250
250
  }
251
251
 
252
252
  _isLevelAbove(level1 , level2 ) {
253
- return LOG_LEVELS.indexOf(level1) > LOG_LEVELS.indexOf(level2);
253
+ const index1 = LOG_LEVELS.indexOf(level1);
254
+ const index2 = LOG_LEVELS.indexOf(level2);
255
+ if (index1 === -1 || index2 === -1) {
256
+ return false;
257
+ }
258
+
259
+ return index1 > index2;
254
260
  }
255
261
 
256
262
  _makeCategory(category ) {
package/lib/api-client.js CHANGED
@@ -315,7 +315,13 @@ class IssueReporter {
315
315
  }
316
316
 
317
317
  _isLevelAbove(level1 , level2 ) {
318
- return LOG_LEVELS.indexOf(level1) > LOG_LEVELS.indexOf(level2);
318
+ const index1 = LOG_LEVELS.indexOf(level1);
319
+ const index2 = LOG_LEVELS.indexOf(level2);
320
+ if (index1 === -1 || index2 === -1) {
321
+ return false;
322
+ }
323
+
324
+ return index1 > index2;
319
325
  }
320
326
 
321
327
  _makeCategory(category ) {
@@ -337,7 +337,13 @@ class IssueReporter {
337
337
  }
338
338
 
339
339
  _isLevelAbove(level1 , level2 ) {
340
- return LOG_LEVELS.indexOf(level1) > LOG_LEVELS.indexOf(level2);
340
+ const index1 = LOG_LEVELS.indexOf(level1);
341
+ const index2 = LOG_LEVELS.indexOf(level2);
342
+ if (index1 === -1 || index2 === -1) {
343
+ return false;
344
+ }
345
+
346
+ return index1 > index2;
341
347
  }
342
348
 
343
349
  _makeCategory(category ) {
@@ -6281,6 +6287,9 @@ class WebRTCClient extends Emitter {
6281
6287
  if (!this._isWeb()) {
6282
6288
  options.sessionDescriptionHandlerModifiers = [modifiers.holdModifier];
6283
6289
  }
6290
+ options.sessionDescriptionHandlerOptions = {
6291
+ constraints: options.constraints,
6292
+ };
6284
6293
 
6285
6294
  // Send re-INVITE
6286
6295
  return session.invite(options);
@@ -6320,6 +6329,9 @@ class WebRTCClient extends Emitter {
6320
6329
  // (eg: holdModifier)
6321
6330
  options.sessionDescriptionHandlerModifiers = [];
6322
6331
  }
6332
+ options.sessionDescriptionHandlerOptions = {
6333
+ constraints: options.constraints,
6334
+ };
6323
6335
 
6324
6336
  // Send re-INVITE
6325
6337
  return session.invite(options);
@@ -315,7 +315,13 @@ class IssueReporter {
315
315
  }
316
316
 
317
317
  _isLevelAbove(level1 , level2 ) {
318
- return LOG_LEVELS.indexOf(level1) > LOG_LEVELS.indexOf(level2);
318
+ const index1 = LOG_LEVELS.indexOf(level1);
319
+ const index2 = LOG_LEVELS.indexOf(level2);
320
+ if (index1 === -1 || index2 === -1) {
321
+ return false;
322
+ }
323
+
324
+ return index1 > index2;
319
325
  }
320
326
 
321
327
  _makeCategory(category ) {
@@ -315,7 +315,13 @@ class IssueReporter {
315
315
  }
316
316
 
317
317
  _isLevelAbove(level1 , level2 ) {
318
- return LOG_LEVELS.indexOf(level1) > LOG_LEVELS.indexOf(level2);
318
+ const index1 = LOG_LEVELS.indexOf(level1);
319
+ const index2 = LOG_LEVELS.indexOf(level2);
320
+ if (index1 === -1 || index2 === -1) {
321
+ return false;
322
+ }
323
+
324
+ return index1 > index2;
319
325
  }
320
326
 
321
327
  _makeCategory(category ) {
@@ -337,7 +337,13 @@ class IssueReporter {
337
337
  }
338
338
 
339
339
  _isLevelAbove(level1 , level2 ) {
340
- return LOG_LEVELS.indexOf(level1) > LOG_LEVELS.indexOf(level2);
340
+ const index1 = LOG_LEVELS.indexOf(level1);
341
+ const index2 = LOG_LEVELS.indexOf(level2);
342
+ if (index1 === -1 || index2 === -1) {
343
+ return false;
344
+ }
345
+
346
+ return index1 > index2;
341
347
  }
342
348
 
343
349
  _makeCategory(category ) {
@@ -6281,6 +6287,9 @@ class WebRTCClient extends Emitter {
6281
6287
  if (!this._isWeb()) {
6282
6288
  options.sessionDescriptionHandlerModifiers = [modifiers.holdModifier];
6283
6289
  }
6290
+ options.sessionDescriptionHandlerOptions = {
6291
+ constraints: options.constraints,
6292
+ };
6284
6293
 
6285
6294
  // Send re-INVITE
6286
6295
  return session.invite(options);
@@ -6320,6 +6329,9 @@ class WebRTCClient extends Emitter {
6320
6329
  // (eg: holdModifier)
6321
6330
  options.sessionDescriptionHandlerModifiers = [];
6322
6331
  }
6332
+ options.sessionDescriptionHandlerOptions = {
6333
+ constraints: options.constraints,
6334
+ };
6323
6335
 
6324
6336
  // Send re-INVITE
6325
6337
  return session.invite(options);
@@ -308,7 +308,13 @@ class IssueReporter {
308
308
  }
309
309
 
310
310
  _isLevelAbove(level1 , level2 ) {
311
- return LOG_LEVELS.indexOf(level1) > LOG_LEVELS.indexOf(level2);
311
+ const index1 = LOG_LEVELS.indexOf(level1);
312
+ const index2 = LOG_LEVELS.indexOf(level2);
313
+ if (index1 === -1 || index2 === -1) {
314
+ return false;
315
+ }
316
+
317
+ return index1 > index2;
312
318
  }
313
319
 
314
320
  _makeCategory(category ) {
@@ -600,7 +600,13 @@ class IssueReporter {
600
600
  }
601
601
 
602
602
  _isLevelAbove(level1 , level2 ) {
603
- return LOG_LEVELS.indexOf(level1) > LOG_LEVELS.indexOf(level2);
603
+ const index1 = LOG_LEVELS.indexOf(level1);
604
+ const index2 = LOG_LEVELS.indexOf(level2);
605
+ if (index1 === -1 || index2 === -1) {
606
+ return false;
607
+ }
608
+
609
+ return index1 > index2;
604
610
  }
605
611
 
606
612
  _makeCategory(category ) {
@@ -5701,6 +5707,9 @@ class WebRTCClient extends Emitter {
5701
5707
  if (!this._isWeb()) {
5702
5708
  options.sessionDescriptionHandlerModifiers = [modifiers.holdModifier];
5703
5709
  }
5710
+ options.sessionDescriptionHandlerOptions = {
5711
+ constraints: options.constraints,
5712
+ };
5704
5713
 
5705
5714
  // Send re-INVITE
5706
5715
  return session.invite(options);
@@ -5740,6 +5749,9 @@ class WebRTCClient extends Emitter {
5740
5749
  // (eg: holdModifier)
5741
5750
  options.sessionDescriptionHandlerModifiers = [];
5742
5751
  }
5752
+ options.sessionDescriptionHandlerOptions = {
5753
+ constraints: options.constraints,
5754
+ };
5743
5755
 
5744
5756
  // Send re-INVITE
5745
5757
  return session.invite(options);
@@ -600,7 +600,13 @@ class IssueReporter {
600
600
  }
601
601
 
602
602
  _isLevelAbove(level1 , level2 ) {
603
- return LOG_LEVELS.indexOf(level1) > LOG_LEVELS.indexOf(level2);
603
+ const index1 = LOG_LEVELS.indexOf(level1);
604
+ const index2 = LOG_LEVELS.indexOf(level2);
605
+ if (index1 === -1 || index2 === -1) {
606
+ return false;
607
+ }
608
+
609
+ return index1 > index2;
604
610
  }
605
611
 
606
612
  _makeCategory(category ) {
@@ -5701,6 +5707,9 @@ class WebRTCClient extends Emitter {
5701
5707
  if (!this._isWeb()) {
5702
5708
  options.sessionDescriptionHandlerModifiers = [modifiers.holdModifier];
5703
5709
  }
5710
+ options.sessionDescriptionHandlerOptions = {
5711
+ constraints: options.constraints,
5712
+ };
5704
5713
 
5705
5714
  // Send re-INVITE
5706
5715
  return session.invite(options);
@@ -5740,6 +5749,9 @@ class WebRTCClient extends Emitter {
5740
5749
  // (eg: holdModifier)
5741
5750
  options.sessionDescriptionHandlerModifiers = [];
5742
5751
  }
5752
+ options.sessionDescriptionHandlerOptions = {
5753
+ constraints: options.constraints,
5754
+ };
5743
5755
 
5744
5756
  // Send re-INVITE
5745
5757
  return session.invite(options);
@@ -532,7 +532,13 @@ class IssueReporter {
532
532
  }
533
533
 
534
534
  _isLevelAbove(level1 , level2 ) {
535
- return LOG_LEVELS.indexOf(level1) > LOG_LEVELS.indexOf(level2);
535
+ const index1 = LOG_LEVELS.indexOf(level1);
536
+ const index2 = LOG_LEVELS.indexOf(level2);
537
+ if (index1 === -1 || index2 === -1) {
538
+ return false;
539
+ }
540
+
541
+ return index1 > index2;
536
542
  }
537
543
 
538
544
  _makeCategory(category ) {
@@ -317,7 +317,13 @@ class IssueReporter {
317
317
  }
318
318
 
319
319
  _isLevelAbove(level1 , level2 ) {
320
- return LOG_LEVELS.indexOf(level1) > LOG_LEVELS.indexOf(level2);
320
+ const index1 = LOG_LEVELS.indexOf(level1);
321
+ const index2 = LOG_LEVELS.indexOf(level2);
322
+ if (index1 === -1 || index2 === -1) {
323
+ return false;
324
+ }
325
+
326
+ return index1 > index2;
321
327
  }
322
328
 
323
329
  _makeCategory(category ) {
@@ -2685,7 +2685,13 @@ class IssueReporter {
2685
2685
  }
2686
2686
 
2687
2687
  _isLevelAbove(level1 , level2 ) {
2688
- return LOG_LEVELS.indexOf(level1) > LOG_LEVELS.indexOf(level2);
2688
+ const index1 = LOG_LEVELS.indexOf(level1);
2689
+ const index2 = LOG_LEVELS.indexOf(level2);
2690
+ if (index1 === -1 || index2 === -1) {
2691
+ return false;
2692
+ }
2693
+
2694
+ return index1 > index2;
2689
2695
  }
2690
2696
 
2691
2697
  _makeCategory(category ) {
@@ -5168,6 +5174,10 @@ class CTIPhone extends Emitter {
5168
5174
  return null;
5169
5175
  }
5170
5176
 
5177
+ getLocalVideoStream() {
5178
+ return null;
5179
+ }
5180
+
5171
5181
  setActiveSipSession() {}
5172
5182
 
5173
5183
  isRegistered() {
@@ -662,7 +662,13 @@ class IssueReporter {
662
662
  }
663
663
 
664
664
  _isLevelAbove(level1 , level2 ) {
665
- return LOG_LEVELS.indexOf(level1) > LOG_LEVELS.indexOf(level2);
665
+ const index1 = LOG_LEVELS.indexOf(level1);
666
+ const index2 = LOG_LEVELS.indexOf(level2);
667
+ if (index1 === -1 || index2 === -1) {
668
+ return false;
669
+ }
670
+
671
+ return index1 > index2;
666
672
  }
667
673
 
668
674
  _makeCategory(category ) {