@wazo/sdk 0.37.42 → 0.37.43
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.
- package/dist/wazo-sdk.js +3 -3
- package/esm/__tests__/api-client.test.js +12 -7
- package/esm/__tests__/web-rtc-client.test.js +16 -9
- package/esm/api/agentd.js +12 -7
- package/esm/api/amid.js +12 -7
- package/esm/api/application.js +12 -7
- package/esm/api/auth.js +12 -7
- package/esm/api/call-logd.js +12 -7
- package/esm/api/calld.js +12 -7
- package/esm/api/chatd.js +12 -7
- package/esm/api/confd.js +12 -7
- package/esm/api/ctid-ng.js +12 -7
- package/esm/api/dird.js +12 -7
- package/esm/api/webhookd.js +12 -7
- package/esm/api-client.js +12 -7
- package/esm/checker/Checker.js +17 -10
- package/esm/checker/checks/aor.js +12 -7
- package/esm/checker/checks/api.js +12 -7
- package/esm/checker/checks/index.js +17 -10
- package/esm/checker/checks/wazo-websocket.js +13 -8
- package/esm/checker/checks/webrtc-transport.js +16 -9
- package/esm/checker/checks/webrtc.js +16 -9
- package/esm/domain/AdHocAPIConference.js +12 -7
- package/esm/domain/Features.js +12 -7
- package/esm/domain/Phone/CTIPhone.js +12 -7
- package/esm/domain/Phone/WebRTCPhone.js +12 -7
- package/esm/index.js +17 -10
- package/esm/lib/WazoSessionDescriptionHandler.js +12 -7
- package/esm/service/CallApi.js +12 -7
- package/esm/service/IssueReporter.js +12 -7
- package/esm/service/__tests__/IssueReporter.test.js +18 -7
- package/esm/service/getApiClient.js +12 -7
- package/esm/simple/Auth.js +17 -10
- package/esm/simple/Configuration.js +17 -10
- package/esm/simple/Directory.js +12 -7
- package/esm/simple/Phone.js +17 -10
- package/esm/simple/Websocket.js +13 -8
- package/esm/simple/index.js +17 -10
- package/esm/simple/room/LocalParticipant.js +17 -10
- package/esm/simple/room/Participant.js +17 -10
- package/esm/simple/room/RemoteParticipant.js +17 -10
- package/esm/simple/room/Room.js +17 -10
- package/esm/simple/room/SipRoom.js +17 -10
- package/esm/simple/room/Stream.js +17 -10
- package/esm/simple/room/__tests__/RemoteParticipant.test.js +17 -10
- package/esm/simple/utils.js +17 -10
- package/esm/utils/__tests__/api-requester.test.js +12 -7
- package/esm/utils/api-requester.js +12 -7
- package/esm/web-rtc-client.js +16 -9
- package/esm/websocket-client.js +13 -8
- package/lib/__tests__/api-client.test.js +12 -7
- package/lib/__tests__/web-rtc-client.test.js +16 -9
- package/lib/api/agentd.js +12 -7
- package/lib/api/amid.js +12 -7
- package/lib/api/application.js +12 -7
- package/lib/api/auth.js +12 -7
- package/lib/api/call-logd.js +12 -7
- package/lib/api/calld.js +12 -7
- package/lib/api/chatd.js +12 -7
- package/lib/api/confd.js +12 -7
- package/lib/api/ctid-ng.js +12 -7
- package/lib/api/dird.js +12 -7
- package/lib/api/webhookd.js +12 -7
- package/lib/api-client.js +12 -7
- package/lib/checker/Checker.js +17 -10
- package/lib/checker/checks/aor.js +12 -7
- package/lib/checker/checks/api.js +12 -7
- package/lib/checker/checks/index.js +17 -10
- package/lib/checker/checks/wazo-websocket.js +13 -8
- package/lib/checker/checks/webrtc-transport.js +16 -9
- package/lib/checker/checks/webrtc.js +16 -9
- package/lib/domain/AdHocAPIConference.js +12 -7
- package/lib/domain/Features.js +12 -7
- package/lib/domain/Phone/CTIPhone.js +12 -7
- package/lib/domain/Phone/WebRTCPhone.js +12 -7
- package/lib/index.js +17 -10
- package/lib/lib/WazoSessionDescriptionHandler.js +12 -7
- package/lib/service/CallApi.js +12 -7
- package/lib/service/IssueReporter.js +12 -7
- package/lib/service/__tests__/IssueReporter.test.js +18 -7
- package/lib/service/getApiClient.js +12 -7
- package/lib/simple/Auth.js +17 -10
- package/lib/simple/Configuration.js +17 -10
- package/lib/simple/Directory.js +12 -7
- package/lib/simple/Phone.js +17 -10
- package/lib/simple/Websocket.js +13 -8
- package/lib/simple/index.js +17 -10
- package/lib/simple/room/LocalParticipant.js +17 -10
- package/lib/simple/room/Participant.js +17 -10
- package/lib/simple/room/RemoteParticipant.js +17 -10
- package/lib/simple/room/Room.js +17 -10
- package/lib/simple/room/SipRoom.js +17 -10
- package/lib/simple/room/Stream.js +17 -10
- package/lib/simple/room/__tests__/RemoteParticipant.test.js +17 -10
- package/lib/simple/utils.js +17 -10
- package/lib/utils/__tests__/api-requester.test.js +12 -7
- package/lib/utils/api-requester.js +12 -7
- package/lib/web-rtc-client.js +16 -9
- package/lib/websocket-client.js +13 -8
- package/package.json +1 -1
- package/src/service/IssueReporter.js +12 -7
- package/src/service/__tests__/IssueReporter.test.js +6 -0
- package/src/web-rtc-client.js +4 -2
- package/src/websocket-client.js +1 -1
|
@@ -398,13 +398,9 @@ class IssueReporter {
|
|
|
398
398
|
|
|
399
399
|
setTimeout(() => {
|
|
400
400
|
if (isArray) {
|
|
401
|
-
payload = payload.map(message =>
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
});
|
|
405
|
-
} else {
|
|
406
|
-
// $FlowFixMe
|
|
407
|
-
payload._retry = retry + 1;
|
|
401
|
+
payload = payload.map(message => this._writeRetryCount(message, retry + 1));
|
|
402
|
+
} else if (payload && typeof payload === 'object') {
|
|
403
|
+
payload = this._writeRetryCount(payload, retry + 1);
|
|
408
404
|
}
|
|
409
405
|
|
|
410
406
|
this._sendDebugToGrafana(payload, retry + 1);
|
|
@@ -412,6 +408,15 @@ class IssueReporter {
|
|
|
412
408
|
});
|
|
413
409
|
}
|
|
414
410
|
|
|
411
|
+
_writeRetryCount(message , count ) {
|
|
412
|
+
if (message && typeof message === 'object') {
|
|
413
|
+
// $FlowFixMe
|
|
414
|
+
message._retry = count;
|
|
415
|
+
}
|
|
416
|
+
|
|
417
|
+
return message;
|
|
418
|
+
}
|
|
419
|
+
|
|
415
420
|
_isLevelAbove(level1 , level2 ) {
|
|
416
421
|
const index1 = LOG_LEVELS.indexOf(level1);
|
|
417
422
|
const index2 = LOG_LEVELS.indexOf(level2);
|
|
@@ -400,13 +400,9 @@ class IssueReporter {
|
|
|
400
400
|
|
|
401
401
|
setTimeout(() => {
|
|
402
402
|
if (isArray) {
|
|
403
|
-
payload = payload.map(message =>
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
});
|
|
407
|
-
} else {
|
|
408
|
-
// $FlowFixMe
|
|
409
|
-
payload._retry = retry + 1;
|
|
403
|
+
payload = payload.map(message => this._writeRetryCount(message, retry + 1));
|
|
404
|
+
} else if (payload && typeof payload === 'object') {
|
|
405
|
+
payload = this._writeRetryCount(payload, retry + 1);
|
|
410
406
|
}
|
|
411
407
|
|
|
412
408
|
this._sendDebugToGrafana(payload, retry + 1);
|
|
@@ -414,6 +410,15 @@ class IssueReporter {
|
|
|
414
410
|
});
|
|
415
411
|
}
|
|
416
412
|
|
|
413
|
+
_writeRetryCount(message , count ) {
|
|
414
|
+
if (message && typeof message === 'object') {
|
|
415
|
+
// $FlowFixMe
|
|
416
|
+
message._retry = count;
|
|
417
|
+
}
|
|
418
|
+
|
|
419
|
+
return message;
|
|
420
|
+
}
|
|
421
|
+
|
|
417
422
|
_isLevelAbove(level1 , level2 ) {
|
|
418
423
|
const index1 = LOG_LEVELS.indexOf(level1);
|
|
419
424
|
const index2 = LOG_LEVELS.indexOf(level2);
|
package/lib/web-rtc-client.js
CHANGED
|
@@ -689,13 +689,9 @@ class IssueReporter {
|
|
|
689
689
|
|
|
690
690
|
setTimeout(() => {
|
|
691
691
|
if (isArray) {
|
|
692
|
-
payload = payload.map(message =>
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
});
|
|
696
|
-
} else {
|
|
697
|
-
// $FlowFixMe
|
|
698
|
-
payload._retry = retry + 1;
|
|
692
|
+
payload = payload.map(message => this._writeRetryCount(message, retry + 1));
|
|
693
|
+
} else if (payload && typeof payload === 'object') {
|
|
694
|
+
payload = this._writeRetryCount(payload, retry + 1);
|
|
699
695
|
}
|
|
700
696
|
|
|
701
697
|
this._sendDebugToGrafana(payload, retry + 1);
|
|
@@ -703,6 +699,15 @@ class IssueReporter {
|
|
|
703
699
|
});
|
|
704
700
|
}
|
|
705
701
|
|
|
702
|
+
_writeRetryCount(message , count ) {
|
|
703
|
+
if (message && typeof message === 'object') {
|
|
704
|
+
// $FlowFixMe
|
|
705
|
+
message._retry = count;
|
|
706
|
+
}
|
|
707
|
+
|
|
708
|
+
return message;
|
|
709
|
+
}
|
|
710
|
+
|
|
706
711
|
_isLevelAbove(level1 , level2 ) {
|
|
707
712
|
const index1 = LOG_LEVELS.indexOf(level1);
|
|
708
713
|
const index2 = LOG_LEVELS.indexOf(level2);
|
|
@@ -6116,8 +6121,10 @@ class WebRTCClient extends Emitter {
|
|
|
6116
6121
|
conference: isConference,
|
|
6117
6122
|
};
|
|
6118
6123
|
|
|
6119
|
-
// Avoid sdh to
|
|
6120
|
-
session.sessionDescriptionHandler
|
|
6124
|
+
// Avoid sdh to create a new stream
|
|
6125
|
+
if (session.sessionDescriptionHandler) {
|
|
6126
|
+
session.sessionDescriptionHandler.localMediaStreamConstraints = options.constraints;
|
|
6127
|
+
}
|
|
6121
6128
|
|
|
6122
6129
|
// Send re-INVITE
|
|
6123
6130
|
return session.invite(options);
|
package/lib/websocket-client.js
CHANGED
|
@@ -397,13 +397,9 @@ class IssueReporter {
|
|
|
397
397
|
|
|
398
398
|
setTimeout(() => {
|
|
399
399
|
if (isArray) {
|
|
400
|
-
payload = payload.map(message =>
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
});
|
|
404
|
-
} else {
|
|
405
|
-
// $FlowFixMe
|
|
406
|
-
payload._retry = retry + 1;
|
|
400
|
+
payload = payload.map(message => this._writeRetryCount(message, retry + 1));
|
|
401
|
+
} else if (payload && typeof payload === 'object') {
|
|
402
|
+
payload = this._writeRetryCount(payload, retry + 1);
|
|
407
403
|
}
|
|
408
404
|
|
|
409
405
|
this._sendDebugToGrafana(payload, retry + 1);
|
|
@@ -411,6 +407,15 @@ class IssueReporter {
|
|
|
411
407
|
});
|
|
412
408
|
}
|
|
413
409
|
|
|
410
|
+
_writeRetryCount(message , count ) {
|
|
411
|
+
if (message && typeof message === 'object') {
|
|
412
|
+
// $FlowFixMe
|
|
413
|
+
message._retry = count;
|
|
414
|
+
}
|
|
415
|
+
|
|
416
|
+
return message;
|
|
417
|
+
}
|
|
418
|
+
|
|
414
419
|
_isLevelAbove(level1 , level2 ) {
|
|
415
420
|
const index1 = LOG_LEVELS.indexOf(level1);
|
|
416
421
|
const index2 = LOG_LEVELS.indexOf(level2);
|
|
@@ -871,7 +876,7 @@ class WebSocketClient extends Emitter {
|
|
|
871
876
|
this.close();
|
|
872
877
|
}
|
|
873
878
|
const url = `wss://${this.host || ''}/api/websocketd/?token=${this.token || ''}&version=${this.version}`;
|
|
874
|
-
logger.
|
|
879
|
+
logger.info('Wazo WS url computed to reconnect', { url });
|
|
875
880
|
|
|
876
881
|
return url;
|
|
877
882
|
}
|
package/package.json
CHANGED
|
@@ -330,13 +330,9 @@ class IssueReporter {
|
|
|
330
330
|
|
|
331
331
|
setTimeout(() => {
|
|
332
332
|
if (isArray) {
|
|
333
|
-
payload = payload.map(message =>
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
});
|
|
337
|
-
} else {
|
|
338
|
-
// $FlowFixMe
|
|
339
|
-
payload._retry = retry + 1;
|
|
333
|
+
payload = payload.map(message => this._writeRetryCount(message, retry + 1));
|
|
334
|
+
} else if (payload && typeof payload === 'object') {
|
|
335
|
+
payload = this._writeRetryCount(payload, retry + 1);
|
|
340
336
|
}
|
|
341
337
|
|
|
342
338
|
this._sendDebugToGrafana(payload, retry + 1);
|
|
@@ -344,6 +340,15 @@ class IssueReporter {
|
|
|
344
340
|
});
|
|
345
341
|
}
|
|
346
342
|
|
|
343
|
+
_writeRetryCount(message: string | Object, count: number): string | Object {
|
|
344
|
+
if (message && typeof message === 'object') {
|
|
345
|
+
// $FlowFixMe
|
|
346
|
+
message._retry = count;
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
return message;
|
|
350
|
+
}
|
|
351
|
+
|
|
347
352
|
_isLevelAbove(level1: string, level2: string) {
|
|
348
353
|
const index1 = LOG_LEVELS.indexOf(level1);
|
|
349
354
|
const index2 = LOG_LEVELS.indexOf(level2);
|
|
@@ -100,4 +100,10 @@ describe('IssueReporter', () => {
|
|
|
100
100
|
expect(IssueReporter.removeSlashes('\"')).toBe("'");
|
|
101
101
|
expect(IssueReporter.removeSlashes('\\\"')).toBe("'");
|
|
102
102
|
});
|
|
103
|
+
|
|
104
|
+
it('Add retry count', () => {
|
|
105
|
+
expect(IssueReporter._writeRetryCount('', 1)).toBe('');
|
|
106
|
+
expect(IssueReporter._writeRetryCount('{}', 1)).toBe('{}');
|
|
107
|
+
expect(IssueReporter._writeRetryCount({}, 1)).toEqual({ _retry: 1 });
|
|
108
|
+
});
|
|
103
109
|
});
|
package/src/web-rtc-client.js
CHANGED
|
@@ -771,8 +771,10 @@ export default class WebRTCClient extends Emitter {
|
|
|
771
771
|
conference: isConference,
|
|
772
772
|
};
|
|
773
773
|
|
|
774
|
-
// Avoid sdh to
|
|
775
|
-
session.sessionDescriptionHandler
|
|
774
|
+
// Avoid sdh to create a new stream
|
|
775
|
+
if (session.sessionDescriptionHandler) {
|
|
776
|
+
session.sessionDescriptionHandler.localMediaStreamConstraints = options.constraints;
|
|
777
|
+
}
|
|
776
778
|
|
|
777
779
|
// Send re-INVITE
|
|
778
780
|
return session.invite(options);
|
package/src/websocket-client.js
CHANGED
|
@@ -356,7 +356,7 @@ class WebSocketClient extends Emitter {
|
|
|
356
356
|
this.close();
|
|
357
357
|
}
|
|
358
358
|
const url = `wss://${this.host || ''}/api/websocketd/?token=${this.token || ''}&version=${this.version}`;
|
|
359
|
-
logger.
|
|
359
|
+
logger.info('Wazo WS url computed to reconnect', { url });
|
|
360
360
|
|
|
361
361
|
return url;
|
|
362
362
|
}
|