@observertc/observer-js 0.9.20-beta → 0.9.22-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.
Files changed (212) hide show
  1. package/.eslintrc.json +143 -0
  2. package/lib/Evaluator.d.ts.map +1 -1
  3. package/lib/Evaluator.js +54 -47
  4. package/lib/Observer.d.ts +1408 -38
  5. package/lib/Observer.d.ts.map +1 -1
  6. package/lib/Observer.js +484 -180
  7. package/lib/common/Semaphore.d.ts.map +1 -1
  8. package/lib/common/callMetaReports.d.ts.map +1 -1
  9. package/lib/common/callMetaReports.js +1 -0
  10. package/lib/common/logger.d.ts.map +1 -1
  11. package/lib/common/logger.js +15 -15
  12. package/lib/common/utils.d.ts +1 -0
  13. package/lib/common/utils.d.ts.map +1 -1
  14. package/lib/common/utils.js +12 -1
  15. package/lib/entries/CallEntry.d.ts +611 -0
  16. package/lib/entries/CallEntry.d.ts.map +1 -0
  17. package/lib/entries/CallEntry.js +75 -0
  18. package/lib/entries/ClientEntry.d.ts +474 -0
  19. package/lib/entries/ClientEntry.d.ts.map +1 -0
  20. package/lib/entries/ClientEntry.js +101 -0
  21. package/lib/entries/InboundTrackEntry.d.ts +670 -0
  22. package/lib/entries/InboundTrackEntry.d.ts.map +1 -0
  23. package/lib/entries/InboundTrackEntry.js +76 -0
  24. package/lib/entries/OutboundTrackEntry.d.ts +670 -0
  25. package/lib/entries/OutboundTrackEntry.d.ts.map +1 -0
  26. package/lib/entries/OutboundTrackEntry.js +73 -0
  27. package/lib/entries/PeerConnectionEntry.d.ts +469 -0
  28. package/lib/entries/PeerConnectionEntry.d.ts.map +1 -0
  29. package/lib/entries/PeerConnectionEntry.js +144 -0
  30. package/lib/entries/SfuEntry.d.ts +150 -0
  31. package/lib/entries/SfuEntry.d.ts.map +1 -0
  32. package/lib/entries/SfuEntry.js +77 -0
  33. package/lib/entries/SfuInboundRtpPadEntry.d.ts +14 -0
  34. package/lib/entries/SfuInboundRtpPadEntry.d.ts.map +1 -0
  35. package/lib/entries/SfuInboundRtpPadEntry.js +49 -0
  36. package/lib/entries/SfuOutboundRtpPadEntry.d.ts +14 -0
  37. package/lib/entries/SfuOutboundRtpPadEntry.d.ts.map +1 -0
  38. package/lib/entries/SfuOutboundRtpPadEntry.js +47 -0
  39. package/lib/entries/SfuSctpChannelEntry.d.ts +12 -0
  40. package/lib/entries/SfuSctpChannelEntry.d.ts.map +1 -0
  41. package/lib/entries/SfuSctpChannelEntry.js +43 -0
  42. package/lib/entries/SfuTransportEntry.d.ts +82 -0
  43. package/lib/entries/SfuTransportEntry.d.ts.map +1 -0
  44. package/lib/entries/SfuTransportEntry.js +122 -0
  45. package/lib/index.d.ts +10 -0
  46. package/lib/index.d.ts.map +1 -1
  47. package/lib/middlewares/CallOperationsContext.d.ts.map +1 -1
  48. package/lib/middlewares/CallOperationsContext.js +2 -6
  49. package/lib/middlewares/CallProcessor.d.ts.map +1 -1
  50. package/lib/middlewares/CallProcessor.js +15 -6
  51. package/lib/middlewares/CommitTransactionMiddleware.d.ts.map +1 -1
  52. package/lib/middlewares/CommitTransactionMiddleware.js +22 -26
  53. package/lib/middlewares/DeleteOutdatedCallEntries.d.ts.map +1 -1
  54. package/lib/middlewares/DeleteOutdatedCallEntries.js +29 -20
  55. package/lib/middlewares/DeleteOutdatedSfuEntries.d.ts.map +1 -1
  56. package/lib/middlewares/DeleteOutdatedSfuEntries.js +27 -18
  57. package/lib/middlewares/Middleware.d.ts.map +1 -1
  58. package/lib/middlewares/Middleware.js +13 -4
  59. package/lib/middlewares/Processor.d.ts.map +1 -1
  60. package/lib/middlewares/Processor.js +18 -9
  61. package/lib/middlewares/TransactionContext.d.ts.map +1 -1
  62. package/lib/middlewares/TransactionContext.js +84 -73
  63. package/lib/middlewares/VisitObservedCallsMiddleware.d.ts.map +1 -1
  64. package/lib/middlewares/VisitObservedCallsMiddleware.js +16 -7
  65. package/lib/middlewares/VisitObservedSfusMiddleware.d.ts.map +1 -1
  66. package/lib/middlewares/VisitObservedSfusMiddleware.js +15 -6
  67. package/lib/middlewares/visitors/visitClient.d.ts.map +1 -1
  68. package/lib/middlewares/visitors/visitClient.js +6 -18
  69. package/lib/middlewares/visitors/visitInboundAudioTrack.d.ts.map +1 -1
  70. package/lib/middlewares/visitors/visitInboundAudioTrack.js +17 -20
  71. package/lib/middlewares/visitors/visitInboundVideoTrack.d.ts.map +1 -1
  72. package/lib/middlewares/visitors/visitInboundVideoTrack.js +16 -21
  73. package/lib/middlewares/visitors/visitOutboundAudioTrack.d.ts.map +1 -1
  74. package/lib/middlewares/visitors/visitOutboundAudioTrack.js +16 -16
  75. package/lib/middlewares/visitors/visitOutboundVideoTarck.d.ts.map +1 -1
  76. package/lib/middlewares/visitors/visitOutboundVideoTarck.js +16 -17
  77. package/lib/middlewares/visitors/visitPeerConnection.d.ts.map +1 -1
  78. package/lib/middlewares/visitors/visitPeerConnection.js +24 -40
  79. package/lib/middlewares/visitors/visitSfu.d.ts.map +1 -1
  80. package/lib/middlewares/visitors/visitSfu.js +6 -7
  81. package/lib/middlewares/visitors/visitSfuInboundRtpPad.d.ts.map +1 -1
  82. package/lib/middlewares/visitors/visitSfuInboundRtpPad.js +3 -7
  83. package/lib/middlewares/visitors/visitSfuOutboundRtpPad.d.ts.map +1 -1
  84. package/lib/middlewares/visitors/visitSfuOutboundRtpPad.js +3 -8
  85. package/lib/middlewares/visitors/visitSfuSctpChannel.d.ts.map +1 -1
  86. package/lib/middlewares/visitors/visitSfuSctpChannel.js +3 -6
  87. package/lib/middlewares/visitors/visitSfuTransport.d.ts.map +1 -1
  88. package/lib/middlewares/visitors/visitSfuTransport.js +3 -6
  89. package/lib/processes/closePeerConnectionProcess.d.ts.map +1 -1
  90. package/lib/processes/closePeerConnectionProcess.js +14 -5
  91. package/lib/processes/detachClientProcess.d.ts.map +1 -1
  92. package/lib/processes/detachClientProcess.js +20 -17
  93. package/lib/processes/findRemoteMatches.d.ts +2 -2
  94. package/lib/processes/findRemoteMatches.d.ts.map +1 -1
  95. package/lib/processes/findRemoteMatches.js +70 -56
  96. package/lib/processes/inboundTrackRemoved.d.ts.map +1 -1
  97. package/lib/processes/inboundTrackRemoved.js +12 -3
  98. package/lib/processes/joinClientProcess.d.ts.map +1 -1
  99. package/lib/processes/joinClientProcess.js +15 -6
  100. package/lib/processes/outboundTrackRemoved.d.ts.map +1 -1
  101. package/lib/processes/outboundTrackRemoved.js +12 -3
  102. package/lib/samples/ObservedCall.d.ts.map +1 -1
  103. package/lib/samples/ObservedCall.js +1 -5
  104. package/lib/samples/ObservedCalls.d.ts.map +1 -1
  105. package/lib/samples/ObservedClient.d.ts.map +1 -1
  106. package/lib/samples/ObservedClient.js +1 -9
  107. package/lib/samples/ObservedInboundAudioTrack.d.ts.map +1 -1
  108. package/lib/samples/ObservedInboundAudioTrack.js +1 -5
  109. package/lib/samples/ObservedInboundVideoTrack.d.ts.map +1 -1
  110. package/lib/samples/ObservedInboundVideoTrack.js +1 -5
  111. package/lib/samples/ObservedOutboundAudioTrack.d.ts.map +1 -1
  112. package/lib/samples/ObservedOutboundAudioTrack.js +1 -5
  113. package/lib/samples/ObservedOutboundVideoTrack.d.ts.map +1 -1
  114. package/lib/samples/ObservedOutboundVideoTrack.js +1 -5
  115. package/lib/samples/ObservedPeerConnection.d.ts.map +1 -1
  116. package/lib/samples/ObservedPeerConnection.js +1 -12
  117. package/lib/samples/ObservedSfu.d.ts.map +1 -1
  118. package/lib/samples/ObservedSfu.js +1 -8
  119. package/lib/samples/ObservedSfuInboundRtpPad.d.ts.map +1 -1
  120. package/lib/samples/ObservedSfuInboundRtpPad.js +1 -5
  121. package/lib/samples/ObservedSfuOutboundRtpPad.d.ts.map +1 -1
  122. package/lib/samples/ObservedSfuOutboundRtpPad.js +1 -5
  123. package/lib/samples/ObservedSfuSctpChannel.d.ts.map +1 -1
  124. package/lib/samples/ObservedSfuSctpChannel.js +1 -5
  125. package/lib/samples/ObservedSfuTransport.d.ts.map +1 -1
  126. package/lib/samples/ObservedSfuTransport.js +1 -8
  127. package/lib/samples/ObservedSfus.d.ts.map +1 -1
  128. package/lib/sinks/ObserverSink.d.ts.map +1 -1
  129. package/lib/sinks/ObserverSink.js +42 -31
  130. package/lib/sinks/callEventReports.js +1 -0
  131. package/lib/sources/ObservedCallSource.d.ts +5 -3
  132. package/lib/sources/ObservedCallSource.d.ts.map +1 -1
  133. package/lib/sources/ObservedClientSource.d.ts +3 -2
  134. package/lib/sources/ObservedClientSource.d.ts.map +1 -1
  135. package/lib/sources/ObservedSfuSource.d.ts +3 -2
  136. package/lib/sources/ObservedSfuSource.d.ts.map +1 -1
  137. package/lib/sources/Sources.d.ts +8 -4
  138. package/lib/sources/Sources.d.ts.map +1 -1
  139. package/lib/sources/Sources.js +71 -46
  140. package/lib/storages/ObserverStorage.d.ts.map +1 -1
  141. package/lib/storages/SimpleStorage.d.ts.map +1 -1
  142. package/lib/storages/SimpleStorage.js +40 -23
  143. package/package.json +2 -1
  144. package/src/Evaluator.ts +17 -9
  145. package/src/Observer.ts +239 -171
  146. package/src/common/Semaphore.ts +2 -0
  147. package/src/common/callMetaReports.ts +30 -28
  148. package/src/common/logger.ts +140 -132
  149. package/src/common/types.ts +1 -1
  150. package/src/common/utils.ts +12 -1
  151. package/src/entries/CallEntry.ts +62 -0
  152. package/src/entries/ClientEntry.ts +90 -0
  153. package/src/entries/InboundTrackEntry.ts +74 -0
  154. package/src/entries/OutboundTrackEntry.ts +72 -0
  155. package/src/entries/PeerConnectionEntry.ts +133 -0
  156. package/src/entries/SfuEntry.ts +62 -0
  157. package/src/entries/SfuInboundRtpPadEntry.ts +46 -0
  158. package/src/entries/SfuOutboundRtpPadEntry.ts +44 -0
  159. package/src/entries/SfuSctpChannelEntry.ts +39 -0
  160. package/src/entries/SfuTransportEntry.ts +109 -0
  161. package/src/index.ts +11 -0
  162. package/src/middlewares/CallOperationsContext.ts +9 -5
  163. package/src/middlewares/CallProcessor.ts +4 -2
  164. package/src/middlewares/CommitTransactionMiddleware.ts +8 -5
  165. package/src/middlewares/DeleteOutdatedCallEntries.ts +24 -16
  166. package/src/middlewares/DeleteOutdatedSfuEntries.ts +24 -15
  167. package/src/middlewares/Middleware.ts +1 -0
  168. package/src/middlewares/Processor.ts +10 -5
  169. package/src/middlewares/TransactionContext.ts +1 -2
  170. package/src/middlewares/VisitObservedCallsMiddleware.ts +5 -2
  171. package/src/middlewares/VisitObservedSfusMiddleware.ts +8 -7
  172. package/src/middlewares/visitors/visitClient.ts +15 -1
  173. package/src/middlewares/visitors/visitInboundAudioTrack.ts +4 -1
  174. package/src/middlewares/visitors/visitInboundVideoTrack.ts +5 -1
  175. package/src/middlewares/visitors/visitOutboundAudioTrack.ts +5 -1
  176. package/src/middlewares/visitors/visitOutboundVideoTarck.ts +5 -1
  177. package/src/middlewares/visitors/visitPeerConnection.ts +15 -2
  178. package/src/middlewares/visitors/visitSfu.ts +7 -1
  179. package/src/middlewares/visitors/visitSfuInboundRtpPad.ts +4 -2
  180. package/src/middlewares/visitors/visitSfuOutboundRtpPad.ts +3 -1
  181. package/src/middlewares/visitors/visitSfuSctpChannel.ts +23 -21
  182. package/src/middlewares/visitors/visitSfuTransport.ts +3 -1
  183. package/src/processes/closePeerConnectionProcess.ts +3 -0
  184. package/src/processes/detachClientProcess.ts +13 -4
  185. package/src/processes/findRemoteMatches.ts +32 -21
  186. package/src/processes/inboundTrackRemoved.ts +2 -0
  187. package/src/processes/joinClientProcess.ts +8 -2
  188. package/src/processes/outboundTrackRemoved.ts +2 -0
  189. package/src/samples/ObservedCall.ts +6 -0
  190. package/src/samples/ObservedCalls.ts +13 -7
  191. package/src/samples/ObservedClient.ts +24 -8
  192. package/src/samples/ObservedInboundAudioTrack.ts +3 -2
  193. package/src/samples/ObservedInboundVideoTrack.ts +3 -2
  194. package/src/samples/ObservedOutboundAudioTrack.ts +3 -2
  195. package/src/samples/ObservedOutboundVideoTrack.ts +3 -2
  196. package/src/samples/ObservedPeerConnection.ts +27 -11
  197. package/src/samples/ObservedSfu.ts +17 -10
  198. package/src/samples/ObservedSfuInboundRtpPad.ts +5 -4
  199. package/src/samples/ObservedSfuOutboundRtpPad.ts +5 -4
  200. package/src/samples/ObservedSfuSctpChannel.ts +13 -13
  201. package/src/samples/ObservedSfuTransport.ts +19 -7
  202. package/src/samples/ObservedSfus.ts +10 -5
  203. package/src/sinks/ObserverSink.ts +51 -44
  204. package/src/sinks/callEventReports.ts +1 -1
  205. package/src/sources/ObservedCallSource.ts +6 -5
  206. package/src/sources/ObservedClientSource.ts +3 -2
  207. package/src/sources/ObservedSfuSource.ts +4 -8
  208. package/src/sources/Sources.ts +96 -22
  209. package/src/storages/ObserverStorage.ts +1 -0
  210. package/src/storages/SimpleStorage.ts +44 -21
  211. package/tsconfig.json +7 -5
  212. package/.eslintrc.js +0 -27
