@webex/plugin-meetings 2.59.1-next.0 → 2.59.2

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.
Files changed (134) hide show
  1. package/dist/common/browser-detection.d.ts +9 -0
  2. package/dist/common/browser-detection.js +2 -2
  3. package/dist/common/browser-detection.js.map +1 -1
  4. package/dist/common/collection.d.ts +48 -0
  5. package/dist/common/collection.js +2 -2
  6. package/dist/common/collection.js.map +1 -1
  7. package/dist/common/config.d.ts +2 -0
  8. package/dist/common/errors/captcha-error.d.ts +15 -0
  9. package/dist/common/errors/intent-to-join.d.ts +16 -0
  10. package/dist/common/errors/join-meeting.d.ts +17 -0
  11. package/dist/common/errors/media.d.ts +15 -0
  12. package/dist/common/errors/parameter.d.ts +15 -0
  13. package/dist/common/errors/password-error.d.ts +15 -0
  14. package/dist/common/errors/permission.d.ts +14 -0
  15. package/dist/common/errors/reconnection-in-progress.d.ts +9 -0
  16. package/dist/common/errors/reconnection.d.ts +15 -0
  17. package/dist/common/errors/stats.d.ts +15 -0
  18. package/dist/common/errors/webex-errors.d.ts +81 -0
  19. package/dist/common/errors/webex-meetings-error.d.ts +20 -0
  20. package/dist/common/events/events-scope.d.ts +17 -0
  21. package/dist/common/events/events.d.ts +12 -0
  22. package/dist/common/events/trigger-proxy.d.ts +2 -0
  23. package/dist/common/events/util.d.ts +2 -0
  24. package/dist/common/logs/logger-config.d.ts +2 -0
  25. package/dist/common/logs/logger-proxy.d.ts +2 -0
  26. package/dist/common/logs/request.d.ts +34 -0
  27. package/dist/common/queue.d.ts +32 -0
  28. package/dist/config.d.ts +73 -0
  29. package/dist/constants.d.ts +924 -0
  30. package/dist/controls-options-manager/constants.d.ts +4 -0
  31. package/dist/controls-options-manager/enums.d.ts +5 -0
  32. package/dist/controls-options-manager/index.d.ts +120 -0
  33. package/dist/controls-options-manager/index.js +2 -2
  34. package/dist/controls-options-manager/index.js.map +1 -1
  35. package/dist/controls-options-manager/util.d.ts +7 -0
  36. package/dist/index.d.ts +4 -0
  37. package/dist/locus-info/controlsUtils.d.ts +2 -0
  38. package/dist/locus-info/controlsUtils.js +6 -6
  39. package/dist/locus-info/controlsUtils.js.map +1 -1
  40. package/dist/locus-info/embeddedAppsUtils.d.ts +2 -0
  41. package/dist/locus-info/fullState.d.ts +2 -0
  42. package/dist/locus-info/hostUtils.d.ts +2 -0
  43. package/dist/locus-info/index.d.ts +269 -0
  44. package/dist/locus-info/index.js +18 -18
  45. package/dist/locus-info/index.js.map +1 -1
  46. package/dist/locus-info/infoUtils.d.ts +2 -0
  47. package/dist/locus-info/mediaSharesUtils.d.ts +2 -0
  48. package/dist/locus-info/parser.d.ts +212 -0
  49. package/dist/locus-info/parser.js +2 -2
  50. package/dist/locus-info/parser.js.map +1 -1
  51. package/dist/locus-info/selfUtils.d.ts +2 -0
  52. package/dist/media/index.d.ts +32 -0
  53. package/dist/media/properties.d.ts +108 -0
  54. package/dist/media/util.d.ts +2 -0
  55. package/dist/mediaQualityMetrics/config.d.ts +233 -0
  56. package/dist/meeting/effectsState.d.ts +42 -0
  57. package/dist/meeting/in-meeting-actions.d.ts +79 -0
  58. package/dist/meeting/index.d.ts +1621 -0
  59. package/dist/meeting/index.js +19 -13
  60. package/dist/meeting/index.js.map +1 -1
  61. package/dist/meeting/muteState.d.ts +116 -0
  62. package/dist/meeting/request.d.ts +255 -0
  63. package/dist/meeting/request.js +2 -2
  64. package/dist/meeting/request.js.map +1 -1
  65. package/dist/meeting/state.d.ts +9 -0
  66. package/dist/meeting/util.d.ts +2 -0
  67. package/dist/meeting/util.js +4 -4
  68. package/dist/meeting/util.js.map +1 -1
  69. package/dist/meeting-info/collection.d.ts +20 -0
  70. package/dist/meeting-info/collection.js +2 -2
  71. package/dist/meeting-info/collection.js.map +1 -1
  72. package/dist/meeting-info/index.d.ts +57 -0
  73. package/dist/meeting-info/meeting-info-v2.d.ts +93 -0
  74. package/dist/meeting-info/request.d.ts +22 -0
  75. package/dist/meeting-info/util.d.ts +2 -0
  76. package/dist/meeting-info/utilv2.d.ts +2 -0
  77. package/dist/meetings/collection.d.ts +23 -0
  78. package/dist/meetings/collection.js +2 -2
  79. package/dist/meetings/collection.js.map +1 -1
  80. package/dist/meetings/index.d.ts +296 -0
  81. package/dist/meetings/request.d.ts +27 -0
  82. package/dist/meetings/util.d.ts +18 -0
  83. package/dist/member/index.d.ts +147 -0
  84. package/dist/member/member.types.d.ts +11 -0
  85. package/dist/member/util.d.ts +2 -0
  86. package/dist/members/collection.d.ts +24 -0
  87. package/dist/members/index.d.ts +298 -0
  88. package/dist/members/index.js +2 -2
  89. package/dist/members/index.js.map +1 -1
  90. package/dist/members/request.d.ts +50 -0
  91. package/dist/members/util.d.ts +2 -0
  92. package/dist/metrics/config.d.ts +169 -0
  93. package/dist/metrics/constants.d.ts +57 -0
  94. package/dist/metrics/index.d.ts +152 -0
  95. package/dist/metrics/index.js +2 -2
  96. package/dist/metrics/index.js.map +1 -1
  97. package/dist/networkQualityMonitor/index.d.ts +70 -0
  98. package/dist/peer-connection-manager/index.d.ts +6 -0
  99. package/dist/peer-connection-manager/util.d.ts +6 -0
  100. package/dist/personal-meeting-room/index.d.ts +47 -0
  101. package/dist/personal-meeting-room/request.d.ts +14 -0
  102. package/dist/personal-meeting-room/util.d.ts +2 -0
  103. package/dist/reachability/index.d.ts +139 -0
  104. package/dist/reachability/index.js +2 -9
  105. package/dist/reachability/index.js.map +1 -1
  106. package/dist/reachability/request.d.ts +35 -0
  107. package/dist/reactions/reactions.d.ts +4 -0
  108. package/dist/reactions/reactions.type.d.ts +32 -0
  109. package/dist/reconnection-manager/index.d.ts +112 -0
  110. package/dist/recording-controller/enums.d.ts +7 -0
  111. package/dist/recording-controller/index.d.ts +193 -0
  112. package/dist/recording-controller/util.d.ts +13 -0
  113. package/dist/roap/collection.d.ts +10 -0
  114. package/dist/roap/handler.d.ts +47 -0
  115. package/dist/roap/index.d.ts +116 -0
  116. package/dist/roap/request.d.ts +35 -0
  117. package/dist/roap/state.d.ts +9 -0
  118. package/dist/roap/turnDiscovery.d.ts +67 -0
  119. package/dist/roap/util.d.ts +2 -0
  120. package/dist/statsAnalyzer/global.d.ts +116 -0
  121. package/dist/statsAnalyzer/global.js +0 -10
  122. package/dist/statsAnalyzer/global.js.map +1 -1
  123. package/dist/statsAnalyzer/index.d.ts +191 -0
  124. package/dist/statsAnalyzer/index.js +13 -11
  125. package/dist/statsAnalyzer/index.js.map +1 -1
  126. package/dist/statsAnalyzer/mqaUtil.d.ts +22 -0
  127. package/dist/statsAnalyzer/mqaUtil.js +15 -15
  128. package/dist/statsAnalyzer/mqaUtil.js.map +1 -1
  129. package/dist/transcription/index.d.ts +64 -0
  130. package/package.json +20 -21
  131. package/src/meeting/index.ts +6 -0
  132. package/src/statsAnalyzer/global.ts +0 -10
  133. package/src/statsAnalyzer/index.ts +11 -12
  134. package/test/unit/spec/stats-analyzer/index.js +68 -0
