@observertc/observer-js 1.0.1-ec27289.0 → 1.1.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.
- package/README.md +2184 -1
- package/dist/index.d.mts +6842 -0
- package/dist/index.d.ts +6842 -0
- package/dist/index.js +7736 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +7608 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +44 -18
- package/.eslintrc.json +0 -143
- package/.prettierignore +0 -5
- package/.prettierrc +0 -7
- package/jest.config.js +0 -9
- package/lib/ObservedCall.d.ts +0 -83
- package/lib/ObservedCall.d.ts.map +0 -1
- package/lib/ObservedCall.js +0 -203
- package/lib/ObservedCallSummary.d.ts +0 -18
- package/lib/ObservedCallSummary.d.ts.map +0 -1
- package/lib/ObservedCallSummary.js +0 -2
- package/lib/ObservedCertificate.d.ts +0 -19
- package/lib/ObservedCertificate.d.ts.map +0 -1
- package/lib/ObservedCertificate.js +0 -38
- package/lib/ObservedClient.d.ts +0 -131
- package/lib/ObservedClient.d.ts.map +0 -1
- package/lib/ObservedClient.js +0 -520
- package/lib/ObservedClientEventMonitor.d.ts +0 -89
- package/lib/ObservedClientEventMonitor.d.ts.map +0 -1
- package/lib/ObservedClientEventMonitor.js +0 -247
- package/lib/ObservedClientSummary.d.ts +0 -23
- package/lib/ObservedClientSummary.d.ts.map +0 -1
- package/lib/ObservedClientSummary.js +0 -2
- package/lib/ObservedCodec.d.ts +0 -22
- package/lib/ObservedCodec.d.ts.map +0 -1
- package/lib/ObservedCodec.js +0 -45
- package/lib/ObservedDataChannel.d.ts +0 -30
- package/lib/ObservedDataChannel.d.ts.map +0 -1
- package/lib/ObservedDataChannel.js +0 -75
- package/lib/ObservedIceCandidate.d.ts +0 -29
- package/lib/ObservedIceCandidate.d.ts.map +0 -1
- package/lib/ObservedIceCandidate.js +0 -59
- package/lib/ObservedIceCandidatePair.d.ts +0 -44
- package/lib/ObservedIceCandidatePair.d.ts.map +0 -1
- package/lib/ObservedIceCandidatePair.js +0 -111
- package/lib/ObservedIceTransport.d.ts +0 -36
- package/lib/ObservedIceTransport.d.ts.map +0 -1
- package/lib/ObservedIceTransport.js +0 -93
- package/lib/ObservedInboundRtp.d.ts +0 -92
- package/lib/ObservedInboundRtp.d.ts.map +0 -1
- package/lib/ObservedInboundRtp.js +0 -193
- package/lib/ObservedInboundTrack.d.ts +0 -31
- package/lib/ObservedInboundTrack.d.ts.map +0 -1
- package/lib/ObservedInboundTrack.js +0 -59
- package/lib/ObservedMediaPlayout.d.ts +0 -22
- package/lib/ObservedMediaPlayout.d.ts.map +0 -1
- package/lib/ObservedMediaPlayout.js +0 -42
- package/lib/ObservedMediaSource.d.ts +0 -28
- package/lib/ObservedMediaSource.d.ts.map +0 -1
- package/lib/ObservedMediaSource.js +0 -55
- package/lib/ObservedOutboundRtp.d.ts +0 -62
- package/lib/ObservedOutboundRtp.d.ts.map +0 -1
- package/lib/ObservedOutboundRtp.js +0 -144
- package/lib/ObservedOutboundTrack.d.ts +0 -31
- package/lib/ObservedOutboundTrack.d.ts.map +0 -1
- package/lib/ObservedOutboundTrack.js +0 -59
- package/lib/ObservedPeerConnection.d.ts +0 -185
- package/lib/ObservedPeerConnection.d.ts.map +0 -1
- package/lib/ObservedPeerConnection.js +0 -710
- package/lib/ObservedPeerConnectionTransport.d.ts +0 -17
- package/lib/ObservedPeerConnectionTransport.d.ts.map +0 -1
- package/lib/ObservedPeerConnectionTransport.js +0 -34
- package/lib/ObservedRemoteInboundRtp.d.ts +0 -30
- package/lib/ObservedRemoteInboundRtp.d.ts.map +0 -1
- package/lib/ObservedRemoteInboundRtp.js +0 -60
- package/lib/ObservedRemoteOutboundRtp.d.ts +0 -30
- package/lib/ObservedRemoteOutboundRtp.d.ts.map +0 -1
- package/lib/ObservedRemoteOutboundRtp.js +0 -60
- package/lib/ObservedTURN.d.ts +0 -31
- package/lib/ObservedTURN.d.ts.map +0 -1
- package/lib/ObservedTURN.js +0 -58
- package/lib/ObservedTurnServer.d.ts +0 -25
- package/lib/ObservedTurnServer.d.ts.map +0 -1
- package/lib/ObservedTurnServer.js +0 -59
- package/lib/Observer.d.ts +0 -61
- package/lib/Observer.d.ts.map +0 -1
- package/lib/Observer.js +0 -156
- package/lib/ObserverSummary.d.ts +0 -13
- package/lib/ObserverSummary.d.ts.map +0 -1
- package/lib/ObserverSummary.js +0 -2
- package/lib/common/Middleware.d.ts +0 -17
- package/lib/common/Middleware.d.ts.map +0 -1
- package/lib/common/Middleware.js +0 -60
- package/lib/common/SingleExecutor.d.ts +0 -3
- package/lib/common/SingleExecutor.d.ts.map +0 -1
- package/lib/common/SingleExecutor.js +0 -31
- package/lib/common/logger.d.ts +0 -17
- package/lib/common/logger.d.ts.map +0 -1
- package/lib/common/logger.js +0 -50
- package/lib/common/types.d.ts +0 -3
- package/lib/common/types.d.ts.map +0 -1
- package/lib/common/types.js +0 -3
- package/lib/common/utils.d.ts +0 -11
- package/lib/common/utils.d.ts.map +0 -1
- package/lib/common/utils.js +0 -63
- package/lib/detectors/Detector.d.ts +0 -5
- package/lib/detectors/Detector.d.ts.map +0 -1
- package/lib/detectors/Detector.js +0 -3
- package/lib/detectors/Detectors.d.ts +0 -11
- package/lib/detectors/Detectors.d.ts.map +0 -1
- package/lib/detectors/Detectors.js +0 -34
- package/lib/index.d.ts +0 -27
- package/lib/index.d.ts.map +0 -1
- package/lib/index.js +0 -47
- package/lib/monitors/TurnUsageMonitor.d.ts +0 -1
- package/lib/monitors/TurnUsageMonitor.d.ts.map +0 -1
- package/lib/monitors/TurnUsageMonitor.js +0 -146
- package/lib/schema/ClientEventTypes.d.ts +0 -100
- package/lib/schema/ClientEventTypes.d.ts.map +0 -1
- package/lib/schema/ClientEventTypes.js +0 -38
- package/lib/schema/ClientMetaTypes.d.ts +0 -34
- package/lib/schema/ClientMetaTypes.d.ts.map +0 -1
- package/lib/schema/ClientMetaTypes.js +0 -16
- package/lib/schema/ClientSample.d.ts +0 -1333
- package/lib/schema/ClientSample.d.ts.map +0 -1
- package/lib/schema/ClientSample.js +0 -4
- package/lib/scores/CalculatedScore.d.ts +0 -6
- package/lib/scores/CalculatedScore.d.ts.map +0 -1
- package/lib/scores/CalculatedScore.js +0 -2
- package/lib/scores/DefaultCallScoreCalculator.d.ts +0 -7
- package/lib/scores/DefaultCallScoreCalculator.d.ts.map +0 -1
- package/lib/scores/DefaultCallScoreCalculator.js +0 -21
- package/lib/scores/ScoreCalculator.d.ts +0 -4
- package/lib/scores/ScoreCalculator.d.ts.map +0 -1
- package/lib/scores/ScoreCalculator.js +0 -2
- package/lib/updaters/CallUpdater.d.ts +0 -5
- package/lib/updaters/CallUpdater.d.ts.map +0 -1
- package/lib/updaters/CallUpdater.js +0 -2
- package/lib/updaters/ObserverUpdater.d.ts +0 -5
- package/lib/updaters/ObserverUpdater.d.ts.map +0 -1
- package/lib/updaters/ObserverUpdater.js +0 -2
- package/lib/updaters/OnAllCallObserverUpdater_.d.ts +0 -13
- package/lib/updaters/OnAllCallObserverUpdater_.d.ts.map +0 -1
- package/lib/updaters/OnAllCallObserverUpdater_.js +0 -38
- package/lib/updaters/OnAllClientCallUpdater.d.ts +0 -13
- package/lib/updaters/OnAllClientCallUpdater.d.ts.map +0 -1
- package/lib/updaters/OnAllClientCallUpdater.js +0 -37
- package/lib/updaters/OnAnyCallObserverUpdater_.d.ts +0 -11
- package/lib/updaters/OnAnyCallObserverUpdater_.d.ts.map +0 -1
- package/lib/updaters/OnAnyCallObserverUpdater_.js +0 -27
- package/lib/updaters/OnAnyClientCallUpdater.d.ts +0 -11
- package/lib/updaters/OnAnyClientCallUpdater.d.ts.map +0 -1
- package/lib/updaters/OnAnyClientCallUpdater.js +0 -27
- package/lib/updaters/OnIntervalUpdater.d.ts +0 -10
- package/lib/updaters/OnIntervalUpdater.d.ts.map +0 -1
- package/lib/updaters/OnIntervalUpdater.js +0 -17
- package/lib/updaters/Updater.d.ts +0 -6
- package/lib/updaters/Updater.d.ts.map +0 -1
- package/lib/updaters/Updater.js +0 -2
- package/lib/utils/RemoteTrackResolver.d.ts +0 -7
- package/lib/utils/RemoteTrackResolver.d.ts.map +0 -1
- package/lib/utils/RemoteTrackResolver.js +0 -2
- package/src/ObservedCall.ts +0 -322
- package/src/ObservedCallSummary.ts +0 -22
- package/src/ObservedCertificate.ts +0 -43
- package/src/ObservedClient.ts +0 -673
- package/src/ObservedClientEventMonitor.ts +0 -301
- package/src/ObservedClientSummary.ts +0 -24
- package/src/ObservedCodec.ts +0 -49
- package/src/ObservedDataChannel.ts +0 -85
- package/src/ObservedIceCandidate.ts +0 -64
- package/src/ObservedIceCandidatePair.ts +0 -118
- package/src/ObservedIceTransport.ts +0 -99
- package/src/ObservedInboundRtp.ts +0 -205
- package/src/ObservedInboundTrack.ts +0 -73
- package/src/ObservedMediaPlayout.ts +0 -49
- package/src/ObservedMediaSource.ts +0 -60
- package/src/ObservedOutboundRtp.ts +0 -156
- package/src/ObservedOutboundTrack.ts +0 -72
- package/src/ObservedPeerConnection.ts +0 -1019
- package/src/ObservedPeerConnectionTransport.ts +0 -38
- package/src/ObservedRemoteInboundRtp.ts +0 -64
- package/src/ObservedRemoteOutboundRtp.ts +0 -65
- package/src/ObservedTURN.ts +0 -86
- package/src/ObservedTurnServer.ts +0 -72
- package/src/Observer.ts +0 -239
- package/src/ObserverSummary.ts +0 -15
- package/src/common/Middleware.ts +0 -84
- package/src/common/SingleExecutor.ts +0 -36
- package/src/common/logger.ts +0 -82
- package/src/common/types.ts +0 -4
- package/src/common/utils.ts +0 -69
- package/src/detectors/Detector.ts +0 -6
- package/src/detectors/Detectors.ts +0 -38
- package/src/index.ts +0 -28
- package/src/monitors/TurnUsageMonitor.ts +0 -187
- package/src/schema/ClientEventTypes.ts +0 -112
- package/src/schema/ClientMetaTypes.ts +0 -41
- package/src/schema/ClientSample.ts +0 -1682
- package/src/scores/CalculatedScore.ts +0 -6
- package/src/scores/DefaultCallScoreCalculator.ts +0 -23
- package/src/scores/ScoreCalculator.ts +0 -3
- package/src/updaters/CallUpdater.ts +0 -5
- package/src/updaters/ObserverUpdater.ts +0 -5
- package/src/updaters/OnAllCallObserverUpdater_.ts +0 -46
- package/src/updaters/OnAllClientCallUpdater.ts +0 -46
- package/src/updaters/OnAnyCallObserverUpdater_.ts +0 -32
- package/src/updaters/OnAnyClientCallUpdater.ts +0 -32
- package/src/updaters/OnIntervalUpdater.ts +0 -19
- package/src/updaters/Updater.ts +0 -5
- package/src/utils/RemoteTrackResolver.ts +0 -12
- package/tsconfig.json +0 -19
- package/tslint.json +0 -6
package/package.json
CHANGED
|
@@ -1,20 +1,40 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@observertc/observer-js",
|
|
3
|
-
"version": "1.
|
|
4
|
-
"description": "Server
|
|
5
|
-
"main": "
|
|
6
|
-
"
|
|
3
|
+
"version": "1.1.0",
|
|
4
|
+
"description": "Server-side Node.js library for processing ObserveRTC Samples",
|
|
5
|
+
"main": "./dist/index.js",
|
|
6
|
+
"module": "./dist/index.mjs",
|
|
7
|
+
"types": "./dist/index.d.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"import": {
|
|
11
|
+
"types": "./dist/index.d.mts",
|
|
12
|
+
"default": "./dist/index.mjs"
|
|
13
|
+
},
|
|
14
|
+
"require": {
|
|
15
|
+
"types": "./dist/index.d.ts",
|
|
16
|
+
"default": "./dist/index.js"
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
"files": [
|
|
21
|
+
"dist"
|
|
22
|
+
],
|
|
7
23
|
"engines": {
|
|
8
|
-
"node": ">=
|
|
24
|
+
"node": ">=22"
|
|
9
25
|
},
|
|
10
26
|
"scripts": {
|
|
11
27
|
"prepare": "npm run build",
|
|
12
|
-
"
|
|
13
|
-
"prepublishOnly": "npm run lint",
|
|
28
|
+
"prepublishOnly": "npm run lint && npm run typecheck",
|
|
14
29
|
"format": "prettier --write \"src/**/*.ts\"",
|
|
15
|
-
"lint": "
|
|
16
|
-
"build": "
|
|
17
|
-
"
|
|
30
|
+
"lint": "eslint -c .eslintrc.json \"src/**/*.ts\"",
|
|
31
|
+
"build": "tsup",
|
|
32
|
+
"typecheck": "tsc --noEmit",
|
|
33
|
+
"test": "jest --config jest.config.js",
|
|
34
|
+
"test:coverage": "jest --config jest.config.js --coverage",
|
|
35
|
+
"example": "ts-node --compiler-options '{\"module\":\"commonjs\"}' examples/sfu-observer.ts",
|
|
36
|
+
"example:detectors": "ts-node --compiler-options '{\"module\":\"commonjs\"}' examples/detectors.ts",
|
|
37
|
+
"bench": "ts-node --compiler-options '{\"module\":\"commonjs\"}' bench/detectors.bench.ts"
|
|
18
38
|
},
|
|
19
39
|
"keywords": [
|
|
20
40
|
"webrtc",
|
|
@@ -27,27 +47,33 @@
|
|
|
27
47
|
"dependencies": {
|
|
28
48
|
"@bufbuild/protobuf": "1.1.1",
|
|
29
49
|
"events": "^3.3.0",
|
|
30
|
-
"uuid": "^
|
|
50
|
+
"uuid": "^11.1.1"
|
|
31
51
|
},
|
|
32
52
|
"devDependencies": {
|
|
33
53
|
"@tsconfig/node20": "^1.0.2",
|
|
34
54
|
"@types/jest": "^27.5.2",
|
|
35
55
|
"@types/node": "^20.9.0",
|
|
36
|
-
"@types/uuid": "^8.3.4",
|
|
37
56
|
"@typescript-eslint/eslint-plugin": "^5.38.0",
|
|
38
57
|
"@typescript-eslint/parser": "^5.38.0",
|
|
39
|
-
"bufferutil": "^4.0.6",
|
|
40
58
|
"eslint": "^8.24.0",
|
|
41
59
|
"jest": "^27.5.0",
|
|
42
|
-
"
|
|
60
|
+
"mediasoup": "^3.20.3",
|
|
43
61
|
"prettier": "2.8.7",
|
|
44
62
|
"ts-jest": "^27.1.5",
|
|
45
|
-
"
|
|
46
|
-
"
|
|
47
|
-
"
|
|
63
|
+
"ts-node": "^10.9.2",
|
|
64
|
+
"tsup": "^8.5.1",
|
|
65
|
+
"typescript": "^4.8.3"
|
|
48
66
|
},
|
|
49
67
|
"repository": {
|
|
50
68
|
"type": "git",
|
|
51
|
-
"url": "https://github.com/
|
|
69
|
+
"url": "git+https://github.com/ObserveRTC/observer-js.git"
|
|
70
|
+
},
|
|
71
|
+
"peerDependencies": {
|
|
72
|
+
"mediasoup": ">=3.11.0"
|
|
73
|
+
},
|
|
74
|
+
"peerDependenciesMeta": {
|
|
75
|
+
"mediasoup": {
|
|
76
|
+
"optional": true
|
|
77
|
+
}
|
|
52
78
|
}
|
|
53
79
|
}
|
package/.eslintrc.json
DELETED
|
@@ -1,143 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"parser": "@typescript-eslint/parser",
|
|
3
|
-
"parserOptions": {
|
|
4
|
-
"ecmaVersion": "latest",
|
|
5
|
-
"sourceType": "module",
|
|
6
|
-
"project": "./tsconfig.json"
|
|
7
|
-
},
|
|
8
|
-
"extends": ["plugin:@typescript-eslint/recommended"],
|
|
9
|
-
"env": { "node": true },
|
|
10
|
-
"rules": {
|
|
11
|
-
"array-bracket-spacing": [ 2, "always", {
|
|
12
|
-
"objectsInArrays": true,
|
|
13
|
-
"arraysInArrays": true
|
|
14
|
-
}],
|
|
15
|
-
"arrow-parens": [ 2, "always" ],
|
|
16
|
-
"arrow-spacing": 2,
|
|
17
|
-
"block-spacing": [ 2, "always" ],
|
|
18
|
-
"brace-style": [ 2, "1tbs", { "allowSingleLine": true } ],
|
|
19
|
-
"camelcase": 2,
|
|
20
|
-
"comma-spacing": [ 2, { "before": false, "after": true } ],
|
|
21
|
-
"comma-style": 2,
|
|
22
|
-
"computed-property-spacing": 2,
|
|
23
|
-
"constructor-super": 2,
|
|
24
|
-
"func-call-spacing": 2,
|
|
25
|
-
"generator-star-spacing": 2,
|
|
26
|
-
"guard-for-in": 2,
|
|
27
|
-
"indent": [ 2, "tab", { "SwitchCase": 1 } ],
|
|
28
|
-
"@typescript-eslint/indent": [ 2, "tab", { "SwitchCase": 1 } ],
|
|
29
|
-
"require-await": "off",
|
|
30
|
-
"@typescript-eslint/require-await": "error",
|
|
31
|
-
"key-spacing": [ 2, {
|
|
32
|
-
"singleLine": {
|
|
33
|
-
"beforeColon": false,
|
|
34
|
-
"afterColon": true
|
|
35
|
-
},
|
|
36
|
-
"multiLine": {
|
|
37
|
-
"beforeColon": false,
|
|
38
|
-
"afterColon": true
|
|
39
|
-
}
|
|
40
|
-
}],
|
|
41
|
-
"keyword-spacing": 2,
|
|
42
|
-
"linebreak-style": [ 2, "unix" ],
|
|
43
|
-
"lines-around-comment": [ 2, {
|
|
44
|
-
"allowBlockStart": true,
|
|
45
|
-
"allowObjectStart": true,
|
|
46
|
-
"beforeBlockComment": true,
|
|
47
|
-
"beforeLineComment": false
|
|
48
|
-
}],
|
|
49
|
-
"max-len": 0,
|
|
50
|
-
"newline-after-var": 2,
|
|
51
|
-
"newline-before-return": 2,
|
|
52
|
-
"newline-per-chained-call": 2,
|
|
53
|
-
"no-alert": 2,
|
|
54
|
-
"no-caller": 2,
|
|
55
|
-
"no-case-declarations": 2,
|
|
56
|
-
"no-catch-shadow": 2,
|
|
57
|
-
"no-class-assign": 2,
|
|
58
|
-
"no-confusing-arrow": 2,
|
|
59
|
-
"no-console": 2,
|
|
60
|
-
"no-const-assign": 2,
|
|
61
|
-
"no-debugger": 2,
|
|
62
|
-
"no-dupe-args": 2,
|
|
63
|
-
"no-dupe-keys": 2,
|
|
64
|
-
"no-duplicate-case": 2,
|
|
65
|
-
"no-div-regex": 2,
|
|
66
|
-
"no-empty": [ 2, { "allowEmptyCatch": true } ],
|
|
67
|
-
"no-empty-pattern": 2,
|
|
68
|
-
"no-else-return": 0,
|
|
69
|
-
"no-eval": 2,
|
|
70
|
-
"no-extend-native": 2,
|
|
71
|
-
"no-ex-assign": 2,
|
|
72
|
-
"no-extra-bind": 2,
|
|
73
|
-
"no-extra-boolean-cast": 2,
|
|
74
|
-
"no-extra-label": 2,
|
|
75
|
-
"no-extra-semi": 2,
|
|
76
|
-
"no-fallthrough": 2,
|
|
77
|
-
"no-func-assign": 2,
|
|
78
|
-
"no-global-assign": 2,
|
|
79
|
-
"no-implicit-coercion": 2,
|
|
80
|
-
"no-implicit-globals": 2,
|
|
81
|
-
"no-inner-declarations": 2,
|
|
82
|
-
"no-invalid-regexp": 2,
|
|
83
|
-
"no-invalid-this": 2,
|
|
84
|
-
"no-irregular-whitespace": 2,
|
|
85
|
-
"no-lonely-if": 2,
|
|
86
|
-
"no-mixed-operators": 2,
|
|
87
|
-
"no-mixed-spaces-and-tabs": 2,
|
|
88
|
-
"no-multi-spaces": 2,
|
|
89
|
-
"no-multi-str": 2,
|
|
90
|
-
"no-multiple-empty-lines": [ 1, { "max": 1, "maxEOF": 0, "maxBOF": 0 } ],
|
|
91
|
-
"no-native-reassign": 2,
|
|
92
|
-
"no-negated-in-lhs": 2,
|
|
93
|
-
"no-new": 2,
|
|
94
|
-
"no-new-func": 2,
|
|
95
|
-
"no-new-wrappers": 2,
|
|
96
|
-
"no-obj-calls": 2,
|
|
97
|
-
"no-proto": 2,
|
|
98
|
-
"no-regex-spaces": 2,
|
|
99
|
-
"no-restricted-imports": 2,
|
|
100
|
-
"no-return-assign": 2,
|
|
101
|
-
"no-self-assign": 2,
|
|
102
|
-
"no-self-compare": 2,
|
|
103
|
-
"no-sequences": 2,
|
|
104
|
-
"no-shadow": 2,
|
|
105
|
-
"no-shadow-restricted-names": 2,
|
|
106
|
-
"no-spaced-func": 2,
|
|
107
|
-
"no-sparse-arrays": 2,
|
|
108
|
-
"no-this-before-super": 2,
|
|
109
|
-
"no-throw-literal": 2,
|
|
110
|
-
"no-unexpected-multiline": 2,
|
|
111
|
-
"no-unmodified-loop-condition": 2,
|
|
112
|
-
"no-unreachable": 2,
|
|
113
|
-
"no-unused-vars": "off",
|
|
114
|
-
"@typescript-eslint/no-unused-vars": "error",
|
|
115
|
-
"no-useless-call": 2,
|
|
116
|
-
"no-useless-computed-key": 2,
|
|
117
|
-
"no-useless-concat": 2,
|
|
118
|
-
"no-useless-rename": 2,
|
|
119
|
-
"no-var": 2,
|
|
120
|
-
"no-whitespace-before-property": 2,
|
|
121
|
-
"object-curly-newline": 0,
|
|
122
|
-
"object-curly-spacing": [ 2, "always" ],
|
|
123
|
-
"object-property-newline": [ 2, { "allowMultiplePropertiesPerLine": true } ],
|
|
124
|
-
"prefer-const": 2,
|
|
125
|
-
"prefer-rest-params": 2,
|
|
126
|
-
"prefer-spread": 2,
|
|
127
|
-
"prefer-template": 2,
|
|
128
|
-
"quotes": [ 2, "single", { "avoidEscape": true } ],
|
|
129
|
-
"semi": [ 2, "always" ],
|
|
130
|
-
"semi-spacing": 2,
|
|
131
|
-
"space-before-blocks": 2,
|
|
132
|
-
"space-before-function-paren": [ 2,
|
|
133
|
-
{
|
|
134
|
-
"anonymous": "never",
|
|
135
|
-
"named": "never",
|
|
136
|
-
"asyncArrow": "always"
|
|
137
|
-
}],
|
|
138
|
-
"space-in-parens": [ 2, "never" ],
|
|
139
|
-
"spaced-comment": [ 2, "always" ],
|
|
140
|
-
"strict": 2,
|
|
141
|
-
"valid-typeof": 2
|
|
142
|
-
}
|
|
143
|
-
}
|
package/.prettierignore
DELETED
package/.prettierrc
DELETED
package/jest.config.js
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
module.exports = {
|
|
2
|
-
roots: ['<rootDir>'],
|
|
3
|
-
transform: {
|
|
4
|
-
'^.+\\.tsx?$': 'ts-jest',
|
|
5
|
-
},
|
|
6
|
-
testPathIgnorePatterns: ["/node_modules/", "/tests/helpers/"],
|
|
7
|
-
testRegex: '(/tests/.*|(\\.|/)(test|spec))\\.(jsx?|tsx?)$',
|
|
8
|
-
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node'],
|
|
9
|
-
}
|
package/lib/ObservedCall.d.ts
DELETED
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
|
-
import { EventEmitter } from 'events';
|
|
3
|
-
import { ObservedClient, ObservedClientSettings } from './ObservedClient';
|
|
4
|
-
import { Observer } from './Observer';
|
|
5
|
-
import { ScoreCalculator } from './scores/ScoreCalculator';
|
|
6
|
-
import { CalculatedScore } from './scores/CalculatedScore';
|
|
7
|
-
import { Detectors } from './detectors/Detectors';
|
|
8
|
-
import { RemoteTrackResolver } from './utils/RemoteTrackResolver';
|
|
9
|
-
import { Updater } from './updaters/Updater';
|
|
10
|
-
export type ObservedCallSettings<AppData extends Record<string, unknown> = Record<string, unknown>> = {
|
|
11
|
-
callId: string;
|
|
12
|
-
appData?: AppData;
|
|
13
|
-
remoteTrackResolvePolicy?: 'p2p' | 'mediasoup-sfu';
|
|
14
|
-
updatePolicy?: 'update-on-any-client-updated' | 'update-when-all-client-updated' | 'update-on-interval';
|
|
15
|
-
updateIntervalInMs?: number;
|
|
16
|
-
};
|
|
17
|
-
export type ObservedCallEvents = {
|
|
18
|
-
update: [];
|
|
19
|
-
newclient: [ObservedClient];
|
|
20
|
-
empty: [];
|
|
21
|
-
'not-empty': [];
|
|
22
|
-
close: [];
|
|
23
|
-
};
|
|
24
|
-
export declare interface ObservedCall {
|
|
25
|
-
on<U extends keyof ObservedCallEvents>(event: U, listener: (...args: ObservedCallEvents[U]) => void): this;
|
|
26
|
-
off<U extends keyof ObservedCallEvents>(event: U, listener: (...args: ObservedCallEvents[U]) => void): this;
|
|
27
|
-
once<U extends keyof ObservedCallEvents>(event: U, listener: (...args: ObservedCallEvents[U]) => void): this;
|
|
28
|
-
emit<U extends keyof ObservedCallEvents>(event: U, ...args: ObservedCallEvents[U]): boolean;
|
|
29
|
-
}
|
|
30
|
-
export declare class ObservedCall<AppData extends Record<string, unknown> = Record<string, unknown>> extends EventEmitter {
|
|
31
|
-
readonly observer: Observer;
|
|
32
|
-
readonly detectors: Detectors;
|
|
33
|
-
updater?: Updater;
|
|
34
|
-
scoreCalculator: ScoreCalculator;
|
|
35
|
-
readonly callId: string;
|
|
36
|
-
readonly observedClients: Map<string, ObservedClient<Record<string, unknown>>>;
|
|
37
|
-
readonly clientsUsedTurn: Set<string>;
|
|
38
|
-
readonly calculatedScore: CalculatedScore;
|
|
39
|
-
remoteTrackResolver?: RemoteTrackResolver;
|
|
40
|
-
totalAddedClients: number;
|
|
41
|
-
totalRemovedClients: number;
|
|
42
|
-
totalClientsReceivedAudioBytes: number;
|
|
43
|
-
totalClientsReceivedVideoBytes: number;
|
|
44
|
-
totalClientsReceivedDataChannelBytes: number;
|
|
45
|
-
totalClientsReceivedBytes: number;
|
|
46
|
-
totalClientsSentAudioBytes: number;
|
|
47
|
-
totalClientsSentDataChannelBytes: number;
|
|
48
|
-
totalClientsSentVideoBytes: number;
|
|
49
|
-
totalClientsSentBytes: number;
|
|
50
|
-
totalRttLt50Measurements: number;
|
|
51
|
-
totalRttLt150Measurements: number;
|
|
52
|
-
totalRttLt300Measurements: number;
|
|
53
|
-
totalRttGtOrEq300Measurements: number;
|
|
54
|
-
numberOfIssues: number;
|
|
55
|
-
numberOfPeerConnections: number;
|
|
56
|
-
numberOfInboundRtpStreams: number;
|
|
57
|
-
numberOfOutboundRtpStreams: number;
|
|
58
|
-
numberOfDataChannels: number;
|
|
59
|
-
maxNumberOfClients: number;
|
|
60
|
-
deltaNumberOfIssues: number;
|
|
61
|
-
deltaRttLt50Measurements: number;
|
|
62
|
-
deltaRttLt150Measurements: number;
|
|
63
|
-
deltaRttLt300Measurements: number;
|
|
64
|
-
deltaRttGtOrEq300Measurements: number;
|
|
65
|
-
appData: AppData;
|
|
66
|
-
closed: boolean;
|
|
67
|
-
startedAt?: number;
|
|
68
|
-
endedAt?: number;
|
|
69
|
-
closedAt?: number;
|
|
70
|
-
private _callStartedEvent;
|
|
71
|
-
private _callEndedEvent;
|
|
72
|
-
constructor(settings: ObservedCallSettings<AppData>, observer: Observer);
|
|
73
|
-
get numberOfClients(): number;
|
|
74
|
-
get score(): number | undefined;
|
|
75
|
-
close(): void;
|
|
76
|
-
getObservedClient<ClientAppData extends Record<string, unknown> = Record<string, unknown>>(clientId: string): ObservedClient<ClientAppData> | undefined;
|
|
77
|
-
createObservedClient<ClientAppData extends Record<string, unknown> = Record<string, unknown>>(settings: ObservedClientSettings<ClientAppData>): ObservedClient<ClientAppData>;
|
|
78
|
-
update(): void;
|
|
79
|
-
private _onClientUpdate;
|
|
80
|
-
private _clientJoined;
|
|
81
|
-
private _clientLeft;
|
|
82
|
-
}
|
|
83
|
-
//# sourceMappingURL=ObservedCall.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ObservedCall.d.ts","sourceRoot":"","sources":["../src/ObservedCall.ts"],"names":[],"mappings":"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"}
|
package/lib/ObservedCall.js
DELETED
|
@@ -1,203 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ObservedCall = void 0;
|
|
4
|
-
const events_1 = require("events");
|
|
5
|
-
const ObservedClient_1 = require("./ObservedClient");
|
|
6
|
-
const DefaultCallScoreCalculator_1 = require("./scores/DefaultCallScoreCalculator");
|
|
7
|
-
const Detectors_1 = require("./detectors/Detectors");
|
|
8
|
-
const OnAllClientCallUpdater_1 = require("./updaters/OnAllClientCallUpdater");
|
|
9
|
-
const OnIntervalUpdater_1 = require("./updaters/OnIntervalUpdater");
|
|
10
|
-
const OnAnyClientCallUpdater_1 = require("./updaters/OnAnyClientCallUpdater");
|
|
11
|
-
class ObservedCall extends events_1.EventEmitter {
|
|
12
|
-
observer;
|
|
13
|
-
detectors;
|
|
14
|
-
updater;
|
|
15
|
-
scoreCalculator;
|
|
16
|
-
callId;
|
|
17
|
-
observedClients = new Map();
|
|
18
|
-
clientsUsedTurn = new Set();
|
|
19
|
-
calculatedScore = {
|
|
20
|
-
weight: 1,
|
|
21
|
-
value: undefined,
|
|
22
|
-
};
|
|
23
|
-
remoteTrackResolver;
|
|
24
|
-
totalAddedClients = 0;
|
|
25
|
-
totalRemovedClients = 0;
|
|
26
|
-
totalClientsReceivedAudioBytes = 0;
|
|
27
|
-
totalClientsReceivedVideoBytes = 0;
|
|
28
|
-
totalClientsReceivedDataChannelBytes = 0;
|
|
29
|
-
totalClientsReceivedBytes = 0;
|
|
30
|
-
totalClientsSentAudioBytes = 0;
|
|
31
|
-
totalClientsSentDataChannelBytes = 0;
|
|
32
|
-
totalClientsSentVideoBytes = 0;
|
|
33
|
-
totalClientsSentBytes = 0;
|
|
34
|
-
totalRttLt50Measurements = 0;
|
|
35
|
-
totalRttLt150Measurements = 0;
|
|
36
|
-
totalRttLt300Measurements = 0;
|
|
37
|
-
totalRttGtOrEq300Measurements = 0;
|
|
38
|
-
numberOfIssues = 0;
|
|
39
|
-
numberOfPeerConnections = 0;
|
|
40
|
-
numberOfInboundRtpStreams = 0;
|
|
41
|
-
numberOfOutboundRtpStreams = 0;
|
|
42
|
-
numberOfDataChannels = 0;
|
|
43
|
-
maxNumberOfClients = 0;
|
|
44
|
-
deltaNumberOfIssues = 0;
|
|
45
|
-
deltaRttLt50Measurements = 0;
|
|
46
|
-
deltaRttLt150Measurements = 0;
|
|
47
|
-
deltaRttLt300Measurements = 0;
|
|
48
|
-
deltaRttGtOrEq300Measurements = 0;
|
|
49
|
-
appData;
|
|
50
|
-
closed = false;
|
|
51
|
-
startedAt;
|
|
52
|
-
endedAt;
|
|
53
|
-
closedAt;
|
|
54
|
-
_callStartedEvent;
|
|
55
|
-
_callEndedEvent;
|
|
56
|
-
constructor(settings, observer) {
|
|
57
|
-
super();
|
|
58
|
-
this.observer = observer;
|
|
59
|
-
this.setMaxListeners(Infinity);
|
|
60
|
-
this.callId = settings.callId;
|
|
61
|
-
this.appData = settings.appData ?? {};
|
|
62
|
-
this.scoreCalculator = new DefaultCallScoreCalculator_1.DefaultCallScoreCalculator(this);
|
|
63
|
-
this.detectors = new Detectors_1.Detectors();
|
|
64
|
-
if (settings.updateIntervalInMs) {
|
|
65
|
-
if (settings.updatePolicy !== 'update-on-interval') {
|
|
66
|
-
throw new Error('updatePolicy must be update-on-interval if updateIntervalInMs is set in config');
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
switch (settings.updatePolicy) {
|
|
70
|
-
case 'update-on-any-client-updated':
|
|
71
|
-
this.updater = new OnAllClientCallUpdater_1.OnAllClientCallUpdater(this);
|
|
72
|
-
break;
|
|
73
|
-
case 'update-when-all-client-updated':
|
|
74
|
-
this.updater = new OnAnyClientCallUpdater_1.OnAnyClientCallUpdater(this);
|
|
75
|
-
break;
|
|
76
|
-
case 'update-on-interval':
|
|
77
|
-
if (!settings.updateIntervalInMs) {
|
|
78
|
-
throw new Error('updateIntervalInMs setting in config must be set if updatePolicy is update-on-interval');
|
|
79
|
-
}
|
|
80
|
-
this.updater = new OnIntervalUpdater_1.OnIntervalUpdater(settings.updateIntervalInMs, this.update.bind(this));
|
|
81
|
-
break;
|
|
82
|
-
}
|
|
83
|
-
switch (settings.remoteTrackResolvePolicy) {
|
|
84
|
-
case 'mediasoup-sfu':
|
|
85
|
-
break;
|
|
86
|
-
}
|
|
87
|
-
this._callStartedEvent = {
|
|
88
|
-
emitted: false,
|
|
89
|
-
};
|
|
90
|
-
this._callEndedEvent = {
|
|
91
|
-
emitted: false,
|
|
92
|
-
};
|
|
93
|
-
}
|
|
94
|
-
get numberOfClients() {
|
|
95
|
-
return this.observedClients.size;
|
|
96
|
-
}
|
|
97
|
-
get score() {
|
|
98
|
-
return this.calculatedScore.value;
|
|
99
|
-
}
|
|
100
|
-
close() {
|
|
101
|
-
if (this.closed)
|
|
102
|
-
return;
|
|
103
|
-
this.update(); // last update before closing
|
|
104
|
-
this.closed = true;
|
|
105
|
-
this.updater?.close();
|
|
106
|
-
[...this.observedClients.values()].forEach((client) => client.close());
|
|
107
|
-
this.closedAt = Date.now();
|
|
108
|
-
this.emit('close');
|
|
109
|
-
}
|
|
110
|
-
getObservedClient(clientId) {
|
|
111
|
-
if (this.closed || !this.observedClients.has(clientId))
|
|
112
|
-
return;
|
|
113
|
-
return this.observedClients.get(clientId);
|
|
114
|
-
}
|
|
115
|
-
createObservedClient(settings) {
|
|
116
|
-
if (this.closed)
|
|
117
|
-
throw new Error(`Call ${this.callId} is closed`);
|
|
118
|
-
if (this.observedClients.has(settings.clientId))
|
|
119
|
-
throw new Error(`Client with id ${settings.clientId} already exists`);
|
|
120
|
-
const result = new ObservedClient_1.ObservedClient(settings, this);
|
|
121
|
-
const wasEmpty = this.observedClients.size === 0;
|
|
122
|
-
const onUpdate = () => this._onClientUpdate(result);
|
|
123
|
-
const joined = () => this._clientJoined(result);
|
|
124
|
-
const left = () => this._clientLeft(result);
|
|
125
|
-
result.once('close', () => {
|
|
126
|
-
result.off('update', onUpdate);
|
|
127
|
-
result.off('joined', joined);
|
|
128
|
-
result.off('left', left);
|
|
129
|
-
this.observedClients.delete(settings.clientId);
|
|
130
|
-
if (this.observedClients.size === 0) {
|
|
131
|
-
this.emit('empty');
|
|
132
|
-
}
|
|
133
|
-
++this.totalRemovedClients;
|
|
134
|
-
});
|
|
135
|
-
result.on('update', onUpdate);
|
|
136
|
-
result.on('joined', joined);
|
|
137
|
-
result.on('left', left);
|
|
138
|
-
++this.totalAddedClients;
|
|
139
|
-
this.observedClients.set(settings.clientId, result);
|
|
140
|
-
this.maxNumberOfClients = Math.max(this.maxNumberOfClients, this.observedClients.size);
|
|
141
|
-
this.emit('newclient', result);
|
|
142
|
-
if (wasEmpty) {
|
|
143
|
-
this.emit('not-empty');
|
|
144
|
-
}
|
|
145
|
-
return result;
|
|
146
|
-
}
|
|
147
|
-
update() {
|
|
148
|
-
if (this.closed)
|
|
149
|
-
return;
|
|
150
|
-
this.numberOfInboundRtpStreams = 0;
|
|
151
|
-
this.numberOfOutboundRtpStreams = 0;
|
|
152
|
-
this.numberOfPeerConnections = 0;
|
|
153
|
-
this.numberOfDataChannels = 0;
|
|
154
|
-
for (const client of this.observedClients.values()) {
|
|
155
|
-
this.numberOfInboundRtpStreams += client.numberOfInboundRtpStreams;
|
|
156
|
-
this.numberOfOutboundRtpStreams += client.numberOfOutboundRtpStreams;
|
|
157
|
-
this.numberOfPeerConnections += client.numberOfPeerConnections;
|
|
158
|
-
this.numberOfDataChannels += client.numberOfDataChannels;
|
|
159
|
-
}
|
|
160
|
-
this.detectors.update();
|
|
161
|
-
this.scoreCalculator.update();
|
|
162
|
-
this.emit('update');
|
|
163
|
-
this.deltaNumberOfIssues = 0;
|
|
164
|
-
this.deltaRttLt50Measurements = 0;
|
|
165
|
-
this.deltaRttLt150Measurements = 0;
|
|
166
|
-
this.deltaRttLt300Measurements = 0;
|
|
167
|
-
this.deltaRttGtOrEq300Measurements = 0;
|
|
168
|
-
}
|
|
169
|
-
_onClientUpdate(client) {
|
|
170
|
-
this.totalClientsReceivedAudioBytes += client.deltaReceivedAudioBytes;
|
|
171
|
-
this.totalClientsReceivedVideoBytes += client.deltaReceivedVideoBytes;
|
|
172
|
-
this.totalClientsReceivedDataChannelBytes += client.deltaDataChannelBytesReceived;
|
|
173
|
-
this.totalClientsReceivedBytes += client.deltaTransportReceivedBytes;
|
|
174
|
-
this.totalClientsSentAudioBytes += client.deltaSentAudioBytes;
|
|
175
|
-
this.totalClientsSentVideoBytes += client.deltaSentVideoBytes;
|
|
176
|
-
this.totalClientsSentDataChannelBytes += client.deltaDataChannelBytesSent;
|
|
177
|
-
this.totalClientsSentBytes += client.deltaTransportSentBytes;
|
|
178
|
-
this.deltaRttLt50Measurements += client.deltaRttLt50Measurements;
|
|
179
|
-
this.deltaRttLt150Measurements += client.deltaRttLt150Measurements;
|
|
180
|
-
this.deltaRttLt300Measurements += client.deltaRttLt300Measurements;
|
|
181
|
-
this.deltaRttGtOrEq300Measurements += client.deltaRttGtOrEq300Measurements;
|
|
182
|
-
this.totalRttLt50Measurements += client.deltaRttLt50Measurements;
|
|
183
|
-
this.totalRttLt150Measurements += client.deltaRttLt150Measurements;
|
|
184
|
-
this.totalRttLt300Measurements += client.deltaRttLt300Measurements;
|
|
185
|
-
this.totalRttGtOrEq300Measurements += client.deltaRttGtOrEq300Measurements;
|
|
186
|
-
this.deltaNumberOfIssues += client.deltaNumberOfIssues;
|
|
187
|
-
this.numberOfIssues += client.deltaNumberOfIssues;
|
|
188
|
-
if (client.usingTURN) {
|
|
189
|
-
this.clientsUsedTurn.add(client.clientId);
|
|
190
|
-
}
|
|
191
|
-
}
|
|
192
|
-
_clientJoined(client) {
|
|
193
|
-
if (!client.joinedAt)
|
|
194
|
-
return;
|
|
195
|
-
this.startedAt = Math.min(this.startedAt ?? client.joinedAt, client.joinedAt);
|
|
196
|
-
}
|
|
197
|
-
_clientLeft(client) {
|
|
198
|
-
if (!client.leftAt)
|
|
199
|
-
return;
|
|
200
|
-
this.endedAt = Math.max(this.endedAt ?? client.leftAt, client.leftAt);
|
|
201
|
-
}
|
|
202
|
-
}
|
|
203
|
-
exports.ObservedCall = ObservedCall;
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
export type ObservedCallSummary = {
|
|
2
|
-
currentActiveClients: number;
|
|
3
|
-
totalAddedClients: number;
|
|
4
|
-
totalRemovedClients: number;
|
|
5
|
-
totalClientsSentBytes: number;
|
|
6
|
-
totalClientsReceivedBytes: number;
|
|
7
|
-
totalClientsReceivedAudioBytes: number;
|
|
8
|
-
totalClientsReceivedVideoBytes: number;
|
|
9
|
-
totalClientsSentAudioBytes: number;
|
|
10
|
-
totalClientsSentVideoBytes: number;
|
|
11
|
-
totalRttLt50Measurements: number;
|
|
12
|
-
totalRttLt150Measurements: number;
|
|
13
|
-
totalRttLt300Measurements: number;
|
|
14
|
-
totalRttGtOrEq300Measurements: number;
|
|
15
|
-
numberOfIssues: number;
|
|
16
|
-
numberOfClientsUsedTurn: number;
|
|
17
|
-
};
|
|
18
|
-
//# sourceMappingURL=ObservedCallSummary.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ObservedCallSummary.d.ts","sourceRoot":"","sources":["../src/ObservedCallSummary.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,mBAAmB,GAAG;IACjC,oBAAoB,EAAE,MAAM,CAAC;IAE7B,iBAAiB,EAAE,MAAM,CAAC;IAC1B,mBAAmB,EAAE,MAAM,CAAC;IAE5B,qBAAqB,EAAE,MAAM,CAAC;IAC9B,yBAAyB,EAAE,MAAM,CAAC;IAClC,8BAA8B,EAAE,MAAM,CAAC;IACvC,8BAA8B,EAAE,MAAM,CAAC;IACvC,0BAA0B,EAAE,MAAM,CAAC;IACnC,0BAA0B,EAAE,MAAM,CAAC;IAEnC,wBAAwB,EAAE,MAAM,CAAC;IACjC,yBAAyB,EAAE,MAAM,CAAC;IAClC,yBAAyB,EAAE,MAAM,CAAC;IAClC,6BAA6B,EAAE,MAAM,CAAC;IAEtC,cAAc,EAAE,MAAM,CAAC;IAEvB,uBAAuB,EAAE,MAAM,CAAC;CAChC,CAAA"}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { ObservedPeerConnection } from './ObservedPeerConnection';
|
|
2
|
-
import { CertificateStats } from './schema/ClientSample';
|
|
3
|
-
export declare class ObservedCertificate implements CertificateStats {
|
|
4
|
-
timestamp: number;
|
|
5
|
-
id: string;
|
|
6
|
-
private readonly _peerConnection;
|
|
7
|
-
appData?: Record<string, unknown>;
|
|
8
|
-
private _visited;
|
|
9
|
-
fingerprint?: string;
|
|
10
|
-
fingerprintAlgorithm?: string;
|
|
11
|
-
base64Certificate?: string;
|
|
12
|
-
issuerCertificateId?: string;
|
|
13
|
-
attachments?: Record<string, unknown>;
|
|
14
|
-
constructor(timestamp: number, id: string, _peerConnection: ObservedPeerConnection);
|
|
15
|
-
get visited(): boolean;
|
|
16
|
-
getPeerConnection(): ObservedPeerConnection;
|
|
17
|
-
update(stats: CertificateStats): void;
|
|
18
|
-
}
|
|
19
|
-
//# sourceMappingURL=ObservedCertificate.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ObservedCertificate.d.ts","sourceRoot":"","sources":["../src/ObservedCertificate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAEzD,qBAAa,mBAAoB,YAAW,gBAAgB;IAYnD,SAAS,EAAE,MAAM;IACjB,EAAE,EAAE,MAAM;IACjB,OAAO,CAAC,QAAQ,CAAC,eAAe;IAb1B,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAEzC,OAAO,CAAC,QAAQ,CAAS;IAEzB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;gBAG9B,SAAS,EAAE,MAAM,EACjB,EAAE,EAAE,MAAM,EACA,eAAe,EAAE,sBAAsB;IAGzD,IAAW,OAAO,YAMjB;IAEM,iBAAiB;IAIjB,MAAM,CAAC,KAAK,EAAE,gBAAgB;CAUrC"}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ObservedCertificate = void 0;
|
|
4
|
-
class ObservedCertificate {
|
|
5
|
-
timestamp;
|
|
6
|
-
id;
|
|
7
|
-
_peerConnection;
|
|
8
|
-
appData;
|
|
9
|
-
_visited = false;
|
|
10
|
-
fingerprint;
|
|
11
|
-
fingerprintAlgorithm;
|
|
12
|
-
base64Certificate;
|
|
13
|
-
issuerCertificateId;
|
|
14
|
-
attachments;
|
|
15
|
-
constructor(timestamp, id, _peerConnection) {
|
|
16
|
-
this.timestamp = timestamp;
|
|
17
|
-
this.id = id;
|
|
18
|
-
this._peerConnection = _peerConnection;
|
|
19
|
-
}
|
|
20
|
-
get visited() {
|
|
21
|
-
const visited = this._visited;
|
|
22
|
-
this._visited = false;
|
|
23
|
-
return visited;
|
|
24
|
-
}
|
|
25
|
-
getPeerConnection() {
|
|
26
|
-
return this._peerConnection;
|
|
27
|
-
}
|
|
28
|
-
update(stats) {
|
|
29
|
-
this._visited = true;
|
|
30
|
-
this.timestamp = stats.timestamp;
|
|
31
|
-
this.fingerprint = stats.fingerprint;
|
|
32
|
-
this.fingerprintAlgorithm = stats.fingerprintAlgorithm;
|
|
33
|
-
this.base64Certificate = stats.base64Certificate;
|
|
34
|
-
this.issuerCertificateId = stats.issuerCertificateId;
|
|
35
|
-
this.attachments = stats.attachments;
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
exports.ObservedCertificate = ObservedCertificate;
|