Переглянути джерело

feat(lint) update linter and apply it to TS code

dev0
Saúl Ibarra Corretgé 7 місяці тому
джерело
коміт
f0e3cb289c
Аккаунт користувача з таким Email не знайдено
58 змінених файлів з 6912 додано та 4256 видалено
  1. 4
    0
      .eslintignore
  2. 13
    0
      .eslintrc.js
  3. 23
    22
      JitsiConferenceErrors.ts
  4. 43
    41
      JitsiConferenceEvents.ts
  5. 3
    2
      JitsiConnectionErrors.ts
  6. 8
    7
      JitsiConnectionEvents.ts
  7. 2
    1
      JitsiMediaDevicesEvents.ts
  8. 27
    19
      JitsiMeetJS.ts
  9. 6
    5
      JitsiTrackErrors.ts
  10. 23
    21
      JitsiTrackEvents.ts
  11. 5
    4
      JitsiTranscriptionStatus.ts
  12. 2
    1
      index.js
  13. 4
    4
      modules/RTC/JitsiLocalTrack.js
  14. 6
    0
      modules/RTCStats/DefaulLogStorage.ts
  15. 24
    20
      modules/RTCStats/RTCStats.ts
  16. 7
    6
      modules/RTCStats/RTCStatsEvents.ts
  17. 3
    3
      modules/connectivity/IceFailedHandling.ts
  18. 14
    16
      modules/connectivity/TrackStreamingStatus.ts
  19. 11
    10
      modules/detection/DetectionEvents.ts
  20. 4
    4
      modules/e2ee/E2EEErrors.ts
  21. 1
    1
      modules/e2ee/ManagedKeyHandler.js
  22. 1
    2
      modules/e2ee/Worker.js
  23. 2
    2
      modules/e2ee/crypto-utils.js
  24. 1
    1
      modules/flags/FeatureFlags.ts
  25. 0
    1
      modules/litemode/LiteModeContext.js
  26. 1
    1
      modules/proxyconnection/ProxyConnectionService.js
  27. 1
    1
      modules/proxyconnection/constants.ts
  28. 7
    1
      modules/qualitycontrol/MockClasses.ts
  29. 59
    36
      modules/qualitycontrol/QualityController.ts
  30. 24
    25
      modules/sdp/SdpSimulcast.ts
  31. 25
    15
      modules/statistics/PreCallTest.ts
  32. 1
    1
      modules/version/ComponentsVersions.ts
  33. 19
    16
      modules/videosipgw/VideoSIPGWConstants.ts
  34. 3
    1
      modules/watchRTC/WatchRTC.ts
  35. 3
    0
      modules/watchRTC/functions.ts
  36. 8
    7
      modules/xmpp/JingleSessionState.ts
  37. 1
    1
      modules/xmpp/Lobby.js
  38. 3
    2
      modules/xmpp/MediaSessionEvents.ts
  39. 6083
    3599
      package-lock.json
  40. 11
    7
      package.json
  41. 1
    0
      service/RTC/BridgeVideoType.ts
  42. 1
    0
      service/RTC/CameraFacingMode.ts
  43. 1
    0
      service/RTC/CodecMimeType.ts
  44. 1
    0
      service/RTC/MediaDirection.ts
  45. 7
    6
      service/RTC/MediaType.ts
  46. 57
    51
      service/RTC/RTCEvents.ts
  47. 1
    0
      service/RTC/SignalingEvents.ts
  48. 11
    8
      service/RTC/StandardVideoQualitySettings.ts
  49. 1
    0
      service/RTC/VideoEncoderScalabilityMode.ts
  50. 1
    0
      service/RTC/VideoType.ts
  51. 2
    1
      service/connectivity/ConnectionQualityEvents.ts
  52. 2
    1
      service/e2eping/E2ePingEvents.ts
  53. 183
    143
      service/statistics/AnalyticsEvents.ts
  54. 2
    1
      service/statistics/Events.ts
  55. 1
    1
      service/statistics/constants.ts
  56. 144
    127
      service/xmpp/XMPPEvents.ts
  57. 7
    6
      service/xmpp/XMPPExtensioProtocols.ts
  58. 3
    5
      webpack.config.js

+ 4
- 0
.eslintignore Переглянути файл

@@ -11,3 +11,7 @@ doc/example/libs/*
11 11
 # not seem to be a reason why we will want to risk being inconsistent with our
12 12
 # remaining JavaScript source code.
13 13
 !.eslintrc.js
14
+
15
+*.d.ts
16
+*.spec.ts
17
+*.spec.js

+ 13
- 0
.eslintrc.js Переглянути файл

@@ -4,5 +4,18 @@ module.exports = {
4 4
     },
5 5
     'extends': [
6 6
         '@jitsi/eslint-config'
7
+    ],
8
+    'overrides': [
9
+        {
10
+            'files': [ '*.ts' ],
11
+            extends: [ '@jitsi/eslint-config/typescript' ],
12
+            parserOptions: {
13
+                sourceType: 'module',
14
+                project: [ 'tsconfig.json' ]
15
+            },
16
+            rules: {
17
+                'no-continue': 0
18
+            }
19
+        }
7 20
     ]
8 21
 };

+ 23
- 22
JitsiConferenceErrors.ts Переглянути файл

@@ -3,6 +3,7 @@
3 3
  */
4 4
 
