@webex/plugin-meetings 3.10.0-next.1 → 3.10.0-next.10

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 (246) 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 +38 -27
  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 +0 -1
  67. package/dist/config.js.map +1 -1
  68. package/dist/constants.js +12 -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/hashTreeParser.js +165 -0
  78. package/dist/hashTree/hashTreeParser.js.map +1 -0
  79. package/dist/hashTree/types.js +15 -0
  80. package/dist/hashTree/types.js.map +1 -0
  81. package/dist/index.js +8 -2
  82. package/dist/index.js.map +1 -1
  83. package/dist/interceptors/index.js.map +1 -1
  84. package/dist/interceptors/locusRetry.js +6 -8
  85. package/dist/interceptors/locusRetry.js.map +1 -1
  86. package/dist/interceptors/locusRouteToken.js +6 -8
  87. package/dist/interceptors/locusRouteToken.js.map +1 -1
  88. package/dist/interpretation/collection.js.map +1 -1
  89. package/dist/interpretation/index.js +1 -2
  90. package/dist/interpretation/index.js.map +1 -1
  91. package/dist/interpretation/siLanguage.js +1 -1
  92. package/dist/interpretation/siLanguage.js.map +1 -1
  93. package/dist/locus-info/controlsUtils.js.map +1 -1
  94. package/dist/locus-info/embeddedAppsUtils.js.map +1 -1
  95. package/dist/locus-info/fullState.js.map +1 -1
  96. package/dist/locus-info/hostUtils.js.map +1 -1
  97. package/dist/locus-info/index.js +532 -94
  98. package/dist/locus-info/index.js.map +1 -1
  99. package/dist/locus-info/infoUtils.js.map +1 -1
  100. package/dist/locus-info/mediaSharesUtils.js.map +1 -1
  101. package/dist/locus-info/parser.js +3 -4
  102. package/dist/locus-info/parser.js.map +1 -1
  103. package/dist/locus-info/selfUtils.js.map +1 -1
  104. package/dist/locus-info/types.js +7 -0
  105. package/dist/locus-info/types.js.map +1 -0
  106. package/dist/media/MediaConnectionAwaiter.js +1 -2
  107. package/dist/media/MediaConnectionAwaiter.js.map +1 -1
  108. package/dist/media/index.js +5 -2
  109. package/dist/media/index.js.map +1 -1
  110. package/dist/media/properties.js +15 -17
  111. package/dist/media/properties.js.map +1 -1
  112. package/dist/media/util.js.map +1 -1
  113. package/dist/meeting/brbState.js +8 -9
  114. package/dist/meeting/brbState.js.map +1 -1
  115. package/dist/meeting/connectionStateHandler.js +10 -13
  116. package/dist/meeting/connectionStateHandler.js.map +1 -1
  117. package/dist/meeting/in-meeting-actions.js.map +1 -1
  118. package/dist/meeting/index.js +1556 -1528
  119. package/dist/meeting/index.js.map +1 -1
  120. package/dist/meeting/locusMediaRequest.js +13 -17
  121. package/dist/meeting/locusMediaRequest.js.map +1 -1
  122. package/dist/meeting/muteState.js +11 -12
  123. package/dist/meeting/muteState.js.map +1 -1
  124. package/dist/meeting/request.js +101 -104
  125. package/dist/meeting/request.js.map +1 -1
  126. package/dist/meeting/request.type.js.map +1 -1
  127. package/dist/meeting/state.js.map +1 -1
  128. package/dist/meeting/type.js.map +1 -1
  129. package/dist/meeting/util.js +24 -23
  130. package/dist/meeting/util.js.map +1 -1
  131. package/dist/meeting/voicea-meeting.js +3 -3
  132. package/dist/meeting/voicea-meeting.js.map +1 -1
  133. package/dist/meeting-info/collection.js +7 -10
  134. package/dist/meeting-info/collection.js.map +1 -1
  135. package/dist/meeting-info/index.js +1 -2
  136. package/dist/meeting-info/index.js.map +1 -1
  137. package/dist/meeting-info/meeting-info-v2.js +135 -146
  138. package/dist/meeting-info/meeting-info-v2.js.map +1 -1
  139. package/dist/meeting-info/request.js +1 -2
  140. package/dist/meeting-info/request.js.map +1 -1
  141. package/dist/meeting-info/util.js +36 -37
  142. package/dist/meeting-info/util.js.map +1 -1
  143. package/dist/meeting-info/utilv2.js +30 -31
  144. package/dist/meeting-info/utilv2.js.map +1 -1
  145. package/dist/meetings/collection.js +6 -8
  146. package/dist/meetings/collection.js.map +1 -1
  147. package/dist/meetings/index.js +179 -141
  148. package/dist/meetings/index.js.map +1 -1
  149. package/dist/meetings/meetings.types.js.map +1 -1
  150. package/dist/meetings/request.js +6 -8
  151. package/dist/meetings/request.js.map +1 -1
  152. package/dist/meetings/util.js +25 -23
  153. package/dist/meetings/util.js.map +1 -1
  154. package/dist/member/index.js +1 -2
  155. package/dist/member/index.js.map +1 -1
  156. package/dist/member/types.js +6 -3
  157. package/dist/member/types.js.map +1 -1
  158. package/dist/member/util.js.map +1 -1
  159. package/dist/members/collection.js +1 -2
  160. package/dist/members/collection.js.map +1 -1
  161. package/dist/members/index.js +18 -21
  162. package/dist/members/index.js.map +1 -1
  163. package/dist/members/request.js +8 -11
  164. package/dist/members/request.js.map +1 -1
  165. package/dist/members/types.js.map +1 -1
  166. package/dist/members/util.js.map +1 -1
  167. package/dist/metrics/constants.js +3 -1
  168. package/dist/metrics/constants.js.map +1 -1
  169. package/dist/metrics/index.js +3 -4
  170. package/dist/metrics/index.js.map +1 -1
  171. package/dist/multistream/mediaRequestManager.js +1 -2
  172. package/dist/multistream/mediaRequestManager.js.map +1 -1
  173. package/dist/multistream/receiveSlot.js +34 -45
  174. package/dist/multistream/receiveSlot.js.map +1 -1
  175. package/dist/multistream/receiveSlotManager.js +8 -9
  176. package/dist/multistream/receiveSlotManager.js.map +1 -1
  177. package/dist/multistream/remoteMedia.js +12 -15
  178. package/dist/multistream/remoteMedia.js.map +1 -1
  179. package/dist/multistream/remoteMediaGroup.js +1 -2
  180. package/dist/multistream/remoteMediaGroup.js.map +1 -1
  181. package/dist/multistream/remoteMediaManager.js +122 -123
  182. package/dist/multistream/remoteMediaManager.js.map +1 -1
  183. package/dist/multistream/sendSlotManager.js +29 -30
  184. package/dist/multistream/sendSlotManager.js.map +1 -1
  185. package/dist/personal-meeting-room/index.js +16 -19
  186. package/dist/personal-meeting-room/index.js.map +1 -1
  187. package/dist/personal-meeting-room/request.js +7 -10
  188. package/dist/personal-meeting-room/request.js.map +1 -1
  189. package/dist/personal-meeting-room/util.js.map +1 -1
  190. package/dist/reachability/clusterReachability.js +36 -39
  191. package/dist/reachability/clusterReachability.js.map +1 -1
  192. package/dist/reachability/index.js +203 -205
  193. package/dist/reachability/index.js.map +1 -1
  194. package/dist/reachability/reachability.types.js.map +1 -1
  195. package/dist/reachability/request.js.map +1 -1
  196. package/dist/reachability/util.js.map +1 -1
  197. package/dist/reactions/constants.js.map +1 -1
  198. package/dist/reactions/reactions.js.map +1 -1
  199. package/dist/reactions/reactions.type.js.map +1 -1
  200. package/dist/reconnection-manager/index.js +178 -176
  201. package/dist/reconnection-manager/index.js.map +1 -1
  202. package/dist/recording-controller/enums.js.map +1 -1
  203. package/dist/recording-controller/index.js +1 -2
  204. package/dist/recording-controller/index.js.map +1 -1
  205. package/dist/recording-controller/util.js.map +1 -1
  206. package/dist/roap/index.js +12 -15
  207. package/dist/roap/index.js.map +1 -1
  208. package/dist/roap/request.js +24 -26
  209. package/dist/roap/request.js.map +1 -1
  210. package/dist/roap/turnDiscovery.js +75 -76
  211. package/dist/roap/turnDiscovery.js.map +1 -1
  212. package/dist/roap/types.js.map +1 -1
  213. package/dist/transcription/index.js +4 -5
  214. package/dist/transcription/index.js.map +1 -1
  215. package/dist/types/common/errors/webex-errors.d.ts +12 -0
  216. package/dist/types/constants.d.ts +26 -21
  217. package/dist/types/hashTree/hashTreeParser.d.ts +109 -0
  218. package/dist/types/hashTree/types.d.ts +16 -0
  219. package/dist/types/index.d.ts +2 -1
  220. package/dist/types/locus-info/index.d.ts +91 -42
  221. package/dist/types/locus-info/types.d.ts +45 -0
  222. package/dist/types/meeting/index.d.ts +22 -9
  223. package/dist/types/meetings/index.d.ts +9 -2
  224. package/dist/types/metrics/constants.d.ts +2 -0
  225. package/dist/webinar/collection.js +1 -2
  226. package/dist/webinar/collection.js.map +1 -1
  227. package/dist/webinar/index.js +148 -158
  228. package/dist/webinar/index.js.map +1 -1
  229. package/package.json +16 -16
  230. package/src/common/errors/webex-errors.ts +19 -0
  231. package/src/constants.ts +14 -2
  232. package/src/hashTree/hashTreeParser.ts +146 -0
  233. package/src/hashTree/types.ts +20 -0
  234. package/src/index.ts +2 -0
  235. package/src/locus-info/index.ts +534 -85
  236. package/src/locus-info/types.ts +46 -0
  237. package/src/media/index.ts +6 -0
  238. package/src/meeting/index.ts +61 -27
  239. package/src/meeting/util.ts +1 -0
  240. package/src/meetings/index.ts +104 -51
  241. package/src/metrics/constants.ts +2 -0
  242. package/test/unit/spec/locus-info/index.js +576 -1
  243. package/test/unit/spec/media/index.ts +140 -9
  244. package/test/unit/spec/meeting/index.js +178 -94
  245. package/test/unit/spec/meeting/utils.js +77 -0
  246. package/test/unit/spec/meetings/index.js +71 -28
