@observertc/observer-js 0.42.9 → 1.0.0-beta.1
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/.prettierrc +6 -6
- package/README.md +493 -63
- package/lib/ObservedCall.d.ts +63 -43
- package/lib/ObservedCall.d.ts.map +1 -1
- package/lib/ObservedCall.js +188 -108
- package/lib/ObservedCallEventMonitor.d.ts +104 -0
- package/lib/ObservedCallEventMonitor.d.ts.map +1 -0
- package/lib/ObservedCallEventMonitor.js +314 -0
- package/lib/ObservedCallSummary.d.ts +18 -0
- package/lib/ObservedCallSummary.d.ts.map +1 -0
- package/lib/ObservedCertificate.d.ts +19 -0
- package/lib/ObservedCertificate.d.ts.map +1 -0
- package/lib/ObservedCertificate.js +38 -0
- package/lib/ObservedClient.d.ts +81 -136
- package/lib/ObservedClient.d.ts.map +1 -1
- package/lib/ObservedClient.js +581 -744
- package/lib/ObservedClientEventMonitor.d.ts +91 -0
- package/lib/ObservedClientEventMonitor.d.ts.map +1 -0
- package/lib/ObservedClientEventMonitor.js +254 -0
- package/lib/ObservedClientSummary.d.ts +23 -0
- package/lib/ObservedClientSummary.d.ts.map +1 -0
- package/lib/ObservedClientSummary.js +2 -0
- package/lib/ObservedCodec.d.ts +22 -0
- package/lib/ObservedCodec.d.ts.map +1 -0
- package/lib/ObservedCodec.js +45 -0
- package/lib/ObservedDataChannel.d.ts +25 -69
- package/lib/ObservedDataChannel.d.ts.map +1 -1
- package/lib/ObservedDataChannel.js +69 -109
- package/lib/ObservedIceCandidate.d.ts +29 -0
- package/lib/ObservedIceCandidate.d.ts.map +1 -0
- package/lib/ObservedIceCandidate.js +59 -0
- package/lib/ObservedIceCandidatePair.d.ts +45 -0
- package/lib/ObservedIceCandidatePair.d.ts.map +1 -0
- package/lib/ObservedIceCandidatePair.js +127 -0
- package/lib/ObservedIceTransport.d.ts +36 -0
- package/lib/ObservedIceTransport.d.ts.map +1 -0
- package/lib/ObservedIceTransport.js +93 -0
- package/lib/ObservedInboundRtp.d.ts +92 -0
- package/lib/ObservedInboundRtp.d.ts.map +1 -0
- package/lib/ObservedInboundRtp.js +193 -0
- package/lib/ObservedInboundTrack.d.ts +32 -0
- package/lib/ObservedInboundTrack.d.ts.map +1 -0
- package/lib/ObservedInboundTrack.js +60 -0
- package/lib/ObservedMediaPlayout.d.ts +22 -0
- package/lib/ObservedMediaPlayout.d.ts.map +1 -0
- package/lib/ObservedMediaPlayout.js +42 -0
- package/lib/ObservedMediaSource.d.ts +28 -0
- package/lib/ObservedMediaSource.d.ts.map +1 -0
- package/lib/ObservedMediaSource.js +55 -0
- package/lib/ObservedOutboundRtp.d.ts +62 -0
- package/lib/ObservedOutboundRtp.d.ts.map +1 -0
- package/lib/ObservedOutboundRtp.js +144 -0
- package/lib/ObservedOutboundTrack.d.ts +32 -0
- package/lib/ObservedOutboundTrack.d.ts.map +1 -0
- package/lib/ObservedOutboundTrack.js +60 -0
- package/lib/ObservedPeerConnection.d.ts +154 -80
- package/lib/ObservedPeerConnection.d.ts.map +1 -1
- package/lib/ObservedPeerConnection.js +709 -357
- package/lib/ObservedPeerConnectionTransport.d.ts +17 -0
- package/lib/ObservedPeerConnectionTransport.d.ts.map +1 -0
- package/lib/ObservedPeerConnectionTransport.js +34 -0
- package/lib/ObservedRemoteInboundRtp.d.ts +30 -0
- package/lib/ObservedRemoteInboundRtp.d.ts.map +1 -0
- package/lib/ObservedRemoteInboundRtp.js +60 -0
- package/lib/ObservedRemoteOutboundRtp.d.ts +30 -0
- package/lib/ObservedRemoteOutboundRtp.d.ts.map +1 -0
- package/lib/ObservedRemoteOutboundRtp.js +60 -0
- package/lib/ObservedTURN.d.ts +31 -0
- package/lib/ObservedTURN.d.ts.map +1 -0
- package/lib/ObservedTURN.js +58 -0
- package/lib/ObservedTurnServer.d.ts +25 -0
- package/lib/ObservedTurnServer.d.ts.map +1 -0
- package/lib/ObservedTurnServer.js +59 -0
- package/lib/Observer.d.ts +49 -54
- package/lib/Observer.d.ts.map +1 -1
- package/lib/Observer.js +131 -226
- package/lib/ObserverEventMonitor.d.ts +138 -0
- package/lib/ObserverEventMonitor.d.ts.map +1 -0
- package/lib/ObserverEventMonitor.js +433 -0
- package/lib/ObserverSummary.d.ts +13 -0
- package/lib/ObserverSummary.d.ts.map +1 -0
- package/lib/ObserverSummary.js +2 -0
- package/lib/common/Middleware.d.ts +10 -1
- package/lib/common/Middleware.d.ts.map +1 -1
- package/lib/common/Middleware.js +55 -36
- package/lib/common/logger.d.ts +8 -4
- package/lib/common/logger.d.ts.map +1 -1
- package/lib/common/logger.js +44 -68
- package/lib/common/types.d.ts +0 -21
- package/lib/common/types.d.ts.map +1 -1
- package/lib/common/types.js +1 -0
- package/lib/common/utils.d.ts +3 -1
- package/lib/common/utils.d.ts.map +1 -1
- package/lib/common/utils.js +23 -3
- package/lib/detectors/Detector.d.ts +5 -0
- package/lib/detectors/Detector.d.ts.map +1 -0
- package/lib/detectors/Detector.js +3 -0
- package/lib/detectors/Detectors.d.ts +11 -0
- package/lib/detectors/Detectors.d.ts.map +1 -0
- package/lib/detectors/Detectors.js +34 -0
- package/lib/index.d.ts +26 -25
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +45 -41
- package/lib/mediasoup/ObservedMediaRouter.d.ts +10 -0
- package/lib/mediasoup/ObservedMediaRouter.d.ts.map +1 -0
- package/lib/mediasoup/ObservedMediaRouter.js +6 -0
- package/lib/monitors/TurnUsageMonitor.d.ts +0 -52
- package/lib/monitors/TurnUsageMonitor.d.ts.map +1 -1
- package/lib/monitors/TurnUsageMonitor.js +145 -120
- package/lib/schema/ClientEventTypes.d.ts +228 -0
- package/lib/schema/ClientEventTypes.d.ts.map +1 -0
- package/lib/schema/ClientEventTypes.js +41 -0
- package/lib/schema/ClientMetaTypes.d.ts +34 -0
- package/lib/schema/ClientMetaTypes.d.ts.map +1 -0
- package/lib/schema/ClientMetaTypes.js +16 -0
- package/lib/schema/ClientSample.d.ts +1333 -0
- package/lib/schema/ClientSample.d.ts.map +1 -0
- package/lib/schema/ClientSample.js +4 -0
- package/lib/scores/CalculatedScore.d.ts +6 -0
- package/lib/scores/CalculatedScore.d.ts.map +1 -0
- package/lib/scores/CalculatedScore.js +2 -0
- package/lib/scores/DefaultCallScoreCalculator.d.ts +7 -0
- package/lib/scores/DefaultCallScoreCalculator.d.ts.map +1 -0
- package/lib/scores/DefaultCallScoreCalculator.js +21 -0
- package/lib/scores/ScoreCalculator.d.ts +4 -0
- package/lib/scores/ScoreCalculator.d.ts.map +1 -0
- package/lib/scores/ScoreCalculator.js +2 -0
- package/lib/updaters/CallUpdater.d.ts +5 -0
- package/lib/updaters/CallUpdater.d.ts.map +1 -0
- package/lib/updaters/CallUpdater.js +2 -0
- package/lib/updaters/ObserverUpdater.d.ts +5 -0
- package/lib/updaters/ObserverUpdater.d.ts.map +1 -0
- package/lib/updaters/ObserverUpdater.js +2 -0
- package/lib/updaters/OnAllCallObserverUpdater.d.ts +15 -0
- package/lib/updaters/OnAllCallObserverUpdater.d.ts.map +1 -0
- package/lib/updaters/OnAllCallObserverUpdater.js +50 -0
- package/lib/updaters/OnAllClientCallUpdater.d.ts +15 -0
- package/lib/updaters/OnAllClientCallUpdater.d.ts.map +1 -0
- package/lib/updaters/OnAllClientCallUpdater.js +53 -0
- package/lib/updaters/OnAnyCallObserverUpdater.d.ts +12 -0
- package/lib/updaters/OnAnyCallObserverUpdater.d.ts.map +1 -0
- package/lib/updaters/OnAnyCallObserverUpdater.js +37 -0
- package/lib/updaters/OnAnyClientCallUpdater.d.ts +12 -0
- package/lib/updaters/OnAnyClientCallUpdater.d.ts.map +1 -0
- package/lib/updaters/OnAnyClientCallUpdater.js +36 -0
- package/lib/updaters/OnIntervalUpdater.d.ts +10 -0
- package/lib/updaters/OnIntervalUpdater.d.ts.map +1 -0
- package/lib/updaters/OnIntervalUpdater.js +17 -0
- package/lib/updaters/Updater.d.ts +6 -0
- package/lib/updaters/Updater.d.ts.map +1 -0
- package/lib/updaters/Updater.js +2 -0
- package/lib/utils/MediasoupRemoteTrackResolver.d.ts +25 -0
- package/lib/utils/MediasoupRemoteTrackResolver.d.ts.map +1 -0
- package/lib/utils/MediasoupRemoteTrackResolver.js +110 -0
- package/lib/utils/RemoteTrackResolver.d.ts +7 -0
- package/lib/utils/RemoteTrackResolver.d.ts.map +1 -0
- package/lib/utils/RemoteTrackResolver.js +2 -0
- package/package.json +4 -4
- package/src/ObservedCall.ts +276 -164
- package/src/ObservedCallEventMonitor.ts +392 -0
- package/src/ObservedCallSummary.ts +22 -0
- package/src/ObservedCertificate.ts +43 -0
- package/src/ObservedClient.ts +624 -1007
- package/src/ObservedClientEventMonitor.ts +309 -0
- package/src/ObservedClientSummary.ts +24 -0
- package/src/ObservedCodec.ts +49 -0
- package/src/ObservedDataChannel.ts +71 -181
- package/src/ObservedIceCandidate.ts +64 -0
- package/src/ObservedIceCandidatePair.ts +134 -0
- package/src/ObservedIceTransport.ts +99 -0
- package/src/ObservedInboundRtp.ts +205 -0
- package/src/ObservedInboundTrack.ts +75 -0
- package/src/ObservedMediaPlayout.ts +49 -0
- package/src/ObservedMediaSource.ts +60 -0
- package/src/ObservedOutboundRtp.ts +156 -0
- package/src/ObservedOutboundTrack.ts +74 -0
- package/src/ObservedPeerConnection.ts +917 -402
- package/src/ObservedPeerConnectionTransport.ts +38 -0
- package/src/ObservedRemoteInboundRtp.ts +64 -0
- package/src/ObservedRemoteOutboundRtp.ts +65 -0
- package/src/ObservedTURN.ts +86 -0
- package/src/ObservedTurnServer.ts +72 -0
- package/src/Observer.ts +182 -298
- package/src/ObserverEventMonitor.ts +551 -0
- package/src/ObserverSummary.ts +15 -0
- package/src/common/Middleware.ts +70 -42
- package/src/common/logger.ts +60 -69
- package/src/common/types.ts +0 -42
- package/src/common/utils.ts +24 -2
- package/src/detectors/Detector.ts +6 -0
- package/src/detectors/Detectors.ts +38 -0
- package/src/index.ts +26 -91
- package/src/mediasoup/ObservedMediaRouter.ts +10 -0
- package/src/monitors/TurnUsageMonitor.ts +164 -164
- package/src/schema/ClientEventTypes.ts +280 -0
- package/src/schema/ClientMetaTypes.ts +41 -0
- package/src/schema/ClientSample.ts +1682 -0
- package/src/scores/CalculatedScore.ts +6 -0
- package/src/scores/DefaultCallScoreCalculator.ts +23 -0
- package/src/scores/ScoreCalculator.ts +3 -0
- package/src/updaters/CallUpdater.ts +5 -0
- package/src/updaters/ObserverUpdater.ts +5 -0
- package/src/updaters/OnAllCallObserverUpdater.ts +59 -0
- package/src/updaters/OnAllClientCallUpdater.ts +61 -0
- package/src/updaters/OnAnyCallObserverUpdater.ts +41 -0
- package/src/updaters/OnAnyClientCallUpdater.ts +39 -0
- package/src/updaters/OnIntervalUpdater.ts +19 -0
- package/src/updaters/Updater.ts +5 -0
- package/src/utils/MediasoupRemoteTrackResolver.ts +155 -0
- package/src/utils/RemoteTrackResolver.ts +12 -0
- package/tsconfig.json +3 -3
- package/lib/ObservedICE.d.ts +0 -64
- package/lib/ObservedICE.d.ts.map +0 -1
- package/lib/ObservedICE.js +0 -141
- package/lib/ObservedInboundAudioTrack.d.ts +0 -96
- package/lib/ObservedInboundAudioTrack.d.ts.map +0 -1
- package/lib/ObservedInboundAudioTrack.js +0 -217
- package/lib/ObservedInboundVideoTrack.d.ts +0 -101
- package/lib/ObservedInboundVideoTrack.d.ts.map +0 -1
- package/lib/ObservedInboundVideoTrack.js +0 -232
- package/lib/ObservedOutboundAudioTrack.d.ts +0 -87
- package/lib/ObservedOutboundAudioTrack.d.ts.map +0 -1
- package/lib/ObservedOutboundAudioTrack.js +0 -186
- package/lib/ObservedOutboundVideoTrack.d.ts +0 -91
- package/lib/ObservedOutboundVideoTrack.d.ts.map +0 -1
- package/lib/ObservedOutboundVideoTrack.js +0 -193
- package/lib/ObservedSfu.d.ts +0 -59
- package/lib/ObservedSfu.d.ts.map +0 -1
- package/lib/ObservedSfu.js +0 -157
- package/lib/ObservedSfuInboundRtpPad.d.ts +0 -42
- package/lib/ObservedSfuInboundRtpPad.d.ts.map +0 -1
- package/lib/ObservedSfuInboundRtpPad.js +0 -71
- package/lib/ObservedSfuOutboundRtpPad.d.ts +0 -42
- package/lib/ObservedSfuOutboundRtpPad.d.ts.map +0 -1
- package/lib/ObservedSfuOutboundRtpPad.js +0 -72
- package/lib/ObservedSfuSctpChannel.d.ts +0 -42
- package/lib/ObservedSfuSctpChannel.d.ts.map +0 -1
- package/lib/ObservedSfuSctpChannel.js +0 -57
- package/lib/ObservedSfuTransport.d.ts +0 -58
- package/lib/ObservedSfuTransport.d.ts.map +0 -1
- package/lib/ObservedSfuTransport.js +0 -120
- package/lib/RemoteTrackAssigner.d.ts +0 -14
- package/lib/RemoteTrackAssigner.d.ts.map +0 -1
- package/lib/RemoteTrackAssigner.js +0 -52
- package/lib/ReportsCollector.d.ts +0 -109
- package/lib/ReportsCollector.d.ts.map +0 -1
- package/lib/ReportsCollector.js +0 -207
- package/lib/common/CalculatedScore.d.ts +0 -80
- package/lib/common/CalculatedScore.d.ts.map +0 -1
- package/lib/common/CalculatedScore.js +0 -162
- package/lib/common/CallEventType.d.ts +0 -63
- package/lib/common/CallEventType.d.ts.map +0 -1
- package/lib/common/CallEventType.js +0 -39
- package/lib/common/CallMetaReports.d.ts +0 -42
- package/lib/common/CallMetaReports.d.ts.map +0 -1
- package/lib/common/CallMetaReports.js +0 -36
- package/lib/common/QualityScoreUtils.d.ts +0 -1
- package/lib/common/QualityScoreUtils.d.ts.map +0 -1
- package/lib/common/QualityScoreUtils.js +0 -1
- package/lib/common/TypedEventEmitter.d.ts +0 -22
- package/lib/common/TypedEventEmitter.d.ts.map +0 -1
- package/lib/common/TypedEventEmitter.js +0 -11
- package/lib/common/callEventReports.d.ts +0 -10
- package/lib/common/callEventReports.d.ts.map +0 -1
- package/lib/common/callEventReports.js +0 -112
- package/lib/monitors/CallSummary.d.ts +0 -37
- package/lib/monitors/CallSummary.d.ts.map +0 -1
- package/lib/monitors/CallSummaryMonitor.d.ts +0 -32
- package/lib/monitors/CallSummaryMonitor.d.ts.map +0 -1
- package/lib/monitors/CallSummaryMonitor.js +0 -152
- package/lib/monitors/ClientIssueMonitor.d.ts +0 -32
- package/lib/monitors/ClientIssueMonitor.d.ts.map +0 -1
- package/lib/monitors/ClientIssueMonitor.js +0 -49
- package/lib/monitors/SfuServerMonitor.d.ts +0 -79
- package/lib/monitors/SfuServerMonitor.d.ts.map +0 -1
- package/lib/monitors/SfuServerMonitor.js +0 -198
- package/src/ObservedICE.ts +0 -237
- package/src/ObservedInboundAudioTrack.ts +0 -344
- package/src/ObservedInboundVideoTrack.ts +0 -361
- package/src/ObservedOutboundAudioTrack.ts +0 -307
- package/src/ObservedOutboundVideoTrack.ts +0 -319
- package/src/ObservedSfu.ts +0 -231
- package/src/ObservedSfuInboundRtpPad.ts +0 -106
- package/src/ObservedSfuOutboundRtpPad.ts +0 -107
- package/src/ObservedSfuSctpChannel.ts +0 -103
- package/src/ObservedSfuTransport.ts +0 -185
- package/src/RemoteTrackAssigner.ts +0 -68
- package/src/ReportsCollector.ts +0 -336
- package/src/common/CalculatedScore.ts +0 -188
- package/src/common/CallEventType.ts +0 -69
- package/src/common/CallMetaReports.ts +0 -82
- package/src/common/QualityScoreUtils.ts +0 -0
- package/src/common/TypedEventEmitter.ts +0 -32
- package/src/common/callEventReports.ts +0 -178
- package/src/monitors/CallSummary.ts +0 -38
- package/src/monitors/CallSummaryMonitor.ts +0 -192
- package/src/monitors/ClientIssueMonitor.ts +0 -88
- package/src/monitors/SfuServerMonitor.ts +0 -285
- /package/lib/{monitors/CallSummary.js → ObservedCallSummary.js} +0 -0
|
@@ -0,0 +1,314 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ObservedCallEventMonitor = void 0;
|
|
4
|
+
class ObservedCallEventMonitor {
|
|
5
|
+
call;
|
|
6
|
+
context;
|
|
7
|
+
constructor(call, context) {
|
|
8
|
+
this.call = call;
|
|
9
|
+
this.context = context;
|
|
10
|
+
this._onPeerConnconnectionAdded = this._onPeerConnconnectionAdded.bind(this);
|
|
11
|
+
this._onPeerConnectionRemoved = this._onPeerConnectionRemoved.bind(this);
|
|
12
|
+
this._onCertificateAdded = this._onCertificateAdded.bind(this);
|
|
13
|
+
this._onCertificateRemoved = this._onCertificateRemoved.bind(this);
|
|
14
|
+
this._onInboundTrackAdded = this._onInboundTrackAdded.bind(this);
|
|
15
|
+
this._onInboundTrackRemoved = this._onInboundTrackRemoved.bind(this);
|
|
16
|
+
this._onOutboundTrackAdded = this._onOutboundTrackAdded.bind(this);
|
|
17
|
+
this._onOutboundTrackRemoved = this._onOutboundTrackRemoved.bind(this);
|
|
18
|
+
this._onInboundRtpAdded = this._onInboundRtpAdded.bind(this);
|
|
19
|
+
this._onInboundRtpRemoved = this._onInboundRtpRemoved.bind(this);
|
|
20
|
+
this._onOutboundRtpAdded = this._onOutboundRtpAdded.bind(this);
|
|
21
|
+
this._onOutboundRtpRemoved = this._onOutboundRtpRemoved.bind(this);
|
|
22
|
+
this._onDataChannelAdded = this._onDataChannelAdded.bind(this);
|
|
23
|
+
this._onDataChannelRemoved = this._onDataChannelRemoved.bind(this);
|
|
24
|
+
this._onAddedIceTransport = this._onAddedIceTransport.bind(this);
|
|
25
|
+
this._onRemovedIceTransport = this._onRemovedIceTransport.bind(this);
|
|
26
|
+
this._onIceCandidateAdded = this._onIceCandidateAdded.bind(this);
|
|
27
|
+
this._onIceCandidateRemoved = this._onIceCandidateRemoved.bind(this);
|
|
28
|
+
this._onAddedIceCandidatePair = this._onAddedIceCandidatePair.bind(this);
|
|
29
|
+
this._onRemovedIceCandidatePair = this._onRemovedIceCandidatePair.bind(this);
|
|
30
|
+
this._onAddedMediaCodec = this._onAddedMediaCodec.bind(this);
|
|
31
|
+
this._onRemovedMediaCodec = this._onRemovedMediaCodec.bind(this);
|
|
32
|
+
this._onAddedMediaPlayout = this._onAddedMediaPlayout.bind(this);
|
|
33
|
+
this._onRemovedMediaPlayout = this._onRemovedMediaPlayout.bind(this);
|
|
34
|
+
this._onMediaSourceAdded = this._onMediaSourceAdded.bind(this);
|
|
35
|
+
this._onMediaSourceRemoved = this._onMediaSourceRemoved.bind(this);
|
|
36
|
+
this._onClientIssue = this._onClientIssue.bind(this);
|
|
37
|
+
this._onClientMetadata = this._onClientMetadata.bind(this);
|
|
38
|
+
this._onClientJoined = this._onClientJoined.bind(this);
|
|
39
|
+
this._onClientLeft = this._onClientLeft.bind(this);
|
|
40
|
+
this._onUserMediaError = this._onUserMediaError.bind(this);
|
|
41
|
+
this._onUsingTurn = this._onUsingTurn.bind(this);
|
|
42
|
+
this._onClientAdded = this._onClientAdded.bind(this);
|
|
43
|
+
this._onCallAdded = this._onCallAdded.bind(this);
|
|
44
|
+
this._onClientRejoined = this._onClientRejoined.bind(this);
|
|
45
|
+
this._onClientExtensionStats = this._onClientExtensionStats.bind(this);
|
|
46
|
+
this._onCallAdded(call);
|
|
47
|
+
}
|
|
48
|
+
// Public event handlers
|
|
49
|
+
onCallClosed;
|
|
50
|
+
onCallEmpty;
|
|
51
|
+
onCallNotEmpty;
|
|
52
|
+
onCallUpdated;
|
|
53
|
+
onClientAdded;
|
|
54
|
+
onClientClosed;
|
|
55
|
+
onClientRejoined;
|
|
56
|
+
onClientIssue;
|
|
57
|
+
onClientMetadata;
|
|
58
|
+
onClientExtensionStats;
|
|
59
|
+
onClientJoined;
|
|
60
|
+
onClientLeft;
|
|
61
|
+
onClientUserMediaError;
|
|
62
|
+
onClientUsingTurn;
|
|
63
|
+
onClientUpdated;
|
|
64
|
+
onClientEvent;
|
|
65
|
+
onPeerConnectionAdded;
|
|
66
|
+
onPeerConnectionRemoved;
|
|
67
|
+
onSelectedCandidatePairChanged;
|
|
68
|
+
onIceGatheringStateChange;
|
|
69
|
+
onIceConnectionStateChange;
|
|
70
|
+
onConnectionStateChange;
|
|
71
|
+
onCertificateAdded;
|
|
72
|
+
onCertificateRemoved;
|
|
73
|
+
onInboundTrackAdded;
|
|
74
|
+
onInboundTrackRemoved;
|
|
75
|
+
onOutboundTrackAdded;
|
|
76
|
+
onOutboundTrackRemoved;
|
|
77
|
+
onInboundRtpAdded;
|
|
78
|
+
onInboundRtpRemoved;
|
|
79
|
+
onOutboundRtpAdded;
|
|
80
|
+
onOutboundRtpRemoved;
|
|
81
|
+
onDataChannelAdded;
|
|
82
|
+
onDataChannelRemoved;
|
|
83
|
+
onAddedIceTransport;
|
|
84
|
+
onRemovedIceTransport;
|
|
85
|
+
onIceCandidateAdded;
|
|
86
|
+
onIceCandidateRemoved;
|
|
87
|
+
onAddedIceCandidatePair;
|
|
88
|
+
onRemovedIceCandidatePair;
|
|
89
|
+
onAddedMediaCodec;
|
|
90
|
+
onRemovedMediaCodec;
|
|
91
|
+
onAddedMediaPlayout;
|
|
92
|
+
onRemovedMediaPlayout;
|
|
93
|
+
onMediaSourceAdded;
|
|
94
|
+
onMediaSourceRemoved;
|
|
95
|
+
_onCallAdded(call) {
|
|
96
|
+
const onCallEmpty = () => this.onCallEmpty?.(call, this.context);
|
|
97
|
+
const onCallNotEmpty = () => this.onCallNotEmpty?.(call, this.context);
|
|
98
|
+
const onCallUpdated = () => this.onCallUpdated?.(call, this.context);
|
|
99
|
+
call.once('close', () => {
|
|
100
|
+
call.off('newclient', this._onClientAdded);
|
|
101
|
+
call.off('empty', onCallEmpty);
|
|
102
|
+
call.off('not-empty', onCallNotEmpty);
|
|
103
|
+
call.off('update', onCallUpdated);
|
|
104
|
+
this.onCallClosed?.(call, this.context);
|
|
105
|
+
});
|
|
106
|
+
call.on('newclient', this._onClientAdded);
|
|
107
|
+
call.on('empty', onCallEmpty);
|
|
108
|
+
call.on('not-empty', onCallNotEmpty);
|
|
109
|
+
call.on('update', onCallUpdated);
|
|
110
|
+
}
|
|
111
|
+
_onClientAdded(observedClient) {
|
|
112
|
+
const onClientIssue = (issue) => this._onClientIssue(observedClient, issue);
|
|
113
|
+
const onClientMetadata = (metaData) => this._onClientMetadata(observedClient, metaData);
|
|
114
|
+
const onClientJoined = () => this._onClientJoined(observedClient);
|
|
115
|
+
const onClientLeft = () => this._onClientLeft(observedClient);
|
|
116
|
+
const onClientRejoined = () => this._onClientRejoined(observedClient);
|
|
117
|
+
const onClientExtensionStats = (extensionStats) => this._onClientExtensionStats(observedClient, extensionStats);
|
|
118
|
+
const onUsingTurn = (usingTurn) => this._onUsingTurn(observedClient, usingTurn);
|
|
119
|
+
const onUserMediaError = (error) => this._onUserMediaError(observedClient, error);
|
|
120
|
+
const onClientUpdated = (...args) => this.onClientUpdated?.(observedClient, args[0], this.context);
|
|
121
|
+
const onClientEvent = (event) => this.onClientEvent?.(observedClient, event, this.context);
|
|
122
|
+
observedClient.once('close', () => {
|
|
123
|
+
observedClient.off('newpeerconnection', this._onPeerConnconnectionAdded);
|
|
124
|
+
observedClient.off('issue', onClientIssue);
|
|
125
|
+
observedClient.off('metaData', onClientMetadata);
|
|
126
|
+
observedClient.off('joined', onClientJoined);
|
|
127
|
+
observedClient.off('left', onClientLeft);
|
|
128
|
+
observedClient.off('rejoined', onClientJoined);
|
|
129
|
+
observedClient.off('usermediaerror', onUserMediaError);
|
|
130
|
+
observedClient.off('usingturn', onUsingTurn);
|
|
131
|
+
observedClient.off('update', onClientUpdated);
|
|
132
|
+
observedClient.off('clientEvent', onClientEvent);
|
|
133
|
+
this.onClientClosed?.(observedClient, this.context);
|
|
134
|
+
});
|
|
135
|
+
observedClient.on('newpeerconnection', this._onPeerConnconnectionAdded);
|
|
136
|
+
observedClient.on('issue', onClientIssue);
|
|
137
|
+
observedClient.on('metaData', onClientMetadata);
|
|
138
|
+
observedClient.on('joined', onClientJoined);
|
|
139
|
+
observedClient.on('left', onClientLeft);
|
|
140
|
+
observedClient.on('rejoined', onClientRejoined);
|
|
141
|
+
observedClient.on('usermediaerror', onUserMediaError);
|
|
142
|
+
observedClient.on('usingturn', onUsingTurn);
|
|
143
|
+
observedClient.on('extensionStats', onClientExtensionStats);
|
|
144
|
+
observedClient.on('update', onClientUpdated);
|
|
145
|
+
observedClient.on('clientEvent', onClientEvent);
|
|
146
|
+
this.onClientAdded?.(observedClient, this.context);
|
|
147
|
+
}
|
|
148
|
+
_onClientRejoined(observedClient) {
|
|
149
|
+
this.onClientRejoined?.(observedClient, this.context);
|
|
150
|
+
}
|
|
151
|
+
_onPeerConnconnectionAdded(peerConnection) {
|
|
152
|
+
const onSelectedCandidatePairChanged = () => this.onSelectedCandidatePairChanged?.(peerConnection, this.context);
|
|
153
|
+
const onIceGatheringStateChange = () => this.onIceGatheringStateChange?.(peerConnection, this.context);
|
|
154
|
+
const onIceConnectionStateChange = () => this.onIceConnectionStateChange?.(peerConnection, this.context);
|
|
155
|
+
const onConnectionStateChange = () => this.onConnectionStateChange?.(peerConnection, this.context);
|
|
156
|
+
peerConnection.once('close', () => {
|
|
157
|
+
peerConnection.off('added-certificate', this._onCertificateAdded);
|
|
158
|
+
peerConnection.off('removed-certificate', this._onCertificateRemoved);
|
|
159
|
+
peerConnection.off('added-inbound-track', this._onInboundTrackAdded);
|
|
160
|
+
peerConnection.off('removed-inbound-track', this._onInboundTrackRemoved);
|
|
161
|
+
peerConnection.off('added-outbound-track', this._onOutboundTrackAdded);
|
|
162
|
+
peerConnection.off('removed-outbound-track', this._onOutboundTrackRemoved);
|
|
163
|
+
peerConnection.off('added-inbound-rtp', this._onInboundRtpAdded);
|
|
164
|
+
peerConnection.off('removed-inbound-rtp', this._onInboundRtpRemoved);
|
|
165
|
+
peerConnection.off('added-outbound-rtp', this._onOutboundRtpAdded);
|
|
166
|
+
peerConnection.off('removed-outbound-rtp', this._onOutboundRtpRemoved);
|
|
167
|
+
peerConnection.off('added-data-channel', this._onDataChannelAdded);
|
|
168
|
+
peerConnection.off('removed-data-channel', this._onDataChannelRemoved);
|
|
169
|
+
peerConnection.off('added-ice-transport', this._onAddedIceTransport);
|
|
170
|
+
peerConnection.off('removed-ice-transport', this._onRemovedIceTransport);
|
|
171
|
+
peerConnection.off('added-ice-candidate', this._onIceCandidateAdded);
|
|
172
|
+
peerConnection.off('removed-ice-candidate', this._onIceCandidateRemoved);
|
|
173
|
+
peerConnection.off('added-ice-candidate-pair', this._onAddedIceCandidatePair);
|
|
174
|
+
peerConnection.off('removed-ice-candidate-pair', this._onRemovedIceCandidatePair);
|
|
175
|
+
peerConnection.off('added-codec', this._onAddedMediaCodec);
|
|
176
|
+
peerConnection.off('removed-codec', this._onRemovedMediaCodec);
|
|
177
|
+
peerConnection.off('added-media-playout', this._onAddedMediaPlayout);
|
|
178
|
+
peerConnection.off('removed-media-playout', this._onRemovedMediaPlayout);
|
|
179
|
+
peerConnection.off('added-media-source', this._onMediaSourceAdded);
|
|
180
|
+
peerConnection.off('removed-media-source', this._onMediaSourceRemoved);
|
|
181
|
+
peerConnection.off('selectedcandidatepair', onSelectedCandidatePairChanged);
|
|
182
|
+
peerConnection.off('icegatheringstatechange', onIceGatheringStateChange);
|
|
183
|
+
peerConnection.off('iceconnectionstatechange', onIceConnectionStateChange);
|
|
184
|
+
peerConnection.off('connectionstatechange', onConnectionStateChange);
|
|
185
|
+
this.onPeerConnectionRemoved?.(peerConnection, this.context);
|
|
186
|
+
});
|
|
187
|
+
peerConnection.on('added-certificate', this._onCertificateAdded);
|
|
188
|
+
peerConnection.on('removed-certificate', this._onCertificateRemoved);
|
|
189
|
+
peerConnection.on('added-inbound-track', this._onInboundTrackAdded);
|
|
190
|
+
peerConnection.on('removed-inbound-track', this._onInboundTrackRemoved);
|
|
191
|
+
peerConnection.on('added-outbound-track', this._onOutboundTrackAdded);
|
|
192
|
+
peerConnection.on('removed-outbound-track', this._onOutboundTrackRemoved);
|
|
193
|
+
peerConnection.on('added-inbound-rtp', this._onInboundRtpAdded);
|
|
194
|
+
peerConnection.on('removed-inbound-rtp', this._onInboundRtpRemoved);
|
|
195
|
+
peerConnection.on('added-outbound-rtp', this._onOutboundRtpAdded);
|
|
196
|
+
peerConnection.on('removed-outbound-rtp', this._onOutboundRtpRemoved);
|
|
197
|
+
peerConnection.on('added-data-channel', this._onDataChannelAdded);
|
|
198
|
+
peerConnection.on('removed-data-channel', this._onDataChannelRemoved);
|
|
199
|
+
peerConnection.on('added-ice-transport', this._onAddedIceTransport);
|
|
200
|
+
peerConnection.on('removed-ice-transport', this._onRemovedIceTransport);
|
|
201
|
+
peerConnection.on('added-ice-candidate', this._onIceCandidateAdded);
|
|
202
|
+
peerConnection.on('removed-ice-candidate', this._onIceCandidateRemoved);
|
|
203
|
+
peerConnection.on('added-ice-candidate-pair', this._onAddedIceCandidatePair);
|
|
204
|
+
peerConnection.on('removed-ice-candidate-pair', this._onRemovedIceCandidatePair);
|
|
205
|
+
peerConnection.on('added-codec', this._onAddedMediaCodec);
|
|
206
|
+
peerConnection.on('removed-codec', this._onRemovedMediaCodec);
|
|
207
|
+
peerConnection.on('added-media-playout', this._onAddedMediaPlayout);
|
|
208
|
+
peerConnection.on('removed-media-playout', this._onRemovedMediaPlayout);
|
|
209
|
+
peerConnection.on('added-media-source', this._onMediaSourceAdded);
|
|
210
|
+
peerConnection.on('removed-media-source', this._onMediaSourceRemoved);
|
|
211
|
+
peerConnection.on('selectedcandidatepair', onSelectedCandidatePairChanged);
|
|
212
|
+
peerConnection.on('icegatheringstatechange', onIceGatheringStateChange);
|
|
213
|
+
peerConnection.on('iceconnectionstatechange', onIceConnectionStateChange);
|
|
214
|
+
peerConnection.on('connectionstatechange', onConnectionStateChange);
|
|
215
|
+
this.onPeerConnectionAdded?.(peerConnection, this.context);
|
|
216
|
+
}
|
|
217
|
+
_onPeerConnectionRemoved(peerConnection) {
|
|
218
|
+
this.onPeerConnectionRemoved?.(peerConnection, this.context);
|
|
219
|
+
}
|
|
220
|
+
_onCertificateAdded(certificate) {
|
|
221
|
+
this.onCertificateAdded?.(certificate, this.context);
|
|
222
|
+
}
|
|
223
|
+
_onCertificateRemoved(certificate) {
|
|
224
|
+
this.onCertificateRemoved?.(certificate, this.context);
|
|
225
|
+
}
|
|
226
|
+
_onInboundTrackAdded(inboundTrack) {
|
|
227
|
+
this.onInboundTrackAdded?.(inboundTrack, this.context);
|
|
228
|
+
}
|
|
229
|
+
_onInboundTrackRemoved(inboundTrack) {
|
|
230
|
+
this.onInboundTrackRemoved?.(inboundTrack, this.context);
|
|
231
|
+
}
|
|
232
|
+
_onOutboundTrackAdded(outboundTrack) {
|
|
233
|
+
this.onOutboundTrackAdded?.(outboundTrack, this.context);
|
|
234
|
+
}
|
|
235
|
+
_onOutboundTrackRemoved(outboundTrack) {
|
|
236
|
+
this.onOutboundTrackRemoved?.(outboundTrack, this.context);
|
|
237
|
+
}
|
|
238
|
+
_onInboundRtpAdded(inboundRtp) {
|
|
239
|
+
this.onInboundRtpAdded?.(inboundRtp, this.context);
|
|
240
|
+
}
|
|
241
|
+
_onInboundRtpRemoved(inboundRtp) {
|
|
242
|
+
this.onInboundRtpRemoved?.(inboundRtp, this.context);
|
|
243
|
+
}
|
|
244
|
+
_onOutboundRtpAdded(outboundRtp) {
|
|
245
|
+
this.onOutboundRtpAdded?.(outboundRtp, this.context);
|
|
246
|
+
}
|
|
247
|
+
_onOutboundRtpRemoved(outboundRtp) {
|
|
248
|
+
this.onOutboundRtpRemoved?.(outboundRtp, this.context);
|
|
249
|
+
}
|
|
250
|
+
_onDataChannelAdded(dataChannel) {
|
|
251
|
+
this.onDataChannelAdded?.(dataChannel, this.context);
|
|
252
|
+
}
|
|
253
|
+
_onDataChannelRemoved(dataChannel) {
|
|
254
|
+
this.onDataChannelRemoved?.(dataChannel, this.context);
|
|
255
|
+
}
|
|
256
|
+
_onAddedIceTransport(iceTransport) {
|
|
257
|
+
this.onAddedIceTransport?.(iceTransport, this.context);
|
|
258
|
+
}
|
|
259
|
+
_onRemovedIceTransport(iceTransport) {
|
|
260
|
+
this.onRemovedIceTransport?.(iceTransport, this.context);
|
|
261
|
+
}
|
|
262
|
+
_onIceCandidateAdded(iceCandidate) {
|
|
263
|
+
this.onIceCandidateAdded?.(iceCandidate, this.context);
|
|
264
|
+
}
|
|
265
|
+
_onIceCandidateRemoved(iceCandidate) {
|
|
266
|
+
this.onIceCandidateRemoved?.(iceCandidate, this.context);
|
|
267
|
+
}
|
|
268
|
+
_onAddedIceCandidatePair(candidatePair) {
|
|
269
|
+
this.onAddedIceCandidatePair?.(candidatePair, this.context);
|
|
270
|
+
}
|
|
271
|
+
_onRemovedIceCandidatePair(candidatePair) {
|
|
272
|
+
this.onRemovedIceCandidatePair?.(candidatePair, this.context);
|
|
273
|
+
}
|
|
274
|
+
_onAddedMediaCodec(codec) {
|
|
275
|
+
this.onAddedMediaCodec?.(codec, this.context);
|
|
276
|
+
}
|
|
277
|
+
_onRemovedMediaCodec(codec) {
|
|
278
|
+
this.onRemovedMediaCodec?.(codec, this.context);
|
|
279
|
+
}
|
|
280
|
+
_onAddedMediaPlayout(mediaPlayout) {
|
|
281
|
+
this.onAddedMediaPlayout?.(mediaPlayout, this.context);
|
|
282
|
+
}
|
|
283
|
+
_onRemovedMediaPlayout(mediaPlayout) {
|
|
284
|
+
this.onRemovedMediaPlayout?.(mediaPlayout, this.context);
|
|
285
|
+
}
|
|
286
|
+
_onMediaSourceAdded(mediaSource) {
|
|
287
|
+
this.onMediaSourceAdded?.(mediaSource, this.context);
|
|
288
|
+
}
|
|
289
|
+
_onMediaSourceRemoved(mediaSource) {
|
|
290
|
+
this.onMediaSourceRemoved?.(mediaSource, this.context);
|
|
291
|
+
}
|
|
292
|
+
_onClientIssue(observedClent, issue) {
|
|
293
|
+
this.onClientIssue?.(observedClent, issue, this.context);
|
|
294
|
+
}
|
|
295
|
+
_onClientMetadata(observedClient, metadata) {
|
|
296
|
+
this.onClientMetadata?.(observedClient, metadata, this.context);
|
|
297
|
+
}
|
|
298
|
+
_onClientExtensionStats(observedClient, extensionStats) {
|
|
299
|
+
this.onClientExtensionStats?.(observedClient, extensionStats, this.context);
|
|
300
|
+
}
|
|
301
|
+
_onClientJoined(observedClient) {
|
|
302
|
+
this.onClientJoined?.(observedClient, this.context);
|
|
303
|
+
}
|
|
304
|
+
_onClientLeft(observedClient) {
|
|
305
|
+
this.onClientLeft?.(observedClient, this.context);
|
|
306
|
+
}
|
|
307
|
+
_onUserMediaError(observedClient, error) {
|
|
308
|
+
this.onClientUserMediaError?.(observedClient, error, this.context);
|
|
309
|
+
}
|
|
310
|
+
_onUsingTurn(observedClient, usingTurn) {
|
|
311
|
+
this.onClientUsingTurn?.(observedClient, usingTurn, this.context);
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
|
+
exports.ObservedCallEventMonitor = ObservedCallEventMonitor;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export type ObservedCallSummary = {
|
|
2
|
+
currentActiveClients: number;
|
|
3
|
+
totalAddedClients: number;
|
|
4
|
+
totalRemovedClients: number;
|
|
5
|
+
totalClientsSentBytes: number;
|
|
6
|
+
totalClientsReceivedBytes: number;
|
|
7
|
+
totalClientsReceivedAudioBytes: number;
|
|
8
|
+
totalClientsReceivedVideoBytes: number;
|
|
9
|
+
totalClientsSentAudioBytes: number;
|
|
10
|
+
totalClientsSentVideoBytes: number;
|
|
11
|
+
totalRttLt50Measurements: number;
|
|
12
|
+
totalRttLt150Measurements: number;
|
|
13
|
+
totalRttLt300Measurements: number;
|
|
14
|
+
totalRttGtOrEq300Measurements: number;
|
|
15
|
+
numberOfIssues: number;
|
|
16
|
+
numberOfClientsUsedTurn: number;
|
|
17
|
+
};
|
|
18
|
+
//# sourceMappingURL=ObservedCallSummary.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ObservedCallSummary.d.ts","sourceRoot":"","sources":["../src/ObservedCallSummary.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,mBAAmB,GAAG;IACjC,oBAAoB,EAAE,MAAM,CAAC;IAE7B,iBAAiB,EAAE,MAAM,CAAC;IAC1B,mBAAmB,EAAE,MAAM,CAAC;IAE5B,qBAAqB,EAAE,MAAM,CAAC;IAC9B,yBAAyB,EAAE,MAAM,CAAC;IAClC,8BAA8B,EAAE,MAAM,CAAC;IACvC,8BAA8B,EAAE,MAAM,CAAC;IACvC,0BAA0B,EAAE,MAAM,CAAC;IACnC,0BAA0B,EAAE,MAAM,CAAC;IAEnC,wBAAwB,EAAE,MAAM,CAAC;IACjC,yBAAyB,EAAE,MAAM,CAAC;IAClC,yBAAyB,EAAE,MAAM,CAAC;IAClC,6BAA6B,EAAE,MAAM,CAAC;IAEtC,cAAc,EAAE,MAAM,CAAC;IAEvB,uBAAuB,EAAE,MAAM,CAAC;CAChC,CAAA"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { ObservedPeerConnection } from './ObservedPeerConnection';
|
|
2
|
+
import { CertificateStats } from './schema/ClientSample';
|
|
3
|
+
export declare class ObservedCertificate implements CertificateStats {
|
|
4
|
+
timestamp: number;
|
|
5
|
+
id: string;
|
|
6
|
+
private readonly _peerConnection;
|
|
7
|
+
appData?: Record<string, unknown>;
|
|
8
|
+
private _visited;
|
|
9
|
+
fingerprint?: string;
|
|
10
|
+
fingerprintAlgorithm?: string;
|
|
11
|
+
base64Certificate?: string;
|
|
12
|
+
issuerCertificateId?: string;
|
|
13
|
+
attachments?: Record<string, unknown>;
|
|
14
|
+
constructor(timestamp: number, id: string, _peerConnection: ObservedPeerConnection);
|
|
15
|
+
get visited(): boolean;
|
|
16
|
+
getPeerConnection(): ObservedPeerConnection;
|
|
17
|
+
update(stats: CertificateStats): void;
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=ObservedCertificate.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ObservedCertificate.d.ts","sourceRoot":"","sources":["../src/ObservedCertificate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAEzD,qBAAa,mBAAoB,YAAW,gBAAgB;IAYnD,SAAS,EAAE,MAAM;IACjB,EAAE,EAAE,MAAM;IACjB,OAAO,CAAC,QAAQ,CAAC,eAAe;IAb1B,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAEzC,OAAO,CAAC,QAAQ,CAAS;IAEzB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;gBAG9B,SAAS,EAAE,MAAM,EACjB,EAAE,EAAE,MAAM,EACA,eAAe,EAAE,sBAAsB;IAGzD,IAAW,OAAO,YAMjB;IAEM,iBAAiB;IAIjB,MAAM,CAAC,KAAK,EAAE,gBAAgB;CAUrC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ObservedCertificate = void 0;
|
|
4
|
+
class ObservedCertificate {
|
|
5
|
+
timestamp;
|
|
6
|
+
id;
|
|
7
|
+
_peerConnection;
|
|
8
|
+
appData;
|
|
9
|
+
_visited = false;
|
|
10
|
+
fingerprint;
|
|
11
|
+
fingerprintAlgorithm;
|
|
12
|
+
base64Certificate;
|
|
13
|
+
issuerCertificateId;
|
|
14
|
+
attachments;
|
|
15
|
+
constructor(timestamp, id, _peerConnection) {
|
|
16
|
+
this.timestamp = timestamp;
|
|
17
|
+
this.id = id;
|
|
18
|
+
this._peerConnection = _peerConnection;
|
|
19
|
+
}
|
|
20
|
+
get visited() {
|
|
21
|
+
const visited = this._visited;
|
|
22
|
+
this._visited = false;
|
|
23
|
+
return visited;
|
|
24
|
+
}
|
|
25
|
+
getPeerConnection() {
|
|
26
|
+
return this._peerConnection;
|
|
27
|
+
}
|
|
28
|
+
update(stats) {
|
|
29
|
+
this._visited = true;
|
|
30
|
+
this.timestamp = stats.timestamp;
|
|
31
|
+
this.fingerprint = stats.fingerprint;
|
|
32
|
+
this.fingerprintAlgorithm = stats.fingerprintAlgorithm;
|
|
33
|
+
this.base64Certificate = stats.base64Certificate;
|
|
34
|
+
this.issuerCertificateId = stats.issuerCertificateId;
|
|
35
|
+
this.attachments = stats.attachments;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
exports.ObservedCertificate = ObservedCertificate;
|
package/lib/ObservedClient.d.ts
CHANGED
|
@@ -1,107 +1,57 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
|
-
import { Browser, ClientSample, Engine, IceLocalCandidate, IceRemoteCandidate, MediaCodecStats, MediaDevice, OperationSystem, Platform } from '@observertc/sample-schemas-js';
|
|
3
|
-
import { ObservedCall } from './ObservedCall';
|
|
4
2
|
import { EventEmitter } from 'events';
|
|
5
3
|
import { ObservedPeerConnection } from './ObservedPeerConnection';
|
|
6
|
-
import {
|
|
7
|
-
import
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
export type
|
|
4
|
+
import { ClientEvent, ClientMetaData, ClientSample, ClientIssue, ExtensionStat } from './schema/ClientSample';
|
|
5
|
+
import * as MetaData from './schema/ClientMetaTypes';
|
|
6
|
+
import { ObservedCall } from './ObservedCall';
|
|
7
|
+
import { CalculatedScore } from './scores/CalculatedScore';
|
|
8
|
+
import { Detectors } from './detectors/Detectors';
|
|
9
|
+
export type ObservedClientSettings<AppData extends Record<string, unknown> = Record<string, unknown>> = {
|
|
12
10
|
clientId: string;
|
|
13
|
-
|
|
14
|
-
userId?: string;
|
|
15
|
-
marker?: string;
|
|
16
|
-
operationSystem?: OperationSystem;
|
|
17
|
-
engine?: Engine;
|
|
18
|
-
platform?: Platform;
|
|
19
|
-
browser?: Browser;
|
|
20
|
-
coordinates?: {
|
|
21
|
-
latitude: number;
|
|
22
|
-
longitude: number;
|
|
23
|
-
};
|
|
11
|
+
appData?: AppData;
|
|
24
12
|
};
|
|
25
13
|
export type ObservedClientEvents = {
|
|
26
|
-
update: [
|
|
27
|
-
{
|
|
28
|
-
sample: ClientSample;
|
|
29
|
-
elapsedTimeInMs: number;
|
|
30
|
-
}
|
|
31
|
-
];
|
|
14
|
+
update: [sample: ClientSample, elapsedTimeInMs: number];
|
|
32
15
|
close: [];
|
|
33
16
|
joined: [];
|
|
34
|
-
left: [];
|
|
35
|
-
newpeerconnection: [ObservedPeerConnection];
|
|
36
|
-
iceconnectionstatechange: [
|
|
37
|
-
{
|
|
38
|
-
peerConnection: ObservedPeerConnection;
|
|
39
|
-
state: string;
|
|
40
|
-
}
|
|
41
|
-
];
|
|
42
|
-
icegatheringstatechange: [
|
|
43
|
-
{
|
|
44
|
-
peerConnection: ObservedPeerConnection;
|
|
45
|
-
state: string;
|
|
46
|
-
}
|
|
47
|
-
];
|
|
48
|
-
connectionstatechange: [
|
|
49
|
-
{
|
|
50
|
-
peerConnection: ObservedPeerConnection;
|
|
51
|
-
state: string;
|
|
52
|
-
}
|
|
53
|
-
];
|
|
54
|
-
selectedcandidatepair: [
|
|
55
|
-
{
|
|
56
|
-
peerConnection: ObservedPeerConnection;
|
|
57
|
-
localCandidate: IceLocalCandidate;
|
|
58
|
-
remoteCandidate: IceRemoteCandidate;
|
|
59
|
-
}
|
|
60
|
-
];
|
|
61
17
|
issue: [ClientIssue];
|
|
18
|
+
metaData: [ClientMetaData];
|
|
19
|
+
rejoined: [timestamp: number];
|
|
20
|
+
left: [];
|
|
62
21
|
usingturn: [boolean];
|
|
63
22
|
usermediaerror: [string];
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
}
|
|
68
|
-
];
|
|
69
|
-
score: [CalculatedScore];
|
|
23
|
+
extensionStats: [ExtensionStat];
|
|
24
|
+
clientEvent: [ClientEvent];
|
|
25
|
+
newpeerconnection: [ObservedPeerConnection];
|
|
70
26
|
};
|
|
71
|
-
export declare interface ObservedClient
|
|
27
|
+
export declare interface ObservedClient {
|
|
72
28
|
on<U extends keyof ObservedClientEvents>(event: U, listener: (...args: ObservedClientEvents[U]) => void): this;
|
|
73
29
|
off<U extends keyof ObservedClientEvents>(event: U, listener: (...args: ObservedClientEvents[U]) => void): this;
|
|
74
30
|
once<U extends keyof ObservedClientEvents>(event: U, listener: (...args: ObservedClientEvents[U]) => void): this;
|
|
75
31
|
emit<U extends keyof ObservedClientEvents>(event: U, ...args: ObservedClientEvents[U]): boolean;
|
|
76
|
-
readonly appData: AppData;
|
|
77
32
|
}
|
|
78
|
-
type PendingPeerConnectionTimestamp = {
|
|
79
|
-
type: 'opened' | 'closed';
|
|
80
|
-
peerConnectionId: string;
|
|
81
|
-
timestamp: number;
|
|
82
|
-
};
|
|
83
|
-
type PendingMediaTrackTimestamp = {
|
|
84
|
-
type: 'added' | 'removed';
|
|
85
|
-
peerConnectionId: string;
|
|
86
|
-
mediaTrackId: string;
|
|
87
|
-
timestamp: number;
|
|
88
|
-
};
|
|
89
33
|
export declare class ObservedClient<AppData extends Record<string, unknown> = Record<string, unknown>> extends EventEmitter {
|
|
90
|
-
private readonly _model;
|
|
91
34
|
readonly call: ObservedCall;
|
|
92
|
-
readonly
|
|
93
|
-
readonly
|
|
35
|
+
readonly detectors: Detectors;
|
|
36
|
+
readonly clientId: string;
|
|
37
|
+
readonly observedPeerConnections: Map<string, ObservedPeerConnection>;
|
|
38
|
+
readonly calculatedScore: CalculatedScore;
|
|
39
|
+
appData: AppData;
|
|
40
|
+
attachments?: Record<string, unknown>;
|
|
94
41
|
updated: number;
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
42
|
+
acceptedSamples: number;
|
|
43
|
+
closed: boolean;
|
|
44
|
+
joinedAt?: number;
|
|
45
|
+
leftAt?: number;
|
|
46
|
+
closedAt?: number;
|
|
47
|
+
lastSampleTimestamp?: number;
|
|
48
|
+
operationSystem?: MetaData.OperationSystem;
|
|
49
|
+
engine?: MetaData.Engine;
|
|
50
|
+
platform?: MetaData.Platform;
|
|
51
|
+
browser?: MetaData.Browser;
|
|
52
|
+
mediaConstraints: string[];
|
|
104
53
|
usingTURN: boolean;
|
|
54
|
+
usingTCP: boolean;
|
|
105
55
|
availableOutgoingBitrate: number;
|
|
106
56
|
availableIncomingBitrate: number;
|
|
107
57
|
totalInboundPacketsLost: number;
|
|
@@ -109,74 +59,69 @@ export declare class ObservedClient<AppData extends Record<string, unknown> = Re
|
|
|
109
59
|
totalOutboundPacketsSent: number;
|
|
110
60
|
totalDataChannelBytesSent: number;
|
|
111
61
|
totalDataChannelBytesReceived: number;
|
|
112
|
-
|
|
113
|
-
|
|
62
|
+
totalDataChannelMessagesSent: number;
|
|
63
|
+
totalDataChannelMessagesReceived: number;
|
|
114
64
|
totalReceivedAudioBytes: number;
|
|
115
65
|
totalReceivedVideoBytes: number;
|
|
116
66
|
totalSentAudioBytes: number;
|
|
117
67
|
totalSentVideoBytes: number;
|
|
68
|
+
totalSentBytes: number;
|
|
69
|
+
totalReceivedBytes: number;
|
|
118
70
|
deltaReceivedAudioBytes: number;
|
|
119
71
|
deltaReceivedVideoBytes: number;
|
|
120
72
|
deltaSentAudioBytes: number;
|
|
121
73
|
deltaSentVideoBytes: number;
|
|
122
74
|
deltaDataChannelBytesSent: number;
|
|
123
75
|
deltaDataChannelBytesReceived: number;
|
|
76
|
+
deltaDataChannelMessagesSent: number;
|
|
77
|
+
deltaDataChannelMessagesReceived: number;
|
|
124
78
|
deltaInboundPacketsLost: number;
|
|
125
79
|
deltaInboundPacketsReceived: number;
|
|
126
80
|
deltaOutboundPacketsSent: number;
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
81
|
+
deltaTransportSentBytes: number;
|
|
82
|
+
deltaTransportReceivedBytes: number;
|
|
83
|
+
deltaRttLt50Measurements: number;
|
|
84
|
+
deltaRttLt150Measurements: number;
|
|
85
|
+
deltaRttLt300Measurements: number;
|
|
86
|
+
deltaRttGtOrEq300Measurements: number;
|
|
87
|
+
currentMaxRttInMs?: number;
|
|
88
|
+
currentMinRttInMs?: number;
|
|
89
|
+
currentAvgRttInMs?: number;
|
|
90
|
+
sendingAudioBitrate: number;
|
|
91
|
+
sendingVideoBitrate: number;
|
|
92
|
+
receivingAudioBitrate: number;
|
|
93
|
+
receivingVideoBitrate: number;
|
|
94
|
+
numberOfInboundRtpStreams: number;
|
|
95
|
+
numberOfInbundTracks: number;
|
|
96
|
+
numberOfOutboundRtpStreams: number;
|
|
97
|
+
numberOfOutboundTracks: number;
|
|
98
|
+
numberOfDataChannels: number;
|
|
99
|
+
totalRttLt50Measurements: number;
|
|
100
|
+
totalRttLt150Measurements: number;
|
|
101
|
+
totalRttLt300Measurements: number;
|
|
102
|
+
totalRttGtOrEq300Measurements: number;
|
|
103
|
+
deltaNumberOfIssues: number;
|
|
104
|
+
totalScoreSum: number;
|
|
105
|
+
numberOfScoreMeasurements: number;
|
|
106
|
+
totalNumberOfIssues: number;
|
|
107
|
+
readonly mediaDevices: MetaData.MediaDeviceInfo[];
|
|
136
108
|
issues: ClientIssue[];
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
get joined(): number | undefined;
|
|
142
|
-
set joined(value: number | undefined);
|
|
143
|
-
get left(): number | undefined;
|
|
144
|
-
set left(value: number | undefined);
|
|
145
|
-
get sfu(): ObservedSfu | undefined;
|
|
146
|
-
get coordinates(): {
|
|
147
|
-
latitude: number;
|
|
148
|
-
longitude: number;
|
|
149
|
-
} | undefined;
|
|
150
|
-
set coordinates(value: {
|
|
151
|
-
latitude: number;
|
|
152
|
-
longitude: number;
|
|
153
|
-
} | undefined);
|
|
154
|
-
get clientId(): string;
|
|
155
|
-
get roomId(): string;
|
|
156
|
-
get serviceId(): string;
|
|
157
|
-
get callId(): string;
|
|
158
|
-
get mediaUnitId(): string;
|
|
159
|
-
get reports(): import("./ReportsCollector").ReportsCollector;
|
|
160
|
-
get userId(): string | undefined;
|
|
161
|
-
set userId(userId: string | undefined);
|
|
162
|
-
get timeZoneOffsetInHours(): number | undefined;
|
|
163
|
-
get marker(): string | undefined;
|
|
164
|
-
get browser(): Browser | undefined;
|
|
165
|
-
get engine(): Engine | undefined;
|
|
166
|
-
get operationSystem(): OperationSystem | undefined;
|
|
167
|
-
get platform(): Platform | undefined;
|
|
168
|
-
get acceptedSamples(): number;
|
|
169
|
-
get closed(): boolean;
|
|
170
|
-
get peerConnections(): ReadonlyMap<string, ObservedPeerConnection>;
|
|
109
|
+
private _injections;
|
|
110
|
+
constructor(settings: ObservedClientSettings<AppData>, call: ObservedCall);
|
|
111
|
+
get numberOfPeerConnections(): number;
|
|
112
|
+
get score(): number | undefined;
|
|
171
113
|
close(): void;
|
|
172
|
-
addEventReport(params: PartialBy<Omit<CallEventReport, 'serviceId' | 'roomId' | 'callId' | 'clientId' | 'userId' | 'marker' | 'attachments'>, 'timestamp'> & {
|
|
173
|
-
attachments?: Record<string, unknown>;
|
|
174
|
-
}): void;
|
|
175
|
-
addExtensionStatsReport(extensionType: string, payload?: Record<string, unknown>): void;
|
|
176
|
-
addIssue(issue: ClientIssue): void;
|
|
177
114
|
accept(sample: ClientSample): void;
|
|
178
|
-
private
|
|
179
|
-
|
|
115
|
+
private _processClientEvent;
|
|
116
|
+
injectMetaData(metaData: ClientMetaData): void;
|
|
117
|
+
injectEvent(event: ClientEvent): void;
|
|
118
|
+
injectIssue(issue: ClientIssue): void;
|
|
119
|
+
injectExtensionStat(stat: ExtensionStat): void;
|
|
120
|
+
injectAttachment(key: string, value: unknown): void;
|
|
121
|
+
addMetadata(metadata: ClientMetaData): void;
|
|
122
|
+
addIssue(issue: ClientIssue): void;
|
|
123
|
+
addExtensionStats(stats: ExtensionStat): void;
|
|
124
|
+
private _updatePeerConnection;
|
|
125
|
+
private _mergeInjections;
|
|
180
126
|
}
|
|
181
|
-
export {};
|
|
182
127
|
//# sourceMappingURL=ObservedClient.d.ts.map
|