@@ -1 +1 @@
1
- {"version":3,"file":"visitOutboundVideoTarck.d.ts","sourceRoot":"","sources":["../../../src/middlewares/visitors/visitOutboundVideoTarck.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,qBAAqB,CAAC;AAC9C,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EAAE,0BAA0B,EAAE,MAAM,0CAA0C,CAAC;AAKtF,wBAAgB,uBAAuB,CACtC,0BAA0B,EAAE,0BAA0B,EACtD,oBAAoB,EAAE,MAAM,CAAC,cAAc,EAC3C,oBAAoB,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,aAAa,CAAC,EACvD,OAAO,EAAE,gBAAgB,EACzB,YAAY,EAAE,OAAO,QAqFrB"}
1
+ {"version":3,"file":"visitOutboundVideoTarck.d.ts","sourceRoot":"","sources":["../../../src/middlewares/visitors/visitOutboundVideoTarck.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,MAAM,qBAAqB,CAAC;AAC9C,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EAAE,0BAA0B,EAAE,MAAM,0CAA0C,CAAC;AAKtF,wBAAgB,uBAAuB,CACtC,0BAA0B,EAAE,0BAA0B,EACtD,oBAAoB,EAAE,MAAM,CAAC,cAAc,EAC3C,oBAAoB,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,aAAa,CAAC,EACvD,OAAO,EAAE,gBAAgB,EACzB,YAAY,EAAE,OAAO,QAwFrB"}
@@ -22,8 +22,20 @@ var __importStar = (this && this.__importStar) || function (mod) {
22
22
  __setModuleDefault(result, mod);
23
23
  return result;
24
24
  };
25
+ var __rest = (this && this.__rest) || function (s, e) {
26
+ var t = {};
27
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
28
+ t[p] = s[p];
29
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
30
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
31
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
32
+ t[p[i]] = s[p[i]];
33
+ }
34
+ return t;
35
+ };
25
36
  Object.defineProperty(exports, "__esModule", { value: true });
26
37
  exports.visitOutboundVideoTrack = void 0;
38
+ /* eslint-disable camelcase */
27
39
  const Models = __importStar(require("../../models/Models"));
28
40
  const VisitObservedCallsMiddleware_1 = require("../VisitObservedCallsMiddleware");
29
41
  const samples_pb_1 = require("../../models/samples_pb");
@@ -57,31 +69,18 @@ function visitOutboundVideoTrack(observedOutboundVideoTrack, storedPeerConnectio
57
69
  }
58
70
  const statsMap = new Map();
59
71
  for (const outboundVideoSample of observedOutboundVideoTrack.samples()) {
60
- const report = {
61
- serviceId,
72
+ const report = Object.assign(Object.assign({ serviceId,
62
73
  roomId,
63
74
  callId,
64
75
  clientId,
65
76
  userId,
66
77
  mediaUnitId,
67
- peerConnectionId,
68
- ...outboundVideoSample,
69
- timestamp,
70
- sampleSeq: -1,
71
- };
78
+ peerConnectionId }, outboundVideoSample), { timestamp, sampleSeq: -1 });
72
79
  reports.addOutboundVideoTrackReport(report);
73
80
  if (fetchSamples) {
74
- const { ssrc: sample_ssrc, bytesSent: sample_bytesSent, headerBytesSent: samples_headerBytesSent, qpSum: samples_qpSum, retransmittedBytesSent: samples_retransmittedBytesSent, totalEncodedBytesTarget: samples_totalEncodedBytesTarget, ...sample } = outboundVideoSample;
81
+ const { ssrc: sample_ssrc, bytesSent: sample_bytesSent, headerBytesSent: samples_headerBytesSent, qpSum: samples_qpSum, retransmittedBytesSent: samples_retransmittedBytesSent, totalEncodedBytesTarget: samples_totalEncodedBytesTarget } = outboundVideoSample, sample = __rest(outboundVideoSample, ["ssrc", "bytesSent", "headerBytesSent", "qpSum", "retransmittedBytesSent", "totalEncodedBytesTarget"]);
75
82
  const ssrc = BigInt(sample_ssrc);
76
- const videoStats = new samples_pb_1.Samples_ClientSample_OutboundVideoTrack({
77
- ssrc,
78
- bytesSent: BigInt(sample_bytesSent !== null && sample_bytesSent !== void 0 ? sample_bytesSent : -1),
79
- headerBytesSent: BigInt(samples_headerBytesSent !== null && samples_headerBytesSent !== void 0 ? samples_headerBytesSent : -1),
80
- retransmittedBytesSent: BigInt(samples_retransmittedBytesSent !== null && samples_retransmittedBytesSent !== void 0 ? samples_retransmittedBytesSent : -1),
81
- totalEncodedBytesTarget: BigInt(samples_totalEncodedBytesTarget !== null && samples_totalEncodedBytesTarget !== void 0 ? samples_totalEncodedBytesTarget : -1),
82
- qpSum: BigInt(samples_qpSum !== null && samples_qpSum !== void 0 ? samples_qpSum : -1),
83
- ...sample,
84
- });
83
+ const videoStats = new samples_pb_1.Samples_ClientSample_OutboundVideoTrack(Object.assign({ ssrc, bytesSent: BigInt(sample_bytesSent !== null && sample_bytesSent !== void 0 ? sample_bytesSent : -1), headerBytesSent: BigInt(samples_headerBytesSent !== null && samples_headerBytesSent !== void 0 ? samples_headerBytesSent : -1), retransmittedBytesSent: BigInt(samples_retransmittedBytesSent !== null && samples_retransmittedBytesSent !== void 0 ? samples_retransmittedBytesSent : -1), totalEncodedBytesTarget: BigInt(samples_totalEncodedBytesTarget !== null && samples_totalEncodedBytesTarget !== void 0 ? samples_totalEncodedBytesTarget : -1), qpSum: BigInt(samples_qpSum !== null && samples_qpSum !== void 0 ? samples_qpSum : -1) }, sample));
85
84
  statsMap.set(ssrc, videoStats);
86
85
  }
87
86
  }
@@ -1 +1 @@
1
- {"version":3,"file":"visitPeerConnection.d.ts","sourceRoot":"","sources":["../../../src/middlewares/visitors/visitPeerConnection.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,sCAAsC,CAAC;AAC9E,OAAO,KAAK,MAAM,MAAM,qBAAqB,CAAC;AAC9C,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAKjE,wBAAgB,mBAAmB,CAClC,sBAAsB,EAAE,sBAAsB,EAC9C,YAAY,EAAE,MAAM,CAAC,MAAM,EAC3B,qBAAqB,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,cAAc,CAAC,EACzD,OAAO,EAAE,gBAAgB,EACzB,YAAY,EAAE,OAAO,QAwHrB"}
1
+ {"version":3,"file":"visitPeerConnection.d.ts","sourceRoot":"","sources":["../../../src/middlewares/visitors/visitPeerConnection.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,sBAAsB,EAAE,MAAM,sCAAsC,CAAC;AAC9E,OAAO,KAAK,MAAM,MAAM,qBAAqB,CAAC;AAC9C,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAUjE,wBAAgB,mBAAmB,CAClC,sBAAsB,EAAE,sBAAsB,EAC9C,YAAY,EAAE,MAAM,CAAC,MAAM,EAC3B,qBAAqB,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,cAAc,CAAC,EACzD,OAAO,EAAE,gBAAgB,EACzB,YAAY,EAAE,OAAO,QA+HrB"}
@@ -22,6 +22,17 @@ var __importStar = (this && this.__importStar) || function (mod) {
22
22
  __setModuleDefault(result, mod);
23
23
  return result;
24
24
  };
25
+ var __rest = (this && this.__rest) || function (s, e) {
26
+ var t = {};
27
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
28
+ t[p] = s[p];
29
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
30
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
31
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
32
+ t[p[i]] = s[p[i]];
33
+ }
34
+ return t;
35
+ };
25
36
  Object.defineProperty(exports, "__esModule", { value: true });
26
37
  exports.visitPeerConnection = void 0;
27
38
  const Models = __importStar(require("../../models/Models"));
@@ -50,74 +61,47 @@ function visitPeerConnection(observedPeerConnection, storedClient, storedPeerCon
50
61
  storedClient.peerConnectionIds.push(peerConnectionId);
51
62
  }
52
63
  else {
53
- VisitObservedCallsMiddleware_1.logger.warn(``);
64
+ VisitObservedCallsMiddleware_1.logger.warn('');
54
65
  }
55
66
  }
56
67
  for (const pcTransport of observedPeerConnection.transportSamples()) {
57
- const report = {
58
- serviceId,
68
+ const report = Object.assign(Object.assign({ serviceId,
59
69
  roomId,
60
70
  callId,
61
71
  clientId,
62
72
  userId,
63
- mediaUnitId,
64
- ...pcTransport,
65
- timestamp,
66
- sampleSeq: -1, // deprecated
67
- };
73
+ mediaUnitId }, pcTransport), { timestamp, sampleSeq: -1 });
68
74
  reports.addPeerConnectionTransportReports(report);
69
75
  }
70
76
  for (const iceCandidatePair of observedPeerConnection.iceCandidatePairs()) {
71
- const report = {
72
- serviceId,
77
+ const report = Object.assign(Object.assign({ serviceId,
73
78
  roomId,
74
79
  callId,
75
80
  userId,
76
81
  clientId,
77
- mediaUnitId,
78
- ...iceCandidatePair,
79
- timestamp,
80
- sampleSeq: -1, // deprecated
81
- };
82
+ mediaUnitId }, iceCandidatePair), { timestamp, sampleSeq: -1 });
82
83
  reports.addIceCandidatePairReport(report);
83
84
  }
84
85
  if (fetchSamples) {
85
86
  storedPeerConnection.icelocalCandidates = [];
86
87
  for (const iceLocalCandidate of observedPeerConnection.iceLocalCandidates()) {
87
- const { priority, ...sample } = iceLocalCandidate;
88
- storedPeerConnection.icelocalCandidates.push(new samples_pb_1.Samples_ClientSample_IceLocalCandidate({
89
- ...sample,
90
- priority: BigInt(priority !== null && priority !== void 0 ? priority : -1)
91
- }));
88
+ const { priority } = iceLocalCandidate, sample = __rest(iceLocalCandidate, ["priority"]);
89
+ storedPeerConnection.icelocalCandidates.push(new samples_pb_1.Samples_ClientSample_IceLocalCandidate(Object.assign(Object.assign({}, sample), { priority: BigInt(priority !== null && priority !== void 0 ? priority : -1) })));
92
90
  }
93
91
  storedPeerConnection.iceRemoteCandidates = [];
94
92
  for (const iceRemoteCandidate of observedPeerConnection.iceRemoteCandidates()) {
95
- const { priority, ...sample } = iceRemoteCandidate;
96
- storedPeerConnection.iceRemoteCandidates.push(new samples_pb_1.Samples_ClientSample_IceRemoteCandidate({
97
- ...sample,
98
- priority: BigInt(priority !== null && priority !== void 0 ? priority : -1)
99
- }));
93
+ const { priority } = iceRemoteCandidate, sample = __rest(iceRemoteCandidate, ["priority"]);
94
+ storedPeerConnection.iceRemoteCandidates.push(new samples_pb_1.Samples_ClientSample_IceRemoteCandidate(Object.assign(Object.assign({}, sample), { priority: BigInt(priority !== null && priority !== void 0 ? priority : -1) })));
100
95
  }
101
96
  storedPeerConnection.iceCandidatePairs = [];
102
97
  for (const iceCandidatePair of observedPeerConnection.iceCandidatePairs()) {
103
- const { bytesDiscardedOnSend, bytesReceived, bytesSent, lastPacketReceivedTimestamp, lastPacketSentTimestamp, ...sample } = iceCandidatePair;
104
- storedPeerConnection.iceCandidatePairs.push(new samples_pb_1.Samples_ClientSample_IceCandidatePair({
105
- ...sample,
106
- bytesDiscardedOnSend: BigInt(bytesDiscardedOnSend !== null && bytesDiscardedOnSend !== void 0 ? bytesDiscardedOnSend : -1),
107
- bytesReceived: BigInt(bytesReceived !== null && bytesReceived !== void 0 ? bytesReceived : -1),
108
- bytesSent: BigInt(bytesSent !== null && bytesSent !== void 0 ? bytesSent : -1),
109
- lastPacketReceivedTimestamp: BigInt(lastPacketReceivedTimestamp !== null && lastPacketReceivedTimestamp !== void 0 ? lastPacketReceivedTimestamp : -1),
110
- lastPacketSentTimestamp: BigInt(lastPacketSentTimestamp !== null && lastPacketSentTimestamp !== void 0 ? lastPacketSentTimestamp : -1),
111
- }));
98
+ const { bytesDiscardedOnSend, bytesReceived, bytesSent, lastPacketReceivedTimestamp, lastPacketSentTimestamp } = iceCandidatePair, sample = __rest(iceCandidatePair, ["bytesDiscardedOnSend", "bytesReceived", "bytesSent", "lastPacketReceivedTimestamp", "lastPacketSentTimestamp"]);
99
+ storedPeerConnection.iceCandidatePairs.push(new samples_pb_1.Samples_ClientSample_IceCandidatePair(Object.assign(Object.assign({}, sample), { bytesDiscardedOnSend: BigInt(bytesDiscardedOnSend !== null && bytesDiscardedOnSend !== void 0 ? bytesDiscardedOnSend : -1), bytesReceived: BigInt(bytesReceived !== null && bytesReceived !== void 0 ? bytesReceived : -1), bytesSent: BigInt(bytesSent !== null && bytesSent !== void 0 ? bytesSent : -1), lastPacketReceivedTimestamp: BigInt(lastPacketReceivedTimestamp !== null && lastPacketReceivedTimestamp !== void 0 ? lastPacketReceivedTimestamp : -1), lastPacketSentTimestamp: BigInt(lastPacketSentTimestamp !== null && lastPacketSentTimestamp !== void 0 ? lastPacketSentTimestamp : -1) })));
112
100
  }
113
101
  storedPeerConnection.transports = [];
114
102
  for (const pcTransport of observedPeerConnection.transportSamples()) {
115
- const { bytesReceived, bytesSent, ...sample } = pcTransport;
116
- storedPeerConnection.transports.push(new samples_pb_1.Samples_ClientSample_PeerConnectionTransport({
117
- ...sample,
118
- bytesReceived: BigInt(bytesReceived !== null && bytesReceived !== void 0 ? bytesReceived : -1),
119
- bytesSent: BigInt(bytesSent !== null && bytesSent !== void 0 ? bytesSent : -1),
120
- }));
103
+ const { bytesReceived, bytesSent } = pcTransport, sample = __rest(pcTransport, ["bytesReceived", "bytesSent"]);
104
+ storedPeerConnection.transports.push(new samples_pb_1.Samples_ClientSample_PeerConnectionTransport(Object.assign(Object.assign({}, sample), { bytesReceived: BigInt(bytesReceived !== null && bytesReceived !== void 0 ? bytesReceived : -1), bytesSent: BigInt(bytesSent !== null && bytesSent !== void 0 ? bytesSent : -1) })));
121
105
  }
122
106
  }
123
107
  }
