@observertc/observer-js 0.9.10-beta → 0.9.12-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 (94) hide show
  1. package/lib/Evaluator.d.ts +2 -0
  2. package/lib/Evaluator.d.ts.map +1 -1
  3. package/lib/Evaluator.js +2 -4
  4. package/lib/Observer.d.ts.map +1 -1
  5. package/lib/Observer.js +1 -0
  6. package/lib/common/callMetaReports.d.ts +1 -1
  7. package/lib/common/callMetaReports.d.ts.map +1 -1
  8. package/lib/common/callMetaReports.js +2 -1
  9. package/lib/common/utils.d.ts +1 -0
  10. package/lib/common/utils.d.ts.map +1 -1
  11. package/lib/common/utils.js +12 -0
  12. package/lib/middlewares/DeleteOutdatedCallEntries.d.ts +6 -0
  13. package/lib/middlewares/DeleteOutdatedCallEntries.d.ts.map +1 -0
  14. package/lib/middlewares/DeleteOutdatedCallEntries.js +112 -0
  15. package/lib/middlewares/DeleteOutdatedSfuEntries.d.ts +6 -0
  16. package/lib/middlewares/DeleteOutdatedSfuEntries.d.ts.map +1 -0
  17. package/lib/middlewares/DeleteOutdatedSfuEntries.js +118 -0
  18. package/lib/middlewares/TransactionContext.d.ts.map +1 -1
  19. package/lib/middlewares/TransactionContext.js +42 -26
  20. package/lib/middlewares/TransactoinProcessor.d.ts +1 -1
  21. package/lib/middlewares/TransactoinProcessor.d.ts.map +1 -1
  22. package/lib/middlewares/TransactoinProcessor.js +4 -2
  23. package/lib/middlewares/VisitObservedCallsMiddleware.d.ts +2 -1
  24. package/lib/middlewares/VisitObservedCallsMiddleware.d.ts.map +1 -1
  25. package/lib/middlewares/VisitObservedCallsMiddleware.js +20 -90
  26. package/lib/middlewares/visitors/visitClient.d.ts.map +1 -1
  27. package/lib/middlewares/visitors/visitClient.js +26 -17
  28. package/lib/middlewares/visitors/visitInboundAudioTrack.d.ts +1 -1
  29. package/lib/middlewares/visitors/visitInboundAudioTrack.d.ts.map +1 -1
  30. package/lib/middlewares/visitors/visitInboundAudioTrack.js +10 -2
  31. package/lib/middlewares/visitors/visitInboundVideoTrack.d.ts +1 -1
  32. package/lib/middlewares/visitors/visitInboundVideoTrack.d.ts.map +1 -1
  33. package/lib/middlewares/visitors/visitInboundVideoTrack.js +10 -2
  34. package/lib/middlewares/visitors/visitOutboundAudioTrack.d.ts.map +1 -1
  35. package/lib/middlewares/visitors/visitOutboundAudioTrack.js +5 -1
  36. package/lib/middlewares/visitors/visitOutboundVideoTarck.d.ts.map +1 -1
  37. package/lib/middlewares/visitors/visitOutboundVideoTarck.js +5 -1
  38. package/lib/middlewares/visitors/visitPeerConnection.d.ts.map +1 -1
  39. package/lib/middlewares/visitors/visitPeerConnection.js +15 -0
  40. package/lib/models/Models.d.ts +26 -22
  41. package/lib/models/Models.d.ts.map +1 -1
  42. package/lib/models/Models.js +16 -11
  43. package/lib/processes/findRemoteMatches.d.ts +9 -0
  44. package/lib/processes/findRemoteMatches.d.ts.map +1 -0
  45. package/lib/processes/findRemoteMatches.js +83 -0
  46. package/lib/processes/joinClientProcess.d.ts.map +1 -1
  47. package/lib/processes/joinClientProcess.js +1 -2
  48. package/lib/samples/ObservedCalls.d.ts.map +1 -1
  49. package/lib/samples/ObservedCalls.js +16 -7
  50. package/lib/samples/ObservedInboundAudioTrack.d.ts +2 -0
  51. package/lib/samples/ObservedInboundAudioTrack.d.ts.map +1 -1
  52. package/lib/samples/ObservedInboundVideoTrack.d.ts +2 -0
  53. package/lib/samples/ObservedInboundVideoTrack.d.ts.map +1 -1
  54. package/lib/samples/ObservedOutboundAudioTrack.d.ts +1 -0
  55. package/lib/samples/ObservedOutboundAudioTrack.d.ts.map +1 -1
  56. package/lib/samples/ObservedOutboundVideoTrack.d.ts +1 -0
  57. package/lib/samples/ObservedOutboundVideoTrack.d.ts.map +1 -1
  58. package/lib/samples/ObservedPeerConnection.d.ts.map +1 -1
  59. package/lib/samples/ObservedPeerConnection.js +15 -8
  60. package/lib/samples/ObservedSfus.d.ts.map +1 -1
  61. package/lib/samples/ObservedSfus.js +10 -4
  62. package/lib/storages/ObserverStorage.d.ts +4 -0
  63. package/lib/storages/ObserverStorage.d.ts.map +1 -1
  64. package/lib/storages/SimpleStorage.d.ts +1 -0
  65. package/lib/storages/SimpleStorage.d.ts.map +1 -1
  66. package/lib/storages/SimpleStorage.js +3 -0
  67. package/package.json +1 -1
  68. package/src/Evaluator.ts +7 -6
  69. package/src/Observer.ts +1 -0
  70. package/src/common/callMetaReports.ts +2 -0
  71. package/src/common/utils.ts +11 -0
  72. package/src/middlewares/DeleteOutdatedCallEntries.ts +151 -0
  73. package/src/middlewares/DeleteOutdatedSfuEntries.ts +159 -0
  74. package/src/middlewares/TransactionContext.ts +61 -29
  75. package/src/middlewares/TransactoinProcessor.ts +8 -2
  76. package/src/middlewares/VisitObservedCallsMiddleware.ts +42 -128
  77. package/src/middlewares/visitors/visitClient.ts +34 -18
  78. package/src/middlewares/visitors/visitInboundAudioTrack.ts +15 -5
  79. package/src/middlewares/visitors/visitInboundVideoTrack.ts +14 -2
  80. package/src/middlewares/visitors/visitOutboundAudioTrack.ts +6 -2
  81. package/src/middlewares/visitors/visitOutboundVideoTarck.ts +5 -1
  82. package/src/middlewares/visitors/visitPeerConnection.ts +17 -1
  83. package/src/models/Models.ts +40 -34
  84. package/src/processes/findRemoteMatches.ts +94 -0
  85. package/src/processes/joinClientProcess.ts +1 -3
  86. package/src/samples/ObservedCalls.ts +17 -7
  87. package/src/samples/ObservedInboundAudioTrack.ts +2 -0
  88. package/src/samples/ObservedInboundVideoTrack.ts +3 -1
  89. package/src/samples/ObservedOutboundAudioTrack.ts +2 -1
  90. package/src/samples/ObservedOutboundVideoTrack.ts +2 -1
  91. package/src/samples/ObservedPeerConnection.ts +29 -8
  92. package/src/samples/ObservedSfus.ts +10 -5
  93. package/src/storages/ObserverStorage.ts +5 -0
  94. package/src/storages/SimpleStorage.ts +4 -0
