@webex/plugin-meetings 3.0.0-bnr.4 → 3.0.0-stream-classes.1

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 (303) hide show
  1. package/README.md +46 -8
  2. package/dist/annotation/annotation.types.js +7 -0
  3. package/dist/annotation/annotation.types.js.map +1 -0
  4. package/dist/annotation/constants.js +49 -0
  5. package/dist/annotation/constants.js.map +1 -0
  6. package/dist/annotation/index.js +342 -0
  7. package/dist/annotation/index.js.map +1 -0
  8. package/dist/breakouts/breakout.js +70 -32
  9. package/dist/breakouts/breakout.js.map +1 -1
  10. package/dist/breakouts/events.js +45 -0
  11. package/dist/breakouts/events.js.map +1 -0
  12. package/dist/breakouts/index.js +422 -217
  13. package/dist/breakouts/index.js.map +1 -1
  14. package/dist/breakouts/utils.js +12 -1
  15. package/dist/breakouts/utils.js.map +1 -1
  16. package/dist/common/errors/webex-errors.js +3 -2
  17. package/dist/common/errors/webex-errors.js.map +1 -1
  18. package/dist/common/logs/logger-proxy.js +1 -1
  19. package/dist/common/logs/logger-proxy.js.map +1 -1
  20. package/dist/common/logs/request.d.ts +1 -1
  21. package/dist/common/queue.js +24 -9
  22. package/dist/common/queue.js.map +1 -1
  23. package/dist/config.js +1 -7
  24. package/dist/config.js.map +1 -1
  25. package/dist/constants.js +118 -24
  26. package/dist/constants.js.map +1 -1
  27. package/dist/controls-options-manager/enums.js +2 -0
  28. package/dist/controls-options-manager/enums.js.map +1 -1
  29. package/dist/controls-options-manager/index.js +19 -14
  30. package/dist/controls-options-manager/index.js.map +1 -1
  31. package/dist/controls-options-manager/types.js.map +1 -1
  32. package/dist/controls-options-manager/util.js +80 -11
  33. package/dist/controls-options-manager/util.js.map +1 -1
  34. package/dist/index.js +62 -20
  35. package/dist/index.js.map +1 -1
  36. package/dist/interpretation/collection.js +23 -0
  37. package/dist/interpretation/collection.js.map +1 -0
  38. package/dist/interpretation/index.js +366 -0
  39. package/dist/interpretation/index.js.map +1 -0
  40. package/dist/interpretation/siLanguage.js +25 -0
  41. package/dist/interpretation/siLanguage.js.map +1 -0
  42. package/dist/locus-info/controlsUtils.js +71 -1
  43. package/dist/locus-info/controlsUtils.js.map +1 -1
  44. package/dist/locus-info/index.js +305 -57
  45. package/dist/locus-info/index.js.map +1 -1
  46. package/dist/locus-info/infoUtils.js +7 -1
  47. package/dist/locus-info/infoUtils.js.map +1 -1
  48. package/dist/locus-info/mediaSharesUtils.js +43 -1
  49. package/dist/locus-info/mediaSharesUtils.js.map +1 -1
  50. package/dist/locus-info/parser.js +219 -63
  51. package/dist/locus-info/parser.js.map +1 -1
  52. package/dist/locus-info/selfUtils.js +44 -22
  53. package/dist/locus-info/selfUtils.js.map +1 -1
  54. package/dist/media/index.js +57 -104
  55. package/dist/media/index.js.map +1 -1
  56. package/dist/media/properties.js +60 -121
  57. package/dist/media/properties.js.map +1 -1
  58. package/dist/meeting/in-meeting-actions.js +61 -3
  59. package/dist/meeting/in-meeting-actions.js.map +1 -1
  60. package/dist/meeting/index.js +2530 -2534
  61. package/dist/meeting/index.js.map +1 -1
  62. package/dist/meeting/locusMediaRequest.js +292 -0
  63. package/dist/meeting/locusMediaRequest.js.map +1 -0
  64. package/dist/meeting/muteState.js +125 -205
  65. package/dist/meeting/muteState.js.map +1 -1
  66. package/dist/meeting/request.js +150 -150
  67. package/dist/meeting/request.js.map +1 -1
  68. package/dist/meeting/util.js +568 -438
  69. package/dist/meeting/util.js.map +1 -1
  70. package/dist/meeting-info/index.js +48 -7
  71. package/dist/meeting-info/index.js.map +1 -1
  72. package/dist/meeting-info/meeting-info-v2.js +94 -38
  73. package/dist/meeting-info/meeting-info-v2.js.map +1 -1
  74. package/dist/meeting-info/utilv2.js +4 -2
  75. package/dist/meeting-info/utilv2.js.map +1 -1
  76. package/dist/meetings/index.d.ts +0 -2
  77. package/dist/meetings/index.js +260 -85
  78. package/dist/meetings/index.js.map +1 -1
  79. package/dist/meetings/meetings.types.js +7 -0
  80. package/dist/meetings/meetings.types.js.map +1 -0
  81. package/dist/meetings/util.js +42 -7
  82. package/dist/meetings/util.js.map +1 -1
  83. package/dist/member/index.d.ts +2 -0
  84. package/dist/member/index.js +26 -0
  85. package/dist/member/index.js.map +1 -1
  86. package/dist/member/member.types.d.ts +11 -0
  87. package/dist/member/member.types.js +18 -0
  88. package/dist/member/member.types.js.map +1 -0
  89. package/dist/member/types.js +11 -1
  90. package/dist/member/types.js.map +1 -1
  91. package/dist/member/util.js +60 -23
  92. package/dist/member/util.js.map +1 -1
  93. package/dist/members/index.js +4 -1
  94. package/dist/members/index.js.map +1 -1
  95. package/dist/members/request.js +75 -45
  96. package/dist/members/request.js.map +1 -1
  97. package/dist/members/util.js +308 -317
  98. package/dist/members/util.js.map +1 -1
  99. package/dist/metrics/config.js +1 -3
  100. package/dist/metrics/config.js.map +1 -1
  101. package/dist/metrics/constants.js +1 -0
  102. package/dist/metrics/constants.js.map +1 -1
  103. package/dist/metrics/index.d.ts +1 -1
  104. package/dist/metrics/index.js +1 -451
  105. package/dist/metrics/index.js.map +1 -1
  106. package/dist/multistream/mediaRequestManager.js +136 -40
  107. package/dist/multistream/mediaRequestManager.js.map +1 -1
  108. package/dist/multistream/receiveSlot.js.map +1 -1
  109. package/dist/multistream/receiveSlotManager.js +4 -4
  110. package/dist/multistream/receiveSlotManager.js.map +1 -1
  111. package/dist/multistream/remoteMedia.js.map +1 -1
  112. package/dist/multistream/remoteMediaGroup.js +60 -3
  113. package/dist/multistream/remoteMediaGroup.js.map +1 -1
  114. package/dist/multistream/remoteMediaManager.js +36 -0
  115. package/dist/multistream/remoteMediaManager.js.map +1 -1
  116. package/dist/multistream/sendSlotManager.js +233 -0
  117. package/dist/multistream/sendSlotManager.js.map +1 -0
  118. package/dist/reachability/index.js +18 -3
  119. package/dist/reachability/index.js.map +1 -1
  120. package/dist/reachability/request.js +5 -3
  121. package/dist/reachability/request.js.map +1 -1
  122. package/dist/reconnection-manager/index.js +181 -153
  123. package/dist/reconnection-manager/index.js.map +1 -1
  124. package/dist/recording-controller/index.js +21 -2
  125. package/dist/recording-controller/index.js.map +1 -1
  126. package/dist/recording-controller/util.js +9 -8
  127. package/dist/recording-controller/util.js.map +1 -1
  128. package/dist/roap/index.js +25 -32
  129. package/dist/roap/index.js.map +1 -1
  130. package/dist/roap/request.js +42 -51
  131. package/dist/roap/request.js.map +1 -1
  132. package/dist/roap/turnDiscovery.js +97 -38
  133. package/dist/roap/turnDiscovery.js.map +1 -1
  134. package/dist/rtcMetrics/constants.js +12 -0
  135. package/dist/rtcMetrics/constants.js.map +1 -0
  136. package/dist/rtcMetrics/index.js +117 -0
  137. package/dist/rtcMetrics/index.js.map +1 -0
  138. package/dist/statsAnalyzer/index.js +0 -1
  139. package/dist/statsAnalyzer/index.js.map +1 -1
  140. package/dist/types/annotation/annotation.types.d.ts +43 -0
  141. package/dist/types/annotation/constants.d.ts +31 -0
  142. package/dist/types/annotation/index.d.ts +124 -0
  143. package/dist/types/breakouts/events.d.ts +2 -0
  144. package/dist/types/breakouts/utils.d.ts +7 -0
  145. package/dist/types/common/errors/webex-errors.d.ts +1 -1
  146. package/dist/types/config.d.ts +0 -6
  147. package/dist/types/constants.d.ts +51 -21
  148. package/dist/types/controls-options-manager/enums.d.ts +2 -0
  149. package/dist/types/controls-options-manager/index.d.ts +1 -1
  150. package/dist/types/controls-options-manager/types.d.ts +7 -1
  151. package/dist/types/index.d.ts +1 -1
  152. package/dist/types/interpretation/collection.d.ts +5 -0
  153. package/dist/types/interpretation/index.d.ts +5 -0
  154. package/dist/types/interpretation/siLanguage.d.ts +5 -0
  155. package/dist/types/locus-info/index.d.ts +39 -1
  156. package/dist/types/media/index.d.ts +2 -0
  157. package/dist/types/media/properties.d.ts +16 -38
  158. package/dist/types/meeting/in-meeting-actions.d.ts +46 -2
  159. package/dist/types/meeting/index.d.ts +179 -379
  160. package/dist/types/meeting/locusMediaRequest.d.ts +70 -0
  161. package/dist/types/meeting/muteState.d.ts +39 -40
  162. package/dist/types/meeting/request.d.ts +25 -26
  163. package/dist/types/meeting/util.d.ts +74 -1
  164. package/dist/types/meeting-info/meeting-info-v2.d.ts +14 -3
  165. package/dist/types/meetings/index.d.ts +49 -1
  166. package/dist/types/meetings/meetings.types.d.ts +4 -0
  167. package/dist/types/member/index.d.ts +2 -0
  168. package/dist/types/members/request.d.ts +56 -11
  169. package/dist/types/members/util.d.ts +209 -1
  170. package/dist/types/metrics/config.d.ts +26 -2
  171. package/dist/types/metrics/constants.d.ts +1 -0
  172. package/dist/types/metrics/index.d.ts +17 -0
  173. package/dist/types/multistream/mediaRequestManager.d.ts +27 -10
  174. package/dist/types/multistream/receiveSlot.d.ts +3 -3
  175. package/dist/types/multistream/remoteMedia.d.ts +2 -2
  176. package/dist/types/multistream/remoteMediaManager.d.ts +14 -0
  177. package/dist/types/roap/request.d.ts +6 -8
  178. package/dist/types/roap/turnDiscovery.d.ts +18 -1
  179. package/package.json +3 -2
  180. package/src/annotation/annotation.types.ts +50 -0
  181. package/src/annotation/constants.ts +36 -0
  182. package/src/annotation/index.ts +328 -0
  183. package/src/breakouts/README.md +3 -2
  184. package/src/breakouts/breakout.ts +62 -27
  185. package/src/breakouts/events.ts +56 -0
  186. package/src/breakouts/index.ts +244 -64
  187. package/src/breakouts/utils.ts +13 -0
  188. package/src/common/errors/webex-errors.ts +6 -2
  189. package/src/common/logs/logger-proxy.ts +1 -1
  190. package/src/common/queue.ts +22 -8
  191. package/src/config.ts +0 -6
  192. package/src/constants.ts +111 -19
  193. package/src/controls-options-manager/enums.ts +2 -0
  194. package/src/controls-options-manager/index.ts +13 -10
  195. package/src/controls-options-manager/types.ts +10 -0
  196. package/src/controls-options-manager/util.ts +82 -11
  197. package/src/index.ts +18 -11
  198. package/src/interpretation/README.md +60 -0
  199. package/src/interpretation/collection.ts +19 -0
  200. package/src/interpretation/index.ts +332 -0
  201. package/src/interpretation/siLanguage.ts +18 -0
  202. package/src/locus-info/controlsUtils.ts +81 -0
  203. package/src/locus-info/index.ts +318 -57
  204. package/src/locus-info/infoUtils.ts +10 -2
  205. package/src/locus-info/mediaSharesUtils.ts +48 -0
  206. package/src/locus-info/parser.ts +224 -39
  207. package/src/locus-info/selfUtils.ts +32 -20
  208. package/src/media/index.ts +94 -108
  209. package/src/media/properties.ts +69 -109
  210. package/src/meeting/in-meeting-actions.ts +120 -4
  211. package/src/meeting/index.ts +1967 -2120
  212. package/src/meeting/locusMediaRequest.ts +314 -0
  213. package/src/meeting/muteState.ts +119 -194
  214. package/src/meeting/request.ts +122 -115
  215. package/src/meeting/util.ts +549 -413
  216. package/src/meeting-info/index.ts +54 -8
  217. package/src/meeting-info/meeting-info-v2.ts +89 -24
  218. package/src/meeting-info/utilv2.ts +6 -2
  219. package/src/meetings/index.ts +247 -87
  220. package/src/meetings/meetings.types.ts +12 -0
  221. package/src/meetings/util.ts +47 -12
  222. package/src/member/index.ts +28 -1
  223. package/src/member/types.ts +14 -0
  224. package/src/member/util.ts +75 -26
  225. package/src/members/index.ts +7 -1
  226. package/src/members/request.ts +61 -21
  227. package/src/members/util.ts +316 -326
  228. package/src/metrics/constants.ts +1 -0
  229. package/src/metrics/index.ts +1 -474
  230. package/src/multistream/mediaRequestManager.ts +183 -67
  231. package/src/multistream/receiveSlot.ts +4 -4
  232. package/src/multistream/receiveSlotManager.ts +4 -4
  233. package/src/multistream/remoteMedia.ts +2 -2
  234. package/src/multistream/remoteMediaGroup.ts +59 -0
  235. package/src/multistream/remoteMediaManager.ts +33 -0
  236. package/src/multistream/sendSlotManager.ts +170 -0
  237. package/src/reachability/index.ts +15 -4
  238. package/src/reachability/request.ts +7 -3
  239. package/src/reconnection-manager/index.ts +36 -29
  240. package/src/recording-controller/index.ts +20 -3
  241. package/src/recording-controller/util.ts +26 -9
  242. package/src/roap/index.ts +25 -30
  243. package/src/roap/request.ts +44 -51
  244. package/src/roap/turnDiscovery.ts +51 -25
  245. package/src/rtcMetrics/constants.ts +3 -0
  246. package/src/rtcMetrics/index.ts +100 -0
  247. package/src/statsAnalyzer/index.ts +0 -1
  248. package/test/integration/spec/converged-space-meetings.js +60 -3
  249. package/test/integration/spec/journey.js +336 -259
  250. package/test/integration/spec/space-meeting.js +76 -3
  251. package/test/unit/spec/annotation/index.ts +418 -0
  252. package/test/unit/spec/breakouts/breakout.ts +85 -26
  253. package/test/unit/spec/breakouts/events.ts +89 -0
  254. package/test/unit/spec/breakouts/index.ts +636 -98
  255. package/test/unit/spec/breakouts/utils.js +19 -1
  256. package/test/unit/spec/common/queue.js +31 -2
  257. package/test/unit/spec/controls-options-manager/index.js +8 -1
  258. package/test/unit/spec/controls-options-manager/util.js +576 -397
  259. package/test/unit/spec/fixture/locus.js +1 -0
  260. package/test/unit/spec/interpretation/collection.ts +15 -0
  261. package/test/unit/spec/interpretation/index.ts +589 -0
  262. package/test/unit/spec/interpretation/siLanguage.ts +28 -0
  263. package/test/unit/spec/locus-info/controlsUtils.js +195 -1
  264. package/test/unit/spec/locus-info/index.js +950 -45
  265. package/test/unit/spec/locus-info/infoUtils.js +37 -15
  266. package/test/unit/spec/locus-info/mediaSharesUtils.ts +22 -0
  267. package/test/unit/spec/locus-info/parser.js +62 -22
  268. package/test/unit/spec/locus-info/selfConstant.js +19 -0
  269. package/test/unit/spec/locus-info/selfUtils.js +131 -26
  270. package/test/unit/spec/media/index.ts +82 -79
  271. package/test/unit/spec/meeting/in-meeting-actions.ts +60 -2
  272. package/test/unit/spec/meeting/index.js +3208 -1734
  273. package/test/unit/spec/meeting/locusMediaRequest.ts +443 -0
  274. package/test/unit/spec/meeting/muteState.js +328 -417
  275. package/test/unit/spec/meeting/request.js +393 -48
  276. package/test/unit/spec/meeting/utils.js +552 -76
  277. package/test/unit/spec/meeting-info/index.js +181 -0
  278. package/test/unit/spec/meeting-info/meetinginfov2.js +258 -20
  279. package/test/unit/spec/meeting-info/utilv2.js +21 -0
  280. package/test/unit/spec/meetings/index.js +631 -145
  281. package/test/unit/spec/meetings/utils.js +164 -9
  282. package/test/unit/spec/member/index.js +44 -14
  283. package/test/unit/spec/member/util.js +296 -155
  284. package/test/unit/spec/members/index.js +23 -3
  285. package/test/unit/spec/members/request.js +167 -35
  286. package/test/unit/spec/metrics/index.js +1 -50
  287. package/test/unit/spec/multistream/mediaRequestManager.ts +366 -8
  288. package/test/unit/spec/multistream/receiveSlot.ts +1 -1
  289. package/test/unit/spec/multistream/remoteMediaGroup.ts +266 -0
  290. package/test/unit/spec/multistream/remoteMediaManager.ts +123 -0
  291. package/test/unit/spec/multistream/sendSlotManager.ts +242 -0
  292. package/test/unit/spec/reachability/index.ts +66 -5
  293. package/test/unit/spec/reachability/request.js +3 -1
  294. package/test/unit/spec/reconnection-manager/index.js +55 -5
  295. package/test/unit/spec/recording-controller/index.js +294 -218
  296. package/test/unit/spec/recording-controller/util.js +223 -96
  297. package/test/unit/spec/roap/index.ts +21 -48
  298. package/test/unit/spec/roap/request.ts +74 -60
  299. package/test/unit/spec/roap/turnDiscovery.ts +30 -6
  300. package/test/unit/spec/rtcMetrics/index.ts +68 -0
  301. package/test/utils/integrationTestUtils.js +46 -0
  302. package/test/utils/testUtils.js +0 -60
  303. package/src/metrics/config.ts +0 -487
