@webex/plugin-meetings 3.0.0-beta.2 → 3.0.0-beta.200
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +45 -7
- package/UPGRADING.md +9 -9
- package/browsers.js +19 -24
- package/dist/annotation/annotation.types.js +7 -0
- package/dist/annotation/annotation.types.js.map +1 -0
- package/dist/annotation/constants.js +49 -0
- package/dist/annotation/constants.js.map +1 -0
- package/dist/annotation/index.js +342 -0
- package/dist/annotation/index.js.map +1 -0
- package/dist/breakouts/breakout.js +216 -0
- package/dist/breakouts/breakout.js.map +1 -0
- package/dist/breakouts/collection.js +23 -0
- package/dist/breakouts/collection.js.map +1 -0
- package/dist/breakouts/edit-lock-error.js +52 -0
- package/dist/breakouts/edit-lock-error.js.map +1 -0
- package/dist/breakouts/events.js +45 -0
- package/dist/breakouts/events.js.map +1 -0
- package/dist/breakouts/index.js +1048 -0
- package/dist/breakouts/index.js.map +1 -0
- package/dist/breakouts/request.js +78 -0
- package/dist/breakouts/request.js.map +1 -0
- package/dist/breakouts/utils.js +67 -0
- package/dist/breakouts/utils.js.map +1 -0
- package/dist/common/browser-detection.js +1 -20
- package/dist/common/browser-detection.js.map +1 -1
- package/dist/common/collection.js +5 -20
- package/dist/common/collection.js.map +1 -1
- package/dist/common/config.js +0 -7
- package/dist/common/config.js.map +1 -1
- package/dist/common/errors/captcha-error.js +10 -24
- package/dist/common/errors/captcha-error.js.map +1 -1
- package/dist/common/errors/intent-to-join.js +11 -24
- package/dist/common/errors/intent-to-join.js.map +1 -1
- package/dist/common/errors/join-meeting.js +12 -25
- package/dist/common/errors/join-meeting.js.map +1 -1
- package/dist/common/errors/media.js +10 -24
- package/dist/common/errors/media.js.map +1 -1
- package/dist/common/errors/parameter.js +5 -33
- package/dist/common/errors/parameter.js.map +1 -1
- package/dist/common/errors/password-error.js +10 -24
- package/dist/common/errors/password-error.js.map +1 -1
- package/dist/common/errors/permission.js +9 -23
- package/dist/common/errors/permission.js.map +1 -1
- package/dist/common/errors/reconnection-in-progress.js +0 -17
- package/dist/common/errors/reconnection-in-progress.js.map +1 -1
- package/dist/common/errors/reconnection.js +10 -24
- package/dist/common/errors/reconnection.js.map +1 -1
- package/dist/common/errors/stats.js +10 -24
- package/dist/common/errors/stats.js.map +1 -1
- package/dist/common/errors/webex-errors.js +9 -43
- package/dist/common/errors/webex-errors.js.map +1 -1
- package/dist/common/errors/webex-meetings-error.js +5 -25
- package/dist/common/errors/webex-meetings-error.js.map +1 -1
- package/dist/common/events/events-scope.js +0 -22
- package/dist/common/events/events-scope.js.map +1 -1
- package/dist/common/events/events.js +0 -23
- package/dist/common/events/events.js.map +1 -1
- package/dist/common/events/trigger-proxy.js +0 -12
- package/dist/common/events/trigger-proxy.js.map +1 -1
- package/dist/common/events/util.js +0 -15
- package/dist/common/events/util.js.map +1 -1
- package/dist/common/logs/logger-config.js +0 -4
- package/dist/common/logs/logger-config.js.map +1 -1
- package/dist/common/logs/logger-proxy.js +1 -8
- package/dist/common/logs/logger-proxy.js.map +1 -1
- package/dist/common/logs/request.js +37 -60
- package/dist/common/logs/request.js.map +1 -1
- package/dist/common/queue.js +28 -23
- package/dist/common/queue.js.map +1 -1
- package/dist/config.js +8 -13
- package/dist/config.js.map +1 -1
- package/dist/constants.js +250 -66
- package/dist/constants.js.map +1 -1
- package/dist/controls-options-manager/constants.js +14 -0
- package/dist/controls-options-manager/constants.js.map +1 -0
- package/dist/controls-options-manager/enums.js +27 -0
- package/dist/controls-options-manager/enums.js.map +1 -0
- package/dist/controls-options-manager/index.js +297 -0
- package/dist/controls-options-manager/index.js.map +1 -0
- package/dist/controls-options-manager/types.js +7 -0
- package/dist/controls-options-manager/types.js.map +1 -0
- package/dist/controls-options-manager/util.js +319 -0
- package/dist/controls-options-manager/util.js.map +1 -0
- package/dist/index.js +108 -17
- package/dist/index.js.map +1 -1
- package/dist/interpretation/collection.js +23 -0
- package/dist/interpretation/collection.js.map +1 -0
- package/dist/interpretation/index.js +366 -0
- package/dist/interpretation/index.js.map +1 -0
- package/dist/interpretation/siLanguage.js +25 -0
- package/dist/interpretation/siLanguage.js.map +1 -0
- package/dist/locus-info/controlsUtils.js +101 -29
- package/dist/locus-info/controlsUtils.js.map +1 -1
- package/dist/locus-info/embeddedAppsUtils.js +3 -26
- package/dist/locus-info/embeddedAppsUtils.js.map +1 -1
- package/dist/locus-info/fullState.js +0 -15
- package/dist/locus-info/fullState.js.map +1 -1
- package/dist/locus-info/hostUtils.js +4 -12
- package/dist/locus-info/hostUtils.js.map +1 -1
- package/dist/locus-info/index.js +532 -240
- package/dist/locus-info/index.js.map +1 -1
- package/dist/locus-info/infoUtils.js +3 -37
- package/dist/locus-info/infoUtils.js.map +1 -1
- package/dist/locus-info/mediaSharesUtils.js +54 -38
- package/dist/locus-info/mediaSharesUtils.js.map +1 -1
- package/dist/locus-info/parser.js +284 -154
- package/dist/locus-info/parser.js.map +1 -1
- package/dist/locus-info/selfUtils.js +110 -92
- package/dist/locus-info/selfUtils.js.map +1 -1
- package/dist/media/index.js +95 -226
- package/dist/media/index.js.map +1 -1
- package/dist/media/properties.js +99 -194
- package/dist/media/properties.js.map +1 -1
- package/dist/media/util.js +2 -9
- package/dist/media/util.js.map +1 -1
- package/dist/mediaQualityMetrics/config.js +505 -495
- package/dist/mediaQualityMetrics/config.js.map +1 -1
- package/dist/meeting/in-meeting-actions.js +83 -14
- package/dist/meeting/in-meeting-actions.js.map +1 -1
- package/dist/meeting/index.js +3478 -3563
- package/dist/meeting/index.js.map +1 -1
- package/dist/meeting/locusMediaRequest.js +291 -0
- package/dist/meeting/locusMediaRequest.js.map +1 -0
- package/dist/meeting/muteState.js +247 -183
- package/dist/meeting/muteState.js.map +1 -1
- package/dist/meeting/request.js +344 -344
- package/dist/meeting/request.js.map +1 -1
- package/dist/meeting/request.type.js +7 -0
- package/dist/meeting/request.type.js.map +1 -0
- package/dist/meeting/state.js +21 -31
- package/dist/meeting/state.js.map +1 -1
- package/dist/meeting/util.js +529 -588
- package/dist/meeting/util.js.map +1 -1
- package/dist/meeting-info/collection.js +6 -25
- package/dist/meeting-info/collection.js.map +1 -1
- package/dist/meeting-info/index.js +62 -39
- package/dist/meeting-info/index.js.map +1 -1
- package/dist/meeting-info/meeting-info-v2.js +328 -283
- package/dist/meeting-info/meeting-info-v2.js.map +1 -1
- package/dist/meeting-info/request.js +3 -15
- package/dist/meeting-info/request.js.map +1 -1
- package/dist/meeting-info/util.js +98 -183
- package/dist/meeting-info/util.js.map +1 -1
- package/dist/meeting-info/utilv2.js +156 -232
- package/dist/meeting-info/utilv2.js.map +1 -1
- package/dist/meetings/collection.js +26 -19
- package/dist/meetings/collection.js.map +1 -1
- package/dist/meetings/index.js +795 -574
- package/dist/meetings/index.js.map +1 -1
- package/dist/meetings/meetings.types.js +7 -0
- package/dist/meetings/meetings.types.js.map +1 -0
- package/dist/meetings/request.js +26 -41
- package/dist/meetings/request.js.map +1 -1
- package/dist/meetings/util.js +186 -155
- package/dist/meetings/util.js.map +1 -1
- package/dist/member/index.js +126 -85
- package/dist/member/index.js.map +1 -1
- package/dist/member/types.js +25 -0
- package/dist/member/types.js.map +1 -0
- package/dist/member/util.js +147 -88
- package/dist/member/util.js.map +1 -1
- package/dist/members/collection.js +13 -12
- package/dist/members/collection.js.map +1 -1
- package/dist/members/index.js +178 -204
- package/dist/members/index.js.map +1 -1
- package/dist/members/request.js +113 -68
- package/dist/members/request.js.map +1 -1
- package/dist/members/types.js +15 -0
- package/dist/members/types.js.map +1 -0
- package/dist/members/util.js +314 -260
- package/dist/members/util.js.map +1 -1
- package/dist/metrics/constants.js +4 -7
- package/dist/metrics/constants.js.map +1 -1
- package/dist/metrics/index.js +11 -558
- package/dist/metrics/index.js.map +1 -1
- package/dist/multistream/mediaRequestManager.js +264 -50
- package/dist/multistream/mediaRequestManager.js.map +1 -1
- package/dist/multistream/receiveSlot.js +58 -65
- package/dist/multistream/receiveSlot.js.map +1 -1
- package/dist/multistream/receiveSlotManager.js +76 -95
- package/dist/multistream/receiveSlotManager.js.map +1 -1
- package/dist/multistream/remoteMedia.js +62 -76
- package/dist/multistream/remoteMedia.js.map +1 -1
- package/dist/multistream/remoteMediaGroup.js +66 -43
- package/dist/multistream/remoteMediaGroup.js.map +1 -1
- package/dist/multistream/remoteMediaManager.js +502 -442
- package/dist/multistream/remoteMediaManager.js.map +1 -1
- package/dist/networkQualityMonitor/index.js +40 -59
- package/dist/networkQualityMonitor/index.js.map +1 -1
- package/dist/personal-meeting-room/index.js +21 -45
- package/dist/personal-meeting-room/index.js.map +1 -1
- package/dist/personal-meeting-room/request.js +1 -31
- package/dist/personal-meeting-room/request.js.map +1 -1
- package/dist/personal-meeting-room/util.js +0 -13
- package/dist/personal-meeting-room/util.js.map +1 -1
- package/dist/reachability/index.js +192 -191
- package/dist/reachability/index.js.map +1 -1
- package/dist/reachability/request.js +15 -23
- package/dist/reachability/request.js.map +1 -1
- package/dist/reactions/constants.js +13 -0
- package/dist/reactions/constants.js.map +1 -0
- package/dist/reactions/reactions.js +109 -0
- package/dist/reactions/reactions.js.map +1 -0
- package/dist/reactions/reactions.type.js +36 -0
- package/dist/reactions/reactions.type.js.map +1 -0
- package/dist/reconnection-manager/index.js +384 -476
- package/dist/reconnection-manager/index.js.map +1 -1
- package/dist/recording-controller/enums.js +17 -0
- package/dist/recording-controller/enums.js.map +1 -0
- package/dist/recording-controller/index.js +363 -0
- package/dist/recording-controller/index.js.map +1 -0
- package/dist/recording-controller/util.js +64 -0
- package/dist/recording-controller/util.js.map +1 -0
- package/dist/roap/index.js +58 -91
- package/dist/roap/index.js.map +1 -1
- package/dist/roap/request.js +137 -135
- package/dist/roap/request.js.map +1 -1
- package/dist/roap/turnDiscovery.js +148 -100
- package/dist/roap/turnDiscovery.js.map +1 -1
- package/dist/rtcMetrics/constants.js +12 -0
- package/dist/rtcMetrics/constants.js.map +1 -0
- package/dist/rtcMetrics/index.js +115 -0
- package/dist/rtcMetrics/index.js.map +1 -0
- package/dist/statsAnalyzer/global.js +1 -95
- package/dist/statsAnalyzer/global.js.map +1 -1
- package/dist/statsAnalyzer/index.js +385 -460
- package/dist/statsAnalyzer/index.js.map +1 -1
- package/dist/statsAnalyzer/mqaUtil.js +143 -87
- package/dist/statsAnalyzer/mqaUtil.js.map +1 -1
- package/dist/transcription/index.js +22 -47
- package/dist/transcription/index.js.map +1 -1
- package/dist/types/annotation/annotation.types.d.ts +42 -0
- package/dist/types/annotation/constants.d.ts +31 -0
- package/dist/types/annotation/index.d.ts +117 -0
- package/dist/types/breakouts/breakout.d.ts +8 -0
- package/dist/types/breakouts/collection.d.ts +5 -0
- package/dist/types/breakouts/edit-lock-error.d.ts +15 -0
- package/dist/types/breakouts/events.d.ts +8 -0
- package/dist/types/breakouts/index.d.ts +5 -0
- package/dist/types/breakouts/request.d.ts +22 -0
- package/dist/types/breakouts/utils.d.ts +15 -0
- package/dist/types/common/browser-detection.d.ts +9 -0
- package/dist/types/common/collection.d.ts +48 -0
- package/dist/types/common/config.d.ts +2 -0
- package/dist/types/common/errors/captcha-error.d.ts +15 -0
- package/dist/types/common/errors/intent-to-join.d.ts +16 -0
- package/dist/types/common/errors/join-meeting.d.ts +17 -0
- package/dist/types/common/errors/media.d.ts +15 -0
- package/dist/types/common/errors/parameter.d.ts +15 -0
- package/dist/types/common/errors/password-error.d.ts +15 -0
- package/dist/types/common/errors/permission.d.ts +14 -0
- package/dist/types/common/errors/reconnection-in-progress.d.ts +9 -0
- package/dist/types/common/errors/reconnection.d.ts +15 -0
- package/dist/types/common/errors/stats.d.ts +15 -0
- package/dist/types/common/errors/webex-errors.d.ts +69 -0
- package/dist/types/common/errors/webex-meetings-error.d.ts +20 -0
- package/dist/types/common/events/events-scope.d.ts +17 -0
- package/dist/types/common/events/events.d.ts +12 -0
- package/dist/types/common/events/trigger-proxy.d.ts +2 -0
- package/dist/types/common/events/util.d.ts +2 -0
- package/dist/types/common/logs/logger-config.d.ts +2 -0
- package/dist/types/common/logs/logger-proxy.d.ts +2 -0
- package/dist/types/common/logs/request.d.ts +34 -0
- package/dist/types/common/queue.d.ts +34 -0
- package/dist/types/config.d.ts +72 -0
- package/dist/types/constants.d.ts +1016 -0
- package/dist/types/controls-options-manager/constants.d.ts +4 -0
- package/dist/types/controls-options-manager/enums.d.ts +15 -0
- package/dist/types/controls-options-manager/index.d.ts +136 -0
- package/dist/types/controls-options-manager/types.d.ts +43 -0
- package/dist/types/controls-options-manager/util.d.ts +1 -0
- package/dist/types/index.d.ts +7 -0
- package/dist/types/interpretation/collection.d.ts +5 -0
- package/dist/types/interpretation/index.d.ts +5 -0
- package/dist/types/interpretation/siLanguage.d.ts +5 -0
- package/dist/types/locus-info/controlsUtils.d.ts +2 -0
- package/dist/types/locus-info/embeddedAppsUtils.d.ts +2 -0
- package/dist/types/locus-info/fullState.d.ts +2 -0
- package/dist/types/locus-info/hostUtils.d.ts +2 -0
- package/dist/types/locus-info/index.d.ts +322 -0
- package/dist/types/locus-info/infoUtils.d.ts +2 -0
- package/dist/types/locus-info/mediaSharesUtils.d.ts +2 -0
- package/dist/types/locus-info/parser.d.ts +271 -0
- package/dist/types/locus-info/selfUtils.d.ts +2 -0
- package/dist/types/media/index.d.ts +34 -0
- package/dist/types/media/properties.d.ts +93 -0
- package/dist/types/media/util.d.ts +2 -0
- package/dist/types/mediaQualityMetrics/config.d.ts +365 -0
- package/dist/types/meeting/in-meeting-actions.d.ts +153 -0
- package/dist/types/meeting/index.d.ts +1471 -0
- package/dist/types/meeting/locusMediaRequest.d.ts +70 -0
- package/dist/types/meeting/muteState.d.ts +184 -0
- package/dist/types/meeting/request.d.ts +257 -0
- package/dist/types/meeting/request.type.d.ts +11 -0
- package/dist/types/meeting/state.d.ts +9 -0
- package/dist/types/meeting/util.d.ts +78 -0
- package/dist/types/meeting-info/collection.d.ts +20 -0
- package/dist/types/meeting-info/index.d.ts +62 -0
- package/dist/types/meeting-info/meeting-info-v2.d.ts +122 -0
- package/dist/types/meeting-info/request.d.ts +22 -0
- package/dist/types/meeting-info/util.d.ts +2 -0
- package/dist/types/meeting-info/utilv2.d.ts +2 -0
- package/dist/types/meetings/collection.d.ts +31 -0
- package/dist/types/meetings/index.d.ts +367 -0
- package/dist/types/meetings/meetings.types.d.ts +4 -0
- package/dist/types/meetings/request.d.ts +27 -0
- package/dist/types/meetings/util.d.ts +18 -0
- package/dist/types/member/index.d.ts +159 -0
- package/dist/types/member/types.d.ts +32 -0
- package/dist/types/member/util.d.ts +2 -0
- package/dist/types/members/collection.d.ts +29 -0
- package/dist/types/members/index.d.ts +353 -0
- package/dist/types/members/request.d.ts +114 -0
- package/dist/types/members/types.d.ts +24 -0
- package/dist/types/members/util.d.ts +210 -0
- package/dist/types/metrics/constants.d.ts +55 -0
- package/dist/types/metrics/index.d.ts +45 -0
- package/dist/types/multistream/mediaRequestManager.d.ts +118 -0
- package/dist/types/multistream/receiveSlot.d.ts +68 -0
- package/dist/types/multistream/receiveSlotManager.d.ts +56 -0
- package/dist/types/multistream/remoteMedia.d.ts +72 -0
- package/dist/types/multistream/remoteMediaGroup.d.ts +47 -0
- package/dist/types/multistream/remoteMediaManager.d.ts +277 -0
- package/dist/types/networkQualityMonitor/index.d.ts +70 -0
- package/dist/types/personal-meeting-room/index.d.ts +47 -0
- package/dist/types/personal-meeting-room/request.d.ts +14 -0
- package/dist/types/personal-meeting-room/util.d.ts +2 -0
- package/dist/types/reachability/index.d.ts +152 -0
- package/dist/types/reachability/request.d.ts +37 -0
- package/dist/types/reactions/constants.d.ts +3 -0
- package/dist/types/reactions/reactions.d.ts +4 -0
- package/dist/types/reactions/reactions.type.d.ts +52 -0
- package/dist/types/reconnection-manager/index.d.ts +126 -0
- package/dist/types/recording-controller/enums.d.ts +7 -0
- package/dist/types/recording-controller/index.d.ts +208 -0
- package/dist/types/recording-controller/util.d.ts +14 -0
- package/dist/types/roap/index.d.ts +77 -0
- package/dist/types/roap/request.d.ts +36 -0
- package/dist/types/roap/turnDiscovery.d.ts +91 -0
- package/dist/types/rtcMetrics/constants.d.ts +4 -0
- package/dist/types/rtcMetrics/index.d.ts +46 -0
- package/dist/types/statsAnalyzer/global.d.ts +36 -0
- package/dist/types/statsAnalyzer/index.d.ts +200 -0
- package/dist/types/statsAnalyzer/mqaUtil.d.ts +24 -0
- package/dist/types/transcription/index.d.ts +64 -0
- package/internal-README.md +7 -6
- package/package.json +29 -21
- package/src/annotation/annotation.types.ts +50 -0
- package/src/annotation/constants.ts +36 -0
- package/src/annotation/index.ts +328 -0
- package/src/breakouts/README.md +220 -0
- package/src/breakouts/breakout.ts +188 -0
- package/src/breakouts/collection.ts +19 -0
- package/src/breakouts/edit-lock-error.ts +25 -0
- package/src/breakouts/events.ts +56 -0
- package/src/breakouts/index.ts +925 -0
- package/src/breakouts/request.ts +55 -0
- package/src/breakouts/utils.ts +57 -0
- package/src/common/{browser-detection.js → browser-detection.ts} +9 -6
- package/src/common/collection.ts +9 -7
- package/src/common/{config.js → config.ts} +1 -1
- package/src/common/errors/{captcha-error.js → captcha-error.ts} +11 -7
- package/src/common/errors/{intent-to-join.js → intent-to-join.ts} +12 -7
- package/src/common/errors/{join-meeting.js → join-meeting.ts} +17 -8
- package/src/common/errors/{media.js → media.ts} +11 -7
- package/src/common/errors/parameter.ts +11 -7
- package/src/common/errors/{password-error.js → password-error.ts} +11 -7
- package/src/common/errors/{permission.js → permission.ts} +10 -6
- package/src/common/errors/{reconnection.js → reconnection.ts} +11 -7
- package/src/common/errors/{stats.js → stats.ts} +11 -7
- package/src/common/errors/{webex-errors.js → webex-errors.ts} +14 -9
- package/src/common/errors/{webex-meetings-error.js → webex-meetings-error.ts} +4 -2
- package/src/common/events/{events-scope.js → events-scope.ts} +6 -2
- package/src/common/events/{events.js → events.ts} +5 -1
- package/src/common/events/{trigger-proxy.js → trigger-proxy.ts} +9 -5
- package/src/common/events/{util.js → util.ts} +2 -3
- package/src/common/logs/{logger-config.js → logger-config.ts} +1 -2
- package/src/common/logs/logger-proxy.ts +44 -0
- package/src/common/logs/{request.js → request.ts} +22 -9
- package/src/common/queue.ts +22 -9
- package/src/{config.js → config.ts} +17 -17
- package/src/constants.ts +197 -22
- package/src/controls-options-manager/constants.ts +5 -0
- package/src/controls-options-manager/enums.ts +18 -0
- package/src/controls-options-manager/index.ts +278 -0
- package/src/controls-options-manager/types.ts +59 -0
- package/src/controls-options-manager/util.ts +300 -0
- package/src/index.ts +39 -0
- package/src/interpretation/README.md +60 -0
- package/src/interpretation/collection.ts +19 -0
- package/src/interpretation/index.ts +332 -0
- package/src/interpretation/siLanguage.ts +18 -0
- package/src/locus-info/controlsUtils.ts +222 -0
- package/src/locus-info/{embeddedAppsUtils.js → embeddedAppsUtils.ts} +5 -6
- package/src/locus-info/{fullState.js → fullState.ts} +16 -12
- package/src/locus-info/{hostUtils.js → hostUtils.ts} +9 -8
- package/src/locus-info/{index.js → index.ts} +518 -111
- package/src/locus-info/{infoUtils.js → infoUtils.ts} +19 -8
- package/src/locus-info/{mediaSharesUtils.js → mediaSharesUtils.ts} +65 -17
- package/src/locus-info/{parser.js → parser.ts} +271 -98
- package/src/locus-info/{selfUtils.js → selfUtils.ts} +199 -68
- package/src/media/index.ts +456 -0
- package/src/media/{properties.js → properties.ts} +80 -102
- package/src/media/{util.js → util.ts} +2 -2
- package/src/mediaQualityMetrics/config.ts +384 -0
- package/src/meeting/in-meeting-actions.ts +171 -3
- package/src/meeting/index.ts +7070 -0
- package/src/meeting/locusMediaRequest.ts +309 -0
- package/src/meeting/muteState.ts +450 -0
- package/src/meeting/{request.js → request.ts} +354 -214
- package/src/meeting/request.type.ts +13 -0
- package/src/meeting/{state.js → state.ts} +50 -35
- package/src/meeting/util.ts +615 -0
- package/src/meeting-info/{collection.js → collection.ts} +6 -2
- package/src/meeting-info/index.ts +183 -0
- package/src/meeting-info/meeting-info-v2.ts +407 -0
- package/src/meeting-info/{request.js → request.ts} +14 -4
- package/src/meeting-info/{util.js → util.ts} +60 -51
- package/src/meeting-info/{utilv2.js → utilv2.ts} +77 -60
- package/src/meetings/{collection.js → collection.ts} +26 -3
- package/src/meetings/index.ts +1467 -0
- package/src/meetings/meetings.types.ts +12 -0
- package/src/meetings/{request.js → request.ts} +34 -25
- package/src/meetings/{util.js → util.ts} +137 -36
- package/src/member/{index.js → index.ts} +151 -56
- package/src/member/types.ts +38 -0
- package/src/member/util.ts +383 -0
- package/src/members/{collection.js → collection.ts} +10 -2
- package/src/members/{index.js → index.ts} +323 -145
- package/src/members/request.ts +255 -0
- package/src/members/types.ts +28 -0
- package/src/members/util.ts +339 -0
- package/src/metrics/{constants.js → constants.ts} +2 -6
- package/src/metrics/index.ts +73 -0
- package/src/multistream/mediaRequestManager.ts +337 -61
- package/src/multistream/receiveSlot.ts +69 -26
- package/src/multistream/receiveSlotManager.ts +66 -42
- package/src/multistream/remoteMedia.ts +40 -5
- package/src/multistream/remoteMediaGroup.ts +63 -3
- package/src/multistream/remoteMediaManager.ts +263 -66
- package/src/networkQualityMonitor/{index.js → index.ts} +41 -29
- package/src/personal-meeting-room/{index.js → index.ts} +28 -19
- package/src/personal-meeting-room/{request.js → request.ts} +13 -4
- package/src/personal-meeting-room/{util.js → util.ts} +4 -4
- package/src/reachability/{index.js → index.ts} +157 -94
- package/src/reachability/request.ts +46 -35
- package/src/reactions/constants.ts +4 -0
- package/src/reactions/reactions.ts +104 -0
- package/src/reactions/reactions.type.ts +62 -0
- package/src/reconnection-manager/{index.js → index.ts} +254 -136
- package/src/recording-controller/enums.ts +8 -0
- package/src/recording-controller/index.ts +333 -0
- package/src/recording-controller/util.ts +75 -0
- package/src/roap/{index.js → index.ts} +86 -78
- package/src/roap/request.ts +163 -0
- package/src/roap/turnDiscovery.ts +111 -49
- package/src/rtcMetrics/constants.ts +3 -0
- package/src/rtcMetrics/index.ts +96 -0
- package/src/statsAnalyzer/global.ts +37 -0
- package/src/statsAnalyzer/index.ts +1272 -0
- package/src/statsAnalyzer/mqaUtil.ts +291 -0
- package/src/transcription/{index.js → index.ts} +46 -39
- package/test/integration/spec/converged-space-meetings.js +233 -0
- package/test/integration/spec/journey.js +804 -526
- package/test/integration/spec/space-meeting.js +391 -204
- package/test/integration/spec/transcription.js +7 -8
- package/test/unit/spec/annotation/index.ts +418 -0
- package/test/unit/spec/breakouts/breakout.ts +237 -0
- package/test/unit/spec/breakouts/collection.ts +15 -0
- package/test/unit/spec/breakouts/edit-lock-error.ts +30 -0
- package/test/unit/spec/breakouts/events.ts +89 -0
- package/test/unit/spec/breakouts/index.ts +1790 -0
- package/test/unit/spec/breakouts/request.ts +104 -0
- package/test/unit/spec/breakouts/utils.js +72 -0
- package/test/unit/spec/common/browser-detection.js +9 -28
- package/test/unit/spec/common/queue.js +31 -2
- package/test/unit/spec/controls-options-manager/index.js +287 -0
- package/test/unit/spec/controls-options-manager/util.js +582 -0
- package/test/unit/spec/fixture/locus.js +93 -90
- package/test/unit/spec/interpretation/collection.ts +15 -0
- package/test/unit/spec/interpretation/index.ts +589 -0
- package/test/unit/spec/interpretation/siLanguage.ts +28 -0
- package/test/unit/spec/locus-info/controlsUtils.js +325 -32
- package/test/unit/spec/locus-info/embeddedAppsUtils.js +8 -6
- package/test/unit/spec/locus-info/index.js +1176 -18
- package/test/unit/spec/locus-info/infoUtils.js +41 -32
- 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/mediaSharesUtils.ts +22 -0
- package/test/unit/spec/locus-info/parser.js +65 -31
- package/test/unit/spec/locus-info/selfConstant.js +120 -103
- package/test/unit/spec/locus-info/selfUtils.js +296 -12
- package/test/unit/spec/media/index.ts +162 -68
- package/test/unit/spec/media/properties.ts +9 -9
- package/test/unit/spec/meeting/in-meeting-actions.ts +82 -3
- package/test/unit/spec/meeting/index.js +4569 -1773
- package/test/unit/spec/meeting/locusMediaRequest.ts +436 -0
- package/test/unit/spec/meeting/muteState.js +382 -211
- package/test/unit/spec/meeting/request.js +444 -78
- package/test/unit/spec/meeting/utils.js +517 -192
- package/test/unit/spec/meeting-info/index.js +181 -0
- package/test/unit/spec/meeting-info/meetinginfov2.js +481 -76
- 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 +131 -74
- package/test/unit/spec/meetings/collection.js +15 -1
- package/test/unit/spec/meetings/index.js +1254 -330
- package/test/unit/spec/meetings/utils.js +220 -14
- package/test/unit/spec/member/index.js +58 -5
- package/test/unit/spec/member/util.js +494 -26
- package/test/unit/spec/members/index.js +423 -55
- package/test/unit/spec/members/request.js +228 -40
- package/test/unit/spec/members/utils.js +191 -4
- package/test/unit/spec/metrics/index.js +12 -66
- package/test/unit/spec/multistream/mediaRequestManager.ts +1013 -106
- package/test/unit/spec/multistream/receiveSlot.ts +77 -18
- package/test/unit/spec/multistream/receiveSlotManager.ts +69 -39
- package/test/unit/spec/multistream/remoteMedia.ts +40 -2
- package/test/unit/spec/multistream/remoteMediaGroup.ts +271 -5
- package/test/unit/spec/multistream/remoteMediaManager.ts +730 -65
- package/test/unit/spec/networkQualityMonitor/index.js +24 -18
- package/test/unit/spec/personal-meeting-room/personal-meeting-room.js +2 -7
- package/test/unit/spec/reachability/index.ts +176 -27
- package/test/unit/spec/reachability/request.js +66 -0
- package/test/unit/spec/reconnection-manager/index.js +155 -9
- package/test/unit/spec/recording-controller/index.js +307 -0
- package/test/unit/spec/recording-controller/util.js +229 -0
- package/test/unit/spec/roap/index.ts +28 -52
- package/test/unit/spec/roap/request.ts +225 -0
- package/test/unit/spec/roap/turnDiscovery.ts +92 -50
- package/test/unit/spec/rtcMetrics/index.ts +60 -0
- package/test/unit/spec/stats-analyzer/index.js +116 -60
- package/test/utils/cmr.js +44 -42
- package/test/utils/constants.js +9 -0
- package/test/utils/integrationTestUtils.js +46 -0
- package/test/utils/testUtils.js +63 -99
- package/test/utils/webex-config.js +22 -18
- package/test/utils/webex-test-users.js +57 -50
- package/tsconfig.json +6 -0
- package/dist/media/internal-media-core-wrapper.js +0 -22
- package/dist/media/internal-media-core-wrapper.js.map +0 -1
- package/dist/meeting/effectsState.js +0 -327
- package/dist/meeting/effectsState.js.map +0 -1
- package/dist/metrics/config.js +0 -301
- package/dist/metrics/config.js.map +0 -1
- package/dist/multistream/multistreamMedia.js +0 -116
- package/dist/multistream/multistreamMedia.js.map +0 -1
- package/dist/peer-connection-manager/util.js +0 -124
- package/dist/peer-connection-manager/util.js.map +0 -1
- package/src/common/logs/logger-proxy.js +0 -33
- package/src/index.js +0 -15
- package/src/locus-info/controlsUtils.js +0 -102
- package/src/media/index.js +0 -459
- package/src/media/internal-media-core-wrapper.ts +0 -9
- package/src/mediaQualityMetrics/config.js +0 -382
- package/src/meeting/effectsState.js +0 -205
- package/src/meeting/index.js +0 -6284
- package/src/meeting/muteState.js +0 -318
- package/src/meeting/util.js +0 -506
- package/src/meeting-info/index.js +0 -131
- package/src/meeting-info/meeting-info-v2.js +0 -255
- package/src/meetings/index.js +0 -1015
- package/src/member/util.js +0 -254
- package/src/members/request.js +0 -131
- package/src/members/util.js +0 -258
- package/src/metrics/config.js +0 -324
- package/src/metrics/index.js +0 -530
- package/src/multistream/multistreamMedia.ts +0 -92
- package/src/peer-connection-manager/util.ts +0 -117
- package/src/roap/request.js +0 -127
- package/src/statsAnalyzer/global.js +0 -133
- package/src/statsAnalyzer/index.js +0 -1006
- package/src/statsAnalyzer/mqaUtil.js +0 -173
- package/test/unit/spec/meeting/effectsState.js +0 -291
- package/test/unit/spec/peerconnection-manager/utils.test-fixtures.ts +0 -389
- /package/src/common/errors/{reconnection-in-progress.js → reconnection-in-progress.ts} +0 -0
|
@@ -1,31 +1,22 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _Object$defineProperty = require("@babel/runtime-corejs2/core-js/object/define-property");
|
|
4
|
-
|
|
5
4
|
var _interopRequireDefault = require("@babel/runtime-corejs2/helpers/interopRequireDefault");
|
|
6
|
-
|
|
7
5
|
_Object$defineProperty(exports, "__esModule", {
|
|
8
6
|
value: true
|
|
9
7
|
});
|
|
10
|
-
|
|
11
8
|
exports.default = void 0;
|
|
12
|
-
|
|
13
9
|
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/taggedTemplateLiteral"));
|
|
14
|
-
|
|
15
10
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/classCallCheck"));
|
|
16
|
-
|
|
17
11
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/createClass"));
|
|
18
|
-
|
|
19
12
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/defineProperty"));
|
|
20
|
-
|
|
21
13
|
var _difference2 = _interopRequireDefault(require("lodash/difference"));
|
|
22
|
-
|
|
23
14
|
var _queue = _interopRequireDefault(require("../common/queue"));
|
|
24
|
-
|
|
25
15
|
var _loggerProxy = _interopRequireDefault(require("../common/logs/logger-proxy"));
|
|
26
|
-
|
|
27
16
|
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10;
|
|
28
|
-
|
|
17
|
+
var MAX_OOO_DELTA_COUNT = 5; // when we receive an out-of-order delta and the queue builds up to MAX_OOO_DELTA_COUNT, we do a sync with Locus
|
|
18
|
+
var OOO_DELTA_WAIT_TIME = 10000; // [ms] minimum wait time before we do a sync if we get out-of-order deltas
|
|
19
|
+
var OOO_DELTA_WAIT_TIME_RANDOM_DELAY = 5000; // [ms] max random delay added to OOO_DELTA_WAIT_TIME
|
|
29
20
|
/**
|
|
30
21
|
* Locus Delta Parser
|
|
31
22
|
* @private
|
|
@@ -33,6 +24,9 @@ var _templateObject, _templateObject2, _templateObject3, _templateObject4, _temp
|
|
|
33
24
|
*/
|
|
34
25
|
var Parser = /*#__PURE__*/function () {
|
|
35
26
|
// processing status
|
|
27
|
+
|
|
28
|
+
// received an out-of-order delta, so waiting for the missing one
|
|
29
|
+
|
|
36
30
|
// loci comparison states
|
|
37
31
|
|
|
38
32
|
/**
|
|
@@ -40,22 +34,72 @@ var Parser = /*#__PURE__*/function () {
|
|
|
40
34
|
*/
|
|
41
35
|
function Parser() {
|
|
42
36
|
(0, _classCallCheck2.default)(this, Parser);
|
|
43
|
-
this
|
|
44
|
-
this
|
|
37
|
+
(0, _defineProperty2.default)(this, "status", void 0);
|
|
38
|
+
(0, _defineProperty2.default)(this, "queue", void 0);
|
|
39
|
+
(0, _defineProperty2.default)(this, "workingCopy", void 0);
|
|
40
|
+
(0, _defineProperty2.default)(this, "syncTimer", void 0);
|
|
41
|
+
var deltaCompareFunc = function deltaCompareFunc(left, right) {
|
|
42
|
+
var _Parser$loci = Parser.loci,
|
|
43
|
+
LT = _Parser$loci.LT,
|
|
44
|
+
GT = _Parser$loci.GT;
|
|
45
|
+
var extract = Parser.extractComparisonState;
|
|
46
|
+
if (Parser.isSequenceEmpty(left)) {
|
|
47
|
+
return -1;
|
|
48
|
+
}
|
|
49
|
+
if (Parser.isSequenceEmpty(right)) {
|
|
50
|
+
return 1;
|
|
51
|
+
}
|
|
52
|
+
var result = extract(Parser.compareSequence(left.baseSequence, right.baseSequence));
|
|
53
|
+
if (result === LT) {
|
|
54
|
+
return -1;
|
|
55
|
+
}
|
|
56
|
+
if (result === GT) {
|
|
57
|
+
return 1;
|
|
58
|
+
}
|
|
59
|
+
return 0;
|
|
60
|
+
};
|
|
61
|
+
this.queue = new _queue.default(deltaCompareFunc);
|
|
62
|
+
this.status = 'IDLE';
|
|
45
63
|
this.onDeltaAction = null;
|
|
46
64
|
this.workingCopy = null;
|
|
65
|
+
this.syncTimer = null;
|
|
47
66
|
}
|
|
67
|
+
|
|
48
68
|
/**
|
|
49
|
-
*
|
|
50
|
-
*
|
|
51
|
-
*
|
|
52
|
-
* @
|
|
53
|
-
* @param {Types~Locus} incoming
|
|
54
|
-
* @returns {string} loci comparison state
|
|
69
|
+
* Returns a debug string representing a locus delta - useful for logging
|
|
70
|
+
*
|
|
71
|
+
* @param {LocusDeltaDto} locus Locus delta
|
|
72
|
+
* @returns {string}
|
|
55
73
|
*/
|
|
56
|
-
|
|
57
|
-
|
|
58
74
|
(0, _createClass2.default)(Parser, [{
|
|
75
|
+
key: "isNewFullLocus",
|
|
76
|
+
value:
|
|
77
|
+
/**
|
|
78
|
+
* Returns true if the incoming full locus DTO is newer than the current working copy
|
|
79
|
+
*
|
|
80
|
+
* @param {Types~Locus} incomingFullDto New Full Locus DTO
|
|
81
|
+
* @returns {string} either Parser.loci.USE_INCOMING or Parser.loci.USE_CURRENT
|
|
82
|
+
*/
|
|
83
|
+
function isNewFullLocus(incomingFullDto) {
|
|
84
|
+
if (!Parser.isLoci(incomingFullDto)) {
|
|
85
|
+
_loggerProxy.default.logger.info('Locus-info:parser#isNewFullLocus --> Ignoring non-locus object.');
|
|
86
|
+
return false;
|
|
87
|
+
}
|
|
88
|
+
if (!this.workingCopy) {
|
|
89
|
+
// we don't have a working copy yet, so any full locus is better than nothing
|
|
90
|
+
return true;
|
|
91
|
+
}
|
|
92
|
+
var comparisonResult = Parser.compareFullDtoSequence(this.workingCopy, incomingFullDto);
|
|
93
|
+
return comparisonResult === Parser.loci.USE_INCOMING;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* Compares Locus sequences
|
|
98
|
+
* @param {Types~Locus} current Current working copy
|
|
99
|
+
* @param {Types~Locus} incoming New Locus delta
|
|
100
|
+
* @returns {string}
|
|
101
|
+
*/
|
|
102
|
+
}, {
|
|
59
103
|
key: "isValidLocus",
|
|
60
104
|
value:
|
|
61
105
|
/**
|
|
@@ -64,33 +108,23 @@ var Parser = /*#__PURE__*/function () {
|
|
|
64
108
|
* @returns {boolean}
|
|
65
109
|
*/
|
|
66
110
|
function isValidLocus(newLoci) {
|
|
67
|
-
var _this = this;
|
|
68
|
-
|
|
69
111
|
var isValid = false;
|
|
70
|
-
var IDLE = Parser.status.IDLE;
|
|
71
112
|
var isLoci = Parser.isLoci;
|
|
72
113
|
|
|
73
|
-
|
|
74
|
-
_this.status = status;
|
|
75
|
-
}; // one or both objects are not locus delta events
|
|
76
|
-
|
|
77
|
-
|
|
114
|
+
// one or both objects are not locus delta events
|
|
78
115
|
if (!isLoci(this.workingCopy) || !isLoci(newLoci)) {
|
|
79
|
-
setStatus(IDLE);
|
|
80
|
-
|
|
81
116
|
_loggerProxy.default.logger.info('Locus-info:parser#processDeltaEvent --> Ignoring non-locus object. workingCopy:', this.workingCopy, 'newLoci:', newLoci);
|
|
82
117
|
} else {
|
|
83
118
|
isValid = true;
|
|
84
119
|
}
|
|
85
|
-
|
|
86
120
|
return isValid;
|
|
87
121
|
}
|
|
122
|
+
|
|
88
123
|
/**
|
|
89
124
|
* Determines if a paricular locus's sequence is empty
|
|
90
125
|
* @param {Types~Locus} locus
|
|
91
126
|
* @returns {bool}
|
|
92
127
|
*/
|
|
93
|
-
|
|
94
128
|
}, {
|
|
95
129
|
key: "nextEvent",
|
|
96
130
|
value:
|
|
@@ -100,19 +134,23 @@ var Parser = /*#__PURE__*/function () {
|
|
|
100
134
|
* @returns {undefined}
|
|
101
135
|
*/
|
|
102
136
|
function nextEvent() {
|
|
103
|
-
if (this.status ===
|
|
137
|
+
if (this.status === 'PAUSED') {
|
|
104
138
|
_loggerProxy.default.logger.info('Locus-info:parser#nextEvent --> Locus parser paused.');
|
|
105
|
-
|
|
106
139
|
return;
|
|
107
|
-
}
|
|
108
|
-
|
|
140
|
+
}
|
|
141
|
+
if (this.status === 'BLOCKED') {
|
|
142
|
+
_loggerProxy.default.logger.info('Locus-info:parser#nextEvent --> Locus parser blocked by out-of-order delta.');
|
|
143
|
+
return;
|
|
144
|
+
}
|
|
109
145
|
|
|
146
|
+
// continue processing until queue is empty
|
|
110
147
|
if (this.queue.size() > 0) {
|
|
111
148
|
this.processDeltaEvent();
|
|
112
149
|
} else {
|
|
113
|
-
this.status =
|
|
150
|
+
this.status = 'IDLE';
|
|
114
151
|
}
|
|
115
152
|
}
|
|
153
|
+
|
|
116
154
|
/**
|
|
117
155
|
* Function handler for delta actions,
|
|
118
156
|
* is set by instance callee.
|
|
@@ -120,37 +158,42 @@ var Parser = /*#__PURE__*/function () {
|
|
|
120
158
|
* @param {Types~Locus} locus Locus delta
|
|
121
159
|
* @returns {undefined}
|
|
122
160
|
*/
|
|
123
|
-
// eslint-disable-next-line no-unused-vars
|
|
124
|
-
|
|
161
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
125
162
|
}, {
|
|
126
163
|
key: "onDeltaAction",
|
|
127
164
|
value: function onDeltaAction(action, locus) {}
|
|
165
|
+
|
|
128
166
|
/**
|
|
129
167
|
* Event handler for locus delta events
|
|
130
168
|
* @param {Types~Locus} loci Locus Delta
|
|
131
169
|
* @returns {undefined}
|
|
132
170
|
*/
|
|
133
|
-
|
|
134
171
|
}, {
|
|
135
172
|
key: "onDeltaEvent",
|
|
136
173
|
value: function onDeltaEvent(loci) {
|
|
137
174
|
// enqueue the new loci
|
|
138
|
-
this.queue.enqueue(loci);
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
175
|
+
this.queue.enqueue(loci);
|
|
176
|
+
if (this.onDeltaAction) {
|
|
177
|
+
if (this.status === 'BLOCKED') {
|
|
178
|
+
if (this.queue.size() > MAX_OOO_DELTA_COUNT) {
|
|
179
|
+
this.triggerSync('queue too big, blocked on out-of-order delta');
|
|
180
|
+
} else {
|
|
181
|
+
this.processDeltaEvent();
|
|
182
|
+
}
|
|
183
|
+
} else if (this.status === 'IDLE') {
|
|
184
|
+
// Update status, ensure we only process one event at a time.
|
|
185
|
+
this.status = 'WORKING';
|
|
186
|
+
this.processDeltaEvent();
|
|
187
|
+
}
|
|
145
188
|
}
|
|
146
189
|
}
|
|
190
|
+
|
|
147
191
|
/**
|
|
148
192
|
* Appends new data onto a string of existing data.
|
|
149
193
|
* @param {string} newData
|
|
150
194
|
* @param {string} oldData
|
|
151
195
|
* @returns {string}
|
|
152
196
|
*/
|
|
153
|
-
|
|
154
197
|
}, {
|
|
155
198
|
key: "pause",
|
|
156
199
|
value:
|
|
@@ -159,36 +202,87 @@ var Parser = /*#__PURE__*/function () {
|
|
|
159
202
|
* @returns {undefined}
|
|
160
203
|
*/
|
|
161
204
|
function pause() {
|
|
162
|
-
this.status =
|
|
163
|
-
|
|
205
|
+
this.status = 'PAUSED';
|
|
164
206
|
_loggerProxy.default.logger.info('Locus-info:parser#pause --> Locus parser paused.');
|
|
165
207
|
}
|
|
208
|
+
|
|
209
|
+
/**
|
|
210
|
+
* Triggers a sync with Locus
|
|
211
|
+
*
|
|
212
|
+
* @param {string} reason used just for logging
|
|
213
|
+
* @returns {undefined}
|
|
214
|
+
*/
|
|
215
|
+
}, {
|
|
216
|
+
key: "triggerSync",
|
|
217
|
+
value: function triggerSync(reason) {
|
|
218
|
+
_loggerProxy.default.logger.info("Locus-info:parser#triggerSync --> doing sync, reason: ".concat(reason));
|
|
219
|
+
this.stopSyncTimer();
|
|
220
|
+
this.pause();
|
|
221
|
+
this.onDeltaAction(Parser.loci.DESYNC, this.workingCopy);
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
/**
|
|
225
|
+
* Starts a timer with a random delay. When that timer expires we will do a sync.
|
|
226
|
+
*
|
|
227
|
+
* The main purpose of this timer is to handle a case when we get some out-of-order deltas,
|
|
228
|
+
* so we start waiting to receive the missing delta. If that delta never arrives, this timer
|
|
229
|
+
* will trigger a sync with Locus.
|
|
230
|
+
*
|
|
231
|
+
* @returns {undefined}
|
|
232
|
+
*/
|
|
233
|
+
}, {
|
|
234
|
+
key: "startSyncTimer",
|
|
235
|
+
value: function startSyncTimer() {
|
|
236
|
+
var _this = this;
|
|
237
|
+
if (this.syncTimer === null) {
|
|
238
|
+
var timeout = OOO_DELTA_WAIT_TIME + Math.random() * OOO_DELTA_WAIT_TIME_RANDOM_DELAY;
|
|
239
|
+
this.syncTimer = setTimeout(function () {
|
|
240
|
+
_this.syncTimer = null;
|
|
241
|
+
_this.triggerSync('timer expired, blocked on out-of-order delta');
|
|
242
|
+
}, timeout);
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
/**
|
|
247
|
+
* Stops the timer for triggering a sync
|
|
248
|
+
*
|
|
249
|
+
* @returns {undefined}
|
|
250
|
+
*/
|
|
251
|
+
}, {
|
|
252
|
+
key: "stopSyncTimer",
|
|
253
|
+
value: function stopSyncTimer() {
|
|
254
|
+
if (this.syncTimer !== null) {
|
|
255
|
+
clearTimeout(this.syncTimer);
|
|
256
|
+
this.syncTimer = null;
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
|
|
166
260
|
/**
|
|
167
261
|
* Processes next locus delta in the queue,
|
|
168
262
|
* continues until the queue is empty
|
|
169
263
|
* or cleared.
|
|
170
264
|
* @returns {undefined}
|
|
171
265
|
*/
|
|
172
|
-
|
|
173
266
|
}, {
|
|
174
267
|
key: "processDeltaEvent",
|
|
175
268
|
value: function processDeltaEvent() {
|
|
176
|
-
var _Parser$
|
|
177
|
-
|
|
178
|
-
|
|
269
|
+
var _Parser$loci2 = Parser.loci,
|
|
270
|
+
DESYNC = _Parser$loci2.DESYNC,
|
|
271
|
+
USE_INCOMING = _Parser$loci2.USE_INCOMING,
|
|
272
|
+
WAIT = _Parser$loci2.WAIT;
|
|
179
273
|
var extract = Parser.extractComparisonState;
|
|
180
274
|
var newLoci = this.queue.dequeue();
|
|
181
|
-
|
|
182
275
|
if (!this.isValidLocus(newLoci)) {
|
|
276
|
+
this.nextEvent();
|
|
183
277
|
return;
|
|
184
278
|
}
|
|
185
|
-
|
|
186
279
|
var result = Parser.compare(this.workingCopy, newLoci);
|
|
187
|
-
var lociComparison = extract(result);
|
|
188
|
-
// for full debugging.
|
|
280
|
+
var lociComparison = extract(result);
|
|
189
281
|
|
|
282
|
+
// limited debugging, use chrome extension
|
|
283
|
+
// for full debugging.
|
|
190
284
|
_loggerProxy.default.logger.debug("Locus-info:parser#processDeltaEvent --> Locus Debug: ".concat(result));
|
|
191
|
-
|
|
285
|
+
var needToWait = false;
|
|
192
286
|
if (lociComparison === DESYNC) {
|
|
193
287
|
// wait for desync response
|
|
194
288
|
this.pause();
|
|
@@ -197,53 +291,86 @@ var Parser = /*#__PURE__*/function () {
|
|
|
197
291
|
// Note: The working copy of parser gets updated in .onFullLocus()
|
|
198
292
|
// and here when USE_INCOMING locus.
|
|
199
293
|
this.workingCopy = newLoci;
|
|
294
|
+
} else if (lociComparison === WAIT) {
|
|
295
|
+
// we've taken newLoci from the front of the queue, so put it back there as we have to wait
|
|
296
|
+
// for the one that should be in front of it, before we can process it
|
|
297
|
+
this.queue.enqueue(newLoci);
|
|
298
|
+
needToWait = true;
|
|
299
|
+
}
|
|
300
|
+
if (needToWait) {
|
|
301
|
+
this.status = 'BLOCKED';
|
|
302
|
+
this.startSyncTimer();
|
|
303
|
+
} else {
|
|
304
|
+
this.stopSyncTimer();
|
|
305
|
+
if (this.status === 'BLOCKED') {
|
|
306
|
+
// we are not blocked anymore
|
|
307
|
+
this.status = 'WORKING';
|
|
308
|
+
_loggerProxy.default.logger.info("Locus-info:parser#processDeltaEvent --> received delta that we were waiting for ".concat(Parser.locus2string(newLoci), ", not blocked anymore"));
|
|
309
|
+
}
|
|
200
310
|
}
|
|
201
|
-
|
|
202
311
|
if (this.onDeltaAction) {
|
|
203
|
-
_loggerProxy.default.logger.info("Locus-info:parser#processDeltaEvent --> Locus Delta Action: ".concat(lociComparison));
|
|
204
|
-
|
|
205
|
-
this.onDeltaAction.call(this, lociComparison, newLoci);
|
|
312
|
+
_loggerProxy.default.logger.info("Locus-info:parser#processDeltaEvent --> Locus Delta ".concat(Parser.locus2string(newLoci), ", Action: ").concat(lociComparison));
|
|
313
|
+
this.onDeltaAction(lociComparison, newLoci);
|
|
206
314
|
}
|
|
207
|
-
|
|
208
315
|
this.nextEvent();
|
|
209
316
|
}
|
|
317
|
+
|
|
210
318
|
/**
|
|
211
319
|
* Resume from a paused state
|
|
212
320
|
* @returns {undefined}
|
|
213
321
|
*/
|
|
214
|
-
|
|
215
322
|
}, {
|
|
216
323
|
key: "resume",
|
|
217
324
|
value: function resume() {
|
|
218
325
|
_loggerProxy.default.logger.info('Locus-info:parser#resume --> Locus parser resumed.');
|
|
219
|
-
|
|
220
|
-
this.status = Parser.status.WORKING;
|
|
326
|
+
this.status = 'WORKING';
|
|
221
327
|
this.nextEvent();
|
|
222
328
|
}
|
|
329
|
+
|
|
223
330
|
/**
|
|
224
331
|
* Gets related debug info for given error code
|
|
225
332
|
* @param {string} debugCode Debug code
|
|
226
333
|
* @param {string} comparison Locus comparison string
|
|
227
334
|
* @returns {object} Debug message
|
|
228
335
|
*/
|
|
229
|
-
|
|
230
336
|
}], [{
|
|
337
|
+
key: "locus2string",
|
|
338
|
+
value: function locus2string(locus) {
|
|
339
|
+
var _locus$sequence;
|
|
340
|
+
if (!((_locus$sequence = locus.sequence) !== null && _locus$sequence !== void 0 && _locus$sequence.entries)) {
|
|
341
|
+
return 'invalid';
|
|
342
|
+
}
|
|
343
|
+
return locus.sequence.entries.length ? "seq=".concat(locus.sequence.entries.at(-1)) : 'empty';
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
/**
|
|
347
|
+
* Checks if two sequences overlap in time,
|
|
348
|
+
* the sequence with the higher minimum value is greater.
|
|
349
|
+
* Chooses sequence with most recent data.
|
|
350
|
+
* @param {Types~Locus} current
|
|
351
|
+
* @param {Types~Locus} incoming
|
|
352
|
+
* @returns {string} loci comparison state
|
|
353
|
+
*/
|
|
354
|
+
}, {
|
|
231
355
|
key: "checkSequenceOverlap",
|
|
232
356
|
value: function checkSequenceOverlap(current, incoming) {
|
|
233
|
-
var comparison = null;
|
|
357
|
+
var comparison = null;
|
|
234
358
|
|
|
359
|
+
// if earliest working copy sequence is more recent than last incoming sequence
|
|
235
360
|
if (current.min > incoming.max) {
|
|
236
361
|
// choose left side (current)
|
|
237
362
|
comparison = "".concat(Parser.loci.GT, ":SO001");
|
|
238
|
-
}
|
|
363
|
+
}
|
|
364
|
+
// if last working copy sequence is before the earliest incoming sequence
|
|
239
365
|
else if (current.max < incoming.min) {
|
|
240
366
|
// choose right side (incoming)
|
|
241
367
|
comparison = "".concat(Parser.loci.LT, ":SO002");
|
|
242
|
-
}
|
|
243
|
-
|
|
368
|
+
}
|
|
244
369
|
|
|
370
|
+
// if no match above, defaults to null
|
|
245
371
|
return comparison;
|
|
246
372
|
}
|
|
373
|
+
|
|
247
374
|
/**
|
|
248
375
|
* Checks if two sequences have unequal ranges.
|
|
249
376
|
* Chooses sequence with most larger range.
|
|
@@ -251,7 +378,6 @@ var Parser = /*#__PURE__*/function () {
|
|
|
251
378
|
* @param {Types~Locus} incoming
|
|
252
379
|
* @returns {object} loci comparison
|
|
253
380
|
*/
|
|
254
|
-
|
|
255
381
|
}, {
|
|
256
382
|
key: "checkUnequalRanges",
|
|
257
383
|
value: function checkUnequalRanges(current, incoming) {
|
|
@@ -259,14 +385,16 @@ var Parser = /*#__PURE__*/function () {
|
|
|
259
385
|
var currentIsNotUnique = current.unique.length === 0;
|
|
260
386
|
var incomingIsNotUnique = incoming.unique.length === 0;
|
|
261
387
|
var currentTotalRange = current.end - current.min;
|
|
262
|
-
var incomingTotalRange = incoming.end - incoming.min;
|
|
388
|
+
var incomingTotalRange = incoming.end - incoming.min;
|
|
263
389
|
|
|
390
|
+
// no unique values for both loci
|
|
264
391
|
if (currentIsNotUnique && incomingIsNotUnique) {
|
|
265
392
|
// current working copy loci has a larger range
|
|
266
393
|
if (currentTotalRange > incomingTotalRange) {
|
|
267
394
|
// choose left side (current)
|
|
268
395
|
comparison = "".concat(Parser.loci.GT, ":UR001");
|
|
269
|
-
}
|
|
396
|
+
}
|
|
397
|
+
// incoming delta loci has a larger range
|
|
270
398
|
else if (currentTotalRange < incomingTotalRange) {
|
|
271
399
|
// choose right side (incoming)
|
|
272
400
|
comparison = "".concat(Parser.loci.LT, ":UR002");
|
|
@@ -276,9 +404,9 @@ var Parser = /*#__PURE__*/function () {
|
|
|
276
404
|
comparison = "".concat(Parser.loci.EQ, ":UR003");
|
|
277
405
|
}
|
|
278
406
|
}
|
|
279
|
-
|
|
280
407
|
return comparison;
|
|
281
408
|
}
|
|
409
|
+
|
|
282
410
|
/**
|
|
283
411
|
* Checks if either sequences has unique entries.
|
|
284
412
|
* Entries are considered unique if they do not overlap
|
|
@@ -288,25 +416,26 @@ var Parser = /*#__PURE__*/function () {
|
|
|
288
416
|
* @param {Types~Locus} incoming
|
|
289
417
|
* @returns {string} loci comparison state
|
|
290
418
|
*/
|
|
291
|
-
|
|
292
419
|
}, {
|
|
293
420
|
key: "checkForUniqueEntries",
|
|
294
421
|
value: function checkForUniqueEntries(current, incoming) {
|
|
295
422
|
var comparison = null;
|
|
296
423
|
var currentIsUnique = current.unique.length > 0;
|
|
297
|
-
var incomingIsUnique = incoming.unique.length > 0;
|
|
424
|
+
var incomingIsUnique = incoming.unique.length > 0;
|
|
298
425
|
|
|
426
|
+
// current has unique entries and incoming does not
|
|
299
427
|
if (currentIsUnique && !incomingIsUnique) {
|
|
300
428
|
// choose left side (current)
|
|
301
429
|
comparison = "".concat(Parser.loci.GT, ":UE001");
|
|
302
|
-
}
|
|
430
|
+
}
|
|
431
|
+
// current has no unique entries but incoming does
|
|
303
432
|
else if (!currentIsUnique && incomingIsUnique) {
|
|
304
433
|
// choose right side (incoming)
|
|
305
434
|
comparison = "".concat(Parser.loci.LT, ":UE002");
|
|
306
435
|
}
|
|
307
|
-
|
|
308
436
|
return comparison;
|
|
309
437
|
}
|
|
438
|
+
|
|
310
439
|
/**
|
|
311
440
|
* Checks both Locus Delta objects to see if they are
|
|
312
441
|
* out of sync with one another. If so sends a DESYNC
|
|
@@ -315,7 +444,6 @@ var Parser = /*#__PURE__*/function () {
|
|
|
315
444
|
* @param {Types~Locus} incoming
|
|
316
445
|
* @returns {string} loci comparison state
|
|
317
446
|
*/
|
|
318
|
-
|
|
319
447
|
}, {
|
|
320
448
|
key: "checkIfOutOfSync",
|
|
321
449
|
value: function checkIfOutOfSync(current, incoming) {
|
|
@@ -325,22 +453,20 @@ var Parser = /*#__PURE__*/function () {
|
|
|
325
453
|
var currentHasNoRange = !current.start && !current.end;
|
|
326
454
|
var incomingHasNoRange = !incoming.start && !incoming.end;
|
|
327
455
|
var neitherSeqHasRange = currentHasNoRange && incomingHasNoRange;
|
|
328
|
-
|
|
329
456
|
var hasUniqOverlap = function hasUniqOverlap(list, min, max) {
|
|
330
457
|
return list.some(function (seq) {
|
|
331
458
|
return min < seq && seq < max;
|
|
332
459
|
});
|
|
333
|
-
};
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
460
|
+
};
|
|
461
|
+
// current unique entries overlap the total range of incoming
|
|
462
|
+
var currentUniqOverlap = hasUniqOverlap(current.unique, incoming.min, incoming.max);
|
|
463
|
+
// vice-versa, incoming unique entries overlap the total range of current
|
|
338
464
|
var incomingUniqOverlap = hasUniqOverlap(incoming.unique, current.min, current.max);
|
|
339
|
-
|
|
340
465
|
if (neitherSeqHasRange || currentUniqOverlap || incomingUniqOverlap) {
|
|
341
466
|
// outputs string indicating which condition occurred. ex: 0,1,0
|
|
342
|
-
var debugInfo = "".concat(+neitherSeqHasRange, ",").concat(+currentUniqOverlap, ",").concat(+incomingUniqOverlap);
|
|
467
|
+
var debugInfo = "".concat(+neitherSeqHasRange, ",").concat(+currentUniqOverlap, ",").concat(+incomingUniqOverlap);
|
|
343
468
|
|
|
469
|
+
// send DESYNC to server
|
|
344
470
|
comparison = "".concat(Parser.loci.DESYNC, ":OOS001:").concat(debugInfo);
|
|
345
471
|
} else if (currentUniqueMin > incomingUniqueMin) {
|
|
346
472
|
// choose left side (current)
|
|
@@ -349,9 +475,9 @@ var Parser = /*#__PURE__*/function () {
|
|
|
349
475
|
// choose right side (incoming)
|
|
350
476
|
comparison = "".concat(Parser.loci.LT, ":OOS003");
|
|
351
477
|
}
|
|
352
|
-
|
|
353
478
|
return comparison;
|
|
354
479
|
}
|
|
480
|
+
|
|
355
481
|
/**
|
|
356
482
|
* Compares two loci to determine which one contains the most recent state
|
|
357
483
|
* @instance
|
|
@@ -360,26 +486,23 @@ var Parser = /*#__PURE__*/function () {
|
|
|
360
486
|
* @param {Types~Locus} incoming
|
|
361
487
|
* @returns {string} loci comparison state
|
|
362
488
|
*/
|
|
363
|
-
|
|
364
489
|
}, {
|
|
365
490
|
key: "compare",
|
|
366
491
|
value: function compare(current, incoming) {
|
|
367
492
|
var isSequenceEmpty = Parser.isSequenceEmpty;
|
|
368
493
|
var extract = Parser.extractComparisonState;
|
|
369
494
|
var pack = Parser.packComparisonResult;
|
|
370
|
-
|
|
371
495
|
if (isSequenceEmpty(current) || isSequenceEmpty(incoming)) {
|
|
372
496
|
return pack(Parser.loci.USE_INCOMING, 'C001');
|
|
373
497
|
}
|
|
374
|
-
|
|
375
498
|
if (incoming.baseSequence) {
|
|
376
499
|
return pack(Parser.compareDelta(current, incoming), 'C002');
|
|
377
500
|
}
|
|
378
|
-
|
|
379
501
|
var result = Parser.compareSequence(current.sequence, incoming.sequence);
|
|
380
502
|
var action = Parser.compareToAction(extract(result));
|
|
381
503
|
return pack(action, result);
|
|
382
504
|
}
|
|
505
|
+
|
|
383
506
|
/**
|
|
384
507
|
* Compares two loci sequences (with delta params) and indicates what action
|
|
385
508
|
* to take.
|
|
@@ -390,127 +513,142 @@ var Parser = /*#__PURE__*/function () {
|
|
|
390
513
|
* @private
|
|
391
514
|
* @returns {string} loci comparison state
|
|
392
515
|
*/
|
|
393
|
-
|
|
394
516
|
}, {
|
|
395
517
|
key: "compareDelta",
|
|
396
518
|
value: function compareDelta(current, incoming) {
|
|
397
|
-
var _Parser$
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
519
|
+
var _Parser$loci3 = Parser.loci,
|
|
520
|
+
LT = _Parser$loci3.LT,
|
|
521
|
+
GT = _Parser$loci3.GT,
|
|
522
|
+
EQ = _Parser$loci3.EQ,
|
|
523
|
+
DESYNC = _Parser$loci3.DESYNC,
|
|
524
|
+
USE_INCOMING = _Parser$loci3.USE_INCOMING,
|
|
525
|
+
WAIT = _Parser$loci3.WAIT;
|
|
403
526
|
var extract = Parser.extractComparisonState;
|
|
404
527
|
var pack = Parser.packComparisonResult;
|
|
405
528
|
var result = Parser.compareSequence(current.sequence, incoming.sequence);
|
|
406
529
|
var comparison = extract(result);
|
|
407
|
-
|
|
408
530
|
if (comparison !== LT) {
|
|
409
531
|
return pack(Parser.compareToAction(comparison), result);
|
|
410
532
|
}
|
|
411
|
-
|
|
412
533
|
comparison = Parser.compareSequence(current.sequence, incoming.baseSequence);
|
|
413
|
-
|
|
414
534
|
switch (extract(comparison)) {
|
|
415
535
|
case GT:
|
|
416
536
|
case EQ:
|
|
417
537
|
comparison = USE_INCOMING;
|
|
418
538
|
break;
|
|
419
|
-
|
|
539
|
+
case LT:
|
|
540
|
+
if (extract(Parser.compareSequence(incoming.baseSequence, incoming.sequence)) === EQ) {
|
|
541
|
+
// special case where Locus sends a delta with baseSequence === sequence to trigger a sync,
|
|
542
|
+
// because the delta event is too large to be sent over mercury connection
|
|
543
|
+
comparison = DESYNC;
|
|
544
|
+
} else {
|
|
545
|
+
// the incoming locus has baseSequence from the future, so it is out-of-order,
|
|
546
|
+
// we are missing 1 or more locus that should be in front of it, we need to wait for it
|
|
547
|
+
comparison = WAIT;
|
|
548
|
+
}
|
|
549
|
+
break;
|
|
420
550
|
default:
|
|
421
551
|
comparison = DESYNC;
|
|
422
552
|
}
|
|
423
|
-
|
|
424
553
|
return pack(comparison, result);
|
|
425
554
|
}
|
|
555
|
+
|
|
426
556
|
/**
|
|
427
|
-
* Compares Locus sequences
|
|
557
|
+
* Compares Locus sequences - it should be called only for full Locus DTOs, not deltas
|
|
558
|
+
*
|
|
428
559
|
* @param {Types~Locus} current Current working copy
|
|
429
|
-
* @param {Types~Locus}
|
|
430
|
-
* @returns {string}
|
|
560
|
+
* @param {Types~Locus} incomingFullDto New Full Locus DTO
|
|
561
|
+
* @returns {string} either Parser.loci.USE_INCOMING or Parser.loci.USE_CURRENT
|
|
431
562
|
*/
|
|
563
|
+
}, {
|
|
564
|
+
key: "compareFullDtoSequence",
|
|
565
|
+
value: function compareFullDtoSequence(current, incomingFullDto) {
|
|
566
|
+
if (Parser.isSequenceEmpty(current) || Parser.isSequenceEmpty(incomingFullDto)) {
|
|
567
|
+
return Parser.loci.USE_INCOMING;
|
|
568
|
+
}
|
|
432
569
|
|
|
570
|
+
// the sequence.entries list will always contain at least 1 entry
|
|
571
|
+
// https://sqbu-github.cisco.com/WebExSquared/cloud-apps/wiki/Locus-Sequence-Comparison-Algorithm
|
|
572
|
+
|
|
573
|
+
return incomingFullDto.sequence.entries.slice(-1)[0] > current.sequence.entries.slice(-1)[0] ? Parser.loci.USE_INCOMING : Parser.loci.USE_CURRENT;
|
|
574
|
+
}
|
|
433
575
|
}, {
|
|
434
576
|
key: "compareSequence",
|
|
435
577
|
value: function compareSequence(current, incoming) {
|
|
436
578
|
// Locus sequence comparison rules in order of priority.
|
|
437
579
|
// https://sqbu-github.cisco.com/WebExSquared/cloud-apps/wiki/Locus-Sequence-Comparison-Algorithm
|
|
580
|
+
|
|
438
581
|
var local = Parser.getMetaData(current);
|
|
439
|
-
var delta = Parser.getMetaData(incoming);
|
|
582
|
+
var delta = Parser.getMetaData(incoming);
|
|
440
583
|
|
|
584
|
+
// update loci metadata
|
|
441
585
|
local.unique = Parser.getUniqueSequences(local, delta);
|
|
442
|
-
delta.unique = Parser.getUniqueSequences(delta, local);
|
|
443
|
-
// order matters
|
|
586
|
+
delta.unique = Parser.getUniqueSequences(delta, local);
|
|
444
587
|
|
|
588
|
+
// Locus sequence comparison rules
|
|
589
|
+
// order matters
|
|
445
590
|
var rules = [Parser.checkSequenceOverlap, Parser.checkUnequalRanges, Parser.checkForUniqueEntries, Parser.checkIfOutOfSync];
|
|
446
|
-
|
|
447
591
|
for (var _i = 0, _rules = rules; _i < _rules.length; _i++) {
|
|
448
592
|
var rule = _rules[_i];
|
|
449
593
|
// Rule only returns a value if the rule applies,
|
|
450
594
|
// otherwise returns null.
|
|
451
595
|
var result = rule(local, delta);
|
|
452
|
-
|
|
453
596
|
if (result) {
|
|
454
597
|
return result;
|
|
455
598
|
}
|
|
456
|
-
}
|
|
599
|
+
}
|
|
600
|
+
|
|
601
|
+
// error, none of rules above applied
|
|
457
602
|
// should never get here as last rule
|
|
458
603
|
// should be catch all.
|
|
459
|
-
|
|
460
|
-
|
|
461
604
|
return Parser.loci.ERROR;
|
|
462
605
|
}
|
|
606
|
+
|
|
463
607
|
/**
|
|
464
608
|
* Transates the result of a sequence comparison into an intended behavior
|
|
465
609
|
* @param {string} result
|
|
466
610
|
* @returns {string} Locus comparison action
|
|
467
611
|
*/
|
|
468
|
-
|
|
469
612
|
}, {
|
|
470
613
|
key: "compareToAction",
|
|
471
614
|
value: function compareToAction(result) {
|
|
472
|
-
var _Parser$
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
615
|
+
var _Parser$loci4 = Parser.loci,
|
|
616
|
+
DESYNC = _Parser$loci4.DESYNC,
|
|
617
|
+
EQ = _Parser$loci4.EQ,
|
|
618
|
+
ERROR = _Parser$loci4.ERROR,
|
|
619
|
+
GT = _Parser$loci4.GT,
|
|
620
|
+
LT = _Parser$loci4.LT,
|
|
621
|
+
USE_CURRENT = _Parser$loci4.USE_CURRENT,
|
|
622
|
+
USE_INCOMING = _Parser$loci4.USE_INCOMING;
|
|
480
623
|
var action = ERROR;
|
|
481
|
-
|
|
482
624
|
switch (result) {
|
|
483
625
|
case EQ:
|
|
484
626
|
case GT:
|
|
485
627
|
action = USE_CURRENT;
|
|
486
628
|
break;
|
|
487
|
-
|
|
488
629
|
case LT:
|
|
489
630
|
action = USE_INCOMING;
|
|
490
631
|
break;
|
|
491
|
-
|
|
492
632
|
case DESYNC:
|
|
493
633
|
action = DESYNC;
|
|
494
634
|
break;
|
|
495
|
-
|
|
496
635
|
default:
|
|
497
636
|
_loggerProxy.default.logger.info("Locus-info:parser#compareToAction --> Error: ".concat(result, " is not a recognized sequence comparison result."));
|
|
498
|
-
|
|
499
637
|
}
|
|
500
|
-
|
|
501
638
|
return action;
|
|
502
639
|
}
|
|
640
|
+
|
|
503
641
|
/**
|
|
504
642
|
* Extracts a loci comparison from a string of data.
|
|
505
643
|
* @param {string} lociComparisonResult Comparison result with extra data
|
|
506
644
|
* @returns {string} Comparison of EQ, LT, GT, or DESYNC.
|
|
507
645
|
*/
|
|
508
|
-
|
|
509
646
|
}, {
|
|
510
647
|
key: "extractComparisonState",
|
|
511
648
|
value: function extractComparisonState(lociComparisonResult) {
|
|
512
649
|
return lociComparisonResult.split(':')[0];
|
|
513
650
|
}
|
|
651
|
+
|
|
514
652
|
/**
|
|
515
653
|
* @typedef {object} LociMetadata
|
|
516
654
|
* @property {number} start - Starting sequence number
|
|
@@ -527,17 +665,18 @@ var Parser = /*#__PURE__*/function () {
|
|
|
527
665
|
* @param {Array.<number>} sequence Locus delta sequence
|
|
528
666
|
* @returns {LociMetadata} Locus Delta Metadata
|
|
529
667
|
*/
|
|
530
|
-
|
|
531
668
|
}, {
|
|
532
669
|
key: "getMetaData",
|
|
533
670
|
value: function getMetaData(sequence) {
|
|
534
671
|
var entries = sequence.entries;
|
|
535
672
|
var first = entries[0];
|
|
536
|
-
var last = entries.slice(-1)[0];
|
|
673
|
+
var last = entries.slice(-1)[0];
|
|
537
674
|
|
|
675
|
+
// rangeStart or rangeEnd is 0 if a range doesn't exist
|
|
538
676
|
var start = sequence.rangeStart;
|
|
539
|
-
var end = sequence.rangeEnd;
|
|
677
|
+
var end = sequence.rangeEnd;
|
|
540
678
|
|
|
679
|
+
// sequence data
|
|
541
680
|
return {
|
|
542
681
|
start: start,
|
|
543
682
|
end: end,
|
|
@@ -551,6 +690,7 @@ var Parser = /*#__PURE__*/function () {
|
|
|
551
690
|
entries: entries
|
|
552
691
|
};
|
|
553
692
|
}
|
|
693
|
+
|
|
554
694
|
/**
|
|
555
695
|
* Compares two Locus delta objects and notes unique
|
|
556
696
|
* values contained within baseLoci.
|
|
@@ -558,15 +698,15 @@ var Parser = /*#__PURE__*/function () {
|
|
|
558
698
|
* @param {LociMetadata} otherLoci
|
|
559
699
|
* @returns {Array.<number>} List of unique sequences
|
|
560
700
|
*/
|
|
561
|
-
|
|
562
701
|
}, {
|
|
563
702
|
key: "getUniqueSequences",
|
|
564
703
|
value: function getUniqueSequences(baseLoci, otherLoci) {
|
|
565
704
|
var diff = (0, _difference2.default)(baseLoci.entries, otherLoci.entries);
|
|
566
705
|
var start = otherLoci.start,
|
|
567
|
-
|
|
706
|
+
end = otherLoci.end;
|
|
568
707
|
return Parser.getNumbersOutOfRange(diff, start, end);
|
|
569
708
|
}
|
|
709
|
+
|
|
570
710
|
/**
|
|
571
711
|
* Returns an array of numbers outside of a given range.
|
|
572
712
|
* @param {Array.<number>} list Array to filter
|
|
@@ -574,15 +714,15 @@ var Parser = /*#__PURE__*/function () {
|
|
|
574
714
|
* @param {number} rangeEnd End of range
|
|
575
715
|
* @returns {Array.<number>} Array of numbers sorted ASC
|
|
576
716
|
*/
|
|
577
|
-
|
|
578
717
|
}, {
|
|
579
718
|
key: "getNumbersOutOfRange",
|
|
580
719
|
value: function getNumbersOutOfRange(list, rangeStart, rangeEnd) {
|
|
581
720
|
// Collect all numbers if number is outside of specified range
|
|
582
721
|
var output = list.filter(function (num) {
|
|
583
722
|
return num < rangeStart || num > rangeEnd;
|
|
584
|
-
});
|
|
723
|
+
});
|
|
585
724
|
|
|
725
|
+
// sort ascending
|
|
586
726
|
return output.sort(function (a, b) {
|
|
587
727
|
return a - b;
|
|
588
728
|
});
|
|
@@ -591,34 +731,30 @@ var Parser = /*#__PURE__*/function () {
|
|
|
591
731
|
key: "isSequenceEmpty",
|
|
592
732
|
value: function isSequenceEmpty(locus) {
|
|
593
733
|
var _sequence$entries;
|
|
594
|
-
|
|
595
734
|
var sequence = locus.sequence;
|
|
596
735
|
var hasEmptyEntries = !((_sequence$entries = sequence.entries) !== null && _sequence$entries !== void 0 && _sequence$entries.length);
|
|
597
736
|
var hasEmptyRange = sequence.rangeStart === 0 && sequence.rangeEnd === 0;
|
|
598
737
|
return hasEmptyEntries && hasEmptyRange;
|
|
599
738
|
}
|
|
739
|
+
|
|
600
740
|
/**
|
|
601
741
|
* Determines if an object has basic
|
|
602
742
|
* structure of a locus object.
|
|
603
743
|
* @param {Types~Locus} loci
|
|
604
744
|
* @returns {boolean}
|
|
605
745
|
*/
|
|
606
|
-
|
|
607
746
|
}, {
|
|
608
747
|
key: "isLoci",
|
|
609
748
|
value: function isLoci(loci) {
|
|
610
749
|
if (!loci || !loci.sequence) {
|
|
611
750
|
return false;
|
|
612
751
|
}
|
|
613
|
-
|
|
614
752
|
var hasProp = function hasProp(prop) {
|
|
615
753
|
return Object.prototype.hasOwnProperty.call(loci.sequence, prop);
|
|
616
754
|
};
|
|
617
|
-
|
|
618
755
|
if (hasProp('rangeStart') && hasProp('rangeEnd')) {
|
|
619
756
|
return true;
|
|
620
757
|
}
|
|
621
|
-
|
|
622
758
|
return false;
|
|
623
759
|
}
|
|
624
760
|
}, {
|
|
@@ -633,7 +769,6 @@ var Parser = /*#__PURE__*/function () {
|
|
|
633
769
|
var mStr = function mStr(strings) {
|
|
634
770
|
return strings.join('').replace(/\s{2,}/g, ' ');
|
|
635
771
|
};
|
|
636
|
-
|
|
637
772
|
var resolutionMap = {
|
|
638
773
|
EQ: "".concat(Parser.loci.LT, ": is equal (current == incoming)."),
|
|
639
774
|
LT: "".concat(Parser.loci.LT, ": choose right side (incoming)."),
|
|
@@ -699,13 +834,7 @@ var Parser = /*#__PURE__*/function () {
|
|
|
699
834
|
}]);
|
|
700
835
|
return Parser;
|
|
701
836
|
}();
|
|
702
|
-
|
|
703
837
|
exports.default = Parser;
|
|
704
|
-
(0, _defineProperty2.default)(Parser, "status", {
|
|
705
|
-
IDLE: 'IDLE',
|
|
706
|
-
PAUSED: 'PAUSED',
|
|
707
|
-
WORKING: 'WORKING'
|
|
708
|
-
});
|
|
709
838
|
(0, _defineProperty2.default)(Parser, "loci", {
|
|
710
839
|
EQ: 'EQUAL',
|
|
711
840
|
GT: 'GREATER_THAN',
|
|
@@ -713,6 +842,7 @@ exports.default = Parser;
|
|
|
713
842
|
DESYNC: 'DESYNC',
|
|
714
843
|
USE_INCOMING: 'USE_INCOMING',
|
|
715
844
|
USE_CURRENT: 'USE_CURRENT',
|
|
845
|
+
WAIT: 'WAIT',
|
|
716
846
|
ERROR: 'ERROR'
|
|
717
847
|
});
|
|
718
848
|
//# sourceMappingURL=parser.js.map
|