@@ -0,0 +1,212 @@
1
+ /**
2
+ * Locus Delta Parser
3
+ * @private
4
+ * https://sqbu-github.cisco.com/WebExSquared/cloud-apps/wiki/Locus-Delta-Events
5
+ */
6
+ export default class Parser {
7
+ static status: {
8
+ IDLE: string;
9
+ PAUSED: string;
10
+ WORKING: string;
11
+ };
12
+ static loci: {
13
+ EQ: string;
14
+ GT: string;
15
+ LT: string;
16
+ DESYNC: string;
17
+ USE_INCOMING: string;
18
+ USE_CURRENT: string;
19
+ ERROR: string;
20
+ };
21
+ queue: any;
22
+ workingCopy: any;
23
+ /**
24
+ * @constructs Parser
25
+ */
26
+ constructor();
27
+ /**
28
+ * Checks if two sequences overlap in time,
29
+ * the sequence with the higher minimum value is greater.
30
+ * Chooses sequence with most recent data.
31
+ * @param {Types~Locus} current
32
+ * @param {Types~Locus} incoming
33
+ * @returns {string} loci comparison state
34
+ */
35
+ static checkSequenceOverlap(current: any, incoming: any): any;
36
+ /**
37
+ * Checks if two sequences have unequal ranges.
38
+ * Chooses sequence with most larger range.
39
+ * @param {Types~Locus} current
40
+ * @param {Types~Locus} incoming
41
+ * @returns {object} loci comparison
42
+ */
43
+ static checkUnequalRanges(current: any, incoming: any): any;
44
+ /**
45
+ * Checks if either sequences has unique entries.
46
+ * Entries are considered unique if they do not overlap
47
+ * with other Loci sequences or range values.
48
+ * Chooses sequence with the unique entries.
49
+ * @param {Types~Locus} current
50
+ * @param {Types~Locus} incoming
51
+ * @returns {string} loci comparison state
52
+ */
53
+ static checkForUniqueEntries(current: any, incoming: any): any;
54
+ /**
55
+ * Checks both Locus Delta objects to see if they are
56
+ * out of sync with one another. If so sends a DESYNC
57
+ * request to the server.
58
+ * @param {Types~Locus} current
59
+ * @param {Types~Locus} incoming
60
+ * @returns {string} loci comparison state
61
+ */
62
+ static checkIfOutOfSync(current: any, incoming: any): any;
63
+ /**
64
+ * Compares two loci to determine which one contains the most recent state
65
+ * @instance
66
+ * @memberof Locus
67
+ * @param {Types~Locus} current
68
+ * @param {Types~Locus} incoming
69
+ * @returns {string} loci comparison state
70
+ */
71
+ static compare(current: any, incoming: any): string;
72
+ /**
73
+ * Compares two loci sequences (with delta params) and indicates what action
74
+ * to take.
75
+ * @instance
76
+ * @memberof Locus
77
+ * @param {Types~Locus} current
78
+ * @param {Types~Locus} incoming
79
+ * @private
80
+ * @returns {string} loci comparison state
81
+ */
82
+ private static compareDelta;
83
+ /**
84
+ * Compares Locus sequences
85
+ * @param {Types~Locus} current Current working copy
86
+ * @param {Types~Locus} incoming New Locus delta
87
+ * @returns {string}
88
+ */
89
+ static compareSequence(current: any, incoming: any): any;
90
+ /**
91
+ * Transates the result of a sequence comparison into an intended behavior
92
+ * @param {string} result
93
+ * @returns {string} Locus comparison action
94
+ */
95
+ static compareToAction(result: string): string;
96
+ /**
97
+ * Extracts a loci comparison from a string of data.
98
+ * @param {string} lociComparisonResult Comparison result with extra data
99
+ * @returns {string} Comparison of EQ, LT, GT, or DESYNC.
100
+ */
101
+ static extractComparisonState(lociComparisonResult: string): string;
102
+ /**
103
+ * @typedef {object} LociMetadata
104
+ * @property {number} start - Starting sequence number
105
+ * @property {number} end - Ending sequence number
106
+ * @property {number} first - First sequence number
107
+ * @property {number} last - Last sequence number
108
+ * @property {number} min - Minimum sequence number
109
+ * @property {number} max - Maximum sequence number
110
+ * @property {number} entries - Loci sequence entries
111
+ */
112
+ /**
113
+ * Metadata for Locus delta
114
+ * @param {Array.<number>} sequence Locus delta sequence
115
+ * @returns {LociMetadata} Locus Delta Metadata
116
+ */
117
+ static getMetaData(sequence: any): {
118
+ start: any;
119
+ end: any;
120
+ first: any;
121
+ last: any;
122
+ min: any;
123
+ max: any;
124
+ entries: any;
125
+ };
126
+ /**
127
+ * Compares two Locus delta objects and notes unique
128
+ * values contained within baseLoci.
129
+ * @param {LociMetadata} baseLoci
130
+ * @param {LociMetadata} otherLoci
131
+ * @returns {Array.<number>} List of unique sequences
132
+ */
133
+ static getUniqueSequences(baseLoci: any, otherLoci: any): number[];
134
+ /**
135
+ * Returns an array of numbers outside of a given range.
136
+ * @param {Array.<number>} list Array to filter
137
+ * @param {number} rangeStart Start of range
138
+ * @param {number} rangeEnd End of range
139
+ * @returns {Array.<number>} Array of numbers sorted ASC
140
+ */
141
+ static getNumbersOutOfRange(list: Array<number>, rangeStart: number, rangeEnd: number): number[];
142
+ /**
143
+ * Checks if newLoci or workingCopy is invalid.
144
+ * @param {Types~Locus} newLoci
145
+ * @returns {boolean}
146
+ */
147
+ isValidLocus(newLoci: any): boolean;
148
+ /**
149
+ * Determines if a paricular locus's sequence is empty
150
+ * @param {Types~Locus} locus
151
+ * @returns {bool}
152
+ */
153
+ static isSequenceEmpty(locus: any): boolean;
154
+ /**
155
+ * Determines if an object has basic
156
+ * structure of a locus object.
157
+ * @param {Types~Locus} loci
158
+ * @returns {boolean}
159
+ */
160
+ static isLoci(loci: any): boolean;
161
+ /**
162
+ * Processes next event in queue,
163
+ * if queue is empty sets status to idle.
164
+ * @returns {undefined}
165
+ */
166
+ nextEvent(): void;
167
+ /**
168
+ * Function handler for delta actions,
169
+ * is set by instance callee.
170
+ * @param {string} action Locus delta action
171
+ * @param {Types~Locus} locus Locus delta
172
+ * @returns {undefined}
173
+ */
174
+ onDeltaAction(action: string, locus: any): void;
175
+ /**
176
+ * Event handler for locus delta events
177
+ * @param {Types~Locus} loci Locus Delta
178
+ * @returns {undefined}
179
+ */
180
+ onDeltaEvent(loci: any): void;
181
+ /**
182
+ * Appends new data onto a string of existing data.
183
+ * @param {string} newData
184
+ * @param {string} oldData
185
+ * @returns {string}
186
+ */
187
+ static packComparisonResult(newData: string, oldData: string): string;
188
+ /**
189
+ * Pause locus processing
190
+ * @returns {undefined}
191
+ */
192
+ pause(): void;
193
+ /**
194
+ * Processes next locus delta in the queue,
195
+ * continues until the queue is empty
196
+ * or cleared.
197
+ * @returns {undefined}
198
+ */
199
+ processDeltaEvent(): void;
200
+ /**
201
+ * Resume from a paused state
202
+ * @returns {undefined}
203
+ */
204
+ resume(): void;
205
+ /**
206
+ * Gets related debug info for given error code
207
+ * @param {string} debugCode Debug code
208
+ * @param {string} comparison Locus comparison string
209
+ * @returns {object} Debug message
210
+ */
211
+ static getDebugMessage(debugCode: string, comparison: string): any;
212
+ }
@@ -10,7 +10,7 @@ var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime-cor
10
10
  var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/classCallCheck"));
11
11
  var _createClass2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/createClass"));
12
12
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/defineProperty"));
13
- var _lodash = require("lodash");
13
+ var _difference2 = _interopRequireDefault(require("lodash/difference"));
14
14
  var _queue = _interopRequireDefault(require("../common/queue"));
15
15
  var _loggerProxy = _interopRequireDefault(require("../common/logs/logger-proxy"));
16
16
  var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10;