@@ -14,336 +14,326 @@ import {
14
14
 
15
15
  import {RoleAssignmentOptions, RoleAssignmentRequest, ServerRoleShape} from './types';
16
16
 
17
- const MembersUtil: any = {};
18
-
19
- /**
20
- * @param {Object} invitee with emailAddress, email or phoneNumber
21
- * @param {String} locusUrl
22
- * @param {Boolean} alertIfActive
23
- * @returns {Object} the format object
24
- */
25
- MembersUtil.generateAddMemberOptions = (
26
- invitee: object,
27
- locusUrl: string,
28
- alertIfActive: boolean
29
- ) => ({
30
- invitee,
31
- locusUrl,
32
- alertIfActive,
33
- });
34
-
35
- /**
36
- * @param {Array} memberIds
37
- * @param {String} locusUrl
38
- * @returns {Object} the format object
39
- */
40
- MembersUtil.generateAdmitMemberOptions = (memberIds: Array<any>, locusUrl: string) => ({
41
- locusUrl,
42
- memberIds,
43
- });
44
-
45
- /**
46
- * @param {Object} options with {invitee: {emailAddress, email, phoneNumber}, alertIfActive}
47
- * @returns {Object} with {invitees: [{address}], alertIfActive}
48
- */
49
- MembersUtil.getAddMemberBody = (options: any) => ({
50
- invitees: [
51
- {
52
- address: options.invitee.emailAddress || options.invitee.email || options.invitee.phoneNumber,
53
- },
54
- ],
55
- alertIfActive: options.alertIfActive,
56
- });
57
-
58
- /**
59
- * @param {Object} options with {memberIds, authorizingLocusUrl}
60
- * @returns {Object} admit with {memberIds}
61
- */
62
- MembersUtil.getAdmitMemberRequestBody = (options: any) => {
63
- const {memberIds, sessionLocusUrls} = options;
64
- const body: any = {admit: {participantIds: memberIds}};
65
- if (sessionLocusUrls) {
66
- const {authorizingLocusUrl} = sessionLocusUrls;
67
-
68
- return {authorizingLocusUrl, ...body};
69
- }
70
-
71
- return body;
72
- };
73
-
74
- /**
75
- * @param {Object} format with {memberIds, locusUrl, sessionLocusUrls}
76
- * @returns {Object} the request parameters (method, uri, body) needed to make a admitMember request
77
- * if a host/cohost is in a breakout session, the locus url should be the main session locus url
78
- */
79
- MembersUtil.getAdmitMemberRequestParams = (format: any) => {
80
- const body = MembersUtil.getAdmitMemberRequestBody(format);
81
- const {locusUrl, sessionLocusUrls} = format;
82
- const baseUrl = sessionLocusUrls?.mainLocusUrl || locusUrl;
83
- const uri = `${baseUrl}/${CONTROLS}`;
84
-
85
- return {
86
- method: HTTP_VERBS.PUT,
87
- uri,
88
- body,
89
- };
90
- };
91
-
92
- /**
93
- * @param {Object} format with {invitee {emailAddress, email, phoneNumber}, locusUrl, alertIfActive}
94
- * @returns {Object} the request parameters (method, uri, body) needed to make a addMember request
95
- */
96
- MembersUtil.getAddMemberRequestParams = (format: any) => {
97
- const body = MembersUtil.getAddMemberBody(format);
98
- const requestParams = {
99
- method: HTTP_VERBS.PUT,
100
- uri: format.locusUrl,
101
- body,
102
- };
103
-
104
- return requestParams;
105
- };
106
-
107
- MembersUtil.isInvalidInvitee = (invitee) => {
108
- if (!(invitee && (invitee.email || invitee.emailAddress || invitee.phoneNumber))) {
109
- return true;
110
- }
111
-
112
- if (invitee.phoneNumber) {
113
- return !DIALER_REGEX.E164_FORMAT.test(invitee.phoneNumber);
114
- }
115
-
116
- return !VALID_EMAIL_ADDRESS.test(invitee.email || invitee.emailAddress);
117
- };
118
-
119
- MembersUtil.getRemoveMemberRequestParams = (options) => {
120
- const body = {
121
- reason: options.reason,
122
- };
123
- const uri = `${options.locusUrl}/${PARTICIPANT}/${options.memberId}/${LEAVE}`;
124
-
125
- return {
126
- method: HTTP_VERBS.PUT,
127
- uri,
128
- body,
129
- };
130
- };
131
-
132
- MembersUtil.generateTransferHostMemberOptions = (transfer, moderator, locusUrl) => ({
133
- moderator,
134
- locusUrl,
135
- memberId: transfer,
136
- });
137
-
138
- MembersUtil.generateRemoveMemberOptions = (removal, locusUrl) => ({
139
- reason: _FORCED_,
140
- memberId: removal,
141
- locusUrl,
142
- });
143
-
144
- MembersUtil.generateMuteMemberOptions = (memberId, status, locusUrl, isAudio) => ({
145
- memberId,
146
- muted: status,
147
- locusUrl,
148
- isAudio,
149
- });
150
-
151
- MembersUtil.generateRaiseHandMemberOptions = (memberId, status, locusUrl) => ({
152
- memberId,
153
- raised: status,
154
- locusUrl,
155
- });
156
-
157
- /**
158
- * @param {String} memberId
159
- * @param {[ServerRoleShape]} roles
160
- * @param {String} locusUrl
161
- * @returns {RoleAssignmentOptions}
162
- */
163
- MembersUtil.generateRoleAssignmentMemberOptions = (
164
- memberId: string,
165
- roles: Array<ServerRoleShape>,
166
- locusUrl: string
167
- ): RoleAssignmentOptions => ({
168
- memberId,
169
- roles,
170
- locusUrl,
171
- });
172
-
173
- MembersUtil.generateLowerAllHandsMemberOptions = (requestingParticipantId, locusUrl) => ({
174
- requestingParticipantId,
175
- locusUrl,
176
- });
177
-
178
- /**
179
- * @param {String} memberId id of the participant who is receiving request
180
- * @param {String} requestingParticipantId id of the participant who is sending request (optional)
181
- * @param {String} alias alias name
182
- * @param {String} locusUrl url
183
- * @returns {Object} consists of {memberID: string, requestingParticipantId: string, alias: string, locusUrl: string}
184
- */
185
- MembersUtil.generateEditDisplayNameMemberOptions = (
186
- memberId,
187
- requestingParticipantId,
188
- alias,
189
- locusUrl
190
- ) => ({
191
- memberId,
192
- requestingParticipantId,
193
- alias,
194
- locusUrl,
195
- });
196
-
197
- MembersUtil.getMuteMemberRequestParams = (options) => {
198
- const property = options.isAudio === false ? 'video' : 'audio';
199
- const body = {
200
- [property]: {
201
- muted: options.muted,
202
- },
203
- };
204
- const uri = `${options.locusUrl}/${PARTICIPANT}/${options.memberId}/${CONTROLS}`;
205
-
206
- return {
207
- method: HTTP_VERBS.PATCH,
208
- uri,
209
- body,
210
- };
211
- };
212
-
213
- /**
214
- * @param {RoleAssignmentOptions} options
215
- * @returns {RoleAssignmentRequest} the request parameters (method, uri, body) needed to make a addMember request
216
- */
217
- MembersUtil.getRoleAssignmentMemberRequestParams = (
218
- options: RoleAssignmentOptions
219
- ): RoleAssignmentRequest => {
220
- const body = {role: {roles: []}};
221
- options.roles.forEach((role) => {
222
- body.role.roles.push({type: role.type, hasRole: role.hasRole});
223
- });
224
-
225
- const uri = `${options.locusUrl}/${PARTICIPANT}/${options.memberId}/${CONTROLS}`;
226
-
227
- return {
228
- method: HTTP_VERBS.PATCH,
229
- uri,
230
- body,
231
- };
232
- };
233
-
234
- MembersUtil.getRaiseHandMemberRequestParams = (options) => {
235
- const body = {
236
- hand: {
237
- raised: options.raised,
238
- },
239
- };
240
- const uri = `${options.locusUrl}/${PARTICIPANT}/${options.memberId}/${CONTROLS}`;
241
-
242
- return {
243
- method: HTTP_VERBS.PATCH,
244
- uri,
245
- body,
246
- };
247
- };
248
-
249
- MembersUtil.getLowerAllHandsMemberRequestParams = (options) => {
250
- const body = {
251
- hand: {
252
- raised: false,
253
- },
254
- requestingParticipantId: options.requestingParticipantId,
255
- };
256
- const uri = `${options.locusUrl}/${CONTROLS}`;
257
-
258
- return {
259
- method: HTTP_VERBS.PATCH,
260
- uri,
261
- body,
262
- };
263
- };
264
-
265
- /**
266
- * @param {Object} options with format of {locusUrl: string, requestingParticipantId: string}
267
- * @returns {Object} request parameters (method, uri, body) needed to make a editDisplayName request
268
- */
269
- MembersUtil.editDisplayNameMemberRequestParams = (options) => {
270
- const body = {
271
- aliasValue: options.alias,
272
- requestingParticipantId: options.requestingParticipantId,
273
- };
274
- const uri = `${options.locusUrl}/${PARTICIPANT}/${options.memberId}/${ALIAS}`;
275
-
276
- return {
277
- method: HTTP_VERBS.POST,
278
- uri,
279
- body,
280
- };
281
- };
282
-
283
- MembersUtil.getTransferHostToMemberRequestParams = (options) => {
284
- const body = {
285
- role: {
286
- moderator: options.moderator,
287
- },
288
- };
289
- const uri = `${options.locusUrl}/${PARTICIPANT}/${options.memberId}/${CONTROLS}`;
290
-
291
- return {
292
- method: HTTP_VERBS.PATCH,
293
- uri,
294
- body,
295
- };
296
- };
297
-
298
- MembersUtil.genderateSendDTMFOptions = (url, tones, memberId, locusUrl) => ({
299
- url,
300
- tones,
301
- memberId,
302
- locusUrl,
303
- });
304
-
305
- MembersUtil.generateSendDTMFRequestParams = ({url, tones, memberId, locusUrl}) => {
306
- const body = {
307
- device: {
308
- url,
309
- },
310
- memberId,
311
- dtmf: {
312
- correlationId: uuid.v4(),
313
- tones,
314
- direction: 'transmit',
315
- },
316
- };
317
- const uri = `${locusUrl}/${PARTICIPANT}/${memberId}/${SEND_DTMF_ENDPOINT}`;
318
-
319
- return {
320
- method: HTTP_VERBS.POST,
321
- uri,
322
- body,
323
- };
324
- };
325
-
326
- MembersUtil.cancelPhoneInviteOptions = (invitee, locusUrl) => ({
327
- invitee,
328
- locusUrl,
329
- });
330
-
331
- MembersUtil.generateCancelInviteRequestParams = (options) => {
332
- const body = {
333
- actionType: _REMOVE_,
17
+ const MembersUtil = {
18
+ /**
19
+ * @param {Object} invitee with emailAddress, email or phoneNumber
20
+ * @param {String} locusUrl
21
+ * @param {Boolean} alertIfActive
22
+ * @returns {Object} the format object
23
+ */
24
+ generateAddMemberOptions: (invitee: object, locusUrl: string, alertIfActive: boolean) => ({
25
+ invitee,
26
+ locusUrl,
27
+ alertIfActive,
28
+ }),
29
+
30
+ /**
31
+ * @param {Array} memberIds
32
+ * @param {String} locusUrl
33
+ * @returns {Object} the format object
34
+ */
35
+ generateAdmitMemberOptions: (memberIds: Array<any>, locusUrl: string) => ({
36
+ locusUrl,
37
+ memberIds,
38
+ }),
39
+
40
+ /**
41
+ * @param {Object} options with {invitee: {emailAddress, email, phoneNumber}, alertIfActive}
42
+ * @returns {Object} with {invitees: [{address}], alertIfActive}
43
+ */
44
+ getAddMemberBody: (options: any) => ({
334
45
  invitees: [
335
46
  {
336
- address: options.invitee.phoneNumber,
47
+ address:
48
+ options.invitee.emailAddress || options.invitee.email || options.invitee.phoneNumber,
337
49
  },
338
50
  ],
339
- };
340
- const requestParams = {
341
- method: HTTP_VERBS.PUT,
342
- uri: options.locusUrl,
343
- body,
344
- };
345
-
346
- return requestParams;
51
+ alertIfActive: options.alertIfActive,
52
+ }),
53
+
54
+ /**
55
+ * @param {Object} options with {memberIds, authorizingLocusUrl}
56
+ * @returns {Object} admit with {memberIds}
57
+ */
58
+ getAdmitMemberRequestBody: (options: any) => {
59
+ const {memberIds, sessionLocusUrls} = options;
60
+ const body: any = {admit: {participantIds: memberIds}};
61
+ if (sessionLocusUrls) {
62
+ const {authorizingLocusUrl} = sessionLocusUrls;
63
+
64
+ return {authorizingLocusUrl, ...body};
65
+ }
66
+
67
+ return body;
68
+ },
69
+
70
+ /**
71
+ * @param {Object} format with {memberIds, locusUrl, sessionLocusUrls}
72
+ * @returns {Object} the request parameters (method, uri, body) needed to make a admitMember request
73
+ * if a host/cohost is in a breakout session, the locus url should be the main session locus url
74
+ */
75
+ getAdmitMemberRequestParams: (format: any) => {
76
+ const body = MembersUtil.getAdmitMemberRequestBody(format);
77
+ const {locusUrl, sessionLocusUrls} = format;
78
+ const baseUrl = sessionLocusUrls?.mainLocusUrl || locusUrl;
79
+ const uri = `${baseUrl}/${CONTROLS}`;
80
+
81
+ return {
82
+ method: HTTP_VERBS.PUT,
83
+ uri,
84
+ body,
85
+ };
86
+ },
87
+
88
+ /**
89
+ * @param {Object} format with {invitee {emailAddress, email, phoneNumber}, locusUrl, alertIfActive}
90
+ * @returns {Object} the request parameters (method, uri, body) needed to make a addMember request
91
+ */
92
+ getAddMemberRequestParams: (format: any) => {
93
+ const body = MembersUtil.getAddMemberBody(format);
94
+ const requestParams = {
95
+ method: HTTP_VERBS.PUT,
96
+ uri: format.locusUrl,
97
+ body,
98
+ };
99
+
100
+ return requestParams;
101
+ },
102
+
103
+ isInvalidInvitee: (invitee) => {
104
+ if (!(invitee && (invitee.email || invitee.emailAddress || invitee.phoneNumber))) {
105
+ return true;
106
+ }
107
+
108
+ if (invitee.phoneNumber) {
109
+ return !DIALER_REGEX.E164_FORMAT.test(invitee.phoneNumber);
110
+ }
111
+
112
+ return !VALID_EMAIL_ADDRESS.test(invitee.email || invitee.emailAddress);
113
+ },
114
+
115
+ getRemoveMemberRequestParams: (options) => {
116
+ const body = {
117
+ reason: options.reason,
118
+ };
119
+ const uri = `${options.locusUrl}/${PARTICIPANT}/${options.memberId}/${LEAVE}`;
120
+
121
+ return {
122
+ method: HTTP_VERBS.PUT,
123
+ uri,
124
+ body,
125
+ };
126
+ },
127
+
128
+ generateTransferHostMemberOptions: (transfer, moderator, locusUrl) => ({
129
+ moderator,
130
+ locusUrl,
131
+ memberId: transfer,
132
+ }),
133
+
134
+ generateRemoveMemberOptions: (removal, locusUrl) => ({
135
+ reason: _FORCED_,
136
+ memberId: removal,
137
+ locusUrl,
138
+ }),
139
+
140
+ generateMuteMemberOptions: (memberId, status, locusUrl, isAudio) => ({
141
+ memberId,
142
+ muted: status,
143
+ locusUrl,
144
+ isAudio,
145
+ }),
146
+
147
+ generateRaiseHandMemberOptions: (memberId, status, locusUrl) => ({
148
+ memberId,
149
+ raised: status,
150
+ locusUrl,
151
+ }),
152
+
153
+ /**
154
+ * @param {String} memberId
155
+ * @param {[ServerRoleShape]} roles
156
+ * @param {String} locusUrl
157
+ * @returns {RoleAssignmentOptions}
158
+ */
159
+ generateRoleAssignmentMemberOptions: (
160
+ memberId: string,
161
+ roles: Array<ServerRoleShape>,
162
+ locusUrl: string
163
+ ): RoleAssignmentOptions => ({
164
+ memberId,
165
+ roles,
166
+ locusUrl,
167
+ }),
168
+
169
+ generateLowerAllHandsMemberOptions: (requestingParticipantId, locusUrl) => ({
170
+ requestingParticipantId,
171
+ locusUrl,
172
+ }),
173
+
174
+ /**
175
+ * @param {String} memberId id of the participant who is receiving request
176
+ * @param {String} requestingParticipantId id of the participant who is sending request (optional)
177
+ * @param {String} alias alias name
178
+ * @param {String} locusUrl url
179
+ * @returns {Object} consists of {memberID: string, requestingParticipantId: string, alias: string, locusUrl: string}
180
+ */
181
+ generateEditDisplayNameMemberOptions: (memberId, requestingParticipantId, alias, locusUrl) => ({
182
+ memberId,
183
+ requestingParticipantId,
184
+ alias,
185
+ locusUrl,
186
+ }),
187
+
188
+ getMuteMemberRequestParams: (options) => {
189
+ const property = options.isAudio === false ? 'video' : 'audio';
190
+ const body = {
191
+ [property]: {
192
+ muted: options.muted,
193
+ },
194
+ };
195
+ const uri = `${options.locusUrl}/${PARTICIPANT}/${options.memberId}/${CONTROLS}`;
196
+
197
+ return {
198
+ method: HTTP_VERBS.PATCH,
199
+ uri,
200
+ body,
201
+ };
202
+ },
203
+
204
+ /**
205
+ * @param {RoleAssignmentOptions} options
206
+ * @returns {RoleAssignmentRequest} the request parameters (method, uri, body) needed to make a addMember request
207
+ */
208
+ getRoleAssignmentMemberRequestParams: (options: RoleAssignmentOptions): RoleAssignmentRequest => {
209
+ const body = {role: {roles: []}};
210
+ options.roles.forEach((role) => {
211
+ body.role.roles.push({type: role.type, hasRole: role.hasRole});
212
+ });
213
+
214
+ const uri = `${options.locusUrl}/${PARTICIPANT}/${options.memberId}/${CONTROLS}`;
215
+
216
+ return {
217
+ method: HTTP_VERBS.PATCH,
218
+ uri,
219
+ body,
220
+ };
221
+ },
222
+
223
+ getRaiseHandMemberRequestParams: (options) => {
224
+ const body = {
225
+ hand: {
226
+ raised: options.raised,
227
+ },
228
+ };
229
+ const uri = `${options.locusUrl}/${PARTICIPANT}/${options.memberId}/${CONTROLS}`;
230
+
231
+ return {
232
+ method: HTTP_VERBS.PATCH,
233
+ uri,
234
+ body,
235
+ };
236
+ },
237
+
238
+ getLowerAllHandsMemberRequestParams: (options) => {
239
+ const body = {
240
+ hand: {
241
+ raised: false,
242
+ },
243
+ requestingParticipantId: options.requestingParticipantId,
244
+ };
245
+ const uri = `${options.locusUrl}/${CONTROLS}`;
246
+
247
+ return {
248
+ method: HTTP_VERBS.PATCH,
249
+ uri,
250
+ body,
251
+ };
252
+ },
253
+
254
+ /**
255
+ * @param {Object} options with format of {locusUrl: string, requestingParticipantId: string}
256
+ * @returns {Object} request parameters (method, uri, body) needed to make a editDisplayName request
257
+ */
258
+ editDisplayNameMemberRequestParams: (options) => {
259
+ const body = {
260
+ aliasValue: options.alias,
261
+ requestingParticipantId: options.requestingParticipantId,
262
+ };
263
+ const uri = `${options.locusUrl}/${PARTICIPANT}/${options.memberId}/${ALIAS}`;
264
+
265
+ return {
266
+ method: HTTP_VERBS.POST,
267
+ uri,
268
+ body,
269
+ };
270
+ },
271
+
272
+ getTransferHostToMemberRequestParams: (options) => {
273
+ const body = {
274
+ role: {
275
+ moderator: options.moderator,
276
+ },
277
+ };
278
+ const uri = `${options.locusUrl}/${PARTICIPANT}/${options.memberId}/${CONTROLS}`;
279
+
280
+ return {
281
+ method: HTTP_VERBS.PATCH,
282
+ uri,
283
+ body,
284
+ };
285
+ },
286
+
287
+ genderateSendDTMFOptions: (url, tones, memberId, locusUrl) => ({
288
+ url,
289
+ tones,
290
+ memberId,
291
+ locusUrl,
292
+ }),
293
+
294
+ generateSendDTMFRequestParams: ({url, tones, memberId, locusUrl}) => {
295
+ const body = {
296
+ device: {
297
+ url,
298
+ },
299
+ memberId,
300
+ dtmf: {
301
+ correlationId: uuid.v4(),
302
+ tones,
303
+ direction: 'transmit',
304
+ },
305
+ };
306
+ const uri = `${locusUrl}/${PARTICIPANT}/${memberId}/${SEND_DTMF_ENDPOINT}`;
307
+
308
+ return {
309
+ method: HTTP_VERBS.POST,
310
+ uri,
311
+ body,
312
+ };
313
+ },
314
+
315
+ cancelPhoneInviteOptions: (invitee, locusUrl) => ({
316
+ invitee,
317
+ locusUrl,
318
+ }),
319
+
320
+ generateCancelInviteRequestParams: (options) => {
321
+ const body = {
322
+ actionType: _REMOVE_,
323
+ invitees: [
324
+ {
325
+ address: options.invitee.phoneNumber,
326
+ },
327
+ ],
328
+ };
329
+ const requestParams = {
330
+ method: HTTP_VERBS.PUT,
331
+ uri: options.locusUrl,
332
+ body,
333
+ };
334
+
335
+ return requestParams;
336
+ },
347
337
  };
348
338
 
349
339
  export default MembersUtil;
@@ -9,6 +9,7 @@ const BEHAVIORAL_METRICS = {
9
9
  JOIN_FAILURE: 'js_sdk_join_failures',
10
10
  ADD_MEDIA_SUCCESS: 'js_sdk_add_media_success',
11
11
  ADD_MEDIA_FAILURE: 'js_sdk_add_media_failures',
12
+ ROAP_MERCURY_EVENT_RECEIVED: 'js_sdk_roap_mercury_received',
12
13
  CONNECTION_SUCCESS: 'js_sdk_connection_success',
13
14
  CONNECTION_FAILURE: 'js_sdk_connection_failures',
14
15
  MEETING_LEAVE_FAILURE: 'js_sdk_meeting_leave_failure',