@@ -1,3 +1,4 @@
1
+ import { iteratorConverter } from '../common/utils';
1
2
  import { ObservedCall, ObservedCallBuilder } from './ObservedCall';
2
3
  import { ObservedSfu, ObservedSfuBuilder } from './ObservedSfu';
3
4
 
@@ -33,21 +34,23 @@ export class ObservedSfusBuilder {
33
34
  public build(): ObservedSfus {
34
35
  const observedSfus = new Map<string, ObservedSfu>();
35
36
 
36
- const sfuIds = function* (): IterableIterator<string> {
37
+ const sfuIdsGenerator = function* () {
37
38
  for (const observedSfu of observedSfus.values()) {
38
39
  yield observedSfu.sfuId;
39
40
  }
40
41
  };
42
+ const sfuIds = () => iteratorConverter<string>(sfuIdsGenerator());
41
43
 
42
- const sfuTransportIds = function* (): IterableIterator<string> {
44
+ const sfuTransportIdsGenerator = function* () {
43
45
  for (const observedSfu of observedSfus.values()) {
44
46
  for (const observedTransport of observedSfu.observedSfuTransports()) {
45
47
  yield observedTransport.transportId;
46
48
  }
47
49
  }
48
50
  };
51
+ const sfuTransportIds = () => iteratorConverter<string>(sfuTransportIdsGenerator());
49
52
 
50
- const sfuInboundRtpPadIds = function* (): IterableIterator<string> {
53
+ const sfuInboundRtpPadIdsGenerator = function* () {
51
54
  for (const observedSfu of observedSfus.values()) {
52
55
  for (const observedTransport of observedSfu.observedSfuTransports()) {
53
56
  for (const sfuInboundRtpPad of observedTransport.inboundRtpPads()) {
@@ -56,8 +59,9 @@ export class ObservedSfusBuilder {
56
59
  }
57
60
  }
58
61
  };
62
+ const sfuInboundRtpPadIds = () => iteratorConverter<string>(sfuInboundRtpPadIdsGenerator());
59
63
 
60
- const sfuOutboundRtpPadIds = function* (): IterableIterator<string> {
64
+ const sfuOutboundRtpPadIdsGenerator = function* () {
61
65
  for (const observedSfu of observedSfus.values()) {
62
66
  for (const observedTransport of observedSfu.observedSfuTransports()) {
63
67
  for (const sfuOutboundRtpPad of observedTransport.outboundRtpPads()) {
@@ -66,7 +70,7 @@ export class ObservedSfusBuilder {
66
70
  }
67
71
  }
68
72
  };
69
-
73
+ const sfuOutboundRtpPadIds = () => iteratorConverter<string>(sfuOutboundRtpPadIdsGenerator());
70
74
 
71
75
  const result: ObservedSfus = {
72
76
  sfuIds,
@@ -80,6 +84,7 @@ export class ObservedSfusBuilder {
80
84
  const observedSfu = builder.build();
81
85
  observedSfus.set(observedSfu.sfuId, observedSfu);
82
86
  }
87
+ this._builders.clear();
83
88
  return result;
84
89
  }
85
90
  }
@@ -90,4 +90,9 @@ export interface ObserverStorage<K, V> {
90
90
  * Returns an async iterable iterator for the key-value pairs in the storage.
91
91
  */
92
92
  [Symbol.asyncIterator](): AsyncIterableIterator<[K, V]>;
93
+
94
+ /**
95
+ * Returns an iterable iterator for the key-value pairs stored in this local instance of the storage.
96
+ */
97
+ localEntries(): IterableIterator<[K, V]>;
93
98
  }
@@ -90,4 +90,8 @@ export class SimpleStorage<K, V> implements ObserverStorage<K, V> {
90
90
  yield entry;
91
91
  }
92
92
  }
93
+
94
+ public localEntries(): IterableIterator<[K, V]> {
95
+ return this._map.entries();
96
+ }
93
97
  }