@@ -1 +1 @@
1
- {"version":3,"names":["_lodash","require","_permission","_interopRequireDefault","_constants","_loggerProxy","_enums","_util","_constants2","ownKeys","e","r","t","_Object$keys2","_Object$getOwnPropertySymbols","o","filter","_Object$getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","arguments","length","Object","forEach","_defineProperty2","default","_Object$getOwnPropertyDescriptors","_Object$defineProperties","_Object$defineProperty","ControlsOptionsManager","exports","request","options","_classCallCheck2","initialize","set","_createClass2","key","value","extract","setLocusUrl","url","isMainLocus","locusUrl","mainLocusUrl","setDisplayHints","hints","displayHints","getLocusUrl","getDisplayHints","update","_this","_len","controls","Array","_key","payloads","map","control","_keys","Control","includes","scope","Error","concat","Util","canUpdate","PermissionError","properties","reduce","previous","payload","extraBody","authorizingLocusUrl","then","uri","CONTROLS","body","method","HTTP_VERBS","PATCH","_promise","resolve","setControls","setting","_this2","LoggerProxy","logger","log","_stringify","error","shouldSkipCheckToMergeBody","_entries","_ref2","_ref3","_slicedToArray2","undefined","CAN_SET","CAN_UNSET","Setting","muted","audio","camelCase","disallowUnmute","muteOnEntry","ENABLED","roles","_isArray","reject","setMuteOnEntry","enabled","setDisallowUnmute","setMuteAll","mutedEnabled","disallowUnmuteEnabled","muteOnEntryEnabled"],"sources":["index.ts"],"sourcesContent":["import {camelCase} from 'lodash';\nimport PermissionError from '../common/errors/permission';\nimport {CONTROLS, HTTP_VERBS} from '../constants';\nimport MeetingRequest from '../meeting/request';\nimport LoggerProxy from '../common/logs/logger-proxy';\nimport {Control, Setting} from './enums';\nimport {ControlConfig} from './types';\nimport Util from './util';\nimport {CAN_SET, CAN_UNSET, ENABLED} from './constants';\n\n/**\n * docs\n * https://sqbu-github.cisco.com/pages/WebExSquared/locus/guides/mute.html\n * https://confluence-eng-gpk2.cisco.com/conf/display/LOCUS/Hard+Mute+and+Audio+Privacy#HardMuteandAudioPrivacy-SelfMuteonEntry\n * https://confluence-eng-gpk2.cisco.com/conf/pages/viewpage.action?spaceKey=UC&title=WEBEX-124454%3A+UCF%3A+Hard+mute+support+for+Teams+joining+Webex+meeting\n * https://jira-eng-gpk2.cisco.com/jira/browse/SPARK-180867\n * https://jira-eng-gpk2.cisco.com/jira/browse/SPARK-393351\n */\n\n/**\n * @description ControlsOptionsManager is responsible for handling the behavior of participant controls when somebody joins a meeting\n * @export\n * @private\n * @class Recording\n */\nexport default class ControlsOptionsManager {\n /**\n * @instance\n * @type {MeetingRequest}\n * @private\n * @memberof ControlsOptionsManager\n */\n private request: MeetingRequest;\n\n /**\n * @instance\n * @type {Array}\n * @private\n * @memberof ControlsOptionsManager\n */\n private displayHints: Array<string> = [];\n\n /**\n * @instance\n * @type {string}\n * @private\n * @memberof ControlsOptionsManager\n */\n private locusUrl: string;\n\n /**\n * @instance\n * @type {string}\n * @private\n * @memberof ControlsOptionsManager\n */\n private mainLocusUrl: string;\n\n /**\n * @param {MeetingRequest} request\n * @param {Object} options\n * @constructor\n * @memberof ControlsOptionsManager\n */\n constructor(\n request: MeetingRequest,\n options?: {\n locusUrl: string;\n displayHints?: Array<string>;\n }\n ) {\n this.initialize(request);\n this.set(options);\n }\n\n /**\n * @param {MeetingRequest} request\n * @returns {void}\n * @private\n * @memberof ControlsOptionsManager\n */\n private initialize(request: MeetingRequest) {\n this.request = request;\n }\n\n /**\n * @param {Object} options\n * @returns {void}\n * @public\n * @memberof ControlsOptionsManager\n */\n public set(options?: {locusUrl: string; displayHints?: Array<string>}) {\n this.extract(options);\n }\n\n /**\n * @param {string} url\n * @param {boolean} isMainLocus\n * @returns {void}\n * @public\n * @memberof ControlsOptionsManager\n */\n public setLocusUrl(url: string, isMainLocus?: boolean) {\n this.locusUrl = url;\n if (isMainLocus) {\n this.mainLocusUrl = url;\n }\n }\n\n /**\n * @param {Array} hints\n * @returns {void}\n * @public\n * @memberof ControlsOptionsManager\n */\n public setDisplayHints(hints: Array<string>) {\n this.displayHints = hints;\n }\n\n /**\n * @returns {string}\n * @public\n * @memberof ControlsOptionsManager\n */\n public getLocusUrl() {\n return this.locusUrl;\n }\n\n /**\n * @returns {Array}\n * @public\n * @memberof ControlsOptionsManager\n */\n public getDisplayHints() {\n return this.displayHints;\n }\n\n /**\n * @param {Object} options\n * @returns {void}\n * @private\n * @memberof ControlsOptionsManager\n */\n private extract(options?: {locusUrl: string; displayHints?: Array<string>}) {\n this.setDisplayHints(options?.displayHints);\n this.setLocusUrl(options?.locusUrl);\n }\n\n /**\n * Set controls for this meeting.\n *\n * @param {Array<ControlConfig>} controls - Spread Array of ControlConfigs\n * @returns {Promise<Array<any>>}- Promise resolving if the request was successful.\n */\n public update(...controls: Array<ControlConfig>) {\n const payloads = controls.map((control) => {\n if (!Object.keys(Control).includes(control.scope)) {\n throw new Error(\n `updating meeting control scope \"${control.scope}\" is not a supported scope`\n );\n }\n\n if (!Util.canUpdate(control, this.displayHints)) {\n throw new PermissionError(\n `updating meeting control scope \"${control.scope}\" not allowed, due to moderator property.`\n );\n }\n\n return {\n [control.scope]: control.properties,\n };\n });\n\n return payloads.reduce((previous, payload) => {\n const extraBody =\n this.mainLocusUrl && this.mainLocusUrl !== this.locusUrl\n ? {authorizingLocusUrl: this.locusUrl}\n : {};\n\n return previous.then(() =>\n // @ts-ignore\n this.request.request({\n uri: `${this.mainLocusUrl || this.locusUrl}/${CONTROLS}`,\n body: {...payload, ...extraBody},\n method: HTTP_VERBS.PATCH,\n })\n );\n }, Promise.resolve());\n }\n\n /**\n * @param {Setting} setting\n * @private\n * @memberof ControlsOptionsManager\n * @returns {Promise}\n */\n private setControls(setting: {\n [Setting.muted]?: boolean;\n [Setting.disallowUnmute]?: boolean;\n [Setting.muteOnEntry]?: boolean;\n [Setting.roles]?: Array<string>;\n }): Promise<any> {\n LoggerProxy.logger.log(\n `ControlsOptionsManager:index#setControls --> ${JSON.stringify(setting)}`\n );\n\n const body: Record<string, any> = {};\n let error: PermissionError;\n\n let shouldSkipCheckToMergeBody = false;\n\n Object.entries(setting).forEach(([key, value]) => {\n if (\n !shouldSkipCheckToMergeBody &&\n value !== undefined &&\n !Util?.[`${value ? CAN_SET : CAN_UNSET}${key}`](this.displayHints)\n ) {\n error = new PermissionError(`${key} [${value}] not allowed, due to moderator property.`);\n }\n\n if (error) {\n return;\n }\n\n switch (key) {\n case Setting.muted:\n shouldSkipCheckToMergeBody = true;\n body.audio = body.audio\n ? {...body.audio, [camelCase(key)]: value}\n : {[camelCase(key)]: value};\n break;\n\n case Setting.disallowUnmute:\n case Setting.muteOnEntry:\n if (Object.keys(setting).includes(Setting.muted)) {\n body.audio = body.audio\n ? {...body.audio, [camelCase(key)]: value}\n : {[camelCase(key)]: value};\n body.audio[camelCase(key)] = value;\n } else {\n body[camelCase(key)] = {[ENABLED]: value};\n }\n break;\n\n case Setting.roles:\n if (Array.isArray(value)) {\n body.audio = body.audio\n ? {...body.audio, [camelCase(key)]: value}\n : {[camelCase(key)]: value};\n }\n break;\n\n default:\n error = new PermissionError(`${key} [${value}] not allowed, due to moderator property.`);\n }\n });\n\n if (error) {\n return Promise.reject(error);\n }\n const extraBody =\n this.mainLocusUrl && this.mainLocusUrl !== this.locusUrl\n ? {authorizingLocusUrl: this.locusUrl}\n : {};\n\n // @ts-ignore\n return this.request.request({\n uri: `${this.mainLocusUrl || this.locusUrl}/${CONTROLS}`,\n body: {...body, ...extraBody},\n method: HTTP_VERBS.PATCH,\n });\n }\n\n /**\n * @public\n * @param {boolean} enabled\n * @memberof ControlsOptionsManager\n * @returns {Promise}\n */\n public setMuteOnEntry(enabled: boolean): Promise<any> {\n return this.setControls({[Setting.muteOnEntry]: enabled});\n }\n\n /**\n * @public\n * @param {boolean} enabled\n * @memberof ControlsOptionsManager\n * @returns {Promise}\n */\n public setDisallowUnmute(enabled: boolean): Promise<any> {\n return this.setControls({[Setting.disallowUnmute]: enabled});\n }\n\n /**\n * @public\n * @param {boolean} mutedEnabled\n * @param {boolean} disallowUnmuteEnabled\n * @param {boolean} muteOnEntryEnabled\n * @param {array} roles which should be muted\n * @memberof ControlsOptionsManager\n * @returns {Promise}\n */\n public setMuteAll(\n mutedEnabled: boolean,\n disallowUnmuteEnabled: boolean,\n muteOnEntryEnabled: boolean,\n roles: Array<string>\n ): Promise<any> {\n return this.setControls({\n [Setting.muted]: mutedEnabled,\n [Setting.disallowUnmute]: disallowUnmuteEnabled,\n [Setting.muteOnEntry]: muteOnEntryEnabled,\n [Setting.roles]: roles,\n });\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,UAAA,GAAAH,OAAA;AAEA,IAAAI,YAAA,GAAAF,sBAAA,CAAAF,OAAA;AACA,IAAAK,MAAA,GAAAL,OAAA;AAEA,IAAAM,KAAA,GAAAJ,sBAAA,CAAAF,OAAA;AACA,IAAAO,WAAA,GAAAP,OAAA;AAAwD,SAAAQ,QAAAC,CAAA,EAAAC,CAAA,QAAAC,CAAA,GAAAC,aAAA,CAAAH,CAAA,OAAAI,6BAAA,QAAAC,CAAA,GAAAD,6BAAA,CAAAJ,CAAA,GAAAC,CAAA,KAAAI,CAAA,GAAAA,CAAA,CAAAC,MAAA,WAAAL,CAAA,WAAAM,gCAAA,CAAAP,CAAA,EAAAC,CAAA,EAAAO,UAAA,OAAAN,CAAA,CAAAO,IAAA,CAAAC,KAAA,CAAAR,CAAA,EAAAG,CAAA,YAAAH,CAAA;AAAA,SAAAS,cAAAX,CAAA,aAAAC,CAAA,MAAAA,CAAA,GAAAW,SAAA,CAAAC,MAAA,EAAAZ,CAAA,UAAAC,CAAA,WAAAU,SAAA,CAAAX,CAAA,IAAAW,SAAA,CAAAX,CAAA,QAAAA,CAAA,OAAAF,OAAA,CAAAe,MAAA,CAAAZ,CAAA,OAAAa,OAAA,WAA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d,OAAO,IAAI,CAACvB,WAAW,KAAA3D,gBAAA,CAAAC,OAAA,MAAAD,gBAAA,CAAAC,OAAA,MAAAD,gBAAA,CAAAC,OAAA,MAAAD,gBAAA,CAAAC,OAAA,MACpB0E,cAAO,CAACC,KAAK,EAAGa,YAAY,GAC5Bd,cAAO,CAACI,cAAc,EAAGW,qBAAqB,GAC9Cf,cAAO,CAACK,WAAW,EAAGW,kBAAkB,GACxChB,cAAO,CAACO,KAAK,EAAGA,KAAK,CACvB,CAAC;IACJ;EAAC;EAAA,OAAA7E,sBAAA;AAAA"}
1
+ {"version":3,"names":["_lodash","require","_permission","_interopRequireDefault","_constants","_loggerProxy","_enums","_util","_constants2","ownKeys","e","r","t","_Object$keys2","_Object$getOwnPropertySymbols","o","filter","_Object$getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","arguments","length","Object","forEach","_defineProperty2","default","_Object$getOwnPropertyDescriptors","_Object$defineProperties","_Object$defineProperty","ControlsOptionsManager","exports","request","options","_classCallCheck2","initialize","set","_createClass2","key","value","extract","setLocusUrl","url","isMainLocus","locusUrl","mainLocusUrl","setDisplayHints","hints","displayHints","getLocusUrl","getDisplayHints","update","_this","_len","controls","Array","_key","payloads","map","control","_keys","Control","includes","scope","Error","concat","Util","canUpdate","PermissionError","properties","reduce","previous","payload","extraBody","authorizingLocusUrl","then","uri","CONTROLS","body","method","HTTP_VERBS","PATCH","_promise","resolve","setControls","setting","_this2","LoggerProxy","logger","log","_stringify","error","shouldSkipCheckToMergeBody","_entries","_ref2","_ref3","_slicedToArray2","undefined","CAN_SET","CAN_UNSET","Setting","muted","audio","camelCase","disallowUnmute","muteOnEntry","ENABLED","roles","_isArray","reject","setMuteOnEntry","enabled","setDisallowUnmute","setMuteAll","mutedEnabled","disallowUnmuteEnabled","muteOnEntryEnabled"],"sources":["index.ts"],"sourcesContent":["import {camelCase} from 'lodash';\nimport PermissionError from '../common/errors/permission';\nimport {CONTROLS, HTTP_VERBS} from '../constants';\nimport MeetingRequest from '../meeting/request';\nimport LoggerProxy from '../common/logs/logger-proxy';\nimport {Control, Setting} from './enums';\nimport {ControlConfig} from './types';\nimport Util from './util';\nimport {CAN_SET, CAN_UNSET, ENABLED} from './constants';\n\n/**\n * docs\n * https://sqbu-github.cisco.com/pages/WebExSquared/locus/guides/mute.html\n * https://confluence-eng-gpk2.cisco.com/conf/display/LOCUS/Hard+Mute+and+Audio+Privacy#HardMuteandAudioPrivacy-SelfMuteonEntry\n * https://confluence-eng-gpk2.cisco.com/conf/pages/viewpage.action?spaceKey=UC&title=WEBEX-124454%3A+UCF%3A+Hard+mute+support+for+Teams+joining+Webex+meeting\n * https://jira-eng-gpk2.cisco.com/jira/browse/SPARK-180867\n * https://jira-eng-gpk2.cisco.com/jira/browse/SPARK-393351\n */\n\n/**\n * @description ControlsOptionsManager is responsible for handling the behavior of participant controls when somebody joins a meeting\n * @export\n * @private\n * @class Recording\n */\nexport default class ControlsOptionsManager {\n /**\n * @instance\n * @type {MeetingRequest}\n * @private\n * @memberof ControlsOptionsManager\n */\n private request: MeetingRequest;\n\n /**\n * @instance\n * @type {Array}\n * @private\n * @memberof ControlsOptionsManager\n */\n private displayHints: Array<string> = [];\n\n /**\n * @instance\n * @type {string}\n * @private\n * @memberof ControlsOptionsManager\n */\n private locusUrl: string;\n\n /**\n * @instance\n * @type {string}\n * @private\n * @memberof ControlsOptionsManager\n */\n private mainLocusUrl: string;\n\n /**\n * @param {MeetingRequest} request\n * @param {Object} options\n * @constructor\n * @memberof ControlsOptionsManager\n */\n constructor(\n request: MeetingRequest,\n options?: {\n locusUrl: string;\n displayHints?: Array<string>;\n }\n ) {\n this.initialize(request);\n this.set(options);\n }\n\n /**\n * @param {MeetingRequest} request\n * @returns {void}\n * @private\n * @memberof ControlsOptionsManager\n */\n private initialize(request: MeetingRequest) {\n this.request = request;\n }\n\n /**\n * @param {Object} options\n * @returns {void}\n * @public\n * @memberof ControlsOptionsManager\n */\n public set(options?: {locusUrl: string; displayHints?: Array<string>}) {\n this.extract(options);\n }\n\n /**\n * @param {string} url\n * @param {boolean} isMainLocus\n * @returns {void}\n * @public\n * @memberof ControlsOptionsManager\n */\n public setLocusUrl(url: string, isMainLocus?: boolean) {\n this.locusUrl = url;\n if (isMainLocus) {\n this.mainLocusUrl = url;\n }\n }\n\n /**\n * @param {Array} hints\n * @returns {void}\n * @public\n * @memberof ControlsOptionsManager\n */\n public setDisplayHints(hints: Array<string>) {\n this.displayHints = hints;\n }\n\n /**\n * @returns {string}\n * @public\n * @memberof ControlsOptionsManager\n */\n public getLocusUrl() {\n return this.locusUrl;\n }\n\n /**\n * @returns {Array}\n * @public\n * @memberof ControlsOptionsManager\n */\n public getDisplayHints() {\n return this.displayHints;\n }\n\n /**\n * @param {Object} options\n * @returns {void}\n * @private\n * @memberof ControlsOptionsManager\n */\n private extract(options?: {locusUrl: string; displayHints?: Array<string>}) {\n this.setDisplayHints(options?.displayHints);\n this.setLocusUrl(options?.locusUrl);\n }\n\n /**\n * Set controls for this meeting.\n *\n * @param {Array<ControlConfig>} controls - Spread Array of ControlConfigs\n * @returns {Promise<Array<any>>}- Promise resolving if the request was successful.\n */\n public update(...controls: Array<ControlConfig>) {\n const payloads = controls.map((control) => {\n if (!Object.keys(Control).includes(control.scope)) {\n throw new Error(\n `updating meeting control scope \"${control.scope}\" is not a supported scope`\n );\n }\n\n if (!Util.canUpdate(control, this.displayHints)) {\n throw new PermissionError(\n `updating meeting control scope \"${control.scope}\" not allowed, due to moderator property.`\n );\n }\n\n return {\n [control.scope]: control.properties,\n };\n });\n\n return payloads.reduce((previous, payload) => {\n const extraBody =\n this.mainLocusUrl && this.mainLocusUrl !== this.locusUrl\n ? {authorizingLocusUrl: this.locusUrl}\n : {};\n\n return previous.then(() =>\n // @ts-ignore\n this.request.request({\n uri: `${this.mainLocusUrl || this.locusUrl}/${CONTROLS}`,\n body: {...payload, ...extraBody},\n method: HTTP_VERBS.PATCH,\n })\n );\n }, Promise.resolve());\n }\n\n /**\n * @param {Setting} setting\n * @private\n * @memberof ControlsOptionsManager\n * @returns {Promise}\n */\n private setControls(setting: {\n [Setting.muted]?: boolean;\n [Setting.disallowUnmute]?: boolean;\n [Setting.muteOnEntry]?: boolean;\n [Setting.roles]?: Array<string>;\n }): Promise<any> {\n LoggerProxy.logger.log(\n `ControlsOptionsManager:index#setControls --> ${JSON.stringify(setting)}`\n );\n\n const body: Record<string, any> = {};\n let error: PermissionError;\n\n let shouldSkipCheckToMergeBody = false;\n\n Object.entries(setting).forEach(([key, value]) => {\n if (\n !shouldSkipCheckToMergeBody &&\n value !== undefined &&\n !Util?.[`${value ? CAN_SET : CAN_UNSET}${key}`](this.displayHints)\n ) {\n error = new PermissionError(`${key} [${value}] not allowed, due to moderator property.`);\n }\n\n if (error) {\n return;\n }\n\n switch (key) {\n case Setting.muted:\n shouldSkipCheckToMergeBody = true;\n body.audio = body.audio\n ? {...body.audio, [camelCase(key)]: value}\n : {[camelCase(key)]: value};\n break;\n\n case Setting.disallowUnmute:\n case Setting.muteOnEntry:\n if (Object.keys(setting).includes(Setting.muted)) {\n body.audio = body.audio\n ? {...body.audio, [camelCase(key)]: value}\n : {[camelCase(key)]: value};\n body.audio[camelCase(key)] = value;\n } else {\n body[camelCase(key)] = {[ENABLED]: value};\n }\n break;\n\n case Setting.roles:\n if (Array.isArray(value)) {\n body.audio = body.audio\n ? {...body.audio, [camelCase(key)]: value}\n : {[camelCase(key)]: value};\n }\n break;\n\n default:\n error = new PermissionError(`${key} [${value}] not allowed, due to moderator property.`);\n }\n });\n\n if (error) {\n return Promise.reject(error);\n }\n const extraBody =\n this.mainLocusUrl && this.mainLocusUrl !== this.locusUrl\n ? {authorizingLocusUrl: this.locusUrl}\n : {};\n\n // @ts-ignore\n return this.request.request({\n uri: `${this.mainLocusUrl || this.locusUrl}/${CONTROLS}`,\n body: {...body, ...extraBody},\n method: HTTP_VERBS.PATCH,\n });\n }\n\n /**\n * @public\n * @param {boolean} enabled\n * @memberof ControlsOptionsManager\n * @returns {Promise}\n */\n public setMuteOnEntry(enabled: boolean): Promise<any> {\n return this.setControls({[Setting.muteOnEntry]: enabled});\n }\n\n /**\n * @public\n * @param {boolean} enabled\n * @memberof ControlsOptionsManager\n * @returns {Promise}\n */\n public setDisallowUnmute(enabled: boolean): Promise<any> {\n return this.setControls({[Setting.disallowUnmute]: enabled});\n }\n\n /**\n * @public\n * @param {boolean} mutedEnabled\n * @param {boolean} disallowUnmuteEnabled\n * @param {boolean} muteOnEntryEnabled\n * @param {array} roles which should be muted\n * @memberof ControlsOptionsManager\n * @returns {Promise}\n */\n public setMuteAll(\n mutedEnabled: boolean,\n disallowUnmuteEnabled: boolean,\n muteOnEntryEnabled: boolean,\n roles: Array<string>\n ): Promise<any> {\n return this.setControls({\n [Setting.muted]: mutedEnabled,\n [Setting.disallowUnmute]: disallowUnmuteEnabled,\n [Setting.muteOnEntry]: muteOnEntryEnabled,\n [Setting.roles]: roles,\n });\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,UAAA,GAAAH,OAAA;AAEA,IAAAI,YAAA,GAAAF,sBAAA,CAAAF,OAAA;AACA,IAAAK,MAAA,GAAAL,OAAA;AAEA,IAAAM,KAAA,GAAAJ,sBAAA,CAAAF,OAAA;AACA,IAAAO,WAAA,GAAAP,OAAA;AAAwD,SAAAQ,QAAAC,CAAA,EAAAC,CAAA,QAAAC,CAAA,GAAAC,aAAA,CAAAH,CAAA,OAAAI,6BAAA,QAAAC,CAAA,GAAAD,6BAAA,CAAAJ,CAAA,GAAAC,CAAA,KAAAI,CAAA,GAAAA,CAAA,CAAAC,MAAA,WAAAL,CAAA,WAAAM,gCAAA,CAAAP,CAAA,EAAAC,CAAA,EAAAO,UAAA,OAAAN,CAAA,CAAAO,IAAA,CAAAC,KAAA,CAAAR,CAAA,EAAAG,CAAA,YAAAH,CAAA;AAA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AAgB;MACvD,OAAO,IAAI,CAAC3B,WAAW,KAAA3D,gBAAA,CAAAC,OAAA,MAAG0E,cAAO,CAACI,cAAc,EAAGO,OAAO,CAAC,CAAC;IAC9D;;IAEA;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EARE;IAAAzE,GAAA;IAAAC,KAAA,EASA,SAAO0E,UAAUA,CACfC,YAAqB,EACrBC,qBAA8B,EAC9BC,kBAA2B,EAC3BT,KAAoB,EACN;MACd,OAAO,IAAI,CAACvB,WAAW,KAAA3D,gBAAA,CAAAC,OAAA,MAAAD,gBAAA,CAAAC,OAAA,MAAAD,gBAAA,CAAAC,OAAA,MAAAD,gBAAA,CAAAC,OAAA,MACpB0E,cAAO,CAACC,KAAK,EAAGa,YAAY,GAC5Bd,cAAO,CAACI,cAAc,EAAGW,qBAAqB,GAC9Cf,cAAO,CAACK,WAAW,EAAGW,kBAAkB,GACxChB,cAAO,CAACO,KAAK,EAAGA,KAAK,CACvB,CAAC;IACJ;EAAC;AAAA","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["types.ts"],"sourcesContent":["import {Control} from './enums';\n\nexport interface ControlProperties {\n /**\n * A list of additional properties that apply to various specific settings.\n *\n * @remarks\n * The values stored here, per the service, are fully ambiguous, an can vary\n * depending on which control scope is being configured.\n */\n [key: string]: boolean;\n}\n\nexport interface AudioProperties {\n muted?: boolean;\n disallowUnmute?: boolean;\n muteOnEntry?: boolean;\n}\n\nexport interface RaiseHandProperties {\n enabled?: boolean;\n}\n\nexport interface ReactionsProperties {\n enabled?: boolean;\n showDisplayNameWithReactions?: boolean;\n}\n\nexport interface ShareControlProperties {\n control?: 'ANYONE' | 'MODERATOR_PRESENTER';\n}\n\nexport interface VideoProperties {\n enabled?: boolean;\n}\n\nexport interface ViewTheParticipantListProperties {\n enabled?: boolean;\n panelistEnabled?: boolean;\n attendeeCount?: boolean;\n}\n\nexport interface AnnotationProperties {\n enabled?: boolean;\n}\n\nexport interface RemoteDesktopControlProperties {\n enabled?: boolean;\n}\n\nexport interface PollingQAProperties {\n enabled?: boolean;\n}\n\nexport type Properties =\n | AudioProperties\n | RaiseHandProperties\n | ReactionsProperties\n | ShareControlProperties\n | VideoProperties\n | ViewTheParticipantListProperties\n | AnnotationProperties\n | RemoteDesktopControlProperties\n | PollingQAProperties;\n\nexport interface ControlConfig<Props = Properties> {\n /**\n * The scope of the control within this object.\n */\n scope: Control;\n\n /**\n * The properties to assign to this control.\n */\n properties: Props;\n}\n"],"mappings":""}
1
+ {"version":3,"names":[],"sources":["types.ts"],"sourcesContent":["import {Control} from './enums';\n\nexport interface ControlProperties {\n /**\n * A list of additional properties that apply to various specific settings.\n *\n * @remarks\n * The values stored here, per the service, are fully ambiguous, an can vary\n * depending on which control scope is being configured.\n */\n [key: string]: boolean;\n}\n\nexport interface AudioProperties {\n muted?: boolean;\n disallowUnmute?: boolean;\n muteOnEntry?: boolean;\n}\n\nexport interface RaiseHandProperties {\n enabled?: boolean;\n}\n\nexport interface ReactionsProperties {\n enabled?: boolean;\n showDisplayNameWithReactions?: boolean;\n}\n\nexport interface ShareControlProperties {\n control?: 'ANYONE' | 'MODERATOR_PRESENTER';\n}\n\nexport interface VideoProperties {\n enabled?: boolean;\n}\n\nexport interface ViewTheParticipantListProperties {\n enabled?: boolean;\n panelistEnabled?: boolean;\n attendeeCount?: boolean;\n}\n\nexport interface AnnotationProperties {\n enabled?: boolean;\n}\n\nexport interface RemoteDesktopControlProperties {\n enabled?: boolean;\n}\n\nexport interface PollingQAProperties {\n enabled?: boolean;\n}\n\nexport type Properties =\n | AudioProperties\n | RaiseHandProperties\n | ReactionsProperties\n | ShareControlProperties\n | VideoProperties\n | ViewTheParticipantListProperties\n | AnnotationProperties\n | RemoteDesktopControlProperties\n | PollingQAProperties;\n\nexport interface ControlConfig<Props = Properties> {\n /**\n * The scope of the control within this object.\n */\n scope: Control;\n\n /**\n * The properties to assign to this control.\n */\n properties: Props;\n}\n"],"mappings":"","ignoreList":[]}
@@ -19,7 +19,7 @@ var Utils = /*#__PURE__*/function () {
19
19
  function Utils() {
20
20
  (0, _classCallCheck2.default)(this, Utils);
21
21
  }
22
- (0, _createClass2.default)(Utils, null, [{
22
+ return (0, _createClass2.default)(Utils, null, [{
23
23
  key: "canSetMuteOnEntry",
24
24
  value:
25
25
  /**
@@ -402,7 +402,6 @@ var Utils = /*#__PURE__*/function () {
402
402
  return determinant;
403
403
  }
404
404
  }]);
405
- return Utils;
406
405
  }();
407
406
  var _default = exports.default = Utils;
408
407
  //# sourceMappingURL=util.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_constants","require","_enums","Utils","_classCallCheck2","default","_createClass2","key","value","canSetMuteOnEntry","displayHints","includes","DISPLAY_HINTS","ENABLE_MUTE_ON_ENTRY","canSetDisallowUnmute","ENABLE_HARD_MUTE","canUnsetMuteOnEntry","DISABLE_MUTE_ON_ENTRY","canUnsetDisallowUnmute","DISABLE_HARD_MUTE","canSetMuted","MUTE_ALL","canUnsetMuted","UNMUTE_ALL","hasHints","config","requiredHints","every","hint","hasPolicies","requiredPolicies","_config$policies","policies","canUpdateAudio","control","properties","muted","push","disallowUnmute","muteOnEntry","canUpdateRaiseHand","enabled","ENABLE_RAISE_HAND","DISABLE_RAISE_HAND","canUpdateReactions","showDisplayNameWithReactions","undefined","ENABLE_SHOW_DISPLAY_NAME","DISABLE_SHOW_DISPLAY_NAME","ENABLE_REACTIONS","DISABLE_REACTIONS","canUpdateShareControl","SHARE_CONTROL","canUpdateViewTheParticipantsList","ENABLE_VIEW_THE_PARTICIPANT_LIST","DISABLE_VIEW_THE_PARTICIPANT_LIST","panelistEnabled","ENABLE_VIEW_THE_PARTICIPANT_LIST_PANELIST","DISABLE_VIEW_THE_PARTICIPANT_LIST_PANELIST","attendeeCount","ENABLE_SHOW_ATTENDEE_COUNT","DISABLE_SHOW_ATTENDEE_COUNT","canUpdateVideo","ENABLE_VIDEO","DISABLE_VIDEO","canUpdateAnnotation","ENABLE_ANNOTATION_MEETING_OPTION","DISABLE_ANNOTATION_MEETING_OPTION","canUpdateRemoteDesktopControl","ENABLE_RDC_MEETING_OPTION","DISABLE_RDC_MEETING_OPTION","canUpdatePollingQA","ENABLE_ATTENDEE_START_POLLING_QA","DISABLE_ATTENDEE_START_POLLING_QA","canUpdate","determinant","scope","Control","audio","raiseHand","reactions","shareControl","video","viewTheParticipantList","annotation","rdc","pollingQA","_default","exports"],"sources":["util.ts"],"sourcesContent":["import {DISPLAY_HINTS} from '../constants';\nimport {Control} from './enums';\nimport {\n ControlConfig,\n AudioProperties,\n RaiseHandProperties,\n ReactionsProperties,\n ViewTheParticipantListProperties,\n VideoProperties,\n type RemoteDesktopControlProperties,\n type AnnotationProperties,\n type PollingQAProperties,\n} from './types';\n\n/**\n * The Controls Options Manager utilities\n *\n * @internal\n */\nclass Utils {\n /**\n * Validate if enabling mute on entry can be set.\n *\n * @param {Array<string>} displayHints - Display Hints to use when validating.\n * @returns {boolean} - True if the action is allowed.\n */\n public static canSetMuteOnEntry(displayHints: Array<string>): boolean {\n return displayHints.includes(DISPLAY_HINTS.ENABLE_MUTE_ON_ENTRY);\n }\n\n /**\n * Validate if allowing unmuting can be set.\n *\n * @param {Array<string>} displayHints - Display Hints to use when validating.\n * @returns {boolean} - True if the action is allowed.\n */\n public static canSetDisallowUnmute(displayHints: Array<string>): boolean {\n return displayHints.includes(DISPLAY_HINTS.ENABLE_HARD_MUTE);\n }\n\n /**\n * Validate if disabling mute on entry can be set.\n *\n * @param {Array<string>} displayHints - Display Hints to use when validating.\n * @returns {boolean} - True if the action is allowed.\n */\n public static canUnsetMuteOnEntry(displayHints: Array<string>): boolean {\n return displayHints.includes(DISPLAY_HINTS.DISABLE_MUTE_ON_ENTRY);\n }\n\n /**\n * Validate if enabling muting can be set.\n *\n * @param {Array<string>} displayHints - Display Hints to use when validating.\n * @returns {boolean} - True if the action is allowed.\n */\n public static canUnsetDisallowUnmute(displayHints: Array<string>): boolean {\n return displayHints.includes(DISPLAY_HINTS.DISABLE_HARD_MUTE);\n }\n\n /**\n * Validate if muting all can be set.\n *\n * @param {Array<string>} displayHints - Display Hints to use when validating.\n * @returns {boolean} - True if the action is allowed.\n */\n public static canSetMuted(displayHints: Array<string>): boolean {\n return displayHints.includes(DISPLAY_HINTS.MUTE_ALL);\n }\n\n /**\n * Validate if unmuting all can be set.\n *\n * @param {Array<string>} displayHints - Display Hints to use when validating.\n * @returns {boolean} - True if the action is allowed.\n */\n public static canUnsetMuted(displayHints: Array<string>): boolean {\n return displayHints.includes(DISPLAY_HINTS.UNMUTE_ALL);\n }\n\n /**\n * Validate an array of hints are allowed based on a full collection of hints.\n *\n * @param {Object} config - Configuration Object.\n * @param {Array<string>} config.requiredHints - Hints required for validation.\n * @param {Array<string>} config.displayHints - All available hints.\n * @returns {boolean} - True if all of the actions are allowed.\n */\n public static hasHints(config: {requiredHints: Array<string>; displayHints: Array<string>}) {\n const {requiredHints, displayHints} = config;\n\n return requiredHints.every((hint) => displayHints.includes(hint));\n }\n\n /**\n * Validate that the self policy object contains the required policies.\n *\n * @param {Object} config - Configuration Object.\n * @param {Array<string>} config.requiredPolicies - Policies required for validation.\n * @param {Array<string>} config.policies - All available policies.\n * @returns {boolean} - True if all of the actions are allowed.\n */\n public static hasPolicies(config: {requiredPolicies: Array<string>; policies: Array<string>}) {\n const {requiredPolicies, policies = {}} = config;\n\n return requiredPolicies.every((hint) => policies[hint]);\n }\n\n /**\n * Validate if an audio-scoped control is allowed to be sent to the service.\n *\n * @param {ControlConfig<AudioProperties>} control - Audio control config to validate.\n * @param {Array<string>} displayHints - All available hints.\n * @returns {boolean} - True if all of the actions are allowed.\n */\n public static canUpdateAudio(\n control: ControlConfig<AudioProperties>,\n displayHints: Array<string>\n ) {\n const requiredHints = [];\n\n if (control.properties.muted === true) {\n requiredHints.push(DISPLAY_HINTS.MUTE_ALL);\n }\n if (control.properties.muted === false) {\n requiredHints.push(DISPLAY_HINTS.UNMUTE_ALL);\n }\n if (control.properties.disallowUnmute === true) {\n requiredHints.push(DISPLAY_HINTS.ENABLE_HARD_MUTE);\n }\n if (control.properties.disallowUnmute === false) {\n requiredHints.push(DISPLAY_HINTS.DISABLE_HARD_MUTE);\n }\n if (control.properties.muteOnEntry === true) {\n requiredHints.push(DISPLAY_HINTS.ENABLE_MUTE_ON_ENTRY);\n }\n if (control.properties.muteOnEntry === false) {\n requiredHints.push(DISPLAY_HINTS.DISABLE_MUTE_ON_ENTRY);\n }\n\n return Utils.hasHints({requiredHints, displayHints});\n }\n\n public static canUpdateRaiseHand(\n control: ControlConfig<RaiseHandProperties>,\n displayHints: Array<string>\n ) {\n const requiredHints = [];\n\n if (control.properties.enabled === true) {\n requiredHints.push(DISPLAY_HINTS.ENABLE_RAISE_HAND);\n }\n if (control.properties.enabled === false) {\n requiredHints.push(DISPLAY_HINTS.DISABLE_RAISE_HAND);\n }\n\n return Utils.hasHints({requiredHints, displayHints});\n }\n\n /**\n * Validate if an reactions-scoped control is allowed to be sent to the service.\n *\n * @param {ControlConfig<ReactionsProperties>} control - Reaction control config to validate.\n * @param {Array<string>} displayHints - All available hints.\n * @returns {boolean} - True if all of the actions are allowed.\n */\n public static canUpdateReactions(\n control: ControlConfig<ReactionsProperties>,\n displayHints: Array<string>\n ) {\n const requiredHints = [];\n\n // This additional if statement avoids the display hint discrepency due to\n // the service blocking partial requests with this property only.\n if (control.properties.showDisplayNameWithReactions !== undefined) {\n if (control.properties.showDisplayNameWithReactions === true) {\n requiredHints.push(DISPLAY_HINTS.ENABLE_SHOW_DISPLAY_NAME);\n }\n if (control.properties.showDisplayNameWithReactions === false) {\n requiredHints.push(DISPLAY_HINTS.DISABLE_SHOW_DISPLAY_NAME);\n }\n } else {\n if (control.properties.enabled === true) {\n requiredHints.push(DISPLAY_HINTS.ENABLE_REACTIONS);\n }\n if (control.properties.enabled === false) {\n requiredHints.push(DISPLAY_HINTS.DISABLE_REACTIONS);\n }\n }\n\n return Utils.hasHints({requiredHints, displayHints});\n }\n\n /**\n * Validate if an share-control-scoped control is allowed to be sent to the service.\n *\n * @param {Array<string>} displayHints - All available hints.\n * @returns {boolean} - True if all of the actions are allowed.\n */\n public static canUpdateShareControl(displayHints: Array<string>) {\n return Utils.hasHints({requiredHints: [DISPLAY_HINTS.SHARE_CONTROL], displayHints});\n }\n\n /**\n * Validate if an view-the-participants-list-scoped control is allowed to be sent to the service.\n *\n * @param {ControlConfig<ViewTheParticipantListProperties>} control - View Participants List control config to validate.\n * @param {Array<string>} displayHints - All available hints.\n * @returns {boolean} - True if all of the actions are allowed.\n */\n public static canUpdateViewTheParticipantsList(\n control: ControlConfig<ViewTheParticipantListProperties>,\n displayHints: Array<string>\n ) {\n const requiredHints = [];\n\n if (control.properties.enabled === true) {\n requiredHints.push(DISPLAY_HINTS.ENABLE_VIEW_THE_PARTICIPANT_LIST);\n }\n if (control.properties.enabled === false) {\n requiredHints.push(DISPLAY_HINTS.DISABLE_VIEW_THE_PARTICIPANT_LIST);\n }\n if (control.properties.panelistEnabled === true) {\n requiredHints.push(DISPLAY_HINTS.ENABLE_VIEW_THE_PARTICIPANT_LIST_PANELIST);\n }\n if (control.properties.panelistEnabled === false) {\n requiredHints.push(DISPLAY_HINTS.DISABLE_VIEW_THE_PARTICIPANT_LIST_PANELIST);\n }\n if (control.properties.attendeeCount === true) {\n requiredHints.push(DISPLAY_HINTS.ENABLE_SHOW_ATTENDEE_COUNT);\n }\n if (control.properties.attendeeCount === false) {\n requiredHints.push(DISPLAY_HINTS.DISABLE_SHOW_ATTENDEE_COUNT);\n }\n\n return Utils.hasHints({requiredHints, displayHints});\n }\n\n /**\n * Validate if a video-scoped control is allowed to be sent to the service.\n *\n * @param {ControlConfig<VideoProperties>} control - Video control config to validate.\n * @param {Array<string>} displayHints - All available hints.\n * @returns {boolean} - True if all of the actions are allowed.\n */\n public static canUpdateVideo(\n control: ControlConfig<VideoProperties>,\n displayHints: Array<string>\n ) {\n const requiredHints = [];\n\n if (control.properties.enabled === true) {\n requiredHints.push(DISPLAY_HINTS.ENABLE_VIDEO);\n }\n if (control.properties.enabled === false) {\n requiredHints.push(DISPLAY_HINTS.DISABLE_VIDEO);\n }\n\n return Utils.hasHints({requiredHints, displayHints});\n }\n\n /**\n * Validate if a annotation-scoped control is allowed to be sent to the service.\n *\n * @param {ControlConfig<AnnotationProperties>} control - Annotation control config to validate\n * @param {Array<string>} displayHints - All available hints\n * @returns {boolean} - True if all of the actions are allowed.\n */\n public static canUpdateAnnotation(\n control: ControlConfig<AnnotationProperties>,\n displayHints: Array<string>\n ): boolean {\n const requiredHints = [];\n\n if (control.properties.enabled === true) {\n requiredHints.push(DISPLAY_HINTS.ENABLE_ANNOTATION_MEETING_OPTION);\n }\n if (control.properties.enabled === false) {\n requiredHints.push(DISPLAY_HINTS.DISABLE_ANNOTATION_MEETING_OPTION);\n }\n\n return Utils.hasHints({requiredHints, displayHints});\n }\n\n /**\n * Validate if a rdc-scoped control is allowed to be sent to the service.\n *\n * @param {ControlConfig<RemoteDesktopControlProperties>} control - Remote Desktop Control config to validate\n * @param {Array<string>} displayHints - All available hints\n * @returns {boolean} - True if all of the actions are allowed.\n */\n public static canUpdateRemoteDesktopControl(\n control: ControlConfig<RemoteDesktopControlProperties>,\n displayHints: Array<string>\n ): boolean {\n const requiredHints = [];\n\n if (control.properties.enabled === true) {\n requiredHints.push(DISPLAY_HINTS.ENABLE_RDC_MEETING_OPTION);\n }\n if (control.properties.enabled === false) {\n requiredHints.push(DISPLAY_HINTS.DISABLE_RDC_MEETING_OPTION);\n }\n\n return Utils.hasHints({requiredHints, displayHints});\n }\n\n /**\n * Validate if a pollingQA-scoped control is allowed to be sent to the service.\n *\n * @param {ControlConfig<PollingQAProperties>} control - Polling QA config to validate\n * @param {Array<string>} displayHints - All available hints\n * @returns {boolean} - True if all of the actions are allowed.\n */\n public static canUpdatePollingQA(\n control: ControlConfig<PollingQAProperties>,\n displayHints: Array<string>\n ): boolean {\n const requiredHints = [];\n\n if (control.properties.enabled === true) {\n requiredHints.push(DISPLAY_HINTS.ENABLE_ATTENDEE_START_POLLING_QA);\n }\n if (control.properties.enabled === false) {\n requiredHints.push(DISPLAY_HINTS.DISABLE_ATTENDEE_START_POLLING_QA);\n }\n\n return Utils.hasHints({requiredHints, displayHints});\n }\n\n /**\n * Validate that a control can be sent to the service based on the provided\n * display hints.\n *\n * @param {ControlConfig} control - Control to validate.\n * @param {Array<string>} displayHints - All available hints.\n * @returns {boolean} - True if all of the actions are allowed.\n */\n public static canUpdate(control: ControlConfig, displayHints: Array<string>) {\n let determinant: boolean;\n\n switch (control.scope) {\n case Control.audio:\n determinant = Utils.canUpdateAudio(control as ControlConfig<AudioProperties>, displayHints);\n break;\n\n case Control.raiseHand:\n determinant = Utils.canUpdateRaiseHand(\n control as ControlConfig<RaiseHandProperties>,\n displayHints\n );\n break;\n\n case Control.reactions:\n determinant = Utils.canUpdateReactions(\n control as ControlConfig<ReactionsProperties>,\n displayHints\n );\n break;\n\n case Control.shareControl:\n determinant = Utils.canUpdateShareControl(displayHints);\n break;\n\n case Control.video:\n determinant = Utils.canUpdateVideo(control as ControlConfig<VideoProperties>, displayHints);\n break;\n\n case Control.viewTheParticipantList:\n determinant = Utils.canUpdateViewTheParticipantsList(\n control as ControlConfig<ViewTheParticipantListProperties>,\n displayHints\n );\n break;\n\n case Control.annotation:\n determinant = Utils.canUpdateAnnotation(\n control as ControlConfig<AnnotationProperties>,\n displayHints\n );\n break;\n\n case Control.rdc:\n determinant = Utils.canUpdateRemoteDesktopControl(\n control as ControlConfig<RemoteDesktopControlProperties>,\n displayHints\n );\n break;\n\n case Control.pollingQA:\n determinant = Utils.canUpdatePollingQA(\n control as ControlConfig<PollingQAProperties>,\n displayHints\n );\n break;\n\n default:\n determinant = false;\n }\n\n return determinant;\n }\n}\n\nexport default Utils;\n"],"mappings":";;;;;;;;;;AAAA,IAAAA,UAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AAaA;AACA;AACA;AACA;AACA;AAJA,IAKME,K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,GAAG;UACdV,WAAW,GAAGxE,KAAK,CAACiE,6BAA6B,CAC/ClC,OAAO,EACPxB,YACF,CAAC;UACD;QAEF,KAAKmE,cAAO,CAACS,SAAS;UACpBX,WAAW,GAAGxE,KAAK,CAACoE,kBAAkB,CACpCrC,OAAO,EACPxB,YACF,CAAC;UACD;QAEF;UACEiE,WAAW,GAAG,KAAK;MACvB;MAEA,OAAOA,WAAW;IACpB;EAAC;EAAA,OAAAxE,KAAA;AAAA;AAAA,IAAAoF,QAAA,GAAAC,OAAA,CAAAnF,OAAA,GAGYF,KAAK"}
1
+ {"version":3,"names":["_constants","require","_enums","Utils","_classCallCheck2","default","_createClass2","key","value","canSetMuteOnEntry","displayHints","includes","DISPLAY_HINTS","ENABLE_MUTE_ON_ENTRY","canSetDisallowUnmute","ENABLE_HARD_MUTE","canUnsetMuteOnEntry","DISABLE_MUTE_ON_ENTRY","canUnsetDisallowUnmute","DISABLE_HARD_MUTE","canSetMuted","MUTE_ALL","canUnsetMuted","UNMUTE_ALL","hasHints","config","requiredHints","every","hint","hasPolicies","requiredPolicies","_config$policies","policies","canUpdateAudio","control","properties","muted","push","disallowUnmute","muteOnEntry","canUpdateRaiseHand","enabled","ENABLE_RAISE_HAND","DISABLE_RAISE_HAND","canUpdateReactions","showDisplayNameWithReactions","undefined","ENABLE_SHOW_DISPLAY_NAME","DISABLE_SHOW_DISPLAY_NAME","ENABLE_REACTIONS","DISABLE_REACTIONS","canUpdateShareControl","SHARE_CONTROL","canUpdateViewTheParticipantsList","ENABLE_VIEW_THE_PARTICIPANT_LIST","DISABLE_VIEW_THE_PARTICIPANT_LIST","panelistEnabled","ENABLE_VIEW_THE_PARTICIPANT_LIST_PANELIST","DISABLE_VIEW_THE_PARTICIPANT_LIST_PANELIST","attendeeCount","ENABLE_SHOW_ATTENDEE_COUNT","DISABLE_SHOW_ATTENDEE_COUNT","canUpdateVideo","ENABLE_VIDEO","DISABLE_VIDEO","canUpdateAnnotation","ENABLE_ANNOTATION_MEETING_OPTION","DISABLE_ANNOTATION_MEETING_OPTION","canUpdateRemoteDesktopControl","ENABLE_RDC_MEETING_OPTION","DISABLE_RDC_MEETING_OPTION","canUpdatePollingQA","ENABLE_ATTENDEE_START_POLLING_QA","DISABLE_ATTENDEE_START_POLLING_QA","canUpdate","determinant","scope","Control","audio","raiseHand","reactions","shareControl","video","viewTheParticipantList","annotation","rdc","pollingQA","_default","exports"],"sources":["util.ts"],"sourcesContent":["import {DISPLAY_HINTS} from '../constants';\nimport {Control} from './enums';\nimport {\n ControlConfig,\n AudioProperties,\n RaiseHandProperties,\n ReactionsProperties,\n ViewTheParticipantListProperties,\n VideoProperties,\n type RemoteDesktopControlProperties,\n type AnnotationProperties,\n type PollingQAProperties,\n} from './types';\n\n/**\n * The Controls Options Manager utilities\n *\n * @internal\n */\nclass Utils {\n /**\n * Validate if enabling mute on entry can be set.\n *\n * @param {Array<string>} displayHints - Display Hints to use when validating.\n * @returns {boolean} - True if the action is allowed.\n */\n public static canSetMuteOnEntry(displayHints: Array<string>): boolean {\n return displayHints.includes(DISPLAY_HINTS.ENABLE_MUTE_ON_ENTRY);\n }\n\n /**\n * Validate if allowing unmuting can be set.\n *\n * @param {Array<string>} displayHints - Display Hints to use when validating.\n * @returns {boolean} - True if the action is allowed.\n */\n public static canSetDisallowUnmute(displayHints: Array<string>): boolean {\n return displayHints.includes(DISPLAY_HINTS.ENABLE_HARD_MUTE);\n }\n\n /**\n * Validate if disabling mute on entry can be set.\n *\n * @param {Array<string>} displayHints - Display Hints to use when validating.\n * @returns {boolean} - True if the action is allowed.\n */\n public static canUnsetMuteOnEntry(displayHints: Array<string>): boolean {\n return displayHints.includes(DISPLAY_HINTS.DISABLE_MUTE_ON_ENTRY);\n }\n\n /**\n * Validate if enabling muting can be set.\n *\n * @param {Array<string>} displayHints - Display Hints to use when validating.\n * @returns {boolean} - True if the action is allowed.\n */\n public static canUnsetDisallowUnmute(displayHints: Array<string>): boolean {\n return displayHints.includes(DISPLAY_HINTS.DISABLE_HARD_MUTE);\n }\n\n /**\n * Validate if muting all can be set.\n *\n * @param {Array<string>} displayHints - Display Hints to use when validating.\n * @returns {boolean} - True if the action is allowed.\n */\n public static canSetMuted(displayHints: Array<string>): boolean {\n return displayHints.includes(DISPLAY_HINTS.MUTE_ALL);\n }\n\n /**\n * Validate if unmuting all can be set.\n *\n * @param {Array<string>} displayHints - Display Hints to use when validating.\n * @returns {boolean} - True if the action is allowed.\n */\n public static canUnsetMuted(displayHints: Array<string>): boolean {\n return displayHints.includes(DISPLAY_HINTS.UNMUTE_ALL);\n }\n\n /**\n * Validate an array of hints are allowed based on a full collection of hints.\n *\n * @param {Object} config - Configuration Object.\n * @param {Array<string>} config.requiredHints - Hints required for validation.\n * @param {Array<string>} config.displayHints - All available hints.\n * @returns {boolean} - True if all of the actions are allowed.\n */\n public static hasHints(config: {requiredHints: Array<string>; displayHints: Array<string>}) {\n const {requiredHints, displayHints} = config;\n\n return requiredHints.every((hint) => displayHints.includes(hint));\n }\n\n /**\n * Validate that the self policy object contains the required policies.\n *\n * @param {Object} config - Configuration Object.\n * @param {Array<string>} config.requiredPolicies - Policies required for validation.\n * @param {Array<string>} config.policies - All available policies.\n * @returns {boolean} - True if all of the actions are allowed.\n */\n public static hasPolicies(config: {requiredPolicies: Array<string>; policies: Array<string>}) {\n const {requiredPolicies, policies = {}} = config;\n\n return requiredPolicies.every((hint) => policies[hint]);\n }\n\n /**\n * Validate if an audio-scoped control is allowed to be sent to the service.\n *\n * @param {ControlConfig<AudioProperties>} control - Audio control config to validate.\n * @param {Array<string>} displayHints - All available hints.\n * @returns {boolean} - True if all of the actions are allowed.\n */\n public static canUpdateAudio(\n control: ControlConfig<AudioProperties>,\n displayHints: Array<string>\n ) {\n const requiredHints = [];\n\n if (control.properties.muted === true) {\n requiredHints.push(DISPLAY_HINTS.MUTE_ALL);\n }\n if (control.properties.muted === false) {\n requiredHints.push(DISPLAY_HINTS.UNMUTE_ALL);\n }\n if (control.properties.disallowUnmute === true) {\n requiredHints.push(DISPLAY_HINTS.ENABLE_HARD_MUTE);\n }\n if (control.properties.disallowUnmute === false) {\n requiredHints.push(DISPLAY_HINTS.DISABLE_HARD_MUTE);\n }\n if (control.properties.muteOnEntry === true) {\n requiredHints.push(DISPLAY_HINTS.ENABLE_MUTE_ON_ENTRY);\n }\n if (control.properties.muteOnEntry === false) {\n requiredHints.push(DISPLAY_HINTS.DISABLE_MUTE_ON_ENTRY);\n }\n\n return Utils.hasHints({requiredHints, displayHints});\n }\n\n public static canUpdateRaiseHand(\n control: ControlConfig<RaiseHandProperties>,\n displayHints: Array<string>\n ) {\n const requiredHints = [];\n\n if (control.properties.enabled === true) {\n requiredHints.push(DISPLAY_HINTS.ENABLE_RAISE_HAND);\n }\n if (control.properties.enabled === false) {\n requiredHints.push(DISPLAY_HINTS.DISABLE_RAISE_HAND);\n }\n\n return Utils.hasHints({requiredHints, displayHints});\n }\n\n /**\n * Validate if an reactions-scoped control is allowed to be sent to the service.\n *\n * @param {ControlConfig<ReactionsProperties>} control - Reaction control config to validate.\n * @param {Array<string>} displayHints - All available hints.\n * @returns {boolean} - True if all of the actions are allowed.\n */\n public static canUpdateReactions(\n control: ControlConfig<ReactionsProperties>,\n displayHints: Array<string>\n ) {\n const requiredHints = [];\n\n // This additional if statement avoids the display hint discrepency due to\n // the service blocking partial requests with this property only.\n if (control.properties.showDisplayNameWithReactions !== undefined) {\n if (control.properties.showDisplayNameWithReactions === true) {\n requiredHints.push(DISPLAY_HINTS.ENABLE_SHOW_DISPLAY_NAME);\n }\n if (control.properties.showDisplayNameWithReactions === false) {\n requiredHints.push(DISPLAY_HINTS.DISABLE_SHOW_DISPLAY_NAME);\n }\n } else {\n if (control.properties.enabled === true) {\n requiredHints.push(DISPLAY_HINTS.ENABLE_REACTIONS);\n }\n if (control.properties.enabled === false) {\n requiredHints.push(DISPLAY_HINTS.DISABLE_REACTIONS);\n }\n }\n\n return Utils.hasHints({requiredHints, displayHints});\n }\n\n /**\n * Validate if an share-control-scoped control is allowed to be sent to the service.\n *\n * @param {Array<string>} displayHints - All available hints.\n * @returns {boolean} - True if all of the actions are allowed.\n */\n public static canUpdateShareControl(displayHints: Array<string>) {\n return Utils.hasHints({requiredHints: [DISPLAY_HINTS.SHARE_CONTROL], displayHints});\n }\n\n /**\n * Validate if an view-the-participants-list-scoped control is allowed to be sent to the service.\n *\n * @param {ControlConfig<ViewTheParticipantListProperties>} control - View Participants List control config to validate.\n * @param {Array<string>} displayHints - All available hints.\n * @returns {boolean} - True if all of the actions are allowed.\n */\n public static canUpdateViewTheParticipantsList(\n control: ControlConfig<ViewTheParticipantListProperties>,\n displayHints: Array<string>\n ) {\n const requiredHints = [];\n\n if (control.properties.enabled === true) {\n requiredHints.push(DISPLAY_HINTS.ENABLE_VIEW_THE_PARTICIPANT_LIST);\n }\n if (control.properties.enabled === false) {\n requiredHints.push(DISPLAY_HINTS.DISABLE_VIEW_THE_PARTICIPANT_LIST);\n }\n if (control.properties.panelistEnabled === true) {\n requiredHints.push(DISPLAY_HINTS.ENABLE_VIEW_THE_PARTICIPANT_LIST_PANELIST);\n }\n if (control.properties.panelistEnabled === false) {\n requiredHints.push(DISPLAY_HINTS.DISABLE_VIEW_THE_PARTICIPANT_LIST_PANELIST);\n }\n if (control.properties.attendeeCount === true) {\n requiredHints.push(DISPLAY_HINTS.ENABLE_SHOW_ATTENDEE_COUNT);\n }\n if (control.properties.attendeeCount === false) {\n requiredHints.push(DISPLAY_HINTS.DISABLE_SHOW_ATTENDEE_COUNT);\n }\n\n return Utils.hasHints({requiredHints, displayHints});\n }\n\n /**\n * Validate if a video-scoped control is allowed to be sent to the service.\n *\n * @param {ControlConfig<VideoProperties>} control - Video control config to validate.\n * @param {Array<string>} displayHints - All available hints.\n * @returns {boolean} - True if all of the actions are allowed.\n */\n public static canUpdateVideo(\n control: ControlConfig<VideoProperties>,\n displayHints: Array<string>\n ) {\n const requiredHints = [];\n\n if (control.properties.enabled === true) {\n requiredHints.push(DISPLAY_HINTS.ENABLE_VIDEO);\n }\n if (control.properties.enabled === false) {\n requiredHints.push(DISPLAY_HINTS.DISABLE_VIDEO);\n }\n\n return Utils.hasHints({requiredHints, displayHints});\n }\n\n /**\n * Validate if a annotation-scoped control is allowed to be sent to the service.\n *\n * @param {ControlConfig<AnnotationProperties>} control - Annotation control config to validate\n * @param {Array<string>} displayHints - All available hints\n * @returns {boolean} - True if all of the actions are allowed.\n */\n public static canUpdateAnnotation(\n control: ControlConfig<AnnotationProperties>,\n displayHints: Array<string>\n ): boolean {\n const requiredHints = [];\n\n if (control.properties.enabled === true) {\n requiredHints.push(DISPLAY_HINTS.ENABLE_ANNOTATION_MEETING_OPTION);\n }\n if (control.properties.enabled === false) {\n requiredHints.push(DISPLAY_HINTS.DISABLE_ANNOTATION_MEETING_OPTION);\n }\n\n return Utils.hasHints({requiredHints, displayHints});\n }\n\n /**\n * Validate if a rdc-scoped control is allowed to be sent to the service.\n *\n * @param {ControlConfig<RemoteDesktopControlProperties>} control - Remote Desktop Control config to validate\n * @param {Array<string>} displayHints - All available hints\n * @returns {boolean} - True if all of the actions are allowed.\n */\n public static canUpdateRemoteDesktopControl(\n control: ControlConfig<RemoteDesktopControlProperties>,\n displayHints: Array<string>\n ): boolean {\n const requiredHints = [];\n\n if (control.properties.enabled === true) {\n requiredHints.push(DISPLAY_HINTS.ENABLE_RDC_MEETING_OPTION);\n }\n if (control.properties.enabled === false) {\n requiredHints.push(DISPLAY_HINTS.DISABLE_RDC_MEETING_OPTION);\n }\n\n return Utils.hasHints({requiredHints, displayHints});\n }\n\n /**\n * Validate if a pollingQA-scoped control is allowed to be sent to the service.\n *\n * @param {ControlConfig<PollingQAProperties>} control - Polling QA config to validate\n * @param {Array<string>} displayHints - All available hints\n * @returns {boolean} - True if all of the actions are allowed.\n */\n public static canUpdatePollingQA(\n control: ControlConfig<PollingQAProperties>,\n displayHints: Array<string>\n ): boolean {\n const requiredHints = [];\n\n if (control.properties.enabled === true) {\n requiredHints.push(DISPLAY_HINTS.ENABLE_ATTENDEE_START_POLLING_QA);\n }\n if (control.properties.enabled === false) {\n requiredHints.push(DISPLAY_HINTS.DISABLE_ATTENDEE_START_POLLING_QA);\n }\n\n return Utils.hasHints({requiredHints, displayHints});\n }\n\n /**\n * Validate that a control can be sent to the service based on the provided\n * display hints.\n *\n * @param {ControlConfig} control - Control to validate.\n * @param {Array<string>} displayHints - All available hints.\n * @returns {boolean} - True if all of the actions are allowed.\n */\n public static canUpdate(control: ControlConfig, displayHints: Array<string>) {\n let determinant: boolean;\n\n switch (control.scope) {\n case Control.audio:\n determinant = Utils.canUpdateAudio(control as ControlConfig<AudioProperties>, displayHints);\n break;\n\n case Control.raiseHand:\n determinant = Utils.canUpdateRaiseHand(\n control as ControlConfig<RaiseHandProperties>,\n displayHints\n );\n break;\n\n case Control.reactions:\n determinant = Utils.canUpdateReactions(\n control as ControlConfig<ReactionsProperties>,\n displayHints\n );\n break;\n\n case Control.shareControl:\n determinant = Utils.canUpdateShareControl(displayHints);\n break;\n\n case Control.video:\n determinant = Utils.canUpdateVideo(control as ControlConfig<VideoProperties>, displayHints);\n break;\n\n case Control.viewTheParticipantList:\n determinant = Utils.canUpdateViewTheParticipantsList(\n control as ControlConfig<ViewTheParticipantListProperties>,\n displayHints\n );\n break;\n\n case Control.annotation:\n determinant = Utils.canUpdateAnnotation(\n control as ControlConfig<AnnotationProperties>,\n displayHints\n );\n break;\n\n case Control.rdc:\n determinant = Utils.canUpdateRemoteDesktopControl(\n control as ControlConfig<RemoteDesktopControlProperties>,\n displayHints\n );\n break;\n\n case Control.pollingQA:\n determinant = Utils.canUpdatePollingQA(\n control as ControlConfig<PollingQAProperties>,\n displayHints\n );\n break;\n\n default:\n determinant = false;\n }\n\n return determinant;\n }\n}\n\nexport default Utils;\n"],"mappings":";;;;;;;;;;AAAA,IAAAA,UAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AAaA;AACA;AACA;AACA;AACA;AAJA,IAKME,KAAK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AAKmE,cAAO,CAACO,UAAU;UACrBT,WAAW,GAAGxE,KAAK,CAAC8D,mBAAmB,CACrC/B,OAAO,EACPxB,YACF,CAAC;UACD;QAEF,KAAKmE,cAAO,CAACQ,GAAG;UACdV,WAAW,GAAGxE,KAAK,CAACiE,6BAA6B,CAC/ClC,OAAO,EACPxB,YACF,CAAC;UACD;QAEF,KAAKmE,cAAO,CAACS,SAAS;UACpBX,WAAW,GAAGxE,KAAK,CAACoE,kBAAkB,CACpCrC,OAAO,EACPxB,YACF,CAAC;UACD;QAEF;UACEiE,WAAW,GAAG,KAAK;MACvB;MAEA,OAAOA,WAAW;IACpB;EAAC;AAAA;AAAA,IAAAY,QAAA,GAAAC,OAAA,CAAAnF,OAAA,GAGYF,KAAK","ignoreList":[]}
@@ -0,0 +1,165 @@
1
+ "use strict";
2
+
3
+ var _Reflect$construct = require("@babel/runtime-corejs2/core-js/reflect/construct");
4
+ var _Object$defineProperty = require("@babel/runtime-corejs2/core-js/object/define-property");
5
+ var _interopRequireDefault = require("@babel/runtime-corejs2/helpers/interopRequireDefault");
6
+ _Object$defineProperty(exports, "__esModule", {
7
+ value: true
8
+ });
9
+ exports.default = exports.LocusInfoUpdateType = void 0;
10
+ exports.isSelf = isSelf;
11
+ var _regenerator = _interopRequireDefault(require("@babel/runtime-corejs2/regenerator"));
12
+ var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/asyncToGenerator"));
13
+ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/defineProperty"));
14
+ var _createClass2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/createClass"));
15
+ var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/classCallCheck"));
16
+ var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/possibleConstructorReturn"));
17
+ var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/getPrototypeOf"));
18
+ var _inherits2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/inherits"));
19
+ var _wrapNativeSuper2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/wrapNativeSuper"));
20
+ var _types = require("./types");
21
+ function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2.default)(o), (0, _possibleConstructorReturn2.default)(t, _isNativeReflectConstruct() ? _Reflect$construct(o, e || [], (0, _getPrototypeOf2.default)(t).constructor) : o.apply(t, e)); }
22
+ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(_Reflect$construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
23
+ var LocusInfoUpdateType = exports.LocusInfoUpdateType = {
24
+ OBJECTS_UPDATED: 'OBJECTS_UPDATED',
25
+ MEETING_ENDED: 'MEETING_ENDED'
26
+ };
27
+ /**
28
+ * This error is thrown if we receive information that the meeting has ended while we're processing some hash messages.
29
+ * It's handled internally by HashTreeParser and results in MEETING_ENDED being sent up.
30
+ */
31
+ var MeetingEndedError = /*#__PURE__*/function (_Error) {
32
+ function MeetingEndedError() {
33
+ (0, _classCallCheck2.default)(this, MeetingEndedError);
34
+ return _callSuper(this, MeetingEndedError, arguments);
35
+ }
36
+ (0, _inherits2.default)(MeetingEndedError, _Error);
37
+ return (0, _createClass2.default)(MeetingEndedError);
38
+ }(/*#__PURE__*/(0, _wrapNativeSuper2.default)(Error));
39
+ /**
40
+ * Checks if the given hash tree object is of type "self"
41
+ * @param {HashTreeObject} object object to check
42
+ * @returns {boolean} True if the object is of type "self", false otherwise
43
+ */
44
+ function isSelf(object) {
45
+ return object.htMeta.elementId.type.toLowerCase() === _types.ObjectType.self;
46
+ }
47
+
48
+ /**
49
+ * Parses hash tree eventing locus data
50
+ */
51
+ var HashTreeParser = /*#__PURE__*/function () {
52
+ /**
53
+ * Constructor for HashTreeParser
54
+ * @param {Object} options
55
+ * @param {Object} options.initialLocus The initial locus data containing the hash tree information
56
+ */
57
+ function HashTreeParser(options) {
58
+ var _locus$self;
59
+ (0, _classCallCheck2.default)(this, HashTreeParser);
60
+ (0, _defineProperty2.default)(this, "dataSets", {});
61
+ (0, _defineProperty2.default)(this, "visibleDataSetsUrl", void 0);
62
+ // url from which we can get info about all data sets
63
+ (0, _defineProperty2.default)(this, "webexRequest", void 0);
64
+ (0, _defineProperty2.default)(this, "locusInfoUpdateCallback", void 0);
65
+ (0, _defineProperty2.default)(this, "visibleDataSets", void 0);
66
+ (0, _defineProperty2.default)(this, "debugId", void 0);
67
+ var locus = options.initialLocus.locus;
68
+ this.debugId = options.debugId;
69
+ this.webexRequest = options.webexRequest;
70
+ this.locusInfoUpdateCallback = options.locusInfoUpdateCallback;
71
+ this.visibleDataSets = (locus === null || locus === void 0 ? void 0 : (_locus$self = locus.self) === null || _locus$self === void 0 ? void 0 : _locus$self.visibleDataSets) || [];
72
+ }
73
+
74
+ /**
75
+ * Initializes the hash tree parser from a message received from Locus.
76
+ *
77
+ * @param {HashTreeMessage} message - initial hash tree message received from Locus
78
+ * @returns {Promise}
79
+ */
80
+ return (0, _createClass2.default)(HashTreeParser, [{
81
+ key: "initializeFromMessage",
82
+ value: (function () {
83
+ var _initializeFromMessage = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee(message) {
84
+ return _regenerator.default.wrap(function (_context) {
85
+ while (1) switch (_context.prev = _context.next) {
86
+ case 0:
87
+ case "end":
88
+ return _context.stop();
89
+ }
90
+ }, _callee);
91
+ }));
92
+ function initializeFromMessage(_x) {
93
+ return _initializeFromMessage.apply(this, arguments);
94
+ }
95
+ return initializeFromMessage;
96
+ }()
97
+ /**
98
+ * Initializes the hash tree parser from GET /loci API response by fetching all data sets metadata
99
+ * first and then doing an initialization sync on each data set
100
+ *
101
+ * This function requires that this.visibleDataSets have been already populated correctly by the constructor.
102
+ *
103
+ * @param {LocusDTO} locus - locus object received from GET /loci
104
+ * @returns {Promise}
105
+ */
106
+ )
107
+ }, {
108
+ key: "initializeFromGetLociResponse",
109
+ value: (function () {
110
+ var _initializeFromGetLociResponse = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee2(locus) {
111
+ return _regenerator.default.wrap(function (_context2) {
112
+ while (1) switch (_context2.prev = _context2.next) {
113
+ case 0:
114
+ case "end":
115
+ return _context2.stop();
116
+ }
117
+ }, _callee2);
118
+ }));
119
+ function initializeFromGetLociResponse(_x2) {
120
+ return _initializeFromGetLociResponse.apply(this, arguments);
121
+ }
122
+ return initializeFromGetLociResponse;
123
+ }()
124
+ /**
125
+ * This method should be called when we receive a partial locus DTO that contains dataSets and htMeta information
126
+ * It updates the hash trees with the new leaf data based on the received Locus
127
+ *
128
+ * @param {Object} update - The locus update containing data sets and locus information
129
+ * @returns {void}
130
+ */
131
+ )
132
+ }, {
133
+ key: "handleLocusUpdate",
134
+ value: function handleLocusUpdate(update) {
135
+ // todo
136
+ }
137
+
138
+ /**
139
+ * Handles incoming hash tree messages, updates the hash trees and calls locusInfoUpdateCallback
140
+ *
141
+ * @param {HashTreeMessage} message - The hash tree message containing data sets and objects to be processed
142
+ * @param {string} [debugText] - Optional debug text to include in logs
143
+ * @returns {void}
144
+ */
145
+ }, {
146
+ key: "handleMessage",
147
+ value: (function () {
148
+ var _handleMessage = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee3(message, debugText) {
149
+ return _regenerator.default.wrap(function (_context3) {
150
+ while (1) switch (_context3.prev = _context3.next) {
151
+ case 0:
152
+ case "end":
153
+ return _context3.stop();
154
+ }
155
+ }, _callee3);
156
+ }));
157
+ function handleMessage(_x3, _x4) {
158
+ return _handleMessage.apply(this, arguments);
159
+ }
160
+ return handleMessage;
161
+ }())
162
+ }]);
163
+ }();
164
+ var _default = exports.default = HashTreeParser;
165
+ //# sourceMappingURL=hashTreeParser.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_types","require","_callSuper","t","o","e","_getPrototypeOf2","default","_possibleConstructorReturn2","_isNativeReflectConstruct","_Reflect$construct","constructor","apply","Boolean","prototype","valueOf","call","LocusInfoUpdateType","exports","OBJECTS_UPDATED","MEETING_ENDED","MeetingEndedError","_Error","_classCallCheck2","arguments","_inherits2","_createClass2","_wrapNativeSuper2","Error","isSelf","object","htMeta","elementId","type","toLowerCase","ObjectType","self","HashTreeParser","options","_locus$self","_defineProperty2","locus","initialLocus","debugId","webexRequest","locusInfoUpdateCallback","visibleDataSets","key","value","_initializeFromMessage","_asyncToGenerator2","_regenerator","mark","_callee","message","wrap","_context","prev","next","stop","initializeFromMessage","_x","_initializeFromGetLociResponse","_callee2","_context2","initializeFromGetLociResponse","_x2","handleLocusUpdate","update","_handleMessage","_callee3","debugText","_context3","handleMessage","_x3","_x4","_default"],"sources":["hashTreeParser.ts"],"sourcesContent":["import {Enum} from '../constants';\nimport {ObjectType, HtMeta} from './types';\nimport {LocusDTO} from '../locus-info/types';\n\nexport interface DataSet {\n url: string;\n root: string;\n version: number;\n leafCount: number;\n name: string;\n idleMs: number;\n backoff: {\n maxMs: number;\n exponent: number;\n };\n}\n\nexport interface HashTreeObject {\n htMeta: HtMeta;\n data: Record<string, any>;\n}\n\nexport interface RootHashMessage {\n dataSets: Array<DataSet>;\n}\nexport interface HashTreeMessage {\n dataSets: Array<DataSet>;\n visibleDataSetsUrl: string; // url from which we can get more info about all data sets - now it seems to be visibleDataSetsUrl\n locusStateElements?: Array<HashTreeObject>;\n locusSessionId?: string;\n locusUrl: string;\n}\n\ninterface InternalDataSet extends DataSet {\n // hashTree?: HashTree; // set only for visible data sets\n timer?: ReturnType<typeof setTimeout>;\n}\n\ntype WebexRequestMethod = (options: Record<string, any>) => Promise<any>;\n\nexport const LocusInfoUpdateType = {\n OBJECTS_UPDATED: 'OBJECTS_UPDATED',\n MEETING_ENDED: 'MEETING_ENDED',\n} as const;\n\nexport type LocusInfoUpdateType = Enum<typeof LocusInfoUpdateType>;\nexport type LocusInfoUpdateCallback = (\n updateType: LocusInfoUpdateType,\n data?: {updatedObjects: HashTreeObject[]}\n) => void;\n\n/**\n * This error is thrown if we receive information that the meeting has ended while we're processing some hash messages.\n * It's handled internally by HashTreeParser and results in MEETING_ENDED being sent up.\n */\nclass MeetingEndedError extends Error {}\n\n/**\n * Checks if the given hash tree object is of type \"self\"\n * @param {HashTreeObject} object object to check\n * @returns {boolean} True if the object is of type \"self\", false otherwise\n */\nexport function isSelf(object: HashTreeObject) {\n return object.htMeta.elementId.type.toLowerCase() === ObjectType.self;\n}\n\n/**\n * Parses hash tree eventing locus data\n */\nclass HashTreeParser {\n dataSets: Record<string, InternalDataSet> = {};\n visibleDataSetsUrl: string; // url from which we can get info about all data sets\n webexRequest: WebexRequestMethod;\n locusInfoUpdateCallback: LocusInfoUpdateCallback;\n visibleDataSets: string[];\n debugId: string;\n\n /**\n * Constructor for HashTreeParser\n * @param {Object} options\n * @param {Object} options.initialLocus The initial locus data containing the hash tree information\n */\n constructor(options: {\n initialLocus: {\n dataSets: Array<DataSet>;\n locus: any;\n };\n webexRequest: WebexRequestMethod;\n locusInfoUpdateCallback: LocusInfoUpdateCallback;\n debugId: string;\n }) {\n const {locus} = options.initialLocus;\n\n this.debugId = options.debugId;\n this.webexRequest = options.webexRequest;\n this.locusInfoUpdateCallback = options.locusInfoUpdateCallback;\n this.visibleDataSets = locus?.self?.visibleDataSets || [];\n }\n\n /**\n * Initializes the hash tree parser from a message received from Locus.\n *\n * @param {HashTreeMessage} message - initial hash tree message received from Locus\n * @returns {Promise}\n */\n async initializeFromMessage(message: HashTreeMessage) {\n // todo\n }\n\n /**\n * Initializes the hash tree parser from GET /loci API response by fetching all data sets metadata\n * first and then doing an initialization sync on each data set\n *\n * This function requires that this.visibleDataSets have been already populated correctly by the constructor.\n *\n * @param {LocusDTO} locus - locus object received from GET /loci\n * @returns {Promise}\n */\n async initializeFromGetLociResponse(locus: LocusDTO) {\n // todo\n }\n\n /**\n * This method should be called when we receive a partial locus DTO that contains dataSets and htMeta information\n * It updates the hash trees with the new leaf data based on the received Locus\n *\n * @param {Object} update - The locus update containing data sets and locus information\n * @returns {void}\n */\n handleLocusUpdate(update: {dataSets?: Array<DataSet>; locus: any}): void {\n // todo\n }\n\n /**\n * Handles incoming hash tree messages, updates the hash trees and calls locusInfoUpdateCallback\n *\n * @param {HashTreeMessage} message - The hash tree message containing data sets and objects to be processed\n * @param {string} [debugText] - Optional debug text to include in logs\n * @returns {void}\n */\n async handleMessage(message: HashTreeMessage, debugText?: string): Promise<void> {\n // todo\n }\n}\n\nexport default HashTreeParser;\n"],"mappings":";;;;;;;;;;;;;;;;;;;AACA,IAAAA,MAAA,GAAAC,OAAA;AAA2C,SAAAC,WAAAC,CAAA,EAAAC,CAAA,EAAAC,CAAA,WAAAD,CAAA,OAAAE,gBAAA,CAAAC,OAAA,EAAAH,CAAA,OAAAI,2BAAA,CAAAD,OAAA,EAAAJ,CAAA,EAAAM,yBAAA,KAAAC,kBAAA,CAAAN,CAAA,EAAAC,CAAA,YAAAC,gBAAA,CAAAC,OAAA,EAAAJ,CAAA,EAAAQ,WAAA,IAAAP,CAAA,CAAAQ,KAAA,CAAAT,CAAA,EAAAE,CAAA;AAAA,SAAAI,0BAAA,cAAAN,CAAA,IAAAU,OAAA,CAAAC,SAAA,CAAAC,OAAA,CAAAC,IAAA,CAAAN,kBAAA,CAAAG,OAAA,iCAAAV,CAAA,aAAAM,yBAAA,YAAAA,0BAAA,aAAAN,CAAA;AAuCpC,IAAMc,mBAAmB,GAAAC,OAAA,CAAAD,mBAAA,GAAG;EACjCE,eAAe,EAAE,iBAAiB;EAClCC,aAAa,EAAE;AACjB,CAAU;AAQV;AACA;AACA;AACA;AAHA,IAIMC,iBAAiB,0BAAAC,MAAA;EAAA,SAAAD,kBAAA;IAAA,IAAAE,gBAAA,CAAAhB,OAAA,QAAAc,iBAAA;IAAA,OAAAnB,UAAA,OAAAmB,iBAAA,EAAAG,SAAA;EAAA;EAAA,IAAAC,UAAA,CAAAlB,OAAA,EAAAc,iBAAA,EAA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AEiB,SAAkB;QAAA,OAAApB,YAAA,CAAA5C,OAAA,CAAAgD,IAAA,WAAAiB,SAAA;UAAA,kBAAAA,SAAA,CAAAf,IAAA,GAAAe,SAAA,CAAAd,IAAA;YAAA;YAAA;cAAA,OAAAc,SAAA,CAAAb,IAAA;UAAA;QAAA,GAAAW,QAAA;MAAA,CAE/D;MAAA,SAFKG,aAAaA,CAAAC,GAAA,EAAAC,GAAA;QAAA,OAAAN,cAAA,CAAAzD,KAAA,OAAAY,SAAA;MAAA;MAAA,OAAbiD,aAAa;IAAA;EAAA;AAAA;AAAA,IAAAG,QAAA,GAAA1D,OAAA,CAAAX,OAAA,GAKN8B,cAAc","ignoreList":[]}
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+
3
+ var _Object$defineProperty = require("@babel/runtime-corejs2/core-js/object/define-property");
4
+ _Object$defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.ObjectType = void 0;
8
+ // todo: Locus docs have now more types like CONTROL_ENTRY, EMBEDDED_APP, FULL_STATE, INFO, MEDIA_SHARE - need to add support for them once Locus implements them
9
+ var ObjectType = exports.ObjectType = {
10
+ participant: 'participant',
11
+ self: 'self',
12
+ locus: 'locus',
13
+ mediaShare: 'mediashare'
14
+ };
15
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["ObjectType","exports","participant","self","locus","mediaShare"],"sources":["types.ts"],"sourcesContent":["import {Enum} from '../constants';\n\n// todo: Locus docs have now more types like CONTROL_ENTRY, EMBEDDED_APP, FULL_STATE, INFO, MEDIA_SHARE - need to add support for them once Locus implements them\nexport const ObjectType = {\n participant: 'participant',\n self: 'self',\n locus: 'locus',\n mediaShare: 'mediashare',\n} as const;\n\nexport type ObjectType = Enum<typeof ObjectType>;\n\nexport interface HtMeta {\n elementId: {\n type: ObjectType;\n id: number;\n version: number;\n };\n dataSetNames: string[];\n}\n"],"mappings":";;;;;;;AAEA;AACO,IAAMA,UAAU,GAAAC,OAAA,CAAAD,UAAA,GAAG;EACxBE,WAAW,EAAE,aAAa;EAC1BC,IAAI,EAAE,MAAM;EACZC,KAAK,EAAE,OAAO;EACdC,UAAU,EAAE;AACd,CAAU","ignoreList":[]}
package/dist/index.js CHANGED
@@ -161,6 +161,12 @@ _Object$defineProperty(exports, "RemoteStreamEventNames", {
161
161
  return _mediaHelpers.RemoteStreamEventNames;
162
162
  }
163
163
  });
