@observertc/observer-js 0.9.26-beta → 0.30.0-beta
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/lib/ObservedCall.d.ts +54 -0
- package/lib/ObservedCall.d.ts.map +1 -0
- package/lib/ObservedCall.js +166 -0
- package/lib/ObservedClient.d.ts +73 -0
- package/lib/ObservedClient.d.ts.map +1 -0
- package/lib/ObservedClient.js +487 -0
- package/lib/ObservedInboundTrack.d.ts +65 -0
- package/lib/ObservedInboundTrack.d.ts.map +1 -0
- package/lib/ObservedInboundTrack.js +192 -0
- package/lib/ObservedOutboundTrack.d.ts +55 -0
- package/lib/ObservedOutboundTrack.d.ts.map +1 -0
- package/lib/ObservedOutboundTrack.js +166 -0
- package/lib/ObservedPeerConnection.d.ts +57 -0
- package/lib/ObservedPeerConnection.d.ts.map +1 -0
- package/lib/ObservedPeerConnection.js +217 -0
- package/lib/Observer.d.ts +26 -1465
- package/lib/Observer.d.ts.map +1 -1
- package/lib/Observer.js +53 -605
- package/lib/{sinks/ObserverSink.d.ts → ReportsCollector.d.ts} +7 -23
- package/lib/ReportsCollector.d.ts.map +1 -0
- package/lib/{sinks/ObserverSink.js → ReportsCollector.js} +27 -85
- package/lib/common/ReportsCollector.d.ts +21 -24
- package/lib/common/ReportsCollector.d.ts.map +1 -1
- package/lib/common/ReportsCollector.js +24 -0
- package/lib/common/SingleExecutor.d.ts +3 -0
- package/lib/common/SingleExecutor.d.ts.map +1 -0
- package/lib/common/SingleExecutor.js +31 -0
- package/lib/common/TypedEventEmitter.d.ts +22 -0
- package/lib/common/TypedEventEmitter.d.ts.map +1 -0
- package/lib/common/TypedEventEmitter.js +11 -0
- package/lib/common/callEventReports.d.ts.map +1 -0
- package/lib/common/logger.d.ts +3 -9
- package/lib/common/logger.d.ts.map +1 -1
- package/lib/common/logger.js +58 -141
- package/lib/common/types.d.ts +2 -14
- package/lib/common/types.d.ts.map +1 -1
- package/lib/common/utils.d.ts +1 -0
- package/lib/common/utils.d.ts.map +1 -1
- package/lib/common/utils.js +6 -1
- package/lib/index.d.ts +8 -19
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +7 -2
- package/package.json +1 -1
- package/src/ObservedCall.ts +201 -0
- package/src/ObservedClient.ts +681 -0
- package/src/ObservedInboundTrack.ts +238 -0
- package/src/ObservedOutboundTrack.ts +205 -0
- package/src/ObservedPeerConnection.ts +249 -0
- package/src/Observer.ts +86 -442
- package/src/{sinks/ObserverSink.ts → ReportsCollector.ts} +29 -94
- package/src/common/ReportsCollector.ts +48 -23
- package/src/common/SingleExecutor.ts +36 -0
- package/src/common/TypedEventEmitter.ts +32 -0
- package/src/common/logger.ts +58 -161
- package/src/common/types.ts +4 -24
- package/src/common/utils.ts +6 -0
- package/src/index.ts +12 -23
- package/lib/Evaluator.d.ts +0 -43
- package/lib/Evaluator.d.ts.map +0 -1
- package/lib/Evaluator.js +0 -171
- package/lib/common/Semaphore.d.ts +0 -31
- package/lib/common/Semaphore.d.ts.map +0 -1
- package/lib/common/Semaphore.js +0 -16
- package/lib/entries/CallEntry.d.ts +0 -619
- package/lib/entries/CallEntry.d.ts.map +0 -1
- package/lib/entries/CallEntry.js +0 -75
- package/lib/entries/ClientEntry.d.ts +0 -478
- package/lib/entries/ClientEntry.d.ts.map +0 -1
- package/lib/entries/ClientEntry.js +0 -114
- package/lib/entries/InboundTrackEntry.d.ts +0 -682
- package/lib/entries/InboundTrackEntry.d.ts.map +0 -1
- package/lib/entries/InboundTrackEntry.js +0 -76
- package/lib/entries/OutboundTrackEntry.d.ts +0 -682
- package/lib/entries/OutboundTrackEntry.d.ts.map +0 -1
- package/lib/entries/OutboundTrackEntry.js +0 -73
- package/lib/entries/PeerConnectionEntry.d.ts +0 -505
- package/lib/entries/PeerConnectionEntry.d.ts.map +0 -1
- package/lib/entries/PeerConnectionEntry.js +0 -144
- package/lib/entries/SfuEntry.d.ts +0 -150
- package/lib/entries/SfuEntry.d.ts.map +0 -1
- package/lib/entries/SfuEntry.js +0 -77
- package/lib/entries/SfuInboundRtpPadEntry.d.ts +0 -14
- package/lib/entries/SfuInboundRtpPadEntry.d.ts.map +0 -1
- package/lib/entries/SfuInboundRtpPadEntry.js +0 -49
- package/lib/entries/SfuOutboundRtpPadEntry.d.ts +0 -14
- package/lib/entries/SfuOutboundRtpPadEntry.d.ts.map +0 -1
- package/lib/entries/SfuOutboundRtpPadEntry.js +0 -47
- package/lib/entries/SfuSctpChannelEntry.d.ts +0 -12
- package/lib/entries/SfuSctpChannelEntry.d.ts.map +0 -1
- package/lib/entries/SfuSctpChannelEntry.js +0 -43
- package/lib/entries/SfuTransportEntry.d.ts +0 -82
- package/lib/entries/SfuTransportEntry.d.ts.map +0 -1
- package/lib/entries/SfuTransportEntry.js +0 -122
- package/lib/evaluators/SetClientsCoordinateEvaluator.d.ts +0 -9
- package/lib/evaluators/SetClientsCoordinateEvaluator.d.ts.map +0 -1
- package/lib/evaluators/SetClientsCoordinateEvaluator.js +0 -95
- package/lib/middlewares/CallOperationsContext.d.ts +0 -18
- package/lib/middlewares/CallOperationsContext.d.ts.map +0 -1
- package/lib/middlewares/CallOperationsContext.js +0 -27
- package/lib/middlewares/CallProcessor.d.ts +0 -6
- package/lib/middlewares/CallProcessor.d.ts.map +0 -1
- package/lib/middlewares/CallProcessor.js +0 -36
- package/lib/middlewares/CommitTransactionMiddleware.d.ts +0 -6
- package/lib/middlewares/CommitTransactionMiddleware.d.ts.map +0 -1
- package/lib/middlewares/CommitTransactionMiddleware.js +0 -179
- package/lib/middlewares/DeleteOutdatedCallEntries.d.ts +0 -6
- package/lib/middlewares/DeleteOutdatedCallEntries.d.ts.map +0 -1
- package/lib/middlewares/DeleteOutdatedCallEntries.js +0 -121
- package/lib/middlewares/DeleteOutdatedSfuEntries.d.ts +0 -6
- package/lib/middlewares/DeleteOutdatedSfuEntries.d.ts.map +0 -1
- package/lib/middlewares/DeleteOutdatedSfuEntries.js +0 -127
- package/lib/middlewares/Middleware.d.ts +0 -3
- package/lib/middlewares/Middleware.d.ts.map +0 -1
- package/lib/middlewares/Middleware.js +0 -21
- package/lib/middlewares/Processor.d.ts +0 -9
- package/lib/middlewares/Processor.d.ts.map +0 -1
- package/lib/middlewares/Processor.js +0 -54
- package/lib/middlewares/TransactionContext.d.ts +0 -35
- package/lib/middlewares/TransactionContext.d.ts.map +0 -1
- package/lib/middlewares/TransactionContext.js +0 -90
- package/lib/middlewares/TransactoinProcessor.d.ts +0 -6
- package/lib/middlewares/TransactoinProcessor.d.ts.map +0 -1
- package/lib/middlewares/TransactoinProcessor.js +0 -17
- package/lib/middlewares/VisitObservedCallsMiddleware.d.ts +0 -7
- package/lib/middlewares/VisitObservedCallsMiddleware.d.ts.map +0 -1
- package/lib/middlewares/VisitObservedCallsMiddleware.js +0 -96
- package/lib/middlewares/VisitObservedSfusMiddleware.d.ts +0 -6
- package/lib/middlewares/VisitObservedSfusMiddleware.d.ts.map +0 -1
- package/lib/middlewares/VisitObservedSfusMiddleware.js +0 -151
- package/lib/middlewares/visitors/visitClient.d.ts +0 -5
- package/lib/middlewares/visitors/visitClient.d.ts.map +0 -1
- package/lib/middlewares/visitors/visitClient.js +0 -174
- package/lib/middlewares/visitors/visitInboundAudioTrack.d.ts +0 -5
- package/lib/middlewares/visitors/visitInboundAudioTrack.d.ts.map +0 -1
- package/lib/middlewares/visitors/visitInboundAudioTrack.js +0 -93
- package/lib/middlewares/visitors/visitInboundVideoTrack.d.ts +0 -5
- package/lib/middlewares/visitors/visitInboundVideoTrack.d.ts.map +0 -1
- package/lib/middlewares/visitors/visitInboundVideoTrack.js +0 -94
- package/lib/middlewares/visitors/visitOutboundAudioTrack.d.ts +0 -5
- package/lib/middlewares/visitors/visitOutboundAudioTrack.d.ts.map +0 -1
- package/lib/middlewares/visitors/visitOutboundAudioTrack.js +0 -90
- package/lib/middlewares/visitors/visitOutboundVideoTarck.d.ts +0 -5
- package/lib/middlewares/visitors/visitOutboundVideoTarck.d.ts.map +0 -1
- package/lib/middlewares/visitors/visitOutboundVideoTarck.js +0 -90
- package/lib/middlewares/visitors/visitPeerConnection.d.ts +0 -5
- package/lib/middlewares/visitors/visitPeerConnection.d.ts.map +0 -1
- package/lib/middlewares/visitors/visitPeerConnection.js +0 -111
- package/lib/middlewares/visitors/visitSfu.d.ts +0 -5
- package/lib/middlewares/visitors/visitSfu.d.ts.map +0 -1
- package/lib/middlewares/visitors/visitSfu.js +0 -78
- package/lib/middlewares/visitors/visitSfuInboundRtpPad.d.ts +0 -5
- package/lib/middlewares/visitors/visitSfuInboundRtpPad.d.ts.map +0 -1
- package/lib/middlewares/visitors/visitSfuInboundRtpPad.js +0 -56
- package/lib/middlewares/visitors/visitSfuOutboundRtpPad.d.ts +0 -5
- package/lib/middlewares/visitors/visitSfuOutboundRtpPad.d.ts.map +0 -1
- package/lib/middlewares/visitors/visitSfuOutboundRtpPad.js +0 -56
- package/lib/middlewares/visitors/visitSfuSctpChannel.d.ts +0 -5
- package/lib/middlewares/visitors/visitSfuSctpChannel.d.ts.map +0 -1
- package/lib/middlewares/visitors/visitSfuSctpChannel.js +0 -55
- package/lib/middlewares/visitors/visitSfuTransport.d.ts +0 -5
- package/lib/middlewares/visitors/visitSfuTransport.d.ts.map +0 -1
- package/lib/middlewares/visitors/visitSfuTransport.js +0 -56
- package/lib/processes/closePeerConnectionProcess.d.ts +0 -10
- package/lib/processes/closePeerConnectionProcess.d.ts.map +0 -1
- package/lib/processes/closePeerConnectionProcess.js +0 -51
- package/lib/processes/detachClientProcess.d.ts +0 -14
- package/lib/processes/detachClientProcess.d.ts.map +0 -1
- package/lib/processes/detachClientProcess.js +0 -106
- package/lib/processes/findRemoteMatches.d.ts +0 -9
- package/lib/processes/findRemoteMatches.d.ts.map +0 -1
- package/lib/processes/findRemoteMatches.js +0 -96
- package/lib/processes/inboundTrackRemoved.d.ts +0 -9
- package/lib/processes/inboundTrackRemoved.d.ts.map +0 -1
- package/lib/processes/inboundTrackRemoved.js +0 -22
- package/lib/processes/joinClientProcess.d.ts +0 -11
- package/lib/processes/joinClientProcess.d.ts.map +0 -1
- package/lib/processes/joinClientProcess.js +0 -120
- package/lib/processes/outboundTrackRemoved.d.ts +0 -9
- package/lib/processes/outboundTrackRemoved.d.ts.map +0 -1
- package/lib/processes/outboundTrackRemoved.js +0 -22
- package/lib/samples/ObservedCall.d.ts +0 -17
- package/lib/samples/ObservedCall.d.ts.map +0 -1
- package/lib/samples/ObservedCall.js +0 -29
- package/lib/samples/ObservedCalls.d.ts +0 -19
- package/lib/samples/ObservedCalls.d.ts.map +0 -1
- package/lib/samples/ObservedCalls.js +0 -113
- package/lib/samples/ObservedClient.d.ts +0 -28
- package/lib/samples/ObservedClient.d.ts.map +0 -1
- package/lib/samples/ObservedClient.js +0 -110
- package/lib/samples/ObservedInboundAudioTrack.d.ts +0 -17
- package/lib/samples/ObservedInboundAudioTrack.d.ts.map +0 -1
- package/lib/samples/ObservedInboundAudioTrack.js +0 -17
- package/lib/samples/ObservedInboundVideoTrack.d.ts +0 -17
- package/lib/samples/ObservedInboundVideoTrack.d.ts.map +0 -1
- package/lib/samples/ObservedInboundVideoTrack.js +0 -17
- package/lib/samples/ObservedOutboundAudioTrack.d.ts +0 -16
- package/lib/samples/ObservedOutboundAudioTrack.d.ts.map +0 -1
- package/lib/samples/ObservedOutboundAudioTrack.js +0 -17
- package/lib/samples/ObservedOutboundVideoTrack.d.ts +0 -16
- package/lib/samples/ObservedOutboundVideoTrack.d.ts.map +0 -1
- package/lib/samples/ObservedOutboundVideoTrack.js +0 -17
- package/lib/samples/ObservedPeerConnection.d.ts +0 -47
- package/lib/samples/ObservedPeerConnection.d.ts.map +0 -1
- package/lib/samples/ObservedPeerConnection.js +0 -130
- package/lib/samples/ObservedSfu.d.ts +0 -27
- package/lib/samples/ObservedSfu.d.ts.map +0 -1
- package/lib/samples/ObservedSfu.js +0 -65
- package/lib/samples/ObservedSfuInboundRtpPad.d.ts +0 -15
- package/lib/samples/ObservedSfuInboundRtpPad.d.ts.map +0 -1
- package/lib/samples/ObservedSfuInboundRtpPad.js +0 -17
- package/lib/samples/ObservedSfuOutboundRtpPad.d.ts +0 -15
- package/lib/samples/ObservedSfuOutboundRtpPad.d.ts.map +0 -1
- package/lib/samples/ObservedSfuOutboundRtpPad.js +0 -17
- package/lib/samples/ObservedSfuSctpChannel.d.ts +0 -15
- package/lib/samples/ObservedSfuSctpChannel.d.ts.map +0 -1
- package/lib/samples/ObservedSfuSctpChannel.js +0 -17
- package/lib/samples/ObservedSfuTransport.d.ts +0 -30
- package/lib/samples/ObservedSfuTransport.d.ts.map +0 -1
- package/lib/samples/ObservedSfuTransport.js +0 -86
- package/lib/samples/ObservedSfus.d.ts +0 -16
- package/lib/samples/ObservedSfus.d.ts.map +0 -1
- package/lib/samples/ObservedSfus.js +0 -72
- package/lib/sinks/ObserverSink.d.ts.map +0 -1
- package/lib/sinks/callEventReports.d.ts.map +0 -1
- package/lib/sources/ObservedCallSource.d.ts +0 -18
- package/lib/sources/ObservedCallSource.d.ts.map +0 -1
- package/lib/sources/ObservedCallSource.js +0 -2
- package/lib/sources/ObservedClientSource.d.ts +0 -19
- package/lib/sources/ObservedClientSource.d.ts.map +0 -1
- package/lib/sources/ObservedClientSource.js +0 -2
- package/lib/sources/ObservedSfuSource.d.ts +0 -15
- package/lib/sources/ObservedSfuSource.d.ts.map +0 -1
- package/lib/sources/ObservedSfuSource.js +0 -2
- package/lib/sources/Sources.d.ts +0 -47
- package/lib/sources/Sources.d.ts.map +0 -1
- package/lib/sources/Sources.js +0 -211
- package/src/Evaluator.ts +0 -229
- package/src/common/Semaphore.ts +0 -45
- package/src/entries/CallEntry.ts +0 -62
- package/src/entries/ClientEntry.ts +0 -106
- package/src/entries/InboundTrackEntry.ts +0 -74
- package/src/entries/OutboundTrackEntry.ts +0 -72
- package/src/entries/PeerConnectionEntry.ts +0 -133
- package/src/entries/SfuEntry.ts +0 -62
- package/src/entries/SfuInboundRtpPadEntry.ts +0 -46
- package/src/entries/SfuOutboundRtpPadEntry.ts +0 -44
- package/src/entries/SfuSctpChannelEntry.ts +0 -39
- package/src/entries/SfuTransportEntry.ts +0 -109
- package/src/evaluators/SetClientsCoordinateEvaluator.ts +0 -78
- package/src/middlewares/CallOperationsContext.ts +0 -56
- package/src/middlewares/CallProcessor.ts +0 -38
- package/src/middlewares/CommitTransactionMiddleware.ts +0 -328
- package/src/middlewares/DeleteOutdatedCallEntries.ts +0 -159
- package/src/middlewares/DeleteOutdatedSfuEntries.ts +0 -168
- package/src/middlewares/Middleware.ts +0 -10
- package/src/middlewares/Processor.ts +0 -59
- package/src/middlewares/TransactionContext.ts +0 -176
- package/src/middlewares/TransactoinProcessor.ts +0 -28
- package/src/middlewares/VisitObservedCallsMiddleware.ts +0 -172
- package/src/middlewares/VisitObservedSfusMiddleware.ts +0 -203
- package/src/middlewares/visitors/visitClient.ts +0 -239
- package/src/middlewares/visitors/visitInboundAudioTrack.ts +0 -113
- package/src/middlewares/visitors/visitInboundVideoTrack.ts +0 -117
- package/src/middlewares/visitors/visitOutboundAudioTrack.ts +0 -100
- package/src/middlewares/visitors/visitOutboundVideoTarck.ts +0 -102
- package/src/middlewares/visitors/visitPeerConnection.ts +0 -151
- package/src/middlewares/visitors/visitSfu.ts +0 -70
- package/src/middlewares/visitors/visitSfuInboundRtpPad.ts +0 -52
- package/src/middlewares/visitors/visitSfuOutboundRtpPad.ts +0 -53
- package/src/middlewares/visitors/visitSfuSctpChannel.ts +0 -50
- package/src/middlewares/visitors/visitSfuTransport.ts +0 -50
- package/src/processes/closePeerConnectionProcess.ts +0 -54
- package/src/processes/detachClientProcess.ts +0 -136
- package/src/processes/findRemoteMatches.ts +0 -104
- package/src/processes/inboundTrackRemoved.ts +0 -22
- package/src/processes/joinClientProcess.ts +0 -138
- package/src/processes/outboundTrackRemoved.ts +0 -22
- package/src/samples/ObservedCall.ts +0 -49
- package/src/samples/ObservedCalls.ts +0 -143
- package/src/samples/ObservedClient.ts +0 -172
- package/src/samples/ObservedInboundAudioTrack.ts +0 -35
- package/src/samples/ObservedInboundVideoTrack.ts +0 -36
- package/src/samples/ObservedOutboundAudioTrack.ts +0 -35
- package/src/samples/ObservedOutboundVideoTrack.ts +0 -35
- package/src/samples/ObservedPeerConnection.ts +0 -227
- package/src/samples/ObservedSfu.ts +0 -115
- package/src/samples/ObservedSfuInboundRtpPad.ts +0 -35
- package/src/samples/ObservedSfuOutboundRtpPad.ts +0 -35
- package/src/samples/ObservedSfuSctpChannel.ts +0 -35
- package/src/samples/ObservedSfuTransport.ts +0 -142
- package/src/samples/ObservedSfus.ts +0 -95
- package/src/sources/ObservedCallSource.ts +0 -26
- package/src/sources/ObservedClientSource.ts +0 -28
- package/src/sources/ObservedSfuSource.ts +0 -19
- package/src/sources/Sources.ts +0 -294
- /package/lib/{sinks → common}/callEventReports.d.ts +0 -0
- /package/lib/{sinks → common}/callEventReports.js +0 -0
- /package/src/{sinks → common}/callEventReports.ts +0 -0
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { CallEventReport, CallMetaReport, ClientDataChannelReport, ClientExtensionReport, IceCandidatePairReport, InboundAudioTrackReport, InboundVideoTrackReport, ObserverEventReport, OutboundAudioTrackReport, OutboundVideoTrackReport, PeerConnectionTransportReport, SfuEventReport, SfuExtensionReport, SfuInboundRtpPadReport, SfuMetaReport, SfuOutboundRtpPadReport, SfuSctpStreamReport, SFUTransportReport } from '@observertc/report-schemas-js';
|
|
2
|
-
import {
|
|
3
|
-
import { ObserverSinkContext } from '../common/types';
|
|
2
|
+
import { ObserverSinkContext } from './common/types';
|
|
4
3
|
export type SinkEventsMap = {
|
|
5
4
|
'call-event': {
|
|
6
5
|
reports: CallEventReport[];
|
|
@@ -56,20 +55,12 @@ export type SinkEventsMap = {
|
|
|
56
55
|
'sfu-meta': {
|
|
57
56
|
reports: SfuMetaReport[];
|
|
58
57
|
};
|
|
58
|
+
'reports': ObserverSinkContext;
|
|
59
|
+
'newreport': number;
|
|
59
60
|
};
|
|
60
|
-
export type SinkConfig = Record<string, unknown>;
|
|
61
61
|
export type ObserverSinkProcess = (observerSinkContext: ObserverSinkContext) => Promise<void>;
|
|
62
|
-
export
|
|
63
|
-
|
|
64
|
-
off<K extends keyof SinkEventsMap>(event: K, listener: (reports: SinkEventsMap[K]) => void): this;
|
|
65
|
-
once<K extends keyof SinkEventsMap>(event: K, listener: (reports: SinkEventsMap[K]) => void): this;
|
|
66
|
-
}
|
|
67
|
-
export declare class SinkImpl implements ReportsCollector, ObserverReportsEmitter {
|
|
68
|
-
readonly config: SinkConfig;
|
|
69
|
-
private _index;
|
|
70
|
-
private _processes;
|
|
71
|
-
private _customProcesses;
|
|
72
|
-
private readonly _processor;
|
|
62
|
+
export declare class ReportsCollector {
|
|
63
|
+
private _collectedReports;
|
|
73
64
|
private _emitter;
|
|
74
65
|
private _callEventReports;
|
|
75
66
|
private _callMetaReports;
|
|
@@ -89,7 +80,7 @@ export declare class SinkImpl implements ReportsCollector, ObserverReportsEmitte
|
|
|
89
80
|
private _sfuSctpStreamReports;
|
|
90
81
|
private _sfuTransportReports;
|
|
91
82
|
private _sfuMetaReports;
|
|
92
|
-
constructor(
|
|
83
|
+
constructor();
|
|
93
84
|
on<K extends keyof SinkEventsMap>(event: K, listener: (reports: SinkEventsMap[K]) => void): this;
|
|
94
85
|
off<K extends keyof SinkEventsMap>(event: K, listener: (reports: SinkEventsMap[K]) => void): this;
|
|
95
86
|
once<K extends keyof SinkEventsMap>(event: K, listener: (reports: SinkEventsMap[K]) => void): this;
|
|
@@ -111,15 +102,8 @@ export declare class SinkImpl implements ReportsCollector, ObserverReportsEmitte
|
|
|
111
102
|
addSfuSctpStreamReport(report: SfuSctpStreamReport): void;
|
|
112
103
|
addSfuTransportReport(report: SFUTransportReport): void;
|
|
113
104
|
addSfuMetaReport(report: SfuMetaReport): void;
|
|
114
|
-
getCallEventReports(): CallEventReport[];
|
|
115
|
-
getClientExtensionReports(): ClientExtensionReport[];
|
|
116
|
-
getSfuEventReports(): SfuEventReport[];
|
|
117
|
-
getSfuExtensionReports(): SfuExtensionReport[];
|
|
118
|
-
addProcess(process: ObserverSinkProcess): void;
|
|
119
|
-
removeProcess(process: ObserverSinkProcess): void;
|
|
120
|
-
private _process;
|
|
121
105
|
emit(): number;
|
|
122
106
|
private _emit;
|
|
123
107
|
private _createObserverSinkContext;
|
|
124
108
|
}
|
|
125
|
-
//# sourceMappingURL=
|
|
109
|
+
//# sourceMappingURL=ReportsCollector.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ReportsCollector.d.ts","sourceRoot":"","sources":["../src/ReportsCollector.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,eAAe,EACf,cAAc,EACd,uBAAuB,EACvB,qBAAqB,EACrB,sBAAsB,EACtB,uBAAuB,EACvB,uBAAuB,EACvB,mBAAmB,EACnB,wBAAwB,EACxB,wBAAwB,EACxB,6BAA6B,EAC7B,cAAc,EACd,kBAAkB,EAClB,sBAAsB,EACtB,aAAa,EACb,uBAAuB,EACvB,mBAAmB,EACnB,kBAAkB,EAClB,MAAM,+BAA+B,CAAC;AAEvC,OAAO,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAErD,MAAM,MAAM,aAAa,GAAG;IAC3B,YAAY,EAAE;QACb,OAAO,EAAE,eAAe,EAAE,CAAC;KAC3B,CAAC;IACF,WAAW,EAAE;QACZ,OAAO,EAAE,cAAc,EAAE,CAAC;KAC1B,CAAC;IACF,qBAAqB,EAAE;QACtB,OAAO,EAAE,uBAAuB,EAAE,CAAC;KACnC,CAAC;IACF,kBAAkB,EAAE;QACnB,OAAO,EAAE,qBAAqB,EAAE,CAAC;KACjC,CAAC;IACF,oBAAoB,EAAE;QACrB,OAAO,EAAE,sBAAsB,EAAE,CAAC;KAClC,CAAC;IACF,2BAA2B,EAAE;QAC5B,OAAO,EAAE,6BAA6B,EAAE,CAAC;KACzC,CAAC;IACF,qBAAqB,EAAE;QACtB,OAAO,EAAE,uBAAuB,EA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MAAM,EAAE,mBAAmB;IAKlD,2BAA2B,CAAC,MAAM,EAAE,wBAAwB;IAK5D,2BAA2B,CAAC,MAAM,EAAE,wBAAwB;IAK5D,iBAAiB,CAAC,MAAM,EAAE,cAAc;IAKxC,qBAAqB,CAAC,MAAM,EAAE,kBAAkB;IAKhD,yBAAyB,CAAC,MAAM,EAAE,sBAAsB;IAKxD,0BAA0B,CAAC,MAAM,EAAE,uBAAuB;IAK1D,sBAAsB,CAAC,MAAM,EAAE,mBAAmB;IAKlD,qBAAqB,CAAC,MAAM,EAAE,kBAAkB;IAKhD,gBAAgB,CAAC,MAAM,EAAE,aAAa;IAKtC,IAAI,IAAI,MAAM;IAwErB,OAAO,CAAC,KAAK;IAIb,OAAO,CAAC,0BAA0B;CAyClC"}
|
|
@@ -1,24 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.
|
|
3
|
+
exports.ReportsCollector = void 0;
|
|
13
4
|
const events_1 = require("events");
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
constructor(config) {
|
|
18
|
-
this.config = config;
|
|
19
|
-
this._index = 0;
|
|
20
|
-
this._processes = new Map();
|
|
21
|
-
this._customProcesses = new Map();
|
|
5
|
+
class ReportsCollector {
|
|
6
|
+
constructor() {
|
|
7
|
+
this._collectedReports = 0;
|
|
22
8
|
this._emitter = new events_1.EventEmitter();
|
|
23
9
|
this._callEventReports = [];
|
|
24
10
|
this._callMetaReports = [];
|
|
@@ -38,7 +24,7 @@ class SinkImpl {
|
|
|
38
24
|
this._sfuSctpStreamReports = [];
|
|
39
25
|
this._sfuTransportReports = [];
|
|
40
26
|
this._sfuMetaReports = [];
|
|
41
|
-
|
|
27
|
+
// empty
|
|
42
28
|
}
|
|
43
29
|
on(event, listener) {
|
|
44
30
|
this._emitter.addListener(event, listener);
|
|
@@ -54,132 +40,86 @@ class SinkImpl {
|
|
|
54
40
|
}
|
|
55
41
|
addCallEventReport(report) {
|
|
56
42
|
this._callEventReports.push(report);
|
|
43
|
+
this._emit('newreport', ++this._collectedReports);
|
|
57
44
|
}
|
|
58
45
|
addCallMetaReport(report) {
|
|
59
46
|
this._callMetaReports.push(report);
|
|
47
|
+
this._emit('newreport', ++this._collectedReports);
|
|
60
48
|
}
|
|
61
49
|
addClientDataChannelReport(report) {
|
|
62
50
|
this._clientDataChannelReports.push(report);
|
|
51
|
+
this._emit('newreport', ++this._collectedReports);
|
|
63
52
|
}
|
|
64
53
|
addClientExtensionReport(report) {
|
|
65
54
|
this._clientExtensionReports.push(report);
|
|
55
|
+
this._emit('newreport', ++this._collectedReports);
|
|
66
56
|
}
|
|
67
57
|
addIceCandidatePairReport(report) {
|
|
68
58
|
this._iceCandidatePairReports.push(report);
|
|
59
|
+
this._emit('newreport', ++this._collectedReports);
|
|
69
60
|
}
|
|
70
61
|
addInboundAudioTrackReport(report) {
|
|
71
62
|
this._inboundAudioTrackReports.push(report);
|
|
63
|
+
this._emit('newreport', ++this._collectedReports);
|
|
72
64
|
}
|
|
73
65
|
addInboundVideoTrackReport(report) {
|
|
74
66
|
this._inboundVideoTrackReports.push(report);
|
|
67
|
+
this._emit('newreport', ++this._collectedReports);
|
|
75
68
|
}
|
|
76
69
|
addPeerConnectionTransportReports(report) {
|
|
77
70
|
this._peerConnectionTransportReports.push(report);
|
|
71
|
+
this._emit('newreport', ++this._collectedReports);
|
|
78
72
|
}
|
|
79
73
|
addObserverEventReport(report) {
|
|
80
74
|
this._observerEventReports.push(report);
|
|
75
|
+
this._emit('newreport', ++this._collectedReports);
|
|
81
76
|
}
|
|
82
77
|
addOutboundAudioTrackReport(report) {
|
|
83
78
|
this._outboundAudioTrackReports.push(report);
|
|
79
|
+
this._emit('newreport', ++this._collectedReports);
|
|
84
80
|
}
|
|
85
81
|
addOutboundVideoTrackReport(report) {
|
|
86
82
|
this._outboundVideoTrackReports.push(report);
|
|
83
|
+
this._emit('newreport', ++this._collectedReports);
|
|
87
84
|
}
|
|
88
85
|
addSfuEventReport(report) {
|
|
89
86
|
this._sfuEventReports.push(report);
|
|
87
|
+
this._emit('newreport', ++this._collectedReports);
|
|
90
88
|
}
|
|
91
89
|
addSfuExtensionReport(report) {
|
|
92
90
|
this._sfuExtensionReports.push(report);
|
|
91
|
+
this._emit('newreport', ++this._collectedReports);
|
|
93
92
|
}
|
|
94
93
|
addSfuInboundRtpPadReport(report) {
|
|
95
94
|
this._sfuInboundRtpPadReports.push(report);
|
|
95
|
+
this._emit('newreport', ++this._collectedReports);
|
|
96
96
|
}
|
|
97
97
|
addSfuOutboundRtpPadReport(report) {
|
|
98
98
|
this._sfuOutboundRtpPadReports.push(report);
|
|
99
|
+
this._emit('newreport', ++this._collectedReports);
|
|
99
100
|
}
|
|
100
101
|
addSfuSctpStreamReport(report) {
|
|
101
102
|
this._sfuSctpStreamReports.push(report);
|
|
103
|
+
this._emit('newreport', ++this._collectedReports);
|
|
102
104
|
}
|
|
103
105
|
addSfuTransportReport(report) {
|
|
104
106
|
this._sfuTransportReports.push(report);
|
|
107
|
+
this._emit('newreport', ++this._collectedReports);
|
|
105
108
|
}
|
|
106
109
|
addSfuMetaReport(report) {
|
|
107
110
|
this._sfuMetaReports.push(report);
|
|
108
|
-
|
|
109
|
-
getCallEventReports() {
|
|
110
|
-
return this._callEventReports;
|
|
111
|
-
}
|
|
112
|
-
getClientExtensionReports() {
|
|
113
|
-
return this._clientExtensionReports;
|
|
114
|
-
}
|
|
115
|
-
getSfuEventReports() {
|
|
116
|
-
return this._sfuEventReports;
|
|
117
|
-
}
|
|
118
|
-
getSfuExtensionReports() {
|
|
119
|
-
return this._sfuExtensionReports;
|
|
120
|
-
}
|
|
121
|
-
addProcess(process) {
|
|
122
|
-
const middleware = (context, next) => __awaiter(this, void 0, void 0, function* () {
|
|
123
|
-
yield process(context);
|
|
124
|
-
if (next)
|
|
125
|
-
yield next(context);
|
|
126
|
-
});
|
|
127
|
-
this._customProcesses.set(process, middleware);
|
|
128
|
-
this._processor.addMiddleware(middleware);
|
|
129
|
-
}
|
|
130
|
-
removeProcess(process) {
|
|
131
|
-
const middleware = this._customProcesses.get(process);
|
|
132
|
-
if (!middleware) {
|
|
133
|
-
return;
|
|
134
|
-
}
|
|
135
|
-
this._customProcesses.delete(process);
|
|
136
|
-
this._processor.removeMiddleware(middleware);
|
|
137
|
-
}
|
|
138
|
-
_process(context) {
|
|
139
|
-
var _a;
|
|
140
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
141
|
-
if (this._processor.getSize() < 1) {
|
|
142
|
-
// no process to execute
|
|
143
|
-
return;
|
|
144
|
-
}
|
|
145
|
-
if (this._processes.has(this._index)) {
|
|
146
|
-
VisitObservedCallsMiddleware_1.logger.warn('The sink process has been called while the previous process has not yet completed. This may indicate that the observer is attempting to process more reports than it can handle.');
|
|
147
|
-
}
|
|
148
|
-
const actualBlockingPoint = (_a = this._processes.get(this._index)) !== null && _a !== void 0 ? _a : Promise.resolve();
|
|
149
|
-
const index = ++this._index;
|
|
150
|
-
const result = new Promise((resolve, reject) => {
|
|
151
|
-
actualBlockingPoint.then(() => {
|
|
152
|
-
this._processor.use(context)
|
|
153
|
-
.then(() => resolve())
|
|
154
|
-
.catch((err) => reject(err));
|
|
155
|
-
});
|
|
156
|
-
});
|
|
157
|
-
const nextBlockingPoint = new Promise((resolve) => {
|
|
158
|
-
result.then(() => {
|
|
159
|
-
this._processes.delete(index);
|
|
160
|
-
resolve();
|
|
161
|
-
}).catch(() => {
|
|
162
|
-
this._processes.delete(index);
|
|
163
|
-
resolve();
|
|
164
|
-
});
|
|
165
|
-
});
|
|
166
|
-
this._processes.set(index, nextBlockingPoint);
|
|
167
|
-
return result;
|
|
168
|
-
});
|
|
111
|
+
this._emit('newreport', ++this._collectedReports);
|
|
169
112
|
}
|
|
170
113
|
emit() {
|
|
171
114
|
let result = 0;
|
|
172
115
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
173
116
|
const checkAndEmit = (eventName, reports) => {
|
|
174
|
-
if (reports.length
|
|
117
|
+
if (0 < reports.length) {
|
|
175
118
|
this._emit(eventName, { reports });
|
|
176
119
|
result += reports.length;
|
|
177
120
|
}
|
|
178
121
|
};
|
|
179
122
|
const context = this._createObserverSinkContext();
|
|
180
|
-
this._process(context).catch((err) => {
|
|
181
|
-
VisitObservedCallsMiddleware_1.logger.error('Error occurred while processing reports', err);
|
|
182
|
-
});
|
|
183
123
|
checkAndEmit('call-event', this._callEventReports);
|
|
184
124
|
this._callEventReports = [];
|
|
185
125
|
checkAndEmit('call-meta', this._callMetaReports);
|
|
@@ -216,6 +156,8 @@ class SinkImpl {
|
|
|
216
156
|
this._sfuTransportReports = [];
|
|
217
157
|
checkAndEmit('sfu-meta', this._sfuMetaReports);
|
|
218
158
|
this._sfuMetaReports = [];
|
|
159
|
+
this._emit('reports', context);
|
|
160
|
+
this._collectedReports = 0;
|
|
219
161
|
return result;
|
|
220
162
|
}
|
|
221
163
|
_emit(event, reports) {
|
|
@@ -262,4 +204,4 @@ class SinkImpl {
|
|
|
262
204
|
};
|
|
263
205
|
}
|
|
264
206
|
}
|
|
265
|
-
exports.
|
|
207
|
+
exports.ReportsCollector = ReportsCollector;
|
|
@@ -1,26 +1,23 @@
|
|
|
1
1
|
import { CallEventReport, CallMetaReport, ClientDataChannelReport, ClientExtensionReport, IceCandidatePairReport, InboundAudioTrackReport, InboundVideoTrackReport, ObserverEventReport, OutboundAudioTrackReport, OutboundVideoTrackReport, PeerConnectionTransportReport, SfuEventReport, SfuExtensionReport, SfuInboundRtpPadReport, SfuMetaReport, SfuOutboundRtpPadReport, SfuSctpStreamReport, SFUTransportReport } from '@observertc/report-schemas-js';
|
|
2
|
-
export
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
getSfuEventReports(): SfuEventReport[];
|
|
24
|
-
getSfuExtensionReports(): SfuExtensionReport[];
|
|
25
|
-
}
|
|
2
|
+
export type ObservedReports = ReturnType<typeof createObservedReports>;
|
|
3
|
+
export declare function createObservedReports(): {
|
|
4
|
+
callEventReports: CallEventReport[];
|
|
5
|
+
callMetaReports: CallMetaReport[];
|
|
6
|
+
clientDataChannelReports: ClientDataChannelReport[];
|
|
7
|
+
clientExtensionReports: ClientExtensionReport[];
|
|
8
|
+
iceCandidatePairReports: IceCandidatePairReport[];
|
|
9
|
+
inboundAudioTrackReports: InboundAudioTrackReport[];
|
|
10
|
+
inboundVideoTrackReports: InboundVideoTrackReport[];
|
|
11
|
+
observerEventReports: ObserverEventReport[];
|
|
12
|
+
outboundAudioTrackReports: OutboundAudioTrackReport[];
|
|
13
|
+
outboundVideoTrackReports: OutboundVideoTrackReport[];
|
|
14
|
+
peerConnectionTransportReports: PeerConnectionTransportReport[];
|
|
15
|
+
sfuEventReports: SfuEventReport[];
|
|
16
|
+
sfuExtensionReports: SfuExtensionReport[];
|
|
17
|
+
sfuInboundRtpPadReports: SfuInboundRtpPadReport[];
|
|
18
|
+
sfuMetaReports: SfuMetaReport[];
|
|
19
|
+
sfuOutboundRtpPadReports: SfuOutboundRtpPadReport[];
|
|
20
|
+
sfuSctpStreamReports: SfuSctpStreamReport[];
|
|
21
|
+
sfuTransportReports: SFUTransportReport[];
|
|
22
|
+
};
|
|
26
23
|
//# sourceMappingURL=ReportsCollector.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ReportsCollector.d.ts","sourceRoot":"","sources":["../../src/common/ReportsCollector.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,eAAe,EACf,cAAc,EACd,uBAAuB,EACvB,qBAAqB,EACrB,sBAAsB,EACtB,uBAAuB,EACvB,uBAAuB,EACvB,mBAAmB,EACnB,wBAAwB,EACxB,wBAAwB,EACxB,6BAA6B,EAC7B,cAAc,EACd,kBAAkB,EAClB,sBAAsB,EACtB,aAAa,EACb,uBAAuB,EACvB,mBAAmB,EACnB,kBAAkB,EAClB,MAAM,+BAA+B,CAAC;
|
|
1
|
+
{"version":3,"file":"ReportsCollector.d.ts","sourceRoot":"","sources":["../../src/common/ReportsCollector.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,eAAe,EACf,cAAc,EACd,uBAAuB,EACvB,qBAAqB,EACrB,sBAAsB,EACtB,uBAAuB,EACvB,uBAAuB,EACvB,mBAAmB,EACnB,wBAAwB,EACxB,wBAAwB,EACxB,6BAA6B,EAC7B,cAAc,EACd,kBAAkB,EAClB,sBAAsB,EACtB,aAAa,EACb,uBAAuB,EACvB,mBAAmB,EACnB,kBAAkB,EAClB,MAAM,+BAA+B,CAAC;AA4BvC,MAAM,MAAM,eAAe,GAAG,UAAU,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAEvE,wBAAgB,qBAAqB;;;;;;;;;;;;;;;;;;;EAqBpC"}
|
|
@@ -1,2 +1,26 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createObservedReports = void 0;
|
|
4
|
+
function createObservedReports() {
|
|
5
|
+
return {
|
|
6
|
+
callEventReports: [],
|
|
7
|
+
callMetaReports: [],
|
|
8
|
+
clientDataChannelReports: [],
|
|
9
|
+
clientExtensionReports: [],
|
|
10
|
+
iceCandidatePairReports: [],
|
|
11
|
+
inboundAudioTrackReports: [],
|
|
12
|
+
inboundVideoTrackReports: [],
|
|
13
|
+
observerEventReports: [],
|
|
14
|
+
outboundAudioTrackReports: [],
|
|
15
|
+
outboundVideoTrackReports: [],
|
|
16
|
+
peerConnectionTransportReports: [],
|
|
17
|
+
sfuEventReports: [],
|
|
18
|
+
sfuExtensionReports: [],
|
|
19
|
+
sfuInboundRtpPadReports: [],
|
|
20
|
+
sfuMetaReports: [],
|
|
21
|
+
sfuOutboundRtpPadReports: [],
|
|
22
|
+
sfuSctpStreamReports: [],
|
|
23
|
+
sfuTransportReports: [],
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
exports.createObservedReports = createObservedReports;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SingleExecutor.d.ts","sourceRoot":"","sources":["../../src/common/SingleExecutor.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,cAAc,GAAG,UAAU,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAErE,wBAAgB,oBAAoB,wDAiCnC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createSingleExecutor = void 0;
|
|
4
|
+
function createSingleExecutor() {
|
|
5
|
+
let semaphore = 1;
|
|
6
|
+
const tasks = [];
|
|
7
|
+
const execute = (task) => {
|
|
8
|
+
return new Promise((resolve, reject) => {
|
|
9
|
+
tasks.push(() => task().then(resolve)
|
|
10
|
+
.catch(reject));
|
|
11
|
+
run();
|
|
12
|
+
});
|
|
13
|
+
};
|
|
14
|
+
const run = () => {
|
|
15
|
+
if (semaphore < 1)
|
|
16
|
+
return;
|
|
17
|
+
const task = tasks.shift();
|
|
18
|
+
if (!task)
|
|
19
|
+
return;
|
|
20
|
+
const postProcess = () => {
|
|
21
|
+
++semaphore;
|
|
22
|
+
run();
|
|
23
|
+
};
|
|
24
|
+
--semaphore;
|
|
25
|
+
task()
|
|
26
|
+
.then(postProcess)
|
|
27
|
+
.catch(postProcess);
|
|
28
|
+
};
|
|
29
|
+
return execute;
|
|
30
|
+
}
|
|
31
|
+
exports.createSingleExecutor = createSingleExecutor;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export type EventMap = {
|
|
2
|
+
[key: string]: [...unknown[]];
|
|
3
|
+
};
|
|
4
|
+
export declare function createTypedEventEmitter<Events extends EventMap>(): TypedEventEmitter<Events>;
|
|
5
|
+
export interface TypedEventEmitter<Events extends EventMap> {
|
|
6
|
+
addListener<E extends keyof Events>(event: E, listener: (...data: Events[E]) => void): this;
|
|
7
|
+
on<E extends keyof Events>(event: E, listener: (...data: Events[E]) => void): this;
|
|
8
|
+
once<E extends keyof Events>(event: E, listener: (...data: Events[E]) => void): this;
|
|
9
|
+
prependListener<E extends keyof Events>(event: E, listener: (...data: Events[E]) => void): this;
|
|
10
|
+
prependOnceListener<E extends keyof Events>(event: E, listener: (...data: Events[E]) => void): this;
|
|
11
|
+
off<E extends keyof Events>(event: E, listener: (...data: Events[E]) => void): this;
|
|
12
|
+
removeAllListeners<E extends keyof Events>(event?: E): this;
|
|
13
|
+
removeListener<E extends keyof Events>(event: E, listener: (...data: Events[E]) => void): this;
|
|
14
|
+
emit<E extends keyof Events>(event: E, ...args: Events[E]): boolean;
|
|
15
|
+
eventNames(): (keyof Events | string | symbol)[];
|
|
16
|
+
rawListeners<E extends keyof Events>(event: E): ((...data: Events[E]) => void)[];
|
|
17
|
+
listeners<E extends keyof Events>(event: E): ((...data: Events[E]) => void)[];
|
|
18
|
+
listenerCount<E extends keyof Events>(event: E): number;
|
|
19
|
+
getMaxListeners(): number;
|
|
20
|
+
setMaxListeners(maxListeners: number): this;
|
|
21
|
+
}
|
|
22
|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
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.createTypedEventEmitter = void 0;
|
|
7
|
+
const events_1 = __importDefault(require("events"));
|
|
8
|
+
function createTypedEventEmitter() {
|
|
9
|
+
return new events_1.default();
|
|
10
|
+
}
|
|
11
|
+
exports.createTypedEventEmitter = createTypedEventEmitter;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"callEventReports.d.ts","sourceRoot":"","sources":["../../src/common/callEventReports.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAGhE,oBAAY,aAAa;IACxB,YAAY,iBAAiB;IAC7B,UAAU,eAAe;IACzB,aAAa,kBAAkB;IAC/B,WAAW,gBAAgB;IAC3B,sBAAsB,2BAA2B;IACjD,sBAAsB,2BAA2B;IACjD,iBAAiB,sBAAsB;IACvC,mBAAmB,wBAAwB;CAC3C;AACD,wBAAgB,4BAA4B,CAC3C,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,MAAM,EACjB,MAAM,CAAC,EAAE,MAAM,GACb,eAAe,CASjB;AAED,wBAAgB,0BAA0B,CACzC,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,MAAM,EACjB,MAAM,CAAC,EAAE,MAAM,GACb,eAAe,CASjB;AAED,wBAAgB,6BAA6B,CAC5C,SAAS,EAAE,MAAM,EACjB,WAAW,EAAE,MAAM,EACnB,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,MAAM,EAChB,SAAS,EAAE,MAAM,EACjB,MAAM,CAAC,EAAE,MAAM,EACf,MAAM,CAAC,EAAE,MAAM,GACb,eAAe,CAYjB;AAED,wBAAgB,2BAA2B,CAC1C,SAAS,EAAE,MAAM,EACjB,WAAW,EAAE,MAA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interface Logger {
|
|
|
6
6
|
warn(...args: any[]): void;
|
|
7
7
|
error(...args: any[]): void;
|
|
8
8
|
}
|
|
9
|
-
export
|
|
10
|
-
init(): void;
|
|
11
|
-
level: LogLevel | undefined;
|
|
12
|
-
logger: Logger;
|
|
13
|
-
}
|
|
14
|
-
export type LoggerFactory = () => Logger;
|
|
15
|
-
export declare const createLogger: (moduleName: string, logLevel?: LogLevel) => WrappedLogger;
|
|
16
|
-
export declare const setLogLevel: (level: LogLevel) => void;
|
|
17
|
-
export declare const setLoggerFactory: (loggerFactory: LoggerFactory) => void;
|
|
9
|
+
export declare function setLogLevel(level: LogLevel): void;
|
|
18
10
|
export declare const getLogLevel: () => LogLevel;
|
|
11
|
+
export declare function forwardLogsTo(logger: Logger | null): void;
|
|
12
|
+
export declare function createLogger(moduleName: string): Logger;
|
|
19
13
|
//# sourceMappingURL=logger.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../src/common/logger.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,QAAQ,GAAG,OAAO,GAAG,OAAO,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,QAAQ,CAAC;AAEhF,MAAM,WAAW,MAAM;IAEtB,KAAK,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC;IAE5B,KAAK,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC;IAE5B,IAAI,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC;IAE3B,IAAI,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC;IAE3B,KAAK,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC;CAC5B;
|
|
1
|
+
{"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../src/common/logger.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,QAAQ,G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