@@ -541,7 +541,7 @@ var Parser = /*#__PURE__*/function () {
541
541
  }, {
542
542
  key: "getUniqueSequences",
543
543
  value: function getUniqueSequences(baseLoci, otherLoci) {
544
- var diff = (0, _lodash.difference)(baseLoci.entries, otherLoci.entries);
544
+ var diff = (0, _difference2.default)(baseLoci.entries, otherLoci.entries);
545
545
  var start = otherLoci.start,
546
546
  end = otherLoci.end;
547
547
  return Parser.getNumbersOutOfRange(diff, start, end);
@@ -1 +1 @@
1
- {"version":3,"names":["_lodash","require","_queue","_interopRequireDefault","_loggerProxy","_templateObject","_templateObject2","_templateObject3","_templateObject4","_templateObject5","_templateObject6","_templateObject7","_templateObject8","_templateObject9","_templateObject10","Parser","_classCallCheck2","default","_defineProperty2","queue","SimpleQueue","status","IDLE","onDeltaAction","workingCopy","_createClass2","key","value","isValidLocus","newLoci","_this","isValid","isLoci","setStatus","LoggerProxy","logger","info","nextEvent","PAUSED","size","processDeltaEvent","action","locus","onDeltaEvent","loci","enqueue","WORKING","pause","_Parser$loci","DESYNC","USE_INCOMING","extract","extractComparisonState","dequeue","result","compare","lociComparison","debug","concat","call","resume","checkSequenceOverlap","current","incoming","comparison","min","max","GT","LT","checkUnequalRanges","currentIsNotUnique","unique","length","incomingIsNotUnique","currentTotalRange","end","incomingTotalRange","EQ","checkForUniqueEntries","currentIsUnique","incomingIsUnique","checkIfOutOfSync","currentUniqueMin","incomingUniqueMin","currentHasNoRange","start","incomingHasNoRange","neitherSeqHasRange","hasUniqOverlap","list","some","seq","currentUniqOverlap","incomingUniqOverlap","debugInfo","isSequenceEmpty","pack","packComparisonResult","baseSequence","compareDelta","compareSequence","sequence","compareToAction","_Parser$loci2","local","getMetaData","delta","getUniqueSequences","rules","_i","_rules","rule","ERROR","_Parser$loci3","USE_CURRENT","lociComparisonResult","split","entries","first","last","slice","rangeStart","rangeEnd","baseLoci","otherLoci","diff","difference","getNumbersOutOfRange","output","filter","num","sort","a","b","_sequence$entries","hasEmptyEntries","hasEmptyRange","hasProp","prop","Object","prototype","hasOwnProperty","newData","oldData","getDebugMessage","debugCode","mStr","strings","join","replace","resolutionMap","debugMap","SO001","title","description","_taggedTemplateLiteral2","logic","SO002","UR001","UR002","UR003","UE001","UE002","OOS001","OOS002","OOS003","debugObj","resolution","exports"],"sources":["parser.ts"],"sourcesContent":["import {difference} from 'lodash';\n\nimport SimpleQueue from '../common/queue';\nimport LoggerProxy from '../common/logs/logger-proxy';\n\n/**\n * Locus Delta Parser\n * @private\n * https://sqbu-github.cisco.com/WebExSquared/cloud-apps/wiki/Locus-Delta-Events\n */\nexport default class Parser {\n // processing status\n static status = {\n IDLE: 'IDLE',\n PAUSED: 'PAUSED',\n WORKING: 'WORKING',\n };\n\n // loci comparison states\n static loci = {\n EQ: 'EQUAL',\n GT: 'GREATER_THAN',\n LT: 'LESS_THAN',\n DESYNC: 'DESYNC',\n USE_INCOMING: 'USE_INCOMING',\n USE_CURRENT: 'USE_CURRENT',\n ERROR: 'ERROR',\n };\n\n queue: any;\n workingCopy: any;\n\n /**\n * @constructs Parser\n */\n constructor() {\n this.queue = new SimpleQueue();\n // @ts-ignore - This is declared as static class member and again being initialized here from same\n this.status = Parser.status.IDLE;\n this.onDeltaAction = null;\n this.workingCopy = null;\n }\n\n /**\n * Checks if two sequences overlap in time,\n * the sequence with the higher minimum value is greater.\n * Chooses sequence with most recent data.\n * @param {Types~Locus} current\n * @param {Types~Locus} incoming\n * @returns {string} loci comparison state\n */\n static checkSequenceOverlap(current, incoming) {\n let comparison = null;\n\n // if earliest working copy sequence is more recent than last incoming sequence\n if (current.min > incoming.max) {\n // choose left side (current)\n comparison = `${Parser.loci.GT}:SO001`;\n }\n // if last working copy sequence is before the earliest incoming sequence\n else if (current.max < incoming.min) {\n // choose right side (incoming)\n comparison = `${Parser.loci.LT}:SO002`;\n }\n\n // if no match above, defaults to null\n return comparison;\n }\n\n /**\n * Checks if two sequences have unequal ranges.\n * Chooses sequence with most larger range.\n * @param {Types~Locus} current\n * @param {Types~Locus} incoming\n * @returns {object} loci comparison\n */\n static checkUnequalRanges(current, incoming) {\n let comparison = null;\n const currentIsNotUnique = current.unique.length === 0;\n const incomingIsNotUnique = incoming.unique.length === 0;\n const currentTotalRange = current.end - current.min;\n const incomingTotalRange = incoming.end - incoming.min;\n\n // no unique values for both loci\n if (currentIsNotUnique && incomingIsNotUnique) {\n // current working copy loci has a larger range\n if (currentTotalRange > incomingTotalRange) {\n // choose left side (current)\n comparison = `${Parser.loci.GT}:UR001`;\n }\n // incoming delta loci has a larger range\n else if (currentTotalRange < incomingTotalRange) {\n // choose right side (incoming)\n comparison = `${Parser.loci.LT}:UR002`;\n } else {\n // with no unique entries and with ranges either absent or\n // of the same size, the sequences are considered equal.\n comparison = `${Parser.loci.EQ}:UR003`;\n }\n }\n\n return comparison;\n }\n\n /**\n * Checks if either sequences has unique entries.\n * Entries are considered unique if they do not overlap\n * with other Loci sequences or range values.\n * Chooses sequence with the unique entries.\n * @param {Types~Locus} current\n * @param {Types~Locus} incoming\n * @returns {string} loci comparison state\n */\n static checkForUniqueEntries(current, incoming) {\n let comparison = null;\n const currentIsUnique = current.unique.length > 0;\n const incomingIsUnique = incoming.unique.length > 0;\n\n // current has unique entries and incoming does not\n if (currentIsUnique && !incomingIsUnique) {\n // choose left side (current)\n comparison = `${Parser.loci.GT}:UE001`;\n }\n // current has no unique entries but incoming does\n else if (!currentIsUnique && incomingIsUnique) {\n // choose right side (incoming)\n comparison = `${Parser.loci.LT}:UE002`;\n }\n\n return comparison;\n }\n\n /**\n * Checks both Locus Delta objects to see if they are\n * out of sync with one another. If so sends a DESYNC\n * request to the server.\n * @param {Types~Locus} current\n * @param {Types~Locus} incoming\n * @returns {string} loci comparison state\n */\n static checkIfOutOfSync(current, incoming) {\n let comparison = null;\n const currentUniqueMin = current.unique[0];\n const incomingUniqueMin = incoming.unique[0];\n\n const currentHasNoRange = !current.start && !current.end;\n const incomingHasNoRange = !incoming.start && !incoming.end;\n const neitherSeqHasRange = currentHasNoRange && incomingHasNoRange;\n\n const hasUniqOverlap = (list, min, max) => list.some((seq) => min < seq && seq < max);\n // current unique entries overlap the total range of incoming\n const currentUniqOverlap = hasUniqOverlap(current.unique, incoming.min, incoming.max);\n // vice-versa, incoming unique entries overlap the total range of current\n const incomingUniqOverlap = hasUniqOverlap(incoming.unique, current.min, current.max);\n\n if (neitherSeqHasRange || currentUniqOverlap || incomingUniqOverlap) {\n // outputs string indicating which condition occurred. ex: 0,1,0\n const debugInfo = `${+neitherSeqHasRange},${+currentUniqOverlap},${+incomingUniqOverlap}`;\n\n // send DESYNC to server\n comparison = `${Parser.loci.DESYNC}:OOS001:${debugInfo}`;\n } else if (currentUniqueMin > incomingUniqueMin) {\n // choose left side (current)\n comparison = `${Parser.loci.GT}:OOS002`;\n } else {\n // choose right side (incoming)\n comparison = `${Parser.loci.LT}:OOS003`;\n }\n\n return comparison;\n }\n\n /**\n * Compares two loci to determine which one contains the most recent state\n * @instance\n * @memberof Locus\n * @param {Types~Locus} current\n * @param {Types~Locus} incoming\n * @returns {string} loci comparison state\n */\n static compare(current, incoming) {\n const {isSequenceEmpty} = Parser;\n const {extractComparisonState: extract} = Parser;\n const {packComparisonResult: pack} = Parser;\n\n if (isSequenceEmpty(current) || isSequenceEmpty(incoming)) {\n return pack(Parser.loci.USE_INCOMING, 'C001');\n }\n\n if (incoming.baseSequence) {\n return pack(Parser.compareDelta(current, incoming), 'C002');\n }\n\n const result = Parser.compareSequence(current.sequence, incoming.sequence);\n const action = Parser.compareToAction(extract(result));\n\n return pack(action, result);\n }\n\n /**\n * Compares two loci sequences (with delta params) and indicates what action\n * to take.\n * @instance\n * @memberof Locus\n * @param {Types~Locus} current\n * @param {Types~Locus} incoming\n * @private\n * @returns {string} loci comparison state\n */\n private static compareDelta(current, incoming) {\n const {LT, GT, EQ, DESYNC, USE_INCOMING} = Parser.loci;\n\n const {extractComparisonState: extract} = Parser;\n const {packComparisonResult: pack} = Parser;\n\n const result = Parser.compareSequence(current.sequence, incoming.sequence);\n let comparison = extract(result);\n\n if (comparison !== LT) {\n return pack(Parser.compareToAction(comparison), result);\n }\n\n comparison = Parser.compareSequence(current.sequence, incoming.baseSequence);\n\n switch (extract(comparison)) {\n case GT:\n case EQ:\n comparison = USE_INCOMING;\n break;\n\n default:\n comparison = DESYNC;\n }\n\n return pack(comparison, result);\n }\n\n /**\n * Compares Locus sequences\n * @param {Types~Locus} current Current working copy\n * @param {Types~Locus} incoming New Locus delta\n * @returns {string}\n */\n static compareSequence(current, incoming) {\n // Locus sequence comparison rules in order of priority.\n // https://sqbu-github.cisco.com/WebExSquared/cloud-apps/wiki/Locus-Sequence-Comparison-Algorithm\n\n const local: any = Parser.getMetaData(current);\n const delta: any = Parser.getMetaData(incoming);\n\n // update loci metadata\n local.unique = Parser.getUniqueSequences(local, delta);\n delta.unique = Parser.getUniqueSequences(delta, local);\n\n // Locus sequence comparison rules\n // order matters\n const rules = [\n Parser.checkSequenceOverlap,\n Parser.checkUnequalRanges,\n Parser.checkForUniqueEntries,\n Parser.checkIfOutOfSync,\n ];\n\n for (const rule of rules) {\n // Rule only returns a value if the rule applies,\n // otherwise returns null.\n const result = rule(local, delta);\n\n if (result) {\n return result;\n }\n }\n\n // error, none of rules above applied\n // should never get here as last rule\n // should be catch all.\n return Parser.loci.ERROR;\n }\n\n /**\n * Transates the result of a sequence comparison into an intended behavior\n * @param {string} result\n * @returns {string} Locus comparison action\n */\n static compareToAction(result: string) {\n const {DESYNC, EQ, ERROR, GT, LT, USE_CURRENT, USE_INCOMING} = Parser.loci;\n\n let action = ERROR;\n\n switch (result) {\n case EQ:\n case GT:\n action = USE_CURRENT;\n break;\n case LT:\n action = USE_INCOMING;\n break;\n case DESYNC:\n action = DESYNC;\n break;\n default:\n LoggerProxy.logger.info(\n `Locus-info:parser#compareToAction --> Error: ${result} is not a recognized sequence comparison result.`\n );\n }\n\n return action;\n }\n\n /**\n * Extracts a loci comparison from a string of data.\n * @param {string} lociComparisonResult Comparison result with extra data\n * @returns {string} Comparison of EQ, LT, GT, or DESYNC.\n */\n static extractComparisonState(lociComparisonResult: string) {\n return lociComparisonResult.split(':')[0];\n }\n\n /**\n * @typedef {object} LociMetadata\n * @property {number} start - Starting sequence number\n * @property {number} end - Ending sequence number\n * @property {number} first - First sequence number\n * @property {number} last - Last sequence number\n * @property {number} min - Minimum sequence number\n * @property {number} max - Maximum sequence number\n * @property {number} entries - Loci sequence entries\n */\n\n /**\n * Metadata for Locus delta\n * @param {Array.<number>} sequence Locus delta sequence\n * @returns {LociMetadata} Locus Delta Metadata\n */\n static getMetaData(sequence: any) {\n const {entries} = sequence;\n const first = entries[0];\n const last = entries.slice(-1)[0];\n\n // rangeStart or rangeEnd is 0 if a range doesn't exist\n const start = sequence.rangeStart;\n const end = sequence.rangeEnd;\n\n // sequence data\n return {\n start,\n end,\n first,\n last,\n // Rule is: rangeStart <= rangeEnd <= min(entries)\n min: start || first,\n // Grab last entry if exist else default to rangeEnd\n max: last || end,\n // keep reference to actual sequence entries\n entries,\n };\n }\n\n /**\n * Compares two Locus delta objects and notes unique\n * values contained within baseLoci.\n * @param {LociMetadata} baseLoci\n * @param {LociMetadata} otherLoci\n * @returns {Array.<number>} List of unique sequences\n */\n static getUniqueSequences(baseLoci: any, otherLoci: any) {\n const diff: any = difference(baseLoci.entries, otherLoci.entries);\n\n const {start, end} = otherLoci;\n\n return Parser.getNumbersOutOfRange(diff, start, end);\n }\n\n /**\n * Returns an array of numbers outside of a given range.\n * @param {Array.<number>} list Array to filter\n * @param {number} rangeStart Start of range\n * @param {number} rangeEnd End of range\n * @returns {Array.<number>} Array of numbers sorted ASC\n */\n static getNumbersOutOfRange(list: Array<number>, rangeStart: number, rangeEnd: number) {\n // Collect all numbers if number is outside of specified range\n const output = list.filter((num) => num < rangeStart || num > rangeEnd);\n\n // sort ascending\n return output.sort((a, b) => a - b);\n }\n\n /**\n * Checks if newLoci or workingCopy is invalid.\n * @param {Types~Locus} newLoci\n * @returns {boolean}\n */\n isValidLocus(newLoci) {\n let isValid = false;\n const {IDLE} = Parser.status;\n const {isLoci} = Parser;\n // @ts-ignore\n const setStatus = (status) => {\n // @ts-ignore\n this.status = status;\n };\n\n // one or both objects are not locus delta events\n if (!isLoci(this.workingCopy) || !isLoci(newLoci)) {\n setStatus(IDLE);\n LoggerProxy.logger.info(\n 'Locus-info:parser#processDeltaEvent --> Ignoring non-locus object. workingCopy:',\n this.workingCopy,\n 'newLoci:',\n newLoci\n );\n } else {\n isValid = true;\n }\n\n return isValid;\n }\n\n /**\n * Determines if a paricular locus's sequence is empty\n * @param {Types~Locus} locus\n * @returns {bool}\n */\n static isSequenceEmpty(locus) {\n const {sequence} = locus;\n const hasEmptyEntries = !sequence.entries?.length;\n const hasEmptyRange = sequence.rangeStart === 0 && sequence.rangeEnd === 0;\n\n return hasEmptyEntries && hasEmptyRange;\n }\n\n /**\n * Determines if an object has basic\n * structure of a locus object.\n * @param {Types~Locus} loci\n * @returns {boolean}\n */\n static isLoci(loci) {\n if (!loci || !loci.sequence) {\n return false;\n }\n const hasProp = (prop) => Object.prototype.hasOwnProperty.call(loci.sequence, prop);\n\n if (hasProp('rangeStart') && hasProp('rangeEnd')) {\n return true;\n }\n\n return false;\n }\n\n /**\n * Processes next event in queue,\n * if queue is empty sets status to idle.\n * @returns {undefined}\n */\n nextEvent() {\n // @ts-ignore\n if (this.status === Parser.status.PAUSED) {\n LoggerProxy.logger.info('Locus-info:parser#nextEvent --> Locus parser paused.');\n\n return;\n }\n\n // continue processing until queue is empty\n if (this.queue.size() > 0) {\n this.processDeltaEvent();\n } else {\n // @ts-ignore\n this.status = Parser.status.IDLE;\n }\n }\n\n /**\n * Function handler for delta actions,\n * is set by instance callee.\n * @param {string} action Locus delta action\n * @param {Types~Locus} locus Locus delta\n * @returns {undefined}\n */\n // eslint-disable-next-line no-unused-vars\n onDeltaAction(action: string, locus) {}\n\n /**\n * Event handler for locus delta events\n * @param {Types~Locus} loci Locus Delta\n * @returns {undefined}\n */\n onDeltaEvent(loci) {\n // enqueue the new loci\n this.queue.enqueue(loci);\n // start processing events in the queue if idle\n // and a function handler is defined\n // @ts-ignore\n if (this.status === Parser.status.IDLE && this.onDeltaAction) {\n // Update status, ensure we only process one event at a time.\n // @ts-ignore\n this.status = Parser.status.WORKING;\n\n this.processDeltaEvent();\n }\n }\n\n /**\n * Appends new data onto a string of existing data.\n * @param {string} newData\n * @param {string} oldData\n * @returns {string}\n */\n static packComparisonResult(newData: string, oldData: string) {\n return `${newData}:${oldData}`;\n }\n\n /**\n * Pause locus processing\n * @returns {undefined}\n */\n pause() {\n // @ts-ignore\n this.status = Parser.status.PAUSED;\n LoggerProxy.logger.info('Locus-info:parser#pause --> Locus parser paused.');\n }\n\n /**\n * Processes next locus delta in the queue,\n * continues until the queue is empty\n * or cleared.\n * @returns {undefined}\n */\n processDeltaEvent() {\n const {DESYNC, USE_INCOMING} = Parser.loci;\n const {extractComparisonState: extract} = Parser;\n const newLoci = this.queue.dequeue();\n\n if (!this.isValidLocus(newLoci)) {\n return;\n }\n\n const result = Parser.compare(this.workingCopy, newLoci);\n const lociComparison = extract(result);\n\n // limited debugging, use chrome extension\n // for full debugging.\n LoggerProxy.logger.debug(`Locus-info:parser#processDeltaEvent --> Locus Debug: ${result}`);\n\n if (lociComparison === DESYNC) {\n // wait for desync response\n this.pause();\n } else if (lociComparison === USE_INCOMING) {\n // update working copy for future comparisons.\n // Note: The working copy of parser gets updated in .onFullLocus()\n // and here when USE_INCOMING locus.\n this.workingCopy = newLoci;\n }\n\n if (this.onDeltaAction) {\n LoggerProxy.logger.info(\n `Locus-info:parser#processDeltaEvent --> Locus Delta Action: ${lociComparison}`\n );\n\n // eslint-disable-next-line no-useless-call\n this.onDeltaAction.call(this, lociComparison, newLoci);\n }\n\n this.nextEvent();\n }\n\n /**\n * Resume from a paused state\n * @returns {undefined}\n */\n resume() {\n LoggerProxy.logger.info('Locus-info:parser#resume --> Locus parser resumed.');\n // @ts-ignore\n this.status = Parser.status.WORKING;\n this.nextEvent();\n }\n\n /**\n * Gets related debug info for given error code\n * @param {string} debugCode Debug code\n * @param {string} comparison Locus comparison string\n * @returns {object} Debug message\n */\n static getDebugMessage(debugCode: string, comparison: string) {\n // removes extra spaces from multiline string\n const mStr = (strings) => strings.join('').replace(/\\s{2,}/g, ' ');\n\n const resolutionMap = {\n EQ: `${Parser.loci.LT}: is equal (current == incoming).`,\n LT: `${Parser.loci.LT}: choose right side (incoming).`,\n GT: `${Parser.loci.GT}: choose left side (current).`,\n };\n\n const debugMap = {\n SO001: {\n title: 'checkSequenceOverlap-001',\n description: mStr`Occurs if earliest working copy sequence is more \\\n recent than last incoming sequence.`,\n logic: 'current.min > incoming.max',\n },\n\n SO002: {\n title: 'checkSequenceOverlap-002',\n description: mStr`Occurs if last working copy sequence is before the \\\n earliest incoming sequence.`,\n logic: 'current.max < incoming.min',\n },\n\n UR001: {\n title: 'checkUnequalRanges-001',\n description: mStr`Occurs if there are no unique values for both loci, \\\n and the current working copy loci has a larger range.`,\n logic: 'currentTotalRange > incomingTotalRange',\n },\n\n UR002: {\n title: 'checkUnequalRanges-002',\n description: mStr`Occurs if there are no unique values for both loci, \\\n and the incoming delta loci has a larger range.`,\n logic: 'currentTotalRange < incomingTotalRange',\n },\n\n UR003: {\n title: 'checkUnequalRanges-003',\n description: mStr`Occurs if there are no unique values for both loci, \\\n and with ranges either absent or of the same size, the sequences \\\n are considered equal.`,\n logic: 'currentTotalRange == incomingTotalRange',\n },\n\n UE001: {\n title: 'checkForUniqueEntries-001',\n description: mStr`Occurs if current loci has unique entries and \\\n incoming does not. Entries are considered unique if they \\\n do not overlap with other Loci sequences or range values.`,\n logic: 'currentIsUnique && !incomingIsUnique',\n },\n\n UE002: {\n title: 'checkForUniqueEntries-002',\n description: mStr`Occurs if current has no unique entries but \\\n incoming does. Entries are considered unique if they \\\n do not overlap with other Loci sequences or range values.`,\n logic: '!currentIsUnique && incomingIsUnique',\n },\n\n OOS001: {\n title: 'checkIfOutOfSync-001',\n description: mStr`Occurs if neither sequence has a range, or \\\n if the current loci unique entries overlap the total range of the \\\n incoming sequence, or if the incoming unique entries overlap \\\n the total range of current sequence.`,\n logic: 'neitherSeqHasRange || currentUniqOverlap || incomingUniqOverlap',\n },\n\n OOS002: {\n title: 'checkIfOutOfSync-002',\n description: mStr`Occurs if the minimum value from sequences that are \\\n unique to the current loci is greater than the minimum value from \\\n sequences that are unique to the incoming loci.`,\n logic: 'currentUniqueMin > incomingUniqueMin',\n },\n\n OOS003: {\n title: 'checkIfOutOfSync-003',\n description: mStr`Occurs if none of the comparison rules applied. \\\n It is a catch all.`,\n logic: 'else (catch all)',\n },\n };\n\n const debugObj = debugMap[debugCode];\n\n debugObj.title = `Debug: ${debugObj.title}`;\n debugObj.resolution = resolutionMap[comparison];\n\n return debugObj;\n }\n}\n"],"mappings":";;;;;;;;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AAEA,IAAAC,MAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,YAAA,GAAAD,sBAAA,CAAAF,OAAA;AAAsD,IAAAI,eAAA,EAAAC,gBAAA,EAAAC,gBAAA,EAAAC,gBAAA,EAAAC,gBAAA,EAAAC,gBAAA,EAAAC,gBAAA,EAAAC,gBAAA,EAAAC,gBAAA,EAAAC,iBAAA;AAEtD;AACA;AACA;AACA;AACA;AAJA,IAKqBC,MAAM;EACzB;;EAOA;;EAcA;AACF;AACA;EACE,SAAAA,OAAA,EAAc;IAAA,IAAAC,gBAAA,CAAAC,OAAA,QAAAF,MAAA;IAAA,IAAAG,gBAAA,CAAAD,OAAA;IAAA,IAAAC,gBAAA,CAAAD,OAAA;IACZ,IAAI,CAACE,KAAK,GAAG,IAAIC,cAAW,EAAE;IAC9B;IACA,IAAI,CAACC,MAAM,GAAGN,MAAM,CAACM,MAAM,CAACC,IAAI;IAChC,IAAI,CAACC,aAAa,GAAG,IAAI;IACzB,IAAI,CAACC,WAAW,GAAG,IAAI;EACzB;;EAEA;AACF;AACA;AACA;AACA;AACA;AACA;AACA;EAPE,IAAA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E,EAAE,OAAO;EACXV,EAAE,EAAE,cAAc;EAClBC,EAAE,EAAE,WAAW;EACfnB,MAAM,EAAE,QAAQ;EAChBC,YAAY,EAAE,cAAc;EAC5BgE,WAAW,EAAE,aAAa;EAC1BF,KAAK,EAAE;AACT,CAAC"}
1
+ {"version":3,"names":["_queue","_interopRequireDefault","require","_loggerProxy","_templateObject","_templateObject2","_templateObject3","_templateObject4","_templateObject5","_templateObject6","_templateObject7","_templateObject8","_templateObject9","_templateObject10","Parser","_classCallCheck2","default","_defineProperty2","queue","SimpleQueue","status","IDLE","onDeltaAction","workingCopy","_createClass2","key","value","isValidLocus","newLoci","_this","isValid","isLoci","setStatus","LoggerProxy","logger","info","nextEvent","PAUSED","size","processDeltaEvent","action","locus","onDeltaEvent","loci","enqueue","WORKING","pause","_Parser$loci","DESYNC","USE_INCOMING","extract","extractComparisonState","dequeue","result","compare","lociComparison","debug","concat","call","resume","checkSequenceOverlap","current","incoming","comparison","min","max","GT","LT","checkUnequalRanges","currentIsNotUnique","unique","length","incomingIsNotUnique","currentTotalRange","end","incomingTotalRange","EQ","checkForUniqueEntries","currentIsUnique","incomingIsUnique","checkIfOutOfSync","currentUniqueMin","incomingUniqueMin","currentHasNoRange","start","incomingHasNoRange","neitherSeqHasRange","hasUniqOverlap","list","some","seq","currentUniqOverlap","incomingUniqOverlap","debugInfo","isSequenceEmpty","pack","packComparisonResult","baseSequence","compareDelta","compareSequence","sequence","compareToAction","_Parser$loci2","local","getMetaData","delta","getUniqueSequences","rules","_i","_rules","rule","ERROR","_Parser$loci3","USE_CURRENT","lociComparisonResult","split","entries","first","last","slice","rangeStart","rangeEnd","baseLoci","otherLoci","diff","_difference2","getNumbersOutOfRange","output","filter","num","sort","a","b","_sequence$entries","hasEmptyEntries","hasEmptyRange","hasProp","prop","Object","prototype","hasOwnProperty","newData","oldData","getDebugMessage","debugCode","mStr","strings","join","replace","resolutionMap","debugMap","SO001","title","description","_taggedTemplateLiteral2","logic","SO002","UR001","UR002","UR003","UE001","UE002","OOS001","OOS002","OOS003","debugObj","resolution","exports"],"sources":["parser.ts"],"sourcesContent":["import {difference} from 'lodash';\n\nimport SimpleQueue from '../common/queue';\nimport LoggerProxy from '../common/logs/logger-proxy';\n\n/**\n * Locus Delta Parser\n * @private\n * https://sqbu-github.cisco.com/WebExSquared/cloud-apps/wiki/Locus-Delta-Events\n */\nexport default class Parser {\n // processing status\n static status = {\n IDLE: 'IDLE',\n PAUSED: 'PAUSED',\n WORKING: 'WORKING',\n };\n\n // loci comparison states\n static loci = {\n EQ: 'EQUAL',\n GT: 'GREATER_THAN',\n LT: 'LESS_THAN',\n DESYNC: 'DESYNC',\n USE_INCOMING: 'USE_INCOMING',\n USE_CURRENT: 'USE_CURRENT',\n ERROR: 'ERROR',\n };\n\n queue: any;\n workingCopy: any;\n\n /**\n * @constructs Parser\n */\n constructor() {\n this.queue = new SimpleQueue();\n // @ts-ignore - This is declared as static class member and again being initialized here from same\n this.status = Parser.status.IDLE;\n this.onDeltaAction = null;\n this.workingCopy = null;\n }\n\n /**\n * Checks if two sequences overlap in time,\n * the sequence with the higher minimum value is greater.\n * Chooses sequence with most recent data.\n * @param {Types~Locus} current\n * @param {Types~Locus} incoming\n * @returns {string} loci comparison state\n */\n static checkSequenceOverlap(current, incoming) {\n let comparison = null;\n\n // if earliest working copy sequence is more recent than last incoming sequence\n if (current.min > incoming.max) {\n // choose left side (current)\n comparison = `${Parser.loci.GT}:SO001`;\n }\n // if last working copy sequence is before the earliest incoming sequence\n else if (current.max < incoming.min) {\n // choose right side (incoming)\n comparison = `${Parser.loci.LT}:SO002`;\n }\n\n // if no match above, defaults to null\n return comparison;\n }\n\n /**\n * Checks if two sequences have unequal ranges.\n * Chooses sequence with most larger range.\n * @param {Types~Locus} current\n * @param {Types~Locus} incoming\n * @returns {object} loci comparison\n */\n static checkUnequalRanges(current, incoming) {\n let comparison = null;\n const currentIsNotUnique = current.unique.length === 0;\n const incomingIsNotUnique = incoming.unique.length === 0;\n const currentTotalRange = current.end - current.min;\n const incomingTotalRange = incoming.end - incoming.min;\n\n // no unique values for both loci\n if (currentIsNotUnique && incomingIsNotUnique) {\n // current working copy loci has a larger range\n if (currentTotalRange > incomingTotalRange) {\n // choose left side (current)\n comparison = `${Parser.loci.GT}:UR001`;\n }\n // incoming delta loci has a larger range\n else if (currentTotalRange < incomingTotalRange) {\n // choose right side (incoming)\n comparison = `${Parser.loci.LT}:UR002`;\n } else {\n // with no unique entries and with ranges either absent or\n // of the same size, the sequences are considered equal.\n comparison = `${Parser.loci.EQ}:UR003`;\n }\n }\n\n return comparison;\n }\n\n /**\n * Checks if either sequences has unique entries.\n * Entries are considered unique if they do not overlap\n * with other Loci sequences or range values.\n * Chooses sequence with the unique entries.\n * @param {Types~Locus} current\n * @param {Types~Locus} incoming\n * @returns {string} loci comparison state\n */\n static checkForUniqueEntries(current, incoming) {\n let comparison = null;\n const currentIsUnique = current.unique.length > 0;\n const incomingIsUnique = incoming.unique.length > 0;\n\n // current has unique entries and incoming does not\n if (currentIsUnique && !incomingIsUnique) {\n // choose left side (current)\n comparison = `${Parser.loci.GT}:UE001`;\n }\n // current has no unique entries but incoming does\n else if (!currentIsUnique && incomingIsUnique) {\n // choose right side (incoming)\n comparison = `${Parser.loci.LT}:UE002`;\n }\n\n return comparison;\n }\n\n /**\n * Checks both Locus Delta objects to see if they are\n * out of sync with one another. If so sends a DESYNC\n * request to the server.\n * @param {Types~Locus} current\n * @param {Types~Locus} incoming\n * @returns {string} loci comparison state\n */\n static checkIfOutOfSync(current, incoming) {\n let comparison = null;\n const currentUniqueMin = current.unique[0];\n const incomingUniqueMin = incoming.unique[0];\n\n const currentHasNoRange = !current.start && !current.end;\n const incomingHasNoRange = !incoming.start && !incoming.end;\n const neitherSeqHasRange = currentHasNoRange && incomingHasNoRange;\n\n const hasUniqOverlap = (list, min, max) => list.some((seq) => min < seq && seq < max);\n // current unique entries overlap the total range of incoming\n const currentUniqOverlap = hasUniqOverlap(current.unique, incoming.min, incoming.max);\n // vice-versa, incoming unique entries overlap the total range of current\n const incomingUniqOverlap = hasUniqOverlap(incoming.unique, current.min, current.max);\n\n if (neitherSeqHasRange || currentUniqOverlap || incomingUniqOverlap) {\n // outputs string indicating which condition occurred. ex: 0,1,0\n const debugInfo = `${+neitherSeqHasRange},${+currentUniqOverlap},${+incomingUniqOverlap}`;\n\n // send DESYNC to server\n comparison = `${Parser.loci.DESYNC}:OOS001:${debugInfo}`;\n } else if (currentUniqueMin > incomingUniqueMin) {\n // choose left side (current)\n comparison = `${Parser.loci.GT}:OOS002`;\n } else {\n // choose right side (incoming)\n comparison = `${Parser.loci.LT}:OOS003`;\n }\n\n return comparison;\n }\n\n /**\n * Compares two loci to determine which one contains the most recent state\n * @instance\n * @memberof Locus\n * @param {Types~Locus} current\n * @param {Types~Locus} incoming\n * @returns {string} loci comparison state\n */\n static compare(current, incoming) {\n const {isSequenceEmpty} = Parser;\n const {extractComparisonState: extract} = Parser;\n const {packComparisonResult: pack} = Parser;\n\n if (isSequenceEmpty(current) || isSequenceEmpty(incoming)) {\n return pack(Parser.loci.USE_INCOMING, 'C001');\n }\n\n if (incoming.baseSequence) {\n return pack(Parser.compareDelta(current, incoming), 'C002');\n }\n\n const result = Parser.compareSequence(current.sequence, incoming.sequence);\n const action = Parser.compareToAction(extract(result));\n\n return pack(action, result);\n }\n\n /**\n * Compares two loci sequences (with delta params) and indicates what action\n * to take.\n * @instance\n * @memberof Locus\n * @param {Types~Locus} current\n * @param {Types~Locus} incoming\n * @private\n * @returns {string} loci comparison state\n */\n private static compareDelta(current, incoming) {\n const {LT, GT, EQ, DESYNC, USE_INCOMING} = Parser.loci;\n\n const {extractComparisonState: extract} = Parser;\n const {packComparisonResult: pack} = Parser;\n\n const result = Parser.compareSequence(current.sequence, incoming.sequence);\n let comparison = extract(result);\n\n if (comparison !== LT) {\n return pack(Parser.compareToAction(comparison), result);\n }\n\n comparison = Parser.compareSequence(current.sequence, incoming.baseSequence);\n\n switch (extract(comparison)) {\n case GT:\n case EQ:\n comparison = USE_INCOMING;\n break;\n\n default:\n comparison = DESYNC;\n }\n\n return pack(comparison, result);\n }\n\n /**\n * Compares Locus sequences\n * @param {Types~Locus} current Current working copy\n * @param {Types~Locus} incoming New Locus delta\n * @returns {string}\n */\n static compareSequence(current, incoming) {\n // Locus sequence comparison rules in order of priority.\n // https://sqbu-github.cisco.com/WebExSquared/cloud-apps/wiki/Locus-Sequence-Comparison-Algorithm\n\n const local: any = Parser.getMetaData(current);\n const delta: any = Parser.getMetaData(incoming);\n\n // update loci metadata\n local.unique = Parser.getUniqueSequences(local, delta);\n delta.unique = Parser.getUniqueSequences(delta, local);\n\n // Locus sequence comparison rules\n // order matters\n const rules = [\n Parser.checkSequenceOverlap,\n Parser.checkUnequalRanges,\n Parser.checkForUniqueEntries,\n Parser.checkIfOutOfSync,\n ];\n\n for (const rule of rules) {\n // Rule only returns a value if the rule applies,\n // otherwise returns null.\n const result = rule(local, delta);\n\n if (result) {\n return result;\n }\n }\n\n // error, none of rules above applied\n // should never get here as last rule\n // should be catch all.\n return Parser.loci.ERROR;\n }\n\n /**\n * Transates the result of a sequence comparison into an intended behavior\n * @param {string} result\n * @returns {string} Locus comparison action\n */\n static compareToAction(result: string) {\n const {DESYNC, EQ, ERROR, GT, LT, USE_CURRENT, USE_INCOMING} = Parser.loci;\n\n let action = ERROR;\n\n switch (result) {\n case EQ:\n case GT:\n action = USE_CURRENT;\n break;\n case LT:\n action = USE_INCOMING;\n break;\n case DESYNC:\n action = DESYNC;\n break;\n default:\n LoggerProxy.logger.info(\n `Locus-info:parser#compareToAction --> Error: ${result} is not a recognized sequence comparison result.`\n );\n }\n\n return action;\n }\n\n /**\n * Extracts a loci comparison from a string of data.\n * @param {string} lociComparisonResult Comparison result with extra data\n * @returns {string} Comparison of EQ, LT, GT, or DESYNC.\n */\n static extractComparisonState(lociComparisonResult: string) {\n return lociComparisonResult.split(':')[0];\n }\n\n /**\n * @typedef {object} LociMetadata\n * @property {number} start - Starting sequence number\n * @property {number} end - Ending sequence number\n * @property {number} first - First sequence number\n * @property {number} last - Last sequence number\n * @property {number} min - Minimum sequence number\n * @property {number} max - Maximum sequence number\n * @property {number} entries - Loci sequence entries\n */\n\n /**\n * Metadata for Locus delta\n * @param {Array.<number>} sequence Locus delta sequence\n * @returns {LociMetadata} Locus Delta Metadata\n */\n static getMetaData(sequence: any) {\n const {entries} = sequence;\n const first = entries[0];\n const last = entries.slice(-1)[0];\n\n // rangeStart or rangeEnd is 0 if a range doesn't exist\n const start = sequence.rangeStart;\n const end = sequence.rangeEnd;\n\n // sequence data\n return {\n start,\n end,\n first,\n last,\n // Rule is: rangeStart <= rangeEnd <= min(entries)\n min: start || first,\n // Grab last entry if exist else default to rangeEnd\n max: last || end,\n // keep reference to actual sequence entries\n entries,\n };\n }\n\n /**\n * Compares two Locus delta objects and notes unique\n * values contained within baseLoci.\n * @param {LociMetadata} baseLoci\n * @param {LociMetadata} otherLoci\n * @returns {Array.<number>} List of unique sequences\n */\n static getUniqueSequences(baseLoci: any, otherLoci: any) {\n const diff: any = difference(baseLoci.entries, otherLoci.entries);\n\n const {start, end} = otherLoci;\n\n return Parser.getNumbersOutOfRange(diff, start, end);\n }\n\n /**\n * Returns an array of numbers outside of a given range.\n * @param {Array.<number>} list Array to filter\n * @param {number} rangeStart Start of range\n * @param {number} rangeEnd End of range\n * @returns {Array.<number>} Array of numbers sorted ASC\n */\n static getNumbersOutOfRange(list: Array<number>, rangeStart: number, rangeEnd: number) {\n // Collect all numbers if number is outside of specified range\n const output = list.filter((num) => num < rangeStart || num > rangeEnd);\n\n // sort ascending\n return output.sort((a, b) => a - b);\n }\n\n /**\n * Checks if newLoci or workingCopy is invalid.\n * @param {Types~Locus} newLoci\n * @returns {boolean}\n */\n isValidLocus(newLoci) {\n let isValid = false;\n const {IDLE} = Parser.status;\n const {isLoci} = Parser;\n // @ts-ignore\n const setStatus = (status) => {\n // @ts-ignore\n this.status = status;\n };\n\n // one or both objects are not locus delta events\n if (!isLoci(this.workingCopy) || !isLoci(newLoci)) {\n setStatus(IDLE);\n LoggerProxy.logger.info(\n 'Locus-info:parser#processDeltaEvent --> Ignoring non-locus object. workingCopy:',\n this.workingCopy,\n 'newLoci:',\n newLoci\n );\n } else {\n isValid = true;\n }\n\n return isValid;\n }\n\n /**\n * Determines if a paricular locus's sequence is empty\n * @param {Types~Locus} locus\n * @returns {bool}\n */\n static isSequenceEmpty(locus) {\n const {sequence} = locus;\n const hasEmptyEntries = !sequence.entries?.length;\n const hasEmptyRange = sequence.rangeStart === 0 && sequence.rangeEnd === 0;\n\n return hasEmptyEntries && hasEmptyRange;\n }\n\n /**\n * Determines if an object has basic\n * structure of a locus object.\n * @param {Types~Locus} loci\n * @returns {boolean}\n */\n static isLoci(loci) {\n if (!loci || !loci.sequence) {\n return false;\n }\n const hasProp = (prop) => Object.prototype.hasOwnProperty.call(loci.sequence, prop);\n\n if (hasProp('rangeStart') && hasProp('rangeEnd')) {\n return true;\n }\n\n return false;\n }\n\n /**\n * Processes next event in queue,\n * if queue is empty sets status to idle.\n * @returns {undefined}\n */\n nextEvent() {\n // @ts-ignore\n if (this.status === Parser.status.PAUSED) {\n LoggerProxy.logger.info('Locus-info:parser#nextEvent --> Locus parser paused.');\n\n return;\n }\n\n // continue processing until queue is empty\n if (this.queue.size() > 0) {\n this.processDeltaEvent();\n } else {\n // @ts-ignore\n this.status = Parser.status.IDLE;\n }\n }\n\n /**\n * Function handler for delta actions,\n * is set by instance callee.\n * @param {string} action Locus delta action\n * @param {Types~Locus} locus Locus delta\n * @returns {undefined}\n */\n // eslint-disable-next-line no-unused-vars\n onDeltaAction(action: string, locus) {}\n\n /**\n * Event handler for locus delta events\n * @param {Types~Locus} loci Locus Delta\n * @returns {undefined}\n */\n onDeltaEvent(loci) {\n // enqueue the new loci\n this.queue.enqueue(loci);\n // start processing events in the queue if idle\n // and a function handler is defined\n // @ts-ignore\n if (this.status === Parser.status.IDLE && this.onDeltaAction) {\n // Update status, ensure we only process one event at a time.\n // @ts-ignore\n this.status = Parser.status.WORKING;\n\n this.processDeltaEvent();\n }\n }\n\n /**\n * Appends new data onto a string of existing data.\n * @param {string} newData\n * @param {string} oldData\n * @returns {string}\n */\n static packComparisonResult(newData: string, oldData: string) {\n return `${newData}:${oldData}`;\n }\n\n /**\n * Pause locus processing\n * @returns {undefined}\n */\n pause() {\n // @ts-ignore\n this.status = Parser.status.PAUSED;\n LoggerProxy.logger.info('Locus-info:parser#pause --> Locus parser paused.');\n }\n\n /**\n * Processes next locus delta in the queue,\n * continues until the queue is empty\n * or cleared.\n * @returns {undefined}\n */\n processDeltaEvent() {\n const {DESYNC, USE_INCOMING} = Parser.loci;\n const {extractComparisonState: extract} = Parser;\n const newLoci = this.queue.dequeue();\n\n if (!this.isValidLocus(newLoci)) {\n return;\n }\n\n const result = Parser.compare(this.workingCopy, newLoci);\n const lociComparison = extract(result);\n\n // limited debugging, use chrome extension\n // for full debugging.\n LoggerProxy.logger.debug(`Locus-info:parser#processDeltaEvent --> Locus Debug: ${result}`);\n\n if (lociComparison === DESYNC) {\n // wait for desync response\n this.pause();\n } else if (lociComparison === USE_INCOMING) {\n // update working copy for future comparisons.\n // Note: The working copy of parser gets updated in .onFullLocus()\n // and here when USE_INCOMING locus.\n this.workingCopy = newLoci;\n }\n\n if (this.onDeltaAction) {\n LoggerProxy.logger.info(\n `Locus-info:parser#processDeltaEvent --> Locus Delta Action: ${lociComparison}`\n );\n\n // eslint-disable-next-line no-useless-call\n this.onDeltaAction.call(this, lociComparison, newLoci);\n }\n\n this.nextEvent();\n }\n\n /**\n * Resume from a paused state\n * @returns {undefined}\n */\n resume() {\n LoggerProxy.logger.info('Locus-info:parser#resume --> Locus parser resumed.');\n // @ts-ignore\n this.status = Parser.status.WORKING;\n this.nextEvent();\n }\n\n /**\n * Gets related debug info for given error code\n * @param {string} debugCode Debug code\n * @param {string} comparison Locus comparison string\n * @returns {object} Debug message\n */\n static getDebugMessage(debugCode: string, comparison: string) {\n // removes extra spaces from multiline string\n const mStr = (strings) => strings.join('').replace(/\\s{2,}/g, ' ');\n\n const resolutionMap = {\n EQ: `${Parser.loci.LT}: is equal (current == incoming).`,\n LT: `${Parser.loci.LT}: choose right side (incoming).`,\n GT: `${Parser.loci.GT}: choose left side (current).`,\n };\n\n const debugMap = {\n SO001: {\n title: 'checkSequenceOverlap-001',\n description: mStr`Occurs if earliest working copy sequence is more \\\n recent than last incoming sequence.`,\n logic: 'current.min > incoming.max',\n },\n\n SO002: {\n title: 'checkSequenceOverlap-002',\n description: mStr`Occurs if last working copy sequence is before the \\\n earliest incoming sequence.`,\n logic: 'current.max < incoming.min',\n },\n\n UR001: {\n title: 'checkUnequalRanges-001',\n description: mStr`Occurs if there are no unique values for both loci, \\\n and the current working copy loci has a larger range.`,\n logic: 'currentTotalRange > incomingTotalRange',\n },\n\n UR002: {\n title: 'checkUnequalRanges-002',\n description: mStr`Occurs if there are no unique values for both loci, \\\n and the incoming delta loci has a larger range.`,\n logic: 'currentTotalRange < incomingTotalRange',\n },\n\n UR003: {\n title: 'checkUnequalRanges-003',\n description: mStr`Occurs if there are no unique values for both loci, \\\n and with ranges either absent or of the same size, the sequences \\\n are considered equal.`,\n logic: 'currentTotalRange == incomingTotalRange',\n },\n\n UE001: {\n title: 'checkForUniqueEntries-001',\n description: mStr`Occurs if current loci has unique entries and \\\n incoming does not. Entries are considered unique if they \\\n do not overlap with other Loci sequences or range values.`,\n logic: 'currentIsUnique && !incomingIsUnique',\n },\n\n UE002: {\n title: 'checkForUniqueEntries-002',\n description: mStr`Occurs if current has no unique entries but \\\n incoming does. Entries are considered unique if they \\\n do not overlap with other Loci sequences or range values.`,\n logic: '!currentIsUnique && incomingIsUnique',\n },\n\n OOS001: {\n title: 'checkIfOutOfSync-001',\n description: mStr`Occurs if neither sequence has a range, or \\\n if the current loci unique entries overlap the total range of the \\\n incoming sequence, or if the incoming unique entries overlap \\\n the total range of current sequence.`,\n logic: 'neitherSeqHasRange || currentUniqOverlap || incomingUniqOverlap',\n },\n\n OOS002: {\n title: 'checkIfOutOfSync-002',\n description: mStr`Occurs if the minimum value from sequences that are \\\n unique to the current loci is greater than the minimum value from \\\n sequences that are unique to the incoming loci.`,\n logic: 'currentUniqueMin > incomingUniqueMin',\n },\n\n OOS003: {\n title: 'checkIfOutOfSync-003',\n description: mStr`Occurs if none of the comparison rules applied. \\\n It is a catch all.`,\n logic: 'else (catch all)',\n },\n };\n\n const debugObj = debugMap[debugCode];\n\n debugObj.title = `Debug: ${debugObj.title}`;\n debugObj.resolution = resolutionMap[comparison];\n\n return debugObj;\n }\n}\n"],"mappings":";;;;;;;;;;;;;AAEA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAF,sBAAA,CAAAC,OAAA;AAAsD,IAAAE,eAAA,EAAAC,gBAAA,EAAAC,gBAAA,EAAAC,gBAAA,EAAAC,gBAAA,EAAAC,gBAAA,EAAAC,gBAAA,EAAAC,gBAAA,EAAAC,gBAAA,EAAAC,iBAAA;AAEtD;AACA;AACA;AACA;AACA;AAJA,IAKqBC,MAAM;EACzB;;EAOA;;EAcA;AACF;AACA;EACE,SAAAA,OAAA,EAAc;IAAA,IAAAC,gBAAA,CAAAC,OAAA,QAAAF,MAAA;IAAA,IAAAG,gBAAA,CAAAD,OAAA;IAAA,IAAAC,gBAAA,CAAAD,OAAA;IACZ,IAAI,CAACE,KAAK,GAAG,IAAIC,cAAW,EAAE;IAC9B;IACA,IAAI,CAACC,MAAM,GAAGN,MAAM,CAACM,MAAM,CAACC,IAAI;IAChC,IAAI,CAACC,aAAa,GAAG,IAAI;IACzB,IAAI,CAACC,WAAW,GAAG,IAAI;EACzB;;EAEA;AACF;AACA;AACA;AACA;AACA;AACA;AACA;EAPE,IAAAC,aAAA,CAAAR,OAAA,EAAAF,MAAA;IAAAW,GAAA;IAAAC,KAAA;IAyVA;AACF;AACA;AACA;AACA;IACE,SAAAC,aAAaC,OAAO,EAAE;MAAA,IAA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c;EAC5BgE,WAAW,EAAE,aAAa;EAC1BF,KAAK,EAAE;AACT,CAAC"}
@@ -0,0 +1,2 @@
1
+ declare const SelfUtils: any;
2
+ export default SelfUtils;
@@ -0,0 +1,32 @@
1
+ /*!
2
+ * Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.
3
+ */
4
+ /**
5
+ * MediaDirection
6
+ * @typedef {Object} MediaDirection
7
+ * @property {boolean} sendAudio
8
+ * @property {boolean} receiveAudio
9
+ * @property {boolean} sendVideo
10
+ * @property {boolean} receiveVideo
11
+ * @property {boolean} sendShare
12
+ * @property {boolean} receiveShare
13
+ */
14
+ /**
15
+ * SendOptions
16
+ * @typedef {Object} SendOptions
17
+ * @property sendAudio
18
+ * @property sendVideo
19
+ * @property sendShare
20
+ * @property isSharing
21
+ * @property {Object} sharePreferences
22
+ */
23
+ /**
24
+ *
25
+ * @public
26
+ * @export
27
+ * Mimic browser APIs as "the ultimate browser".
28
+ * Handles the quirks of each browser.
29
+ * Extends and enhances adapter.js, i.e., the "media" file from the web client.
30
+ */
31
+ declare const Media: any;
32
+ export default Media;
@@ -0,0 +1,108 @@
1
+ /**
2
+ * @class MediaProperties
3
+ */
4
+ export default class MediaProperties {
5
+ audioTrack: any;
6
+ localQualityLevel: any;
7
+ mediaDirection: any;
8
+ mediaSettings: any;
9
+ peerConnection: any;
10
+ remoteAudioTrack: any;
11
+ remoteQualityLevel: any;
12
+ remoteShare: any;
13
+ remoteVideoTrack: any;
14
+ shareTrack: any;
15
+ videoDeviceId: any;
16
+ videoTrack: any;
17
+ namespace: string;
18
+ /**
19
+ * @param {Object} [options] -- to auto construct
20
+ * @returns {MediaProperties}
21
+ */
22
+ constructor(options?: any);
23
+ /**
24
+ * Retrieves the preferred video input device
25
+ * @returns {Object|null}
26
+ */
27
+ getVideoDeviceId(): any;
28
+ setMediaDirection(mediaDirection: any): void;
29
+ setMediaSettings(type: any, values: any): void;
30
+ setMediaPeerConnection(peerConnection: any): void;
31
+ setLocalVideoTrack(videoTrack: any): void;
32
+ setLocalAudioTrack(audioTrack: any): void;
33
+ setLocalQualityLevel(localQualityLevel: any): void;
34
+ setLocalShareTrack(shareTrack: any): void;
35
+ setRemoteQualityLevel(remoteQualityLevel: any): void;
36
+ setRemoteShare(remoteShare: any): void;
37
+ /**
38
+ * Sets the remote audio track
39
+ * @param {MediaTrack} remoteAudioTrack MediaTrack to save
40
+ * @returns {void}
41
+ */
42
+ setRemoteAudioTrack(remoteAudioTrack: any): void;
43
+ /**
44
+ * Sets the remote video track
45
+ * @param {MediaTrack} remoteVideoTrack MediaTrack to save
46
+ * @returns {void}
47
+ */
48
+ setRemoteVideoTrack(remoteVideoTrack: any): void;
49
+ /**
50
+ * Stores the preferred video input device
51
+ * @param {string} deviceId Preferred video input device
52
+ * @returns {void}
53
+ */
54
+ setVideoDeviceId(deviceId: string): void;
55
+ unsetPeerConnection(): void;
56
+ reInitiatePeerconnection(turnServerInfo: any): void;
57
+ unsetLocalVideoTrack(): void;
58
+ unsetLocalShareTrack(): void;
59
+ unsetLocalAudioTrack(): void;
60
+ /**
61
+ * Removes remote stream from class instance
62
+ * @deprecated after v1.89.3
63
+ * @returns {void}
64
+ */
65
+ unsetRemoteStream(): void;
66
+ /**
67
+ * Removes both remote audio and video from class instance
68
+ * @returns {void}
69
+ */
70
+ unsetRemoteMedia(): void;
71
+ unsetRemoteShare(): void;
72
+ unsetLocalVideoTracks(): void;
73
+ /**
74
+ * Removes remote stream and remote share from class instance
75
+ * @deprecated after v1.89.3
76
+ * @returns {void}
77
+ */
78
+ unsetRemoteStreams(): void;
79
+ /**
80
+ * Unsets all remote tracks
81
+ * @returns {void}
82
+ */
83
+ unsetRemoteTracks(): void;
84
+ unsetShareStreams(): void;
85
+ /**
86
+ * Removes both local and remote video stream from class instance
87
+ * @deprecated after v1.89.3
88
+ * @returns {void}
89
+ */
90
+ unsetMediaStreams(): void;
91
+ /**
92
+ * Removes both local and remote video stream from class instance
93
+ * @returns {void}
94
+ */
95
+ unsetMediaTracks(): void;
96
+ /**
97
+ * Waits until ice connection is established
98
+ *
99
+ * @returns {Promise<void>}
100
+ */
101
+ waitForIceConnectedState(): Promise<void>;
102
+ /**
103
+ * Returns the type of a connection that has been established
104
+ *
105
+ * @returns {Promise<'UDP' | 'TCP' | 'TURN-TLS' | 'TURN-TCP' | 'TURN-UDP' | 'unknown'>}
106
+ */
107
+ getCurrentConnectionType(): Promise<string>;
108
+ }
@@ -0,0 +1,2 @@
1
+ declare const MediaUtil: any;
2
+ export default MediaUtil;