@wazo/sdk 0.37.24 → 0.37.28

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 (129) hide show
  1. package/README.md +96 -58
  2. package/dist/wazo-sdk.js +6 -6
  3. package/esm/__tests__/api-client.test.js +14 -14
  4. package/esm/__tests__/web-rtc-client.test.js +130 -108
  5. package/esm/api/agentd.js +1 -1
  6. package/esm/api/amid.js +2 -2
  7. package/esm/api/application.js +1 -1
  8. package/esm/api/auth.js +1 -1
  9. package/esm/api/call-logd.js +3 -3
  10. package/esm/api/calld.js +1 -1
  11. package/esm/api/chatd.js +1 -1
  12. package/esm/api/confd.js +1 -1
  13. package/esm/api/ctid-ng.js +4 -4
  14. package/esm/api/dird.js +3 -3
  15. package/esm/api/webhookd.js +2 -2
  16. package/esm/api-client.js +14 -14
  17. package/esm/checker/Checker.js +155 -133
  18. package/esm/checker/checks/aor.js +14 -14
  19. package/esm/checker/checks/api.js +14 -14
  20. package/esm/checker/checks/index.js +145 -123
  21. package/esm/checker/checks/wazo-websocket.js +16 -16
  22. package/esm/checker/checks/webrtc-transport.js +130 -108
  23. package/esm/checker/checks/webrtc.js +130 -108
  24. package/esm/domain/AdHocAPIConference.js +14 -14
  25. package/esm/domain/CallLog.js +1 -1
  26. package/esm/domain/CallSession.js +15 -0
  27. package/esm/domain/Contact.js +2 -2
  28. package/esm/domain/Features.js +14 -14
  29. package/esm/domain/Phone/CTIPhone.js +43 -28
  30. package/esm/domain/Phone/WebRTCPhone.js +126 -90
  31. package/esm/domain/SFUNotAvailableError.js +9 -0
  32. package/esm/domain/__tests__/CallLog.test.js +1 -1
  33. package/esm/domain/__tests__/CallSession.test.js +15 -0
  34. package/esm/domain/__tests__/Contact.test.js +2 -2
  35. package/esm/domain/__tests__/IndirectTransfer.test.js +15 -0
  36. package/esm/domain/__tests__/Room.test.js +15 -0
  37. package/esm/index.js +415 -346
  38. package/esm/lib/WazoSessionDescriptionHandler.js +10 -5
  39. package/esm/service/CallApi.js +14 -14
  40. package/esm/service/IssueReporter.js +2 -2
  41. package/esm/service/__tests__/IssueReporter.test.js +2 -2
  42. package/esm/service/getApiClient.js +14 -14
  43. package/esm/simple/Auth.js +404 -336
  44. package/esm/simple/Configuration.js +404 -336
  45. package/esm/simple/Directory.js +14 -14
  46. package/esm/simple/Phone.js +404 -336
  47. package/esm/simple/Websocket.js +18 -18
  48. package/esm/simple/index.js +408 -340
  49. package/esm/simple/room/LocalParticipant.js +408 -340
  50. package/esm/simple/room/Participant.js +408 -340
  51. package/esm/simple/room/RemoteParticipant.js +408 -340
  52. package/esm/simple/room/Room.js +409 -341
  53. package/esm/simple/room/SipRoom.js +408 -340
  54. package/esm/simple/room/Stream.js +408 -340
  55. package/esm/simple/room/__tests__/RemoteParticipant.test.js +408 -340
  56. package/esm/simple/utils.js +408 -340
  57. package/esm/utils/__tests__/api-requester.test.js +1 -1
  58. package/esm/utils/api-requester.js +1 -1
  59. package/esm/web-rtc-client.js +130 -108
  60. package/esm/websocket-client.js +16 -16
  61. package/lib/__tests__/api-client.test.js +14 -14
  62. package/lib/__tests__/web-rtc-client.test.js +130 -108
  63. package/lib/api/agentd.js +1 -1
  64. package/lib/api/amid.js +2 -2
  65. package/lib/api/application.js +1 -1
  66. package/lib/api/auth.js +1 -1
  67. package/lib/api/call-logd.js +3 -3
  68. package/lib/api/calld.js +1 -1
  69. package/lib/api/chatd.js +1 -1
  70. package/lib/api/confd.js +1 -1
  71. package/lib/api/ctid-ng.js +4 -4
  72. package/lib/api/dird.js +3 -3
  73. package/lib/api/webhookd.js +2 -2
  74. package/lib/api-client.js +14 -14
  75. package/lib/checker/Checker.js +155 -133
  76. package/lib/checker/checks/aor.js +14 -14
  77. package/lib/checker/checks/api.js +14 -14
  78. package/lib/checker/checks/index.js +145 -123
  79. package/lib/checker/checks/wazo-websocket.js +16 -16
  80. package/lib/checker/checks/webrtc-transport.js +130 -108
  81. package/lib/checker/checks/webrtc.js +130 -108
  82. package/lib/domain/AdHocAPIConference.js +14 -14
  83. package/lib/domain/CallLog.js +1 -1
  84. package/lib/domain/CallSession.js +15 -0
  85. package/lib/domain/Contact.js +2 -2
  86. package/lib/domain/Features.js +14 -14
  87. package/lib/domain/Phone/CTIPhone.js +43 -28
  88. package/lib/domain/Phone/WebRTCPhone.js +126 -89
  89. package/lib/domain/SFUNotAvailableError.js +11 -0
  90. package/lib/domain/__tests__/CallLog.test.js +1 -1
  91. package/lib/domain/__tests__/CallSession.test.js +15 -0
  92. package/lib/domain/__tests__/Contact.test.js +2 -2
  93. package/lib/domain/__tests__/IndirectTransfer.test.js +15 -0
  94. package/lib/domain/__tests__/Room.test.js +15 -0
  95. package/lib/index.js +415 -346
  96. package/lib/lib/WazoSessionDescriptionHandler.js +10 -5
  97. package/lib/service/CallApi.js +14 -14
  98. package/lib/service/IssueReporter.js +2 -2
  99. package/lib/service/__tests__/IssueReporter.test.js +2 -2
  100. package/lib/service/getApiClient.js +14 -14
  101. package/lib/simple/Auth.js +404 -336
  102. package/lib/simple/Configuration.js +404 -336
  103. package/lib/simple/Directory.js +14 -14
  104. package/lib/simple/Phone.js +404 -336
  105. package/lib/simple/Websocket.js +18 -18
  106. package/lib/simple/index.js +408 -340
  107. package/lib/simple/room/LocalParticipant.js +408 -340
  108. package/lib/simple/room/Participant.js +408 -340
  109. package/lib/simple/room/RemoteParticipant.js +408 -340
  110. package/lib/simple/room/Room.js +409 -341
  111. package/lib/simple/room/SipRoom.js +408 -340
  112. package/lib/simple/room/Stream.js +408 -340
  113. package/lib/simple/room/__tests__/RemoteParticipant.test.js +408 -340
  114. package/lib/simple/utils.js +408 -340
  115. package/lib/utils/__tests__/api-requester.test.js +1 -1
  116. package/lib/utils/api-requester.js +1 -1
  117. package/lib/web-rtc-client.js +130 -108
  118. package/lib/websocket-client.js +16 -16
  119. package/package.json +1 -1
  120. package/src/domain/CallSession.js +16 -0
  121. package/src/domain/Contact.js +1 -1
  122. package/src/domain/Phone/WebRTCPhone.js +25 -4
  123. package/src/domain/SFUNotAvailableError.js +7 -0
  124. package/src/index.js +2 -0
  125. package/src/lib/WazoSessionDescriptionHandler.js +8 -3
  126. package/src/simple/Phone.js +2 -1
  127. package/src/simple/index.js +2 -0
  128. package/src/utils/api-requester.js +1 -1
  129. package/src/web-rtc-client.js +27 -10
