@observertc/observer-js 0.30.5-beta → 0.40.0-beta

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (58) hide show
  1. package/lib/CallSummary.d.ts +22 -0
  2. package/lib/CallSummary.d.ts.map +1 -0
  3. package/lib/ObservedCall.d.ts +6 -13
  4. package/lib/ObservedCall.d.ts.map +1 -1
  5. package/lib/ObservedCall.js +24 -104
  6. package/lib/ObservedClient.d.ts +16 -27
  7. package/lib/ObservedClient.d.ts.map +1 -1
  8. package/lib/ObservedClient.js +360 -523
  9. package/lib/ObservedInboundTrack.d.ts +3 -8
  10. package/lib/ObservedInboundTrack.d.ts.map +1 -1
  11. package/lib/ObservedInboundTrack.js +74 -154
  12. package/lib/ObservedOutboundTrack.d.ts +9 -8
  13. package/lib/ObservedOutboundTrack.d.ts.map +1 -1
  14. package/lib/ObservedOutboundTrack.js +76 -130
  15. package/lib/ObservedPeerConnection.d.ts +17 -15
  16. package/lib/ObservedPeerConnection.d.ts.map +1 -1
  17. package/lib/ObservedPeerConnection.js +64 -173
  18. package/lib/ObservedSfu.d.ts +14 -4
  19. package/lib/ObservedSfu.d.ts.map +1 -1
  20. package/lib/ObservedSfu.js +37 -50
  21. package/lib/Observer.d.ts +5 -6
  22. package/lib/Observer.d.ts.map +1 -1
  23. package/lib/Observer.js +28 -31
  24. package/lib/common/types.d.ts +0 -55
  25. package/lib/common/types.d.ts.map +1 -1
  26. package/lib/index.d.ts +5 -7
  27. package/lib/index.d.ts.map +1 -1
  28. package/package.json +1 -1
  29. package/src/CallSummary.ts +23 -0
  30. package/src/ObservedCall.ts +27 -87
  31. package/src/ObservedClient.ts +425 -582
  32. package/src/ObservedInboundTrack.ts +14 -65
  33. package/src/ObservedOutboundTrack.ts +32 -53
  34. package/src/ObservedPeerConnection.ts +55 -117
  35. package/src/ObservedSfu.ts +45 -27
  36. package/src/Observer.ts +11 -16
  37. package/src/common/types.ts +0 -69
  38. package/src/index.ts +5 -7
  39. package/lib/models/Models.d.ts +0 -642
  40. package/lib/models/Models.d.ts.map +0 -1
  41. package/lib/models/Models.js +0 -481
  42. package/lib/models/samples_pb.d.ts +0 -2452
  43. package/lib/models/samples_pb.d.ts.map +0 -1
  44. package/lib/models/samples_pb.js +0 -1495
  45. package/lib/storages/ObserverStorage.d.ts +0 -87
  46. package/lib/storages/ObserverStorage.d.ts.map +0 -1
  47. package/lib/storages/SimpleStorage.d.ts +0 -19
  48. package/lib/storages/SimpleStorage.d.ts.map +0 -1
  49. package/lib/storages/SimpleStorage.js +0 -106
  50. package/lib/storages/StorageProvider.d.ts +0 -16
  51. package/lib/storages/StorageProvider.d.ts.map +0 -1
  52. package/lib/storages/StorageProvider.js +0 -29
  53. package/src/models/Models.ts +0 -1103
  54. package/src/models/samples_pb.ts +0 -4061
  55. package/src/storages/ObserverStorage.ts +0 -99
  56. package/src/storages/SimpleStorage.ts +0 -120
  57. package/src/storages/StorageProvider.ts +0 -42
  58. /package/lib/{storages/ObserverStorage.js → CallSummary.js} +0 -0