@@ -1 +1 @@
1
- {"version":3,"file":"visitSfu.d.ts","sourceRoot":"","sources":["../../../src/middlewares/visitors/visitSfu.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,qBAAqB,CAAC;AAC9C,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAExD,wBAAgB,QAAQ,CACvB,WAAW,EAAE,WAAW,EACxB,UAAU,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,CAAC,EACnC,OAAO,EAAE,gBAAgB,EACzB,YAAY,EAAE,OAAO,QAuDrB"}
1
+ {"version":3,"file":"visitSfu.d.ts","sourceRoot":"","sources":["../../../src/middlewares/visitors/visitSfu.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,qBAAqB,CAAC;AAC9C,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAExD,wBAAgB,QAAQ,CACvB,WAAW,EAAE,WAAW,EACxB,UAAU,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,CAAC,EACnC,OAAO,EAAE,gBAAgB,EACzB,YAAY,EAAE,OAAO,QA6DrB"}
@@ -43,7 +43,7 @@ function visitSfu(observedSfu, storedSfus, reports, fetchSamples) {
43
43
  reports.addSfuEventReport({
44
44
  serviceId,
45
45
  mediaUnitId,
46
- name: "SFU_JOINED",
46
+ name: 'SFU_JOINED',
47
47
  sfuId,
48
48
  timestamp,
49
49
  marker,
@@ -53,13 +53,9 @@ function visitSfu(observedSfu, storedSfus, reports, fetchSamples) {
53
53
  for (const sfuSample of observedSfu.samples()) {
54
54
  if (sfuSample.customSfuEvents) {
55
55
  for (const sfuEvent of sfuSample.customSfuEvents) {
56
- reports.addSfuEventReport({
57
- serviceId,
56
+ reports.addSfuEventReport(Object.assign({ serviceId,
58
57
  mediaUnitId,
59
- sfuId,
60
- timestamp: Date.now(),
61
- ...sfuEvent,
62
- });
58
+ sfuId, timestamp: Date.now() }, sfuEvent));
63
59
  }
64
60
  }
65
61
  if (sfuSample.extensionStats) {
@@ -74,6 +70,9 @@ function visitSfu(observedSfu, storedSfus, reports, fetchSamples) {
74
70
  });
75
71
  }
76
72
  }
73
+ if (fetchSamples) {
74
+ // empty
75
+ }
77
76
  }
78
77
  }
79
78
  exports.visitSfu = visitSfu;
@@ -1 +1 @@
1
- {"version":3,"file":"visitSfuInboundRtpPad.d.ts","sourceRoot":"","sources":["../../../src/middlewares/visitors/visitSfuInboundRtpPad.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,qBAAqB,CAAC;AAC9C,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAEjE,OAAO,EAAE,wBAAwB,EAAE,MAAM,wCAAwC,CAAC;AAElF,wBAAgB,qBAAqB,CACpC,wBAAwB,EAAE,wBAAwB,EAClD,kBAAkB,EAAE,MAAM,CAAC,YAAY,EACvC,uBAAuB,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,gBAAgB,CAAC,EAC7D,OAAO,EAAE,gBAAgB,EACzB,YAAY,EAAE,OAAO,QAuCrB"}
1
+ {"version":3,"file":"visitSfuInboundRtpPad.d.ts","sourceRoot":"","sources":["../../../src/middlewares/visitors/visitSfuInboundRtpPad.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,qBAAqB,CAAC;AAC9C,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAEjE,OAAO,EAAE,wBAAwB,EAAE,MAAM,wCAAwC,CAAC;AAElF,wBAAgB,qBAAqB,CACpC,wBAAwB,EAAE,wBAAwB,EAClD,kBAAkB,EAAE,MAAM,CAAC,YAAY,EACvC,uBAAuB,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,gBAAgB,CAAC,EAC7D,OAAO,EAAE,gBAAgB,EACzB,YAAY,EAAE,OAAO,QAyCrB"}
@@ -43,18 +43,14 @@ function visitSfuInboundRtpPad(observedSfuInboundRtpPad, storedSfuTransport, sto
43
43
  storedSfuTransport.inboundRtpPadIds.push(rtpPadId);
44
44
  }
45
45
  for (const sfuInboundRtpPad of observedSfuInboundRtpPad.samples()) {
46
- const report = {
47
- serviceId,
46
+ const report = Object.assign(Object.assign({ serviceId,
48
47
  sfuId,
49
48
  mediaUnitId,
50
- rtpPadId,
51
- ...sfuInboundRtpPad,
52
- sfuStreamId: sfuInboundRtpPad.streamId,
53
- timestamp,
54
- };
49
+ rtpPadId }, sfuInboundRtpPad), { sfuStreamId: sfuInboundRtpPad.streamId, timestamp });
55
50
  reports.addSfuTransportReport(report);
56
51
  }
57
52
  if (fetchSamples) {
53
+ // empty
58
54
  }
59
55
  }
60
56
  exports.visitSfuInboundRtpPad = visitSfuInboundRtpPad;
@@ -1 +1 @@
1
- {"version":3,"file":"visitSfuOutboundRtpPad.d.ts","sourceRoot":"","sources":["../../../src/middlewares/visitors/visitSfuOutboundRtpPad.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,qBAAqB,CAAC;AAC9C,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAGjE,OAAO,EAAE,yBAAyB,EAAE,MAAM,yCAAyC,CAAC;AAEpF,wBAAgB,sBAAsB,CACrC,yBAAyB,EAAE,yBAAyB,EACpD,kBAAkB,EAAE,MAAM,CAAC,YAAY,EACvC,wBAAwB,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,iBAAiB,CAAC,EAC/D,OAAO,EAAE,gBAAgB,EACzB,YAAY,EAAE,OAAO,QAuCrB"}
1
+ {"version":3,"file":"visitSfuOutboundRtpPad.d.ts","sourceRoot":"","sources":["../../../src/middlewares/visitors/visitSfuOutboundRtpPad.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,qBAAqB,CAAC;AAC9C,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAEjE,OAAO,EAAE,yBAAyB,EAAE,MAAM,yCAAyC,CAAC;AAEpF,wBAAgB,sBAAsB,CACrC,yBAAyB,EAAE,yBAAyB,EACpD,kBAAkB,EAAE,MAAM,CAAC,YAAY,EACvC,wBAAwB,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,iBAAiB,CAAC,EAC/D,OAAO,EAAE,gBAAgB,EACzB,YAAY,EAAE,OAAO,QA0CrB"}
@@ -43,19 +43,14 @@ function visitSfuOutboundRtpPad(observedSfuOutboundRtpPad, storedSfuTransport, s
43
43
  storedSfuTransport.outboundRtpPadIds.push(rtpPadId);
44
44
  }
45
45
  for (const sfuOutboundRtpPad of observedSfuOutboundRtpPad.samples()) {
46
- const report = {
47
- serviceId,
46
+ const report = Object.assign(Object.assign({ serviceId,
48
47
  sfuId,
49
48
  mediaUnitId,
50
- rtpPadId,
51
- ...sfuOutboundRtpPad,
52
- sfuStreamId: sfuOutboundRtpPad.streamId,
53
- sfuSinkId: sfuOutboundRtpPad.sinkId,
54
- timestamp,
55
- };
49
+ rtpPadId }, sfuOutboundRtpPad), { sfuStreamId: sfuOutboundRtpPad.streamId, sfuSinkId: sfuOutboundRtpPad.sinkId, timestamp });
56
50
  reports.addSfuTransportReport(report);
57
51
  }
58
52
  if (fetchSamples) {
53
+ // empty
59
54
  }
60
55
  }
61
56
  exports.visitSfuOutboundRtpPad = visitSfuOutboundRtpPad;
@@ -1 +1 @@
1
- {"version":3,"file":"visitSfuSctpChannel.d.ts","sourceRoot":"","sources":["../../../src/middlewares/visitors/visitSfuSctpChannel.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,qBAAqB,CAAC;AAC9C,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAEjE,OAAO,EAAE,sBAAsB,EAAE,MAAM,sCAAsC,CAAC;AAE9E,wBAAgB,mBAAmB,CAClC,sBAAsB,EAAE,sBAAsB,EAC9C,kBAAkB,EAAE,MAAM,CAAC,YAAY,EACvC,qBAAqB,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,cAAc,CAAC,EACzD,OAAO,EAAE,gBAAgB,EACzB,YAAY,EAAE,OAAO,QAoCnB"}
1
+ {"version":3,"file":"visitSfuSctpChannel.d.ts","sourceRoot":"","sources":["../../../src/middlewares/visitors/visitSfuSctpChannel.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,qBAAqB,CAAC;AAC9C,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAEjE,OAAO,EAAE,sBAAsB,EAAE,MAAM,sCAAsC,CAAC;AAE9E,wBAAgB,mBAAmB,CAClC,sBAAsB,EAAE,sBAAsB,EAC9C,kBAAkB,EAAE,MAAM,CAAC,YAAY,EACvC,qBAAqB,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,cAAc,CAAC,EACzD,OAAO,EAAE,gBAAgB,EACzB,YAAY,EAAE,OAAO,QAuCrB"}
@@ -43,16 +43,13 @@ function visitSfuSctpChannel(observedSfuSctpChannel, storedSfuTransport, storedS
43
43
  storedSfuTransport.sctpChannelIds.push(channelId);
44
44
  }
45
45
  for (const sfuSctpChannel of observedSfuSctpChannel.samples()) {
46
- const report = {
47
- serviceId,
46
+ const report = Object.assign(Object.assign({ serviceId,
48
47
  sfuId,
49
- mediaUnitId,
50
- ...sfuSctpChannel,
51
- timestamp,
52
- };
48
+ mediaUnitId }, sfuSctpChannel), { timestamp });
53
49
  reports.addSfuTransportReport(report);
54
50
  }
55
51
  if (fetchSamples) {
52
+ // empty
56
53
  }
57
54
  }
58
55
  exports.visitSfuSctpChannel = visitSfuSctpChannel;
@@ -1 +1 @@
1
- {"version":3,"file":"visitSfuTransport.d.ts","sourceRoot":"","sources":["../../../src/middlewares/visitors/visitSfuTransport.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,qBAAqB,CAAC;AAC9C,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAEjE,OAAO,EAAE,oBAAoB,EAAE,MAAM,oCAAoC,CAAC;AAE1E,wBAAgB,iBAAiB,CAChC,oBAAoB,EAAE,oBAAoB,EAC1C,SAAS,EAAE,MAAM,CAAC,GAAG,EACrB,mBAAmB,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,YAAY,CAAC,EACrD,OAAO,EAAE,gBAAgB,EACzB,YAAY,EAAE,OAAO,QAqCrB"}
1
+ {"version":3,"file":"visitSfuTransport.d.ts","sourceRoot":"","sources":["../../../src/middlewares/visitors/visitSfuTransport.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,qBAAqB,CAAC;AAC9C,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAEjE,OAAO,EAAE,oBAAoB,EAAE,MAAM,oCAAoC,CAAC;AAE1E,wBAAgB,iBAAiB,CAChC,oBAAoB,EAAE,oBAAoB,EAC1C,SAAS,EAAE,MAAM,CAAC,GAAG,EACrB,mBAAmB,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,YAAY,CAAC,EACrD,OAAO,EAAE,gBAAgB,EACzB,YAAY,EAAE,OAAO,QAuCrB"}
@@ -44,16 +44,13 @@ function visitSfuTransport(observedSfuTransport, storedSfu, storedSfuTransports,
44
44
  storedSfu.sfuTransportIds.push(transportId);
45
45
  }
46
46
  for (const sfuTransport of observedSfuTransport.transportSamples()) {
47
- const report = {
48
- serviceId,
47
+ const report = Object.assign(Object.assign({ serviceId,
49
48
  sfuId,
50
- mediaUnitId,
51
- ...sfuTransport,
52
- timestamp,
53
- };
49
+ mediaUnitId }, sfuTransport), { timestamp });
54
50
  reports.addSfuTransportReport(report);
55
51
  }
56
52
  if (fetchSamples) {
53
+ // empty
57
54
  }
58
55
  }
59
56
  exports.visitSfuTransport = visitSfuTransport;
@@ -1 +1 @@
1
- {"version":3,"file":"closePeerConnectionProcess.d.ts","sourceRoot":"","sources":["../../src/processes/closePeerConnectionProcess.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAI9D,MAAM,MAAM,+BAA+B,GAAG;IAC7C,qBAAqB,EAAE;QACtB,gBAAgB,EAAE,MAAM,CAAC;QACzB,MAAM,EAAE,MAAM,CAAC;KACf,EAAE,CAAC;IACJ,SAAS,EAAE,OAAO,CAAC;CACnB,CAAC;AAEF,wBAAgB,gCAAgC,CAC/C,eAAe,EAAE,eAAe,GAC9B,CAAC,KAAK,EAAE,+BAA+B,KAAK,OAAO,CAAC,IAAI,CAAC,CAoC3D"}
1
+ {"version":3,"file":"closePeerConnectionProcess.d.ts","sourceRoot":"","sources":["../../src/processes/closePeerConnectionProcess.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAI9D,MAAM,MAAM,+BAA+B,GAAG;IAC7C,qBAAqB,EAAE;QACtB,gBAAgB,EAAE,MAAM,CAAC;QACzB,MAAM,EAAE,MAAM,CAAC;KACf,EAAE,CAAC;IACJ,SAAS,EAAE,OAAO,CAAC;CACnB,CAAC;AAEF,wBAAgB,gCAAgC,CAC/C,eAAe,EAAE,eAAe,GAC9B,CAAC,KAAK,EAAE,+BAA+B,KAAK,OAAO,CAAC,IAAI,CAAC,CAuC3D"}
@@ -1,4 +1,13 @@
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
+ };
2
11
  Object.defineProperty(exports, "__esModule", { value: true });
3
12
  exports.createClosePeerConnectionProcess = void 0;
4
13
  const inboundTrackRemoved_1 = require("./inboundTrackRemoved");
@@ -6,12 +15,12 @@ const outboundTrackRemoved_1 = require("./outboundTrackRemoved");
6
15
  function createClosePeerConnectionProcess(storageProvider) {
7
16
  const removeInboundTracks = (0, inboundTrackRemoved_1.createInboundTrackRemoveProcess)(storageProvider);
8
17
  const removeOutboundTracks = (0, outboundTrackRemoved_1.createOutboundTrackRemoveProcess)(storageProvider);
9
- const process = async (input) => {
18
+ const process = (input) => __awaiter(this, void 0, void 0, function* () {
10
19
  const { closedPeerConnections, recursive } = input;
11
20
  const { peerConnectionStorage } = storageProvider;
12
21
  const peerConnectionIds = closedPeerConnections.map((c) => c.peerConnectionId);
13
- const peerConnections = await peerConnectionStorage.getAll(peerConnectionIds);
14
- await peerConnectionStorage.removeAll(peerConnectionIds);
22
+ const peerConnections = yield peerConnectionStorage.getAll(peerConnectionIds);
23
+ yield peerConnectionStorage.removeAll(peerConnectionIds);
15
24
  if (recursive) {
16
25
  const inboundTrackIds = Array.from(peerConnections.values())
17
26
  .flatMap((pc) => pc.inboundTrackIds)
@@ -27,7 +36,7 @@ function createClosePeerConnectionProcess(storageProvider) {
27
36
  trackId,
28
37
  };
29
38
  });
30
- await Promise.all([
39
+ yield Promise.all([
31
40
  removeInboundTracks({
32
41
  removedTracks: inboundTrackIds,
33
42
  }),
@@ -36,7 +45,7 @@ function createClosePeerConnectionProcess(storageProvider) {
36
45
  }),
37
46
  ]);
38
47
  }
39
- };
48
+ });
40
49
  return process;
41
50
  }
42
51
  exports.createClosePeerConnectionProcess = createClosePeerConnectionProcess;
@@ -1 +1 @@
1
- {"version":3,"file":"detachClientProcess.d.ts","sourceRoot":"","sources":["../../src/processes/detachClientProcess.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACnD,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAG9D,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAG9D,OAAO,EAAE,0BAA0B,EAAE,MAAM,iCAAiC,CAAC;AAC7E,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAK3C,MAAM,MAAM,wBAAwB,GAAG;IACtC,OAAO,EAAE,CAAC,0BAA0B,GAAG;QACtC,QAAQ,EAAE,MAAM,CAAC;KACjB,CAAC,EAAE,CAAC;IACL,SAAS,EAAE,OAAO,CAAC;IAEnB,gBAAgB,CAAC,EAAE,QAAQ,CAAC,gBAAgB,CAAC,CAAC;CAC9C,CAAC;AAEF,wBAAgB,yBAAyB,CACxC,eAAe,EAAE,eAAe,EAChC,OAAO,EAAE,gBAAgB,GACvB,CAAC,KAAK,EAAE,wBAAwB,KAAK,OAAO,CAAC,IAAI,CAAC,CAqGpD"}
1
+ {"version":3,"file":"detachClientProcess.d.ts","sourceRoot":"","sources":["../../src/processes/detachClientProcess.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACnD,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAG9D,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAG9D,OAAO,EAAE,0BAA0B,EAAE,MAAM,iCAAiC,CAAC;AAC7E,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAI3C,MAAM,MAAM,wBAAwB,GAAG;IACtC,OAAO,EAAE,CAAC,0BAA0B,GAAG;QACtC,QAAQ,EAAE,MAAM,CAAC;KACjB,CAAC,EAAE,CAAC;IACL,SAAS,EAAE,OAAO,CAAC;IAEnB,gBAAgB,CAAC,EAAE,QAAQ,CAAC,gBAAgB,CAAC,CAAC;CAC9C,CAAC;AAEF,wBAAgB,yBAAyB,CACxC,eAAe,EAAE,eAAe,EAChC,OAAO,EAAE,gBAAgB,GACvB,CAAC,KAAK,EAAE,wBAAwB,KAAK,OAAO,CAAC,IAAI,CAAC,CA+GpD"}
@@ -1,4 +1,13 @@
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
+ };
2
11
  Object.defineProperty(exports, "__esModule", { value: true });
3
12
  exports.createDetachClientProcess = void 0;
4
13
  const callEventReports_1 = require("../sinks/callEventReports");
@@ -7,14 +16,14 @@ const logger_1 = require("../common/logger");
7
16
  const logger = (0, logger_1.createLogger)('ClientLeftProcess');
8
17
  function createDetachClientProcess(storageProvider, reports) {
9
18
  const peerConnectionClosedProcess = (0, closePeerConnectionProcess_1.createClosePeerConnectionProcess)(storageProvider);
10
- const process = async (context) => {
19
+ const process = (context) => __awaiter(this, void 0, void 0, function* () {
11
20
  var _a, _b;
12
21
  const { clients: detachedClients, recursive, evaluatorContext } = context;
13
22
  const { callStorage, clientStorage } = storageProvider;
14
23
  const clientIds = detachedClients.map((c) => c.clientId);
15
24
  if (clientIds.length < 1)
16
25
  return;
17
- const clients = await clientStorage.getAll(clientIds);
26
+ const clients = yield clientStorage.getAll(clientIds);
18
27
  const callToClientIds = new Map();
19
28
  for (const client of clients.values()) {
20
29
  const { callId, clientId } = client;
@@ -28,7 +37,7 @@ function createDetachClientProcess(storageProvider, reports) {
28
37
  recursive,
29
38
  };
30
39
  const callDetaches = new Map();
31
- await clientStorage.removeAll(clientIds).then((deletedClientIds) => {
40
+ yield clientStorage.removeAll(clientIds).then((deletedClientIds) => {
32
41
  var _a;
33
42
  for (const { clientId, detached } of detachedClients) {
34
43
  if (!deletedClientIds.has(clientId)) {
@@ -49,19 +58,16 @@ function createDetachClientProcess(storageProvider, reports) {
49
58
  });
50
59
  }
51
60
  reports.addCallEventReport((0, callEventReports_1.createClientLeftEventReport)(serviceId, mediaUnitId, roomId, callId, clientId, detached, userId, marker));
52
- evaluatorContext === null || evaluatorContext === void 0 ? void 0 : evaluatorContext.detachedClients.push({
53
- ...deletedClient,
54
- detached: Number(detached),
55
- });
61
+ evaluatorContext === null || evaluatorContext === void 0 ? void 0 : evaluatorContext.detachedClients.push(Object.assign(Object.assign({}, deletedClient), { detached: Number(detached) }));
56
62
  callDetaches.set(callId, Math.max((_a = callDetaches.get(callId)) !== null && _a !== void 0 ? _a : 0, detached));
57
63
  }
58
64
  });
59
65
  if (recursive && 0 < peerConnectionCloseProcessInput.closedPeerConnections.length) {
60
- await peerConnectionClosedProcess(peerConnectionCloseProcessInput).catch((err) => {
61
- logger.error(`Error occurred while closing peer connections`, err);
66
+ yield peerConnectionClosedProcess(peerConnectionCloseProcessInput).catch((err) => {
67
+ logger.error('Error occurred while closing peer connections', err);
62
68
  });
63
69
  }
64
- const calls = await callStorage.getAll(callToClientIds.keys());
70
+ const calls = yield callStorage.getAll(callToClientIds.keys());
65
71
  const updatedCalls = new Map();
66
72
  const removedCallIds = [];
67
73
  for (const call of calls.values()) {
@@ -78,10 +84,10 @@ function createDetachClientProcess(storageProvider, reports) {
78
84
  }
79
85
  }
80
86
  if (0 < updatedCalls.size) {
81
- await callStorage.setAll(updatedCalls);
87
+ yield callStorage.setAll(updatedCalls);
82
88
  }
83
89
  if (0 < removedCallIds.length) {
84
- await callStorage.removeAll(removedCallIds).then((deletedCalls) => {
90
+ yield callStorage.removeAll(removedCallIds).then((deletedCalls) => {
85
91
  var _a;
86
92
  for (const [callId, deletedCall] of deletedCalls) {
87
93
  const { serviceId, roomId } = deletedCall;
@@ -90,14 +96,11 @@ function createDetachClientProcess(storageProvider, reports) {
90
96
  const ended = (_a = callDetaches.get(callId)) !== null && _a !== void 0 ? _a : Date.now();
91
97
  const callEvent = (0, callEventReports_1.createCallEndedEventReport)(serviceId, roomId, callId, ended);
92
98
  reports.addCallEventReport(callEvent);
93
- evaluatorContext === null || evaluatorContext === void 0 ? void 0 : evaluatorContext.endedCalls.push({
94
- ...deletedCall,
95
- ended,
96
- });
99
+ evaluatorContext === null || evaluatorContext === void 0 ? void 0 : evaluatorContext.endedCalls.push(Object.assign(Object.assign({}, deletedCall), { ended }));
97
100
  }
98
101
  });
99
102
  }
100
- };
103
+ });
101
104
  return process;
102
105
  }
103
106
  exports.createDetachClientProcess = createDetachClientProcess;
@@ -1,5 +1,5 @@
1
- import { Client, InboundTrack } from "../models/Models";
2
- import { StorageProvider } from "../storages/StorageProvider";
1
+ import { Client, InboundTrack } from '../models/Models';
2
+ import { StorageProvider } from '../storages/StorageProvider';
3
3
  export declare const logger: import("../common/logger").WrappedLogger;
4
4
  export declare function findRemoteMatches(storages: StorageProvider, clients: ReadonlyMap<string, Client>, inboundTracks: ReadonlyMap<string, InboundTrack>): Promise<{
5
5
  remoteTrackIds: Map<string, string>;
@@ -1 +1 @@
1
- {"version":3,"file":"findRemoteMatches.d.ts","sourceRoot":"","sources":["../../src/processes/findRemoteMatches.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,YAAY,EAAiC,MAAM,kBAAkB,CAAC;AACvF,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAE9D,eAAO,MAAM,MAAM,0CAAoC,CAAC;AAmBxD,wBAAsB,iBAAiB,CACtC,QAAQ,EAAE,eAAe,EACzB,OAAO,EAAE,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,EACpC,aAAa,EAAE,WAAW,CAAC,MAAM,EAAE,YAAY,CAAC;;;;GAkEhD"}
1
+ {"version":3,"file":"findRemoteMatches.d.ts","sourceRoot":"","sources":["../../src/processes/findRemoteMatches.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,YAAY,EAAiC,MAAM,kBAAkB,CAAC;AACvF,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAE9D,eAAO,MAAM,MAAM,0CAAoC,CAAC;AAuBxD,wBAAsB,iBAAiB,CACtC,QAAQ,EAAE,eAAe,EACzB,OAAO,EAAE,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,EACpC,aAAa,EAAE,WAAW,CAAC,MAAM,EAAE,YAAY,CAAC;;;;GAyEhD"}