@webex/plugin-meetings 3.10.0-next.3 → 3.10.0-next.30

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 (274) hide show
  1. package/dist/annotation/annotation.types.js.map +1 -1
  2. package/dist/annotation/constants.js.map +1 -1
  3. package/dist/annotation/index.js +19 -22
  4. package/dist/annotation/index.js.map +1 -1
  5. package/dist/breakouts/breakout.js +6 -6
  6. package/dist/breakouts/breakout.js.map +1 -1
  7. package/dist/breakouts/collection.js.map +1 -1
  8. package/dist/breakouts/edit-lock-error.js +9 -11
  9. package/dist/breakouts/edit-lock-error.js.map +1 -1
  10. package/dist/breakouts/events.js.map +1 -1
  11. package/dist/breakouts/index.js +126 -127
  12. package/dist/breakouts/index.js.map +1 -1
  13. package/dist/breakouts/request.js +6 -8
  14. package/dist/breakouts/request.js.map +1 -1
  15. package/dist/breakouts/utils.js.map +1 -1
  16. package/dist/common/browser-detection.js.map +1 -1
  17. package/dist/common/collection.js +1 -2
  18. package/dist/common/collection.js.map +1 -1
  19. package/dist/common/config.js.map +1 -1
  20. package/dist/common/errors/captcha-error.js +9 -11
  21. package/dist/common/errors/captcha-error.js.map +1 -1
  22. package/dist/common/errors/intent-to-join.js +10 -12
  23. package/dist/common/errors/intent-to-join.js.map +1 -1
  24. package/dist/common/errors/join-forbidden-error.js +10 -12
  25. package/dist/common/errors/join-forbidden-error.js.map +1 -1
  26. package/dist/common/errors/join-meeting.js +10 -12
  27. package/dist/common/errors/join-meeting.js.map +1 -1
  28. package/dist/common/errors/join-webinar-error.js +9 -11
  29. package/dist/common/errors/join-webinar-error.js.map +1 -1
  30. package/dist/common/errors/media.js +9 -11
  31. package/dist/common/errors/media.js.map +1 -1
  32. package/dist/common/errors/multistream-not-supported-error.js +9 -11
  33. package/dist/common/errors/multistream-not-supported-error.js.map +1 -1
  34. package/dist/common/errors/no-meeting-info.js +9 -11
  35. package/dist/common/errors/no-meeting-info.js.map +1 -1
  36. package/dist/common/errors/parameter.js +11 -14
  37. package/dist/common/errors/parameter.js.map +1 -1
  38. package/dist/common/errors/password-error.js +9 -11
  39. package/dist/common/errors/password-error.js.map +1 -1
  40. package/dist/common/errors/permission.js +9 -11
  41. package/dist/common/errors/permission.js.map +1 -1
  42. package/dist/common/errors/reclaim-host-role-errors.js +32 -38
  43. package/dist/common/errors/reclaim-host-role-errors.js.map +1 -1
  44. package/dist/common/errors/reconnection-not-started.js +5 -6
  45. package/dist/common/errors/reconnection-not-started.js.map +1 -1
  46. package/dist/common/errors/reconnection.js +9 -11
  47. package/dist/common/errors/reconnection.js.map +1 -1
  48. package/dist/common/errors/stats.js +9 -11
  49. package/dist/common/errors/stats.js.map +1 -1
  50. package/dist/common/errors/webex-errors.js +20 -29
  51. package/dist/common/errors/webex-errors.js.map +1 -1
  52. package/dist/common/errors/webex-meetings-error.js +9 -12
  53. package/dist/common/errors/webex-meetings-error.js.map +1 -1
  54. package/dist/common/events/events-scope.js +9 -10
  55. package/dist/common/events/events-scope.js.map +1 -1
  56. package/dist/common/events/events.js +9 -10
  57. package/dist/common/events/events.js.map +1 -1
  58. package/dist/common/events/trigger-proxy.js.map +1 -1
  59. package/dist/common/events/util.js.map +1 -1
  60. package/dist/common/logs/logger-config.js.map +1 -1
  61. package/dist/common/logs/logger-proxy.js.map +1 -1
  62. package/dist/common/logs/request.js +17 -17
  63. package/dist/common/logs/request.js.map +1 -1
  64. package/dist/common/queue.js +1 -2
  65. package/dist/common/queue.js.map +1 -1
  66. package/dist/config.js +2 -2
  67. package/dist/config.js.map +1 -1
  68. package/dist/constants.js +11 -8
  69. package/dist/constants.js.map +1 -1
  70. package/dist/controls-options-manager/constants.js.map +1 -1
  71. package/dist/controls-options-manager/enums.js.map +1 -1
  72. package/dist/controls-options-manager/index.js +1 -2
  73. package/dist/controls-options-manager/index.js.map +1 -1
  74. package/dist/controls-options-manager/types.js.map +1 -1
  75. package/dist/controls-options-manager/util.js +1 -2
  76. package/dist/controls-options-manager/util.js.map +1 -1
  77. package/dist/hashTree/constants.js +20 -0
  78. package/dist/hashTree/constants.js.map +1 -0
  79. package/dist/hashTree/hashTree.js +515 -0
  80. package/dist/hashTree/hashTree.js.map +1 -0
  81. package/dist/hashTree/hashTreeParser.js +1250 -0
  82. package/dist/hashTree/hashTreeParser.js.map +1 -0
  83. package/dist/hashTree/types.js +23 -0
  84. package/dist/hashTree/types.js.map +1 -0
  85. package/dist/hashTree/utils.js +59 -0
  86. package/dist/hashTree/utils.js.map +1 -0
  87. package/dist/index.js +1 -2
  88. package/dist/index.js.map +1 -1
  89. package/dist/interceptors/index.js.map +1 -1
  90. package/dist/interceptors/locusRetry.js +6 -8
  91. package/dist/interceptors/locusRetry.js.map +1 -1
  92. package/dist/interceptors/locusRouteToken.js +26 -12
  93. package/dist/interceptors/locusRouteToken.js.map +1 -1
  94. package/dist/interpretation/collection.js.map +1 -1
  95. package/dist/interpretation/index.js +1 -2
  96. package/dist/interpretation/index.js.map +1 -1
  97. package/dist/interpretation/siLanguage.js +1 -1
  98. package/dist/interpretation/siLanguage.js.map +1 -1
  99. package/dist/locus-info/controlsUtils.js.map +1 -1
  100. package/dist/locus-info/embeddedAppsUtils.js.map +1 -1
  101. package/dist/locus-info/fullState.js.map +1 -1
  102. package/dist/locus-info/hostUtils.js.map +1 -1
  103. package/dist/locus-info/index.js +609 -177
  104. package/dist/locus-info/index.js.map +1 -1
  105. package/dist/locus-info/infoUtils.js.map +1 -1
  106. package/dist/locus-info/mediaSharesUtils.js.map +1 -1
  107. package/dist/locus-info/parser.js +3 -4
  108. package/dist/locus-info/parser.js.map +1 -1
  109. package/dist/locus-info/selfUtils.js.map +1 -1
  110. package/dist/locus-info/types.js +7 -0
  111. package/dist/locus-info/types.js.map +1 -0
  112. package/dist/media/MediaConnectionAwaiter.js +1 -2
  113. package/dist/media/MediaConnectionAwaiter.js.map +1 -1
  114. package/dist/media/index.js +0 -2
  115. package/dist/media/index.js.map +1 -1
  116. package/dist/media/properties.js +15 -17
  117. package/dist/media/properties.js.map +1 -1
  118. package/dist/media/util.js.map +1 -1
  119. package/dist/meeting/brbState.js +8 -9
  120. package/dist/meeting/brbState.js.map +1 -1
  121. package/dist/meeting/connectionStateHandler.js +10 -13
  122. package/dist/meeting/connectionStateHandler.js.map +1 -1
  123. package/dist/meeting/in-meeting-actions.js.map +1 -1
  124. package/dist/meeting/index.js +1576 -1533
  125. package/dist/meeting/index.js.map +1 -1
  126. package/dist/meeting/locusMediaRequest.js +13 -17
  127. package/dist/meeting/locusMediaRequest.js.map +1 -1
  128. package/dist/meeting/muteState.js +11 -12
  129. package/dist/meeting/muteState.js.map +1 -1
  130. package/dist/meeting/request.js +101 -104
  131. package/dist/meeting/request.js.map +1 -1
  132. package/dist/meeting/request.type.js.map +1 -1
  133. package/dist/meeting/state.js.map +1 -1
  134. package/dist/meeting/type.js.map +1 -1
  135. package/dist/meeting/util.js +24 -23
  136. package/dist/meeting/util.js.map +1 -1
  137. package/dist/meeting/voicea-meeting.js +3 -3
  138. package/dist/meeting/voicea-meeting.js.map +1 -1
  139. package/dist/meeting-info/collection.js +7 -10
  140. package/dist/meeting-info/collection.js.map +1 -1
  141. package/dist/meeting-info/index.js +1 -2
  142. package/dist/meeting-info/index.js.map +1 -1
  143. package/dist/meeting-info/meeting-info-v2.js +135 -146
  144. package/dist/meeting-info/meeting-info-v2.js.map +1 -1
  145. package/dist/meeting-info/request.js +1 -2
  146. package/dist/meeting-info/request.js.map +1 -1
  147. package/dist/meeting-info/util.js +36 -37
  148. package/dist/meeting-info/util.js.map +1 -1
  149. package/dist/meeting-info/utilv2.js +30 -31
  150. package/dist/meeting-info/utilv2.js.map +1 -1
  151. package/dist/meetings/collection.js +6 -8
  152. package/dist/meetings/collection.js.map +1 -1
  153. package/dist/meetings/index.js +200 -148
  154. package/dist/meetings/index.js.map +1 -1
  155. package/dist/meetings/meetings.types.js.map +1 -1
  156. package/dist/meetings/request.js +6 -8
  157. package/dist/meetings/request.js.map +1 -1
  158. package/dist/meetings/util.js +36 -30
  159. package/dist/meetings/util.js.map +1 -1
  160. package/dist/member/index.js +1 -2
  161. package/dist/member/index.js.map +1 -1
  162. package/dist/member/types.js +6 -3
  163. package/dist/member/types.js.map +1 -1
  164. package/dist/member/util.js.map +1 -1
  165. package/dist/members/collection.js +1 -2
  166. package/dist/members/collection.js.map +1 -1
  167. package/dist/members/index.js +18 -21
  168. package/dist/members/index.js.map +1 -1
  169. package/dist/members/request.js +8 -11
  170. package/dist/members/request.js.map +1 -1
  171. package/dist/members/types.js.map +1 -1
  172. package/dist/members/util.js.map +1 -1
  173. package/dist/metrics/constants.js +3 -1
  174. package/dist/metrics/constants.js.map +1 -1
  175. package/dist/metrics/index.js +3 -4
  176. package/dist/metrics/index.js.map +1 -1
  177. package/dist/multistream/mediaRequestManager.js +1 -2
  178. package/dist/multistream/mediaRequestManager.js.map +1 -1
  179. package/dist/multistream/receiveSlot.js +34 -45
  180. package/dist/multistream/receiveSlot.js.map +1 -1
  181. package/dist/multistream/receiveSlotManager.js +8 -9
  182. package/dist/multistream/receiveSlotManager.js.map +1 -1
  183. package/dist/multistream/remoteMedia.js +12 -15
  184. package/dist/multistream/remoteMedia.js.map +1 -1
  185. package/dist/multistream/remoteMediaGroup.js +1 -2
  186. package/dist/multistream/remoteMediaGroup.js.map +1 -1
  187. package/dist/multistream/remoteMediaManager.js +122 -123
  188. package/dist/multistream/remoteMediaManager.js.map +1 -1
  189. package/dist/multistream/sendSlotManager.js +29 -30
  190. package/dist/multistream/sendSlotManager.js.map +1 -1
  191. package/dist/personal-meeting-room/index.js +16 -19
  192. package/dist/personal-meeting-room/index.js.map +1 -1
  193. package/dist/personal-meeting-room/request.js +7 -10
  194. package/dist/personal-meeting-room/request.js.map +1 -1
  195. package/dist/personal-meeting-room/util.js.map +1 -1
  196. package/dist/reachability/clusterReachability.js +188 -352
  197. package/dist/reachability/clusterReachability.js.map +1 -1
  198. package/dist/reachability/index.js +206 -206
  199. package/dist/reachability/index.js.map +1 -1
  200. package/dist/reachability/reachability.types.js +14 -1
  201. package/dist/reachability/reachability.types.js.map +1 -1
  202. package/dist/reachability/reachabilityPeerConnection.js +445 -0
  203. package/dist/reachability/reachabilityPeerConnection.js.map +1 -0
  204. package/dist/reachability/request.js.map +1 -1
  205. package/dist/reachability/util.js.map +1 -1
  206. package/dist/reactions/constants.js.map +1 -1
  207. package/dist/reactions/reactions.js.map +1 -1
  208. package/dist/reactions/reactions.type.js.map +1 -1
  209. package/dist/reconnection-manager/index.js +178 -176
  210. package/dist/reconnection-manager/index.js.map +1 -1
  211. package/dist/recording-controller/enums.js.map +1 -1
  212. package/dist/recording-controller/index.js +1 -2
  213. package/dist/recording-controller/index.js.map +1 -1
  214. package/dist/recording-controller/util.js.map +1 -1
  215. package/dist/roap/index.js +12 -15
  216. package/dist/roap/index.js.map +1 -1
  217. package/dist/roap/request.js +24 -26
  218. package/dist/roap/request.js.map +1 -1
  219. package/dist/roap/turnDiscovery.js +75 -76
  220. package/dist/roap/turnDiscovery.js.map +1 -1
  221. package/dist/roap/types.js.map +1 -1
  222. package/dist/transcription/index.js +4 -5
  223. package/dist/transcription/index.js.map +1 -1
  224. package/dist/types/config.d.ts +1 -0
  225. package/dist/types/constants.d.ts +26 -21
  226. package/dist/types/hashTree/constants.d.ts +8 -0
  227. package/dist/types/hashTree/hashTree.d.ts +129 -0
  228. package/dist/types/hashTree/hashTreeParser.d.ts +250 -0
  229. package/dist/types/hashTree/types.d.ts +33 -0
  230. package/dist/types/hashTree/utils.d.ts +16 -0
  231. package/dist/types/interceptors/locusRouteToken.d.ts +1 -0
  232. package/dist/types/locus-info/index.d.ts +98 -80
  233. package/dist/types/locus-info/types.d.ts +54 -0
  234. package/dist/types/meeting/index.d.ts +22 -9
  235. package/dist/types/meetings/index.d.ts +9 -2
  236. package/dist/types/metrics/constants.d.ts +2 -0
  237. package/dist/types/reachability/clusterReachability.d.ts +33 -84
  238. package/dist/types/reachability/reachability.types.d.ts +12 -1
  239. package/dist/types/reachability/reachabilityPeerConnection.d.ts +111 -0
  240. package/dist/webinar/collection.js +1 -2
  241. package/dist/webinar/collection.js.map +1 -1
  242. package/dist/webinar/index.js +148 -158
  243. package/dist/webinar/index.js.map +1 -1
  244. package/package.json +23 -22
  245. package/src/config.ts +1 -0
  246. package/src/constants.ts +13 -1
  247. package/src/hashTree/constants.ts +9 -0
  248. package/src/hashTree/hashTree.ts +463 -0
  249. package/src/hashTree/hashTreeParser.ts +1143 -0
  250. package/src/hashTree/types.ts +39 -0
  251. package/src/hashTree/utils.ts +53 -0
  252. package/src/interceptors/locusRouteToken.ts +16 -4
  253. package/src/locus-info/index.ts +625 -164
  254. package/src/locus-info/types.ts +53 -0
  255. package/src/meeting/index.ts +78 -27
  256. package/src/meeting/util.ts +1 -0
  257. package/src/meetings/index.ts +119 -59
  258. package/src/meetings/util.ts +10 -9
  259. package/src/metrics/constants.ts +2 -0
  260. package/src/reachability/clusterReachability.ts +159 -330
  261. package/src/reachability/index.ts +6 -1
  262. package/src/reachability/reachability.types.ts +15 -1
  263. package/src/reachability/reachabilityPeerConnection.ts +418 -0
  264. package/test/unit/spec/hashTree/hashTree.ts +655 -0
  265. package/test/unit/spec/hashTree/hashTreeParser.ts +1524 -0
  266. package/test/unit/spec/hashTree/utils.ts +140 -0
  267. package/test/unit/spec/interceptors/locusRouteToken.ts +27 -0
  268. package/test/unit/spec/locus-info/index.js +851 -16
  269. package/test/unit/spec/meeting/index.js +120 -20
  270. package/test/unit/spec/meeting/utils.js +77 -0
  271. package/test/unit/spec/meetings/index.js +263 -27
  272. package/test/unit/spec/meetings/utils.js +51 -1
  273. package/test/unit/spec/reachability/clusterReachability.ts +404 -137
  274. package/test/unit/spec/reachability/index.ts +3 -3
