@webex/plugin-meetings 2.35.2 → 2.35.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/common/browser-detection.js.map +1 -1
- package/dist/common/collection.js.map +1 -1
- package/dist/common/config.js.map +1 -1
- package/dist/common/errors/captcha-error.js +7 -0
- package/dist/common/errors/captcha-error.js.map +1 -1
- package/dist/common/errors/intent-to-join.js +8 -0
- package/dist/common/errors/intent-to-join.js.map +1 -1
- package/dist/common/errors/join-meeting.js +8 -0
- package/dist/common/errors/join-meeting.js.map +1 -1
- package/dist/common/errors/media.js +7 -0
- package/dist/common/errors/media.js.map +1 -1
- package/dist/common/errors/parameter.js.map +1 -1
- package/dist/common/errors/password-error.js +7 -0
- package/dist/common/errors/password-error.js.map +1 -1
- package/dist/common/errors/permission.js +7 -0
- package/dist/common/errors/permission.js.map +1 -1
- package/dist/common/errors/reconnection-in-progress.js.map +1 -1
- package/dist/common/errors/reconnection.js +7 -0
- package/dist/common/errors/reconnection.js.map +1 -1
- package/dist/common/errors/stats.js +7 -0
- package/dist/common/errors/stats.js.map +1 -1
- package/dist/common/errors/webex-errors.js.map +1 -1
- package/dist/common/errors/webex-meetings-error.js +5 -2
- package/dist/common/errors/webex-meetings-error.js.map +1 -1
- package/dist/common/events/events-scope.js.map +1 -1
- package/dist/common/events/events.js.map +1 -1
- package/dist/common/events/trigger-proxy.js.map +1 -1
- package/dist/common/events/util.js.map +1 -1
- package/dist/common/logs/logger-config.js.map +1 -1
- package/dist/common/logs/logger-proxy.js.map +1 -1
- package/dist/common/logs/request.js +3 -0
- package/dist/common/logs/request.js.map +1 -1
- package/dist/common/queue.js.map +1 -1
- package/dist/config.js.map +1 -1
- package/dist/constants.js.map +1 -1
- package/dist/locus-info/controlsUtils.js.map +1 -1
- package/dist/locus-info/embeddedAppsUtils.js.map +1 -1
- package/dist/locus-info/fullState.js.map +1 -1
- package/dist/locus-info/hostUtils.js.map +1 -1
- package/dist/locus-info/index.js +43 -5
- package/dist/locus-info/index.js.map +1 -1
- package/dist/locus-info/infoUtils.js.map +1 -1
- package/dist/locus-info/mediaSharesUtils.js.map +1 -1
- package/dist/locus-info/parser.js +12 -3
- package/dist/locus-info/parser.js.map +1 -1
- package/dist/locus-info/selfUtils.js.map +1 -1
- package/dist/media/index.js.map +1 -1
- package/dist/media/properties.js +12 -0
- package/dist/media/properties.js.map +1 -1
- package/dist/media/util.js.map +1 -1
- package/dist/mediaQualityMetrics/config.js.map +1 -1
- package/dist/meeting/effectsState.js +8 -1
- package/dist/meeting/effectsState.js.map +1 -1
- package/dist/meeting/index.js +151 -32
- package/dist/meeting/index.js.map +1 -1
- package/dist/meeting/muteState.js +6 -0
- package/dist/meeting/muteState.js.map +1 -1
- package/dist/meeting/request.js +54 -24
- package/dist/meeting/request.js.map +1 -1
- package/dist/meeting/state.js.map +1 -1
- package/dist/meeting/util.js.map +1 -1
- package/dist/meeting-info/collection.js +4 -1
- package/dist/meeting-info/collection.js.map +1 -1
- package/dist/meeting-info/index.js +5 -0
- package/dist/meeting-info/index.js.map +1 -1
- package/dist/meeting-info/meeting-info-v2.js +14 -2
- package/dist/meeting-info/meeting-info-v2.js.map +1 -1
- package/dist/meeting-info/request.js +3 -0
- package/dist/meeting-info/request.js.map +1 -1
- package/dist/meeting-info/util.js.map +1 -1
- package/dist/meeting-info/utilv2.js.map +1 -1
- package/dist/meetings/collection.js +4 -1
- package/dist/meetings/collection.js.map +1 -1
- package/dist/meetings/index.js +72 -20
- package/dist/meetings/index.js.map +1 -1
- package/dist/meetings/request.js +4 -0
- package/dist/meetings/request.js.map +1 -1
- package/dist/meetings/util.js.map +1 -1
- package/dist/member/index.js +30 -7
- package/dist/member/index.js.map +1 -1
- package/dist/member/util.js +2 -1
- package/dist/member/util.js.map +1 -1
- package/dist/members/collection.js +1 -0
- package/dist/members/collection.js.map +1 -1
- package/dist/members/index.js +12 -1
- package/dist/members/index.js.map +1 -1
- package/dist/members/request.js +19 -9
- package/dist/members/request.js.map +1 -1
- package/dist/members/util.js.map +1 -1
- package/dist/metrics/config.js.map +1 -1
- package/dist/metrics/constants.js.map +1 -1
- package/dist/metrics/index.js +8 -0
- package/dist/metrics/index.js.map +1 -1
- package/dist/networkQualityMonitor/index.js +10 -2
- package/dist/networkQualityMonitor/index.js.map +1 -1
- package/dist/peer-connection-manager/index.js +11 -4
- package/dist/peer-connection-manager/index.js.map +1 -1
- package/dist/personal-meeting-room/index.js +11 -0
- package/dist/personal-meeting-room/index.js.map +1 -1
- package/dist/personal-meeting-room/request.js +2 -1
- package/dist/personal-meeting-room/request.js.map +1 -1
- package/dist/personal-meeting-room/util.js.map +1 -1
- package/dist/reachability/index.js +17 -7
- package/dist/reachability/index.js.map +1 -1
- package/dist/reachability/request.js +1 -0
- package/dist/reachability/request.js.map +1 -1
- package/dist/reconnection-manager/index.js +21 -2
- package/dist/reconnection-manager/index.js.map +1 -1
- package/dist/roap/collection.js +1 -0
- package/dist/roap/collection.js.map +1 -1
- package/dist/roap/handler.js +14 -2
- package/dist/roap/handler.js.map +1 -1
- package/dist/roap/index.js +11 -1
- package/dist/roap/index.js.map +1 -1
- package/dist/roap/request.js +7 -2
- package/dist/roap/request.js.map +1 -1
- package/dist/roap/state.js.map +1 -1
- package/dist/roap/turnDiscovery.js +9 -1
- package/dist/roap/turnDiscovery.js.map +1 -1
- package/dist/roap/util.js.map +1 -1
- package/dist/statsAnalyzer/global.js.map +1 -1
- package/dist/statsAnalyzer/index.js +19 -1
- package/dist/statsAnalyzer/index.js.map +1 -1
- package/dist/statsAnalyzer/mqaUtil.js +9 -3
- package/dist/statsAnalyzer/mqaUtil.js.map +1 -1
- package/dist/transcription/index.js +10 -3
- package/dist/transcription/index.js.map +1 -1
- package/package.json +19 -19
- package/src/common/{browser-detection.js → browser-detection.ts} +1 -1
- package/src/common/collection.ts +6 -6
- package/src/common/{config.js → config.ts} +1 -1
- package/src/common/errors/{captcha-error.js → captcha-error.ts} +5 -1
- package/src/common/errors/{intent-to-join.js → intent-to-join.ts} +6 -1
- package/src/common/errors/{join-meeting.js → join-meeting.ts} +6 -1
- package/src/common/errors/{media.js → media.ts} +5 -1
- package/src/common/errors/parameter.ts +3 -2
- package/src/common/errors/{password-error.js → password-error.ts} +5 -1
- package/src/common/errors/{permission.js → permission.ts} +5 -1
- package/src/common/errors/{reconnection-in-progress.js → reconnection-in-progress.ts} +0 -0
- package/src/common/errors/{reconnection.js → reconnection.ts} +5 -1
- package/src/common/errors/{stats.js → stats.ts} +5 -1
- package/src/common/errors/{webex-errors.js → webex-errors.ts} +1 -2
- package/src/common/errors/{webex-meetings-error.js → webex-meetings-error.ts} +3 -1
- package/src/common/events/{events-scope.js → events-scope.ts} +1 -1
- package/src/common/events/{events.js → events.ts} +0 -0
- package/src/common/events/{trigger-proxy.js → trigger-proxy.ts} +1 -2
- package/src/common/events/{util.js → util.ts} +1 -1
- package/src/common/logs/{logger-config.js → logger-config.ts} +1 -2
- package/src/common/logs/{logger-proxy.js → logger-proxy.ts} +1 -1
- package/src/common/logs/{request.js → request.ts} +12 -2
- package/src/common/queue.ts +1 -2
- package/src/{config.js → config.ts} +1 -0
- package/src/constants.ts +1 -0
- package/src/locus-info/{controlsUtils.js → controlsUtils.ts} +4 -4
- package/src/locus-info/{embeddedAppsUtils.js → embeddedAppsUtils.ts} +5 -6
- package/src/locus-info/{fullState.js → fullState.ts} +1 -1
- package/src/locus-info/{hostUtils.js → hostUtils.ts} +5 -5
- package/src/locus-info/{index.js → index.ts} +67 -32
- package/src/locus-info/{infoUtils.js → infoUtils.ts} +3 -4
- package/src/locus-info/{mediaSharesUtils.js → mediaSharesUtils.ts} +13 -13
- package/src/locus-info/{parser.js → parser.ts} +22 -12
- package/src/locus-info/{selfUtils.js → selfUtils.ts} +17 -19
- package/src/media/{index.js → index.ts} +108 -39
- package/src/media/{properties.js → properties.ts} +16 -4
- package/src/media/{util.js → util.ts} +2 -3
- package/src/mediaQualityMetrics/{config.js → config.ts} +1 -1
- package/src/meeting/{effectsState.js → effectsState.ts} +12 -6
- package/src/meeting/{index.js → index.ts} +323 -147
- package/src/meeting/{muteState.js → muteState.ts} +16 -11
- package/src/meeting/{request.js → request.ts} +124 -36
- package/src/meeting/{state.js → state.ts} +6 -6
- package/src/meeting/{util.js → util.ts} +4 -4
- package/src/meeting-info/{collection.js → collection.ts} +4 -1
- package/src/meeting-info/{index.js → index.ts} +10 -6
- package/src/meeting-info/{meeting-info-v2.js → meeting-info-v2.ts} +28 -10
- package/src/meeting-info/{request.js → request.ts} +6 -2
- package/src/meeting-info/{util.js → util.ts} +6 -5
- package/src/meeting-info/{utilv2.js → utilv2.ts} +8 -7
- package/src/meetings/{collection.js → collection.ts} +5 -2
- package/src/meetings/{index.js → index.ts} +88 -22
- package/src/meetings/{request.js → request.ts} +6 -1
- package/src/meetings/{util.js → util.ts} +5 -3
- package/src/member/{index.js → index.ts} +46 -15
- package/src/member/{util.js → util.ts} +17 -16
- package/src/members/{collection.js → collection.ts} +2 -1
- package/src/members/{index.js → index.ts} +39 -26
- package/src/members/{request.js → request.ts} +16 -5
- package/src/members/{util.js → util.ts} +7 -7
- package/src/metrics/{config.js → config.ts} +0 -2
- package/src/metrics/{constants.js → constants.ts} +0 -0
- package/src/metrics/{index.js → index.ts} +27 -8
- package/src/networkQualityMonitor/{index.js → index.ts} +18 -3
- package/src/peer-connection-manager/{index.js → index.ts} +72 -28
- package/src/personal-meeting-room/{index.js → index.ts} +17 -4
- package/src/personal-meeting-room/{request.js → request.ts} +3 -1
- package/src/personal-meeting-room/{util.js → util.ts} +1 -1
- package/src/reachability/{index.js → index.ts} +28 -17
- package/src/reachability/request.ts +4 -2
- package/src/reconnection-manager/{index.js → index.ts} +42 -13
- package/src/roap/{collection.js → collection.ts} +1 -0
- package/src/roap/{handler.js → handler.ts} +15 -4
- package/src/roap/{index.js → index.ts} +23 -10
- package/src/roap/{request.js → request.ts} +19 -3
- package/src/roap/{state.js → state.ts} +3 -2
- package/src/roap/turnDiscovery.ts +14 -5
- package/src/roap/{util.js → util.ts} +1 -2
- package/src/statsAnalyzer/{global.js → global.ts} +0 -0
- package/src/statsAnalyzer/{index.js → index.ts} +36 -17
- package/src/statsAnalyzer/{mqaUtil.js → mqaUtil.ts} +6 -1
- package/src/transcription/{index.js → index.ts} +16 -11
- package/test/integration/spec/space-meeting.js +1 -2
- package/test/unit/spec/roap/util.js +1 -1
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
const HostUtils = {};
|
|
1
|
+
const HostUtils: any = {};
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* parse the relevant host values that we care about: id
|
|
5
5
|
* @param {Object} host
|
|
6
6
|
* @returns {Object} parsed host or null if host was undefined
|
|
7
7
|
*/
|
|
8
|
-
HostUtils.parse = (host) => {
|
|
8
|
+
HostUtils.parse = (host: object) => {
|
|
9
9
|
if (host) {
|
|
10
10
|
return {
|
|
11
11
|
hostId: HostUtils.getId(host)
|
|
@@ -22,7 +22,7 @@ HostUtils.parse = (host) => {
|
|
|
22
22
|
* @returns {Object}
|
|
23
23
|
* previous: {Object} old host, current: {Object} new host, updates: {isNewHost: {boolean}} boolean update values
|
|
24
24
|
*/
|
|
25
|
-
HostUtils.getHosts = (oldHost, newHost) => {
|
|
25
|
+
HostUtils.getHosts = (oldHost: object, newHost: object) => {
|
|
26
26
|
const previous = oldHost && HostUtils.parse(oldHost);
|
|
27
27
|
const current = newHost && HostUtils.parse(newHost);
|
|
28
28
|
|
|
@@ -41,14 +41,14 @@ HostUtils.getHosts = (oldHost, newHost) => {
|
|
|
41
41
|
* @param {String} currentId
|
|
42
42
|
* @returns {Boolean}
|
|
43
43
|
*/
|
|
44
|
-
HostUtils.isDifferentHosts = (previousId, currentId) => previousId !== currentId;
|
|
44
|
+
HostUtils.isDifferentHosts = (previousId: string, currentId: string) => previousId !== currentId;
|
|
45
45
|
|
|
46
46
|
/**
|
|
47
47
|
* Extract the id from the host object
|
|
48
48
|
* @param {Object} host
|
|
49
49
|
* @returns {String}
|
|
50
50
|
*/
|
|
51
|
-
HostUtils.getId = (host) => {
|
|
51
|
+
HostUtils.getId = (host: any) => {
|
|
52
52
|
if (!host) {
|
|
53
53
|
return null;
|
|
54
54
|
}
|
|
@@ -35,6 +35,34 @@ import LocusDeltaParser from '../locus-info/parser';
|
|
|
35
35
|
* @class LocusInfo
|
|
36
36
|
*/
|
|
37
37
|
export default class LocusInfo extends EventsScope {
|
|
38
|
+
compareAndUpdateFlags: any;
|
|
39
|
+
emitChange: any;
|
|
40
|
+
locusParser: any;
|
|
41
|
+
meetingId: any;
|
|
42
|
+
parsedLocus: any;
|
|
43
|
+
updateMeeting: any;
|
|
44
|
+
webex: any;
|
|
45
|
+
aclUrl: any;
|
|
46
|
+
baseSequence: any;
|
|
47
|
+
created: any;
|
|
48
|
+
deltaParticipants: any;
|
|
49
|
+
identities: any;
|
|
50
|
+
membership: any;
|
|
51
|
+
participants: any;
|
|
52
|
+
participantsUrl: any;
|
|
53
|
+
replaces: any;
|
|
54
|
+
scheduledMeeting: any;
|
|
55
|
+
sequence: any;
|
|
56
|
+
controls: any;
|
|
57
|
+
conversationUrl: any;
|
|
58
|
+
embeddedApps: any;
|
|
59
|
+
fullState: any;
|
|
60
|
+
host: any;
|
|
61
|
+
info: any;
|
|
62
|
+
mediaShares: any;
|
|
63
|
+
replace: any;
|
|
64
|
+
url: any;
|
|
65
|
+
|
|
38
66
|
constructor(updateMeeting, webex, meetingId) {
|
|
39
67
|
super();
|
|
40
68
|
this.parsedLocus = {
|
|
@@ -55,7 +83,7 @@ export default class LocusInfo extends EventsScope {
|
|
|
55
83
|
* @param {Meeting} meeting
|
|
56
84
|
* @returns {undefined}
|
|
57
85
|
*/
|
|
58
|
-
applyLocusDeltaData(action, locus, meeting) {
|
|
86
|
+
applyLocusDeltaData(action: string, locus: any, meeting: any) {
|
|
59
87
|
const {DESYNC, USE_CURRENT, USE_INCOMING} = LocusDeltaParser.loci;
|
|
60
88
|
|
|
61
89
|
switch (action) {
|
|
@@ -94,7 +122,7 @@ export default class LocusInfo extends EventsScope {
|
|
|
94
122
|
* @param {Meeting} meeting
|
|
95
123
|
* @returns {undefined}
|
|
96
124
|
*/
|
|
97
|
-
handleLocusDelta(locus, meeting) {
|
|
125
|
+
handleLocusDelta(locus: any, meeting: any) {
|
|
98
126
|
// register a function to process delta actions
|
|
99
127
|
if (!this.locusParser.onDeltaAction) {
|
|
100
128
|
// delta action, along with associated loci
|
|
@@ -112,7 +140,7 @@ export default class LocusInfo extends EventsScope {
|
|
|
112
140
|
* @returns {undefined}
|
|
113
141
|
* @memberof LocusInfo
|
|
114
142
|
*/
|
|
115
|
-
init(locus = {}) {
|
|
143
|
+
init(locus: any = {}) {
|
|
116
144
|
this.created = locus.created || null;
|
|
117
145
|
this.scheduledMeeting = locus.meeting || null;
|
|
118
146
|
this.participantsUrl = locus.participantsUrl || null;
|
|
@@ -164,7 +192,7 @@ export default class LocusInfo extends EventsScope {
|
|
|
164
192
|
* @returns {undefined}
|
|
165
193
|
* @memberof LocusInfo
|
|
166
194
|
*/
|
|
167
|
-
initialSetup(locus) {
|
|
195
|
+
initialSetup(locus: object) {
|
|
168
196
|
this.onFullLocus(locus);
|
|
169
197
|
|
|
170
198
|
// Change it to true after it receives it first locus object
|
|
@@ -177,7 +205,7 @@ export default class LocusInfo extends EventsScope {
|
|
|
177
205
|
* @returns {undefined}
|
|
178
206
|
* @memberof LocusInfo
|
|
179
207
|
*/
|
|
180
|
-
parse(meeting, data) {
|
|
208
|
+
parse(meeting: any, data: any) {
|
|
181
209
|
const {eventType} = data;
|
|
182
210
|
|
|
183
211
|
LoggerProxy.logger.info(`Locus-info:index#parse --> received locus data: ${eventType}`);
|
|
@@ -217,18 +245,18 @@ export default class LocusInfo extends EventsScope {
|
|
|
217
245
|
* @returns {undefined}
|
|
218
246
|
* @memberof LocusInfo
|
|
219
247
|
*/
|
|
220
|
-
emitScoped(scope, eventName, args) {
|
|
248
|
+
emitScoped(scope?: any, eventName?: string, args?: any) {
|
|
221
249
|
return this.emit(scope, eventName, args);
|
|
222
250
|
}
|
|
223
251
|
|
|
224
252
|
/**
|
|
225
253
|
* updates the locus with full locus object
|
|
226
254
|
* @param {object} locus locus object
|
|
227
|
-
* @param {
|
|
255
|
+
* @param {string} eventType particulat locus event
|
|
228
256
|
* @returns {object} null
|
|
229
257
|
* @memberof LocusInfo
|
|
230
258
|
*/
|
|
231
|
-
onFullLocus(locus, eventType) {
|
|
259
|
+
onFullLocus(locus: any, eventType?: string) {
|
|
232
260
|
if (!locus) {
|
|
233
261
|
LoggerProxy.logger.error(
|
|
234
262
|
'Locus-info:index#onFullLocus --> object passed as argument was invalid, continuing.'
|
|
@@ -252,7 +280,7 @@ export default class LocusInfo extends EventsScope {
|
|
|
252
280
|
* @returns {undefined}
|
|
253
281
|
* @memberof LocusInfo
|
|
254
282
|
*/
|
|
255
|
-
handleOneOnOneEvent(eventType) {
|
|
283
|
+
handleOneOnOneEvent(eventType: string) {
|
|
256
284
|
if (
|
|
257
285
|
this.parsedLocus.fullState.type === _CALL_ ||
|
|
258
286
|
this.parsedLocus.fullState.type === _SIP_BRIDGE_
|
|
@@ -295,7 +323,7 @@ export default class LocusInfo extends EventsScope {
|
|
|
295
323
|
* @returns {undefined}
|
|
296
324
|
* @memberof LocusInfo
|
|
297
325
|
*/
|
|
298
|
-
onDeltaLocus(locus) {
|
|
326
|
+
onDeltaLocus(locus: any) {
|
|
299
327
|
this.updateLocusInfo(locus);
|
|
300
328
|
this.updateParticipants(locus.participants);
|
|
301
329
|
this.isMeetingActive();
|
|
@@ -306,7 +334,7 @@ export default class LocusInfo extends EventsScope {
|
|
|
306
334
|
* @returns {undefined}
|
|
307
335
|
* @memberof LocusInfo
|
|
308
336
|
*/
|
|
309
|
-
updateLocusInfo(locus) {
|
|
337
|
+
updateLocusInfo(locus: any) {
|
|
310
338
|
this.updateControls(locus.controls);
|
|
311
339
|
this.updateConversationUrl(locus.conversationUrl, locus.info);
|
|
312
340
|
this.updateCreated(locus.created);
|
|
@@ -334,7 +362,7 @@ export default class LocusInfo extends EventsScope {
|
|
|
334
362
|
* @returns {Array}
|
|
335
363
|
* @memberof LocusInfo
|
|
336
364
|
*/
|
|
337
|
-
getLocusPartner(participants
|
|
365
|
+
getLocusPartner(participants: Array<any>, self: any) {
|
|
338
366
|
if (!participants || participants.length === 0) {
|
|
339
367
|
return null;
|
|
340
368
|
}
|
|
@@ -345,6 +373,7 @@ export default class LocusInfo extends EventsScope {
|
|
|
345
373
|
self &&
|
|
346
374
|
participant.identity !== self.identity &&
|
|
347
375
|
(participants.length <= 2 || (participant.type === _USER_ && !participant.removed))
|
|
376
|
+
// @ts-ignore
|
|
348
377
|
) || this.partner
|
|
349
378
|
);
|
|
350
379
|
}
|
|
@@ -359,6 +388,7 @@ export default class LocusInfo extends EventsScope {
|
|
|
359
388
|
this.parsedLocus.fullState.type === _CALL_ ||
|
|
360
389
|
this.parsedLocus.fullState.type === _SIP_BRIDGE_
|
|
361
390
|
) {
|
|
391
|
+
// @ts-ignore
|
|
362
392
|
const partner = this.getLocusPartner(this.participants, this.self);
|
|
363
393
|
|
|
364
394
|
this.updateMeeting({partner});
|
|
@@ -444,6 +474,7 @@ export default class LocusInfo extends EventsScope {
|
|
|
444
474
|
if (
|
|
445
475
|
this.fullState &&
|
|
446
476
|
(this.fullState.state === LOCUS.STATE.INACTIVE ||
|
|
477
|
+
// @ts-ignore
|
|
447
478
|
this.fullState.state === LOCUS.STATE.TERMINATING)
|
|
448
479
|
) {
|
|
449
480
|
LoggerProxy.logger.warn(
|
|
@@ -565,13 +596,13 @@ export default class LocusInfo extends EventsScope {
|
|
|
565
596
|
* @param {Array} [participants] - The participants to update against.
|
|
566
597
|
* @returns {void}
|
|
567
598
|
*/
|
|
568
|
-
updateParticipantDeltas(participants = []) {
|
|
599
|
+
updateParticipantDeltas(participants: Array<any> = []) {
|
|
569
600
|
// Used to find a participant within a participants collection.
|
|
570
601
|
const findParticipant = (participant, collection) =>
|
|
571
602
|
collection.find((item) => item.person.id === participant.person.id);
|
|
572
603
|
|
|
573
604
|
// Generates an object that indicates which state properties have changed.
|
|
574
|
-
const generateDelta = (prevState = {}, newState = {}) => {
|
|
605
|
+
const generateDelta = (prevState: any = {}, newState: any = {}) => {
|
|
575
606
|
// Setup deltas.
|
|
576
607
|
const deltas = {
|
|
577
608
|
audioStatus: prevState.audioStatus !== newState.audioStatus,
|
|
@@ -614,7 +645,7 @@ export default class LocusInfo extends EventsScope {
|
|
|
614
645
|
* @returns {Array} updatedParticipants
|
|
615
646
|
* @memberof LocusInfo
|
|
616
647
|
*/
|
|
617
|
-
updateParticipants(participants) {
|
|
648
|
+
updateParticipants(participants: object) {
|
|
618
649
|
this.emitScoped(
|
|
619
650
|
{
|
|
620
651
|
file: 'locus-info',
|
|
@@ -636,7 +667,7 @@ export default class LocusInfo extends EventsScope {
|
|
|
636
667
|
* @returns {undefined}
|
|
637
668
|
* @memberof LocusInfo
|
|
638
669
|
*/
|
|
639
|
-
updateControls(controls) {
|
|
670
|
+
updateControls(controls: object) {
|
|
640
671
|
if (controls && !isEqual(this.controls, controls)) {
|
|
641
672
|
this.parsedLocus.controls = ControlsUtils.parse(controls);
|
|
642
673
|
const {
|
|
@@ -738,7 +769,7 @@ export default class LocusInfo extends EventsScope {
|
|
|
738
769
|
* @returns {undefined}
|
|
739
770
|
* @memberof LocusInfo
|
|
740
771
|
*/
|
|
741
|
-
updateConversationUrl(conversationUrl, info) {
|
|
772
|
+
updateConversationUrl(conversationUrl: string, info: any) {
|
|
742
773
|
if (conversationUrl && !isEqual(this.conversationUrl, conversationUrl)) {
|
|
743
774
|
this.conversationUrl = conversationUrl;
|
|
744
775
|
this.updateMeeting({conversationUrl});
|
|
@@ -758,7 +789,7 @@ export default class LocusInfo extends EventsScope {
|
|
|
758
789
|
* @returns {undefined}
|
|
759
790
|
* @memberof LocusInfo
|
|
760
791
|
*/
|
|
761
|
-
updateCreated(created) {
|
|
792
|
+
updateCreated(created: object) {
|
|
762
793
|
if (created && !isEqual(this.created, created)) {
|
|
763
794
|
this.created = created;
|
|
764
795
|
}
|
|
@@ -769,7 +800,7 @@ export default class LocusInfo extends EventsScope {
|
|
|
769
800
|
* @returns {undefined}
|
|
770
801
|
* @memberof LocusInfo
|
|
771
802
|
*/
|
|
772
|
-
updateFullState(fullState) {
|
|
803
|
+
updateFullState(fullState: object) {
|
|
773
804
|
if (fullState && !isEqual(this.fullState, fullState)) {
|
|
774
805
|
const result = FullState.getFullState(this.fullState, fullState);
|
|
775
806
|
|
|
@@ -813,7 +844,7 @@ export default class LocusInfo extends EventsScope {
|
|
|
813
844
|
* @memberof LocusInfo
|
|
814
845
|
* emits internal event locus_info_update_host
|
|
815
846
|
*/
|
|
816
|
-
updateHostInfo(host) {
|
|
847
|
+
updateHostInfo(host: object) {
|
|
817
848
|
if (host && !isEqual(this.host, host)) {
|
|
818
849
|
const parsedHosts = HostUtils.getHosts(this.host, host);
|
|
819
850
|
|
|
@@ -846,7 +877,7 @@ export default class LocusInfo extends EventsScope {
|
|
|
846
877
|
* @returns {undefined}
|
|
847
878
|
* @memberof LocusInfo
|
|
848
879
|
*/
|
|
849
|
-
updateMeetingInfo(info, self) {
|
|
880
|
+
updateMeetingInfo(info: object, self?: object) {
|
|
850
881
|
if (info && !isEqual(this.info, info)) {
|
|
851
882
|
const roles = self ? SelfUtils.getRoles(self) : this.parsedLocus.self?.roles || [];
|
|
852
883
|
const isJoined = SelfUtils.isJoined(self || this.parsedLocus.self);
|
|
@@ -894,7 +925,7 @@ export default class LocusInfo extends EventsScope {
|
|
|
894
925
|
* @returns {undefined}
|
|
895
926
|
* @memberof LocusInfo
|
|
896
927
|
*/
|
|
897
|
-
updateEmbeddedApps(embeddedApps) {
|
|
928
|
+
updateEmbeddedApps(embeddedApps: object) {
|
|
898
929
|
// don't do anything if the arrays of apps haven't changed significantly
|
|
899
930
|
if (EmbeddedAppsUtils.areSimilar(this.embeddedApps, embeddedApps)) {
|
|
900
931
|
return;
|
|
@@ -922,7 +953,7 @@ export default class LocusInfo extends EventsScope {
|
|
|
922
953
|
* @memberof LocusInfo
|
|
923
954
|
* emits internal event locus_info_update_media_shares
|
|
924
955
|
*/
|
|
925
|
-
updateMediaShares(mediaShares) {
|
|
956
|
+
updateMediaShares(mediaShares: object) {
|
|
926
957
|
if (mediaShares && !isEqual(this.mediaShares, mediaShares)) {
|
|
927
958
|
const parsedMediaShares = MediaSharesUtils.getMediaShares(this.mediaShares, mediaShares);
|
|
928
959
|
|
|
@@ -948,7 +979,7 @@ export default class LocusInfo extends EventsScope {
|
|
|
948
979
|
* @returns {undefined}
|
|
949
980
|
* @memberof LocusInfo
|
|
950
981
|
*/
|
|
951
|
-
updateParticipantsUrl(participantsUrl) {
|
|
982
|
+
updateParticipantsUrl(participantsUrl: string) {
|
|
952
983
|
if (participantsUrl && !isEqual(this.participantsUrl, participantsUrl)) {
|
|
953
984
|
this.participantsUrl = participantsUrl;
|
|
954
985
|
}
|
|
@@ -959,7 +990,7 @@ export default class LocusInfo extends EventsScope {
|
|
|
959
990
|
* @returns {undefined}
|
|
960
991
|
* @memberof LocusInfo
|
|
961
992
|
*/
|
|
962
|
-
updateReplace(replace) {
|
|
993
|
+
updateReplace(replace: object) {
|
|
963
994
|
if (replace && !isEqual(this.replace, replace)) {
|
|
964
995
|
this.replace = replace;
|
|
965
996
|
}
|
|
@@ -973,8 +1004,10 @@ export default class LocusInfo extends EventsScope {
|
|
|
973
1004
|
* @memberof LocusInfo
|
|
974
1005
|
* emits internal events self_admitted_guest, self_unadmitted_guest, locus_info_update_self
|
|
975
1006
|
*/
|
|
976
|
-
updateSelf(self, participants) {
|
|
1007
|
+
updateSelf(self: any, participants: Array<any>) {
|
|
1008
|
+
// @ts-ignore - check where this.self come from
|
|
977
1009
|
if (self && !isEqual(this.self, self)) {
|
|
1010
|
+
// @ts-ignore
|
|
978
1011
|
const parsedSelves = SelfUtils.getSelves(this.self, self, this.webex.internal.device.url);
|
|
979
1012
|
|
|
980
1013
|
this.updateMeeting(parsedSelves.current);
|
|
@@ -1100,6 +1133,7 @@ export default class LocusInfo extends EventsScope {
|
|
|
1100
1133
|
file: 'locus-info',
|
|
1101
1134
|
function: 'updateSelf',
|
|
1102
1135
|
},
|
|
1136
|
+
// @ts-ignore
|
|
1103
1137
|
LOCUSINFO.EVENTS.MEDIA_INACTIVITY,
|
|
1104
1138
|
SelfUtils.getMediaStatus(self.mediaSessions)
|
|
1105
1139
|
);
|
|
@@ -1168,6 +1202,7 @@ export default class LocusInfo extends EventsScope {
|
|
|
1168
1202
|
}
|
|
1169
1203
|
);
|
|
1170
1204
|
this.parsedLocus.self = parsedSelves.current;
|
|
1205
|
+
// @ts-ignore
|
|
1171
1206
|
this.self = self;
|
|
1172
1207
|
}
|
|
1173
1208
|
else {
|
|
@@ -1181,7 +1216,7 @@ export default class LocusInfo extends EventsScope {
|
|
|
1181
1216
|
* @returns {undefined}
|
|
1182
1217
|
* emits internal event locus_info_update_url
|
|
1183
1218
|
*/
|
|
1184
|
-
updateLocusUrl(url) {
|
|
1219
|
+
updateLocusUrl(url: string) {
|
|
1185
1220
|
if (url && this.url !== url) {
|
|
1186
1221
|
this.url = url;
|
|
1187
1222
|
this.updateMeeting({locusUrl: url});
|
|
@@ -1201,7 +1236,7 @@ export default class LocusInfo extends EventsScope {
|
|
|
1201
1236
|
* @returns {undefined}
|
|
1202
1237
|
* @memberof LocusInfo
|
|
1203
1238
|
*/
|
|
1204
|
-
updateAclUrl(aclUrl) {
|
|
1239
|
+
updateAclUrl(aclUrl: string) {
|
|
1205
1240
|
if (aclUrl && !isEqual(this.aclUrl, aclUrl)) {
|
|
1206
1241
|
this.aclUrl = aclUrl;
|
|
1207
1242
|
}
|
|
@@ -1212,7 +1247,7 @@ export default class LocusInfo extends EventsScope {
|
|
|
1212
1247
|
* @returns {undefined}
|
|
1213
1248
|
* @memberof LocusInfo
|
|
1214
1249
|
*/
|
|
1215
|
-
updateBasequence(baseSequence) {
|
|
1250
|
+
updateBasequence(baseSequence: number) {
|
|
1216
1251
|
if (baseSequence && !isEqual(this.baseSequence, baseSequence)) {
|
|
1217
1252
|
this.baseSequence = baseSequence;
|
|
1218
1253
|
}
|
|
@@ -1223,7 +1258,7 @@ export default class LocusInfo extends EventsScope {
|
|
|
1223
1258
|
* @returns {undefined}
|
|
1224
1259
|
* @memberof LocusInfo
|
|
1225
1260
|
*/
|
|
1226
|
-
updateSequence(sequence) {
|
|
1261
|
+
updateSequence(sequence: number) {
|
|
1227
1262
|
if (sequence && !isEqual(this.sequence, sequence)) {
|
|
1228
1263
|
this.sequence = sequence;
|
|
1229
1264
|
}
|
|
@@ -1234,7 +1269,7 @@ export default class LocusInfo extends EventsScope {
|
|
|
1234
1269
|
* @returns {undefined}
|
|
1235
1270
|
* @memberof LocusInfo
|
|
1236
1271
|
*/
|
|
1237
|
-
updateMemberShip(membership) {
|
|
1272
|
+
updateMemberShip(membership: object) {
|
|
1238
1273
|
if (membership && !isEqual(this.membership, membership)) {
|
|
1239
1274
|
this.membership = membership;
|
|
1240
1275
|
}
|
|
@@ -1245,7 +1280,7 @@ export default class LocusInfo extends EventsScope {
|
|
|
1245
1280
|
* @returns {undefined}
|
|
1246
1281
|
* @memberof LocusInfo
|
|
1247
1282
|
*/
|
|
1248
|
-
updateIdentifiers(identities) {
|
|
1283
|
+
updateIdentifiers(identities: Array<any>) {
|
|
1249
1284
|
if (identities && !isEqual(this.identities, identities)) {
|
|
1250
1285
|
this.identities = identities;
|
|
1251
1286
|
}
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
|
|
2
1
|
import {SELF_ROLES, DISPLAY_HINTS} from '../constants';
|
|
3
2
|
|
|
4
|
-
const InfoUtils = {};
|
|
3
|
+
const InfoUtils: any = {};
|
|
5
4
|
|
|
6
5
|
InfoUtils.parse = (info, roles, isJoined = true) => {
|
|
7
|
-
const parsed = {
|
|
6
|
+
const parsed: any = {
|
|
8
7
|
policy: InfoUtils.parsePolicy(info),
|
|
9
8
|
moderator: InfoUtils.parseModerator(info),
|
|
10
9
|
coHost: InfoUtils.parseCoHost(info),
|
|
@@ -70,7 +69,7 @@ InfoUtils.getInfos = (oldInfo, newInfo, roles, isJoined) => {
|
|
|
70
69
|
previous = oldInfo;
|
|
71
70
|
}
|
|
72
71
|
const current = newInfo && InfoUtils.parse(newInfo, roles, isJoined);
|
|
73
|
-
const updates = {};
|
|
72
|
+
const updates: any = {};
|
|
74
73
|
|
|
75
74
|
if (current) {
|
|
76
75
|
current.isLocked = InfoUtils.isLocked(current.policy);
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import {CONTENT, WHITEBOARD} from '../constants';
|
|
2
2
|
|
|
3
|
-
const MediaSharesUtils = {};
|
|
3
|
+
const MediaSharesUtils: any = {};
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* parses the relevant values for mediaShares: contentId, disposition
|
|
7
7
|
* @param {Object} mediaShares
|
|
8
8
|
* @returns {undefined}
|
|
9
9
|
*/
|
|
10
|
-
MediaSharesUtils.parse = (mediaShares) => {
|
|
10
|
+
MediaSharesUtils.parse = (mediaShares: object) => {
|
|
11
11
|
if (mediaShares) {
|
|
12
12
|
return {
|
|
13
13
|
content: {
|
|
@@ -32,7 +32,7 @@ MediaSharesUtils.parse = (mediaShares) => {
|
|
|
32
32
|
* @returns {Object}
|
|
33
33
|
* previous: {Object} old share, current: {Object} new share,
|
|
34
34
|
*/
|
|
35
|
-
MediaSharesUtils.getMediaShares = (oldShare, newShare) => {
|
|
35
|
+
MediaSharesUtils.getMediaShares = (oldShare: object, newShare: object) => {
|
|
36
36
|
const previous = oldShare && MediaSharesUtils.parse(oldShare);
|
|
37
37
|
const current = newShare && MediaSharesUtils.parse(newShare);
|
|
38
38
|
|
|
@@ -47,7 +47,7 @@ MediaSharesUtils.getMediaShares = (oldShare, newShare) => {
|
|
|
47
47
|
* @param {Object} mediaShares
|
|
48
48
|
* @returns {Boolean} disposition
|
|
49
49
|
*/
|
|
50
|
-
MediaSharesUtils.getContentDisposition = (mediaShares) => {
|
|
50
|
+
MediaSharesUtils.getContentDisposition = (mediaShares: object) => {
|
|
51
51
|
const contentFloor = MediaSharesUtils.extractContentFloor(mediaShares);
|
|
52
52
|
|
|
53
53
|
return contentFloor ? contentFloor.disposition : null;
|
|
@@ -58,7 +58,7 @@ MediaSharesUtils.getContentDisposition = (mediaShares) => {
|
|
|
58
58
|
* @param {Object} mediaShares
|
|
59
59
|
* @returns {Boolean} disposition
|
|
60
60
|
*/
|
|
61
|
-
MediaSharesUtils.getWhiteboardDisposition = (mediaShares) => {
|
|
61
|
+
MediaSharesUtils.getWhiteboardDisposition = (mediaShares: object) => {
|
|
62
62
|
const whiteboardFloor = MediaSharesUtils.extractWhiteboardFloor(mediaShares);
|
|
63
63
|
|
|
64
64
|
return whiteboardFloor ? whiteboardFloor.disposition : null;
|
|
@@ -69,7 +69,7 @@ MediaSharesUtils.getWhiteboardDisposition = (mediaShares) => {
|
|
|
69
69
|
* @param {Object} mediaShares
|
|
70
70
|
* @returns {Object}
|
|
71
71
|
*/
|
|
72
|
-
MediaSharesUtils.extractContent = (mediaShares) => {
|
|
72
|
+
MediaSharesUtils.extractContent = (mediaShares: any) => {
|
|
73
73
|
if (!mediaShares || !mediaShares.length) {
|
|
74
74
|
return null;
|
|
75
75
|
}
|
|
@@ -82,7 +82,7 @@ MediaSharesUtils.extractContent = (mediaShares) => {
|
|
|
82
82
|
* @param {Object} mediaShares
|
|
83
83
|
* @returns {Object}
|
|
84
84
|
*/
|
|
85
|
-
MediaSharesUtils.extractWhiteboard = (mediaShares) => {
|
|
85
|
+
MediaSharesUtils.extractWhiteboard = (mediaShares: any) => {
|
|
86
86
|
if (!mediaShares || !mediaShares.length) {
|
|
87
87
|
return null;
|
|
88
88
|
}
|
|
@@ -95,7 +95,7 @@ MediaSharesUtils.extractWhiteboard = (mediaShares) => {
|
|
|
95
95
|
* @param {Object} mediaStream
|
|
96
96
|
* @returns {Object}
|
|
97
97
|
*/
|
|
98
|
-
MediaSharesUtils.extractFloor = (mediaStream) => {
|
|
98
|
+
MediaSharesUtils.extractFloor = (mediaStream: any) => {
|
|
99
99
|
if (!mediaStream) {
|
|
100
100
|
return null;
|
|
101
101
|
}
|
|
@@ -108,7 +108,7 @@ MediaSharesUtils.extractFloor = (mediaStream) => {
|
|
|
108
108
|
* @param {Object} mediaShares
|
|
109
109
|
* @returns {Object}
|
|
110
110
|
*/
|
|
111
|
-
MediaSharesUtils.extractContentFloor = (mediaShares) => {
|
|
111
|
+
MediaSharesUtils.extractContentFloor = (mediaShares: object) => {
|
|
112
112
|
const content = MediaSharesUtils.extractContent(mediaShares);
|
|
113
113
|
|
|
114
114
|
return MediaSharesUtils.extractFloor(content);
|
|
@@ -119,7 +119,7 @@ MediaSharesUtils.extractContentFloor = (mediaShares) => {
|
|
|
119
119
|
* @param {Object} mediaShares
|
|
120
120
|
* @returns {Object}
|
|
121
121
|
*/
|
|
122
|
-
MediaSharesUtils.extractWhiteboardFloor = (mediaShares) => {
|
|
122
|
+
MediaSharesUtils.extractWhiteboardFloor = (mediaShares: object) => {
|
|
123
123
|
const whiteboard = MediaSharesUtils.extractWhiteboard(mediaShares);
|
|
124
124
|
|
|
125
125
|
return MediaSharesUtils.extractFloor(whiteboard);
|
|
@@ -130,7 +130,7 @@ MediaSharesUtils.extractWhiteboardFloor = (mediaShares) => {
|
|
|
130
130
|
* @param {Object} mediaShares
|
|
131
131
|
* @returns {Object}
|
|
132
132
|
*/
|
|
133
|
-
MediaSharesUtils.getContentBeneficiaryId = (mediaShares) => {
|
|
133
|
+
MediaSharesUtils.getContentBeneficiaryId = (mediaShares: object) => {
|
|
134
134
|
const contentFloor = MediaSharesUtils.extractContentFloor(mediaShares);
|
|
135
135
|
|
|
136
136
|
if (!contentFloor || !contentFloor.beneficiary) {
|
|
@@ -145,7 +145,7 @@ MediaSharesUtils.getContentBeneficiaryId = (mediaShares) => {
|
|
|
145
145
|
* @param {Object} mediaShares
|
|
146
146
|
* @returns {Object}
|
|
147
147
|
*/
|
|
148
|
-
MediaSharesUtils.getWhiteboardBeneficiaryId = (mediaShares) => {
|
|
148
|
+
MediaSharesUtils.getWhiteboardBeneficiaryId = (mediaShares: object) => {
|
|
149
149
|
const whiteboardFloor = MediaSharesUtils.extractWhiteboardFloor(mediaShares);
|
|
150
150
|
|
|
151
151
|
if (!whiteboardFloor || !whiteboardFloor.beneficiary) {
|
|
@@ -160,7 +160,7 @@ MediaSharesUtils.getWhiteboardBeneficiaryId = (mediaShares) => {
|
|
|
160
160
|
* @param {Object} mediaShares
|
|
161
161
|
* @returns {Object}
|
|
162
162
|
*/
|
|
163
|
-
MediaSharesUtils.getWhiteboardResourceUrl = (mediaShares) => {
|
|
163
|
+
MediaSharesUtils.getWhiteboardResourceUrl = (mediaShares: object) => {
|
|
164
164
|
const whiteboard = MediaSharesUtils.extractWhiteboard(mediaShares);
|
|
165
165
|
|
|
166
166
|
if (!whiteboard || !whiteboard.resourceUrl) {
|
|
@@ -27,12 +27,15 @@ export default class Parser {
|
|
|
27
27
|
ERROR: 'ERROR'
|
|
28
28
|
};
|
|
29
29
|
|
|
30
|
+
queue: any;
|
|
31
|
+
workingCopy: any;
|
|
30
32
|
|
|
31
33
|
/**
|
|
32
34
|
* @constructs Parser
|
|
33
35
|
*/
|
|
34
36
|
constructor() {
|
|
35
37
|
this.queue = new SimpleQueue();
|
|
38
|
+
// @ts-ignore - This is declared as static class member and again being initialized here from same
|
|
36
39
|
this.status = Parser.status.IDLE;
|
|
37
40
|
this.onDeltaAction = null;
|
|
38
41
|
this.workingCopy = null;
|
|
@@ -214,7 +217,7 @@ export default class Parser {
|
|
|
214
217
|
* @private
|
|
215
218
|
* @returns {string} loci comparison state
|
|
216
219
|
*/
|
|
217
|
-
static compareDelta(current, incoming) {
|
|
220
|
+
private static compareDelta(current, incoming) {
|
|
218
221
|
const {
|
|
219
222
|
LT, GT, EQ, DESYNC, USE_INCOMING
|
|
220
223
|
} = Parser.loci;
|
|
@@ -255,8 +258,8 @@ export default class Parser {
|
|
|
255
258
|
// Locus sequence comparison rules in order of priority.
|
|
256
259
|
// https://sqbu-github.cisco.com/WebExSquared/cloud-apps/wiki/Locus-Sequence-Comparison-Algorithm
|
|
257
260
|
|
|
258
|
-
const local = Parser.getMetaData(current);
|
|
259
|
-
const delta = Parser.getMetaData(incoming);
|
|
261
|
+
const local: any = Parser.getMetaData(current);
|
|
262
|
+
const delta: any = Parser.getMetaData(incoming);
|
|
260
263
|
|
|
261
264
|
// update loci metadata
|
|
262
265
|
local.unique = Parser.getUniqueSequences(local, delta);
|
|
@@ -293,7 +296,7 @@ export default class Parser {
|
|
|
293
296
|
* @param {string} result
|
|
294
297
|
* @returns {string} Locus comparison action
|
|
295
298
|
*/
|
|
296
|
-
static compareToAction(result) {
|
|
299
|
+
static compareToAction(result: string) {
|
|
297
300
|
const {
|
|
298
301
|
DESYNC, EQ, ERROR, GT, LT, USE_CURRENT, USE_INCOMING
|
|
299
302
|
} = Parser.loci;
|
|
@@ -324,7 +327,7 @@ export default class Parser {
|
|
|
324
327
|
* @param {string} lociComparisonResult Comparison result with extra data
|
|
325
328
|
* @returns {string} Comparison of EQ, LT, GT, or DESYNC.
|
|
326
329
|
*/
|
|
327
|
-
static extractComparisonState(lociComparisonResult) {
|
|
330
|
+
static extractComparisonState(lociComparisonResult: string) {
|
|
328
331
|
return lociComparisonResult.split(':')[0];
|
|
329
332
|
}
|
|
330
333
|
|
|
@@ -345,7 +348,7 @@ export default class Parser {
|
|
|
345
348
|
* @param {Array.<number>} sequence Locus delta sequence
|
|
346
349
|
* @returns {LociMetadata} Locus Delta Metadata
|
|
347
350
|
*/
|
|
348
|
-
static getMetaData(sequence) {
|
|
351
|
+
static getMetaData(sequence: any) {
|
|
349
352
|
const {entries} = sequence;
|
|
350
353
|
const first = entries[0];
|
|
351
354
|
const last = entries.slice(-1)[0];
|
|
@@ -377,8 +380,8 @@ export default class Parser {
|
|
|
377
380
|
* @param {LociMetadata} otherLoci
|
|
378
381
|
* @returns {Array.<number>} List of unique sequences
|
|
379
382
|
*/
|
|
380
|
-
static getUniqueSequences(baseLoci, otherLoci) {
|
|
381
|
-
const diff = difference(
|
|
383
|
+
static getUniqueSequences(baseLoci: any, otherLoci: any) {
|
|
384
|
+
const diff: any = difference(
|
|
382
385
|
baseLoci.entries,
|
|
383
386
|
otherLoci.entries
|
|
384
387
|
);
|
|
@@ -395,7 +398,7 @@ export default class Parser {
|
|
|
395
398
|
* @param {number} rangeEnd End of range
|
|
396
399
|
* @returns {Array.<number>} Array of numbers sorted ASC
|
|
397
400
|
*/
|
|
398
|
-
static getNumbersOutOfRange(list
|
|
401
|
+
static getNumbersOutOfRange(list: Array<number>, rangeStart: number, rangeEnd: number) {
|
|
399
402
|
// Collect all numbers if number is outside of specified range
|
|
400
403
|
const output = list.filter((num) => num < rangeStart || num > rangeEnd);
|
|
401
404
|
|
|
@@ -413,6 +416,7 @@ export default class Parser {
|
|
|
413
416
|
let isValid = false;
|
|
414
417
|
const {IDLE} = Parser.status;
|
|
415
418
|
const {isLoci} = Parser;
|
|
419
|
+
// @ts-ignore
|
|
416
420
|
const setStatus = (status) => { this.status = status; };
|
|
417
421
|
|
|
418
422
|
// one or both objects are not locus delta events
|
|
@@ -468,6 +472,7 @@ export default class Parser {
|
|
|
468
472
|
* @returns {undefined}
|
|
469
473
|
*/
|
|
470
474
|
nextEvent() {
|
|
475
|
+
// @ts-ignore
|
|
471
476
|
if (this.status === Parser.status.PAUSED) {
|
|
472
477
|
LoggerProxy.logger.info('Locus-info:parser#nextEvent --> Locus parser paused.');
|
|
473
478
|
|
|
@@ -479,6 +484,7 @@ export default class Parser {
|
|
|
479
484
|
this.processDeltaEvent();
|
|
480
485
|
}
|
|
481
486
|
else {
|
|
487
|
+
// @ts-ignore
|
|
482
488
|
this.status = Parser.status.IDLE;
|
|
483
489
|
}
|
|
484
490
|
}
|
|
@@ -492,7 +498,7 @@ export default class Parser {
|
|
|
492
498
|
* @returns {undefined}
|
|
493
499
|
*/
|
|
494
500
|
// eslint-disable-next-line no-unused-vars
|
|
495
|
-
onDeltaAction(action, locus) {}
|
|
501
|
+
onDeltaAction(action: string, locus) {}
|
|
496
502
|
|
|
497
503
|
|
|
498
504
|
/**
|
|
@@ -505,8 +511,10 @@ export default class Parser {
|
|
|
505
511
|
this.queue.enqueue(loci);
|
|
506
512
|
// start processing events in the queue if idle
|
|
507
513
|
// and a function handler is defined
|
|
514
|
+
// @ts-ignore
|
|
508
515
|
if (this.status === Parser.status.IDLE && this.onDeltaAction) {
|
|
509
516
|
// Update status, ensure we only process one event at a time.
|
|
517
|
+
// @ts-ignore
|
|
510
518
|
this.status = Parser.status.WORKING;
|
|
511
519
|
|
|
512
520
|
this.processDeltaEvent();
|
|
@@ -520,7 +528,7 @@ export default class Parser {
|
|
|
520
528
|
* @param {string} oldData
|
|
521
529
|
* @returns {string}
|
|
522
530
|
*/
|
|
523
|
-
static packComparisonResult(newData, oldData) {
|
|
531
|
+
static packComparisonResult(newData: string, oldData: string) {
|
|
524
532
|
return `${newData}:${oldData}`;
|
|
525
533
|
}
|
|
526
534
|
|
|
@@ -530,6 +538,7 @@ export default class Parser {
|
|
|
530
538
|
* @returns {undefined}
|
|
531
539
|
*/
|
|
532
540
|
pause() {
|
|
541
|
+
// @ts-ignore
|
|
533
542
|
this.status = Parser.status.PAUSED;
|
|
534
543
|
LoggerProxy.logger.info('Locus-info:parser#pause --> Locus parser paused.');
|
|
535
544
|
}
|
|
@@ -583,6 +592,7 @@ export default class Parser {
|
|
|
583
592
|
*/
|
|
584
593
|
resume() {
|
|
585
594
|
LoggerProxy.logger.info('Locus-info:parser#resume --> Locus parser resumed.');
|
|
595
|
+
// @ts-ignore
|
|
586
596
|
this.status = Parser.status.WORKING;
|
|
587
597
|
this.nextEvent();
|
|
588
598
|
}
|
|
@@ -594,7 +604,7 @@ export default class Parser {
|
|
|
594
604
|
* @param {string} comparison Locus comparison string
|
|
595
605
|
* @returns {object} Debug message
|
|
596
606
|
*/
|
|
597
|
-
static getDebugMessage(debugCode, comparison) {
|
|
607
|
+
static getDebugMessage(debugCode: string, comparison: string) {
|
|
598
608
|
// removes extra spaces from multiline string
|
|
599
609
|
const mStr = (strings) => strings.join('').replace(/\s{2,}/g, ' ');
|
|
600
610
|
|