164
+ _Object$defineProperty(exports, "SdpResponseTimeoutError", {
165
+ enumerable: true,
166
+ get: function get() {
167
+ return _webexErrors.SdpResponseTimeoutError;
168
+ }
169
+ });
164
170
  _Object$defineProperty(exports, "StreamEventNames", {
165
171
  enumerable: true,
166
172
  get: function get() {
@@ -223,6 +229,7 @@ var _reclaimHostRoleErrors = require("./common/errors/reclaim-host-role-errors")
223
229
  var _meeting = _interopRequireDefault(require("./meeting"));
224
230
  var _utilv = _interopRequireDefault(require("./meeting-info/utilv2"));
225
231
  var _joinMeeting = _interopRequireDefault(require("./common/errors/join-meeting"));
232
+ var _webexErrors = require("./common/errors/webex-errors");
226
233
  var _mediaHelpers = require("@webex/media-helpers");
227
234
  var _CONSTANTS = _interopRequireWildcard(require("./constants"));
228
235
  exports.CONSTANTS = _CONSTANTS;
@@ -234,8 +241,7 @@ var _MeetingInfoV = _interopRequireWildcard(require("./meeting-info/meeting-info
234
241
  exports.MeetingInfoV2 = _MeetingInfoV;
235
242
  var _remoteMedia = require("./multistream/remoteMedia");
236
243
  var _triggerProxy = _interopRequireDefault(require("./common/events/trigger-proxy"));
237
- function _getRequireWildcardCache(e) { if ("function" != typeof _WeakMap) return null; var r = new _WeakMap(), t = new _WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
238
- function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = _Object$defineProperty && _Object$getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? _Object$getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? _Object$defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
244
+ function _interopRequireWildcard(e, t) { if ("function" == typeof _WeakMap) var r = new _WeakMap(), n = new _WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = _Object$defineProperty) && _Object$getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
239
245
  /* eslint-env browser */
240
246
 
241
247
  (0, _webexCore.registerPlugin)('meetings', _meetings.default, {
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"names":["_webexCore","require","_meetings","_interopRequireDefault","_config","_interceptors","_captchaError","_intentToJoin","_passwordError","_permission","_joinWebinarError","_reclaimHostRoleErrors","_meeting","_utilv","_joinMeeting","_mediaHelpers","_CONSTANTS","_interopRequireWildcard","exports","CONSTANTS","_REACTIONS","REACTIONS","_sdkAnnotationTypes","sdkAnnotationTypes","_MeetingInfoV","MeetingInfoV2","_remoteMedia","_triggerProxy","_getRequireWildcardCache","e","_WeakMap","r","t","__esModule","_typeof","default","has","get","n","__proto__","a","_Object$defineProperty","_Object$getOwnPropertyDescriptor","u","Object","prototype","hasOwnProperty","call","i","set","registerPlugin","Meetings","config","interceptors","LocusRetryStatusInterceptor","create","LocusRouteTokenInterceptor","_default"],"sources":["index.ts"],"sourcesContent":["/* eslint-env browser */\nimport {registerPlugin} from '@webex/webex-core';\n\nimport Meetings from './meetings';\nimport config from './config';\nimport {LocusRetryStatusInterceptor, LocusRouteTokenInterceptor} from './interceptors';\nimport CaptchaError from './common/errors/captcha-error';\nimport IntentToJoinError from './common/errors/intent-to-join';\nimport PasswordError from './common/errors/password-error';\nimport PermissionError from './common/errors/permission';\nimport JoinWebinarError from './common/errors/join-webinar-error';\nimport {\n ReclaimHostEmptyWrongKeyError,\n ReclaimHostIsHostAlreadyError,\n ReclaimHostNotAllowedError,\n ReclaimHostNotSupportedError,\n} from './common/errors/reclaim-host-role-errors';\nimport Meeting from './meeting';\nimport MeetingInfoUtil from './meeting-info/utilv2';\nimport JoinMeetingError from './common/errors/join-meeting';\n\nregisterPlugin('meetings', Meetings, {\n config,\n interceptors: {\n LocusRetryStatusInterceptor: LocusRetryStatusInterceptor.create,\n LocusRouteTokenInterceptor: LocusRouteTokenInterceptor.create,\n },\n});\n\nexport {\n LocalStream,\n LocalDisplayStream,\n LocalSystemAudioStream,\n LocalStreamEventNames,\n StreamEventNames,\n RemoteStreamEventNames,\n type ServerMuteReason,\n LocalMicrophoneStreamEventNames,\n LocalCameraStreamEventNames,\n LocalMicrophoneStream,\n LocalCameraStream,\n createMicrophoneStream,\n createCameraStream,\n createCameraAndMicrophoneStreams,\n createDisplayStream,\n createDisplayStreamWithAudio,\n createDisplayMedia,\n FacingMode,\n DisplaySurface,\n PresetCameraConstraints,\n type VideoContentHint,\n type StreamState,\n} from '@webex/media-helpers';\n\nexport default Meetings;\n\nexport * as CONSTANTS from './constants';\nexport * as REACTIONS from './reactions/reactions';\nexport * as sdkAnnotationTypes from './annotation/annotation.types';\nexport * as MeetingInfoV2 from './meeting-info/meeting-info-v2';\nexport {type Reaction} from './reactions/reactions.type';\n\nexport {\n CaptchaError,\n IntentToJoinError,\n JoinMeetingError,\n PasswordError,\n PermissionError,\n ReclaimHostIsHostAlreadyError,\n ReclaimHostNotAllowedError,\n ReclaimHostNotSupportedError,\n ReclaimHostEmptyWrongKeyError,\n Meeting,\n MeetingInfoUtil,\n JoinWebinarError,\n};\n\nexport {R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AAC,UAAU,EAAEC,iBAAQ,EAAE;EACnCC,MAAM,EAANA,eAAM;EACNC,YAAY,EAAE;IACZC,2BAA2B,EAAEA,yCAA2B,CAACC,MAAM;IAC/DC,0BAA0B,EAAEA,wCAA0B,CAACD;EACzD;AACF,CAAC,CAAC;AAAC,IAAAE,QAAA,GAAAvC,OAAA,CAAAiB,OAAA,GA2BYgB,iBAAQ"}
1
+ {"version":3,"names":["_webexCore","require","_meetings","_interopRequireDefault","_config","_interceptors","_captchaError","_intentToJoin","_passwordError","_permission","_joinWebinarError","_reclaimHostRoleErrors","_meeting","_utilv","_joinMeeting","_webexErrors","_mediaHelpers","_CONSTANTS","_interopRequireWildcard","exports","CONSTANTS","_REACTIONS","REACTIONS","_sdkAnnotationTypes","sdkAnnotationTypes","_MeetingInfoV","MeetingInfoV2","_remoteMedia","_triggerProxy","e","t","_WeakMap","r","n","__esModule","o","i","f","__proto__","default","_typeof","has","get","set","_t","hasOwnProperty","call","_Object$defineProperty","_Object$getOwnPropertyDescriptor","registerPlugin","Meetings","config","interceptors","LocusRetryStatusInterceptor","create","LocusRouteTokenInterceptor","_default"],"sources":["index.ts"],"sourcesContent":["/* eslint-env browser */\nimport {registerPlugin} from '@webex/webex-core';\n\nimport Meetings from './meetings';\nimport config from './config';\nimport {LocusRetryStatusInterceptor, LocusRouteTokenInterceptor} from './interceptors';\nimport CaptchaError from './common/errors/captcha-error';\nimport IntentToJoinError from './common/errors/intent-to-join';\nimport PasswordError from './common/errors/password-error';\nimport PermissionError from './common/errors/permission';\nimport JoinWebinarError from './common/errors/join-webinar-error';\nimport {\n ReclaimHostEmptyWrongKeyError,\n ReclaimHostIsHostAlreadyError,\n ReclaimHostNotAllowedError,\n ReclaimHostNotSupportedError,\n} from './common/errors/reclaim-host-role-errors';\nimport Meeting from './meeting';\nimport MeetingInfoUtil from './meeting-info/utilv2';\nimport JoinMeetingError from './common/errors/join-meeting';\nimport {SdpResponseTimeoutError} from './common/errors/webex-errors';\n\nregisterPlugin('meetings', Meetings, {\n config,\n interceptors: {\n LocusRetryStatusInterceptor: LocusRetryStatusInterceptor.create,\n LocusRouteTokenInterceptor: LocusRouteTokenInterceptor.create,\n },\n});\n\nexport {\n LocalStream,\n LocalDisplayStream,\n LocalSystemAudioStream,\n LocalStreamEventNames,\n StreamEventNames,\n RemoteStreamEventNames,\n type ServerMuteReason,\n LocalMicrophoneStreamEventNames,\n LocalCameraStreamEventNames,\n LocalMicrophoneStream,\n LocalCameraStream,\n createMicrophoneStream,\n createCameraStream,\n createCameraAndMicrophoneStreams,\n createDisplayStream,\n createDisplayStreamWithAudio,\n createDisplayMedia,\n FacingMode,\n DisplaySurface,\n PresetCameraConstraints,\n type VideoContentHint,\n type StreamState,\n} from '@webex/media-helpers';\n\nexport default Meetings;\n\nexport * as CONSTANTS from './constants';\nexport * as REACTIONS from './reactions/reactions';\nexport * as sdkAnnotationTypes from './annotation/annotation.types';\nexport * as MeetingInfoV2 from './meeting-info/meeting-info-v2';\nexport {type Reaction} from './reactions/reactions.type';\n\nexport {\n CaptchaError,\n IntentToJoinError,\n JoinMeetingError,\n PasswordError,\n PermissionError,\n ReclaimHostIsHostAlreadyError,\n ReclaimHostNotAllowedError,\n ReclaimHostNotSupportedError,\n ReclaimHostEmptyWrongKeyError,\n Meeting,\n MeetingInfoUtil,\n JoinWebinarError,\n SdpResponseTimeoutError,\n};\n\nexport {RemoteMedia} from './multistream/remoteMedia';\n\nexport {default as TriggerProxy} from './common/events/trigger-proxy';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,IAAAA,UAAA,GAAAC,OAAA;AAEA,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A,CAAAK,UAAA,SAAAL,CAAA,MAAAM,CAAA,EAAAC,CAAA,EAAAC,CAAA,KAAAC,SAAA,QAAAC,OAAA,EAAAV,CAAA,iBAAAA,CAAA,gBAAAW,OAAA,CAAAX,CAAA,0BAAAA,CAAA,SAAAQ,CAAA,MAAAF,CAAA,GAAAL,CAAA,GAAAG,CAAA,GAAAD,CAAA,QAAAG,CAAA,CAAAM,GAAA,CAAAZ,CAAA,UAAAM,CAAA,CAAAO,GAAA,CAAAb,CAAA,GAAAM,CAAA,CAAAQ,GAAA,CAAAd,CAAA,EAAAQ,CAAA,cAAAO,EAAA,IAAAf,CAAA,gBAAAe,EAAA,OAAAC,cAAA,CAAAC,IAAA,CAAAjB,CAAA,EAAAe,EAAA,OAAAR,CAAA,IAAAD,CAAA,GAAAY,sBAAA,KAAAC,gCAAA,CAAAnB,CAAA,EAAAe,EAAA,OAAAR,CAAA,CAAAM,GAAA,IAAAN,CAAA,CAAAO,GAAA,IAAAR,CAAA,CAAAE,CAAA,EAAAO,EAAA,EAAAR,CAAA,IAAAC,CAAA,CAAAO,EAAA,IAAAf,CAAA,CAAAe,EAAA,WAAAP,CAAA,KAAAR,CAAA,EAAAC,CAAA;AAjFtE;;AAsBA,IAAAmB,yBAAc,EAAC,UAAU,EAAEC,iBAAQ,EAAE;EACnCC,MAAM,EAANA,eAAM;EACNC,YAAY,EAAE;IACZC,2BAA2B,EAAEA,yCAA2B,CAACC,MAAM;IAC/DC,0BAA0B,EAAEA,wCAA0B,CAACD;EACzD;AACF,CAAC,CAAC;AAAC,IAAAE,QAAA,GAAArC,OAAA,CAAAoB,OAAA,GA2BYW,iBAAQ","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["_locusRetry","_interopRequireDefault","require","_locusRouteToken"],"sources":["index.ts"],"sourcesContent":["import LocusRetryStatusInterceptor from './locusRetry';\nimport LocusRouteTokenInterceptor from './locusRouteToken';\n\nexport {LocusRetryStatusInterceptor, LocusRouteTokenInterceptor};\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA,IAAAA,WAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,gBAAA,GAAAF,sBAAA,CAAAC,OAAA"}
1
+ {"version":3,"names":["_locusRetry","_interopRequireDefault","require","_locusRouteToken"],"sources":["index.ts"],"sourcesContent":["import LocusRetryStatusInterceptor from './locusRetry';\nimport LocusRouteTokenInterceptor from './locusRouteToken';\n\nexport {LocusRetryStatusInterceptor, LocusRouteTokenInterceptor};\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA,IAAAA,WAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,gBAAA,GAAAF,sBAAA,CAAAC,OAAA","ignoreList":[]}
@@ -9,14 +9,14 @@ _Object$defineProperty(exports, "__esModule", {
9
9
  exports.default = void 0;
10
10
  var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/classCallCheck"));
11
11
  var _createClass2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/createClass"));
12
- var _inherits2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/inherits"));
13
12
  var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/possibleConstructorReturn"));
14
13
  var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/getPrototypeOf"));
14
+ var _inherits2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/inherits"));
15
15
  var _weakMap = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/weak-map"));
16
16
  var _promise = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/promise"));
17
17
  var _httpCore = require("@webex/http-core");
18
- function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = _Reflect$construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
19
- function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !_Reflect$construct) return false; if (_Reflect$construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(_Reflect$construct(Boolean, [], function () {})); return true; } catch (e) { return false; } } /*!
18
+ function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2.default)(o), (0, _possibleConstructorReturn2.default)(t, _isNativeReflectConstruct() ? _Reflect$construct(o, e || [], (0, _getPrototypeOf2.default)(t).constructor) : o.apply(t, e)); }
19
+ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(_Reflect$construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } /*!
20
20
  * Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.
21
21
  */
22
22
  var rateLimitExpiryTime = new _weakMap.default();
@@ -24,13 +24,12 @@ var rateLimitExpiryTime = new _weakMap.default();
24
24
  * @class
25
25
  */
26
26
  var LocusRetryStatusInterceptor = exports.default = /*#__PURE__*/function (_Interceptor) {
27
- (0, _inherits2.default)(LocusRetryStatusInterceptor, _Interceptor);
28
- var _super = _createSuper(LocusRetryStatusInterceptor);
29
27
  function LocusRetryStatusInterceptor() {
30
28
  (0, _classCallCheck2.default)(this, LocusRetryStatusInterceptor);
31
- return _super.apply(this, arguments);
29
+ return _callSuper(this, LocusRetryStatusInterceptor, arguments);
32
30
  }
33
- (0, _createClass2.default)(LocusRetryStatusInterceptor, [{
31
+ (0, _inherits2.default)(LocusRetryStatusInterceptor, _Interceptor);
32
+ return (0, _createClass2.default)(LocusRetryStatusInterceptor, [{
34
33
  key: "onResponseError",
35
34
  value:
36
35
  /**
@@ -89,6 +88,5 @@ var LocusRetryStatusInterceptor = exports.default = /*#__PURE__*/function (_Inte
89
88
  });
90
89
  }
91
90
  }]);
92
- return LocusRetryStatusInterceptor;
93
91
  }(_httpCore.Interceptor);
94
92
  //# sourceMappingURL=locusRetry.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_httpCore","require","_createSuper","Derived","hasNativeReflectConstruct","_isNativeReflectConstruct","_createSuperInternal","Super","_getPrototypeOf2","default","result","NewTarget","constructor","_Reflect$construct","arguments","apply","_possibleConstructorReturn2","Reflect","sham","Proxy","Boolean","prototype","valueOf","call","e","rateLimitExpiryTime","_weakMap","LocusRetryStatusInterceptor","exports","_Interceptor","_inherits2","_super","_classCallCheck2","_createClass2","key","value","onResponseError","options","reason","statusCode","uri","includes","hasRetriedLocusRequest","get","retryAfterTime","headers","set","_promise","reject","handleRetryRequestLocusServiceError","_this","resolve","timeout","setTimeout","clearTimeout","webex","request","method","body","then","catch","create","Interceptor"],"sources":["locusRetry.ts"],"sourcesContent":["/*!\n * Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.\n */\n\nimport {Interceptor} from '@webex/http-core';\n\nconst rateLimitExpiryTime = new WeakMap();\n/**\n * @class\n */\nexport default class LocusRetryStatusInterceptor extends Interceptor {\n /**\n * @returns {LocusRetryStatusInterceptor}\n */\n static create() {\n // @ts-ignore\n return new LocusRetryStatusInterceptor({webex: this});\n }\n\n /**\n * Handle response errors\n * @param {Object} options\n * @param {WebexHttpError} reason\n * @returns {Promise<WebexHttpError>}\n */\n onResponseError(options, reason) {\n if ((reason.statusCode === 503 || reason.statusCode === 429) && options.uri.includes('locus')) {\n const hasRetriedLocusRequest = rateLimitExpiryTime.get(this);\n const retryAfterTime = options.headers['retry-after'] || 2000;\n\n if (hasRetriedLocusRequest) {\n rateLimitExpiryTime.set(this, false);\n\n return Promise.reject(options);\n }\n rateLimitExpiryTime.set(this, true);\n\n return this.handleRetryRequestLocusServiceError(options, retryAfterTime);\n }\n\n return Promise.reject(reason);\n }\n\n /**\n * Handle retries for locus service unavailable errors\n * @param {Object} options associated with the request\n * @param {number} retryAfterTime retry after time in milliseconds\n * @returns {Promise}\n */\n handleRetryRequestLocusServiceError(options, retryAfterTime) {\n return new Promise((resolve, reject) => {\n const timeout = setTimeout(() => {\n clearTimeout(timeout);\n\n // @ts-ignore\n this.webex\n .request({\n method: options.method,\n uri: options.uri,\n body: options.body,\n })\n .then(resolve)\n .catch(reject);\n }, retryAfterTime);\n });\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAIA,IAAAA,SAAA,GAAAC,OAAA;AAA6C,SAAAC,aAAAC,OAAA,QAAAC,yBAAA,GAAAC,yBAAA,oBAAAC,qBAAA,QAAAC,KAAA,OAAAC,gBAAA,CAAAC,OAAA,EAAAN,OAAA,GAAAO,MAAA,MAAAN,yBAAA,QAAAO,SAAA,OAAAH,gBAAA,CAAAC,OAAA,QAAAG,WAAA,EAAAF,MAAA,GAAAG,kBAAA,CAAAN,KAAA,EAAAO,SAAA,EAAAH,SAAA,YAAAD,MAAA,GAAAH,KAAA,CAAAQ,KAAA,OAAAD,SAAA,gBAAAE,2BAAA,CAAAP,OAAA,QAAAC,MAAA;AAAA,SAAAL,0BAAA,eAAAY,OAAA,qBAAAJ,kBAAA,oBAAAA,kBAAA,CAAAK,IAAA,2BAAAC,KAAA,oCAAAC,OAAA,CAAAC,SAAA,CAAAC,OAAA,CAAAC,IAAA,CAAAV,kBAAA,CAAAO,OAAA,8CAAAI,CAAA,sBAJ7C;AACA;AACA;AAIA,IAAMC,mBAAmB,GAAG,IAAAC,QAAA,CAAAjB,OAAA,CAAY,CAAC;AACzC;AACA;AACA;AAFA,IAGqBkB,2BAA2B,GAAAC,OAAA,CAAAnB,OAAA,0BAAAoB,YAAA;EAAA,IAAAC,UAAA,CAAArB,OAAA,EAAAkB,2BAAA,EAAAE,YAAA;EAAA,IAAAE,MAAA,GAAA7B,YAAA,CAAAyB,2BAAA;EAAA,SAAAA,4BAAA;IAAA,IAAAK,gBAAA,CAAAvB,OAAA,QAAAkB,2BAAA;IAAA,OAAAI,MAAA,CAAAhB,KAAA,OAAAD,SAAA;EAAA;EAAA,IAAAmB,aAAA,CAAAxB,OAAA,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CAACqB;UAChB,CAAC,CAAC,CACDC,IAAI,CAACR,OAAO,CAAC,CACbS,KAAK,CAACZ,MAAM,CAAC;QAClB,CAAC,EAAEJ,cAAc,CAAC;MACpB,CAAC,CAAC;IACJ;EAAC;IAAAV,GAAA;IAAAC,KAAA;IAtDD;AACF;AACA;IACE,SAAA0B,OAAA,EAAgB;MACd;MACA,OAAO,IAAIlC,2BAA2B,CAAC;QAAC4B,KAAK,EAAE;MAAI,CAAC,CAAC;IACvD;EAAC;EAAA,OAAA5B,2BAAA;AAAA,EAPsDmC,qBAAW"}
1
+ {"version":3,"names":["_httpCore","require","_callSuper","t","o","e","_getPrototypeOf2","default","_possibleConstructorReturn2","_isNativeReflectConstruct","_Reflect$construct","constructor","apply","Boolean","prototype","valueOf","call","rateLimitExpiryTime","_weakMap","LocusRetryStatusInterceptor","exports","_Interceptor","_classCallCheck2","arguments","_inherits2","_createClass2","key","value","onResponseError","options","reason","statusCode","uri","includes","hasRetriedLocusRequest","get","retryAfterTime","headers","set","_promise","reject","handleRetryRequestLocusServiceError","_this","resolve","timeout","setTimeout","clearTimeout","webex","request","method","body","then","catch","create","Interceptor"],"sources":["locusRetry.ts"],"sourcesContent":["/*!\n * Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.\n */\n\nimport {Interceptor} from '@webex/http-core';\n\nconst rateLimitExpiryTime = new WeakMap();\n/**\n * @class\n */\nexport default class LocusRetryStatusInterceptor extends Interceptor {\n /**\n * @returns {LocusRetryStatusInterceptor}\n */\n static create() {\n // @ts-ignore\n return new LocusRetryStatusInterceptor({webex: this});\n }\n\n /**\n * Handle response errors\n * @param {Object} options\n * @param {WebexHttpError} reason\n * @returns {Promise<WebexHttpError>}\n */\n onResponseError(options, reason) {\n if ((reason.statusCode === 503 || reason.statusCode === 429) && options.uri.includes('locus')) {\n const hasRetriedLocusRequest = rateLimitExpiryTime.get(this);\n const retryAfterTime = options.headers['retry-after'] || 2000;\n\n if (hasRetriedLocusRequest) {\n rateLimitExpiryTime.set(this, false);\n\n return Promise.reject(options);\n }\n rateLimitExpiryTime.set(this, true);\n\n return this.handleRetryRequestLocusServiceError(options, retryAfterTime);\n }\n\n return Promise.reject(reason);\n }\n\n /**\n * Handle retries for locus service unavailable errors\n * @param {Object} options associated with the request\n * @param {number} retryAfterTime retry after time in milliseconds\n * @returns {Promise}\n */\n handleRetryRequestLocusServiceError(options, retryAfterTime) {\n return new Promise((resolve, reject) => {\n const timeout = setTimeout(() => {\n clearTimeout(timeout);\n\n // @ts-ignore\n this.webex\n .request({\n method: options.method,\n uri: options.uri,\n body: options.body,\n })\n .then(resolve)\n .catch(reject);\n }, retryAfterTime);\n });\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAIA,IAAAA,SAAA,GAAAC,OAAA;AAA6C,SAAAC,WAAAC,CAAA,EAAAC,CAAA,EAAAC,CAAA,WAAAD,CAAA,OAAAE,gBAAA,CAAAC,OAAA,EAAAH,CAAA,OAAAI,2BAAA,CAAAD,OAAA,EAAAJ,CAAA,EAAAM,yBAAA,KAAAC,kBAAA,CAAAN,CAAA,EAAAC,CAAA,YAAAC,gBAAA,CAAAC,OAAA,EAAAJ,CAAA,EAAAQ,WAAA,IAAAP,CAAA,CAAAQ,KAAA,CAAAT,CAAA,EAAAE,CAAA;AAAA,SAAAI,0BAAA,cAAAN,CAAA,IAAAU,OAAA,CAAAC,SAAA,CAAAC,OAAA,CAAAC,IAAA,CAAAN,kBAAA,CAAAG,OAAA,iCAAAV,CAAA,aAAAM,yBAAA,YAAAA,0BAAA,aAAAN,CAAA,UAJ7C;AACA;AACA;AAIA,IAAMc,mBAAmB,GAAG,IAAAC,QAAA,CAAAX,OAAA,CAAY,CAAC;AACzC;AACA;AACA;AAFA,IAGqBY,2BAA2B,GAAAC,OAAA,CAAAb,OAAA,0BAAAc,YAAA;EAAA,SAAAF,4BAAA;IAAA,IAAAG,gBAAA,CAAAf,OAAA,QAAAY,2BAAA;IAAA,OAAAjB,UAAA,OAAAiB,2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