@@ -0,0 +1,9 @@
1
+ /* */
2
+ class SFUNotAvailableError extends Error {
3
+ constructor(message = 'Sorry your user is not configured to support video conference') {
4
+ super(message);
5
+ this.name = 'SFUNotAvailableError';
6
+ }
7
+ }
8
+
9
+ export default SFUNotAvailableError;
@@ -26,7 +26,7 @@ BwIDAQAB
26
26
 
27
27
  //
28
28
 
29
- const swarmKey = KEYUTIL.getKey(swarmPublicKey);
29
+ KEYUTIL.getKey(swarmPublicKey);
30
30
 
31
31
  //
32
32
 
@@ -37,8 +37,10 @@ var updateFrom = (instance , from ) => {
37
37
 
38
38
 
39
39
 
40
+
40
41
 
41
42
 
43
+
42
44
 
43
45
 
44
46
 
@@ -55,6 +57,7 @@ var updateFrom = (instance , from ) => {
55
57
 
56
58
 
57
59
 
60
+
58
61
 
59
62
 
60
63
  class CallSession {
@@ -74,8 +77,12 @@ class CallSession {
74
77
 
75
78
 
76
79
 
80
+
81
+
77
82
 
78
83
 
84
+
85
+
79
86
 
80
87
 
81
88
 
@@ -113,6 +120,8 @@ class CallSession {
113
120
 
114
121
 
115
122
 
123
+
124
+
116
125
 
117
126
  constructor({
118
127
  answered,
@@ -126,6 +135,8 @@ class CallSession {
126
135
  paused,
127
136
  ringing,
128
137
  startTime,
138
+ creationTime,
139
+ endTime,
129
140
  cameraEnabled,
130
141
  dialedExtension,
131
142
  sipCallId,
@@ -138,12 +149,15 @@ class CallSession {
138
149
  recording,
139
150
  recordingPaused,
140
151
  videoRemotelyDowngraded,
152
+ sipSession,
141
153
  } ) {
142
154
  this.callId = callId;
143
155
  this.sipCallId = sipCallId;
144
156
  this.displayName = displayName;
145
157
  this.number = number;
158
+ this.creationTime = creationTime;
146
159
  this.startTime = startTime;
160
+ this.endTime = endTime;
147
161
  this.isCaller = isCaller;
148
162
  this.answered = answered;
149
163
  this.answeredBySystem = answeredBySystem;
@@ -162,6 +176,7 @@ class CallSession {
162
176
  this.recording = recording || false;
163
177
  this.recordingPaused = recordingPaused || false;
164
178
  this.videoRemotelyDowngraded = videoRemotelyDowngraded;
179
+ this.sipSession = sipSession;
165
180
 
166
181
  // Useful to compare instead of instanceof with minified code
167
182
  this.type = 'CallSession';
@@ -44,7 +44,7 @@ const LINE_STATE = {
44
44
 
45
45
  //
46
46
 
47
- const swarmKey = KEYUTIL.getKey(swarmPublicKey);
47
+ KEYUTIL.getKey(swarmPublicKey);
48
48
 
49
49
  //
50
50
 
@@ -698,7 +698,7 @@ class Contact {
698
698
  this[key] = old[key] || this[key];
699
699
  });
700
700
 
701
- if (old.lineState && !this.lineState) {
701
+ if (old.lineState) {
702
702
  this.lineState = old.lineState;
703
703
  }
704
704
 
@@ -37,8 +37,10 @@ var updateFrom = (instance , from ) => {
37
37
 
38
38
 
39
39
 
40
+
40
41
 
41
42
 
43
+
42
44
 
43
45
 
44
46
 
@@ -55,6 +57,7 @@ var updateFrom = (instance , from ) => {
55
57
 
56
58
 
57
59
 
60
+
58
61
 
59
62
 
60
63
  class CallSession {
@@ -74,8 +77,12 @@ class CallSession {
74
77
 
75
78
 
76
79
 
80
+
81
+
77
82
 
78
83
 
84
+
85
+
79
86
 
80
87
 
81
88
 
@@ -113,6 +120,8 @@ class CallSession {
113
120
 
114
121
 
115
122
 
123
+
124
+
116
125
 
117
126
  constructor({
118
127
  answered,
@@ -126,6 +135,8 @@ class CallSession {
126
135
  paused,
127
136
  ringing,
128
137
  startTime,
138
+ creationTime,
139
+ endTime,
129
140
  cameraEnabled,
130
141
  dialedExtension,
131
142
  sipCallId,
@@ -138,12 +149,15 @@ class CallSession {
138
149
  recording,
139
150
  recordingPaused,
140
151
  videoRemotelyDowngraded,
152
+ sipSession,
141
153
  } ) {
142
154
  this.callId = callId;
143
155
  this.sipCallId = sipCallId;
144
156
  this.displayName = displayName;
145
157
  this.number = number;
158
+ this.creationTime = creationTime;
146
159
  this.startTime = startTime;
160
+ this.endTime = endTime;
147
161
  this.isCaller = isCaller;
148
162
  this.answered = answered;
149
163
  this.answeredBySystem = answeredBySystem;
@@ -162,6 +176,7 @@ class CallSession {
162
176
  this.recording = recording || false;
163
177
  this.recordingPaused = recordingPaused || false;
164
178
  this.videoRemotelyDowngraded = videoRemotelyDowngraded;
179
+ this.sipSession = sipSession;
165
180
 
166
181
  // Useful to compare instead of instanceof with minified code
167
182
  this.type = 'CallSession';
@@ -37,8 +37,10 @@ var updateFrom = (instance , from ) => {
37
37
 
38
38
 
39
39
 
40
+
40
41
 
41
42
 
43
+
42
44
 
43
45
 
44
46
 
@@ -55,6 +57,7 @@ var updateFrom = (instance , from ) => {
55
57
 
56
58
 
57
59
 
60
+
58
61
 
59
62
 
60
63
  class CallSession {
@@ -74,8 +77,12 @@ class CallSession {
74
77
 
75
78
 
76
79
 
80
+
81
+
77
82
 
78
83
 
84
+
85
+
79
86
 
80
87
 
81
88
 
@@ -113,6 +120,8 @@ class CallSession {
113
120
 
114
121
 
115
122
 
123
+
124
+
116
125
 
117
126
  constructor({
118
127
  answered,
@@ -126,6 +135,8 @@ class CallSession {
126
135
  paused,
127
136
  ringing,
128
137
  startTime,
138
+ creationTime,
139
+ endTime,
129
140
  cameraEnabled,
130
141
  dialedExtension,
131
142
  sipCallId,
@@ -138,12 +149,15 @@ class CallSession {
138
149
  recording,
139
150
  recordingPaused,
140
151
  videoRemotelyDowngraded,
152
+ sipSession,
141
153
  } ) {
142
154
  this.callId = callId;
143
155
  this.sipCallId = sipCallId;
144
156
  this.displayName = displayName;
145
157
  this.number = number;
158
+ this.creationTime = creationTime;
146
159
  this.startTime = startTime;
160
+ this.endTime = endTime;
147
161
  this.isCaller = isCaller;
148
162
  this.answered = answered;
149
163
  this.answeredBySystem = answeredBySystem;
@@ -162,6 +176,7 @@ class CallSession {
162
176
  this.recording = recording || false;
163
177
  this.recordingPaused = recordingPaused || false;
164
178
  this.videoRemotelyDowngraded = videoRemotelyDowngraded;
179
+ this.sipSession = sipSession;
165
180
 
166
181
  // Useful to compare instead of instanceof with minified code
167
182
  this.type = 'CallSession';