@@ -0,0 +1,250 @@
1
+ import HashTree from './hashTree';
2
+ import { Enum } from '../constants';
3
+ import { HashTreeObject } from './types';
4
+ import { LocusDTO } from '../locus-info/types';
5
+ export interface DataSet {
6
+ url: string;
7
+ root: string;
8
+ version: number;
9
+ leafCount: number;
10
+ name: string;
11
+ idleMs: number;
12
+ backoff: {
13
+ maxMs: number;
14
+ exponent: number;
15
+ };
16
+ }
17
+ export interface RootHashMessage {
18
+ dataSets: Array<DataSet>;
19
+ }
20
+ export interface HashTreeMessage {
21
+ dataSets: Array<DataSet>;
22
+ visibleDataSetsUrl: string;
23
+ locusStateElements?: Array<HashTreeObject>;
24
+ locusSessionId?: string;
25
+ locusUrl: string;
26
+ }
27
+ interface InternalDataSet extends DataSet {
28
+ hashTree?: HashTree;
29
+ timer?: ReturnType<typeof setTimeout>;
30
+ }
31
+ type WebexRequestMethod = (options: Record<string, any>) => Promise<any>;
32
+ export declare const LocusInfoUpdateType: {
33
+ readonly OBJECTS_UPDATED: "OBJECTS_UPDATED";
34
+ readonly MEETING_ENDED: "MEETING_ENDED";
35
+ };
36
+ export type LocusInfoUpdateType = Enum<typeof LocusInfoUpdateType>;
37
+ export type LocusInfoUpdateCallback = (updateType: LocusInfoUpdateType, data?: {
38
+ updatedObjects: HashTreeObject[];
39
+ }) => void;
40
+ /**
41
+ * Parses hash tree eventing locus data
42
+ */
43
+ declare class HashTreeParser {
44
+ dataSets: Record<string, InternalDataSet>;
45
+ visibleDataSetsUrl: string;
46
+ webexRequest: WebexRequestMethod;
47
+ locusInfoUpdateCallback: LocusInfoUpdateCallback;
48
+ visibleDataSets: string[];
49
+ debugId: string;
50
+ /**
51
+ * Constructor for HashTreeParser
52
+ * @param {Object} options
53
+ * @param {Object} options.initialLocus The initial locus data containing the hash tree information
54
+ */
55
+ constructor(options: {
56
+ initialLocus: {
57
+ dataSets: Array<DataSet>;
58
+ locus: any;
59
+ };
60
+ webexRequest: WebexRequestMethod;
61
+ locusInfoUpdateCallback: LocusInfoUpdateCallback;
62
+ debugId: string;
63
+ });
64
+ /**
65
+ * Initializes a new visible data set by creating a hash tree for it, adding it to all the internal structures,
66
+ * and sending an initial sync request to Locus with empty leaf data - that will trigger Locus to gives us all the data
67
+ * from that dataset (in the response or via messages).
68
+ *
69
+ * @param {DataSet} dataSet The new data set to be added
70
+ * @returns {Promise}
71
+ */
72
+ private initializeNewVisibleDataSet;
73
+ /**
74
+ * Sends a special sync request to Locus with all leaves empty - this is a way to get all the data for a given dataset.
75
+ *
76
+ * @param {string} datasetName - name of the dataset for which to send the request
77
+ * @param {string} debugText - text to include in logs
78
+ * @returns {Promise}
79
+ */
80
+ private sendInitializationSyncRequestToLocus;
81
+ /**
82
+ * Queries Locus for information about all the data sets
83
+ *
84
+ * @param {string} url - url from which we can get info about all data sets
85
+ * @returns {Promise}
86
+ */
87
+ private getAllDataSetsMetadata;
88
+ /**
89
+ * Initializes the hash tree parser from a message received from Locus.
90
+ *
91
+ * @param {HashTreeMessage} message - initial hash tree message received from Locus
92
+ * @returns {Promise}
93
+ */
94
+ initializeFromMessage(message: HashTreeMessage): Promise<void>;
95
+ /**
96
+ * Initializes the hash tree parser from GET /loci API response by fetching all data sets metadata
97
+ * first and then doing an initialization sync on each data set
98
+ *
99
+ * This function requires that this.visibleDataSets have been already populated correctly by the constructor.
100
+ *
101
+ * @param {LocusDTO} locus - locus object received from GET /loci
102
+ * @returns {Promise}
103
+ */
104
+ initializeFromGetLociResponse(locus: LocusDTO): Promise<void>;
105
+ /**
106
+ * Initializes data sets by doing an initialization sync on each visible data set that doesn't have a hash tree yet.
107
+ *
108
+ * @param {DataSet[]} dataSets Array of DataSet objects to initialize
109
+ * @param {string} debugText Text to include in logs for debugging purposes
110
+ * @returns {Promise}
111
+ */
112
+ private initializeDataSets;
113
+ /**
114
+ * Each dataset exists at a different place in the dto
115
+ * iterate recursively over the locus and if it has a htMeta key,
116
+ * create an object with the type, id and version and add it to the appropriate leafData array
117
+ *
118
+ * @param {any} locus - The current part of the locus being processed
119
+ * @param {Object} [options]
120
+ * @param {boolean} [options.copyData=false] - Whether to copy the data for each leaf into returned result
121
+ * @returns {any} - An object mapping dataset names to arrays of leaf data
122
+ */
123
+ private analyzeLocusHtMeta;
124
+ /**
125
+ * Checks if the provided hash tree message indicates the end of the meeting and that there won't be any more updates.
126
+ *
127
+ * @param {HashTreeMessage} message - The hash tree message to check
128
+ * @returns {boolean} - Returns true if the message indicates the end of the meeting, false otherwise
129
+ */
130
+ private isEndMessage;
131
+ /**
132
+ * Handles the root hash heartbeat message
133
+ *
134
+ * @param {RootHashMessage} message - The root hash heartbeat message
135
+ * @returns {void}
136
+ */
137
+ private handleRootHashHeartBeatMessage;
138
+ /**
139
+ * This method should be called when we receive a partial locus DTO that contains dataSets and htMeta information
140
+ * It updates the hash trees with the new leaf data based on the received Locus
141
+ *
142
+ * @param {Object} update - The locus update containing data sets and locus information
143
+ * @returns {void}
144
+ */
145
+ handleLocusUpdate(update: {
146
+ dataSets?: Array<DataSet>;
147
+ locus: any;
148
+ }): void;
149
+ /**
150
+ * Updates the internal data set information based on the received data set from Locus.
151
+ *
152
+ * @param {DataSet} receivedDataSet - The latest data set information received from Locus to update the internal state.
153
+ * @returns {void}
154
+ */
155
+ private updateDataSetInfo;
156
+ /**
157
+ * Checks for changes in the visible data sets based on the updated objects.
158
+ * @param {HashTreeObject[]} updatedObjects - The list of updated hash tree objects.
159
+ * @returns {Object} An object containing the removed and added visible data sets.
160
+ */
161
+ private checkForVisibleDataSetChanges;
162
+ /**
163
+ * Deletes the hash tree for the specified data set.
164
+ *
165
+ * @param {string} dataSetName name of the data set to delete
166
+ * @returns {void}
167
+ */
168
+ private deleteHashTree;
169
+ /**
170
+ * Adds entries to the passed in updateObjects array
171
+ * for the changes that result from removing visible data sets and creates hash
172
+ * trees for the new visible data sets, but without populating the hash trees.
173
+ *
174
+ * This function is synchronous. If we are missing information about some new
175
+ * visible data sets and they require async initialization, the names of these data sets
176
+ * are returned in an array.
177
+ *
178
+ * @param {string[]} removedDataSets - The list of removed data sets.
179
+ * @param {string[]} addedDataSets - The list of added data sets.
180
+ * @param {HashTreeObject[]} updatedObjects - The list of updated hash tree objects to which changes will be added.
181
+ * @returns {string[]} names of data sets that couldn't be initialized synchronously
182
+ */
183
+ private processVisibleDataSetChanges;
184
+ /**
185
+ * Adds entries to the passed in updateObjects array
186
+ * for the changes that result from adding and removing visible data sets.
187
+ *
188
+ * @param {HashTreeMessage} message - The hash tree message that triggered the visible data set changes.
189
+ * @param {string[]} addedDataSets - The list of added data sets.
190
+ * @returns {Promise<void>}
191
+ */
192
+ private initializeNewVisibleDataSets;
193
+ /**
194
+ * Parses incoming hash tree messages, updates the hash trees and returns information about the changes
195
+ *
196
+ * @param {HashTreeMessage} message - The hash tree message containing data sets and objects to be processed
197
+ * @param {string} [debugText] - Optional debug text to include in logs
198
+ * @returns {Promise}
199
+ */
200
+ private parseMessage;
201
+ /**
202
+ * Handles incoming hash tree messages, updates the hash trees and calls locusInfoUpdateCallback
203
+ *
204
+ * @param {HashTreeMessage} message - The hash tree message containing data sets and objects to be processed
205
+ * @param {string} [debugText] - Optional debug text to include in logs
206
+ * @returns {void}
207
+ */
208
+ handleMessage(message: HashTreeMessage, debugText?: string): Promise<void>;
209
+ /**
210
+ * Calls the updateInfo callback if there are any updates to report
211
+ *
212
+ * @param {Object} updates parsed from a Locus message
213
+ * @returns {void}
214
+ */
215
+ private callLocusInfoUpdateCallback;
216
+ /**
217
+ * Calculates a weighted backoff time that should be used for syncs
218
+ *
219
+ * @param {Object} backoff - The backoff configuration containing maxMs and exponent
220
+ * @returns {number} - A weighted backoff time based on the provided configuration, using algorithm supplied by Locus team
221
+ */
222
+ private getWeightedBackoffTime;
223
+ /**
224
+ * Runs the sync algorithm for the given data set.
225
+ *
226
+ * @param {DataSet} receivedDataSet - The data set to run the sync algorithm for.
227
+ * @returns {void}
228
+ */
229
+ private runSyncAlgorithm;
230
+ /**
231
+ * Stops all timers for the data sets to prevent any further sync attempts.
232
+ * @returns {void}
233
+ */
234
+ private stopAllTimers;
235
+ /**
236
+ * Gets the current hashes from the locus for a specific data set.
237
+ * @param {string} dataSetName
238
+ * @returns {string[]}
239
+ */
240
+ private getHashesFromLocus;
241
+ /**
242
+ * Sends a sync request to Locus for the specified data set.
243
+ *
244
+ * @param {InternalDataSet} dataSet The data set to sync.
245
+ * @param {Record<number, LeafDataItem[]>} mismatchedLeavesData The mismatched leaves data to include in the sync request.
246
+ * @returns {Promise<HashTreeMessage|null>}
247
+ */
248
+ private sendSyncRequestToLocus;
249
+ }
250
+ export default HashTreeParser;
@@ -0,0 +1,33 @@
1
+ import { Enum } from '../constants';
2
+ export declare const ObjectType: {
3
+ readonly participant: "participant";
4
+ readonly self: "self";
5
+ readonly locus: "locus";
6
+ readonly mediaShare: "mediashare";
7
+ readonly info: "info";
8
+ readonly fullState: "fullstate";
9
+ readonly links: "links";
10
+ readonly control: "controlentry";
11
+ };
12
+ export type ObjectType = Enum<typeof ObjectType>;
13
+ export declare const ObjectTypeToLocusKeyMap: {
14
+ links: string;
15
+ info: string;
16
+ fullstate: string;
17
+ self: string;
18
+ participant: string;
19
+ mediashare: string;
20
+ controlentry: string;
21
+ };
22
+ export interface HtMeta {
23
+ elementId: {
24
+ type: ObjectType;
25
+ id: number;
26
+ version: number;
27
+ };
28
+ dataSetNames: string[];
29
+ }
30
+ export interface HashTreeObject {
31
+ htMeta: HtMeta;
32
+ data: Record<string, any>;
33
+ }
@@ -0,0 +1,16 @@
1
+ import { HashTreeObject } from './types';
2
+ /**
3
+ * Checks if the given hash tree object is of type "self"
4
+ * @param {HashTreeObject} object object to check
5
+ * @returns {boolean} True if the object is of type "self", false otherwise
6
+ */
7
+ export declare function isSelf(object: HashTreeObject): boolean;
8
+ /**
9
+ * Analyzes given part of Locus DTO recursively and delete any nested objects that have their own htMeta
10
+ *
11
+ * @param {Object} currentLocusPart part of locus DTO to analyze
12
+ * @param {Object} parent parent object
13
+ * @param {string|number} currentKey key of the parent object that currentLocusPart is
14
+ * @returns {void}
15
+ */
16
+ export declare const deleteNestedObjectsWithHtMeta: (currentLocusPart: any, parent?: any, currentKey?: string | number) => void;
@@ -11,6 +11,7 @@ export default class LocusRouteTokenInterceptor extends Interceptor {
11
11
  */
12
12
  static create(): LocusRouteTokenInterceptor;
13
13
  getLocusIdByRequestUrl(url: string): string;
14
+ getHeader(headers: Record<string, string>, name: string): string;
14
15
  /**
15
16
  * @param {Object} options
16
17
  * @param {HttpResponse} response
@@ -1,45 +1,16 @@
1
1
  import EventsScope from '../common/events/events-scope';
2
- export type LocusDTO = {
3
- controls?: any;
4
- fullState?: {
5
- active: boolean;
6
- count: number;
7
- lastActive: string;
8
- locked: boolean;
9
- sessionId: string;
10
- seessionIds: string[];
11
- startTime: number;
12
- state: string;
13
- type: string;
2
+ import { LOCUSEVENT } from '../constants';
3
+ import HashTreeParser, { DataSet, HashTreeMessage } from '../hashTree/hashTreeParser';
4
+ import { HashTreeObject } from '../hashTree/types';
5
+ import { Links, LocusDTO } from './types';
6
+ export type LocusLLMEvent = {
7
+ data: {
8
+ eventType: typeof LOCUSEVENT.HASH_TREE_DATA_UPDATED;
9
+ stateElementsMessage: HashTreeMessage;
14
10
  };
15
- host?: {
16
- id: string;
17
- incomingCallProtocols: any[];
18
- isExternal: boolean;
19
- name: string;
20
- orgId: string;
21
- };
22
- info?: any;
23
- links?: any;
24
- mediaShares?: any[];
25
- meetings?: any[];
26
- participants: any[];
27
- replaces?: any[];
28
- self?: any;
29
- sequence?: {
30
- dirtyParticipants: number;
31
- entries: number[];
32
- rangeEnd: number;
33
- rangeStart: number;
34
- sequenceHash: number;
35
- sessionToken: string;
36
- since: string;
37
- totalParticipants: number;
38
- };
39
- syncUrl?: string;
40
- url?: string;
41
11
  };
42
12
  export type LocusApiResponseBody = {
13
+ dataSets?: DataSet[];
43
14
  locus: LocusDTO;
44
15
  };
45
16
  /**
@@ -59,10 +30,7 @@ export default class LocusInfo extends EventsScope {
59
30
  aclUrl: any;
60
31
  baseSequence: any;
61
32
  created: any;
62
- identities: any;
63
- membership: any;
64
33
  participants: any;
65
- participantsUrl: any;
66
34
  replaces: any;
67
35
  scheduledMeeting: any;
68
36
  sequence: any;
@@ -74,12 +42,13 @@ export default class LocusInfo extends EventsScope {
74
42
  info: any;
75
43
  roles: any;
76
44
  mediaShares: any;
77
- replace: any;
78
45
  url: any;
79
- services: any;
80
- resources: any;
46
+ links?: Links;
81
47
  mainSessionLocusCache: any;
82
48
  self: any;
49
+ hashTreeParser?: HashTreeParser;
50
+ hashTreeObjectId2ParticipantId: Map<number, string>;
51
+ classicVsHashTreeMismatchMetricCounter: number;
83
52
  /**
84
53
  * Constructor
85
54
  * @param {function} updateMeeting callback to update the meeting object from an object
@@ -90,6 +59,7 @@ export default class LocusInfo extends EventsScope {
90
59
  constructor(updateMeeting: any, webex: any, meetingId: any);
91
60
  /**
92
61
  * Does a Locus sync. It tries to get the latest delta DTO or if it can't, it falls back to getting the full Locus DTO.
62
+ * WARNING: This function must not be used for hash tree based Locus meetings.
93
63
  *
94
64
  * @param {Meeting} meeting
95
65
  * @param {boolean} isLocusUrlChanged
@@ -121,11 +91,28 @@ export default class LocusInfo extends EventsScope {
121
91
  */
122
92
  init(locus?: any): void;
123
93
  /**
124
- * @param {Object} locus
94
+ * Creates the HashTreeParser instance.
95
+ * @param {Object} initial locus data
96
+ * @returns {void}
97
+ */
98
+ private createHashTreeParser;
99
+ /**
100
+ * @param {Object} data - data to initialize locus info with. It may be from a join or GET /loci response or from a Mercury event that triggers a creation of meeting object
125
101
  * @returns {undefined}
126
102
  * @memberof LocusInfo
127
103
  */
128
- initialSetup(locus: object): void;
104
+ initialSetup(data: {
105
+ trigger: 'join-response';
106
+ locus: LocusDTO;
107
+ dataSets?: DataSet[];
108
+ } | {
109
+ trigger: 'locus-message';
110
+ locus?: LocusDTO;
111
+ hashTreeMessage?: HashTreeMessage;
112
+ } | {
113
+ trigger: 'get-loci-response';
114
+ locus?: LocusDTO;
115
+ }): Promise<void>;
129
116
  /**
130
117
  * Handles HTTP response from Locus API call.
131
118
  * @param {Meeting} meeting meeting object
@@ -133,6 +120,39 @@ export default class LocusInfo extends EventsScope {
133
120
  * @returns {void}
134
121
  */
135
122
  handleLocusAPIResponse(meeting: any, responseBody: LocusApiResponseBody): void;
123
+ /**
124
+ *
125
+ * @param {HashTreeObject} object data set object
126
+ * @param {any} locus
127
+ * @returns {void}
128
+ */
129
+ updateLocusFromHashTreeObject(object: HashTreeObject, locus: LocusDTO): LocusDTO;
130
+ /**
131
+ * Sends a metric when we receive something from Locus that uses hash trees while we
132
+ * expect classic deltas or the other way around.
133
+ * @param {Meeting} meeting
134
+ * @param {string} message
135
+ * @returns {void}
136
+ */
137
+ sendClassicVsHashTreeMismatchMetric(meeting: any, message: string): void;
138
+ /**
139
+ * Handles a hash tree message received from Locus.
140
+ *
141
+ * @param {Meeting} meeting - The meeting object
142
+ * @param {eventType} eventType - The event type
143
+ * @param {HashTreeMessage} message incoming hash tree message
144
+ * @returns {void}
145
+ */
146
+ private handleHashTreeMessage;
147
+ /**
148
+ * Callback registered with HashTreeParser to receive locus info updates.
149
+ * Updates our locus info based on the data parsed by the hash tree parser.
150
+ *
151
+ * @param {LocusInfoUpdateType} updateType - The type of update received.
152
+ * @param {Object} [data] - Additional data for the update, if applicable.
153
+ * @returns {void}
154
+ */
155
+ private updateFromHashTree;
136
156
  /**
137
157
  * @param {Meeting} meeting
138
158
  * @param {Object} data
@@ -148,14 +168,39 @@ export default class LocusInfo extends EventsScope {
148
168
  * @memberof LocusInfo
149
169
  */
150
170
  emitScoped(scope?: any, eventName?: string, args?: any): boolean;
171
+ /**
172
+ * Function for handling full locus when it's using hash trees (so not the "classic" one).
173
+ *
174
+ * @param {object} locus locus object
175
+ * @param {string} eventType locus event
176
+ * @param {DataSet[]} dataSets
177
+ * @returns {void}
178
+ */
179
+ private onFullLocusWithHashTrees;
180
+ /**
181
+ * Function for handling full locus when it's the "classic" one (not hash trees)
182
+ *
183
+ * @param {object} locus locus object
184
+ * @param {string} eventType locus event
185
+ * @returns {void}
186
+ */
187
+ private onFullLocusClassic;
151
188
  /**
152
189
  * updates the locus with full locus object
153
190
  * @param {object} locus locus object
154
- * @param {string} eventType particulat locus event
191
+ * @param {string} eventType locus event
192
+ * @param {DataSet[]} dataSets
155
193
  * @returns {object} null
156
194
  * @memberof LocusInfo
157
195
  */
158
- onFullLocus(locus: any, eventType?: string): void;
196
+ onFullLocus(locus: any, eventType?: string, dataSets?: Array<DataSet>): void;
197
+ /**
198
+ * Common part of handling full locus, used by both classic and hash tree based locus handling
199
+ * @param {object} locus locus object
200
+ * @param {string} eventType locus event
201
+ * @returns {void}
202
+ */
203
+ private onFullLocusCommon;
159
204
  /**
160
205
  * @param {String} eventType
161
206
  * @returns {undefined}
@@ -229,21 +274,12 @@ export default class LocusInfo extends EventsScope {
229
274
  */
230
275
  updateCreated(created: object): void;
231
276
  /**
232
- * @param {Object} services
233
- * @returns {undefined}
234
- * @memberof LocusInfo
235
- */
236
- updateServices(services: Record<'breakout' | 'record', {
237
- url: string;
238
- }>): void;
239
- /**
240
- * @param {Object} resources
277
+ * Updates links and emits appropriate events if services or resources have changed
278
+ * @param {Object} links
241
279
  * @returns {undefined}
242
280
  * @memberof LocusInfo
243
281
  */
244
- updateResources(resources: Record<'webcastInstance', {
245
- url: string;
246
- }>): void;
282
+ updateLinks(links?: Links): void;
247
283
  /**
248
284
  * @param {Object} fullState
249
285
  * @returns {undefined}
@@ -281,17 +317,11 @@ export default class LocusInfo extends EventsScope {
281
317
  */
282
318
  updateMediaShares(mediaShares: object, forceUpdate?: boolean): void;
283
319
  /**
284
- * @param {String} participantsUrl
320
+ * @param {Object} replaces
285
321
  * @returns {undefined}
286
322
  * @memberof LocusInfo
287
323
  */
288
- updateParticipantsUrl(participantsUrl: string): void;
289
- /**
290
- * @param {Object} replace
291
- * @returns {undefined}
292
- * @memberof LocusInfo
293
- */
294
- updateReplace(replace: object): void;
324
+ updateReplaces(replaces: object): void;
295
325
  /**
296
326
  * handles when the locus.self is updated
297
327
  * @param {Object} self the new locus.self
@@ -326,18 +356,6 @@ export default class LocusInfo extends EventsScope {
326
356
  * @memberof LocusInfo
327
357
  */
328
358
  updateSequence(sequence: number): void;
329
- /**
330
- * @param {Object} membership
331
- * @returns {undefined}
332
- * @memberof LocusInfo
333
- */
334
- updateMemberShip(membership: object): void;
335
- /**
336
- * @param {Array} identities
337
- * @returns {undefined}
338
- * @memberof LocusInfo
339
- */
340
- updateIdentifiers(identities: Array<any>): void;
341
359
  /**
342
360
  * check the locus is main session's one or not, if is main session's, update main session cache
343
361
  * @param {Object} locus
@@ -0,0 +1,54 @@
1
+ import { HtMeta } from '../hashTree/types';
2
+ export type LocusFullState = {
3
+ active: boolean;
4
+ count: number;
5
+ lastActive: string;
6
+ locked: boolean;
7
+ sessionId: string;
8
+ seessionIds: string[];
9
+ startTime: number;
10
+ state: string;
11
+ type: string;
12
+ };
13
+ export type Links = {
14
+ services: Record<'breakout' | 'record', {
15
+ url: string;
16
+ }>;
17
+ resources: Record<'webcastInstance' | 'visibleDataSets', {
18
+ url: string;
19
+ }>;
20
+ };
21
+ export type LocusDTO = {
22
+ controls?: any;
23
+ fullState?: LocusFullState;
24
+ host?: {
25
+ id: string;
26
+ incomingCallProtocols: any[];
27
+ isExternal: boolean;
28
+ name: string;
29
+ orgId: string;
30
+ };
31
+ htMeta?: HtMeta;
32
+ info?: any;
33
+ jsSdkMeta?: {
34
+ removedParticipantIds: string[];
35
+ };
36
+ links?: Links;
37
+ mediaShares?: any[];
38
+ meetings?: any[];
39
+ participants: any[];
40
+ replaces?: any[];
41
+ self?: any;
42
+ sequence?: {
43
+ dirtyParticipants: number;
44
+ entries: number[];
45
+ rangeEnd: number;
46
+ rangeStart: number;
47
+ sequenceHash: number;
48
+ sessionToken: string;
49
+ since: string;
50
+ totalParticipants: number;
51
+ };
52
+ syncUrl?: string;
53
+ url?: string;
54
+ };
@@ -23,6 +23,8 @@ import { LocusMediaRequest } from './locusMediaRequest';
23
23
  import { BrbState } from './brbState';
24
24
  import { SetStageOptions } from './request.type';
25
25
  import { Invitee } from './type';
26
+ import { DataSet } from '../hashTree/hashTreeParser';
27
+ import { LocusDTO } from '../locus-info/types';
26
28
  export type CaptionData = {
27
29
  id: string;
28
30
  isFinal: boolean;
@@ -1034,25 +1036,30 @@ export default class Meeting extends StatelessWebexPlugin {
1034
1036
  */
1035
1037
  setSipUri(sipUri: string): void;
1036
1038
  /**
1037
- * Set the locus info the class instance
1038
- * @param {Object} locus
1039
- * @param {Array} locus.mediaConnections
1040
- * @param {String} locus.locusUrl
1041
- * @param {String} locus.locusId
1042
- * @param {String} locus.mediaId
1043
- * @param {Object} locus.host
1039
+ * Set the locus info the class instance. Should be called with the parsed locus
1040
+ * we got in the join response.
1041
+ *
1042
+ * @param {Object} data
1043
+ * @param {Array} data.mediaConnections
1044
+ * @param {String} data.locusUrl
1045
+ * @param {String} data.locusId
1046
+ * @param {String} data.mediaId
1047
+ * @param {Object} data.host
1044
1048
  * @todo change name to genertic parser
1045
1049
  * @returns {undefined}
1046
1050
  * @private
1047
1051
  * @memberof Meeting
1048
1052
  */
1049
- setLocus(locus: {
1053
+ setLocus(data: {
1054
+ locus: LocusDTO;
1050
1055
  mediaConnections: Array<any>;
1051
1056
  locusUrl: string;
1052
1057
  locusId: string;
1053
1058
  mediaId: string;
1054
1059
  host: object;
1055
- } | any): void;
1060
+ selfId: string;
1061
+ dataSets: DataSet[];
1062
+ }): void;
1056
1063
  /**
1057
1064
  * Upload logs for the current meeting
1058
1065
  * @param {object} options file name and function name
@@ -1269,6 +1276,12 @@ export default class Meeting extends StatelessWebexPlugin {
1269
1276
  startTranscription(options?: {
1270
1277
  spokenLanguage?: string;
1271
1278
  }): Promise<void>;
1279
+ /** Handles Locus LLM events
1280
+ *
1281
+ * @param {LocusLLMEvent} event - The Locus LLM event to process
1282
+ * @returns {void}
1283
+ */
1284
+ private processLocusLLMEvent;
1272
1285
  /**
1273
1286
  * Callback called when a relay event is received from meeting LLM Connection
1274
1287
  * @param {RelayEvent} e Event object coming from LLM Connection