@@ -1,87 +0,0 @@
1
- /**
2
- * The `ObserverStorage` interface defines the methods used for managing storage of key-value pairs.
3
- */
4
- export interface ObserverStorage<K, V> {
5
- /**
6
- * The identifier of the storage
7
- */
8
- readonly id: string;
9
- /**
10
- * Returns the number of entries the storage has.
11
- */
12
- size(): Promise<number>;
13
- /**
14
- * Clears the storage and evicts all entries.
15
- */
16
- clear(): Promise<void>;
17
- /**
18
- * Retrieves the value associated with the given key or returns undefined if the entry is not found.
19
- *
20
- * @param key The key to be accessed in the storage.
21
- * @returns The value or undefined if the entry was not found.
22
- */
23
- get(key: K): Promise<V | undefined>;
24
- /**
25
- * Retrieves a map filled with key-value pairs found in the storage for the given keys.
26
- *
27
- * @param keys A set of keys to be retrieved from the storage.
28
- * @returns A ReadonlyMap containing the key-value pairs found in the storage.
29
- */
30
- getAll(keys: Iterable<K>): Promise<ReadonlyMap<K, V>>;
31
- /**
32
- * Sets the value for the specified key and returns the previous value or undefined.
33
- *
34
- * @param key The key to be set.
35
- * @param value The value to be set.
36
- * @returns The previous value or undefined.
37
- */
38
- set(key: K, value: V): Promise<V | undefined>;
39
- /**
40
- * Sets all the key-value pairs in the provided ReadonlyMap.
41
- *
42
- * @param entries A ReadonlyMap containing the key-value pairs to be set.
43
- * @returns A Promise of the ReadonlyMap containing the key-value pairs.
44
- */
45
- setAll(entries: ReadonlyMap<K, V>): Promise<ReadonlyMap<K, V>>;
46
- /**
47
- * Inserts a key-value pair only if the key does not already exist and returns the value or undefined.
48
- *
49
- * @param key The key to be inserted.
50
- * @param value The value to be inserted.
51
- * @returns The value already stored in the storage, or undefined if there was no value stored for the given key.
52
- */
53
- insert(key: K, value: V): Promise<V | undefined>;
54
- /**
55
- * Inserts all key-value pairs in the provided ReadonlyMap only if the keys do not already exist.
56
- * Returns a ReadonlyMap containing the values already stored in the storage for the given keys,
57
- * or undefined for each key that had no value stored.
58
- *
59
- * @param entries A ReadonlyMap containing the key-value pairs to be inserted.
60
- * @returns A Promise of the ReadonlyMap containing the values already stored in the storage for the given keys,
61
- * or undefined for each key that had no value stored.
62
- */
63
- insertAll(entries: ReadonlyMap<K, V>): Promise<ReadonlyMap<K, V | undefined>>;
64
- /**
65
- * Removes the key-value pair associated with the specified key and returns the removed value or undefined.
66
- *
67
- * @param key The key to be removed.
68
- * @returns The removed value or undefined.
69
- */
70
- remove(key: K): Promise<V | undefined>;
71
- /**
72
- * Removes all key-value pairs associated with the specified keys and returns a ReadonlyMap of the removed pairs.
73
- *
74
- * @param keys An iterable of keys to be removed.
75
- * @returns A Promise of the ReadonlyMap containing the removed key-value pairs.
76
- */
77
- removeAll(keys: Iterable<K>): Promise<ReadonlyMap<K, V>>;
78
- /**
79
- * Returns an async iterable iterator for the key-value pairs in the storage.
80
- */
81
- [Symbol.asyncIterator](): AsyncIterableIterator<[K, V]>;
82
- /**
83
- * Returns an iterable iterator for the key-value pairs stored in this local instance of the storage.
84
- */
85
- localEntries(): IterableIterator<[K, V]>;
86
- }
87
- //# sourceMappingURL=ObserverStorage.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ObserverStorage.d.ts","sourceRoot":"","sources":["../../src/storages/ObserverStorage.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,eAAe,CAAC,CAAC,EAAE,CAAC;IAEpC;;OAEG;IACH,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IAEpB;;OAEG;IACH,IAAI,IAAI,OAAO,CAAC,MAAM,CAAC,CAAC;IAExB;;OAEG;IACH,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IAEvB;;;;;OAKG;IACH,GAAG,CAAC,GAAG,EAAE,CAAC,GAAG,OAAO,CAAC,CAAC,GAAG,SAAS,CAAC,CAAC;IAEpC;;;;;OAKG;IACH,MAAM,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;IAEtD;;;;;;OAMG;IACH,GAAG,CAAC,GAAG,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,GAAG,OAAO,CAAC,CAAC,GAAG,SAAS,CAAC,CAAC;IAE9C;;;;;OAKG;IACH,MAAM,CAAC,OAAO,EAAE,WAAW,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;IAE/D;;;;;;OAMG;IACH,MAAM,CAAC,GAAG,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,GAAG,OAAO,CAAC,CAAC,GAAG,SAAS,CAAC,CAAC;IAEjD;;;;;;;;OAQG;IACH,SAAS,CAAC,OAAO,EAAE,WAAW,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC,EAAE,CAAC,GAAG,SAAS,CAAC,CAAC,CAAC;IAE9E;;;;;OAKG;IACH,MAAM,CAAC,GAAG,EAAE,CAAC,GAAG,OAAO,CAAC,CAAC,GAAG,SAAS,CAAC,CAAC;IAEvC;;;;;OAKG;IACH,SAAS,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;IAEzD;;OAEG;IACH,CAAC,MAAM,CAAC,aAAa,CAAC,IAAI,qBAAqB,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;IAExD;;OAEG;IACH,YAAY,IAAI,gBAAgB,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;CACzC"}
@@ -1,19 +0,0 @@
1
- import { ObserverStorage } from './ObserverStorage';
2
- export declare class SimpleStorage<K, V> implements ObserverStorage<K, V> {
3
- readonly id: string;
4
- private _map;
5
- constructor(id: string);
6
- size(): Promise<number>;
7
- clear(): Promise<void>;
8
- get(key: K): Promise<V | undefined>;
9
- getAll(keys: Iterable<K>): Promise<ReadonlyMap<K, V>>;
10
- set(key: K, value: V): Promise<V | undefined>;
11
- setAll(entries: ReadonlyMap<K, V>): Promise<ReadonlyMap<K, V>>;
12
- insert(key: K, value: V): Promise<V | undefined>;
13
- insertAll(entries: ReadonlyMap<K, V>): Promise<ReadonlyMap<K, V>>;
14
- remove(key: K): Promise<V | undefined>;
15
- removeAll(keys: Iterable<K>): Promise<ReadonlyMap<K, V>>;
16
- [Symbol.asyncIterator](): AsyncIterableIterator<[K, V]>;
17
- localEntries(): IterableIterator<[K, V]>;
18
- }
19
- //# sourceMappingURL=SimpleStorage.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"SimpleStorage.d.ts","sourceRoot":"","sources":["../../src/storages/SimpleStorage.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEpD,qBAAa,aAAa,CAAC,CAAC,EAAE,CAAC,CAAE,YAAW,eAAe,CAAC,CAAC,EA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
1
- "use strict";
2
- var __await = (this && this.__await) || function (v) { return this instanceof __await ? (this.v = v, this) : new __await(v); }
3
- var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _arguments, generator) {
4
- if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
5
- var g = generator.apply(thisArg, _arguments || []), i, q = [];
6
- return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
7
- function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
8
- function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
9
- function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
10
- function fulfill(value) { resume("next", value); }
11
- function reject(value) { resume("throw", value); }
12
- function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
13
- };
14
- Object.defineProperty(exports, "__esModule", { value: true });
15
- exports.SimpleStorage = void 0;
16
- class SimpleStorage {
17
- constructor(id) {
18
- this.id = id;
19
- this._map = new Map();
20
- }
21
- size() {
22
- return Promise.resolve(this._map.size);
23
- }
24
- clear() {
25
- this._map.clear();
26
- return Promise.resolve();
27
- }
28
- get(key) {
29
- return Promise.resolve(this._map.get(key));
30
- }
31
- getAll(keys) {
32
- const result = new Map();
33
- for (const key of keys) {
34
- const value = this._map.get(key);
35
- if (value) {
36
- result.set(key, value);
37
- }
38
- }
39
- return Promise.resolve(result);
40
- }
41
- set(key, value) {
42
- const result = this._map.get(key);
43
- this._map.set(key, value);
44
- return Promise.resolve(result);
45
- }
46
- setAll(entries) {
47
- const result = new Map();
48
- for (const [key, value] of entries) {
49
- const oldValue = this._map.get(key);
50
- if (oldValue) {
51
- result.set(key, oldValue);
52
- }
53
- this._map.set(key, value);
54
- }
55
- return Promise.resolve(result);
56
- }
57
- insert(key, value) {
58
- const result = this._map.get(key);
59
- if (result) {
60
- return Promise.resolve(result);
61
- }
62
- this._map.set(key, value);
63
- return Promise.resolve(undefined);
64
- }
65
- insertAll(entries) {
66
- const result = new Map();
67
- for (const [key, value] of entries) {
68
- const oldValue = this._map.get(key);
69
- if (oldValue) {
70
- result.set(key, oldValue);
71
- }
72
- else {
73
- this._map.set(key, value);
74
- }
75
- }
76
- return Promise.resolve(result);
77
- }
78
- remove(key) {
79
- const result = this._map.get(key);
80
- this._map.delete(key);
81
- return Promise.resolve(result);
82
- }
83
- removeAll(keys) {
84
- const result = new Map();
85
- for (const key of keys) {
86
- const value = this._map.get(key);
87
- this._map.delete(key);
88
- if (value) {
89
- result.set(key, value);
90
- }
91
- }
92
- return Promise.resolve(result);
93
- }
94
- [Symbol.asyncIterator]() {
95
- return __asyncGenerator(this, arguments, function* _a() {
96
- yield __await(Promise.resolve());
97
- for (const entry of this._map.entries()) {
98
- yield yield __await(entry);
99
- }
100
- });
101
- }
102
- localEntries() {
103
- return this._map.entries();
104
- }
105
- }
106
- exports.SimpleStorage = SimpleStorage;
@@ -1,16 +0,0 @@
1
- import { ObserverStorage } from './ObserverStorage';
2
- import * as Models from '../models/Models';
3
- export interface StorageProvider {
4
- readonly callStorage: ObserverStorage<string, Models.Call>;
5
- readonly clientStorage: ObserverStorage<string, Models.Client>;
6
- readonly peerConnectionStorage: ObserverStorage<string, Models.PeerConnection>;
7
- readonly inboundTrackStorage: ObserverStorage<string, Models.InboundTrack>;
8
- readonly outboundTrackStorage: ObserverStorage<string, Models.OutboundTrack>;
9
- readonly sfuStorage: ObserverStorage<string, Models.Sfu>;
10
- readonly sfuTransportStorage: ObserverStorage<string, Models.SfuTransport>;
11
- readonly sfuInboundRtpPadStorage: ObserverStorage<string, Models.SfuInboundRtpPad>;
12
- readonly sfuOutboundRtpPadStorage: ObserverStorage<string, Models.SfuOutboundRtpPad>;
13
- readonly sfuSctpChannelStorage: ObserverStorage<string, Models.SfuSctpChannel>;
14
- }
15
- export declare function createSimpleStorageProvider(): StorageProvider;
16
- //# sourceMappingURL=StorageProvider.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"StorageProvider.d.ts","sourceRoot":"","sources":["../../src/storages/StorageProvider.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,KAAK,MAAM,MAAM,kBAAkB,CAAC;AAG3C,MAAM,WAAW,eAAe;IAC/B,QAAQ,CAAC,WAAW,EAAE,eAAe,CAAC,MAAM,EAAE,MAAM,CAAC,IAAI,CAAC,CAAC;IAC3D,QAAQ,CAAC,aAAa,EAAE,eAAe,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC;IAC/D,QAAQ,CAAC,qBAAqB,EAAE,eAAe,CAAC,MAAM,EAAE,MAAM,CAAC,cAAc,CAAC,CAAC;IAC/E,QAAQ,CAAC,mBAAmB,EAAE,eAAe,CAAC,MAAM,EAAE,MAAM,CAAC,YAAY,CAAC,CAAC;IAC3E,QAAQ,CAAC,oBAAoB,EAAE,eAAe,CAAC,MAAM,EAAE,MAAM,CAAC,aAAa,CAAC,CAAC;IAC7E,QAAQ,CAAC,UAAU,EAAE,eAAe,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,CAAC,CAAC;IACzD,QAAQ,CAAC,mBAAmB,EAAE,eAAe,CAAC,MAAM,EAAE,MAAM,CAAC,YAAY,CAAC,CAAC;IAC3E,QAAQ,CAAC,uBAAuB,EAAE,eAAe,CAAC,MAAM,EAAE,MAAM,CAAC,gBAAgB,CAAC,CAAC;IACnF,QAAQ,CAAC,wBAAwB,EAAE,eAAe,CAAC,MAAM,EAAE,MAAM,CAAC,iBAAiB,CAAC,CAAC;IACrF,QAAQ,CAAC,qBAAqB,EAAE,eAAe,CAAC,MAAM,EAAE,MAAM,CAAC,cAAc,CAAC,CAAC;CAC/E;AAED,wBAAgB,2BAA2B,IAAI,eAAe,CAwB7D"}
@@ -1,29 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.createSimpleStorageProvider = void 0;
4
- const SimpleStorage_1 = require("./SimpleStorage");
5
- function createSimpleStorageProvider() {
6
- const callStorage = new SimpleStorage_1.SimpleStorage('ObserverCallStorage');
7
- const clientStorage = new SimpleStorage_1.SimpleStorage('ObserverClientStorage');
8
- const peerConnectionStorage = new SimpleStorage_1.SimpleStorage('ObserverPeerConnectionStorage');
9
- const inboundTrackStorage = new SimpleStorage_1.SimpleStorage('ObserverInboundTrackStorage');
10
- const outboundTrackStorage = new SimpleStorage_1.SimpleStorage('ObserverOutboundTrackStorage');
11
- const sfuStorage = new SimpleStorage_1.SimpleStorage('ObserverSfuStorage');
12
- const sfuTransportStorage = new SimpleStorage_1.SimpleStorage('ObserverSfuTransportStorage');
13
- const sfuInboundRtpPadStorage = new SimpleStorage_1.SimpleStorage('ObserverSfuInboundRtpPadStorage');
14
- const sfuOutboundRtpPadStorage = new SimpleStorage_1.SimpleStorage('ObserverSfuOutboundRtpPadStorage');
15
- const sfuSctpChannelStorage = new SimpleStorage_1.SimpleStorage('ObserverSfuSctpChannelStorage');
16
- return {
17
- callStorage,
18
- clientStorage,
19
- peerConnectionStorage,
20
- inboundTrackStorage,
21
- outboundTrackStorage,
22
- sfuStorage,
23
- sfuTransportStorage,
24
- sfuInboundRtpPadStorage,
25
- sfuOutboundRtpPadStorage,
26
- sfuSctpChannelStorage,
27
- };
28
- }
29
- exports.createSimpleStorageProvider = createSimpleStorageProvider;