@webex/plugin-meetings 3.0.0-beta.13 → 3.0.0-beta.15
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/UPGRADING.md +9 -9
- package/browsers.js +19 -24
- package/dist/common/browser-detection.js +1 -0
- package/dist/common/browser-detection.js.map +1 -1
- package/dist/common/collection.js.map +1 -1
- package/dist/common/errors/captcha-error.js +5 -5
- package/dist/common/errors/captcha-error.js.map +1 -1
- package/dist/common/errors/intent-to-join.js +5 -5
- package/dist/common/errors/intent-to-join.js.map +1 -1
- package/dist/common/errors/join-meeting.js +6 -6
- package/dist/common/errors/join-meeting.js.map +1 -1
- package/dist/common/errors/media.js +5 -5
- package/dist/common/errors/media.js.map +1 -1
- package/dist/common/errors/parameter.js +5 -5
- package/dist/common/errors/parameter.js.map +1 -1
- package/dist/common/errors/password-error.js +5 -5
- package/dist/common/errors/password-error.js.map +1 -1
- package/dist/common/errors/permission.js +4 -4
- package/dist/common/errors/permission.js.map +1 -1
- package/dist/common/errors/reconnection.js +5 -5
- package/dist/common/errors/reconnection.js.map +1 -1
- package/dist/common/errors/stats.js +5 -5
- 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.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-proxy.js.map +1 -1
- package/dist/common/logs/request.js.map +1 -1
- package/dist/config.js.map +1 -1
- package/dist/constants.js.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/locus-info/controlsUtils.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 +11 -8
- 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 +2 -1
- package/dist/locus-info/parser.js.map +1 -1
- package/dist/locus-info/selfUtils.js +2 -1
- package/dist/locus-info/selfUtils.js.map +1 -1
- package/dist/media/index.js.map +1 -1
- package/dist/media/internal-media-core-wrapper.js.map +1 -1
- package/dist/media/properties.js.map +1 -1
- package/dist/media/util.js +1 -1
- package/dist/media/util.js.map +1 -1
- package/dist/mediaQualityMetrics/config.js.map +1 -1
- package/dist/meeting/effectsState.js +1 -1
- package/dist/meeting/effectsState.js.map +1 -1
- package/dist/meeting/in-meeting-actions.js.map +1 -1
- package/dist/meeting/index.js +118 -89
- package/dist/meeting/index.js.map +1 -1
- package/dist/meeting/muteState.js +1 -1
- package/dist/meeting/muteState.js.map +1 -1
- package/dist/meeting/request.js +25 -0
- package/dist/meeting/request.js.map +1 -1
- package/dist/meeting/request.type.js +8 -0
- package/dist/meeting/request.type.js.map +1 -0
- package/dist/meeting/state.js +5 -5
- package/dist/meeting/state.js.map +1 -1
- package/dist/meeting/util.js.map +1 -1
- package/dist/meeting-info/collection.js.map +1 -1
- package/dist/meeting-info/index.js +2 -2
- package/dist/meeting-info/index.js.map +1 -1
- package/dist/meeting-info/meeting-info-v2.js +48 -48
- package/dist/meeting-info/meeting-info-v2.js.map +1 -1
- package/dist/meeting-info/request.js.map +1 -1
- package/dist/meeting-info/util.js.map +1 -1
- package/dist/meeting-info/utilv2.js +1 -1
- package/dist/meeting-info/utilv2.js.map +1 -1
- package/dist/meetings/collection.js.map +1 -1
- package/dist/meetings/index.js +251 -250
- package/dist/meetings/index.js.map +1 -1
- package/dist/meetings/request.js +2 -2
- package/dist/meetings/request.js.map +1 -1
- package/dist/meetings/util.js +14 -14
- package/dist/meetings/util.js.map +1 -1
- package/dist/member/index.js +31 -31
- package/dist/member/index.js.map +1 -1
- package/dist/member/util.js.map +1 -1
- package/dist/members/collection.js.map +1 -1
- package/dist/members/index.js +43 -43
- package/dist/members/index.js.map +1 -1
- 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 +23 -20
- package/dist/metrics/index.js.map +1 -1
- package/dist/multistream/multistreamMedia.js +2 -1
- package/dist/multistream/multistreamMedia.js.map +1 -1
- package/dist/multistream/receiveSlot.js.map +1 -1
- package/dist/multistream/receiveSlotManager.js +2 -0
- package/dist/multistream/receiveSlotManager.js.map +1 -1
- package/dist/multistream/remoteMedia.js.map +1 -1
- package/dist/multistream/remoteMediaGroup.js.map +1 -1
- package/dist/multistream/remoteMediaManager.js.map +1 -1
- package/dist/networkQualityMonitor/index.js +8 -8
- package/dist/networkQualityMonitor/index.js.map +1 -1
- package/dist/personal-meeting-room/index.js +7 -7
- package/dist/personal-meeting-room/index.js.map +1 -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.map +1 -1
- package/dist/reachability/request.js.map +1 -1
- package/dist/reactions/reactions.js.map +1 -1
- package/dist/reactions/reactions.type.js +3 -1
- package/dist/reactions/reactions.type.js.map +1 -1
- package/dist/reconnection-manager/index.js +4 -4
- package/dist/reconnection-manager/index.js.map +1 -1
- package/dist/roap/index.js +5 -5
- package/dist/roap/index.js.map +1 -1
- package/dist/roap/request.js.map +1 -1
- package/dist/roap/turnDiscovery.js.map +1 -1
- package/dist/statsAnalyzer/global.js.map +1 -1
- package/dist/statsAnalyzer/index.js.map +1 -1
- package/dist/statsAnalyzer/mqaUtil.js.map +1 -1
- package/dist/transcription/index.js +4 -1
- package/dist/transcription/index.js.map +1 -1
- package/internal-README.md +7 -6
- package/package.json +18 -18
- package/src/common/browser-detection.ts +9 -6
- package/src/common/collection.ts +3 -1
- package/src/common/errors/captcha-error.ts +6 -6
- package/src/common/errors/intent-to-join.ts +6 -6
- package/src/common/errors/join-meeting.ts +12 -8
- package/src/common/errors/media.ts +6 -6
- package/src/common/errors/parameter.ts +9 -6
- package/src/common/errors/password-error.ts +6 -6
- package/src/common/errors/permission.ts +5 -5
- package/src/common/errors/reconnection.ts +6 -6
- package/src/common/errors/stats.ts +6 -6
- package/src/common/errors/webex-errors.ts +7 -5
- package/src/common/errors/webex-meetings-error.ts +1 -1
- package/src/common/events/events-scope.ts +5 -1
- package/src/common/events/events.ts +5 -1
- package/src/common/events/trigger-proxy.ts +8 -3
- package/src/common/events/util.ts +1 -2
- package/src/common/logs/logger-proxy.ts +21 -10
- package/src/common/logs/request.ts +11 -8
- package/src/config.ts +11 -11
- package/src/constants.ts +1 -1
- package/src/index.js +1 -1
- package/src/locus-info/controlsUtils.ts +34 -24
- package/src/locus-info/fullState.ts +15 -11
- package/src/locus-info/hostUtils.ts +4 -3
- package/src/locus-info/index.ts +25 -34
- package/src/locus-info/infoUtils.ts +12 -4
- package/src/locus-info/mediaSharesUtils.ts +4 -4
- package/src/locus-info/parser.ts +45 -68
- package/src/locus-info/selfUtils.ts +106 -57
- package/src/media/index.ts +123 -135
- package/src/media/internal-media-core-wrapper.ts +2 -2
- package/src/media/properties.ts +30 -20
- package/src/media/util.ts +1 -1
- package/src/mediaQualityMetrics/config.ts +46 -46
- package/src/meeting/effectsState.ts +35 -35
- package/src/meeting/in-meeting-actions.ts +7 -3
- package/src/meeting/index.ts +1576 -1291
- package/src/meeting/muteState.ts +62 -31
- package/src/meeting/request.ts +174 -113
- package/src/meeting/request.type.ts +11 -0
- package/src/meeting/state.ts +45 -30
- package/src/meeting/util.ts +101 -70
- package/src/meeting-info/collection.ts +2 -1
- package/src/meeting-info/index.ts +32 -30
- package/src/meeting-info/meeting-info-v2.ts +106 -108
- package/src/meeting-info/request.ts +9 -3
- package/src/meeting-info/util.ts +54 -46
- package/src/meeting-info/utilv2.ts +59 -53
- package/src/meetings/collection.ts +1 -1
- package/src/meetings/index.ts +512 -440
- package/src/meetings/request.ts +26 -24
- package/src/meetings/util.ts +29 -29
- package/src/member/index.ts +55 -49
- package/src/member/util.ts +26 -13
- package/src/members/collection.ts +0 -1
- package/src/members/index.ts +182 -126
- package/src/members/request.ts +46 -14
- package/src/members/util.ts +44 -42
- package/src/metrics/config.ts +254 -81
- package/src/metrics/constants.ts +0 -2
- package/src/metrics/index.ts +84 -71
- package/src/multistream/multistreamMedia.ts +1 -0
- package/src/multistream/receiveSlot.ts +1 -0
- package/src/multistream/receiveSlotManager.ts +1 -0
- package/src/multistream/remoteMedia.ts +1 -1
- package/src/multistream/remoteMediaGroup.ts +2 -1
- package/src/multistream/remoteMediaManager.ts +3 -0
- package/src/networkQualityMonitor/index.ts +20 -23
- package/src/personal-meeting-room/index.ts +12 -16
- package/src/personal-meeting-room/request.ts +10 -3
- package/src/personal-meeting-room/util.ts +3 -3
- package/src/reachability/index.ts +61 -59
- package/src/reachability/request.ts +36 -32
- package/src/reactions/reactions.ts +4 -4
- package/src/reactions/reactions.type.ts +4 -3
- package/src/reconnection-manager/index.ts +139 -84
- package/src/roap/index.ts +46 -38
- package/src/roap/request.ts +44 -31
- package/src/roap/turnDiscovery.ts +59 -30
- package/src/statsAnalyzer/global.ts +30 -33
- package/src/statsAnalyzer/index.ts +432 -175
- package/src/statsAnalyzer/mqaUtil.ts +178 -72
- package/src/transcription/index.ts +34 -32
- package/test/integration/spec/journey.js +663 -462
- package/test/integration/spec/space-meeting.js +318 -203
- package/test/integration/spec/transcription.js +6 -7
- package/test/unit/spec/common/browser-detection.js +9 -28
- package/test/unit/spec/fixture/locus.js +92 -90
- package/test/unit/spec/locus-info/controlsUtils.js +5 -5
- package/test/unit/spec/locus-info/embeddedAppsUtils.js +8 -6
- package/test/unit/spec/locus-info/index.js +1 -2
- package/test/unit/spec/locus-info/infoUtils.js +26 -33
- package/test/unit/spec/locus-info/lib/BasicSeqCmp.json +88 -430
- package/test/unit/spec/locus-info/lib/SeqCmp.json +513 -685
- package/test/unit/spec/locus-info/parser.js +3 -9
- package/test/unit/spec/locus-info/selfConstant.js +72 -103
- package/test/unit/spec/locus-info/selfUtils.js +21 -12
- package/test/unit/spec/meeting/effectsState.js +36 -46
- package/test/unit/spec/meeting/in-meeting-actions.ts +2 -3
- package/test/unit/spec/meeting/index.js +1342 -684
- package/test/unit/spec/meeting/muteState.js +42 -33
- package/test/unit/spec/meeting/request.js +75 -45
- package/test/unit/spec/meeting/utils.js +78 -53
- package/test/unit/spec/meeting-info/meetinginfov2.js +100 -73
- package/test/unit/spec/meeting-info/request.js +7 -9
- package/test/unit/spec/meeting-info/util.js +11 -12
- package/test/unit/spec/meeting-info/utilv2.js +110 -74
- package/test/unit/spec/meetings/collection.js +1 -1
- package/test/unit/spec/meetings/index.js +438 -257
- package/test/unit/spec/meetings/utils.js +14 -12
- package/test/unit/spec/member/index.js +0 -1
- package/test/unit/spec/member/util.js +5 -6
- package/test/unit/spec/members/index.js +104 -54
- package/test/unit/spec/members/request.js +29 -20
- package/test/unit/spec/members/utils.js +8 -5
- package/test/unit/spec/metrics/index.js +16 -21
- package/test/unit/spec/networkQualityMonitor/index.js +21 -15
- package/test/unit/spec/personal-meeting-room/personal-meeting-room.js +2 -7
- package/test/unit/spec/reachability/index.ts +9 -11
- package/test/unit/spec/reconnection-manager/index.js +16 -18
- package/test/unit/spec/roap/turnDiscovery.ts +22 -19
- package/test/unit/spec/stats-analyzer/index.js +25 -20
- package/test/utils/cmr.js +44 -42
- package/test/utils/testUtils.js +83 -74
- package/test/utils/webex-config.js +18 -18
- package/test/utils/webex-test-users.js +53 -50
package/src/locus-info/parser.ts
CHANGED
|
@@ -13,7 +13,7 @@ export default class Parser {
|
|
|
13
13
|
static status = {
|
|
14
14
|
IDLE: 'IDLE',
|
|
15
15
|
PAUSED: 'PAUSED',
|
|
16
|
-
WORKING: 'WORKING'
|
|
16
|
+
WORKING: 'WORKING',
|
|
17
17
|
};
|
|
18
18
|
|
|
19
19
|
// loci comparison states
|
|
@@ -24,7 +24,7 @@ export default class Parser {
|
|
|
24
24
|
DESYNC: 'DESYNC',
|
|
25
25
|
USE_INCOMING: 'USE_INCOMING',
|
|
26
26
|
USE_CURRENT: 'USE_CURRENT',
|
|
27
|
-
ERROR: 'ERROR'
|
|
27
|
+
ERROR: 'ERROR',
|
|
28
28
|
};
|
|
29
29
|
|
|
30
30
|
queue: any;
|
|
@@ -41,7 +41,6 @@ export default class Parser {
|
|
|
41
41
|
this.workingCopy = null;
|
|
42
42
|
}
|
|
43
43
|
|
|
44
|
-
|
|
45
44
|
/**
|
|
46
45
|
* Checks if two sequences overlap in time,
|
|
47
46
|
* the sequence with the higher minimum value is greater.
|
|
@@ -68,7 +67,6 @@ export default class Parser {
|
|
|
68
67
|
return comparison;
|
|
69
68
|
}
|
|
70
69
|
|
|
71
|
-
|
|
72
70
|
/**
|
|
73
71
|
* Checks if two sequences have unequal ranges.
|
|
74
72
|
* Chooses sequence with most larger range.
|
|
@@ -94,8 +92,7 @@ export default class Parser {
|
|
|
94
92
|
else if (currentTotalRange < incomingTotalRange) {
|
|
95
93
|
// choose right side (incoming)
|
|
96
94
|
comparison = `${Parser.loci.LT}:UR002`;
|
|
97
|
-
}
|
|
98
|
-
else {
|
|
95
|
+
} else {
|
|
99
96
|
// with no unique entries and with ranges either absent or
|
|
100
97
|
// of the same size, the sequences are considered equal.
|
|
101
98
|
comparison = `${Parser.loci.EQ}:UR003`;
|
|
@@ -105,7 +102,6 @@ export default class Parser {
|
|
|
105
102
|
return comparison;
|
|
106
103
|
}
|
|
107
104
|
|
|
108
|
-
|
|
109
105
|
/**
|
|
110
106
|
* Checks if either sequences has unique entries.
|
|
111
107
|
* Entries are considered unique if they do not overlap
|
|
@@ -134,7 +130,6 @@ export default class Parser {
|
|
|
134
130
|
return comparison;
|
|
135
131
|
}
|
|
136
132
|
|
|
137
|
-
|
|
138
133
|
/**
|
|
139
134
|
* Checks both Locus Delta objects to see if they are
|
|
140
135
|
* out of sync with one another. If so sends a DESYNC
|
|
@@ -164,12 +159,10 @@ export default class Parser {
|
|
|
164
159
|
|
|
165
160
|
// send DESYNC to server
|
|
166
161
|
comparison = `${Parser.loci.DESYNC}:OOS001:${debugInfo}`;
|
|
167
|
-
}
|
|
168
|
-
else if (currentUniqueMin > incomingUniqueMin) {
|
|
162
|
+
} else if (currentUniqueMin > incomingUniqueMin) {
|
|
169
163
|
// choose left side (current)
|
|
170
164
|
comparison = `${Parser.loci.GT}:OOS002`;
|
|
171
|
-
}
|
|
172
|
-
else {
|
|
165
|
+
} else {
|
|
173
166
|
// choose right side (incoming)
|
|
174
167
|
comparison = `${Parser.loci.LT}:OOS003`;
|
|
175
168
|
}
|
|
@@ -177,7 +170,6 @@ export default class Parser {
|
|
|
177
170
|
return comparison;
|
|
178
171
|
}
|
|
179
172
|
|
|
180
|
-
|
|
181
173
|
/**
|
|
182
174
|
* Compares two loci to determine which one contains the most recent state
|
|
183
175
|
* @instance
|
|
@@ -191,7 +183,6 @@ export default class Parser {
|
|
|
191
183
|
const {extractComparisonState: extract} = Parser;
|
|
192
184
|
const {packComparisonResult: pack} = Parser;
|
|
193
185
|
|
|
194
|
-
|
|
195
186
|
if (isSequenceEmpty(current) || isSequenceEmpty(incoming)) {
|
|
196
187
|
return pack(Parser.loci.USE_INCOMING, 'C001');
|
|
197
188
|
}
|
|
@@ -206,7 +197,6 @@ export default class Parser {
|
|
|
206
197
|
return pack(action, result);
|
|
207
198
|
}
|
|
208
199
|
|
|
209
|
-
|
|
210
200
|
/**
|
|
211
201
|
* Compares two loci sequences (with delta params) and indicates what action
|
|
212
202
|
* to take.
|
|
@@ -218,16 +208,14 @@ export default class Parser {
|
|
|
218
208
|
* @returns {string} loci comparison state
|
|
219
209
|
*/
|
|
220
210
|
private static compareDelta(current, incoming) {
|
|
221
|
-
const {
|
|
222
|
-
|
|
223
|
-
} = Parser.loci;
|
|
211
|
+
const {LT, GT, EQ, DESYNC, USE_INCOMING} = Parser.loci;
|
|
212
|
+
|
|
224
213
|
const {extractComparisonState: extract} = Parser;
|
|
225
214
|
const {packComparisonResult: pack} = Parser;
|
|
226
215
|
|
|
227
216
|
const result = Parser.compareSequence(current.sequence, incoming.sequence);
|
|
228
217
|
let comparison = extract(result);
|
|
229
218
|
|
|
230
|
-
|
|
231
219
|
if (comparison !== LT) {
|
|
232
220
|
return pack(Parser.compareToAction(comparison), result);
|
|
233
221
|
}
|
|
@@ -247,7 +235,6 @@ export default class Parser {
|
|
|
247
235
|
return pack(comparison, result);
|
|
248
236
|
}
|
|
249
237
|
|
|
250
|
-
|
|
251
238
|
/**
|
|
252
239
|
* Compares Locus sequences
|
|
253
240
|
* @param {Types~Locus} current Current working copy
|
|
@@ -271,7 +258,7 @@ export default class Parser {
|
|
|
271
258
|
Parser.checkSequenceOverlap,
|
|
272
259
|
Parser.checkUnequalRanges,
|
|
273
260
|
Parser.checkForUniqueEntries,
|
|
274
|
-
Parser.checkIfOutOfSync
|
|
261
|
+
Parser.checkIfOutOfSync,
|
|
275
262
|
];
|
|
276
263
|
|
|
277
264
|
for (const rule of rules) {
|
|
@@ -290,16 +277,13 @@ export default class Parser {
|
|
|
290
277
|
return Parser.loci.ERROR;
|
|
291
278
|
}
|
|
292
279
|
|
|
293
|
-
|
|
294
280
|
/**
|
|
295
281
|
* Transates the result of a sequence comparison into an intended behavior
|
|
296
282
|
* @param {string} result
|
|
297
283
|
* @returns {string} Locus comparison action
|
|
298
284
|
*/
|
|
299
285
|
static compareToAction(result: string) {
|
|
300
|
-
const {
|
|
301
|
-
DESYNC, EQ, ERROR, GT, LT, USE_CURRENT, USE_INCOMING
|
|
302
|
-
} = Parser.loci;
|
|
286
|
+
const {DESYNC, EQ, ERROR, GT, LT, USE_CURRENT, USE_INCOMING} = Parser.loci;
|
|
303
287
|
|
|
304
288
|
let action = ERROR;
|
|
305
289
|
|
|
@@ -315,13 +299,14 @@ export default class Parser {
|
|
|
315
299
|
action = DESYNC;
|
|
316
300
|
break;
|
|
317
301
|
default:
|
|
318
|
-
LoggerProxy.logger.info(
|
|
302
|
+
LoggerProxy.logger.info(
|
|
303
|
+
`Locus-info:parser#compareToAction --> Error: ${result} is not a recognized sequence comparison result.`
|
|
304
|
+
);
|
|
319
305
|
}
|
|
320
306
|
|
|
321
307
|
return action;
|
|
322
308
|
}
|
|
323
309
|
|
|
324
|
-
|
|
325
310
|
/**
|
|
326
311
|
* Extracts a loci comparison from a string of data.
|
|
327
312
|
* @param {string} lociComparisonResult Comparison result with extra data
|
|
@@ -331,7 +316,6 @@ export default class Parser {
|
|
|
331
316
|
return lociComparisonResult.split(':')[0];
|
|
332
317
|
}
|
|
333
318
|
|
|
334
|
-
|
|
335
319
|
/**
|
|
336
320
|
* @typedef {object} LociMetadata
|
|
337
321
|
* @property {number} start - Starting sequence number
|
|
@@ -368,11 +352,10 @@ export default class Parser {
|
|
|
368
352
|
// Grab last entry if exist else default to rangeEnd
|
|
369
353
|
max: last || end,
|
|
370
354
|
// keep reference to actual sequence entries
|
|
371
|
-
entries
|
|
355
|
+
entries,
|
|
372
356
|
};
|
|
373
357
|
}
|
|
374
358
|
|
|
375
|
-
|
|
376
359
|
/**
|
|
377
360
|
* Compares two Locus delta objects and notes unique
|
|
378
361
|
* values contained within baseLoci.
|
|
@@ -381,16 +364,13 @@ export default class Parser {
|
|
|
381
364
|
* @returns {Array.<number>} List of unique sequences
|
|
382
365
|
*/
|
|
383
366
|
static getUniqueSequences(baseLoci: any, otherLoci: any) {
|
|
384
|
-
const diff: any = difference(
|
|
385
|
-
|
|
386
|
-
otherLoci.entries
|
|
387
|
-
);
|
|
367
|
+
const diff: any = difference(baseLoci.entries, otherLoci.entries);
|
|
368
|
+
|
|
388
369
|
const {start, end} = otherLoci;
|
|
389
370
|
|
|
390
371
|
return Parser.getNumbersOutOfRange(diff, start, end);
|
|
391
372
|
}
|
|
392
373
|
|
|
393
|
-
|
|
394
374
|
/**
|
|
395
375
|
* Returns an array of numbers outside of a given range.
|
|
396
376
|
* @param {Array.<number>} list Array to filter
|
|
@@ -406,7 +386,6 @@ export default class Parser {
|
|
|
406
386
|
return output.sort((a, b) => a - b);
|
|
407
387
|
}
|
|
408
388
|
|
|
409
|
-
|
|
410
389
|
/**
|
|
411
390
|
* Checks if newLoci or workingCopy is invalid.
|
|
412
391
|
* @param {Types~Locus} newLoci
|
|
@@ -417,21 +396,26 @@ export default class Parser {
|
|
|
417
396
|
const {IDLE} = Parser.status;
|
|
418
397
|
const {isLoci} = Parser;
|
|
419
398
|
// @ts-ignore
|
|
420
|
-
const setStatus = (status) => {
|
|
399
|
+
const setStatus = (status) => {
|
|
400
|
+
this.status = status;
|
|
401
|
+
};
|
|
421
402
|
|
|
422
403
|
// one or both objects are not locus delta events
|
|
423
404
|
if (!isLoci(this.workingCopy) || !isLoci(newLoci)) {
|
|
424
405
|
setStatus(IDLE);
|
|
425
|
-
LoggerProxy.logger.info(
|
|
426
|
-
|
|
427
|
-
|
|
406
|
+
LoggerProxy.logger.info(
|
|
407
|
+
'Locus-info:parser#processDeltaEvent --> Ignoring non-locus object. workingCopy:',
|
|
408
|
+
this.workingCopy,
|
|
409
|
+
'newLoci:',
|
|
410
|
+
newLoci
|
|
411
|
+
);
|
|
412
|
+
} else {
|
|
428
413
|
isValid = true;
|
|
429
414
|
}
|
|
430
415
|
|
|
431
416
|
return isValid;
|
|
432
417
|
}
|
|
433
418
|
|
|
434
|
-
|
|
435
419
|
/**
|
|
436
420
|
* Determines if a paricular locus's sequence is empty
|
|
437
421
|
* @param {Types~Locus} locus
|
|
@@ -445,7 +429,6 @@ export default class Parser {
|
|
|
445
429
|
return hasEmptyEntries && hasEmptyRange;
|
|
446
430
|
}
|
|
447
431
|
|
|
448
|
-
|
|
449
432
|
/**
|
|
450
433
|
* Determines if an object has basic
|
|
451
434
|
* structure of a locus object.
|
|
@@ -456,8 +439,7 @@ export default class Parser {
|
|
|
456
439
|
if (!loci || !loci.sequence) {
|
|
457
440
|
return false;
|
|
458
441
|
}
|
|
459
|
-
const hasProp = (prop) =>
|
|
460
|
-
Object.prototype.hasOwnProperty.call(loci.sequence, prop);
|
|
442
|
+
const hasProp = (prop) => Object.prototype.hasOwnProperty.call(loci.sequence, prop);
|
|
461
443
|
|
|
462
444
|
if (hasProp('rangeStart') && hasProp('rangeEnd')) {
|
|
463
445
|
return true;
|
|
@@ -482,14 +464,12 @@ export default class Parser {
|
|
|
482
464
|
// continue processing until queue is empty
|
|
483
465
|
if (this.queue.size() > 0) {
|
|
484
466
|
this.processDeltaEvent();
|
|
485
|
-
}
|
|
486
|
-
else {
|
|
467
|
+
} else {
|
|
487
468
|
// @ts-ignore
|
|
488
469
|
this.status = Parser.status.IDLE;
|
|
489
470
|
}
|
|
490
471
|
}
|
|
491
472
|
|
|
492
|
-
|
|
493
473
|
/**
|
|
494
474
|
* Function handler for delta actions,
|
|
495
475
|
* is set by instance callee.
|
|
@@ -500,7 +480,6 @@ export default class Parser {
|
|
|
500
480
|
// eslint-disable-next-line no-unused-vars
|
|
501
481
|
onDeltaAction(action: string, locus) {}
|
|
502
482
|
|
|
503
|
-
|
|
504
483
|
/**
|
|
505
484
|
* Event handler for locus delta events
|
|
506
485
|
* @param {Types~Locus} loci Locus Delta
|
|
@@ -521,7 +500,6 @@ export default class Parser {
|
|
|
521
500
|
}
|
|
522
501
|
}
|
|
523
502
|
|
|
524
|
-
|
|
525
503
|
/**
|
|
526
504
|
* Appends new data onto a string of existing data.
|
|
527
505
|
* @param {string} newData
|
|
@@ -532,7 +510,6 @@ export default class Parser {
|
|
|
532
510
|
return `${newData}:${oldData}`;
|
|
533
511
|
}
|
|
534
512
|
|
|
535
|
-
|
|
536
513
|
/**
|
|
537
514
|
* Pause locus processing
|
|
538
515
|
* @returns {undefined}
|
|
@@ -543,7 +520,6 @@ export default class Parser {
|
|
|
543
520
|
LoggerProxy.logger.info('Locus-info:parser#pause --> Locus parser paused.');
|
|
544
521
|
}
|
|
545
522
|
|
|
546
|
-
|
|
547
523
|
/**
|
|
548
524
|
* Processes next locus delta in the queue,
|
|
549
525
|
* continues until the queue is empty
|
|
@@ -569,8 +545,7 @@ export default class Parser {
|
|
|
569
545
|
if (lociComparison === DESYNC) {
|
|
570
546
|
// wait for desync response
|
|
571
547
|
this.pause();
|
|
572
|
-
}
|
|
573
|
-
else if (lociComparison === USE_INCOMING) {
|
|
548
|
+
} else if (lociComparison === USE_INCOMING) {
|
|
574
549
|
// update working copy for future comparisons.
|
|
575
550
|
// Note: The working copy of parser gets updated in .onFullLocus()
|
|
576
551
|
// and here when USE_INCOMING locus.
|
|
@@ -578,14 +553,17 @@ export default class Parser {
|
|
|
578
553
|
}
|
|
579
554
|
|
|
580
555
|
if (this.onDeltaAction) {
|
|
581
|
-
LoggerProxy.logger.info(
|
|
556
|
+
LoggerProxy.logger.info(
|
|
557
|
+
`Locus-info:parser#processDeltaEvent --> Locus Delta Action: ${lociComparison}`
|
|
558
|
+
);
|
|
559
|
+
|
|
560
|
+
// eslint-disable-next-line no-useless-call
|
|
582
561
|
this.onDeltaAction.call(this, lociComparison, newLoci);
|
|
583
562
|
}
|
|
584
563
|
|
|
585
564
|
this.nextEvent();
|
|
586
565
|
}
|
|
587
566
|
|
|
588
|
-
|
|
589
567
|
/**
|
|
590
568
|
* Resume from a paused state
|
|
591
569
|
* @returns {undefined}
|
|
@@ -597,7 +575,6 @@ export default class Parser {
|
|
|
597
575
|
this.nextEvent();
|
|
598
576
|
}
|
|
599
577
|
|
|
600
|
-
|
|
601
578
|
/**
|
|
602
579
|
* Gets related debug info for given error code
|
|
603
580
|
* @param {string} debugCode Debug code
|
|
@@ -611,7 +588,7 @@ export default class Parser {
|
|
|
611
588
|
const resolutionMap = {
|
|
612
589
|
EQ: `${Parser.loci.LT}: is equal (current == incoming).`,
|
|
613
590
|
LT: `${Parser.loci.LT}: choose right side (incoming).`,
|
|
614
|
-
GT: `${Parser.loci.GT}: choose left side (current)
|
|
591
|
+
GT: `${Parser.loci.GT}: choose left side (current).`,
|
|
615
592
|
};
|
|
616
593
|
|
|
617
594
|
const debugMap = {
|
|
@@ -619,28 +596,28 @@ export default class Parser {
|
|
|
619
596
|
title: 'checkSequenceOverlap-001',
|
|
620
597
|
description: mStr`Occurs if earliest working copy sequence is more \
|
|
621
598
|
recent than last incoming sequence.`,
|
|
622
|
-
logic: 'current.min > incoming.max'
|
|
599
|
+
logic: 'current.min > incoming.max',
|
|
623
600
|
},
|
|
624
601
|
|
|
625
602
|
SO002: {
|
|
626
603
|
title: 'checkSequenceOverlap-002',
|
|
627
604
|
description: mStr`Occurs if last working copy sequence is before the \
|
|
628
605
|
earliest incoming sequence.`,
|
|
629
|
-
logic: 'current.max < incoming.min'
|
|
606
|
+
logic: 'current.max < incoming.min',
|
|
630
607
|
},
|
|
631
608
|
|
|
632
609
|
UR001: {
|
|
633
610
|
title: 'checkUnequalRanges-001',
|
|
634
611
|
description: mStr`Occurs if there are no unique values for both loci, \
|
|
635
612
|
and the current working copy loci has a larger range.`,
|
|
636
|
-
logic: 'currentTotalRange > incomingTotalRange'
|
|
613
|
+
logic: 'currentTotalRange > incomingTotalRange',
|
|
637
614
|
},
|
|
638
615
|
|
|
639
616
|
UR002: {
|
|
640
617
|
title: 'checkUnequalRanges-002',
|
|
641
618
|
description: mStr`Occurs if there are no unique values for both loci, \
|
|
642
619
|
and the incoming delta loci has a larger range.`,
|
|
643
|
-
logic: 'currentTotalRange < incomingTotalRange'
|
|
620
|
+
logic: 'currentTotalRange < incomingTotalRange',
|
|
644
621
|
},
|
|
645
622
|
|
|
646
623
|
UR003: {
|
|
@@ -648,7 +625,7 @@ export default class Parser {
|
|
|
648
625
|
description: mStr`Occurs if there are no unique values for both loci, \
|
|
649
626
|
and with ranges either absent or of the same size, the sequences \
|
|
650
627
|
are considered equal.`,
|
|
651
|
-
logic: 'currentTotalRange == incomingTotalRange'
|
|
628
|
+
logic: 'currentTotalRange == incomingTotalRange',
|
|
652
629
|
},
|
|
653
630
|
|
|
654
631
|
UE001: {
|
|
@@ -656,7 +633,7 @@ export default class Parser {
|
|
|
656
633
|
description: mStr`Occurs if current loci has unique entries and \
|
|
657
634
|
incoming does not. Entries are considered unique if they \
|
|
658
635
|
do not overlap with other Loci sequences or range values.`,
|
|
659
|
-
logic: 'currentIsUnique && !incomingIsUnique'
|
|
636
|
+
logic: 'currentIsUnique && !incomingIsUnique',
|
|
660
637
|
},
|
|
661
638
|
|
|
662
639
|
UE002: {
|
|
@@ -664,7 +641,7 @@ export default class Parser {
|
|
|
664
641
|
description: mStr`Occurs if current has no unique entries but \
|
|
665
642
|
incoming does. Entries are considered unique if they \
|
|
666
643
|
do not overlap with other Loci sequences or range values.`,
|
|
667
|
-
logic: '!currentIsUnique && incomingIsUnique'
|
|
644
|
+
logic: '!currentIsUnique && incomingIsUnique',
|
|
668
645
|
},
|
|
669
646
|
|
|
670
647
|
OOS001: {
|
|
@@ -673,7 +650,7 @@ export default class Parser {
|
|
|
673
650
|
if the current loci unique entries overlap the total range of the \
|
|
674
651
|
incoming sequence, or if the incoming unique entries overlap \
|
|
675
652
|
the total range of current sequence.`,
|
|
676
|
-
logic: 'neitherSeqHasRange || currentUniqOverlap || incomingUniqOverlap'
|
|
653
|
+
logic: 'neitherSeqHasRange || currentUniqOverlap || incomingUniqOverlap',
|
|
677
654
|
},
|
|
678
655
|
|
|
679
656
|
OOS002: {
|
|
@@ -681,15 +658,15 @@ export default class Parser {
|
|
|
681
658
|
description: mStr`Occurs if the minimum value from sequences that are \
|
|
682
659
|
unique to the current loci is greater than the minimum value from \
|
|
683
660
|
sequences that are unique to the incoming loci.`,
|
|
684
|
-
logic: 'currentUniqueMin > incomingUniqueMin'
|
|
661
|
+
logic: 'currentUniqueMin > incomingUniqueMin',
|
|
685
662
|
},
|
|
686
663
|
|
|
687
664
|
OOS003: {
|
|
688
665
|
title: 'checkIfOutOfSync-003',
|
|
689
666
|
description: mStr`Occurs if none of the comparison rules applied. \
|
|
690
667
|
It is a catch all.`,
|
|
691
|
-
logic: 'else (catch all)'
|
|
692
|
-
}
|
|
668
|
+
logic: 'else (catch all)',
|
|
669
|
+
},
|
|
693
670
|
};
|
|
694
671
|
|
|
695
672
|
const debugObj = debugMap[debugCode];
|