@observertc/observer-js 0.9.27-beta → 0.30.0-e12fcb4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (298) hide show
  1. package/lib/ObservedCall.d.ts +54 -0
  2. package/lib/ObservedCall.d.ts.map +1 -0
  3. package/lib/ObservedCall.js +166 -0
  4. package/lib/ObservedClient.d.ts +73 -0
  5. package/lib/ObservedClient.d.ts.map +1 -0
  6. package/lib/ObservedClient.js +487 -0
  7. package/lib/ObservedInboundTrack.d.ts +65 -0
  8. package/lib/ObservedInboundTrack.d.ts.map +1 -0
  9. package/lib/ObservedInboundTrack.js +192 -0
  10. package/lib/ObservedOutboundTrack.d.ts +55 -0
  11. package/lib/ObservedOutboundTrack.d.ts.map +1 -0
  12. package/lib/ObservedOutboundTrack.js +166 -0
  13. package/lib/ObservedPeerConnection.d.ts +57 -0
  14. package/lib/ObservedPeerConnection.d.ts.map +1 -0
  15. package/lib/ObservedPeerConnection.js +217 -0
  16. package/lib/Observer.d.ts +26 -1465
  17. package/lib/Observer.d.ts.map +1 -1
  18. package/lib/Observer.js +53 -605
  19. package/lib/{sinks/ObserverSink.d.ts → ReportsCollector.d.ts} +7 -23
  20. package/lib/ReportsCollector.d.ts.map +1 -0
  21. package/lib/{sinks/ObserverSink.js → ReportsCollector.js} +27 -85
  22. package/lib/common/ReportsCollector.d.ts +21 -24
  23. package/lib/common/ReportsCollector.d.ts.map +1 -1
  24. package/lib/common/ReportsCollector.js +24 -0
  25. package/lib/common/SingleExecutor.d.ts +3 -0
  26. package/lib/common/SingleExecutor.d.ts.map +1 -0
  27. package/lib/common/SingleExecutor.js +31 -0
  28. package/lib/common/TypedEventEmitter.d.ts +22 -0
  29. package/lib/common/TypedEventEmitter.d.ts.map +1 -0
  30. package/lib/common/TypedEventEmitter.js +11 -0
  31. package/lib/common/callEventReports.d.ts.map +1 -0
  32. package/lib/common/logger.d.ts +3 -9
  33. package/lib/common/logger.d.ts.map +1 -1
  34. package/lib/common/logger.js +58 -141
  35. package/lib/common/types.d.ts +2 -14
  36. package/lib/common/types.d.ts.map +1 -1
  37. package/lib/common/utils.d.ts +1 -0
  38. package/lib/common/utils.d.ts.map +1 -1
  39. package/lib/common/utils.js +6 -1
  40. package/lib/index.d.ts +8 -19
  41. package/lib/index.d.ts.map +1 -1
  42. package/lib/index.js +7 -2
  43. package/package.json +1 -1
  44. package/src/ObservedCall.ts +201 -0
  45. package/src/ObservedClient.ts +681 -0
  46. package/src/ObservedInboundTrack.ts +238 -0
  47. package/src/ObservedOutboundTrack.ts +205 -0
  48. package/src/ObservedPeerConnection.ts +249 -0
  49. package/src/Observer.ts +86 -442
  50. package/src/{sinks/ObserverSink.ts → ReportsCollector.ts} +29 -94
  51. package/src/common/ReportsCollector.ts +48 -23
  52. package/src/common/SingleExecutor.ts +36 -0
  53. package/src/common/TypedEventEmitter.ts +32 -0
  54. package/src/common/logger.ts +58 -161
  55. package/src/common/types.ts +4 -24
  56. package/src/common/utils.ts +6 -0
  57. package/src/index.ts +12 -23
  58. package/lib/Evaluator.d.ts +0 -43
  59. package/lib/Evaluator.d.ts.map +0 -1
  60. package/lib/Evaluator.js +0 -171
  61. package/lib/common/Semaphore.d.ts +0 -31
  62. package/lib/common/Semaphore.d.ts.map +0 -1
  63. package/lib/common/Semaphore.js +0 -16
  64. package/lib/entries/CallEntry.d.ts +0 -619
  65. package/lib/entries/CallEntry.d.ts.map +0 -1
  66. package/lib/entries/CallEntry.js +0 -75
  67. package/lib/entries/ClientEntry.d.ts +0 -478
  68. package/lib/entries/ClientEntry.d.ts.map +0 -1
  69. package/lib/entries/ClientEntry.js +0 -114
  70. package/lib/entries/InboundTrackEntry.d.ts +0 -682
  71. package/lib/entries/InboundTrackEntry.d.ts.map +0 -1
  72. package/lib/entries/InboundTrackEntry.js +0 -76
  73. package/lib/entries/OutboundTrackEntry.d.ts +0 -682
  74. package/lib/entries/OutboundTrackEntry.d.ts.map +0 -1
  75. package/lib/entries/OutboundTrackEntry.js +0 -73
  76. package/lib/entries/PeerConnectionEntry.d.ts +0 -505
  77. package/lib/entries/PeerConnectionEntry.d.ts.map +0 -1
  78. package/lib/entries/PeerConnectionEntry.js +0 -144
  79. package/lib/entries/SfuEntry.d.ts +0 -150
  80. package/lib/entries/SfuEntry.d.ts.map +0 -1
  81. package/lib/entries/SfuEntry.js +0 -77
  82. package/lib/entries/SfuInboundRtpPadEntry.d.ts +0 -14
  83. package/lib/entries/SfuInboundRtpPadEntry.d.ts.map +0 -1
  84. package/lib/entries/SfuInboundRtpPadEntry.js +0 -49
  85. package/lib/entries/SfuOutboundRtpPadEntry.d.ts +0 -14
  86. package/lib/entries/SfuOutboundRtpPadEntry.d.ts.map +0 -1
  87. package/lib/entries/SfuOutboundRtpPadEntry.js +0 -47
  88. package/lib/entries/SfuSctpChannelEntry.d.ts +0 -12
  89. package/lib/entries/SfuSctpChannelEntry.d.ts.map +0 -1
  90. package/lib/entries/SfuSctpChannelEntry.js +0 -43
  91. package/lib/entries/SfuTransportEntry.d.ts +0 -82
  92. package/lib/entries/SfuTransportEntry.d.ts.map +0 -1
  93. package/lib/entries/SfuTransportEntry.js +0 -122
  94. package/lib/evaluators/SetClientsCoordinateEvaluator.d.ts +0 -9
  95. package/lib/evaluators/SetClientsCoordinateEvaluator.d.ts.map +0 -1
  96. package/lib/evaluators/SetClientsCoordinateEvaluator.js +0 -95
  97. package/lib/middlewares/CallOperationsContext.d.ts +0 -18
  98. package/lib/middlewares/CallOperationsContext.d.ts.map +0 -1
  99. package/lib/middlewares/CallOperationsContext.js +0 -27
  100. package/lib/middlewares/CallProcessor.d.ts +0 -6
  101. package/lib/middlewares/CallProcessor.d.ts.map +0 -1
  102. package/lib/middlewares/CallProcessor.js +0 -36
  103. package/lib/middlewares/CommitTransactionMiddleware.d.ts +0 -6
  104. package/lib/middlewares/CommitTransactionMiddleware.d.ts.map +0 -1
  105. package/lib/middlewares/CommitTransactionMiddleware.js +0 -179
  106. package/lib/middlewares/DeleteOutdatedCallEntries.d.ts +0 -6
  107. package/lib/middlewares/DeleteOutdatedCallEntries.d.ts.map +0 -1
  108. package/lib/middlewares/DeleteOutdatedCallEntries.js +0 -121
  109. package/lib/middlewares/DeleteOutdatedSfuEntries.d.ts +0 -6
  110. package/lib/middlewares/DeleteOutdatedSfuEntries.d.ts.map +0 -1
  111. package/lib/middlewares/DeleteOutdatedSfuEntries.js +0 -127
  112. package/lib/middlewares/Middleware.d.ts +0 -3
  113. package/lib/middlewares/Middleware.d.ts.map +0 -1
  114. package/lib/middlewares/Middleware.js +0 -21
  115. package/lib/middlewares/Processor.d.ts +0 -9
  116. package/lib/middlewares/Processor.d.ts.map +0 -1
  117. package/lib/middlewares/Processor.js +0 -54
  118. package/lib/middlewares/TransactionContext.d.ts +0 -35
  119. package/lib/middlewares/TransactionContext.d.ts.map +0 -1
  120. package/lib/middlewares/TransactionContext.js +0 -90
  121. package/lib/middlewares/TransactoinProcessor.d.ts +0 -6
  122. package/lib/middlewares/TransactoinProcessor.d.ts.map +0 -1
  123. package/lib/middlewares/TransactoinProcessor.js +0 -17
  124. package/lib/middlewares/VisitObservedCallsMiddleware.d.ts +0 -7
  125. package/lib/middlewares/VisitObservedCallsMiddleware.d.ts.map +0 -1
  126. package/lib/middlewares/VisitObservedCallsMiddleware.js +0 -96
  127. package/lib/middlewares/VisitObservedSfusMiddleware.d.ts +0 -6
  128. package/lib/middlewares/VisitObservedSfusMiddleware.d.ts.map +0 -1
  129. package/lib/middlewares/VisitObservedSfusMiddleware.js +0 -151
  130. package/lib/middlewares/visitors/visitClient.d.ts +0 -5
  131. package/lib/middlewares/visitors/visitClient.d.ts.map +0 -1
  132. package/lib/middlewares/visitors/visitClient.js +0 -174
  133. package/lib/middlewares/visitors/visitInboundAudioTrack.d.ts +0 -5
  134. package/lib/middlewares/visitors/visitInboundAudioTrack.d.ts.map +0 -1
  135. package/lib/middlewares/visitors/visitInboundAudioTrack.js +0 -93
  136. package/lib/middlewares/visitors/visitInboundVideoTrack.d.ts +0 -5
  137. package/lib/middlewares/visitors/visitInboundVideoTrack.d.ts.map +0 -1
  138. package/lib/middlewares/visitors/visitInboundVideoTrack.js +0 -94
  139. package/lib/middlewares/visitors/visitOutboundAudioTrack.d.ts +0 -5
  140. package/lib/middlewares/visitors/visitOutboundAudioTrack.d.ts.map +0 -1
  141. package/lib/middlewares/visitors/visitOutboundAudioTrack.js +0 -90
  142. package/lib/middlewares/visitors/visitOutboundVideoTarck.d.ts +0 -5
  143. package/lib/middlewares/visitors/visitOutboundVideoTarck.d.ts.map +0 -1
  144. package/lib/middlewares/visitors/visitOutboundVideoTarck.js +0 -90
  145. package/lib/middlewares/visitors/visitPeerConnection.d.ts +0 -5
  146. package/lib/middlewares/visitors/visitPeerConnection.d.ts.map +0 -1
  147. package/lib/middlewares/visitors/visitPeerConnection.js +0 -111
  148. package/lib/middlewares/visitors/visitSfu.d.ts +0 -5
  149. package/lib/middlewares/visitors/visitSfu.d.ts.map +0 -1
  150. package/lib/middlewares/visitors/visitSfu.js +0 -78
  151. package/lib/middlewares/visitors/visitSfuInboundRtpPad.d.ts +0 -5
  152. package/lib/middlewares/visitors/visitSfuInboundRtpPad.d.ts.map +0 -1
  153. package/lib/middlewares/visitors/visitSfuInboundRtpPad.js +0 -56
  154. package/lib/middlewares/visitors/visitSfuOutboundRtpPad.d.ts +0 -5
  155. package/lib/middlewares/visitors/visitSfuOutboundRtpPad.d.ts.map +0 -1
  156. package/lib/middlewares/visitors/visitSfuOutboundRtpPad.js +0 -56
  157. package/lib/middlewares/visitors/visitSfuSctpChannel.d.ts +0 -5
  158. package/lib/middlewares/visitors/visitSfuSctpChannel.d.ts.map +0 -1
  159. package/lib/middlewares/visitors/visitSfuSctpChannel.js +0 -55
  160. package/lib/middlewares/visitors/visitSfuTransport.d.ts +0 -5
  161. package/lib/middlewares/visitors/visitSfuTransport.d.ts.map +0 -1
  162. package/lib/middlewares/visitors/visitSfuTransport.js +0 -56
  163. package/lib/processes/closePeerConnectionProcess.d.ts +0 -10
  164. package/lib/processes/closePeerConnectionProcess.d.ts.map +0 -1
  165. package/lib/processes/closePeerConnectionProcess.js +0 -51
  166. package/lib/processes/detachClientProcess.d.ts +0 -14
  167. package/lib/processes/detachClientProcess.d.ts.map +0 -1
  168. package/lib/processes/detachClientProcess.js +0 -106
  169. package/lib/processes/findRemoteMatches.d.ts +0 -9
  170. package/lib/processes/findRemoteMatches.d.ts.map +0 -1
  171. package/lib/processes/findRemoteMatches.js +0 -96
  172. package/lib/processes/inboundTrackRemoved.d.ts +0 -9
  173. package/lib/processes/inboundTrackRemoved.d.ts.map +0 -1
  174. package/lib/processes/inboundTrackRemoved.js +0 -22
  175. package/lib/processes/joinClientProcess.d.ts +0 -11
  176. package/lib/processes/joinClientProcess.d.ts.map +0 -1
  177. package/lib/processes/joinClientProcess.js +0 -120
  178. package/lib/processes/outboundTrackRemoved.d.ts +0 -9
  179. package/lib/processes/outboundTrackRemoved.d.ts.map +0 -1
  180. package/lib/processes/outboundTrackRemoved.js +0 -22
  181. package/lib/samples/ObservedCall.d.ts +0 -17
  182. package/lib/samples/ObservedCall.d.ts.map +0 -1
  183. package/lib/samples/ObservedCall.js +0 -29
  184. package/lib/samples/ObservedCalls.d.ts +0 -19
  185. package/lib/samples/ObservedCalls.d.ts.map +0 -1
  186. package/lib/samples/ObservedCalls.js +0 -113
  187. package/lib/samples/ObservedClient.d.ts +0 -28
  188. package/lib/samples/ObservedClient.d.ts.map +0 -1
  189. package/lib/samples/ObservedClient.js +0 -110
  190. package/lib/samples/ObservedInboundAudioTrack.d.ts +0 -17
  191. package/lib/samples/ObservedInboundAudioTrack.d.ts.map +0 -1
  192. package/lib/samples/ObservedInboundAudioTrack.js +0 -17
  193. package/lib/samples/ObservedInboundVideoTrack.d.ts +0 -17
  194. package/lib/samples/ObservedInboundVideoTrack.d.ts.map +0 -1
  195. package/lib/samples/ObservedInboundVideoTrack.js +0 -17
  196. package/lib/samples/ObservedOutboundAudioTrack.d.ts +0 -16
  197. package/lib/samples/ObservedOutboundAudioTrack.d.ts.map +0 -1
  198. package/lib/samples/ObservedOutboundAudioTrack.js +0 -17
  199. package/lib/samples/ObservedOutboundVideoTrack.d.ts +0 -16
  200. package/lib/samples/ObservedOutboundVideoTrack.d.ts.map +0 -1
  201. package/lib/samples/ObservedOutboundVideoTrack.js +0 -17
  202. package/lib/samples/ObservedPeerConnection.d.ts +0 -47
  203. package/lib/samples/ObservedPeerConnection.d.ts.map +0 -1
  204. package/lib/samples/ObservedPeerConnection.js +0 -130
  205. package/lib/samples/ObservedSfu.d.ts +0 -27
  206. package/lib/samples/ObservedSfu.d.ts.map +0 -1
  207. package/lib/samples/ObservedSfu.js +0 -65
  208. package/lib/samples/ObservedSfuInboundRtpPad.d.ts +0 -15
  209. package/lib/samples/ObservedSfuInboundRtpPad.d.ts.map +0 -1
  210. package/lib/samples/ObservedSfuInboundRtpPad.js +0 -17
  211. package/lib/samples/ObservedSfuOutboundRtpPad.d.ts +0 -15
  212. package/lib/samples/ObservedSfuOutboundRtpPad.d.ts.map +0 -1
  213. package/lib/samples/ObservedSfuOutboundRtpPad.js +0 -17
  214. package/lib/samples/ObservedSfuSctpChannel.d.ts +0 -15
  215. package/lib/samples/ObservedSfuSctpChannel.d.ts.map +0 -1
  216. package/lib/samples/ObservedSfuSctpChannel.js +0 -17
  217. package/lib/samples/ObservedSfuTransport.d.ts +0 -30
  218. package/lib/samples/ObservedSfuTransport.d.ts.map +0 -1
  219. package/lib/samples/ObservedSfuTransport.js +0 -86
  220. package/lib/samples/ObservedSfus.d.ts +0 -16
  221. package/lib/samples/ObservedSfus.d.ts.map +0 -1
  222. package/lib/samples/ObservedSfus.js +0 -72
  223. package/lib/sinks/ObserverSink.d.ts.map +0 -1
  224. package/lib/sinks/callEventReports.d.ts.map +0 -1
  225. package/lib/sources/ObservedCallSource.d.ts +0 -18
  226. package/lib/sources/ObservedCallSource.d.ts.map +0 -1
  227. package/lib/sources/ObservedCallSource.js +0 -2
  228. package/lib/sources/ObservedClientSource.d.ts +0 -19
  229. package/lib/sources/ObservedClientSource.d.ts.map +0 -1
  230. package/lib/sources/ObservedClientSource.js +0 -2
  231. package/lib/sources/ObservedSfuSource.d.ts +0 -15
  232. package/lib/sources/ObservedSfuSource.d.ts.map +0 -1
  233. package/lib/sources/ObservedSfuSource.js +0 -2
  234. package/lib/sources/Sources.d.ts +0 -49
  235. package/lib/sources/Sources.d.ts.map +0 -1
  236. package/lib/sources/Sources.js +0 -213
  237. package/src/Evaluator.ts +0 -229
  238. package/src/common/Semaphore.ts +0 -45
  239. package/src/entries/CallEntry.ts +0 -62
  240. package/src/entries/ClientEntry.ts +0 -106
  241. package/src/entries/InboundTrackEntry.ts +0 -74
  242. package/src/entries/OutboundTrackEntry.ts +0 -72
  243. package/src/entries/PeerConnectionEntry.ts +0 -133
  244. package/src/entries/SfuEntry.ts +0 -62
  245. package/src/entries/SfuInboundRtpPadEntry.ts +0 -46
  246. package/src/entries/SfuOutboundRtpPadEntry.ts +0 -44
  247. package/src/entries/SfuSctpChannelEntry.ts +0 -39
  248. package/src/entries/SfuTransportEntry.ts +0 -109
  249. package/src/evaluators/SetClientsCoordinateEvaluator.ts +0 -78
  250. package/src/middlewares/CallOperationsContext.ts +0 -56
  251. package/src/middlewares/CallProcessor.ts +0 -38
  252. package/src/middlewares/CommitTransactionMiddleware.ts +0 -328
  253. package/src/middlewares/DeleteOutdatedCallEntries.ts +0 -159
  254. package/src/middlewares/DeleteOutdatedSfuEntries.ts +0 -168
  255. package/src/middlewares/Middleware.ts +0 -10
  256. package/src/middlewares/Processor.ts +0 -59
  257. package/src/middlewares/TransactionContext.ts +0 -176
  258. package/src/middlewares/TransactoinProcessor.ts +0 -28
  259. package/src/middlewares/VisitObservedCallsMiddleware.ts +0 -172
  260. package/src/middlewares/VisitObservedSfusMiddleware.ts +0 -203
  261. package/src/middlewares/visitors/visitClient.ts +0 -239
  262. package/src/middlewares/visitors/visitInboundAudioTrack.ts +0 -113
  263. package/src/middlewares/visitors/visitInboundVideoTrack.ts +0 -117
  264. package/src/middlewares/visitors/visitOutboundAudioTrack.ts +0 -100
  265. package/src/middlewares/visitors/visitOutboundVideoTarck.ts +0 -102
  266. package/src/middlewares/visitors/visitPeerConnection.ts +0 -151
  267. package/src/middlewares/visitors/visitSfu.ts +0 -70
  268. package/src/middlewares/visitors/visitSfuInboundRtpPad.ts +0 -52
  269. package/src/middlewares/visitors/visitSfuOutboundRtpPad.ts +0 -53
  270. package/src/middlewares/visitors/visitSfuSctpChannel.ts +0 -50
  271. package/src/middlewares/visitors/visitSfuTransport.ts +0 -50
  272. package/src/processes/closePeerConnectionProcess.ts +0 -54
  273. package/src/processes/detachClientProcess.ts +0 -136
  274. package/src/processes/findRemoteMatches.ts +0 -104
  275. package/src/processes/inboundTrackRemoved.ts +0 -22
  276. package/src/processes/joinClientProcess.ts +0 -138
  277. package/src/processes/outboundTrackRemoved.ts +0 -22
  278. package/src/samples/ObservedCall.ts +0 -49
  279. package/src/samples/ObservedCalls.ts +0 -143
  280. package/src/samples/ObservedClient.ts +0 -172
  281. package/src/samples/ObservedInboundAudioTrack.ts +0 -35
  282. package/src/samples/ObservedInboundVideoTrack.ts +0 -36
  283. package/src/samples/ObservedOutboundAudioTrack.ts +0 -35
  284. package/src/samples/ObservedOutboundVideoTrack.ts +0 -35
  285. package/src/samples/ObservedPeerConnection.ts +0 -227
  286. package/src/samples/ObservedSfu.ts +0 -115
  287. package/src/samples/ObservedSfuInboundRtpPad.ts +0 -35
  288. package/src/samples/ObservedSfuOutboundRtpPad.ts +0 -35
  289. package/src/samples/ObservedSfuSctpChannel.ts +0 -35
  290. package/src/samples/ObservedSfuTransport.ts +0 -142
  291. package/src/samples/ObservedSfus.ts +0 -95
  292. package/src/sources/ObservedCallSource.ts +0 -26
  293. package/src/sources/ObservedClientSource.ts +0 -28
  294. package/src/sources/ObservedSfuSource.ts +0 -19
  295. package/src/sources/Sources.ts +0 -301
  296. /package/lib/{sinks → common}/callEventReports.d.ts +0 -0
  297. /package/lib/{sinks → common}/callEventReports.js +0 -0
  298. /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 { ReportsCollector } from '../common/ReportsCollector';
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 interface ObserverReportsEmitter {
63
- on<K extends keyof SinkEventsMap>(event: K, listener: (reports: SinkEventsMap[K]) => void): this;
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(config: SinkConfig);
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=ObserverSink.d.ts.map
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,EA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Q,EAAE,CAAC,OAAO,EAAE,aAAa,CAAC,CAAC,CAAC,KAAK,IAAI,GAAG,IAAI;IAMlG,kBAAkB,CAAC,MAAM,EAAE,eAAe;IAK1C,iBAAiB,CAAC,MAAM,EAAE,cAAc;IAKxC,0BAA0B,CAAC,MAAM,EAAE,uBAAuB;IAK1D,wBAAwB,CAAC,MAAM,EAAE,qBAAqB;IAKtD,yBAAyB,CAAC,MAAM,EAAE,sBAAsB;IAKxD,0BAA0B,CAAC,MAAM,EAAE,uBAAuB;IAK1D,0BAA0B,CAAC,MAAM,EAAE,uBAAuB;IAK1D,iCAAiC,CAAC,MAAM,EAAE,6BAA6B;IAKvE,sBAAsB,CAAC,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.SinkImpl = void 0;
3
+ exports.ReportsCollector = void 0;
13
4
  const events_1 = require("events");
14
- const Processor_1 = require("../middlewares/Processor");
15
- const VisitObservedCallsMiddleware_1 = require("../middlewares/VisitObservedCallsMiddleware");
16
- class SinkImpl {
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
- this._processor = (0, Processor_1.createProcessor)();
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 > 0) {
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.SinkImpl = SinkImpl;
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 interface ReportsCollector {
3
- addCallEventReport(report: CallEventReport): void;
4
- addCallMetaReport(report: CallMetaReport): void;
5
- addClientDataChannelReport(report: ClientDataChannelReport): void;
6
- addClientExtensionReport(report: ClientExtensionReport): void;
7
- addIceCandidatePairReport(report: IceCandidatePairReport): void;
8
- addInboundAudioTrackReport(report: InboundAudioTrackReport): void;
9
- addInboundVideoTrackReport(report: InboundVideoTrackReport): void;
10
- addPeerConnectionTransportReports(report: PeerConnectionTransportReport): void;
11
- addObserverEventReport(report: ObserverEventReport): void;
12
- addOutboundAudioTrackReport(report: OutboundAudioTrackReport): void;
13
- addOutboundVideoTrackReport(report: OutboundVideoTrackReport): void;
14
- addSfuEventReport(report: SfuEventReport): void;
15
- addSfuExtensionReport(report: SfuExtensionReport): void;
16
- addSfuInboundRtpPadReport(report: SfuInboundRtpPadReport): void;
17
- addSfuOutboundRtpPadReport(report: SfuOutboundRtpPadReport): void;
18
- addSfuSctpStreamReport(report: SfuSctpStreamReport): void;
19
- addSfuTransportReport(report: SFUTransportReport): void;
20
- addSfuMetaReport(report: SfuMetaReport): void;
21
- getCallEventReports(): CallEventReport[];
22
- getClientExtensionReports(): ClientExtensionReport[];
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;AAEvC,MAAM,WAAW,gBAAgB;IAChC,kBAAkB,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sCollector.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,3 @@
1
+ export type SingleExecutor = ReturnType<typeof createSingleExecutor>;
2
+ export declare function createSingleExecutor(): <T = unknown>(task: () => Promise<T>) => Promise<T>;
3
+ //# sourceMappingURL=SingleExecutor.d.ts.map
@@ -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
+ //# sourceMappingURL=TypedEventEmitter.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TypedEventEmitter.d.ts","sourceRoot":"","sources":["../../src/common/TypedEventEmitter.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,QAAQ,GAAG;IAEtB,CAAC,GAAG,EAAE,MAAM,GAAG,CAAC,GAAG,OAAO,EAAE,CAAC,CAAA;CAC7B,CAAA;AAED,wBAAgB,uBAAuB,CAAC,MAAM,SAAS,QAAQ,+BAE9D;AAED,MAAM,WAAW,iBAAiB,CAAC,MAAM,SAAS,QAAQ;IACzD,WAAW,CAAC,CAAC,SAAS,MAAM,MAAM,EAAG,KAAK,EAAE,CAAC,EAAE,QAAQ,EAAE,CAAC,GAAG,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC,KAAK,IAAI,GAAG,IAAI,CAAA;IAC5F,EAAE,CAAC,CAAC,SAAS,MAAM,MAAM,EAAG,KAAK,EAAE,CAAC,EAAE,QAAQ,EAAE,CAAC,GAAG,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC,KAAK,IAAI,GAAG,IAAI,CAAA;IACnF,IAAI,CAAC,CAAC,SAAS,MAAM,MAAM,EAAG,KAAK,EAAE,CAAC,EAAE,QAAQ,EAAE,CAAC,GAAG,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC,KAAK,IAAI,GAAG,IAAI,CAAA;IACrF,eAAe,CAAC,CAAC,SAAS,MAAM,MAAM,EAAG,KAAK,EAAE,CAAC,EAAE,QAAQ,EAAE,CAAC,GAAG,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC,KAAK,IAAI,GAAG,IAAI,CAAA;IAChG,mBAAmB,CAAC,CAAC,SAAS,MAAM,M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,IAAI,CAAA;CAC5C"}
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
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,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B"}
@@ -6,14 +6,8 @@ export interface Logger {
6
6
  warn(...args: any[]): void;
7
7
  error(...args: any[]): void;
8
8
  }
9
- export interface WrappedLogger extends Logger {
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;AAED,MAAM,WAAW,aAAc,SAAQ,MAAM;IAC5C,IAAI,IAAI,IAAI,CAAC;IACb,KAAK,EAAE,QAAQ,GAAG,SAAS,CAAC;IAC5B,MAAM,EAAE,MAAM,CAAC;CACf;AAED,MAAM,MAAM,aAAa,GAAG,MAAM,MAAM,CAAC;AA4IzC,eAAO,M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