5 5
 export enum JitsiConferenceErrors {
6
+
6 7
     /**
7 8
      * Indicates that client must be authenticated to create the conference.
8 9
      */
@@ -14,9 +15,10 @@ export enum JitsiConferenceErrors {
14 15
     CHAT_ERROR = 'conference.chatError',
15 16
 
16 17
     /**
17
-     * Indicates that a settings error occurred.
18
+     * Indicates that a connection error is due to denied access to the room,
19
+     * occurred after joining a lobby room and access is denied by the room moderators.
18 20
      */
19
-    SETTINGS_ERROR = 'conference.settingsError',
21
+    CONFERENCE_ACCESS_DENIED = 'conference.connectionError.accessDenied',
20 22
 
21 23
     /**
22 24
      * Indicates that conference has been destroyed.
@@ -28,11 +30,6 @@ export enum JitsiConferenceErrors {
28 30
      */
29 31
     CONFERENCE_MAX_USERS = 'conference.max_users',
30 32
 
31
-    /**
32
-     * Indicates that a connection error occurred when trying to join a conference.
33
-     */
34
-    CONNECTION_ERROR = 'conference.connectionError',
35
-
36 33
     /**
37 34
      * Indicates that the client has been forced to restart by jicofo when the
38 35
      * conference was migrated from one bridge to another.
@@ -40,22 +37,9 @@ export enum JitsiConferenceErrors {
40 37
     CONFERENCE_RESTARTED = 'conference.restarted',
41 38
 
42 39
     /**
43
-     * Indicates that a connection error is due to not allowed,
44
-     * occurred when trying to join a conference.
45
-     */
46
-    NOT_ALLOWED_ERROR = 'conference.connectionError.notAllowed',
47
-
48
-    /**
49
-     * Indicates that a connection error is due to not allowed,
50
-     * occurred when trying to join a conference, only approved members are allowed to join.
51
-     */
52
-    MEMBERS_ONLY_ERROR = 'conference.connectionError.membersOnly',
53
-
54
-    /**
55
-     * Indicates that a connection error is due to denied access to the room,
56
-     * occurred after joining a lobby room and access is denied by the room moderators.
40
+     * Indicates that a connection error occurred when trying to join a conference.
57 41
      */
58
-    CONFERENCE_ACCESS_DENIED = 'conference.connectionError.accessDenied',
42
+    CONNECTION_ERROR = 'conference.connectionError',
59 43
 
60 44
     /**
61 45
      * Indicates that the display name is required when joining the room.
@@ -90,6 +74,18 @@ export enum JitsiConferenceErrors {
90 74
      */
91 75
     INCOMPATIBLE_SERVER_VERSIONS = 'conference.incompatible_server_versions',
92 76
 
77
+    /**
78
+     * Indicates that a connection error is due to not allowed,
79
+     * occurred when trying to join a conference, only approved members are allowed to join.
80
+     */
81
+    MEMBERS_ONLY_ERROR = 'conference.connectionError.membersOnly',
82
+
83
+    /**
84
+     * Indicates that a connection error is due to not allowed,
85
+     * occurred when trying to join a conference.
86
+     */
87
+    NOT_ALLOWED_ERROR = 'conference.connectionError.notAllowed',
88
+
93 89
     /**
94 90
      * Indicates that offer/answer had failed.
95 91
      */
@@ -110,6 +106,11 @@ export enum JitsiConferenceErrors {
110 106
      */
111 107
     RESERVATION_ERROR = 'conference.reservationError',
112 108
 
109
+    /**
110
+     * Indicates that a settings error occurred.
111
+     */
112
+    SETTINGS_ERROR = 'conference.settingsError',
113
+
113 114
     /**
114 115
      * Indicates that there is no available videobridge.
115 116
      */

+ 43
- 41
JitsiConferenceEvents.ts Переглянути файл

@@ -2,19 +2,6 @@
2 2
  * The events for the conference.
3 3
  */
4 4
 export enum JitsiConferenceEvents {
5
-    /**
6
-     * An event(library-private) fired when the conference switches the currently active media session.
7
-     * @type {string}
8
-     * @private
9
-     */
10
-    _MEDIA_SESSION_ACTIVE_CHANGED = 'conference.media_session.active_changed',
11
-
12
-    /**
13
-     * An event(library-private) fired when a new media session is added to the conference.
14
-     * @type {string}
15
-     * @private
16
-     */
17
-    _MEDIA_SESSION_STARTED = 'conference.media_session.started',
18 5
 
19 6
     /**
20 7
      * Event indicates that the current conference audio input switched between audio
@@ -23,8 +10,8 @@ export enum JitsiConferenceEvents {
23 10
     AUDIO_INPUT_STATE_CHANGE = 'conference.audio_input_state_changed',
24 11
 
25 12
     /**
26
-     * Event indicates that the permission for unmuting audio has changed based on the number of audio senders in the call
27
-     * and the audio sender limit configured in Jicofo.
13
+     * Event indicates that the permission for unmuting audio has changed based on the number of audio senders in the
14
+     * call and the audio sender limit configured in Jicofo.
28 15
      */
29 16
     AUDIO_UNMUTE_PERMISSIONS_CHANGED = 'conference.audio_unmute_permissions_changed',
30 17
 
@@ -115,17 +102,17 @@ export enum JitsiConferenceEvents {
115 102
      */
116 103
     CONFERENCE_FAILED = 'conference.failed',
117 104
 
118
-    /**
119
-     * Indicates that conference is in progress of joining.
120
-     */
121
-    CONFERENCE_JOIN_IN_PROGRESS = 'conference.join_in_progress',
122
-
123 105
     /**
124 106
      * Indicates that conference has been joined. The event does NOT provide any
125 107
      * parameters to its listeners.
126 108
      */
127 109
     CONFERENCE_JOINED = 'conference.joined',
128 110
 
111
+    /**
112
+     * Indicates that conference is in progress of joining.
113
+     */
114
+    CONFERENCE_JOIN_IN_PROGRESS = 'conference.join_in_progress',
115
+
129 116
     /**
130 117
      * Indicates that conference has been left.
131 118
      */
@@ -163,7 +150,7 @@ export enum JitsiConferenceEvents {
163 150
 
164 151
     /**
165 152
      * A connection to the video bridge's data channel has been closed.
166
-     * This event is only emitted in 
153
+     * This event is only emitted in
167 154
      */
168 155
     DATA_CHANNEL_CLOSED = 'conference.dataChannelClosed',
169 156
 
@@ -284,21 +271,11 @@ export enum JitsiConferenceEvents {
284 271
      */
285 272
     MESSAGE_RECEIVED = 'conference.messageReceived',
286 273
 
287
-    /**
288
-     * New reaction was received.
289
-     */
290
-    REACTION_RECEIVED = 'conference.reactionReceived',
291
-
292 274
     /**
293 275
      * Event fired when the conference metadata is updated.
294 276
      */
295 277
     METADATA_UPDATED = 'conference.metadata.updated',
296 278
 
297
-    /**
298
-     * Event indicates that the current selected input device has no signal
299
-     */
300
-    NO_AUDIO_INPUT = 'conference.no_audio_input',
301
-
302 279
     /**
303 280
      * Event indicates that the current microphone used by the conference is noisy.
304 281
      */
@@ -310,6 +287,11 @@ export enum JitsiConferenceEvents {
310 287
      */
311 288
     NON_PARTICIPANT_MESSAGE_RECEIVED = 'conference.non_participant_message_received',
312 289
 
290
+    /**
291
+     * Event indicates that the current selected input device has no signal
292
+     */
293
+    NO_AUDIO_INPUT = 'conference.no_audio_input',
294
+
313 295
     /**
314 296
      * Indicates that the conference has switched between JVB and P2P connections.
315 297
      * The first argument of this event is a <tt>boolean</tt> which when set to
@@ -350,12 +332,18 @@ export enum JitsiConferenceEvents {
350 332
      * New private text message was received.
351 333
      */
352 334
     PRIVATE_MESSAGE_RECEIVED = 'conference.privateMessageReceived',
335
+
353 336
     /**
354 337
      * The conference properties changed.
355 338
      * @type {string}
356 339
      */
357 340
     PROPERTIES_CHANGED = 'conference.propertiesChanged',
358 341
 
342
+    /**
343
+     * New reaction was received.
344
+     */
345
+    REACTION_RECEIVED = 'conference.reactionReceived',
346
+
359 347
     /**
360 348
      * Indicates that recording state changed.
361 349
      */
@@ -374,14 +362,14 @@ export enum JitsiConferenceEvents {
374 362
     SILENT_STATUS_CHANGED = 'conference.silentStatusChanged',
375 363
 
376 364
     /**
377
-     * Indicates that start muted settings changed.
365
+     * Indicates that the local user has started muted.
378 366
      */
379
-    START_MUTED_POLICY_CHANGED = 'conference.start_muted_policy_changed',
367
+    STARTED_MUTED = 'conference.started_muted',
380 368
 
381 369
     /**
382
-     * Indicates that the local user has started muted.
370
+     * Indicates that start muted settings changed.
383 371
      */
384
-    STARTED_MUTED = 'conference.started_muted',
372
+    START_MUTED_POLICY_CHANGED = 'conference.start_muted_policy_changed',
385 373
 
386 374
     /**
387 375
      * Indicates that subject of the conference has changed.
@@ -478,25 +466,39 @@ export enum JitsiConferenceEvents {
478 466
     VIDEO_SIP_GW_SESSION_STATE_CHANGED = 'conference.videoSIPGWSessionStateChanged',
479 467
 
480 468
     /**
481
-     * Event indicates that the permission for unmuting video has changed based on the number of video senders in the call
482
-     * and the video sender limit configured in Jicofo.
469
+     * Event indicates that the permission for unmuting video has changed based on the number of video senders in the
470
+     * call and the video sender limit configured in Jicofo.
483 471
      */
484 472
     VIDEO_UNMUTE_PERMISSIONS_CHANGED = 'conference.video_unmute_permissions_changed',
485 473
 
474
+    /**
475
+     * Event indicating we have received a message from the visitors component.
476
+     */
477
+    VISITORS_MESSAGE = 'conference.visitors_message',
478
+
479
+    /**
480
+     * Event indicating that our request for promotion was rejected.
481
+     */
482
+    VISITORS_REJECTION = 'conference.visitors_rejection',
483
+
486 484
     /**
487 485
      * Indicates that the conference has support for visitors.
488 486
      */
489 487
     VISITORS_SUPPORTED_CHANGED = 'conference.visitorsSupported',
490 488
 
491 489
     /**
492
-     * Event indicating we have received a message from the visitors component.
490
+     * An event(library-private) fired when the conference switches the currently active media session.
491
+     * @type {string}
492
+     * @private
493 493
      */
494
-    VISITORS_MESSAGE = 'conference.visitors_message',
494
+    _MEDIA_SESSION_ACTIVE_CHANGED = 'conference.media_session.active_changed',
495 495
 
496 496
     /**
497
-     * Event indicating that our request for promotion was rejected.
497
+     * An event(library-private) fired when a new media session is added to the conference.
498
+     * @type {string}
499
+     * @private
498 500
      */
499
-    VISITORS_REJECTION = 'conference.visitors_rejection'
501
+    _MEDIA_SESSION_STARTED = 'conference.media_session.started'
500 502
 }
501 503
 
502 504
 // exported for backward compatibility

+ 3
- 2
JitsiConnectionErrors.ts Переглянути файл

@@ -3,10 +3,11 @@
3 3
  */
4 4
 
5 5
 export enum JitsiConnectionErrors {
6
+
6 7
     /**
7 8
      * When the conference-request to jicofo fails.
8 9
      */
9
-    CONFERENCE_REQUEST_FAILED = "connection.conferenceRequestFailed",
10
+    CONFERENCE_REQUEST_FAILED = 'connection.conferenceRequestFailed',
10 11
 
11 12
     /**
12 13
      * Indicates that the connection was dropped with an error which was most likely
@@ -41,7 +42,7 @@ export enum JitsiConnectionErrors {
41 42
      * errors on BOSH requests.
42 43
      */
43 44
     SERVER_ERROR = 'connection.serverError'
44
-};
45
+}
45 46
 
46 47
 // exported for backward compatibility
47 48
 export const CONFERENCE_REQUEST_FAILED = JitsiConnectionErrors.CONFERENCE_REQUEST_FAILED;

+ 8
- 7
JitsiConnectionEvents.ts Переглянути файл

@@ -3,6 +3,7 @@
3 3
  */
4 4
 
5 5
 export enum JitsiConnectionEvents {
6
+
6 7
     /**
7 8
      * Indicates that the connection has been disconnected. The event provides
8 9
      * the following parameters to its listeners:
@@ -39,12 +40,6 @@ export enum JitsiConnectionEvents {
39 40
      */
40 41
     CONNECTION_REDIRECTED = 'connection.redirected',
41 42
 
42
-    /**
43
-     * Indicates that the performed action cannot be executed because the
44
-     * connection is not in the correct state(connected, disconnected, etc.)
45
-     */
46
-    WRONG_STATE = 'connection.wrongState',
47
-
48 43
     /**
49 44
      * Indicates that the display name is required over this connection and need to be supplied when
50 45
      * joining the room.
@@ -56,7 +51,13 @@ export enum JitsiConnectionEvents {
56 51
      * Indicates that the connection properties have been updated.
57 52
      * @param properties {object} - All available connection properties (e.g. shard, region).
58 53
      */
59
-    PROPERTIES_UPDATED = 'connection.propertiesUpdated'
54
+    PROPERTIES_UPDATED = 'connection.propertiesUpdated',
55
+
56
+    /**
57
+     * Indicates that the performed action cannot be executed because the
58
+     * connection is not in the correct state(connected, disconnected, etc.)
59
+     */
60
+    WRONG_STATE = 'connection.wrongState'
60 61
 }
61 62
 
62 63
 // exported for backward compatibility

+ 2
- 1
JitsiMediaDevicesEvents.ts Переглянути файл

@@ -3,6 +3,7 @@
3 3
  */
4 4
 
5 5
 export enum JitsiMediaDevicesEvents {
6
+
6 7
     /**
7 8
      * Indicates that the list of available media devices has been changed. The
8 9
      * event provides the following parameters to its listeners:
@@ -30,7 +31,7 @@ export enum JitsiMediaDevicesEvents {
30 31
      *  other execution environment.
31 32
      */
32 33
     PERMISSION_PROMPT_IS_SHOWN = 'mediaDevices.permissionPromptIsShown'
33
-};
34
+}
34 35
 
35 36
 // exported for backward compatibility
36 37
 export const DEVICE_LIST_CHANGED = JitsiMediaDevicesEvents.DEVICE_LIST_CHANGED;

+ 27
- 19
JitsiMeetJS.ts Переглянути файл

@@ -13,6 +13,7 @@ import * as JitsiTrackEvents from './JitsiTrackEvents';
13 13
 import * as JitsiTranscriptionStatus from './JitsiTranscriptionStatus';
14 14
 import RTC from './modules/RTC/RTC';
15 15
 import RTCStats from './modules/RTCStats/RTCStats';
16
+import * as RTCStatsEvents from './modules/RTCStats/RTCStatsEvents';
16 17
 import browser from './modules/browser';
17 18
 import NetworkInfo from './modules/connectivity/NetworkInfo';
18 19
 import { TrackStreamingStatus } from './modules/connectivity/TrackStreamingStatus';
@@ -24,18 +25,17 @@ import ProxyConnectionService
24 25
 import recordingConstants from './modules/recording/recordingConstants';
25 26
 import Settings from './modules/settings/Settings';
26 27
 import LocalStatsCollector from './modules/statistics/LocalStatsCollector';
28
+import runPreCallTest, { IIceServer, IPreCallResult } from './modules/statistics/PreCallTest';
27 29
 import Statistics from './modules/statistics/statistics';
28 30
 import ScriptUtil from './modules/util/ScriptUtil';
29 31
 import * as VideoSIPGWConstants from './modules/videosipgw/VideoSIPGWConstants';
30 32
 import AudioMixer from './modules/webaudio/AudioMixer';
31 33
 import { MediaType } from './service/RTC/MediaType';
34
+import { VideoType } from './service/RTC/VideoType';
32 35
 import * as ConnectionQualityEvents
33 36
     from './service/connectivity/ConnectionQualityEvents';
34 37
 import * as E2ePingEvents from './service/e2eping/E2ePingEvents';
35 38
 import { createGetUserMediaEvent } from './service/statistics/AnalyticsEvents';
36
-import *  as RTCStatsEvents from './modules/RTCStats/RTCStatsEvents';
37
-import { VideoType } from './service/RTC/VideoType';
38
-import runPreCallTest, { IceServer, PreCallResult } from './modules/statistics/PreCallTest';
39 39
 
40 40
 const logger = Logger.getLogger(__filename);
41 41
 
@@ -57,14 +57,18 @@ let hasGUMExecuted = false;
57 57
 function getAnalyticsAttributesFromOptions(options) {
58 58
     const attributes: any = {};
59 59
 
60
-    attributes['audio_requested'] = options.devices.includes('audio');
61
-    attributes['video_requested'] = options.devices.includes('video');
62
-    attributes['screen_sharing_requested'] = options.devices.includes('desktop');
60
+    /* eslint-disable */
61
+
62
+    attributes.audio_requested = options.devices.includes(MediaType.AUDIO);
63
+    attributes.video_requested = options.devices.includes(MediaType.VIDEO);
64
+    attributes.screen_sharing_requested = options.devices.includes(VideoType.DESKTOP);
63 65
 
64 66
     if (attributes.video_requested) {
65 67
         attributes.resolution = options.resolution;
66 68
     }
67 69
 
70
+    /* eslint-enable */
71
+
68 72
     return attributes;
69 73
 }
70 74
 
@@ -89,14 +93,15 @@ interface IJitsiMeetJSOptions {
89 93
     flags?: {
90 94
         runInLiteMode?: boolean;
91 95
         ssrcRewritingEnabled?: boolean;
92
-    }
96
+    };
93 97
 }
94 98
 
95 99
 interface ICreateLocalTrackFromMediaStreamOptions {
96
-    stream: MediaStream,
97
-    sourceType: string,
98
-    mediaType: MediaType,
99
-    videoType?: VideoType
100
+    mediaType: MediaType;
101
+    sourceType: string;
102
+    stream: MediaStream;
103
+    track: any;
104
+    videoType?: VideoType;
100 105
 }
101 106
 
102 107
 /**
@@ -293,7 +298,7 @@ export default {
293 298
      */
294 299
     createLocalTracks(options: ICreateLocalTrackOptions = {}) {
295 300
         let isFirstGUM = false;
296
-        let startTS = window.performance.now();
301
+        const startTS = window.performance.now();
297 302
 
298 303
         if (!window.connectionTimes) {
299 304
             window.connectionTimes = {};
@@ -308,7 +313,7 @@ export default {
308 313
 
309 314
         return RTC.obtainAudioAndVideoPermissions(options)
310 315
             .then(tracks => {
311
-                let endTS = window.performance.now();
316
+                const endTS = window.performance.now();
312 317
 
313 318
                 window.connectionTimes['obtainPermissions.end'] = endTS;
314 319
 
@@ -372,7 +377,7 @@ export default {
372 377
                         createGetUserMediaEvent('error', attributes));
373 378
                 }
374 379
 
375
-                let endTS = window.performance.now();
380
+                const endTS = window.performance.now();
376 381
 
377 382
                 window.connectionTimes['obtainPermissions.end'] = endTS;
378 383
 
@@ -390,16 +395,18 @@ export default {
390 395
      * @param {Array<ICreateLocalTrackFromMediaStreamOptions>} tracksInfo - array of track information
391 396
      * @returns {Array<JitsiLocalTrack>} - created local tracks
392 397
      */
393
-    createLocalTracksFromMediaStreams(tracksInfo) {
394
-        return RTC.createLocalTracks(tracksInfo.map((trackInfo) => {
398
+    createLocalTracksFromMediaStreams(tracksInfo: ICreateLocalTrackFromMediaStreamOptions[]) {
399
+        return RTC.createLocalTracks(tracksInfo.map(trackInfo => {
395 400
             const tracks = trackInfo.stream.getTracks()
396 401
                 .filter(track => track.kind === trackInfo.mediaType);
397 402
 
398 403
             if (!tracks || tracks.length === 0) {
404
+                // eslint-disable-next-line @typescript-eslint/only-throw-error
399 405
                 throw new JitsiTrackError(JitsiTrackErrors.TRACK_NO_STREAM_TRACKS_FOUND, null, null);
400 406
             }
401 407
 
402 408
             if (tracks.length > 1) {
409
+                // eslint-disable-next-line @typescript-eslint/only-throw-error
403 410
                 throw new JitsiTrackError(JitsiTrackErrors.TRACK_TOO_MANY_TRACKS_IN_STREAM, null, null);
404 411
             }
405 412
 
@@ -481,10 +488,11 @@ export default {
481 488
     /**
482 489
      * Run a pre-call test to check the network conditions.
483 490
      *
484
-     * @param {IceServer} iceServers  - The ICE servers to use for the test,
485
-     * @returns {Promise<PreCallResult | any>} - A Promise that resolves with the test results or rejects with an error message.
491
+     * @param {IIceServer} iceServers  - The ICE servers to use for the test,
492
+     * @returns {Promise<PreCallResult | any>} - A Promise that resolves with the test results or rejects with an error
493
+     * message.
486 494
      */
487
-    runPreCallTest(iceServers) {
495
+    runPreCallTest(iceServers: IIceServer[]): Promise<IPreCallResult | any> {
488 496
         return runPreCallTest(iceServers);
489 497
     },
490 498
 

+ 6
- 5
JitsiTrackErrors.ts Переглянути файл

@@ -3,6 +3,7 @@
3 3
  */
4 4
 
5 5
 export enum JitsiTrackErrors {
6
+
6 7
     /**
7 8
      * An error which indicates that some of requested constraints in
8 9
      * getUserMedia call were not satisfied.
@@ -71,10 +72,9 @@ export enum JitsiTrackErrors {
71 72
     TRACK_NO_STREAM_FOUND = 'track.no_stream_found',
72 73
 
73 74
     /**
74
-     * An error which indicates that requested video resolution is not supported
75
-     * by a webcam.
75
+     * An error which indicates that no tracks were found in the media stream
76 76
      */
77
-    UNSUPPORTED_RESOLUTION = 'gum.unsupported_resolution',
77
+    TRACK_NO_STREAM_TRACKS_FOUND = 'track.no_stream_tracks_found',
78 78
 
79 79
     /**
80 80
      * An error which indicates that there are too many tracks in the provided media stream
@@ -82,9 +82,10 @@ export enum JitsiTrackErrors {
82 82
     TRACK_TOO_MANY_TRACKS_IN_STREAM = 'track.too_many_tracks_in_stream',
83 83
 
84 84
     /**
85
-     * An error which indicates that no tracks were found in the media stream
85
+     * An error which indicates that requested video resolution is not supported
86
+     * by a webcam.
86 87
      */
87
-    TRACK_NO_STREAM_TRACKS_FOUND = 'track.no_stream_tracks_found',
88
+    UNSUPPORTED_RESOLUTION = 'gum.unsupported_resolution'
88 89
 }
89 90
 
90 91
 // exported for backward compatibility

+ 23
- 21
JitsiTrackEvents.ts Переглянути файл

@@ -1,9 +1,22 @@
1 1
 export enum JitsiTrackEvents {
2
+
2 3
     /**
3 4
      * The media track was removed to the conference.
4 5
      */
5 6
     LOCAL_TRACK_STOPPED = 'track.stopped',
6 7
 
8
+    /**
9
+     * Indicates that the local audio track is not receiving any audio input from
10
+     * the microphone that is currently selected.
11
+     */
12
+    NO_AUDIO_INPUT = 'track.no_audio_input',
13
+
14
+    /**
15
+     * Indicates that the track is not receiving any data even though we expect it
16
+     * to receive data (i.e. the stream is not stopped).
17
+     */
18
+    NO_DATA_FROM_SOURCE = 'track.no_data_from_source',
19
+
7 20
     /**
8 21
      * Audio levels of a this track was changed.
9 22
      * The first argument is a number with audio level value in range [0, 1].
@@ -28,23 +41,6 @@ export enum JitsiTrackEvents {
28 41
      */
29 42
     TRACK_MUTE_CHANGED = 'track.trackMuteChanged',
30 43
 
31
-    /**
32
-     * The video type("camera" or "desktop") of the track was changed.
33
-     */
34
-    TRACK_VIDEOTYPE_CHANGED = 'track.videoTypeChanged',
35
-
36
-    /**
37
-     * Indicates that the track is not receiving any data even though we expect it
38
-     * to receive data (i.e. the stream is not stopped).
39
-     */
40
-    NO_DATA_FROM_SOURCE = 'track.no_data_from_source',
41
-
42
-    /**
43
-     * Indicates that the local audio track is not receiving any audio input from
44
-     * the microphone that is currently selected.
45
-     */
46
-    NO_AUDIO_INPUT = 'track.no_audio_input',
47
-
48 44
     /**
49 45
      * Indicates that a new owner has been assigned to a remote track when SSRC rewriting is enabled.
50 46
      */
@@ -52,17 +48,23 @@ export enum JitsiTrackEvents {
52 48
 
53 49
     /**
54 50
      * Event fired whenever video track's streaming changes.
55
-     * First argument is the sourceName of the track and the second is a string indicating if the connection is currently
51
+     * First argument is the sourceName of the track and the second is a string indicating if the connection is
52
+     * currently
56 53
      * - active - the connection is active.
57
-     * - inactive - the connection is inactive, was intentionally interrupted by the bridge because of low BWE or because
58
-     *   of the endpoint falling out of last N.
54
+     * - inactive - the connection is inactive, was intentionally interrupted by the bridge because of low BWE or
55
+     *   because of the endpoint falling out of last N.
59 56
      * - interrupted - a network problem occurred.
60 57
      * - restoring - the connection was inactive and is restoring now.
61 58
      *
62 59
      * The current status value can be obtained by calling JitsiRemoteTrack.getTrackStreamingStatus().
63 60
      */
64 61
     TRACK_STREAMING_STATUS_CHANGED = 'track.streaming_status_changed',
65
-};
62
+
63
+    /**
64
+     * The video type("camera" or "desktop") of the track was changed.
65
+     */
66
+    TRACK_VIDEOTYPE_CHANGED = 'track.videoTypeChanged'
67
+}
66 68
 
67 69
 // exported for backward compatibility
68 70
 export const LOCAL_TRACK_STOPPED = JitsiTrackEvents.LOCAL_TRACK_STOPPED;

+ 5
- 4
JitsiTranscriptionStatus.ts Переглянути файл

@@ -1,13 +1,14 @@
1 1
 export enum JitsiTranscriptionStatus {
2
+
2 3
     /**
3
-     * The transcription is on.
4
+     * The transcription is off.
4 5
      */
5
-    ON = 'ON',
6
+    OFF = 'OFF',
6 7
 
7 8
     /**
8
-     * The transcription is off.
9
+     * The transcription is on.
9 10
      */
10
-    OFF = 'OFF'
11
+    ON = 'ON'
11 12
 }
12 13
 
13 14
 // exported for backward compatibility

+ 2
- 1
index.js Переглянути файл

@@ -23,7 +23,8 @@ const ljm = require('./JitsiMeetJS').default;
23 23
 function _mergeNamespaceAndModule(module) {
24 24
     return (
25 25
         typeof window.JitsiMeetJS === 'object'
26
-            ? Object.assign({}, window.JitsiMeetJS, module)
26
+            ? { ...window.JitsiMeetJS,
27
+                ...module }
27 28
             : module);
28 29
 }
29 30
 

+ 4
- 4
modules/RTC/JitsiLocalTrack.js Переглянути файл

@@ -437,10 +437,10 @@ export default class JitsiLocalTrack extends JitsiTrack {
437 437
             };
438 438
 
439 439
             promise
440
-                = RTCUtils.obtainAudioAndVideoPermissions(Object.assign(
441
-                    {},
442
-                    streamOptions,
443
-                    { constraints: { video: this._constraints } }));
440
+                = RTCUtils.obtainAudioAndVideoPermissions({
441
+
442
+                    ...streamOptions,
443
+                    constraints: { video: this._constraints } });
444 444
 
445 445
             promise = promise.then(streamsInfo => {
446 446
                 const streamInfo = streamsInfo.find(info => info.track.kind === this.getType());

+ 6
- 0
modules/RTCStats/DefaulLogStorage.ts Переглянути файл

@@ -6,9 +6,15 @@ import RTCStats from './RTCStats';
6 6
 export default class DefaultLogStorage {
7 7
     private rtcStats: any;
8 8
 
9
+    /**
10
+     * Creates new instance of <tt>DefaultLogStorage</tt>.
11
+     * @param rtcStats - The RTCStats instance.
12
+     */
9 13
     constructor(rtcStats: any) {
10 14
         this.rtcStats = rtcStats;
11 15
     }
16
+
17
+
12 18
     /**
13 19
      * The DefaultLogStorage is ready when the RTCStats is ready.
14 20
      *

+ 24
- 20
modules/RTCStats/RTCStats.ts Переглянути файл

@@ -1,8 +1,8 @@
1 1
 import Logger, { getLogger } from '@jitsi/logger';
2
-
3 2
 import rtcstatsInit from '@jitsi/rtcstats/rtcstats';
4 3
 import traceInit from '@jitsi/rtcstats/trace-ws';
5 4
 
5
+import JitsiConference from '../../JitsiConference';
6 6
 import {
7 7
     BEFORE_STATISTICS_DISPOSED,
8 8
     CONFERENCE_CREATED_TIMESTAMP,
@@ -10,18 +10,18 @@ import {
10 10
     CONFERENCE_LEFT,
11 11
     CONFERENCE_UNIQUE_ID_SET
12 12
 } from '../../JitsiConferenceEvents';
13
-import JitsiConference from '../../JitsiConference';
14
-import { IRTCStatsConfiguration } from './interfaces';
15
-import { RTC_STATS_PC_EVENT, RTC_STATS_WC_DISCONNECTED } from './RTCStatsEvents';
16
-import EventEmitter from '../util/EventEmitter';
17 13
 import Settings from '../settings/Settings';
14
+import EventEmitter from '../util/EventEmitter';
15
+
18 16
 import DefaultLogStorage from './DefaulLogStorage';
17
+import { RTC_STATS_PC_EVENT, RTC_STATS_WC_DISCONNECTED } from './RTCStatsEvents';
18
+import { IRTCStatsConfiguration } from './interfaces';
19 19
 
20 20
 const logger = getLogger(__filename);
21 21
 
22 22
 /**
23
- * RTCStats Singleton that is initialized only once for the lifetime of the app, subsequent calls to init will be ignored.
24
- * Config and conference changes are handled by the start method.
23
+ * RTCStats Singleton that is initialized only once for the lifetime of the app, subsequent calls to init will be
24
+ * ignored. Config and conference changes are handled by the start method.
25 25
  */
26 26
 class RTCStats {
27 27
     private _initialized: boolean = false;
@@ -41,7 +41,7 @@ class RTCStats {
41 41
         const {
42 42
             analytics: {
43 43
                 rtcstatsUseLegacy: useLegacy = false,
44
-                rtcstatsPollInterval: pollInterval= 10000,
44
+                rtcstatsPollInterval: pollInterval = 10000,
45 45
                 rtcstatsSendSdp: sendSdp = false,
46 46
                 rtcstatsEnabled = false
47 47
             } = {}
@@ -50,14 +50,16 @@ class RTCStats {
50 50
         // If rtcstats is not enabled or already initialized, do nothing.
51 51
         // Calling rtcsatsInit multiple times will cause the global objects to be rewritten multiple times,
52 52
         // with unforeseen consequences.
53
-        if (!rtcstatsEnabled || this._initialized) return;
53
+        if (!rtcstatsEnabled || this._initialized) {
54
+            return;
55
+        }
54 56
 
55 57
         rtcstatsInit(
56 58
             { statsEntry: this.sendStatsEntry.bind(this) },
57 59
             { pollInterval,
58
-              useLegacy,
59
-              sendSdp,
60
-              eventCallback: (event) => this.events.emit(RTC_STATS_PC_EVENT, event)}
60
+                useLegacy,
61
+                sendSdp,
62
+                eventCallback: event => this.events.emit(RTC_STATS_PC_EVENT, event) }
61 63
         );
62 64
 
63 65
         this._initialized = true;
@@ -75,10 +77,10 @@ class RTCStats {
75 77
     start(conference: JitsiConference) {
76 78
         const {
77 79
             options: {
78
-                config : confConfig = {},
80
+                config: confConfig = {},
79 81
                 name: confName = ''
80 82
             } = {},
81
-            _statsCurrentId : displayName = ''
83
+            _statsCurrentId: displayName = ''
82 84
         } = conference;
83 85
 
84 86
         const {
@@ -104,7 +106,9 @@ class RTCStats {
104 106
         this.reset();
105 107
 
106 108
         // The new conference config might have rtcstats disabled, so we need to check again.
107
-        if (!rtcstatsEnabled) return;
109
+        if (!rtcstatsEnabled) {
110
+            return;
111
+        }
108 112
 
109 113
         // If rtcstats proxy module is not initialized, do nothing.
110 114
         if (!this._initialized) {
@@ -122,7 +126,7 @@ class RTCStats {
122 126
             const traceOptions = {
123 127
                 endpoint,
124 128
                 meetingFqn: confName,
125
-                onCloseCallback: (event) => this.events.emit(RTC_STATS_WC_DISCONNECTED, event),
129
+                onCloseCallback: event => this.events.emit(RTC_STATS_WC_DISCONNECTED, event),
126 130
                 useLegacy
127 131
             };
128 132
 
@@ -145,14 +149,14 @@ class RTCStats {
145 149
                 meetingUniqueId,
146 150
                 isBreakoutRoom,
147 151
                 localId
148
-            }
152
+            };
149 153
 
150 154
             this.sendIdentity(identityData);
151 155
         });
152 156
 
153 157
         // Note, this will only be called for normal rooms, not breakout rooms.
154
-        conference.once(CONFERENCE_UNIQUE_ID_SET, (meetingUniqueId) => {
155
-            this.sendIdentity({meetingUniqueId});
158
+        conference.once(CONFERENCE_UNIQUE_ID_SET, meetingUniqueId => {
159
+            this.sendIdentity({ meetingUniqueId });
156 160
         });
157 161
 
158 162
         conference.once(CONFERENCE_LEFT, () => {
@@ -161,7 +165,7 @@ class RTCStats {
161 165
 
162 166
         conference.once(CONFERENCE_CREATED_TIMESTAMP, (timestamp: number) => {
163 167
             this.sendStatsEntry('conferenceStartTimestamp', null, timestamp);
164
-        })
168
+        });
165 169
 
166 170
         conference.once(
167 171
             BEFORE_STATISTICS_DISPOSED,

+ 7
- 6
modules/RTCStats/RTCStatsEvents.ts Переглянути файл

@@ -2,14 +2,10 @@
2 2
  * Events emitted by the RTCStats module.
3 3
  */
4 4
 export enum RTCStatsEvents {
5
-    /**
6
-     * Event emitted when the websocket connection to the rtcstats server is disconnected.
7
-     */
8
-    RTC_STATS_WC_DISCONNECTED = 'rtcstats_ws_disconnected',
9 5
 
10 6
     /**
11 7
      * Event emitted when any PeerConnection event is triggered.
12
-     * 
8
+     *
13 9
      * @param {object} event - The PeerConnection event.
14 10
      * @param {string} event.type - The event type.
15 11
      * @param {object} event.body - Event body.
@@ -17,7 +13,12 @@ export enum RTCStatsEvents {
17 13
      * @param {string} event.body.state - PeerConnection state change which triggered the event.
18 14
      */
19 15
     RTC_STATS_PC_EVENT = 'rtstats_pc_event',
20
-};
16
+
17
+    /**
18
+     * Event emitted when the websocket connection to the rtcstats server is disconnected.
19
+     */
20
+    RTC_STATS_WC_DISCONNECTED = 'rtcstats_ws_disconnected'
21
+}
21 22
 
22 23
 // exported for backward compatibility
23 24
 export const RTC_STATS_WC_DISCONNECTED = RTCStatsEvents.RTC_STATS_WC_DISCONNECTED;

+ 3
- 3
modules/connectivity/IceFailedHandling.ts Переглянути файл

@@ -1,8 +1,8 @@
1 1
 import { getLogger } from '@jitsi/logger';
2 2
 
3
+import JitsiConference from '../../JitsiConference';
3 4
 import * as JitsiConferenceErrors from '../../JitsiConferenceErrors';
4 5
 import * as JitsiConferenceEvents from '../../JitsiConferenceEvents';
5
-import JitsiConference from '../../JitsiConference';
6 6
 
7 7
 const logger = getLogger(__filename);
8 8
 
@@ -23,7 +23,7 @@ export default class IceFailedHandling {
23 23
      * Creates new {@code DelayedIceFailed} task.
24 24
      * @param {JitsiConference} conference
25 25
      */
26
-    constructor(conference:JitsiConference) {
26
+    constructor(conference: JitsiConference) {
27 27
         this._conference = conference;
28 28
     }
29 29
 
@@ -52,7 +52,7 @@ export default class IceFailedHandling {
52 52
         }
53 53
 
54 54
         const jvbConnection = this._conference.jvbJingleSession;
55
-        const jvbConnIceState = jvbConnection && jvbConnection.getIceConnectionState();
55
+        const jvbConnIceState = jvbConnection?.getIceConnectionState();
56 56
 
57 57
         if (!jvbConnection) {
58 58
             logger.warn('Not sending ICE failed - no JVB connection');

+ 14
- 16
modules/connectivity/TrackStreamingStatus.ts Переглянути файл

@@ -3,12 +3,12 @@ import { getLogger } from '@jitsi/logger';
3 3
 import { JitsiConferenceEvents } from '../../JitsiConferenceEvents';
4 4
 import * as JitsiTrackEvents from '../../JitsiTrackEvents';
5 5
 import RTCEvents from '../../service/RTC/RTCEvents';
6
+import { VideoType } from '../../service/RTC/VideoType';
6 7
 import { createTrackStreamingStatusEvent } from '../../service/statistics/AnalyticsEvents';
7
-import browser from '../browser';
8
-import Statistics from '../statistics/statistics';
9 8
 import JitsiRemoteTrack from '../RTC/JitsiRemoteTrack';
10
-import { VideoType } from '../../service/RTC/VideoType';
11 9
 import RTC from '../RTC/RTC';
10
+import browser from '../browser';
11
+import Statistics from '../statistics/statistics';
12 12
 
13 13
 /** Track streaming statuses. */
14 14
 export enum TrackStreamingStatus {
@@ -34,14 +34,14 @@ export enum TrackStreamingStatus {
34 34
      * Status indicating that streaming is currently restoring.
35 35
      */
36 36
     RESTORING = 'restoring',
37
-  }
37
+}
38 38
 
39 39
 type StreamingStatusMap = {
40
-    videoType?: VideoType,
41
-    startedMs?: number,
42
-    p2p?: boolean,
43
-    streamingStatus?: string,
44
-    value?: number
40
+    p2p?: boolean;
41
+    startedMs?: number;
42
+    streamingStatus?: string;
43
+    value?: number;
44
+    videoType?: VideoType;
45 45
 };
46 46
 
47 47
 const logger = getLogger(__filename);
@@ -135,7 +135,7 @@ export class TrackStreamingStatusImpl {
135 135
     _onLastNValueChanged: () => void;
136 136
     _onForwardedSourcesChanged: () => void;
137 137
 
138
-    /* eslint-disable max-params*/
138
+    /* eslint-disable max-params */
139 139
     /**
140 140
      * Calculates the new {@link TrackStreamingStatus} based on the values given for some specific remote track. It is
141 141
      * assumed that the conference is currently in the JVB mode (in contrary to the P2P mode)
@@ -179,7 +179,7 @@ export class TrackStreamingStatusImpl {
179 179
         return isInForwardedSources ? TrackStreamingStatus.ACTIVE : TrackStreamingStatus.INACTIVE;
180 180
     }
181 181
 
182
-    /* eslint-enable max-params*/
182
+    /* eslint-enable max-params */
183 183
 
184 184
     /**
185 185
      * In P2P mode we don't care about any values coming from the JVB and the streaming status can be only active or
@@ -215,9 +215,9 @@ export class TrackStreamingStatusImpl {
215 215
      * {@link TrackStreamingStatusImpl.outOfForwardedSourcesTimeout}.
216 216
      */
217 217
     constructor(rtc: RTC, conference: any, track: JitsiRemoteTrack, options: {
218
-        outOfForwardedSourcesTimeout: number,
219
-        p2pRtcMuteTimeout: number,
220
-        rtcMuteTimeout: number
218
+        outOfForwardedSourcesTimeout: number;
219
+        p2pRtcMuteTimeout: number;
220
+        rtcMuteTimeout: number;
221 221
     }) {
222 222
         this.rtc = rtc;
223 223
         this.conference = conference;
@@ -609,8 +609,6 @@ export class TrackStreamingStatusImpl {
609 609
             return;
610 610
         }
611 611
 
612
-        const sourceName = this.track.getSourceName();
613
-
614 612
         this.figureOutStreamingStatus();
615 613
     }
616 614
 

+ 11
- 10
modules/detection/DetectionEvents.ts Переглянути файл

@@ -1,11 +1,4 @@
1 1
 export enum DetectionEvents {
2
-    /**
3
-     * Event triggered by a audio detector indicating that its active state has changed from active to inactive or vice
4
-     * versa.
5
-     * @event
6
-     * @type {boolean} - true when service has changed to active false otherwise.
7
-     */
8
-    DETECTOR_STATE_CHANGE = 'detector_state_change',
9 2
 
10 3
     /** Event triggered by {@link NoAudioSignalDetector} when the local audio device associated with a JitsiConference
11 4
      * starts receiving audio levels with the value of 0 meaning no audio is being captured on that device, or when
@@ -15,8 +8,16 @@ export enum DetectionEvents {
15 8
      */
16 9
     AUDIO_INPUT_STATE_CHANGE = 'audio_input_state_changed',
17 10
 
18
-    /** Event triggered by NoAudioSignalDetector when the local audio device associated with a JitsiConference goes silent
19
-     * for a period of time, meaning that the device is either broken or hardware/software muted.
11
+    /**
12
+     * Event triggered by a audio detector indicating that its active state has changed from active to inactive or vice
13
+     * versa.
14
+     * @event
15
+     * @type {boolean} - true when service has changed to active false otherwise.
16
+     */
17
+    DETECTOR_STATE_CHANGE = 'detector_state_change',
18
+
19
+    /** Event triggered by NoAudioSignalDetector when the local audio device associated with a JitsiConference goes
20
+     * silent for a period of time, meaning that the device is either broken or hardware/software muted.
20 21
      * @event
21 22
      * @type {void}
22 23
      */
@@ -59,7 +60,7 @@ export enum DetectionEvents {
59 60
      *  @type {Object}
60 61
      */
61 62
     VAD_TALK_WHILE_MUTED = 'detection.vad_talk_while_muted'
62
-};
63
+}
63 64
 
64 65
 // exported for backward compatibility
65 66
 export const DETECTOR_STATE_CHANGE = DetectionEvents.DETECTOR_STATE_CHANGE;

+ 4
- 4
modules/e2ee/E2EEErrors.ts Переглянути файл

@@ -1,8 +1,8 @@
1 1
 export enum E2EEErrors {
2
+    E2EE_SAS_CHANNEL_VERIFICATION_FAILED = 'e2ee.sas.channel-verification-failed',
3
+    E2EE_SAS_COMMITMENT_MISMATCHED = 'e2ee.sas.commitment-mismatched',
4
+    E2EE_SAS_INVALID_SAS_VERIFICATION = 'e2ee.sas.invalid-sas-verification',
2 5
     E2EE_SAS_KEYS_MAC_MISMATCH = 'e2ee.sas.keys-mac-mismatch',
3 6
     E2EE_SAS_MAC_MISMATCH = 'e2ee.sas.mac-mismatch',
4
-    E2EE_SAS_MISSING_KEY =  'e2ee.sas.missing-key',
5
-    E2EE_SAS_COMMITMENT_MISMATCHED =  'e2ee.sas.commitment-mismatched',
6
-    E2EE_SAS_CHANNEL_VERIFICATION_FAILED = 'e2ee.sas.channel-verification-failed',
7
-    E2EE_SAS_INVALID_SAS_VERIFICATION =  'e2ee.sas.invalid-sas-verification',
7
+    E2EE_SAS_MISSING_KEY = 'e2ee.sas.missing-key'
8 8
 }

+ 1
- 1
modules/e2ee/ManagedKeyHandler.js Переглянути файл

@@ -106,7 +106,7 @@ export class ManagedKeyHandler extends KeyHandler {
106 106
      * @param {*} newValue - The property's new value.
107 107
      * @private
108 108
      */
109
-    async _onParticipantPropertyChanged(participant, name, oldValue, newValue) {
109
+    _onParticipantPropertyChanged(participant, name, oldValue, newValue) {
110 110
         switch (name) {
111 111
         case 'e2ee.idKey':
112 112
             logger.debug(`Participant ${participant.getId()} updated their id key: ${newValue}`);

+ 1
- 2
modules/e2ee/Worker.js Переглянути файл

@@ -1,4 +1,3 @@
1
-/* global TransformStream */
2 1
 /* eslint-disable no-bitwise */
3 2
 
4 3
 // Worker for E2EE/Insertable streams.
@@ -50,7 +49,7 @@ function handleTransform(context, operation, readableStream, writableStream) {
50 49
     }
51 50
 }
52 51
 
53
-onmessage = async event => {
52
+onmessage = event => {
54 53
     const { operation } = event.data;
55 54
 
56 55
     if (operation === 'initialize') {

+ 2
- 2
modules/e2ee/crypto-utils.js Переглянути файл

@@ -36,7 +36,7 @@ export async function ratchet(material) {
36 36
     const textEncoder = new TextEncoder();
37 37
 
38 38
     // https://developer.mozilla.org/en-US/docs/Web/API/SubtleCrypto/deriveBits
39
-    return crypto.subtle.deriveBits({
39
+    return await crypto.subtle.deriveBits({
40 40
         name: 'HKDF',
41 41
         salt: textEncoder.encode('JFrameRatchetKey'),
42 42
         hash: 'SHA-256',
@@ -53,5 +53,5 @@ export async function ratchet(material) {
53 53
  */
54 54
 export async function importKey(keyBytes) {
55 55
     // https://developer.mozilla.org/en-US/docs/Web/API/SubtleCrypto/importKey
56
-    return crypto.subtle.importKey('raw', keyBytes, 'HKDF', false, [ 'deriveBits', 'deriveKey' ]);
56
+    return await crypto.subtle.importKey('raw', keyBytes, 'HKDF', false, [ 'deriveBits', 'deriveKey' ]);
57 57
 }

+ 1
- 1
modules/flags/FeatureFlags.ts Переглянути файл

@@ -6,7 +6,7 @@ import browser from '../browser';
6 6
 class FeatureFlags {
7 7
     private _runInLiteMode: boolean;
8 8
     private _ssrcRewriting: boolean;
9
-    
9
+
10 10
     /**
11 11
      * Configures the module.
12 12
      *

+ 0
- 1
modules/litemode/LiteModeContext.js Переглянути файл

@@ -1,4 +1,3 @@
1
-/* global TransformStream */
2 1
 import { getLogger } from '@jitsi/logger';
3 2
 
4 3
 import RTCEvents from '../../service/RTC/RTCEvents';

+ 1
- 1
modules/proxyconnection/ProxyConnectionService.js Переглянути файл

@@ -121,7 +121,7 @@ export default class ProxyConnectionService {
121 121
             this._selfCloseConnection();
122 122
         }
123 123
 
124
-        return;
124
+
125 125
     }
126 126
 
127 127
     /**

+ 1
- 1
modules/proxyconnection/constants.ts Переглянути файл

@@ -9,4 +9,4 @@ export enum ACTIONS {
9 9
     TERMINATE = 'session-terminate',
10 10
     TRANSPORT_INFO = 'transport-info',
11 11
     UNAVAILABLE = 'unavailable'
12
-};
12
+}

+ 7
- 1
modules/qualitycontrol/MockClasses.ts Переглянути файл

@@ -47,9 +47,15 @@ export class MockLocalTrack {
47 47
         this.videoType = videoType;
48 48
     }
49 49
 
50
+    /**
51
+     * Gets the capture resolution of the mock local track.
52
+     * @returns - The capture resolution.
53
+     */
50 54
     getCaptureResolution(): number {
51 55
         return this.captureResolution;
52 56
     }
57
+
58
+
53 59
     /**
54 60
      * Returns the video type of the mock local track.
55 61
      * @returns {VideoType}
@@ -120,7 +126,7 @@ export class MockConference extends Listenable {
120 126
      * Returns the list of participants.
121 127
      * @returns Array<MockParticipant>
122 128
      */
123
-    getParticipants(): Array<MockParticipant>  {
129
+    getParticipants(): Array<MockParticipant> {
124 130
         return this.participants;
125 131
     }
126 132
 

+ 59
- 36
modules/qualitycontrol/QualityController.ts Переглянути файл

@@ -1,21 +1,22 @@
1 1
 import { getLogger } from '@jitsi/logger';
2 2
 
3
-import JitsiConference from "../../JitsiConference";
4
-import { JitsiConferenceEvents } from "../../JitsiConferenceEvents";
5
-import { CodecMimeType } from "../../service/RTC/CodecMimeType";
6
-import RTCEvents from "../../service/RTC/RTCEvents";
7
-import JitsiLocalTrack from "../RTC/JitsiLocalTrack";
8
-import TraceablePeerConnection from "../RTC/TraceablePeerConnection";
9
-import JingleSessionPC from "../xmpp/JingleSessionPC";
10
-import { CodecSelection } from "./CodecSelection";
11
-import ReceiveVideoController from "./ReceiveVideoController";
12
-import SendVideoController from "./SendVideoController";
3
+import JitsiConference from '../../JitsiConference';
4
+import { JitsiConferenceEvents } from '../../JitsiConferenceEvents';
5
+import { CodecMimeType } from '../../service/RTC/CodecMimeType';
6
+import RTCEvents from '../../service/RTC/RTCEvents';
13 7
 import {
14 8
     DEFAULT_LAST_N,
15 9
     LAST_N_UNLIMITED,
16 10
     VIDEO_CODECS_BY_COMPLEXITY,
17 11
     VIDEO_QUALITY_LEVELS
18 12
 } from '../../service/RTC/StandardVideoQualitySettings';
13
+import JitsiLocalTrack from '../RTC/JitsiLocalTrack';
14
+import TraceablePeerConnection from '../RTC/TraceablePeerConnection';
15
+import JingleSessionPC from '../xmpp/JingleSessionPC';
16
+
17
+import { CodecSelection } from './CodecSelection';
18
+import ReceiveVideoController from './ReceiveVideoController';
19
+import SendVideoController from './SendVideoController';
19 20
 
20 21
 const logger = getLogger(__filename);
21 22
 
@@ -30,7 +31,7 @@ enum QualityLimitationReason {
30 31
     BANDWIDTH = 'bandwidth',
31 32
     CPU = 'cpu',
32 33
     NONE = 'none'
33
-};
34
+}
34 35
 
35 36
 interface IResolution {
36 37
     height: number;
@@ -53,10 +54,10 @@ interface ISourceStats {
53 54
     qualityLimitationReason: QualityLimitationReason;
54 55
     timestamp: number;
55 56
     tpc: TraceablePeerConnection;
56
-};
57
+}
57 58
 
58 59
 interface ITrackStats {
59
-    encodeResolution: number
60
+    encodeResolution: number;
60 61
     encodeTime: number;
61 62
     qualityLimitationReason: QualityLimitationReason;
62 63
 }
@@ -66,33 +67,36 @@ interface IVideoConstraints {
66 67
     sourceName: string;
67 68
 }
68 69
 
70
+/* eslint-disable require-jsdoc */
69 71
 export class FixedSizeArray {
70 72
     private _data: ISourceStats[];
71 73
     private _maxSize: number;
72
-  
74
+
73 75
     constructor(size: number) {
74
-      this._maxSize = size;
75
-      this._data = [];
76
+        this._maxSize = size;
77
+        this._data = [];
76 78
     }
77
-  
79
+
78 80
     add(item: ISourceStats): void {
79
-      if (this._data.length >= this._maxSize) {
80
-        this._data.shift();
81
-      }
82
-      this._data.push(item);
81
+        if (this._data.length >= this._maxSize) {
82
+            this._data.shift();
83
+        }
84
+        this._data.push(item);
83 85
     }
84
-  
86
+
85 87
     get(index: number): ISourceStats | undefined {
86
-      if (index < 0 || index >= this._data.length) {
87
-        throw new Error("Index out of bounds");
88
-      }
89
-      return this._data[index];
88
+        if (index < 0 || index >= this._data.length) {
89
+            throw new Error('Index out of bounds');
90
+        }
91
+
92
+        return this._data[index];
90 93
     }
91 94
 
92 95
     size(): number {
93 96
         return this._data.length;
94 97
     }
95 98
 }
99
+/* eslint-enable require-jsdoc */
96 100
 
97 101
 /**
98 102
  * QualityController class that is responsible for maintaining optimal video quality experience on the local endpoint
@@ -112,19 +116,21 @@ export class QualityController {
112 116
     private _sendVideoController: SendVideoController;
113 117
 
114 118
     /**
115
-     * 
119
+     *
116 120
      * @param {JitsiConference} conference - The JitsiConference instance.
117 121
      * @param {Object} options - video quality settings passed through config.js.
118 122
      */
119 123
     constructor(conference: JitsiConference, options: {
120 124
         enableAdaptiveMode: boolean;
121
-        jvb: Object;
125
+        jvb: object;
122 126
         lastNRampupTime: number;
123
-        p2p: Object;
127
+        p2p: object;
124 128
     }) {
125 129
         this._conference = conference;
126 130
         const { jvb, p2p } = options;
127
-        this._codecController = new CodecSelection(conference, { jvb, p2p });
131
+
132
+        this._codecController = new CodecSelection(conference, { jvb,
133
+            p2p });
128 134
         this._enableAdaptiveMode = options.enableAdaptiveMode;
129 135
         this._encodeTimeStats = new Map();
130 136
         this._isLastNRampupBlocked = false;
@@ -150,14 +156,17 @@ export class QualityController {
150 156
         const debouncedSelectCodec = this._debounce(
151 157
             () => this._codecController.selectPreferredCodec(this._conference.jvbJingleSession),
152 158
             1000);
159
+
153 160
         this._conference.on(JitsiConferenceEvents.USER_JOINED, debouncedSelectCodec.bind(this));
154 161
         this._conference.on(JitsiConferenceEvents.USER_LEFT, debouncedSelectCodec.bind(this));
155 162
         this._conference.rtc.on(
156 163
             RTCEvents.SENDER_VIDEO_CONSTRAINTS_CHANGED,
157
-            (videoConstraints: IVideoConstraints) => this._sendVideoController.onSenderConstraintsReceived(videoConstraints));
164
+            (videoConstraints: IVideoConstraints) =>
165
+                this._sendVideoController.onSenderConstraintsReceived(videoConstraints));
158 166
         this._conference.on(
159 167
             JitsiConferenceEvents.ENCODE_TIME_STATS_RECEIVED,
160
-            (tpc: TraceablePeerConnection, stats: Map<number, IOutboundRtpStats>) => this._processOutboundRtpStats(tpc, stats));
168
+            (tpc: TraceablePeerConnection, stats: Map<number, IOutboundRtpStats>) =>
169
+                this._processOutboundRtpStats(tpc, stats));
161 170
     }
162 171
 
163 172
     /**
@@ -169,14 +178,16 @@ export class QualityController {
169 178
      * @param {number} delay - The delay in milliseconds.
170 179
      * @returns {Function} - The debounced function.
171 180
      */
172
-    _debounce(func: Function, delay: number) {
173
-        return function (...args) {
181
+    _debounce(func: Function, delay: number) { // eslint-disable-line @typescript-eslint/no-unsafe-function-type
182
+        return function(...args: any) {
183
+            /* eslint-disable @typescript-eslint/no-invalid-this */
174 184
             if (!this._timer) {
175 185
                 this._timer = setTimeout(() => {
176 186
                     this._timer = null;
177 187
                     func.apply(this, args);
178 188
                 }, delay);
179 189
             }
190
+            /* eslint-enable @typescript-eslint/no-invalid-this */
180 191
         };
181 192
     }
182 193
 
@@ -239,6 +250,7 @@ export class QualityController {
239 250
         if (individualConstraints && Object.keys(individualConstraints).length) {
240 251
             for (const value of Object.values(individualConstraints)) {
241 252
                 const v: any = value;
253
+
242 254
                 maxHeight = Math.max(maxHeight, v.maxHeight);
243 255
             }
244 256
         }
@@ -276,11 +288,13 @@ export class QualityController {
276 288
                 this._limitedByCpuTimeout = undefined;
277 289
                 const updatedStats = this._encodeTimeStats.get(trackId);
278 290
                 const latestSourceStats: ISourceStats = updatedStats.get(updatedStats.size() - 1);
291
+                const expectedSendResolution
292
+                    = Math.min(localTrack.maxEnabledResolution, localTrack.getCaptureResolution());
279 293
 
280 294
                 // If the encoder is still limited by CPU, switch to a lower complexity codec.
281 295
                 if (latestSourceStats.qualityLimitationReason === QualityLimitationReason.CPU
282
-                    || encodeResolution <  Math.min(localTrack.maxEnabledResolution, localTrack.getCaptureResolution())) {
283
-                        return this.codecController.changeCodecPreferenceOrder(localTrack, codec)
296
+                        || encodeResolution < expectedSendResolution) {
297
+                    return this.codecController.changeCodecPreferenceOrder(localTrack, codec);
284 298
                 }
285 299
             }, LIMITED_BY_CPU_TIMEOUT);
286 300
         }
@@ -451,14 +465,23 @@ export class QualityController {
451 465
         }
452 466
     }
453 467
 
468
+    /**
469
+     * Gets the codec controller instance.
470
+     */
454 471
     get codecController() {
455 472
         return this._codecController;
456 473
     }
457 474
 
475
+    /**
476
+     * Gets the receive video controller instance.
477
+     */
458 478
     get receiveVideoController() {
459 479
         return this._receiveVideoController;
460 480
     }
461 481
 
482
+    /**
483
+     * Gets the send video controller instance.
484
+     */
462 485
     get sendVideoController() {
463 486
         return this._sendVideoController;
464 487
     }

+ 24
- 25
modules/sdp/SdpSimulcast.ts Переглянути файл

@@ -1,12 +1,13 @@
1
+import * as transform from 'sdp-transform';
2
+
1 3
 import { MediaDirection } from '../../service/RTC/MediaDirection';
2 4
 import { MediaType } from '../../service/RTC/MediaType';
3 5
 import { SIM_LAYERS, SSRC_GROUP_SEMANTICS } from '../../service/RTC/StandardVideoQualitySettings';
4 6
 
5
-import * as transform from 'sdp-transform';
6 7
 
7
-interface Description {
8
-    type: RTCSdpType;
8
+interface IDescription {
9 9
     sdp: string;
10
+    type: RTCSdpType;
10 11
 }
11 12
 
12 13
 /**
@@ -37,7 +38,7 @@ export default class SdpSimulcast {
37 38
      * @param mLine
38 39
      * @returns
39 40
      */
40
-     _fillSsrcsFromCache(mLine: transform.MediaDescription) : any {
41
+    _fillSsrcsFromCache(mLine: transform.MediaDescription): any {
41 42
         const mid = mLine.mid;
42 43
         const cachedSsrcs = this._ssrcCache.get(mid);
43 44
         const newSsrcs = this._parseSimLayers(mLine);
@@ -76,21 +77,9 @@ export default class SdpSimulcast {
76 77
      * @param primarySsrc
77 78
      * @returns
78 79
      */
79
-    _generateNewSsrcsForSimulcast(mLine: transform.MediaDescription, primarySsrc: number) : any {
80
+    _generateNewSsrcsForSimulcast(mLine: transform.MediaDescription, primarySsrc: number): any {
80 81
         const cname = this._getSsrcAttribute(mLine, primarySsrc, 'cname');
81 82
         let msid = this._getSsrcAttribute(mLine, primarySsrc, 'msid');
82
-        const addAssociatedAttributes = (mLine: transform.MediaDescription, ssrc: number) => {
83
-            mLine.ssrcs.push({
84
-                id: ssrc,
85
-                attribute: 'cname',
86
-                value: cname
87
-            });
88
-            mLine.ssrcs.push({
89
-                id: ssrc,
90
-                attribute: 'msid',
91
-                value: msid
92
-            });
93
-        }
94 83
 
95 84
         // In Unified-plan mode, the a=ssrc lines with the msid attribute are not present (only cname attributes are
96 85
         // present) in the answers that Chrome and Safari generate for an offer received from Jicofo. Generate these
@@ -105,7 +94,7 @@ export default class SdpSimulcast {
105 94
                     attribute: 'msid',
106 95
                     value: msid
107 96
                 });
108
-            })
97
+            });
109 98
         }
110 99
 
111 100
         // Generate SIM layers.
@@ -114,14 +103,24 @@ export default class SdpSimulcast {
114 103
         for (let i = 0; i < this._numOfLayers - 1; ++i) {
115 104
             const simSsrc = this._generateSsrc();
116 105
 
117
-            addAssociatedAttributes(mLine, simSsrc);
106
+            mLine.ssrcs.push({
107
+                id: simSsrc,
108
+                attribute: 'cname',
109
+                value: cname
110
+            });
111
+            mLine.ssrcs.push({
112
+                id: simSsrc,
113
+                attribute: 'msid',
114
+                value: msid
115
+            });
116
+
118 117
             simSsrcs.push(simSsrc);
119 118
         }
120 119
 
121 120
         mLine.ssrcGroups = mLine.ssrcGroups || [];
122 121
         mLine.ssrcGroups.push({
123 122
             semantics: SSRC_GROUP_SEMANTICS.SIM,
124
-            ssrcs: primarySsrc + ' ' + simSsrcs.join(' ')
123
+            ssrcs: `${primarySsrc} ${simSsrcs.join(' ')}`
125 124
         });
126 125
 
127 126
         return mLine;
@@ -132,7 +131,7 @@ export default class SdpSimulcast {
132 131
      *
133 132
      * @returns
134 133
      */
135
-    _generateSsrc() : number {
134
+    _generateSsrc(): number {
136 135
         const max = 0xffffffff;
137 136
 
138 137
         return Math.floor(Math.random() * max);
@@ -146,7 +145,7 @@ export default class SdpSimulcast {
146 145
      * @param attributeName
147 146
      * @returns
148 147
      */
149
-    _getSsrcAttribute(mLine: transform.MediaDescription, ssrc: number, attributeName: string) : string | undefined {
148
+    _getSsrcAttribute(mLine: transform.MediaDescription, ssrc: number, attributeName: string): string | undefined {
150 149
         return mLine.ssrcs?.find(
151 150
             ssrcInfo => Number(ssrcInfo.id) === ssrc
152 151
             && ssrcInfo.attribute === attributeName)?.value;
@@ -158,7 +157,7 @@ export default class SdpSimulcast {
158 157
      * @param mLine
159 158
      * @returns
160 159
      */
161
-    _parseSimLayers(mLine: transform.MediaDescription) : Array<number> | null {
160
+    _parseSimLayers(mLine: transform.MediaDescription): Array<number> | null {
162 161
         const simGroup = mLine.ssrcGroups?.find(group => group.semantics === SSRC_GROUP_SEMANTICS.SIM);
163 162
 
164 163
         if (simGroup) {
@@ -181,8 +180,8 @@ export default class SdpSimulcast {
181 180
      * @param description
182 181
      * @returns
183 182
      */
184
-    mungeLocalDescription(description: Description) : Description {
185
-        if (!description || !description.sdp) {
183
+    mungeLocalDescription(description: IDescription): IDescription {
184
+        if (!description?.sdp) {
186 185
             return description;
187 186
         }
188 187
         const session = transform.parse(description.sdp);

+ 25
- 15
modules/statistics/PreCallTest.ts Переглянути файл

@@ -1,30 +1,40 @@
1 1
 import PreCallTest from '@jitsi/precall-test';
2 2
 
3 3
 
4
-export interface PreCallResult {
5
-    throughput: number; // Maximum bandwidth reached in kbps  (kilo bits per second).
6
-    fractionalLoss: number; // Packet loss percentage over all the test traffic.
7
-    rtt: number;  // Round trip time in milliseconds.
8
-    jitter: number;  // Variation in packet arrival times during the transmission of media.
9
-    mediaConnectivity: boolean; // Whether the data channel was able to send data or not.
4
+export interface IPreCallResult {
5
+
6
+    // Maximum bandwidth reached in kbps  (kilo bits per second).
7
+    fractionalLoss: number;
8
+
9
+    // Round trip time in milliseconds.
10
+    jitter: number;
11
+
12
+    // Variation in packet arrival times during the transmission of media.
13
+    mediaConnectivity: boolean;
14
+
15
+    // Packet loss percentage over all the test traffic.
16
+    rtt: number;
17
+    throughput: number; // Whether the data channel was able to send data or not.
10 18
 }
11 19
 
12 20
 // Same interface as a PeerConnection configuration object.
13
-export interface IceServer {
21
+export interface IIceServer {
22
+    credential?: string;
14 23
     urls: Array<string> | string;
15 24
     username?: string;
16
-    credential?: string;
17 25
 }
18 26
 
19 27
 /**
20 28
  * Run a pre-call test to check the network conditions. It uses a TURN server to establish
21
- * a connection between two PeerConnections using the server as a relay. Afterwards it sends 
22
- * some test traffic through a data channel to measure the network conditions, these are 
29
+ * a connection between two PeerConnections using the server as a relay. Afterwards it sends
30
+ * some test traffic through a data channel to measure the network conditions, these are
23 31
  * recorded and returned through a Promise.
24
- * 
25
- * @param {Array<IceServer>} - The ICE servers to use for the test, these are passes to the PeerConnection constructor. 
26
- * @returns {Promise<PreCallResult | any>} - A Promise that resolves with the test results or rejects with an error.
32
+ *
33
+ * @param {Array<IIceServer>} - The ICE servers to use for the test, these are passes to the PeerConnection constructor.
34
+ * @returns {Promise<IPreCallResult | any>} - A Promise that resolves with the test results or rejects with an error.
27 35
  */
28
-export default async function runPreCallTest(iceServers: Array<IceServer>): Promise<PreCallResult | string> {
29
-    return new PreCallTest().start(iceServers);
36
+export default async function runPreCallTest(iceServers: Array<IIceServer>): Promise<IPreCallResult | string> {
37
+    const test = new PreCallTest();
38
+
39
+    return await test.start(iceServers);
30 40
 }

+ 1
- 1
modules/version/ComponentsVersions.ts Переглянути файл

@@ -6,7 +6,7 @@ const logger = getLogger(__filename);
6 6
  * Discovers component versions in a conference.
7 7
  */
8 8
 export default class ComponentsVersions {
9
-    versions: {[key: string]: string};
9
+    versions: { [key: string]: string; };
10 10
     conference: any;
11 11
 
12 12
     /**

+ 19
- 16
modules/videosipgw/VideoSIPGWConstants.ts Переглянути файл

@@ -1,32 +1,39 @@
1 1
 export enum VideoSIPGWStatusConstants {
2
+
2 3
     /**
3 4
      * Status that video SIP GW service is available.
4 5
      */
5 6
     STATUS_AVAILABLE = 'available',
6 7
 
7 8
     /**
8
-     * Status that video SIP GW service is not available.
9
+     * Status that video SIP GW service is available but there are no free nodes
10
+     * at the moment to serve new requests.
9 11
      */
10
-    STATUS_UNDEFINED = 'undefined',
12
+    STATUS_BUSY = 'busy',
11 13
 
12 14
     /**
13
-     * Status that video SIP GW service is available but there are no free nodes
14
-     * at the moment to serve new requests.
15
+     * Status that video SIP GW service is not available.
15 16
      */
16
-    STATUS_BUSY = 'busy'
17
-};
17
+    STATUS_UNDEFINED = 'undefined'
18
+}
18 19
 
19 20
 export enum VideoSIPGWStateConstants {
21
+
20 22
     /**
21
-     * Video SIP GW session state, currently running.
23
+     * Video SIP GW session state, tried to start but it failed.
22 24
      */
23
-    STATE_ON = 'on',
25
+    STATE_FAILED = 'failed',
24 26
 
25 27
     /**
26 28
      * Video SIP GW session state, currently stopped and not running.
27 29
      */
28 30
     STATE_OFF = 'off',
29 31
 
32
+    /**
33
+     * Video SIP GW session state, currently running.
34
+     */
35
+    STATE_ON = 'on',
36
+
30 37
     /**
31 38
      * Video SIP GW session state, currently is starting.
32 39
      */
@@ -36,15 +43,11 @@ export enum VideoSIPGWStateConstants {
36 43
      * Video SIP GW session state, has observed some issues and is retrying at the
37 44
      * moment.
38 45
      */
39
-    STATE_RETRYING = 'retrying',
40
-
41
-    /**
42
-     * Video SIP GW session state, tried to start but it failed.
43
-     */
44
-    STATE_FAILED = 'failed'
45
-};
46
+    STATE_RETRYING = 'retrying'
47
+}
46 48
 
47 49
 export enum VideoSIPGWErrorConstants {
50
+
48 51
     /**
49 52
      * Error on trying to create video SIP GW session in conference where
50 53
      * there is no room connection (hasn't joined or has left the room).
@@ -56,7 +59,7 @@ export enum VideoSIPGWErrorConstants {
56 59
      * there is an already created session.
57 60
      */
58 61
     ERROR_SESSION_EXISTS = 'error_session_already_exists'
59
-};
62
+}
60 63
 
61 64
 // exported for backward compatibility
62 65
 export const STATUS_AVAILABLE = VideoSIPGWStatusConstants.STATUS_AVAILABLE;

+ 3
- 1
modules/watchRTC/WatchRTC.ts Переглянути файл

@@ -29,11 +29,13 @@ class WatchRTCHandler {
29 29
             // @ts-ignore
30 30
             if (browser.isReactNative()) {
31 31
                 logger.warn('Cannot initialize WatchRTC in a react native environment!');
32
+
32 33
                 return;
33 34
             }
34 35
 
35 36
             if (!isAnalyticsEnabled(options)) {
36 37
                 logger.error('Cannot initialize WatchRTC when analytics or third party requests are disabled.');
38
+
37 39
                 return;
38 40
             }
39 41
 
@@ -75,4 +77,4 @@ class WatchRTCHandler {
75 77
     }
76 78
 }
77 79
 
78
-export default new WatchRTCHandler();
80
+export default new WatchRTCHandler();

+ 3
- 0
modules/watchRTC/functions.ts Переглянути файл

@@ -6,6 +6,7 @@
6 6
  */
7 7
 export function isAnalyticsEnabled(options): boolean {
8 8
     const { analytics, disableThirdPartyRequests } = options;
9
+
9 10
     return !(analytics?.disabled || disableThirdPartyRequests);
10 11
 }
11 12
 
@@ -17,6 +18,7 @@ export function isAnalyticsEnabled(options): boolean {
17 18
  */
18 19
 export function isRtcstatsEnabled(options): boolean {
19 20
     const { analytics } = options;
21
+
20 22
     return analytics?.rtcstatsEnabled ?? false;
21 23
 }
22 24
 
@@ -28,5 +30,6 @@ export function isRtcstatsEnabled(options): boolean {
28 30
  */
29 31
 export function isWatchRTCEnabled(options): boolean {
30 32
     const { analytics } = options;
33
+
31 34
     return analytics?.watchRTCEnabled ?? false;
32 35
 }

+ 8
- 7
modules/xmpp/JingleSessionState.ts Переглянути файл

@@ -1,9 +1,4 @@
1 1
 export enum JingleSessionState {
2
-    /**
3
-     * The pending Jingle session state which means the session as defined in
4
-     * XEP-0166(before 'session-invite/session-accept' took place).
5
-     */
6
-    PENDING = 'pending',
7 2
 
8 3
     /**
9 4
      * The active Jingle session state as defined in XEP-0166
@@ -15,8 +10,14 @@ export enum JingleSessionState {
15 10
      * The ended Jingle session state as defined in XEP-0166
16 11
      * (after 'session-terminate').
17 12
      */
18
-    ENDED = 'ended'
19
-};
13
+    ENDED = 'ended',
14
+
15
+    /**
16
+     * The pending Jingle session state which means the session as defined in
17
+     * XEP-0166(before 'session-invite/session-accept' took place).
18
+     */
19
+    PENDING = 'pending'
20
+}
20 21
 
21 22
 // exported for backward compatibility
22 23
 export const PENDING = JingleSessionState.PENDING;

+ 1
- 1
modules/xmpp/Lobby.js Переглянути файл

@@ -324,7 +324,7 @@ export default class Lobby {
324 324
 
325 325
                     this.lobbyRoom.clean();
326 326
 
327
-                    return;
327
+
328 328
                 }
329 329
             });
330 330
 

+ 3
- 2
modules/xmpp/MediaSessionEvents.ts Переглянути файл

@@ -1,8 +1,9 @@
1 1
 enum MediaSessionEvents {
2
+
2 3
     /**
3 4
      * Event triggered when the remote party signals video max frame heights for its local sources.
4 5
      */
5 6
     REMOTE_SOURCE_CONSTRAINTS_CHANGED = 'media_session.REMOTE_SOURCE_CONSTRAINTS_CHANGED'
6
-};
7
+}
7 8
 
8
-export default MediaSessionEvents;
9
+export default MediaSessionEvents;

+ 6083
- 3599
package-lock.json
Різницю між файлами не показано, бо вона завелика
Переглянути файл


+ 11
- 7
package.json Переглянути файл

@@ -35,19 +35,23 @@
35 35
     "webrtc-adapter": "8.1.1"
36 36
   },
37 37
   "devDependencies": {
38
-    "@babel/core": "7.16.0",
39
-    "@babel/eslint-parser": "7.16.0",
40
-    "@babel/preset-env": "7.16.0",
41
-    "@babel/preset-typescript": "7.16.7",
42
-    "@jitsi/eslint-config": "4.1.4",
38
+    "@babel/core": "7.25.9",
39
+    "@babel/eslint-parser": "7.25.9",
40
+    "@babel/preset-env": "7.25.9",
41
+    "@babel/preset-typescript": "7.25.9",
42
+    "@jitsi/eslint-config": "5.0.10",
43
+    "@stylistic/eslint-plugin": "2.12.1",
43 44
     "@types/async": "3.2.12",
44 45
     "@types/jasmine": "4.0.3",
45 46
     "@types/lodash-es": "4.17.12",
46 47
     "@types/sdp-transform": "2.4.5",
48
+    "@typescript-eslint/eslint-plugin": "8.19.1",
49
+    "@typescript-eslint/parser": "8.19.1",
47 50
     "babel-loader": "8.2.3",
48 51
     "core-js": "3.19.1",
49
-    "eslint": "8.1.0",
50
-    "eslint-plugin-import": "2.25.2",
52
+    "eslint": "8.57.0",
53
+    "eslint-plugin-import": "2.31.0",
54
+    "eslint-plugin-typescript-sort-keys": "3.3.0",
51 55
     "jasmine-core": "4.2.0",
52 56
     "karma": "6.4.0",
53 57
     "karma-chrome-launcher": "3.1.1",

+ 1
- 0
service/RTC/BridgeVideoType.ts Переглянути файл

@@ -3,6 +3,7 @@
3 3
  * @type {{CAMERA: string, DESKTOP: string, DESKTOP_HIGH_FPS: string, NONE: string}}
4 4
  */
5 5
 export enum BridgeVideoType {
6
+
6 7
     /**
7 8
      * The camera video type.
8 9
      */

+ 1
- 0
service/RTC/CameraFacingMode.ts Переглянути файл

@@ -8,6 +8,7 @@
8 8
  * @enum {string}
9 9
  */
10 10
 export enum CameraFacingMode {
11
+
11 12
     /**
12 13
      * The mode which specifies the environment-facing camera.
13 14
      */

+ 1
- 0
service/RTC/CodecMimeType.ts Переглянути файл

@@ -3,6 +3,7 @@
3 3
  * @type {{AV1: string, H264: string, OPUS: string, RED: string, ULPFEC: string, VP8: string, VP9: string}}
4 4
  */
5 5
 export enum CodecMimeType {
6
+
6 7
     /**
7 8
      * AV1 codec mime type.
8 9
      */

+ 1
- 0
service/RTC/MediaDirection.ts Переглянути файл

@@ -2,6 +2,7 @@
2 2
  * Enumeration of the media direction types.
3 3
  */
4 4
 export enum MediaDirection {
5
+
5 6
     /**
6 7
      * Media is send and receive is suspended.
7 8
      */

+ 7
- 6
service/RTC/MediaType.ts Переглянути файл

@@ -1,16 +1,17 @@
1 1
 export enum MediaType {
2
+
2 3
     /**
3
-     * The audio type.
4
+     * The application type (data over bridge channel).
4 5
      */
5
-    AUDIO = 'audio',
6
+    APPLICATION = 'application',
6 7
 
7 8
     /**
8
-     * The video type.
9
+     * The audio type.
9 10
      */
10
-    VIDEO = 'video',
11
+    AUDIO = 'audio',
11 12
 
12 13
     /**
13
-     * The application type (data over bridge channel).
14
+     * The video type.
14 15
      */
15
-    APPLICATION = 'application'
16
+    VIDEO = 'video'
16 17
 }

+ 57
- 51
service/RTC/RTCEvents.ts Переглянути файл

@@ -1,4 +1,13 @@
1 1
 export enum RTCEvents {
2
+
3
+    AUDIO_OUTPUT_DEVICE_CHANGED = 'rtc.audio_output_device_changed',
4
+
5
+    /**
6
+     * Designates an event indicating that some received audio SSRCs will now map to
7
+     * new remote sources.
8
+     */
9
+    AUDIO_SSRCS_REMAPPED = 'rtc.audio_ssrcs_remapped',
10
+
2 11
     /**
3 12
      * Indicates error while create answer call.
4 13
      */
@@ -8,20 +17,33 @@ export enum RTCEvents {
8 17
      * Indicates error while create offer call.
9 18
      */
10 19
     CREATE_OFFER_FAILED = 'rtc.create_offer_failed',
11
-    DATA_CHANNEL_OPEN = 'rtc.data_channel_open',
12 20
     DATA_CHANNEL_CLOSED = 'rtc.data_channel_closed',
13
-    ENDPOINT_CONN_STATUS_CHANGED = 'rtc.endpoint_conn_status_changed',
21
+    DATA_CHANNEL_OPEN = 'rtc.data_channel_open',
22
+    DEVICE_LIST_AVAILABLE = 'rtc.device_list_available',
23
+
24
+    DEVICE_LIST_CHANGED = 'rtc.device_list_changed',
25
+
26
+    /**
27
+     * Indicates that the list with available devices will change.
28
+     */
29
+    DEVICE_LIST_WILL_CHANGE = 'rtc.device_list_will_change',
30
+
14 31
     DOMINANT_SPEAKER_CHANGED = 'rtc.dominant_speaker_changed',
15
-    FORWARDED_SOURCES_CHANGED = 'rtc.forwarded_sources_changed',
32
+
33
+    ENDPOINT_CONN_STATUS_CHANGED = 'rtc.endpoint_conn_status_changed',
16 34
 
17 35
     /**
18
-     * Event emitted when the user granted/blocked a permission for the camera / mic.
19
-     * Used to keep track of the granted permissions on browsers which don't
20
-     * support the Permissions API.
36
+     * Indicates that a message from another participant is received on
37
+     * data channel.
21 38
      */
22
-    PERMISSIONS_CHANGED = 'rtc.permissions_changed',
39
+    ENDPOINT_MESSAGE_RECEIVED = 'rtc.endpoint_message_received',
23 40
 
24
-    SENDER_VIDEO_CONSTRAINTS_CHANGED = 'rtc.sender_video_constraints_changed',
41
+    /**
42
+     * Indicates that the remote endpoint stats have been received on data channel.
43
+     */
44
+    ENDPOINT_STATS_RECEIVED = 'rtc.endpoint_stats_received',
45
+
46
+    FORWARDED_SOURCES_CHANGED = 'rtc.forwarded_sources_changed',
25 47
 
26 48
     /**
27 49
      * Event emitted when {@link RTC.setLastN} method is called to update with
@@ -35,7 +57,21 @@ export enum RTCEvents {
35 57
      */
36 58
     LOCAL_TRACK_MAX_ENABLED_RESOLUTION_CHANGED = 'rtc.local_track_max_enabled_resolution_changed',
37 59
 
38
-    TRACK_ATTACHED = 'rtc.track_attached',
60
+    /**
61
+     * Designates an event indicating that the local ICE username fragment of
62
+     * the jingle session has changed.
63
+     * The first argument of the vent is <tt>TraceablePeerConnection</tt> which
64
+     * is the source of the event.
65
+     * The second argument is the actual "ufrag" string.
66
+     */
67
+    LOCAL_UFRAG_CHANGED = 'rtc.local_ufrag_changed',
68
+
69
+    /**
70
+     * Event emitted when the user granted/blocked a permission for the camera / mic.
71
+     * Used to keep track of the granted permissions on browsers which don't
72
+     * support the Permissions API.
73
+     */
74
+    PERMISSIONS_CHANGED = 'rtc.permissions_changed',
39 75
 
40 76
     /**
41 77
      * Event fired when we remote track is added to the conference.
@@ -57,35 +93,6 @@ export enum RTCEvents {
57 93
     // (currently implemented for local tracks only)
58 94
     REMOTE_TRACK_UNMUTE = 'rtc.remote_track_unmute',
59 95
 
60
-    /**
61
-     * Indicates error while set local description.
62
-     */
63
-    SET_LOCAL_DESCRIPTION_FAILED = 'rtc.set_local_description_failed',
64
-
65
-    /**
66
-     * Indicates error while set remote description.
67
-     */
68
-    SET_REMOTE_DESCRIPTION_FAILED = 'rtc.set_remote_description_failed',
69
-    AUDIO_OUTPUT_DEVICE_CHANGED = 'rtc.audio_output_device_changed',
70
-    DEVICE_LIST_CHANGED = 'rtc.device_list_changed',
71
-
72
-    /**
73
-     * Indicates that the list with available devices will change.
74
-     */
75
-    DEVICE_LIST_WILL_CHANGE = 'rtc.device_list_will_change',
76
-    DEVICE_LIST_AVAILABLE = 'rtc.device_list_available',
77
-
78
-    /**
79
-     * Indicates that a message from another participant is received on
80
-     * data channel.
81
-     */
82
-    ENDPOINT_MESSAGE_RECEIVED = 'rtc.endpoint_message_received',
83
-
84
-    /**
85
-     * Indicates that the remote endpoint stats have been received on data channel.
86
-     */
87
-    ENDPOINT_STATS_RECEIVED = 'rtc.endpoint_stats_received',
88
-
89 96
     /**
90 97
      * Designates an event indicating that the local ICE username fragment of
91 98
      * the jingle session has changed.
@@ -93,28 +100,27 @@ export enum RTCEvents {
93 100
      * is the source of the event.
94 101
      * The second argument is the actual "ufrag" string.
95 102
      */
96
-    LOCAL_UFRAG_CHANGED = 'rtc.local_ufrag_changed',
103
+    REMOTE_UFRAG_CHANGED = 'rtc.remote_ufrag_changed',
104
+
105
+    SENDER_VIDEO_CONSTRAINTS_CHANGED = 'rtc.sender_video_constraints_changed',
97 106
 
98 107
     /**
99
-     * Designates an event indicating that the local ICE username fragment of
100
-     * the jingle session has changed.
101
-     * The first argument of the vent is <tt>TraceablePeerConnection</tt> which
102
-     * is the source of the event.
103
-     * The second argument is the actual "ufrag" string.
108
+     * Indicates error while set local description.
104 109
      */
105
-    REMOTE_UFRAG_CHANGED = 'rtc.remote_ufrag_changed',
110
+    SET_LOCAL_DESCRIPTION_FAILED = 'rtc.set_local_description_failed',
106 111
 
107 112
     /**
108
-     * Designates an event indicating that some received video SSRCs will now map to
109
-     * new remote sources.
113
+     * Indicates error while set remote description.
110 114
      */
111
-    VIDEO_SSRCS_REMAPPED = 'rtc.video_ssrcs_remapped',
115
+    SET_REMOTE_DESCRIPTION_FAILED = 'rtc.set_remote_description_failed',
116
+
117
+    TRACK_ATTACHED = 'rtc.track_attached',
112 118
 
113 119
     /**
114
-     * Designates an event indicating that some received audio SSRCs will now map to
120
+     * Designates an event indicating that some received video SSRCs will now map to
115 121
      * new remote sources.
116 122
      */
117
-    AUDIO_SSRCS_REMAPPED = 'rtc.audio_ssrcs_remapped'
123
+    VIDEO_SSRCS_REMAPPED = 'rtc.video_ssrcs_remapped'
118 124
 }
119 125
 
120 126
 export const CREATE_ANSWER_FAILED = RTCEvents.CREATE_ANSWER_FAILED;
@@ -149,4 +155,4 @@ export const AUDIO_SSRCS_REMAPPED = RTCEvents.AUDIO_SSRCS_REMAPPED;
149 155
 // TODO: this was a pre-ES6 module using module.exports = RTCEvents which doesn't translate well
150 156
 // it is used in a number of places and should be updated to use the named export
151 157
 
152
-export default RTCEvents;
158
+export default RTCEvents;

+ 1
- 0
service/RTC/SignalingEvents.ts Переглянути файл

@@ -1,4 +1,5 @@
1 1
 export enum SignalingEvents {
2
+
2 3
     /**
3 4
      * Event triggered when participant's muted status changes.
4 5
      *

+ 11
- 8
service/RTC/StandardVideoQualitySettings.ts Переглянути файл

@@ -1,4 +1,5 @@
1 1
 import browser from '../../modules/browser';
2
+
2 3
 import { CodecMimeType } from './CodecMimeType';
3 4
 
4 5
 // Default value for assumed downlink bandwidth for the local endpoint which tells the bridge to use its own calculated
@@ -33,6 +34,7 @@ export const SIM_LAYERS = [
33 34
  * The ssrc-group semantics for SSRCs related to the video streams.
34 35
  */
35 36
 export enum SSRC_GROUP_SEMANTICS {
37
+
36 38
     // The semantics for group of SSRCs belonging to the same stream, primary and RTX.
37 39
     FID = 'FID',
38 40
 
@@ -104,12 +106,12 @@ export const STANDARD_CODEC_SETTINGS = {
104 106
  * next codec in the list.
105 107
  */
106 108
 export const VIDEO_CODECS_BY_COMPLEXITY = {
107
-    'camera' : [
109
+    'camera': [
108 110
         CodecMimeType.AV1,
109 111
         CodecMimeType.VP9,
110 112
         CodecMimeType.VP8
111 113
     ],
112
-    'desktop' : [
114
+    'desktop': [
113 115
         CodecMimeType.VP9,
114 116
         CodecMimeType.VP8,
115 117
         CodecMimeType.AV1
@@ -172,8 +174,6 @@ export const VIDEO_QUALITY_LEVELS = [
172 174
  * Enumerate the supported video resolutions.
173 175
  */
174 176
 export enum VIDEO_QUALITY_SETTINGS {
175
-    // 3840x2160 or 4k.
176
-    ULTRA = 'ultraHd',
177 177
 
178 178
     // 1920x1080 or full High Definition.
179 179
     FULL = 'fullHd',
@@ -181,12 +181,15 @@ export enum VIDEO_QUALITY_SETTINGS {
181 181
     // 1280x720 or High Definition.
182 182
     HIGH = 'high',
183 183
 
184
-    // 640x360 or Standard Definition.
185
-    STANDARD = 'standard',
186
-
187 184
     // 320x180 or Low Definition.
188 185
     LOW = 'low',
189 186
 
190 187
     // When the camera is turned off.
191
-    NONE = 'none'
188
+    NONE = 'none',
189
+
190
+    // 640x360 or Standard Definition.
191
+    STANDARD = 'standard',
192
+
193
+    // 3840x2160 or 4k.
194
+    ULTRA = 'ultraHd'
192 195
 }

+ 1
- 0
service/RTC/VideoEncoderScalabilityMode.ts Переглянути файл

@@ -11,6 +11,7 @@
11 11
  * }
12 12
  */
13 13
 export enum VideoEncoderScalabilityMode {
14
+
14 15
     /**
15 16
      * L1T3 mode: 1-layer spatial and 3-layer temporal scalabilty encoding.
16 17
      */

+ 1
- 0
service/RTC/VideoType.ts Переглянути файл

@@ -2,6 +2,7 @@
2 2
  * Enumeration of the video types
3 3
  */
4 4
 export enum VideoType {
5
+
5 6
     /**
6 7
      * The camera video type.
7 8
      */

+ 2
- 1
service/connectivity/ConnectionQualityEvents.ts Переглянути файл

@@ -1,4 +1,5 @@
1 1
 export enum ConnectionQualityEvents {
2
+
2 3
     /**
3 4
      * Indicates that the local connection statistics were updated.
4 5
      */
@@ -9,7 +10,7 @@ export enum ConnectionQualityEvents {
9 10
      * were updated.
10 11
      */
11 12
     REMOTE_STATS_UPDATED = 'cq.remote_stats_updated'
12
-};
13
+}
13 14
 
14 15
 // exported for backward compatibility
15 16
 export const LOCAL_STATS_UPDATED = ConnectionQualityEvents.LOCAL_STATS_UPDATED;

+ 2
- 1
service/e2eping/E2ePingEvents.ts Переглянути файл

@@ -1,9 +1,10 @@
1 1
 export enum E2ePingEvents {
2
+
2 3
     /**
3 4
      * Indicates that the end-to-end round-trip-time for a participant has changed.
4 5
      */
5 6
     E2E_RTT_CHANGED = 'e2eping.e2e_rtt_changed'
6
-};
7
+}
7 8
 
8 9
 // exported for backward compatibility
9 10
 export const E2E_RTT_CHANGED = E2ePingEvents.E2E_RTT_CHANGED;

+ 183
- 143
service/statistics/AnalyticsEvents.ts Переглянути файл

@@ -23,25 +23,6 @@
23 23
  */
24 24
 
25 25
 export enum AnalyticsEvents {
26
-    /**
27
-     * The constant which identifies an event of type "operational".
28
-     */
29
-    TYPE_OPERATIONAL = 'operational',
30
-
31
-    /**
32
-     * The constant which identifies an event of type "page".
33
-     */
34
-    TYPE_PAGE = 'page',
35
-
36
-    /**
37
-     * The constant which identifies an event of type "track".
38
-     */
39
-    TYPE_TRACK = 'track',
40
-
41
-    /**
42
-     * The constant which identifies an event of type "ui".
43
-     */
44
-    TYPE_UI = 'ui',
45 26
 
46 27
     /**
47 28
      * The "action" value for Jingle events which indicates that the Jingle session
@@ -80,8 +61,8 @@ export enum AnalyticsEvents {
80 61
     ACTION_JVB_ICE_FAILED = 'jvb.ice.failed',
81 62
 
82 63
     /**
83
-     * The "action" value for P2P events which indicates that P2P session initiate message has been rejected by the client
84
-     * because the mandatory requirements were not met.
64
+     * The "action" value for P2P events which indicates that P2P session initiate message has been rejected by the
65
+     * client because the mandatory requirements were not met.
85 66
      */
86 67
     ACTION_P2P_DECLINED = 'decline',
87 68
 
@@ -206,6 +187,26 @@ export enum AnalyticsEvents {
206 187
      */
207 188
     TRACK_UNMUTED = 'track.unmuted',
208 189
 
190
+    /**
191
+     * The constant which identifies an event of type "operational".
192
+     */
193
+    TYPE_OPERATIONAL = 'operational',
194
+
195
+    /**
196
+     * The constant which identifies an event of type "page".
197
+     */
198
+    TYPE_PAGE = 'page',
199
+
200
+    /**
201
+     * The constant which identifies an event of type "track".
202
+     */
203
+    TYPE_TRACK = 'track',
204
+
205
+    /**
206
+     * The constant which identifies an event of type "ui".
207
+     */
208
+    TYPE_UI = 'ui',
209
+
209 210
     /**
210 211
      * Indicates that the video codec changed for a local track.
211 212
      *
@@ -245,11 +246,13 @@ export const VIDEO_CODEC_CHANGED = AnalyticsEvents.VIDEO_CODEC_CHANGED;
245 246
  * Creates an operational event which indicates that we have received a
246 247
  * "bridge down" event from jicofo.
247 248
  */
248
-export const createBridgeDownEvent = () => ( {
249
-    action: 'bridge.down',
250
-    actionSubject: 'bridge.down',
251
-    type: TYPE_OPERATIONAL
252
-} );
249
+export const createBridgeDownEvent = () => {
250
+    return {
251
+        action: 'bridge.down',
252
+        actionSubject: 'bridge.down',
253
+        type: TYPE_OPERATIONAL
254
+    };
255
+};
253 256
 
254 257
 /**
255 258
  * Creates an event which indicates that the XMPP connection failed
@@ -257,15 +260,17 @@ export const createBridgeDownEvent = () => ( {
257 260
  * @param errorMessage TODO
258 261
  * @param detail connection failed details.
259 262
  */
260
-export const createConnectionFailedEvent = ( errorType: unknown, errorMessage: unknown, details: object ) => ( {
261
-    type: AnalyticsEvents.TYPE_OPERATIONAL,
262
-    action: 'connection.failed',
263
-    attributes: {
264
-        'error_type': errorType,
265
-        'error_message': errorMessage,
266
-        ...details
267
-    }
268
-} );
263
+export const createConnectionFailedEvent = (errorType: unknown, errorMessage: unknown, details: object) => {
264
+    return {
265
+        type: AnalyticsEvents.TYPE_OPERATIONAL,
266
+        action: 'connection.failed',
267
+        attributes: {
268
+            'error_type': errorType,
269
+            'error_message': errorMessage,
270
+            ...details
271
+        }
272
+    };
273
+};
269 274
 
270 275
 /**
271 276
  * Creates a conference event.
@@ -273,12 +278,14 @@ export const createConnectionFailedEvent = ( errorType: unknown, errorMessage: u
273 278
  * @param action - The action of the event.
274 279
  * @param attributes - The attributes to be added to the event.
275 280
  */
276
-export const createConferenceEvent = ( action: string, attributes: object ) => ( {
277
-    action,
278
-    attributes,
279
-    source: 'conference',
280
-    type: AnalyticsEvents.TYPE_OPERATIONAL
281
-} );
281
+export const createConferenceEvent = (action: string, attributes: object) => {
282
+    return {
283
+        action,
284
+        attributes,
285
+        source: 'conference',
286
+        type: AnalyticsEvents.TYPE_OPERATIONAL
287
+    };
288
+};
282 289
 
283 290
 /**
284 291
  * Creates an operational event which indicates that a particular connection
@@ -291,13 +298,15 @@ export const createConferenceEvent = ( action: string, attributes: object ) => (
291 298
  * relative to the beginning of the document's lifetime.
292 299
  *
293 300
  */
294
-export const createConnectionStageReachedEvent = ( stage: unknown, attributes: object ) => ( {
295
-    action: 'connection.stage.reached',
296
-    actionSubject: stage,
297
-    attributes,
298
-    source: 'connection.stage.reached',
299
-    type: AnalyticsEvents.TYPE_OPERATIONAL
300
-} );
301
+export const createConnectionStageReachedEvent = (stage: unknown, attributes: object) => {
302
+    return {
303
+        action: 'connection.stage.reached',
304
+        actionSubject: stage,
305
+        attributes,
306
+        source: 'connection.stage.reached',
307
+        type: AnalyticsEvents.TYPE_OPERATIONAL
308
+    };
309
+};
301 310
 
302 311
 /**
303 312
  * Creates an operational event for the end-to-end round trip time to a
@@ -306,24 +315,28 @@ export const createConnectionStageReachedEvent = ( stage: unknown, attributes: o
306 315
  * @param region the region of the remote participant
307 316
  * @param rtt the rtt
308 317
  */
309
-export const createE2eRttEvent = ( participantId: unknown, region: unknown, rtt: unknown ) => ( {
310
-    attributes: {
311
-        'participant_id': participantId,
312
-        region,
313
-        rtt
314
-    },
315
-    name: 'e2e_rtt',
316
-    type: AnalyticsEvents.TYPE_OPERATIONAL
317
-} );
318
+export const createE2eRttEvent = (participantId: unknown, region: unknown, rtt: unknown) => {
319
+    return {
320
+        attributes: {
321
+            'participant_id': participantId,
322
+            region,
323
+            rtt
324
+        },
325
+        name: 'e2e_rtt',
326
+        type: AnalyticsEvents.TYPE_OPERATIONAL
327
+    };
328
+};
318 329
 
319 330
 /**
320 331
  * Creates an event which indicates that the focus has left the MUC.
321 332
  */
322
-export const createFocusLeftEvent = () => ( {
323
-    action: 'focus.left',
324
-    actionSubject: 'focus.left',
325
-    type: AnalyticsEvents.TYPE_OPERATIONAL
326
-} );
333
+export const createFocusLeftEvent = () => {
334
+    return {
335
+        action: 'focus.left',
336
+        actionSubject: 'focus.left',
337
+        type: AnalyticsEvents.TYPE_OPERATIONAL
338
+    };
339
+};
327 340
 
328 341
 /**
329 342
  * Creates an event related to a getUserMedia call.
@@ -332,12 +345,14 @@ export const createFocusLeftEvent = () => ( {
332 345
  * 'success', 'warning', etc.
333 346
  * @param attributes the attributes to attach to the event.
334 347
  */
335
-export const createGetUserMediaEvent = ( action: 'error' | 'success' | 'warning' | string, attributes: object = {} ) => ( {
336
-    type: AnalyticsEvents.TYPE_OPERATIONAL,
337
-    source: 'get.user.media',
338
-    action,
339
-    attributes
340
-} );
348
+export const createGetUserMediaEvent = (action: 'error' | 'success' | 'warning' | string, attributes: object = {}) => {
349
+    return {
350
+        type: AnalyticsEvents.TYPE_OPERATIONAL,
351
+        source: 'get.user.media',
352
+        action,
353
+        attributes
354
+    };
355
+};
341 356
 
342 357
 /**
343 358
  * Creates an event which indicates that the JVB ICE connection has failed event after 3 retries.
@@ -346,47 +361,55 @@ export const createGetUserMediaEvent = ( action: 'error' | 'success' | 'warning'
346 361
  * @param attributes - The attributes to be added to the event.
347 362
  * @returns - The event object.
348 363
  */
349
-export const createJvbIceFailedEvent = ( action: unknown, attributes: object = {} ) => ( {
350
-    action,
351
-    attributes,
352
-    type: AnalyticsEvents.TYPE_OPERATIONAL,
353
-} );
364
+export const createJvbIceFailedEvent = (action: unknown, attributes: object = {}) => {
365
+    return {
366
+        action,
367
+        attributes,
368
+        type: AnalyticsEvents.TYPE_OPERATIONAL,
369
+    };
370
+};
354 371
 
355 372
 /**
356 373
  * Creates an event related to remote participant connection status changes.
357 374
  *
358 375
  * @param attributes the attributes to attach to the event.
359 376
  */
360
-export const createParticipantConnectionStatusEvent = ( attributes: object = {} ) => ( {
361
-    type: AnalyticsEvents.TYPE_OPERATIONAL,
362
-    source: 'peer.conn.status',
363
-    action: 'duration',
364
-    attributes
365
-} );
377
+export const createParticipantConnectionStatusEvent = (attributes: object = {}) => {
378
+    return {
379
+        type: AnalyticsEvents.TYPE_OPERATIONAL,
380
+        source: 'peer.conn.status',
381
+        action: 'duration',
382
+        attributes
383
+    };
384
+};
366 385
 
367 386
 /**
368 387
  * Creates an event related to remote track streaming status changes.
369 388
  *
370 389
  * @param attributes the attributes to attach to the event.
371 390
  */
372
-export const createTrackStreamingStatusEvent = ( attributes: object = {} ) => ( {
373
-    type: AnalyticsEvents.TYPE_OPERATIONAL,
374
-    source: 'track.streaming.status',
375
-    action: 'duration',
376
-    attributes
377
-} );
391
+export const createTrackStreamingStatusEvent = (attributes: object = {}) => {
392
+    return {
393
+        type: AnalyticsEvents.TYPE_OPERATIONAL,
394
+        source: 'track.streaming.status',
395
+        action: 'duration',
396
+        attributes
397
+    };
398
+};
378 399
 
379 400
 /**
380 401
  * Creates an event for a Jingle-related event.
381 402
  * @param action the action of the event
382 403
  * @param attributes attributes to add to the event.
383 404
  */
384
-export const createJingleEvent = ( action: unknown, attributes: object = {} ) => ( {
385
-    type: AnalyticsEvents.TYPE_OPERATIONAL,
386
-    action,
387
-    source: 'jingle',
388
-    attributes
389
-} );
405
+export const createJingleEvent = (action: unknown, attributes: object = {}) => {
406
+    return {
407
+        type: AnalyticsEvents.TYPE_OPERATIONAL,
408
+        action,
409
+        source: 'jingle',
410
+        attributes
411
+    };
412
+};
390 413
 
391 414
 /**
392 415
  * Creates an event which indicates that a local track was not able to read
@@ -395,35 +418,41 @@ export const createJingleEvent = ( action: unknown, attributes: object = {} ) =>
395 418
  * @param mediaType the media type of the local track ('audio' or
396 419
  * 'video').
397 420
  */
398
-export const createNoDataFromSourceEvent = ( mediaType: 'audio' | 'video' | string, value: unknown ) => ( {
399
-    attributes: {
400
-        'media_type': mediaType,
401
-        value
402
-    },
403
-    action: 'track.no.data.from.source',
404
-    type: AnalyticsEvents.TYPE_OPERATIONAL
405
-} );
421
+export const createNoDataFromSourceEvent = (mediaType: 'audio' | 'video' | string, value: unknown) => {
422
+    return {
423
+        attributes: {
424
+            'media_type': mediaType,
425
+            value
426
+        },
427
+        action: 'track.no.data.from.source',
428
+        type: AnalyticsEvents.TYPE_OPERATIONAL
429
+    };
430
+};
406 431
 
407 432
 /**
408 433
  * Creates an event for a p2p-related event.
409 434
  * @param action the action of the event
410 435
  * @param attributes attributes to add to the event.
411 436
  */
412
-export const createP2PEvent = ( action: unknown, attributes: object = {} ) => ( {
413
-    type: AnalyticsEvents.TYPE_OPERATIONAL,
414
-    action,
415
-    source: 'p2p',
416
-    attributes
417
-} )
437
+export const createP2PEvent = (action: unknown, attributes: object = {}) => {
438
+    return {
439
+        type: AnalyticsEvents.TYPE_OPERATIONAL,
440
+        action,
441
+        source: 'p2p',
442
+        attributes
443
+    };
444
+};
418 445
 
419 446
 /**
420 447
  * Indicates that we received a remote command to mute.
421 448
  */
422
-export const createRemotelyMutedEvent = ( mediaType: unknown ) => ( {
423
-    type: AnalyticsEvents.TYPE_OPERATIONAL,
424
-    action: 'remotely.muted',
425
-    mediaType
426
-} );
449
+export const createRemotelyMutedEvent = (mediaType: unknown) => {
450
+    return {
451
+        type: AnalyticsEvents.TYPE_OPERATIONAL,
452
+        action: 'remotely.muted',
453
+        mediaType
454
+    };
455
+};
427 456
 
428 457
 /**
429 458
  * Creates an event which contains RTP statistics such as RTT and packet loss.
@@ -468,11 +497,13 @@ export const createRemotelyMutedEvent = ( mediaType: unknown ) => ( {
468 497
  * {@link TraceablePeerConnection} and work independently from the main stats
469 498
  * pipe.
470 499
  */
471
-export const createRtpStatsEvent = ( attributes: object ) => ( {
472
-    type: AnalyticsEvents.TYPE_OPERATIONAL,
473
-    action: 'rtp.stats',
474
-    attributes
475
-} );
500
+export const createRtpStatsEvent = (attributes: object) => {
501
+    return {
502
+        type: AnalyticsEvents.TYPE_OPERATIONAL,
503
+        action: 'rtp.stats',
504
+        attributes
505
+    };
506
+};
476 507
 
477 508
 /**
478 509
  * Creates an event which contains the round trip time (RTT) to a set of
@@ -480,11 +511,13 @@ export const createRtpStatsEvent = ( attributes: object ) => ( {
480 511
  *
481 512
  * @param attributes
482 513
  */
483
-export const createRttByRegionEvent = ( attributes: object ) => ( {
484
-    type: AnalyticsEvents.TYPE_OPERATIONAL,
485
-    action: 'rtt.by.region',
486
-    attributes
487
-} );
514
+export const createRttByRegionEvent = (attributes: object) => {
515
+    return {
516
+        type: AnalyticsEvents.TYPE_OPERATIONAL,
517
+        action: 'rtt.by.region',
518
+        attributes
519
+    };
520
+};
488 521
 
489 522
 /**
490 523
  * Creates an event which contains the local and remote ICE candidate types
@@ -492,11 +525,13 @@ export const createRttByRegionEvent = ( attributes: object ) => ( {
492 525
  *
493 526
  * @param attributes
494 527
  */
495
-export const createTransportStatsEvent = ( attributes: object ) => ( {
496
-    type: AnalyticsEvents.TYPE_OPERATIONAL,
497
-    action: 'transport.stats',
498
-    attributes
499
-} );
528
+export const createTransportStatsEvent = (attributes: object) => {
529
+    return {
530
+        type: AnalyticsEvents.TYPE_OPERATIONAL,
531
+        action: 'transport.stats',
532
+        attributes
533
+    };
534
+};
500 535
 
501 536
 /**
502 537
  * Creates an event which contains information about the audio output problem (the user id of the affected participant,
@@ -506,15 +541,18 @@ export const createTransportStatsEvent = ( attributes: object ) => ( {
506 541
  * @param localAudioLevels - The local audio levels.
507 542
  * @param remoteAudioLevels - The audio levels received from the participant.
508 543
  */
509
-export const createAudioOutputProblemEvent = ( userID: string, localAudioLevels: unknown, remoteAudioLevels: unknown ) => ( {
510
-    type: AnalyticsEvents.TYPE_OPERATIONAL,
511
-    action: 'audio.output.problem',
512
-    attributes: {
513
-        userID,
514
-        localAudioLevels,
515
-        remoteAudioLevels
516
-    }
517
-} );
544
+export const createAudioOutputProblemEvent
545
+    = (userID: string, localAudioLevels: unknown, remoteAudioLevels: unknown) => {
546
+        return {
547
+            type: AnalyticsEvents.TYPE_OPERATIONAL,
548
+            action: 'audio.output.problem',
549
+            attributes: {
550
+                userID,
551
+                localAudioLevels,
552
+                remoteAudioLevels
553
+            }
554
+        };
555
+    };
518 556
 
519 557
 /**
520 558
  * Creates an event which contains an information related to the bridge channel close event.
@@ -522,14 +560,16 @@ export const createAudioOutputProblemEvent = ( userID: string, localAudioLevels:
522 560
  * @param code - A code from {@link https://developer.mozilla.org/en-US/docs/Web/API/CloseEvent}
523 561
  * @param reason - A string which describes the reason for closing the bridge channel.
524 562
  */
525
-export const createBridgeChannelClosedEvent = ( code: string, reason: string ) => ( {
526
-    type: AnalyticsEvents.TYPE_OPERATIONAL,
527
-    action: 'bridge-channel.error',
528
-    attributes: {
529
-        code,
530
-        reason
531
-    }
532
-} );
563
+export const createBridgeChannelClosedEvent = (code: string, reason: string) => {
564
+    return {
565
+        type: AnalyticsEvents.TYPE_OPERATIONAL,
566
+        action: 'bridge-channel.error',
567
+        attributes: {
568
+            code,
569
+            reason
570
+        }
571
+    };
572
+};
533 573
 
534 574
 /**
535 575
  * Creates an event which indicates the Time To First Media (TTFM).
@@ -546,4 +586,4 @@ export const createBridgeChannelClosedEvent = ( code: string, reason: string ) =
546 586
  *      muted: whether the track has ever been muted (?)
547 587
  *      value: the TTMF in milliseconds.
548 588
  */
549
-export const createTtfmEvent = ( attributes: object ) => createConnectionStageReachedEvent( 'ttfm', attributes );
589
+export const createTtfmEvent = (attributes: object) => createConnectionStageReachedEvent('ttfm', attributes);

+ 2
- 1
service/statistics/Events.ts Переглянути файл

@@ -1,4 +1,5 @@
1 1
 export enum Events {
2
+
2 3
     /**
3 4
      * Notifies about audio level in RTP statistics by SSRC.
4 5
      *
@@ -40,7 +41,7 @@ export enum Events {
40 41
      * An event carrying performance stats.
41 42
      */
42 43
     LONG_TASKS_STATS = 'statistics.long_tasks_stats'
43
-};
44
+}
44 45
 
45 46
 // exported for backward compatibility
46 47
 export const AUDIO_LEVEL = Events.AUDIO_LEVEL;

+ 1
- 1
service/statistics/constants.ts Переглянути файл

@@ -1 +1 @@
1
-export const LOCAL_JID = 'local'
1
+export const LOCAL_JID = 'local';

+ 144
- 127
service/xmpp/XMPPEvents.ts Переглянути файл

@@ -1,4 +1,5 @@
1 1
 export enum XMPPEvents {
2
+
2 3
     /**
3 4
      * Indicates error while adding ice candidate.
4 5
      */
@@ -8,10 +9,53 @@ export enum XMPPEvents {
8 9
     // audio.
9 10
     AUDIO_MUTED_BY_FOCUS = 'xmpp.audio_muted_by_focus',
10 11
 
11
-    // Designates an event indicating that the focus has asked us to disable our
12
-    // camera.
13
-    VIDEO_MUTED_BY_FOCUS = 'xmpp.video_muted_by_focus',
14 12
     AUTHENTICATION_REQUIRED = 'xmpp.authentication_required',
13
+
14
+    /**
15
+     * Event fired when we receive a message for AV moderation approved for the local participant.
16
+     */
17
+    AV_MODERATION_APPROVED = 'xmpp.av_moderation.approved',
18
+
19
+    /**
20
+     * Event fired when the moderation enable/disable changes.
21
+     */
22
+    AV_MODERATION_CHANGED = 'xmpp.av_moderation.changed',
23
+
24
+    /**
25
+     * Event fired when we receive message that a new jid was approved.
26
+     */
27
+    AV_MODERATION_PARTICIPANT_APPROVED = 'xmpp.av_moderation.participant.approved',
28
+
29
+    /**
30
+     * Event fired when we receive message that a new jid was approved.
31
+     */
32
+    AV_MODERATION_PARTICIPANT_REJECTED = 'xmpp.av_moderation.participant.rejected',
33
+
34
+    /**
35
+     * Event fired when we receive a message for AV moderation.
36
+     */
37
+    AV_MODERATION_RECEIVED = 'xmpp.av_moderation.received',
38
+
39
+    /**
40
+    * Event fired when we receive a message for AV moderation rejected for the local participant.
41
+    */
42
+    AV_MODERATION_REJECTED = 'xmpp.av_moderation.rejected',
43
+
44
+    /**
45
+     * Event fired when we receive a message for breakout rooms.
46
+     */
47
+    BREAKOUT_ROOMS_EVENT = 'xmpp.breakout-rooms.event',
48
+
49
+    /**
50
+     * Event fired when a participant is requested to join a given (breakout) room.
51
+     */
52
+    BREAKOUT_ROOMS_MOVE_TO_ROOM = 'xmpp.breakout-rooms.move-to-room',
53
+
54
+    /**
55
+     * Event fired when the breakout rooms data was updated.
56
+     */
57
+    BREAKOUT_ROOMS_UPDATED = 'xmpp.breakout-rooms.updated',
58
+
15 59
     BRIDGE_DOWN = 'xmpp.bridge_down',
16 60
 
17 61
     /**
@@ -19,21 +63,26 @@ export enum XMPPEvents {
19 63
      */
20 64
     CALL_ACCEPTED = 'xmpp.callaccepted.jingle',
21 65
 
22
-    // Designates an event indicating that an offer (e.g. Jingle
23
-    // session-initiate) was received.
24
-    CALL_INCOMING = 'xmpp.callincoming.jingle',
25
-
26 66
     // Triggered when Jicofo kills our media session, this can happen while
27 67
     // we're still in the MUC, when it decides to terminate the media session.
28 68
     // For example when the session is idle for too long, because we're the only
29 69
     // person in the conference room.
30 70
     CALL_ENDED = 'xmpp.callended.jingle',
71
+
72
+    // Designates an event indicating that an offer (e.g. Jingle
73
+    // session-initiate) was received.
74
+    CALL_INCOMING = 'xmpp.callincoming.jingle',
75
+
31 76
     CHAT_ERROR_RECEIVED = 'xmpp.chat_error_received',
32
-    SETTINGS_ERROR_RECEIVED = 'xmpp.settings_error_received',
33 77
 
34 78
     // The conference properties (as advertised by jicofo) have changed
35 79
     CONFERENCE_PROPERTIES_CHANGED = 'xmpp.conference_properties_changed',
36 80
 
81
+    /**
82
+     * Event fired when conference creation timestamp is received.
83
+     */
84
+    CONFERENCE_TIMESTAMP_RECEIVED = 'xmpp.conference_timestamp_received',
85
+
37 86
     /**
38 87
      * This event is triggered when the ICE connects for the first time.
39 88
      */
@@ -43,22 +92,22 @@ export enum XMPPEvents {
43 92
     // failed.
44 93
     CONNECTION_FAILED = 'xmpp.connection.failed',
45 94
 
46
-    // Designates an event indicating that the media (ICE) connection was
47
-    // interrupted. This should go to the RTC module.
48
-    CONNECTION_INTERRUPTED = 'xmpp.connection.interrupted',
49
-
50
-    // Designates an event indicating that the media (ICE) connection was
51
-    // restored. This should go to the RTC module.
52
-    CONNECTION_RESTORED = 'xmpp.connection.restored',
53
-
54 95
     // Designates an event indicating that the media (ICE) connection failed.
55 96
     // This should go to the RTC module.
56 97
     CONNECTION_ICE_FAILED = 'xmpp.connection.ice.failed',
57 98
 
99
+    // Designates an event indicating that the media (ICE) connection was
100
+    // interrupted. This should go to the RTC module.
101
+    CONNECTION_INTERRUPTED = 'xmpp.connection.interrupted',
102
+
58 103
     // Designates an event indicating that the call has been migrated to a different
59 104
     // bridge and that the client needs to be restarted for a successful transition.
60 105
     CONNECTION_RESTARTED = 'xmpp.connection.restart',
61 106
 
107
+    // Designates an event indicating that the media (ICE) connection was
108
+    // restored. This should go to the RTC module.
109
+    CONNECTION_RESTORED = 'xmpp.connection.restored',
110
+
62 111
     /**
63 112
      * Designates an event indicating connection status changes.
64 113
      */
@@ -82,11 +131,30 @@ export enum XMPPEvents {
82 131
      * Chat room instance have been removed from Strophe.emuc plugin.
83 132
      */
84 133
     EMUC_ROOM_REMOVED = 'xmpp.emuc_room_removed',
134
+
85 135
     ETHERPAD = 'xmpp.etherpad',
136
+
86 137
     FOCUS_DISCONNECTED = 'xmpp.focus_disconnected',
138
+
87 139
     FOCUS_LEFT = 'xmpp.focus_left',
140
+
88 141
     GRACEFUL_SHUTDOWN = 'xmpp.graceful_shutdown',
89 142
 
143
+    // Designates an event indicating that the local ICE connection state has
144
+    // changed.
145
+    ICE_CONNECTION_STATE_CHANGED = 'xmpp.ice_connection_state_changed',
146
+
147
+    // Designates an event indicating that an invite XMPP message in the MUC was
148
+    // received.
149
+    INVITE_MESSAGE_RECEIVED = 'xmpp.invite_message_received',
150
+
151
+    /**
152
+     * Event which is emitted when the body in an XMPP message in the MUC
153
+     * contains JSON
154
+     * TODO: this event contains a typo (xmmp vs xmpp) but it's unlikely this can be changed now
155
+     */
156
+    JSON_MESSAGE_RECEIVED = 'xmmp.json_message_received',
157
+
90 158
     /**
91 159
      * Designates an event indicating that we were kicked from the XMPP MUC.
92 160
      * @param {boolean} isSelfPresence - whether it is for local participant
@@ -110,54 +178,29 @@ export enum XMPPEvents {
110 178
     // received.
111 179
     MESSAGE_RECEIVED = 'xmpp.message_received',
112 180
 
113
-    // Designates an event indicating that a reaction XMPP message in the MUC
114
-    // was received.
115
-    REACTION_RECEIVED = "xmpp.reaction_received",
116
-
117
-    // Designates an event indicating that an invite XMPP message in the MUC was
118
-    // received.
119
-    INVITE_MESSAGE_RECEIVED = 'xmpp.invite_message_received',
120
-
121
-    // Designates an event indicating that a private XMPP message in the MUC was
122
-    // received.
123
-    PRIVATE_MESSAGE_RECEIVED = 'xmpp.private_message_received',
124
-
125
-    // Designates an event indicating that a bot participant type had changed
126
-    MUC_MEMBER_BOT_TYPE_CHANGED = 'xmpp.muc_member_bot_type_changed',
181
+    // Designates an event indicating that a participant was denied access to a conference from the lobby XMPP MUC.
182
+    MUC_DENIED_ACCESS = 'xmpp.muc_denied access',
127 183
 
128 184
     // Designates an event indicating that the XMPP MUC was destroyed.
129 185
     MUC_DESTROYED = 'xmpp.muc_destroyed',
130 186
 
131
-    // Designates an event indicating that we are currently in process of joining the XMPP MUC.
132
-    MUC_JOIN_IN_PROGRESS = 'xmpp.muc_join_in_progress',
133
-
134 187
     // Designates an event indicating that we have joined the XMPP MUC.
135 188
     MUC_JOINED = 'xmpp.muc_joined',
136 189
 
137
-    // Designates an event indicating that a participant joined the XMPP MUC.
138
-    MUC_MEMBER_JOINED = 'xmpp.muc_member_joined',
190
+    // Designates an event indicating that we are currently in process of joining the XMPP MUC.
191
+    MUC_JOIN_IN_PROGRESS = 'xmpp.muc_join_in_progress',
139 192
 
140
-    // Designates an event indicating that a participant left the XMPP MUC.
141
-    MUC_MEMBER_LEFT = 'xmpp.muc_member_left',
193
+    // Designates an event indicating that local participant left the muc
194
+    MUC_LEFT = 'xmpp.muc_left',
142 195
 
143 196
     // Designates an event indicating that a participant joined the lobby XMPP MUC.
144 197
     MUC_LOBBY_MEMBER_JOINED = 'xmpp.muc_lobby_member_joined',
145 198
 
146
-    // Designates an event indicating that a participant in the lobby XMPP MUC has been updated
147
-    MUC_LOBBY_MEMBER_UPDATED = 'xmpp.muc_lobby_member_updated',
148
-
149 199
     // Designates an event indicating that a participant left the XMPP MUC.
150 200
     MUC_LOBBY_MEMBER_LEFT = 'xmpp.muc_lobby_member_left',
151 201
 
152
-    // Designates an event indicating that a participant was denied access to a conference from the lobby XMPP MUC.
153
-    MUC_DENIED_ACCESS = 'xmpp.muc_denied access',
154
-
155
-    // Designates an event indicating that local participant left the muc
156
-    MUC_LEFT = 'xmpp.muc_left',
157
-
158
-    // Designates an event indicating that the MUC role of a participant has
159
-    // changed.
160
-    MUC_ROLE_CHANGED = 'xmpp.muc_role_changed',
202
+    // Designates an event indicating that a participant in the lobby XMPP MUC has been updated
203
+    MUC_LOBBY_MEMBER_UPDATED = 'xmpp.muc_lobby_member_updated',
161 204
 
162 205
     // Designates an event indicating that the MUC has been locked or unlocked.
163 206
     MUC_LOCK_CHANGED = 'xmpp.muc_lock_changed',
@@ -165,6 +208,19 @@ export enum XMPPEvents {
165 208
     // Designates an event indicating that the MUC members only config has changed.
166 209
     MUC_MEMBERS_ONLY_CHANGED = 'xmpp.muc_members_only_changed',
167 210
 
211
+    // Designates an event indicating that a bot participant type had changed
212
+    MUC_MEMBER_BOT_TYPE_CHANGED = 'xmpp.muc_member_bot_type_changed',
213
+
214
+    // Designates an event indicating that a participant joined the XMPP MUC.
215
+    MUC_MEMBER_JOINED = 'xmpp.muc_member_joined',
216
+
217
+    // Designates an event indicating that a participant left the XMPP MUC.
218
+    MUC_MEMBER_LEFT = 'xmpp.muc_member_left',
219
+
220
+    // Designates an event indicating that the MUC role of a participant has
221
+    // changed.
222
+    MUC_ROLE_CHANGED = 'xmpp.muc_role_changed',
223
+
168 224
     // Designates an event indicating that the MUC visitors support has changed.
169 225
     MUC_VISITORS_SUPPORTED_CHANGED = 'xmpp.muc_visitors_supported_changed',
170 226
 
@@ -172,6 +228,11 @@ export enum XMPPEvents {
172 228
     // advertised that they have audio muted (or unmuted).
173 229
     PARTICIPANT_AUDIO_MUTED = 'xmpp.audio_muted',
174 230
 
231
+    /**
232
+     * Indicates that the features of the participant has been changed.
233
+     */
234
+    PARTICIPANT_FEATURES_CHANGED = 'xmpp.participant_features_changed',
235
+
175 236
     // Designates an event indicating that a participant in the XMPP MUC has
176 237
     // advertised that they have video muted (or unmuted).
177 238
     PARTICIPANT_VIDEO_MUTED = 'xmpp.video_muted',
@@ -182,10 +243,6 @@ export enum XMPPEvents {
182 243
     // someone (regardless of whether or not the "video type" changed).
183 244
     PARTICIPANT_VIDEO_TYPE_CHANGED = 'xmpp.video_type',
184 245
 
185
-    /**
186
-     * Indicates that the features of the participant has been changed.
187
-     */
188
-    PARTICIPANT_FEATURES_CHANGED = 'xmpp.participant_features_changed',
189 246
     PASSWORD_REQUIRED = 'xmpp.password_required',
190 247
 
191 248
     /**
@@ -194,8 +251,16 @@ export enum XMPPEvents {
194 251
     PHONE_NUMBER_CHANGED = 'conference.phoneNumberChanged',
195 252
     PRESENCE_RECEIVED = 'xmpp.presence_received',
196 253
     PRESENCE_STATUS = 'xmpp.presence_status',
254
+
255
+    // Designates an event indicating that a private XMPP message in the MUC was
256
+    // received.
257
+    PRIVATE_MESSAGE_RECEIVED = 'xmpp.private_message_received',
197 258
     PROMPT_FOR_LOGIN = 'xmpp.prompt_for_login',
198 259
 
260
+    // Designates an event indicating that a reaction XMPP message in the MUC
261
+    // was received.
262
+    REACTION_RECEIVED = 'xmpp.reaction_received',
263
+
199 264
     // xmpp is connected and obtained user media
200 265
     READY_TO_JOIN = 'xmpp.ready_to_join',
201 266
 
@@ -212,23 +277,39 @@ export enum XMPPEvents {
212 277
      * Indicates that the offer / answer renegotiation has failed.
213 278
      */
214 279
     RENEGOTIATION_FAILED = 'xmpp.renegotiation_failed',
280
+
215 281
     RESERVATION_ERROR = 'xmpp.room_reservation_error',
282
+
216 283
     ROOM_CONNECT_ERROR = 'xmpp.room_connect_error',
217
-    ROOM_CONNECT_NOT_ALLOWED_ERROR = 'xmpp.room_connect_error.not_allowed',
218
-    ROOM_JOIN_ERROR = 'xmpp.room_join_error',
284
+
219 285
     ROOM_CONNECT_MEMBERS_ONLY_ERROR = 'xmpp.room_connect_error.members_only',
220 286
 
287
+    ROOM_CONNECT_NOT_ALLOWED_ERROR = 'xmpp.room_connect_error.not_allowed',
288
+
289
+    ROOM_DISCO_INFO_FAILED = 'xmpp.room_disco_info_failed',
290
+
221 291
     /**
222 292
      * Indicates that we have received a reply to our disco-info request for the room.
223 293
      */
224 294
     ROOM_DISCO_INFO_UPDATED = 'xmpp.room_disco_info_updated',
225
-    ROOM_DISCO_INFO_FAILED = 'xmpp.room_disco_info_failed',
295
+
296
+    ROOM_JOIN_ERROR = 'xmpp.room_join_error',
226 297
 
227 298
     /**
228 299
      * Indicates that max users limit has been reached.
229 300
      */
230 301
     ROOM_MAX_USERS_ERROR = 'xmpp.room_max_users_error',
231 302
 
303
+    /**
304
+     * Event fired when we receive a message related to room metadata.
305
+     */
306
+    ROOM_METADATA_EVENT = 'xmpp.room-metadata.event',
307
+
308
+    /**
309
+     * Event fired when we receive a message related to room metadata.
310
+     */
311
+    ROOM_METADATA_UPDATED = 'xmpp.room-metadata.updated',
312
+
232 313
     // Designates an event indicating that we sent an XMPP message to the MUC.
233 314
     SENDING_CHAT_MESSAGE = 'xmpp.sending_chat_message',
234 315
 
@@ -258,6 +339,8 @@ export enum XMPPEvents {
258 339
      */
259 340
     SESSION_ACCEPT_TIMEOUT = 'xmpp.session_accept_timeout',
260 341
 
342
+    SETTINGS_ERROR_RECEIVED = 'xmpp.settings_error_received',
343
+
261 344
     /**
262 345
      * Event fired when participant joins a meeting without audio.
263 346
      */
@@ -288,66 +371,6 @@ export enum XMPPEvents {
288 371
      */
289 372
     SPEAKER_STATS_RECEIVED = 'xmpp.speaker_stats_received',
290 373
 
291
-    /**
292
-     * Event fired when conference creation timestamp is received.
293
-     */
294
-    CONFERENCE_TIMESTAMP_RECEIVED = 'xmpp.conference_timestamp_received',
295
-
296
-    /**
297
-     * Event fired when we receive a message for AV moderation approved for the local participant.
298
-     */
299
-    AV_MODERATION_APPROVED = 'xmpp.av_moderation.approved',
300
-
301
-    /**
302
-    * Event fired when we receive a message for AV moderation rejected for the local participant.
303
-    */
304
-    AV_MODERATION_REJECTED = 'xmpp.av_moderation.rejected',
305
-
306
-    /**
307
-     * Event fired when we receive a message for AV moderation.
308
-     */
309
-    AV_MODERATION_RECEIVED = 'xmpp.av_moderation.received',
310
-
311
-    /**
312
-     * Event fired when the moderation enable/disable changes.
313
-     */
314
-    AV_MODERATION_CHANGED = 'xmpp.av_moderation.changed',
315
-
316
-    /**
317
-     * Event fired when we receive message that a new jid was approved.
318
-     */
319
-    AV_MODERATION_PARTICIPANT_APPROVED = 'xmpp.av_moderation.participant.approved',
320
-
321
-    /**
322
-     * Event fired when we receive message that a new jid was approved.
323
-     */
324
-    AV_MODERATION_PARTICIPANT_REJECTED = 'xmpp.av_moderation.participant.rejected',
325
-
326
-    /**
327
-     * Event fired when a participant is requested to join a given (breakout) room.
328
-     */
329
-    BREAKOUT_ROOMS_MOVE_TO_ROOM = 'xmpp.breakout-rooms.move-to-room',
330
-
331
-    /**
332
-     * Event fired when we receive a message for breakout rooms.
333
-     */
334
-    BREAKOUT_ROOMS_EVENT = 'xmpp.breakout-rooms.event',
335
-
336
-    /**
337
-     * Event fired when the breakout rooms data was updated.
338
-     */
339
-    BREAKOUT_ROOMS_UPDATED = 'xmpp.breakout-rooms.updated',
340
-
341
-    /**
342
-     * Event fired when we receive a message related to room metadata.
343
-     */
344
-    ROOM_METADATA_EVENT = 'xmpp.room-metadata.event',
345
-
346
-    /**
347
-     * Event fired when we receive a message related to room metadata.
348
-     */
349
-    ROOM_METADATA_UPDATED = 'xmpp.room-metadata.updated',
350
-
351 374
     // Designates an event indicating that we should join the conference with
352 375
     // audio and/or video muted.
353 376
     START_MUTED_FROM_FOCUS = 'xmpp.start_muted_from_focus',
@@ -373,6 +396,10 @@ export enum XMPPEvents {
373 396
      */
374 397
     TRANSPORT_INFO = 'xmpp.transportinfo.jingle',
375 398
 
399
+    // Designates an event indicating that the focus has asked us to disable our
400
+    // camera.
401
+    VIDEO_MUTED_BY_FOCUS = 'xmpp.video_muted_by_focus',
402
+
376 403
     /**
377 404
      * Indicates that video SIP GW state changed.
378 405
      *
@@ -401,14 +428,4 @@ export enum XMPPEvents {
401 428
      */
402 429
     VISITORS_REJECTION = 'xmpp.visitors_rejection',
403 430
 
404
-    // Designates an event indicating that the local ICE connection state has
405
-    // changed.
406
-    ICE_CONNECTION_STATE_CHANGED = 'xmpp.ice_connection_state_changed',
407
-
408
-    /**
409
-     * Event which is emitted when the body in an XMPP message in the MUC
410
-     * contains JSON
411
-     * TODO: this event contains a typo (xmmp vs xmpp) but it's unlikely this can be changed now
412
-     */
413
-    JSON_MESSAGE_RECEIVED = 'xmmp.json_message_received'
414
-};
431
+}

+ 7
- 6
service/xmpp/XMPPExtensioProtocols.ts Переглянути файл

@@ -1,5 +1,6 @@
1 1
 
2 2
 export enum XEP {
3
+
3 4
     /**
4 5
      * XEP-0338 - Signals the usage of bundled media, i.e., allows the use of a single set of ICE candidates for
5 6
      * multiple media descriptions.
@@ -42,12 +43,6 @@ export enum XEP {
42 43
      */
43 44
     RTP_FEEDBACK = 'urn:xmpp:jingle:apps:rtp:rtcp-fb:0',
44 45
 
45
-    /**
46
-     * XEP-0167 - Signals support for RTP video.
47
-     * https://xmpp.org/extensions/xep-0167.html#support
48
-     */
49
-    RTP_VIDEO = 'urn:xmpp:jingle:apps:rtp:video',
50
-
51 46
     /**
52 47
      * XEP-0294 - Signals the use of RTP Header Extensions.
53 48
      * https://xmpp.org/extensions/xep-0294.html
@@ -60,6 +55,12 @@ export enum XEP {
60 55
      */
61 56
     RTP_MEDIA = 'urn:xmpp:jingle:apps:rtp:1',
62 57
 
58
+    /**
59
+     * XEP-0167 - Signals support for RTP video.
60
+     * https://xmpp.org/extensions/xep-0167.html#support
61
+     */
62
+    RTP_VIDEO = 'urn:xmpp:jingle:apps:rtp:video',
63
+
63 64
     /**
64 65
      * XEP-0343 - Signaling WebRTC datachannels (bridge channel) in Jingle that uses DTLS/SCTP on top of ICE.
65 66
      * https://xmpp.org/extensions/xep-0343.html

+ 3
- 5
webpack.config.js Переглянути файл

@@ -10,16 +10,14 @@ module.exports = (_env, argv) => {
10 10
         = sharedConfig(mode === 'production' /* minimize */, Boolean(process.env.ANALYZE_BUNDLE) /* analyzeBundle */);
11 11
 
12 12
     return [
13
-        Object.assign({}, config, {
13
+        { ...config,
14 14
             entry: {
15 15
                 'lib-jitsi-meet': './index.js'
16 16
             },
17
-            output: Object.assign({}, config.output, {
17
+            output: { ...config.output,
18 18
                 library: 'JitsiMeetJS',
19 19
                 libraryTarget: 'umd',
20
-                path: path.join(process.cwd(), 'dist', 'umd')
21
-            })
22
-        }),
20
+                path: path.join(process.cwd(), 'dist', 'umd') } },
23 21
         {
24 22
             entry: {
25 23
                 worker: './modules/e2ee/Worker.js'

Завантаження…
Відмінити
Зберегти